From c1f723d8cb29e2e12e1739309bf1e0b7e8bfc6e1 Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 23 Dec 2023 12:46:25 -0700 Subject: [PATCH 1/2] check and update version on commit --- src/update-version.cjs | 28 ++++++++++++++++++++++++++++ tsconfig.json | 5 +++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/update-version.cjs diff --git a/src/update-version.cjs b/src/update-version.cjs new file mode 100644 index 0000000..3fc029e --- /dev/null +++ b/src/update-version.cjs @@ -0,0 +1,28 @@ +const fs = require("fs") + +// DO NOT DELETE THIS FILE + +function main() { + const source = fs.readFileSync("C:/Users/Duncan McPherson/WebstormProjects/karma-test-utils/package.json").toString("utf-8"); + const sourceObj = JSON.parse(source); + const version = sourceObj.version; + + const versionParts = version.split('.'); + let patchVersion = +versionParts[2]; + let minorVersion = +versionParts[1]; + let majorVersion = +versionParts[0]; + if (patchVersion++ >= 10) { + minorVersion++; + patchVersion = 0; + } + if (minorVersion === 10) { + majorVersion++; + minorVersion = 0; + } + const newVersion = `${majorVersion}.${minorVersion}.${patchVersion}` + sourceObj.version = newVersion; + console.log("new version:", newVersion) + fs.writeFileSync("C:/Users/Duncan McPherson/WebstormProjects/karma-test-utils/package.json", Buffer.from(JSON.stringify(sourceObj, null, 2), "utf-8")); +} + +main(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 91037c8..663b2a3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,12 +7,13 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": false, - "skipLibCheck": true + "skipLibCheck": true, + "moduleResolution": "NodeNext" }, "include": [ "src/**/*" ], "exclude": [ "src/**/*.spec.ts" - ], + ] } \ No newline at end of file From ed0f6c0d527240cbb31412736441d3b5c15529ca Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 23 Dec 2023 12:47:07 -0700 Subject: [PATCH 2/2] testing version change --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6606404..0d99af1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ez-budgets/karma-test-utils", - "version": "1.0.0", + "version": "1.0.2", "description": "Karma unit testing helpers", "main": "dist/index.js", "module": "index.mjs", @@ -40,4 +40,4 @@ "ts-node": "^10.9.2", "typescript": "^5.3.3" } -} +} \ No newline at end of file