diff --git a/package-lock.json b/package-lock.json index 4ec29c5b0..65f1e6d17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "chai-as-promised": "^7.1.1", "chai-subset": "^1.6.0", "concurrently": "^8.1.0", + "cross-env": "^7.0.3", "esbuild": "^0.17.19", "mocha": "^10.2.0", "mysql2": "^3.3.3", @@ -1186,6 +1187,38 @@ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -2498,6 +2531,12 @@ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, "node_modules/jest-diff": { "version": "29.5.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", @@ -3211,6 +3250,15 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -4038,6 +4086,27 @@ "randombytes": "^2.1.0" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/shell-quote": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", @@ -4701,6 +4770,21 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/which-boxed-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", diff --git a/package.json b/package.json index e0143fce8..ff512853a 100644 --- a/package.json +++ b/package.json @@ -38,10 +38,10 @@ "test": "npm run build && npm run test:node:build && concurrently -n node,typings,esmimports \"npm run test:node\" \"npm run test:typings\" \"npm run test:esmimports\"", "test:node:build": "tsc -p test/node", "test:node": "concurrently -n postgres,mysql,mssql,sqlite \"npm run test:node:postgres\" \"npm run test:node:mysql\" \"npm run test:node:mssql\" \"npm run test:node:sqlite\"", - "test:node:postgres": "DIALECT=postgres npm run test:node:run", - "test:node:mysql": "DIALECT=mysql npm run test:node:run", - "test:node:mssql": "DIALECT=mssql npm run test:node:run", - "test:node:sqlite": "DIALECT=sqlite npm run test:node:run", + "test:node:postgres": "cross-env DIALECT=postgres npm run test:node:run", + "test:node:mysql": "cross-env DIALECT=mysql npm run test:node:run", + "test:node:mssql": "cross-env DIALECT=mssql npm run test:node:run", + "test:node:sqlite": "cross-env DIALECT=sqlite npm run test:node:run", "test:node:run": "mocha --reporter min --timeout 15000 test/node/dist/**/*.test.js", "test:browser:build": "rm -rf test/browser/bundle.js && esbuild test/browser/main.ts --bundle --outfile=test/browser/bundle.js", "test:browser": "npm run build && npm run test:browser:build && node test/browser/test.js", @@ -82,6 +82,7 @@ "chai-as-promised": "^7.1.1", "chai-subset": "^1.6.0", "concurrently": "^8.1.0", + "cross-env": "^7.0.3", "esbuild": "^0.17.19", "mocha": "^10.2.0", "mysql2": "^3.3.3", diff --git a/scripts/module-fixup.js b/scripts/module-fixup.js index b0e1d5236..9267f856c 100755 --- a/scripts/module-fixup.js +++ b/scripts/module-fixup.js @@ -34,9 +34,9 @@ for (const ex of Object.keys(package.exports)) { const [, ...targetFolders] = package.exports[ex].require.split('/') const targetFileName = targetFolders.pop() - const target = path.relative( - path.join(ROOT_PATH, ...folders), - path.join(ROOT_PATH, ...targetFolders, targetFileName) + const target = path.posix.relative( + path.posix.join(ROOT_PATH, ...folders), + path.posix.join(ROOT_PATH, ...targetFolders, targetFileName) ) fs.mkdirSync(path.join(ROOT_PATH, ...folders), {