-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adds .gitignore (in config dir and symlink to it) - adds config dir for shared configuration - creates config/eslint.config.js with placeholder info - adds version bump script - adds github job for publishing
- Loading branch information
1 parent
67faa79
commit c18c039
Showing
7 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: Publish to NPM | ||
|
||
on: | ||
push: | ||
branches: [ "main", "publish-test" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js (22.x) | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22.x | ||
registry-url: https://registry.npmjs.org/ | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: npm test --if-present | ||
- run: npm run bump --if-present | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// eslint.config.js | ||
module.exports = [ | ||
{ | ||
rules: { | ||
semi: "error", | ||
"prefer-const": "error" | ||
} | ||
} | ||
]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env node | ||
|
||
const { execSync } = require('node:child_process'); | ||
const { parseHeader } = require('parse-commit-message'); | ||
|
||
const latestCommitMessage = execSync("git log -1 --pretty=%B"); | ||
const { type, scope } = parseHeader(latestCommitMessage); | ||
|
||
let flag; | ||
if (scope === 'patch' || ['fix', 'chore', 'docs', 'refactor', 'perf', 'test', 'build'].includes(type)) { | ||
flag = '--patch'; | ||
} else if (scope === 'minor' || ['feat', 'feature'].includes(type)) { | ||
flag = '--minor'; | ||
} else if (scope === 'major') { | ||
flag = '--major'; | ||
} else { | ||
flag = '--patch'; | ||
} | ||
|
||
execSync(`npm version ${flag}`); | ||
execSync("git add package.json"); | ||
execSync("git commit --amend --no-edit"); | ||
execSync("git push --force"); |