diff --git a/.changeset/flat-windows-report.md b/.changeset/flat-windows-report.md new file mode 100644 index 000000000..fcbf1d33b --- /dev/null +++ b/.changeset/flat-windows-report.md @@ -0,0 +1,5 @@ +--- +"ilib-loctool-mrkdwn": patch +--- + +Added missing dependency on ilib. diff --git a/.changeset/nine-jobs-behave.md b/.changeset/nine-jobs-behave.md new file mode 100644 index 000000000..2c5c46d47 --- /dev/null +++ b/.changeset/nine-jobs-behave.md @@ -0,0 +1,7 @@ +--- +"ilib-loctool-javascript": patch +"ilib-loctool-json": patch +"ilib-loctool-xml": patch +--- + +Added missing dependency on micromatch. diff --git a/packages/ilib-assemble/package.json b/packages/ilib-assemble/package.json index e077d3cab..37a2709fb 100644 --- a/packages/ilib-assemble/package.json +++ b/packages/ilib-assemble/package.json @@ -50,9 +50,9 @@ }, "scripts": { "test": "pnpm test:cli", - "test:cli": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", - "test:watch": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest --testEnvironment node -i", + "test:cli": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", + "test:watch": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --watch", + "debug": "node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i", "clean": "git clean -f -d src test ; rm -rf lib *.tgz", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/*.js -m table > docs/ilibAssemble.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/ilib-common/package.json b/packages/ilib-common/package.json index 79a75d64e..5e82aa54d 100644 --- a/packages/ilib-common/package.json +++ b/packages/ilib-common/package.json @@ -59,13 +59,13 @@ "build:test": "webpack-cli --config webpack-test.config.js", "build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json", "test": "pnpm test:all", - "test:jest": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test:jest": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:karma": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" karma start --reporters dots", "test:cli": "LANG=en_US.UTF8 pnpm build:dev && pnpm test:jest", "test:web": "pnpm test:karma --single-run", "test:watch": "pnpm test:jest --watch", "test:all": "npm-run-all --npm-path pnpm test:cli test:web", - "debug": "pnpm build:dev; NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest --testEnvironment node -i", + "debug": "pnpm build:dev; node --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i", "debug:web": "pnpm test:karma", "clean": "git clean -f -d src test; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibCommon.md && pnpm doc:html", @@ -88,7 +88,6 @@ "grunt-contrib-jshint": "^3.2.0", "grunt-contrib-uglify": "^5.2.2", "jest": "^26.6.3", - "jest-mock": "^29.7.0", "jsdoc": "^4.0.2", "jsdoc-to-markdown": "^8.0.0", "karma": "^6.4.2", diff --git a/packages/ilib-data-utils/package.json b/packages/ilib-data-utils/package.json index 6ff429a6c..1f536d585 100644 --- a/packages/ilib-data-utils/package.json +++ b/packages/ilib-data-utils/package.json @@ -56,9 +56,9 @@ "build": "pnpm build:prod", "build:prod": "grunt babel --mode=prod", "build:dev": "grunt babel --mode=dev", - "test": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", - "test:watch": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest --testEnvironment node -i", + "test": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", + "test:watch": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --watch", + "debug": "node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i", "clean": "git clean -f -d * ; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilib-data-utils.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/ilib-env/package.json b/packages/ilib-env/package.json index eb56b7809..c5766bce9 100644 --- a/packages/ilib-env/package.json +++ b/packages/ilib-env/package.json @@ -59,13 +59,13 @@ "build:test": "webpack-cli --config webpack-test.config.js", "build:pkg": "mkdir -p lib && echo '{\"type\": \"commonjs\"}' > lib/package.json", "test": "pnpm run test:all", - "test:jest": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test:jest": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:karma": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" karma start --reporters dots", "test:cli": "LANG=en_US.UTF8 npm-run-all --npm-path pnpm build:dev test:jest", "test:web": "pnpm test:karma --single-run", "test:watch": "pnpm test:jest --watch", "test:all": "npm-run-all --npm-path pnpm test:cli test:web", - "debug": "pnpm build:dev && node --experimental-vm-modules --inspect-brk node_modules/.bin/jest --testEnvironment node -i", + "debug": "pnpm build:dev && node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i", "debug:web": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/.bin/karma start --reporters dots", "clean": "git clean -f -d src test; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibEnv.md && pnpm doc:html", diff --git a/packages/ilib-lint-common/package.json b/packages/ilib-lint-common/package.json index ed903f73c..2c455de3c 100644 --- a/packages/ilib-lint-common/package.json +++ b/packages/ilib-lint-common/package.json @@ -52,16 +52,18 @@ "node": ">=14.0.0" }, "scripts": { - "test": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest", - "test:watch": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i", + "test": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js", + "test:watch": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --watch", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d src test", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilib-lint-common.md && pnpm run doc:html", "doc:html": "jsdoc -c jsdoc.json", "types": "tsc -p ./jsconfig.json" }, "devDependencies": { + "@jest/globals": "^29.7.0", "@tsconfig/node14": "^14.1.0", + "@types/jest": "^29.5.14", "@types/node": "^20.11.5", "docdash": "^2.0.2", "jest": "^29.7.0", diff --git a/packages/ilib-lint-common/test/SourceFile.test.js b/packages/ilib-lint-common/test/SourceFile.test.js index 810251bb3..aefe74125 100644 --- a/packages/ilib-lint-common/test/SourceFile.test.js +++ b/packages/ilib-lint-common/test/SourceFile.test.js @@ -17,11 +17,9 @@ * limitations under the License. */ -import fs from 'fs'; -import SourceFile from '../src/SourceFile.js'; -import jest from 'jest-mock'; - -import {describe, expect, test} from '@jest/globals'; +import fs from "fs"; +import SourceFile from "../src/SourceFile.js"; +import { jest } from "@jest/globals"; /** * @jest-environment node @@ -37,19 +35,19 @@ const getLogger = (loggerName) => { }; }; -describe('SourceFile', () => { - const filePath1 = './test/testfiles/testfile1.txt'; - const filePath2 = './test/testfiles/testfile2.txt'; - const filePath3 = './test/testfiles/testfile3.txt'; - const filePath4 = './test/testfiles/testfile4.txt'; +describe("SourceFile", () => { + const filePath1 = "./test/testfiles/testfile1.txt"; + const filePath2 = "./test/testfiles/testfile2.txt"; + const filePath3 = "./test/testfiles/testfile3.txt"; + const filePath4 = "./test/testfiles/testfile4.txt"; - test('should throw an error if created without a file path', () => { + test("should throw an error if created without a file path", () => { expect.assertions(1); - expect(() => new SourceFile(undefined)).toThrowError('Attempt to create a SourceFile without a file path'); + expect(() => new SourceFile(undefined)).toThrowError("Attempt to create a SourceFile without a file path"); }); - test('should create a SourceFile instance with the correct properties', () => { + test("should create a SourceFile instance with the correct properties", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath1, { getLogger }); @@ -57,19 +55,19 @@ describe('SourceFile', () => { expect(sourceFile.getType()).toBe("string"); }); - test('should create a SourceFile instance with provided options', () => { + test("should create a SourceFile instance with provided options", () => { expect.assertions(2); const customLogger = { log: jest.fn() }; const type = "test"; const sourceFile = new SourceFile(filePath1, { - type + type, }); expect(sourceFile.getPath()).toBe(filePath1); expect(sourceFile.getType()).toBe("test"); }); - test('should read the raw file into memory correctly', () => { + test("should read the raw file into memory correctly", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath1, { getLogger }); @@ -78,40 +76,40 @@ describe('SourceFile', () => { expect(sourceFile.isDirty()).toBe(false); }); - test('should read the cooked file into memory correctly', () => { + test("should read the cooked file into memory correctly", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath1, { getLogger }); - expect(sourceFile.getContent()).toBe('Mock file content'); + expect(sourceFile.getContent()).toBe("Mock file content"); expect(sourceFile.isDirty()).toBe(false); }); - test('should get the path to the source file', () => { + test("should get the path to the source file", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath1, { getLogger }); expect(sourceFile.getPath()).toBe(filePath1); }); - test('should get the raw contents of the file as a Buffer', () => { + test("should get the raw contents of the file as a Buffer", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath1, { getLogger }); const rawBuffer = sourceFile.getRaw(); expect(Buffer.isBuffer(rawBuffer)).toBe(true); - expect(rawBuffer?.toString('utf-8')).toBe('Mock file content'); + expect(rawBuffer?.toString("utf-8")).toBe("Mock file content"); }); - test('should get the content of the file as a string', () => { + test("should get the content of the file as a string", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath1, { getLogger }); - expect(sourceFile.getContent()).toBe('Mock file content'); + expect(sourceFile.getContent()).toBe("Mock file content"); }); - test('should get lines from the file content', () => { + test("should get lines from the file content", () => { expect.assertions(3); const sourceFile = new SourceFile(filePath2, { getLogger }); @@ -119,78 +117,78 @@ describe('SourceFile', () => { expect(Array.isArray(lines)).toBe(true); expect(lines).toHaveLength(3); - expect(lines).toEqual(['Line 1', 'Line 2', 'Line 3']); + expect(lines).toEqual(["Line 1", "Line 2", "Line 3"]); }); - test('should set lines to the file content', () => { + test("should set lines to the file content", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath2, { getLogger }); - const newLines = ['New Line 1', 'New Line 2', 'New Line 3']; + const newLines = ["New Line 1", "New Line 2", "New Line 3"]; const newSourceFile = new SourceFile(filePath2, { file: sourceFile, - content: newLines.join('\n') + content: newLines.join("\n"), }); expect(newSourceFile.getLines()).toEqual(newLines); }); - test('should not set lines to an empty array if null is provided', () => { + test("should not set lines to an empty array if null is provided", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath2, { getLogger }); const newSourceFile = new SourceFile(filePath2, { file: sourceFile, - content: null + content: null, }); // The content of the file is still the same - expect(newSourceFile.getLines()).toEqual(['Line 1', 'Line 2', 'Line 3']); + expect(newSourceFile.getLines()).toEqual(["Line 1", "Line 2", "Line 3"]); }); - test('should not set lines to an empty array if undefined is provided', () => { + test("should not set lines to an empty array if undefined is provided", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath2, { getLogger }); const newSourceFile = new SourceFile(filePath2, { file: sourceFile, - content: undefined + content: undefined, }); // The content of the file is still the same - expect(newSourceFile.getLines()).toEqual(['Line 1', 'Line 2', 'Line 3']); + expect(newSourceFile.getLines()).toEqual(["Line 1", "Line 2", "Line 3"]); }); - test('should handle empty lines in the file content', () => { + test("should handle empty lines in the file content", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath3, { getLogger }); - expect(sourceFile.getLines()).toEqual(['', '']); + expect(sourceFile.getLines()).toEqual(["", ""]); }); - test('should handle a single line in the file content', () => { + test("should handle a single line in the file content", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath4, { getLogger }); - expect(sourceFile.getLines()).toEqual(['Single Line']); + expect(sourceFile.getLines()).toEqual(["Single Line"]); }); - test('should set lines to an empty array if an empty array is provided', () => { + test("should set lines to an empty array if an empty array is provided", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath2, { getLogger }); - expect(sourceFile.getLines()).toEqual(['Line 1', 'Line 2', 'Line 3']); + expect(sourceFile.getLines()).toEqual(["Line 1", "Line 2", "Line 3"]); const newSourceFile = new SourceFile(filePath2, { file: sourceFile, - content: '' + content: "", }); - expect(newSourceFile.getLines()).toEqual(['']); + expect(newSourceFile.getLines()).toEqual([""]); }); - test('length is set correctly', () => { + test("length is set correctly", () => { expect.assertions(1); const sourceFile = new SourceFile(filePath2, { getLogger }); @@ -198,31 +196,31 @@ describe('SourceFile', () => { expect(sourceFile.getLength()).toBe(20); }); - test('length is updated after setLines', () => { + test("length is updated after setLines", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath2, { getLogger }); expect(sourceFile.getLength()).toBe(20); - const newLines = ['New Line 1', 'New Line 2', 'New Line 3']; + const newLines = ["New Line 1", "New Line 2", "New Line 3"]; const newSourceFile = new SourceFile(filePath2, { file: sourceFile, - content: newLines.join('\n') + content: newLines.join("\n"), }); expect(newSourceFile.getLength()).toBe(32); }); - test('dirty flag is updated after setLines', () => { + test("dirty flag is updated after setLines", () => { expect.assertions(2); const sourceFile = new SourceFile(filePath2, { getLogger }); expect(sourceFile.isDirty()).toBeFalsy(); - const newLines = ['New Line 1', 'New Line 2', 'New Line 3']; + const newLines = ["New Line 1", "New Line 2", "New Line 3"]; const newSourceFile = new SourceFile(filePath2, { file: sourceFile, - content: newLines.join('\n') + content: newLines.join("\n"), }); expect(newSourceFile.isDirty()).toBeTruthy(); }); -}); \ No newline at end of file +}); diff --git a/packages/ilib-lint/package.json b/packages/ilib-lint/package.json index 291b545d4..b3f863791 100644 --- a/packages/ilib-lint/package.json +++ b/packages/ilib-lint/package.json @@ -50,9 +50,9 @@ }, "scripts": { "test": "pnpm test:jest", - "test:jest": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --trace-warnings --experimental-vm-modules\" jest", + "test:jest": "LANG=en_US.UTF8 node --trace-warnings --experimental-vm-modules node_modules/jest/bin/jest.js", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --trace-warnings --experimental-vm-modules --inspect-brk\" jest -i", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i", "lint": "node src/index.js", "clean": "git clean -f -d src test", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibLint.md && pnpm doc:html", diff --git a/packages/ilib-loader/package.json b/packages/ilib-loader/package.json index 118c948cb..db5f4aa2a 100644 --- a/packages/ilib-loader/package.json +++ b/packages/ilib-loader/package.json @@ -56,13 +56,13 @@ "build:test": "webpack-cli --config webpack-test.config.js", "build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json", "test": "echo Success: TODO fix this to pnpm test:all", - "test:jest": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test:jest": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:karma": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" karma start --reporters dots", "test:cli": "LANG=en_US.UTF8 npm-run-all --npm-path pnpm build:dev test:jest", "test:web": "pnpm test:karma --single-run", "test:watch": "pnpm test:jest --watch", "test:all": "npm-run-all --npm-path pnpm test:cli test:web", - "debug": "pnpm build:dev && node --experimental-vm-modules --inspect-brk node_modules/.bin/jest --testEnvironment node -i", + "debug": "pnpm build:dev && node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i", "debug:web": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/.bin/karma start --reporters dots", "clean": "git clean -f -d src test&& rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilib-loader.md && pnpm doc:html", diff --git a/packages/ilib-loctool-android-layout/package.json b/packages/ilib-loctool-android-layout/package.json index d7ee98102..a73b874e9 100644 --- a/packages/ilib-loctool-android-layout/package.json +++ b/packages/ilib-loctool-android-layout/package.json @@ -43,9 +43,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-android-resource/package.json b/packages/ilib-loctool-android-resource/package.json index ff24af97a..0d3a2d7e0 100644 --- a/packages/ilib-loctool-android-resource/package.json +++ b/packages/ilib-loctool-android-resource/package.json @@ -43,9 +43,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-csv/package.json b/packages/ilib-loctool-csv/package.json index 6261ef584..f70a06009 100644 --- a/packages/ilib-loctool-csv/package.json +++ b/packages/ilib-loctool-csv/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-ghfm-readmeio/package.json b/packages/ilib-loctool-ghfm-readmeio/package.json index d910760b5..574a12d14 100644 --- a/packages/ilib-loctool-ghfm-readmeio/package.json +++ b/packages/ilib-loctool-ghfm-readmeio/package.json @@ -46,7 +46,7 @@ }, "scripts": { "test": "node test/testSuite.js", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-ghfm/package.json b/packages/ilib-loctool-ghfm/package.json index c731f5d4e..5240ee053 100644 --- a/packages/ilib-loctool-ghfm/package.json +++ b/packages/ilib-loctool-ghfm/package.json @@ -44,9 +44,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d * ; rm -rf test/testfiles/fr-FR test/testfiles/de-DE" }, "engines": { diff --git a/packages/ilib-loctool-haml/package.json b/packages/ilib-loctool-haml/package.json index abd9d40d8..fea3ae667 100644 --- a/packages/ilib-loctool-haml/package.json +++ b/packages/ilib-loctool-haml/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-html/package.json b/packages/ilib-loctool-html/package.json index 6ab1d0c66..5b95db05f 100644 --- a/packages/ilib-loctool-html/package.json +++ b/packages/ilib-loctool-html/package.json @@ -41,9 +41,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-java/package.json b/packages/ilib-loctool-java/package.json index eab8f1681..11ab3d29c 100644 --- a/packages/ilib-loctool-java/package.json +++ b/packages/ilib-loctool-java/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-javascript-resource/package.json b/packages/ilib-loctool-javascript-resource/package.json index d7371950a..54b48f509 100644 --- a/packages/ilib-loctool-javascript-resource/package.json +++ b/packages/ilib-loctool-javascript-resource/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-javascript/package.json b/packages/ilib-loctool-javascript/package.json index 253c91bfc..02fc2a31e 100644 --- a/packages/ilib-loctool-javascript/package.json +++ b/packages/ilib-loctool-javascript/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { @@ -57,6 +57,7 @@ "devDependencies": { "ilib-loctool-json": "workspace:^", "jest": "^26.6.3", - "loctool": "workspace:^" + "loctool": "workspace:^", + "micromatch": "^4.0.8" } } \ No newline at end of file diff --git a/packages/ilib-loctool-json/package.json b/packages/ilib-loctool-json/package.json index 3cfbfe119..ccbaa4306 100644 --- a/packages/ilib-loctool-json/package.json +++ b/packages/ilib-loctool-json/package.json @@ -43,9 +43,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d test" }, "engines": { @@ -53,7 +53,8 @@ }, "dependencies": { "ilib": "^14.19.0", - "json5": "^2.2.3" + "json5": "^2.2.3", + "micromatch": "^4.0.8" }, "devDependencies": { "jest": "^29.0.0", diff --git a/packages/ilib-loctool-jst/package.json b/packages/ilib-loctool-jst/package.json index e0d742a07..c7378f666 100644 --- a/packages/ilib-loctool-jst/package.json +++ b/packages/ilib-loctool-jst/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-jsx/package.json b/packages/ilib-loctool-jsx/package.json index 13cf37381..9c66d394f 100644 --- a/packages/ilib-loctool-jsx/package.json +++ b/packages/ilib-loctool-jsx/package.json @@ -43,9 +43,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-mrkdwn/package.json b/packages/ilib-loctool-mrkdwn/package.json index b9eb9368a..de7649c28 100644 --- a/packages/ilib-loctool-mrkdwn/package.json +++ b/packages/ilib-loctool-mrkdwn/package.json @@ -46,15 +46,16 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d * ; rm -rf test/testfiles/fr-FR test/testfiles/de-DE" }, "engines": { "node": ">=10.0" }, "dependencies": { + "ilib": "^14.20.0", "ilib-tree-node": "workspace:^", "message-accumulator": "workspace:^", "micromatch": "^4.0.8", diff --git a/packages/ilib-loctool-objectivec/package.json b/packages/ilib-loctool-objectivec/package.json index 4b9b5df07..c3deeed2b 100644 --- a/packages/ilib-loctool-objectivec/package.json +++ b/packages/ilib-loctool-objectivec/package.json @@ -40,9 +40,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-po/package.json b/packages/ilib-loctool-po/package.json index 7137791d4..9c1861c3c 100644 --- a/packages/ilib-loctool-po/package.json +++ b/packages/ilib-loctool-po/package.json @@ -45,9 +45,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d test" }, "engines": { diff --git a/packages/ilib-loctool-properties/package.json b/packages/ilib-loctool-properties/package.json index 31ddbe8e3..03a101621 100644 --- a/packages/ilib-loctool-properties/package.json +++ b/packages/ilib-loctool-properties/package.json @@ -42,9 +42,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-ruby-ilib/package.json b/packages/ilib-loctool-ruby-ilib/package.json index 53bf4c472..1d32dc6aa 100644 --- a/packages/ilib-loctool-ruby-ilib/package.json +++ b/packages/ilib-loctool-ruby-ilib/package.json @@ -41,9 +41,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-salesforce-metaxml/package.json b/packages/ilib-loctool-salesforce-metaxml/package.json index 50e9842dd..35ead67e7 100644 --- a/packages/ilib-loctool-salesforce-metaxml/package.json +++ b/packages/ilib-loctool-salesforce-metaxml/package.json @@ -46,9 +46,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-strings/package.json b/packages/ilib-loctool-strings/package.json index d47e59706..7401e3319 100644 --- a/packages/ilib-loctool-strings/package.json +++ b/packages/ilib-loctool-strings/package.json @@ -41,9 +41,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-swift/package.json b/packages/ilib-loctool-swift/package.json index 2c1edff94..86efee215 100644 --- a/packages/ilib-loctool-swift/package.json +++ b/packages/ilib-loctool-swift/package.json @@ -42,9 +42,9 @@ }, "scripts": { "test": "pnpm test:jest", - "test:jest": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest", + "test:jest": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-xml/package.json b/packages/ilib-loctool-xml/package.json index e28da69ba..183a8210d 100644 --- a/packages/ilib-loctool-xml/package.json +++ b/packages/ilib-loctool-xml/package.json @@ -45,9 +45,9 @@ }, "scripts": { "test": "pnpm test:jest", - "test:jest": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest", + "test:jest": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d test" }, "engines": { @@ -55,6 +55,7 @@ }, "dependencies": { "ilib": "^14.18.0", + "micromatch": "^4.0.8", "xml-js": "^1.6.11" }, "devDependencies": { diff --git a/packages/ilib-loctool-yaml-resource/package.json b/packages/ilib-loctool-yaml-resource/package.json index 0d293a50b..7fbf860ef 100644 --- a/packages/ilib-loctool-yaml-resource/package.json +++ b/packages/ilib-loctool-yaml-resource/package.json @@ -41,9 +41,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-loctool-yaml/package.json b/packages/ilib-loctool-yaml/package.json index ca7ad2486..3054d5bda 100644 --- a/packages/ilib-loctool-yaml/package.json +++ b/packages/ilib-loctool-yaml/package.json @@ -40,9 +40,9 @@ "url": "https://github.com/iLib-js/ilib-mono.git" }, "scripts": { - "test": "jest", - "test:watch": "jest --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --inspect-brk\" jest -i", + "test": "node node_modules/jest/bin/jest.js", + "test:watch": "node node_modules/jest/bin/jest.js --watch", + "debug": "node --inspect-brk node_modules/jest/bin/jest.js -i", "clean": "git clean -f -d *" }, "engines": { diff --git a/packages/ilib-po/package.json b/packages/ilib-po/package.json index f09d78926..c760b64e0 100644 --- a/packages/ilib-po/package.json +++ b/packages/ilib-po/package.json @@ -47,7 +47,7 @@ "scripts": { "build": "tsc --project tsconfig.build.json", "types": "tsc", - "test": "jest", + "test": "node node_modules/jest/bin/jest.js", "test:watch": "pnpm test --watch", "debug": "node --inspect-brk node_modules/jest/bin/jest.js --runInBand", "clean": "git clean -f -d src test", diff --git a/packages/ilib-tmx/package.json b/packages/ilib-tmx/package.json index 1760fcebd..af369b907 100644 --- a/packages/ilib-tmx/package.json +++ b/packages/ilib-tmx/package.json @@ -53,9 +53,9 @@ "build:prod": "grunt babel --mode=prod && pnpm build:pkg", "build:dev": "grunt babel --mode=dev && pnpm build:pkg", "build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json", - "test": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i --testEnvironment node", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node", "clean": "git clean -f -d src test; rm -rf lib *.tgz", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibTmx.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/ilib-tools-common/package.json b/packages/ilib-tools-common/package.json index d55cb1545..a50c0fe65 100644 --- a/packages/ilib-tools-common/package.json +++ b/packages/ilib-tools-common/package.json @@ -57,9 +57,9 @@ "build:prod": "grunt babel --mode=prod && pnpm build:pkg", "build:dev": "grunt babel --mode=dev && pnpm build:pkg", "build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json", - "test": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i --testEnvironment node", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node", "clean": "git clean -f -d src test; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibToolsCommon.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/ilib-tree-node/package.json b/packages/ilib-tree-node/package.json index d03cf0fbf..07e8f1468 100644 --- a/packages/ilib-tree-node/package.json +++ b/packages/ilib-tree-node/package.json @@ -42,9 +42,9 @@ "scripts": { "build": "grunt babel", "test": "npm-run-all --npm-path pnpm build test:cli", - "test:cli": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test:cli": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i --testEnvironment node", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node", "clean": "git clean -f -d * ; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibTreeNode.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/ilib-yaml/package.json b/packages/ilib-yaml/package.json index c838b6f49..b1ab69647 100644 --- a/packages/ilib-yaml/package.json +++ b/packages/ilib-yaml/package.json @@ -55,9 +55,9 @@ "build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json", "test": "pnpm test:all", "test:all": "npm-run-all --npm-path pnpm test:cli", - "test:cli": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test:cli": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i --testEnvironment node", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node", "clean": "git clean -f -d src test; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibYaml.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/loctool/package.json b/packages/loctool/package.json index 4ad85109d..d33ca61f1 100644 --- a/packages/loctool/package.json +++ b/packages/loctool/package.json @@ -58,9 +58,9 @@ "clean": "ant clean", "build": "pnpm generate", "generate": "node generate/genPluralCategories.js", - "test": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node --detectOpenHandles", - "test:watch": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node --detectOpenHandles --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest --testEnvironment node --detectOpenHandles -i" + "test": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --detectOpenHandles", + "test:watch": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --detectOpenHandles --watch", + "debug": "node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node --detectOpenHandles -i" }, "dependencies": { "@formatjs/intl": "^2.10.4", diff --git a/packages/message-accumulator/package.json b/packages/message-accumulator/package.json index a48bc92a7..6e014e621 100644 --- a/packages/message-accumulator/package.json +++ b/packages/message-accumulator/package.json @@ -52,9 +52,9 @@ "scripts": { "build": "grunt babel", "test": "npm-run-all --npm-path pnpm build test:cli", - "test:cli": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", + "test:cli": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", "test:watch": "pnpm test:jest --watch", - "debug": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest -i --testEnvironment node", + "debug": "LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node", "clean": "git clean -f -d * ; rm -rf lib", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibMessageAccumulator.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/packages/tmxtool/package.json b/packages/tmxtool/package.json index 313ac3216..955341dd0 100644 --- a/packages/tmxtool/package.json +++ b/packages/tmxtool/package.json @@ -53,9 +53,9 @@ "node": ">= 14.0.0" }, "scripts": { - "test": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node", - "test:watch": "LANG=en_US.UTF8 NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testEnvironment node --watch", - "debug": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --inspect-brk\" jest --testEnvironment node -i", + "test": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node", + "test:watch": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --watch", + "debug": "node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i", "clean": "git clean -f -d src test", "doc": "mkdir -p docs && jsdoc2md -c jsdoc.json --separators --source src/*.js -m table > docs/ilibAssemble.md && pnpm doc:html", "doc:html": "jsdoc -c jsdoc.json" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d39c4621..d94deac27 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -117,9 +117,6 @@ importers: jest: specifier: ^26.6.3 version: 26.6.3 - jest-mock: - specifier: ^29.7.0 - version: 29.7.0 jsdoc: specifier: ^4.0.2 version: 4.0.4 @@ -368,9 +365,15 @@ importers: packages/ilib-lint-common: devDependencies: + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 '@tsconfig/node14': specifier: ^14.1.0 version: 14.1.2 + '@types/jest': + specifier: ^29.5.14 + version: 29.5.14 '@types/node': specifier: ^20.11.5 version: 20.17.4 @@ -946,6 +949,9 @@ importers: loctool: specifier: workspace:^ version: link:../loctool + micromatch: + specifier: ^4.0.8 + version: 4.0.8 packages/ilib-loctool-javascript-resource: dependencies: @@ -968,6 +974,9 @@ importers: json5: specifier: ^2.2.3 version: 2.2.3 + micromatch: + specifier: ^4.0.8 + version: 4.0.8 devDependencies: jest: specifier: ^29.0.0 @@ -1013,6 +1022,9 @@ importers: packages/ilib-loctool-mrkdwn: dependencies: + ilib: + specifier: ^14.20.0 + version: 14.20.0 ilib-tree-node: specifier: workspace:^ version: link:../ilib-tree-node @@ -1179,6 +1191,9 @@ importers: ilib: specifier: ^14.18.0 version: 14.20.0 + micromatch: + specifier: ^4.0.8 + version: 4.0.8 xml-js: specifier: ^1.6.11 version: 1.6.11 diff --git a/scripts/binary-scripts-mapping.js b/scripts/binary-scripts-mapping.js new file mode 100644 index 000000000..d2468fa3b --- /dev/null +++ b/scripts/binary-scripts-mapping.js @@ -0,0 +1,112 @@ +const fs = require("fs"); + +// usage: node scripts/binary-scripts.js +// This script will modify the package.json files of all packages in the `packages` directory +// to use Jest js binary `node_modules/jest/bin/jest.js` instead of the pnpm shell wrapper +// `node_modules/.bin/jest` to avoid the issue described in https://github.com/pnpm/pnpm/issues/8863; +// It will also print a set of all scripts from all packages for visual inspection +// in case any further bulk fixes are needed - to use mapping, add a new entry to the `scriptsMap` object +// with the original script as the key and the new script as the value + +const scriptsSet = new Set(); + +const scriptsMap = new Map([ + [`jest`, `node node_modules/jest/bin/jest.js`], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest --testEnvironment node`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules --inspect-brk" jest -i`, + `LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules --inspect-brk" jest -i --testEnvironment node`, + `LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules --inspect-brk" jest -i --testEnvironment node`, + `LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i --testEnvironment node`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest --testEnvironment node`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest --testEnvironment node --detectOpenHandles`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --detectOpenHandles`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest --testEnvironment node --detectOpenHandles --watch`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --detectOpenHandles --watch`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest --testEnvironment node --watch`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --testEnvironment node --watch`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" jest --watch`, + `LANG=en_US.UTF8 node --experimental-vm-modules node_modules/jest/bin/jest.js --watch`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --trace-warnings --experimental-vm-modules --inspect-brk" jest -i`, + `LANG=en_US.UTF8 node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js -i`, + ], + [ + `LANG=en_US.UTF8 NODE_OPTIONS="$NODE_OPTIONS --trace-warnings --experimental-vm-modules" jest`, + `LANG=en_US.UTF8 node --trace-warnings --experimental-vm-modules node_modules/jest/bin/jest.js`, + ], + [ + `NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules --inspect-brk" jest --testEnvironment node --detectOpenHandles -i`, + `node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node --detectOpenHandles -i`, + ], + [ + `NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules --inspect-brk" jest --testEnvironment node -i`, + `node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i`, + ], + [`NODE_OPTIONS="$NODE_OPTIONS --inspect-brk" jest`, `node --inspect-brk node_modules/jest/bin/jest.js`], + [`NODE_OPTIONS="$NODE_OPTIONS --inspect-brk" jest -i`, `node --inspect-brk node_modules/jest/bin/jest.js -i`], + [`jest --watch`, `node node_modules/jest/bin/jest.js --watch`], + [ + `pnpm build:dev && node --experimental-vm-modules --inspect-brk node_modules/.bin/jest --testEnvironment node -i`, + `pnpm build:dev && node --experimental-vm-modules --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i`, + ], + [ + `pnpm build:dev; NODE_OPTIONS="$NODE_OPTIONS --inspect-brk" jest --testEnvironment node -i`, + `pnpm build:dev; node --inspect-brk node_modules/jest/bin/jest.js --testEnvironment node -i`, + ], +]); + +const packageFiles = fs + .readdirSync("packages") + .map((package) => `packages/${package}/package.json`) + .filter((file) => fs.existsSync(file)); + +for (const path of packageFiles) { + const data = fs.readFileSync(path, "utf8"); + const pkg = JSON.parse(data); + + const { scripts } = pkg; + if (!scripts) { + continue; + } + + let didModify = false; + for (const [scriptName, scriptValue] of Object.entries(scripts)) { + if (scriptsMap.has(scriptValue)) { + scripts[scriptName] = scriptsMap.get(scriptValue); + didModify = true; + } + } + if (didModify) { + fs.writeFileSync(path, JSON.stringify(pkg, null, 4)); + } + + Object.values(scripts).forEach((scriptValue) => scriptsSet.add(scriptValue)); +} + +console.log([...scriptsSet].sort().join("\n"));