Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"test": "LOG_LEVEL=SILENT TZ=UTC jest --maxWorkers=4",
"develop": "npm run __prepare-folder-develop && npm run __develop-core",
"develop-watch": "npm run develop && chokidar \"src/**/*.(ts|tsx|json)\" \"public/**/*.(html|css)\" -c \"[[ {path} == src* ]] && npm run __develop-core;[[ {path} == public* ]] && copyup {path} dist\"",
"build": "npm run __prepare-folder && npm run __check-types && NODE_ENV=production node --import ./register.js ./build.ts"
"build": "npm run __prepare-folder && npm run __check-types && NODE_ENV=production node --import ./register.js ./build.ts",
"set-version": "node --import ./register.js scripts/set-version.ts"
},
"devDependencies": {
"@jest/types": "^29.6.3",
Expand Down
27 changes: 27 additions & 0 deletions scripts/set-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import fs from "fs";
import { execSync } from "child_process";

const version = process.argv[2];
if (!version || !/^\d+\.\d+\.\d+$/.test(version)) {
console.error("Usage: set-version.ts <major.minor.patch>");
process.exit(1);
}

const packageJson = JSON.parse(fs.readFileSync("package.json", "utf8"));
packageJson.version = version;
fs.writeFileSync("package.json", `${JSON.stringify(packageJson, null, 2)}\n`);

const manifestJson = JSON.parse(fs.readFileSync("manifest.json", "utf8"));
manifestJson.version = version;
fs.writeFileSync("manifest.json", `${JSON.stringify(manifestJson, null, 2)}\n`);

execSync("npm install", { stdio: "inherit" });

const lockfileVersion = JSON.parse(fs.readFileSync("package-lock.json", "utf8")).version;

if (lockfileVersion !== version) {
console.error(`package-lock.json version is ${lockfileVersion}, expected ${version}`);
process.exit(1);
}

console.log(`My Notes updated to ${version}`);
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"./jest.config.ts",
"./jest.setup.ts",
"./register.js",
"./build.ts"
"./build.ts",
"./scripts/**/*"
],

"compilerOptions": {
Expand Down
Loading