From d0d5e5105b0ade51ec0f4eed3834ffed1a942d74 Mon Sep 17 00:00:00 2001 From: electrovir Date: Tue, 10 Dec 2024 13:45:34 +0000 Subject: [PATCH] [minor] ad fix-ts-bind.script.ts to @augment-vir/node --- package-lock.json | 48 +++++++++---------- package.json | 4 +- packages/assert/package.json | 4 +- packages/common/package.json | 6 +-- packages/core/package.json | 2 +- packages/node/.npmignore | 1 - packages/node/package.json | 8 ++-- .../src/scripts/fix-ts-bin.script.ts | 17 ++++++- packages/scripts/package.json | 10 ++-- packages/test/package.json | 6 +-- packages/web/package.json | 8 ++-- 11 files changed, 63 insertions(+), 51 deletions(-) rename packages/{scripts => node}/src/scripts/fix-ts-bin.script.ts (79%) diff --git a/package-lock.json b/package-lock.json index e7772c0a..efa74c13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@augment-vir/mono-repo-root", - "version": "31.0.1", + "version": "31.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@augment-vir/mono-repo-root", - "version": "31.0.1", + "version": "31.1.0", "hasInstallScript": true, "license": "(MIT or CC0 1.0)", "workspaces": [ @@ -18940,10 +18940,10 @@ }, "packages/assert": { "name": "@augment-vir/assert", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { - "@augment-vir/core": "^31.0.1", + "@augment-vir/core": "^31.1.0", "@date-vir/duration": "^7.0.1", "deep-eql": "^5.0.2", "expect-type": "^1.1.0", @@ -18978,11 +18978,11 @@ }, "packages/common": { "name": "@augment-vir/common", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/core": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/core": "^31.1.0", "@date-vir/duration": "^7.0.1", "ansi-styles": "^6.2.1", "json5": "^2.2.3", @@ -19017,7 +19017,7 @@ }, "packages/core": { "name": "@augment-vir/core", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { "@date-vir/duration": "^7.0.1", @@ -19048,11 +19048,11 @@ }, "packages/node": { "name": "@augment-vir/node", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", "@date-vir/duration": "^7.0.1", "ansi-styles": "^6.2.1", "terminate": "^2.8.0", @@ -19060,7 +19060,7 @@ "typed-event-target": "^4.0.2" }, "devDependencies": { - "@augment-vir/test": "^31.0.1", + "@augment-vir/test": "^31.1.0", "@prisma/client": "^5.22.0", "@types/node": "^22.10.0", "@web/dev-server-esbuild": "^1.0.3", @@ -19091,18 +19091,18 @@ }, "packages/scripts": { "name": "@augment-vir/scripts", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", - "@augment-vir/node": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", + "@augment-vir/node": "^31.1.0", "@virmator/docs": "^13.10.3", "jsdom": "^25.0.1", "typedoc": "^0.27.0" }, "devDependencies": { - "@augment-vir/test": "^31.0.1", + "@augment-vir/test": "^31.1.0", "@types/jsdom": "^21.1.7", "@types/node": "^22.10.0" }, @@ -19112,11 +19112,11 @@ }, "packages/test": { "name": "@augment-vir/test", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", "@open-wc/testing-helpers": "^3.0.1", "@virmator/test": "^13.10.3", "type-fest": "^4.29.0" @@ -19150,17 +19150,17 @@ }, "packages/web": { "name": "@augment-vir/web", - "version": "31.0.1", + "version": "31.1.0", "license": "(MIT or CC0 1.0)", "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", "@date-vir/duration": "^7.0.1", "html-spec-tags": "^2.2.1", "type-fest": "^4.29.0" }, "devDependencies": { - "@augment-vir/test": "^31.0.1", + "@augment-vir/test": "^31.1.0", "bowser": "^2.11.0", "typescript": "^5.6.3" }, diff --git a/package.json b/package.json index 5c947e90..d125e8dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/mono-repo-root", - "version": "31.0.1", + "version": "31.1.0", "private": true, "homepage": "https://github.com/electrovir/augment-vir", "bugs": { @@ -23,7 +23,7 @@ "compile": "virmator compile", "docs": "npm run exec --workspace @augment-vir/scripts src/scripts/run-typedoc.script.ts", "format": "virmator format", - "postinstall": "cd packages/common && tsc -b -f --pretty && cd ../.. && tsx packages/scripts/src/scripts/fix-ts-bin.script.ts", + "postinstall": "cd packages/common && tsc -b -f --pretty && cd ../.. && tsx packages/node/src/scripts/fix-ts-bin.script.ts", "lint": "virmator lint fix", "publish": "virmator publish \"npm run test:all\"", "test": "mono-vir for-each npm run test", diff --git a/packages/assert/package.json b/packages/assert/package.json index 2ec9d166..3211ecf3 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/assert", - "version": "31.0.1", + "version": "31.1.0", "description": "A collection of assertions for test and production code alike.", "keywords": [ "augment", @@ -41,7 +41,7 @@ "test:update": "npm test" }, "dependencies": { - "@augment-vir/core": "^31.0.1", + "@augment-vir/core": "^31.1.0", "@date-vir/duration": "^7.0.1", "deep-eql": "^5.0.2", "expect-type": "^1.1.0", diff --git a/packages/common/package.json b/packages/common/package.json index 97d04f73..330822c6 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/common", - "version": "31.0.1", + "version": "31.1.0", "description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.", "keywords": [ "augment", @@ -39,8 +39,8 @@ "test:web": "virmator --no-deps test web" }, "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/core": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/core": "^31.1.0", "@date-vir/duration": "^7.0.1", "ansi-styles": "^6.2.1", "json5": "^2.2.3", diff --git a/packages/core/package.json b/packages/core/package.json index 2b6ac81e..09b156cd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/core", - "version": "31.0.1", + "version": "31.1.0", "description": "Core augment-vir augments. Use @augment-vir/common instead.", "homepage": "https://github.com/electrovir/augment-vir", "bugs": { diff --git a/packages/node/.npmignore b/packages/node/.npmignore index 99933cb1..41139c8f 100644 --- a/packages/node/.npmignore +++ b/packages/node/.npmignore @@ -11,7 +11,6 @@ /cspell.config.cjs /graphics/ /Icon? -/src/ /www-static/ bash-scripts/ dist-docs/ diff --git a/packages/node/package.json b/packages/node/package.json index a2186504..7692c28b 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/node", - "version": "31.0.1", + "version": "31.1.0", "description": "A collection of augments, helpers types, functions, and classes only for Node.js (backend) JavaScript environments.", "keywords": [ "augment", @@ -37,8 +37,8 @@ "test:update": "npm test" }, "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", "@date-vir/duration": "^7.0.1", "ansi-styles": "^6.2.1", "terminate": "^2.8.0", @@ -46,7 +46,7 @@ "typed-event-target": "^4.0.2" }, "devDependencies": { - "@augment-vir/test": "^31.0.1", + "@augment-vir/test": "^31.1.0", "@prisma/client": "^5.22.0", "@types/node": "^22.10.0", "@web/dev-server-esbuild": "^1.0.3", diff --git a/packages/scripts/src/scripts/fix-ts-bin.script.ts b/packages/node/src/scripts/fix-ts-bin.script.ts similarity index 79% rename from packages/scripts/src/scripts/fix-ts-bin.script.ts rename to packages/node/src/scripts/fix-ts-bin.script.ts index 4ee5b89a..546c3b6a 100644 --- a/packages/scripts/src/scripts/fix-ts-bin.script.ts +++ b/packages/node/src/scripts/fix-ts-bin.script.ts @@ -1,8 +1,21 @@ +/* node:coverage disable */ + +/** + * To use this script properly, call it directly in your postinstall script. Like this: + * + * ```json + * { + * "scripts": { + * "postinstall": "tsx node_modules/@augment-vir/node/src/scripts/fix-ts-bin.script.ts" + * } + * } + * ``` + */ + import {log} from '@augment-vir/common'; import {interpolationSafeWindowsPath, runShellCommand} from '@augment-vir/node'; import {rm, writeFile} from 'node:fs/promises'; import {join, sep} from 'node:path/posix'; -import {monoRepoNodeModulesDirPath} from '../file-paths.js'; type PackageToFix = { packageName: string; @@ -37,7 +50,7 @@ function createBinFileContents({scriptPath}: Readonly) { - const binFilePath = join(monoRepoNodeModulesDirPath, '.bin', packageToFix.binName); + const binFilePath = join(process.cwd(), 'node_modules', '.bin', packageToFix.binName); await rm(binFilePath, {force: true}); await writeFile(binFilePath, createBinFileContents(packageToFix)); await runShellCommand(`chmod +x ${interpolationSafeWindowsPath(binFilePath)}`); diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 6c88ecf3..83c9f15d 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/scripts", - "version": "31.0.1", + "version": "31.1.0", "private": true, "homepage": "https://github.com/electrovir/augment-vir", "bugs": { @@ -24,15 +24,15 @@ "test:update": "npm test" }, "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", - "@augment-vir/node": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", + "@augment-vir/node": "^31.1.0", "@virmator/docs": "^13.10.3", "jsdom": "^25.0.1", "typedoc": "^0.27.0" }, "devDependencies": { - "@augment-vir/test": "^31.0.1", + "@augment-vir/test": "^31.1.0", "@types/jsdom": "^21.1.7", "@types/node": "^22.10.0" }, diff --git a/packages/test/package.json b/packages/test/package.json index 90340c6e..a31cef3b 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/test", - "version": "31.0.1", + "version": "31.1.0", "description": "A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.", "keywords": [ "test", @@ -42,8 +42,8 @@ "test:web": "virmator test --no-deps web 'src/test-web/**/*.test.ts' 'src/augments/universal-testing-suite/**/*.test.ts'" }, "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", "@open-wc/testing-helpers": "^3.0.1", "@virmator/test": "^13.10.3", "type-fest": "^4.29.0" diff --git a/packages/web/package.json b/packages/web/package.json index ee54df3f..98c311bf 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@augment-vir/web", - "version": "31.0.1", + "version": "31.1.0", "description": "A collection of augments, helpers types, functions, and classes only for web (frontend) JavaScript environments.", "keywords": [ "augment", @@ -35,14 +35,14 @@ "test:update": "npm test" }, "dependencies": { - "@augment-vir/assert": "^31.0.1", - "@augment-vir/common": "^31.0.1", + "@augment-vir/assert": "^31.1.0", + "@augment-vir/common": "^31.1.0", "@date-vir/duration": "^7.0.1", "html-spec-tags": "^2.2.1", "type-fest": "^4.29.0" }, "devDependencies": { - "@augment-vir/test": "^31.0.1", + "@augment-vir/test": "^31.1.0", "bowser": "^2.11.0", "typescript": "^5.6.3" },