Skip to content

Commit

Permalink
set package version + use --node-env
Browse files Browse the repository at this point in the history
  • Loading branch information
tophf committed Dec 17, 2024
1 parent 5fb9aaf commit 4e0c42d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 43 deletions.
35 changes: 2 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stylus",
"version": "1.5.51",
"version": "2.0.7",
"description": "Redesign the web with Stylus, a user styles manager",
"license": "GPL-3.0-only",
"repository": "openstyles/stylus",
Expand Down Expand Up @@ -47,7 +47,6 @@
"postcss-simple-vars": "^7.0.1",
"svg2ttf": "^6.0.3",
"svgicons2svgfont": "^12.0.0",
"sync-version": "^1.0.1",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.97.1",
"webpack-bundle-analyzer": "^4.10.2",
Expand All @@ -60,20 +59,20 @@
"update-locales": "tx pull --all && node tools/fix-transifex.js && git commit -m \"update locales\" src/_locales",
"update-transifex": "tx push -s",
"build-icons": "node tools/build-icons",
"build-chrome-mv2": "webpack-cli --define-process-env-node-env chrome-mv2",
"build-chrome-mv3": "webpack-cli --define-process-env-node-env chrome-mv3",
"build-firefox": "webpack-cli --define-process-env-node-env firefox",
"watch-mv2": "webpack-cli watch --define-process-env-node-env DEV",
"watch-mv3": "webpack-cli watch --define-process-env-node-env chrome-mv3",
"build-chrome-mv2": "webpack-cli --node-env chrome-mv2",
"build-chrome-mv3": "webpack-cli --node-env chrome-mv3",
"build-firefox": "webpack-cli --node-env firefox",
"watch-mv2": "webpack-cli watch --node-env DEV",
"watch-mv3": "webpack-cli watch --node-env chrome-mv3",
"zip": "npm test && node tools/build-zip.js",
"zip-chrome-mv2": "npm test && node tools/build-zip.js chrome-mv2",
"zip-chrome-mv3": "npm test && node tools/build-zip.js chrome-mv3",
"zip-chrome-mv3-beta": "npm test && node tools/build-zip.js chrome-mv3-beta",
"zip-firefox": "npm test && node tools/build-zip.js firefox",
"postinstall": "node tools/postinstall.js",
"preversion": "npm test",
"version": "sync-version manifest.json && git add .",
"postversion": "npm run zip && git push --follow-tags"
"version": "node tools/sync-manifest-version.js && git add .",
"bump": "npm version patch"
},
"engines": {
"node": ">=20.6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stylus",
"version": "2.0.6",
"version": "2.0.7",
"minimum_chrome_version": "",
"description": "__MSG_description__",
"homepage_url": "https://add0n.com/stylus.html",
Expand Down
14 changes: 14 additions & 0 deletions tools/sync-manifest-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env node
'use strict';

const fs = require('fs');
const {MANIFEST, ROOT, SRC} = require('./util');
const {version} = require(ROOT + 'package.json');

const mjPath = SRC + MANIFEST;
const mjText = fs.readFileSync(mjPath, 'utf8');
const [mjVer] = mjText.match(/(?<="version"\s*:\s*")[^"]+/);
if (mjVer !== version) {
const res = mjText.replace(/(?<="version"\s*:\s*")[^"]+/, version);
fs.writeFileSync(mjPath, res, 'utf8');
}

0 comments on commit 4e0c42d

Please sign in to comment.