Section 2.

This commit is contained in:
Leon Zandman 2026-05-19 13:34:05 +02:00
parent d09446fad6
commit 16ae9e7772
5 changed files with 70 additions and 7 deletions

View File

@ -205,10 +205,9 @@
"lint:grammar": "cspell ./src", "lint:grammar": "cspell ./src",
"postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup", "postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup",
"newop": "node src/core/config/scripts/newOperation.mjs", "newop": "node src/core/config/scripts/newOperation.mjs",
"minor": "node src/core/config/scripts/newMinorVersion.mjs && npm version minor --git-tag-version=false && echo \"Updated to version v$(npm pkg get version | xargs), please create a pull request and once merged use 'npm run tag'\"", "minor": "node src/core/config/scripts/bumpMinor.mjs",
"tag": "git tag -s \"v$(npm pkg get version | xargs)\" -m \"$(npm pkg get version | xargs)\" && echo \"Created v$(npm pkg get version | xargs), now check and push the tag\"", "tag": "node src/core/config/scripts/tagRelease.mjs",
"getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'", "getheapsize": "node --no-warnings src/core/config/scripts/getHeapSize.mjs"
"setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048"
}, },
"engines": { "engines": {
"node": ">=24 <25" "node": ">=24 <25"

View File

@ -16,9 +16,9 @@ Stages are executed by Leon, not the agent. Tick each box once the stage is done
- [x] 1g. Webpack output path uses `path.join` _(2026-05-19)_ - [x] 1g. Webpack output path uses `path.join` _(2026-05-19)_
### Section 2 — [package.json](package.json) ### Section 2 — [package.json](package.json)
- [ ] 2a. `setheapsize` deleted - [x] 2a. `setheapsize` deleted _(2026-05-19)_
- [ ] 2b. `getheapsize` switched to `getHeapSize.mjs` - [x] 2b. `getheapsize` switched to `getHeapSize.mjs` _(2026-05-19)_
- [ ] 2c. `minor` / `tag` switched to `.mjs` orchestrators - [x] 2c. `minor` / `tag` switched to `.mjs` orchestrators _(2026-05-19)_
### Verification ### Verification
- [ ] macOS: 7-step verification pass (see "Verification" section below) - [ ] macOS: 7-step verification pass (see "Verification" section below)

View File

@ -0,0 +1,27 @@
/**
* Orchestrates a minor version bump: regenerates the CHANGELOG via
* newMinorVersion.mjs, runs `npm version minor` (without a git tag),
* then prints a follow-up message that includes the new version.
*
* Replaces the previous shell-substitution npm script so it works on
* Windows cmd.exe as well as POSIX shells.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2026
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import { execSync } from "child_process";
import { readFileSync } from "fs";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "..", "..", "package.json");
execSync("node src/core/config/scripts/newMinorVersion.mjs", { stdio: "inherit" });
execSync("npm version minor --git-tag-version=false", { stdio: "inherit" });
const version = JSON.parse(readFileSync(pkgPath, "utf8")).version;
console.log(`Updated to version v${version}, please create a pull request and once merged use 'npm run tag'`);

View File

@ -0,0 +1,13 @@
/**
* Prints the Node V8 heap size limit in MB.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2026
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import v8 from "v8";
console.log(`node heap limit = ${v8.getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`);

View File

@ -0,0 +1,24 @@
/**
* Creates a signed git tag matching the version in package.json,
* then prints a follow-up message.
*
* Replaces the previous shell-substitution npm script so it works on
* Windows cmd.exe as well as POSIX shells.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2026
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import { execSync } from "child_process";
import { readFileSync } from "fs";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "..", "..", "package.json");
const version = JSON.parse(readFileSync(pkgPath, "utf8")).version;
execSync(`git tag -s "v${version}" -m "${version}"`, { stdio: "inherit" });
console.log(`Created v${version}, now check and push the tag`);