Skip to content

Commit 6c6bee3

Browse files
chore: husky and initial publish setup
1 parent 19b640a commit 6c6bee3

File tree

8 files changed

+3706
-39
lines changed

8 files changed

+3706
-39
lines changed

.commitlintrc.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
extends: ["@commitlint/config-conventional"]
3+
};

.github/workflows/publish.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '20'
20+
cache: 'yarn'
21+
22+
- name: Install dependencies
23+
run: yarn install
24+
25+
- name: Automate versioning and changelog
26+
id: version
27+
uses: actions-ecosystem/action-update-semver@v2
28+
with:
29+
update_type: auto # Options: major, minor, patch, or auto
30+
31+
- name: Set Yarn version
32+
run: yarn version --new-version ${{ steps.version.outputs.new_version }} --no-git-tag-version
33+
34+
- name: Publish to NPM
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
run: yarn publish --non-interactive
38+
39+
- name: Push changes back to repo
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
git add package.json yarn.lock
44+
git commit -m "chore(release): publish ${{ steps.version.outputs.new_version }}"
45+
git tag v${{ steps.version.outputs.new_version }}
46+
git push --follow-tags

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn commitlint --edit

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm test

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
<!-- [![Build Status: Linux](https://travis-ci.com/sindresorhus/got.svg?branch=master)](https://travis-ci.com/github/sindresorhus/got) -->
2-
<!-- [![Downloads](https://img.shields.io/npm/dm/got.svg)](https://npmjs.com/got) -->
3-
<!-- [![Install size](https://packagephobia.now.sh/badge?p=got)](https://packagephobia.now.sh/result?p=got) -->
4-
51
<div align=center> <img src='./images/nopalm.png' width="50%" height="50%"> </div>
62

73
> Manage your node projects from user interface
4+
[![Downloads](https://img.shields.io/npm/dm/nopalm.svg)](https://npmjs.com/nopalm)
5+
[![Install size](https://packagephobia.now.sh/badge?p=nopalm)](https://packagephobia.now.sh/result?nopalm)
6+
87

98
## RATIONALE
109

package.json

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "nopalm",
3-
"version": "1.0.8",
43
"description": "One stop graphical solution to create and manage your local Node.Js projects end to end.",
54
"main": "lib/index.js",
65
"bin": {
@@ -16,7 +15,14 @@
1615
"winston": "^3.12.0"
1716
},
1817
"devDependencies": {
19-
"nodemon": "^2.0.4"
18+
"@commitlint/cli": "^19.7.1",
19+
"@commitlint/config-conventional": "^19.7.1",
20+
"@semantic-release/changelog": "^6.0.3",
21+
"@semantic-release/git": "^10.0.1",
22+
"@semantic-release/npm": "^12.0.1",
23+
"husky": "^8.0.0",
24+
"nodemon": "^2.0.4",
25+
"semantic-release": "^24.2.2"
2026
},
2127
"keywords": [
2228
"node",
@@ -46,10 +52,11 @@
4652
"local-development"
4753
],
4854
"scripts": {
49-
"test": "echo \"Error: no test specified\" && exit 1",
55+
"test": "echo \"No tests for now\"",
5056
"copy-build": "cp -ar client/dist/. public/",
5157
"build": "rm -rf build/ && cd client/ && yarn build && cd .. && yarn copy-build",
52-
"postinstall": "node ./lib/scripts/addon --methodToExecute='createCopiedAddonFolder'"
58+
"postinstall": "node ./lib/scripts/addon --methodToExecute='createCopiedAddonFolder'",
59+
"prepare": "husky install"
5360
},
5461
"repository": {
5562
"type": "git",
@@ -68,7 +75,6 @@
6875
"lib",
6976
"public",
7077
"images",
71-
"addon",
72-
"node_modules"
78+
"addon"
7379
]
7480
}

release.config.mjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
branches: ["main"],
3+
plugins: [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
[
9+
"@semantic-release/git",
10+
{
11+
assets: ["package.json", "yarn.lock", "CHANGELOG.md"],
12+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
13+
}
14+
]
15+
]
16+
};

0 commit comments

Comments
 (0)