Skip to content

Commit

Permalink
feat: 🔨 add in husky, changeset, github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Newton <[email protected]>
  • Loading branch information
iamnewton committed Oct 16, 2024
1 parent f9110a5 commit 53b7e39
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
8 changes: 8 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": ["@changesets/changelog-github", {"repo": "theholocron/configs"}],
"commit": false,
"updateInternalDependencies": "patch"
}
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Version, Release, & Publish"

on:
push:
branches: ["main"]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
permissions:
contents: write # to create release
issues: write # to post issue comments
pull-requests: write # to create pull request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Publish to NPM
uses: changesets/action@v1
with:
title: "chore(release): 🦋 version packages"
commit: "chore(release): 🦋 version packages"
version: npx changeset version
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged --config @theholocron/lint-staged-config
18 changes: 18 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

NAME=$(git config user.name)
EMAIL=$(git config user.email)

if [ -z "$NAME" ]; then
echo "empty git config user.name"
exit 1
fi

if [ -z "$EMAIL" ]; then
echo "empty git config user.email"
exit 1
fi

git interpret-trailers --if-exists doNothing --trailer \
"Signed-off-by: $NAME <$EMAIL>" \
--in-place "$1"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Installation

```bash
npm install --save-dev @theholocron/<lib>
npm install --save-dev @theholocron/<name>
```

## Usage
Expand Down
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@theholocron/<name>",
"description": "<description>",
"homepage": "https://github.com/theholocron/<name>#readme",
"author": "Newton Koumantzelis",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "git+https://github.com/theholocron/<name>.git"
},
"bugs": "https://github.com/theholocron/<name>/issues",
"releases": "https://github.com/theholocron/<name>/releases",
"wiki": "https://github.com/theholocron/<name>/wiki",
"license": "GPL-3.0",
"packageManager": "[email protected]",
"commitlint": {
"extends": "@theholocron"
},
"eslintConfig": {
"extends": "@theholocron"
},
"jest": {
"displayName": "<name>",
"preset": "@theholocron/jest-config"
},
"publishConfig": {
"access": "public"
},
"prettier": "@theholocron/prettier-config",
"scripts": {
"build": "tsc --noEmit",
"lint": "eslint --ignore-path .gitignore '**/*.{js,jsx,ts,tsx}'",
"release": "changeset",
"start": "",
"test": "jest"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@theholocron/commitlint-config": "^2.0.0",
"@theholocron/eslint-config": "^2.0.0",
"@theholocron/jest-config": "^2.0.0",
"@theholocron/lint-staged-config": "^2.0.0",
"@theholocron/prettier-config": "^2.0.0",
"@theholocron/tsconfig": "^2.0.0"
}
}
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@theholcron/tsconfig/node-next/tsconfig.json"
}

0 comments on commit 53b7e39

Please sign in to comment.