@vacantthinker/firefox-addon-framework-easy-nodejs 2026.5.2203 → 2026.522.1749

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main #
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+ - uses: actions/setup-node@v6
17
+ with:
18
+ node-version: 24
19
+ - run: npm ci
20
+
21
+ publish-npm:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ contents: read
26
+ id-token: write
27
+ steps:
28
+ - uses: actions/checkout@v6
29
+ - uses: actions/setup-node@v6
30
+ with:
31
+ node-version: 24
32
+ registry-url: https://registry.npmjs.org/
33
+ - run: npm ci
34
+ - run: npm publish --provenance --access public
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy-nodejs",
3
- "version": "2026.5.2203",
3
+ "version": "2026.0522.1749",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
7
- "access": "public"
7
+ "access": "public",
8
+ "provenance": true
8
9
  },
9
10
  "scripts": {
10
- "git_acp": "git add . && git commit -m 'update __dirname to process.cwd()' && git push",
11
- "npm_publish": "npm publish"
11
+ "git_acp": "git add . && git commit -m 'add github workflow npm-publish.ym; add publish.sh' && git push"
12
12
  },
13
13
  "dependencies": {
14
14
  "@types/node": "^22.18.0",
15
15
  "archiver": "^7.0.1",
16
- "copy-webpack-plugin": "^13.0.1",
17
- "html-minimizer-webpack-plugin": "^5.0.3",
16
+ "copy-webpack-plugin": "^14.0.0",
17
+ "html-minimizer-webpack-plugin": "^6.0.0",
18
18
  "json-minimizer-webpack-plugin": "^5.0.1",
19
19
  "terser-webpack-plugin": "^5.3.14",
20
20
  "webpack": "^5.102.1",
package/publish.sh ADDED
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+
3
+ # 1. 获取当前时间(格式例如:2026.0522.0443)
4
+ # 这样不仅带日期,还精确到时分,绝对保证每次 push 时的版本号都是递增的,永远不会重复
5
+ NEW_VERSION=$(date +'%Y.%m%d.%H%M')
6
+
7
+ #CURRENT_YEAR=$(date +'%Y')
8
+ #CURRENT_MONTH=$(date +'%m' | sed 's/^0//')
9
+ #CURRENT_DAY=$(date +'%d' | sed 's/^0//')
10
+ #CURRENT_TIME=$(date +'%H%M')
11
+ #NEW_VERSION="${CURRENT_YEAR}.${CURRENT_MONTH}.${CURRENT_DAY}${CURRENT_TIME}"
12
+
13
+
14
+ echo "🚀 开始更新版本号至: $NEW_VERSION"
15
+
16
+ # 2. 使用 jq 自动修改 package.json 中的 version 字段,并写回原文件
17
+ jq ".version = \"$NEW_VERSION\"" package.json > package.json.tmp && mv package.json.tmp package.json
18
+
19
+ # 3. 检查是否有需要提交的代码变化
20
+ git add .
21
+
22
+ # 4. 自动提交并记录本次发布的版本
23
+ git commit -m "chore: bump version to $NEW_VERSION and publish"
24
+
25
+ # 5. 一键推送到 GitHub,触发云端免密发布
26
+ echo "📤 正在推送至 GitHub..."
27
+ git push origin main
28
+
29
+ echo "✅ 推送完成!请前往 GitHub Actions 页面查看发布状态。"