@prosopo/config 3.3.4 → 3.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$cjs.log +27 -24
- package/.turbo/turbo-build$colon$tsc.log +4 -4
- package/.turbo/turbo-build.log +28 -24
- package/CHANGELOG.md +32 -0
- package/dist/_virtual/_rolldown/runtime.js +3 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/dependencies.cjs +130 -137
- package/dist/cjs/index.cjs +31 -32
- package/dist/cjs/vite/TsNoCheckPlugin.cjs +11 -15
- package/dist/cjs/vite/index.cjs +26 -26
- package/dist/cjs/vite/vite-plugin-close-and-copy.cjs +42 -42
- package/dist/cjs/vite/vite-plugin-copy.cjs +39 -38
- package/dist/cjs/vite/vite-plugin-externalize-obfuscator-deadcode.cjs +25 -0
- package/dist/cjs/vite/vite-plugin-fix-absolute-imports.cjs +16 -24
- package/dist/cjs/vite/vite-plugin-remove-unused-translations.cjs +53 -74
- package/dist/cjs/vite/vite-plugin-sourcemap-exclude.cjs +12 -15
- package/dist/cjs/vite/vite.backend.config.cjs +87 -104
- package/dist/cjs/vite/vite.commonjs.config.cjs +69 -74
- package/dist/cjs/vite/vite.esm.config.cjs +71 -70
- package/dist/cjs/vite/vite.frontend.config.cjs +173 -210
- package/dist/cjs/vite/vite.test.config.cjs +70 -80
- package/dist/cjs/vite/vite.threads.test.config.cjs +67 -78
- package/dist/cjs/webpack/index.cjs +0 -2
- package/dist/cjs/webpack/webpack.config.cjs +108 -146
- package/dist/dependencies.d.ts.map +1 -1
- package/dist/dependencies.js +123 -138
- package/dist/dependencies.js.map +1 -1
- package/dist/index.js +14 -31
- package/dist/vite/TsNoCheckPlugin.js +12 -16
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +13 -25
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/vite-plugin-close-and-copy.js +37 -41
- package/dist/vite/vite-plugin-copy.js +32 -36
- package/dist/vite/vite-plugin-externalize-obfuscator-deadcode.d.ts +3 -0
- package/dist/vite/vite-plugin-externalize-obfuscator-deadcode.d.ts.map +1 -0
- package/dist/vite/vite-plugin-externalize-obfuscator-deadcode.js +25 -0
- package/dist/vite/vite-plugin-externalize-obfuscator-deadcode.js.map +1 -0
- package/dist/vite/vite-plugin-fix-absolute-imports.js +15 -24
- package/dist/vite/vite-plugin-remove-unused-translations.js +50 -76
- package/dist/vite/vite-plugin-sourcemap-exclude.js +12 -16
- package/dist/vite/vite.backend.config.d.ts.map +1 -1
- package/dist/vite/vite.backend.config.js +80 -101
- package/dist/vite/vite.backend.config.js.map +1 -1
- package/dist/vite/vite.commonjs.config.d.ts.map +1 -1
- package/dist/vite/vite.commonjs.config.js +61 -71
- package/dist/vite/vite.commonjs.config.js.map +1 -1
- package/dist/vite/vite.esm.config.d.ts.map +1 -1
- package/dist/vite/vite.esm.config.js +63 -67
- package/dist/vite/vite.esm.config.js.map +1 -1
- package/dist/vite/vite.frontend.config.d.ts.map +1 -1
- package/dist/vite/vite.frontend.config.js +158 -202
- package/dist/vite/vite.frontend.config.js.map +1 -1
- package/dist/vite/vite.test.config.d.ts.map +1 -1
- package/dist/vite/vite.test.config.js +63 -78
- package/dist/vite/vite.test.config.js.map +1 -1
- package/dist/vite/vite.threads.test.config.d.ts.map +1 -1
- package/dist/vite/vite.threads.test.config.js +61 -76
- package/dist/vite/vite.threads.test.config.js.map +1 -1
- package/dist/webpack/index.js +1 -1
- package/dist/webpack/webpack.config.d.ts +2 -0
- package/dist/webpack/webpack.config.d.ts.map +1 -1
- package/dist/webpack/webpack.config.js +96 -119
- package/dist/webpack/webpack.config.js.map +1 -1
- package/package.json +9 -9
- package/src/dependencies.ts +15 -2
- package/src/vite/index.ts +1 -0
- package/src/vite/vite-plugin-externalize-obfuscator-deadcode.ts +43 -0
- package/src/vite/vite.backend.config.ts +19 -2
- package/src/vite/vite.commonjs.config.ts +2 -0
- package/src/vite/vite.esm.config.ts +12 -0
- package/src/vite/vite.frontend.config.ts +19 -8
- package/src/vite/vite.test.config.ts +15 -10
- package/src/vite/vite.threads.test.config.ts +6 -9
- package/src/webpack/webpack.config.ts +8 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.cjs.config.ts +4 -0
- package/vite.esm.config.ts +9 -1
- package/.turbo/turbo-typecheck.log +0 -4
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/config@3.3.
|
|
2
|
+
> @prosopo/config@3.3.6 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-production}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
6
6
|
{ tsConfigPaths: [] }
|
|
7
7
|
{ externals: [] }
|
|
8
|
-
[
|
|
8
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
9
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
9
10
|
Bundle build started
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[32m✓[39m 17 modules transformed.
|
|
13
|
-
[33mEntry module "src/vite/vite-plugin-remove-unused-translations.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.[39m
|
|
11
|
+
[2K
|
|
12
|
+
✓ 19 modules transformed.
|
|
14
13
|
rendering chunks...
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
computing gzip size...
|
|
15
|
+
dist/cjs/webpack/index.cjs 0.00 kB │ gzip: 0.02 kB
|
|
16
|
+
dist/cjs/vite/vite-plugin-sourcemap-exclude.cjs 0.34 kB │ gzip: 0.23 kB
|
|
17
|
+
dist/cjs/vite/TsNoCheckPlugin.cjs 0.37 kB │ gzip: 0.24 kB
|
|
18
|
+
dist/cjs/vite/vite-plugin-fix-absolute-imports.cjs 0.60 kB │ gzip: 0.34 kB
|
|
19
|
+
dist/cjs/vite/vite-plugin-externalize-obfuscator-deadcode.cjs 0.68 kB │ gzip: 0.37 kB
|
|
20
|
+
dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
|
|
21
|
+
dist/cjs/vite/vite-plugin-copy.cjs 1.60 kB │ gzip: 0.65 kB
|
|
22
|
+
dist/cjs/vite/vite-plugin-close-and-copy.cjs 1.77 kB │ gzip: 0.67 kB
|
|
23
|
+
dist/cjs/vite/index.cjs 2.07 kB │ gzip: 0.46 kB
|
|
24
|
+
dist/cjs/vite/vite-plugin-remove-unused-translations.cjs 2.34 kB │ gzip: 1.01 kB
|
|
25
|
+
dist/cjs/vite/vite.esm.config.cjs 2.39 kB │ gzip: 0.92 kB
|
|
26
|
+
dist/cjs/vite/vite.commonjs.config.cjs 2.52 kB │ gzip: 0.99 kB
|
|
27
|
+
dist/cjs/vite/vite.threads.test.config.cjs 2.52 kB │ gzip: 1.00 kB
|
|
28
|
+
dist/cjs/index.cjs 2.54 kB │ gzip: 0.57 kB
|
|
29
|
+
dist/cjs/vite/vite.test.config.cjs 2.67 kB │ gzip: 1.03 kB
|
|
30
|
+
dist/cjs/vite/vite.backend.config.cjs 3.63 kB │ gzip: 1.35 kB
|
|
31
|
+
dist/cjs/webpack/webpack.config.cjs 3.72 kB │ gzip: 1.30 kB
|
|
32
|
+
dist/cjs/dependencies.cjs 5.87 kB │ gzip: 1.92 kB
|
|
33
|
+
dist/cjs/vite/vite.frontend.config.cjs 6.66 kB │ gzip: 2.32 kB
|
|
34
|
+
|
|
35
|
+
[32m✓ built in 72ms[39m
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/config@3.3.
|
|
2
|
+
> @prosopo/config@3.3.6 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
11:09:15 AM - Projects in this build:
|
|
6
6
|
* tsconfig.json
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
11:09:15 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
11:09:15 AM - Building project '/home/runner/work/captcha/captcha/dev/config/tsconfig.json'...
|
|
11
11
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/config@3.3.
|
|
2
|
+
> @prosopo/config@3.3.6 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/config@3.3.
|
|
6
|
+
> @prosopo/config@3.3.6 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
10
10
|
{ tsConfigPaths: [] }
|
|
11
11
|
{ externals: [] }
|
|
12
|
-
[
|
|
12
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
13
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
13
14
|
Bundle build started
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
[32m✓[39m 17 modules transformed.
|
|
15
|
+
[2K
|
|
16
|
+
✓ 19 modules transformed.
|
|
17
17
|
rendering chunks...
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
computing gzip size...
|
|
19
|
+
dist/webpack/index.js 0.01 kB │ gzip: 0.03 kB
|
|
20
|
+
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
21
|
+
dist/vite/vite-plugin-sourcemap-exclude.js 0.34 kB │ gzip: 0.23 kB
|
|
22
|
+
dist/vite/TsNoCheckPlugin.js 0.36 kB │ gzip: 0.23 kB
|
|
23
|
+
dist/vite/vite-plugin-fix-absolute-imports.js 0.59 kB │ gzip: 0.33 kB
|
|
24
|
+
dist/vite/vite-plugin-externalize-obfuscator-deadcode.js 0.69 kB │ gzip: 0.38 kB
|
|
25
|
+
dist/vite/vite-plugin-copy.js 1.22 kB │ gzip: 0.57 kB
|
|
26
|
+
dist/vite/vite-plugin-close-and-copy.js 1.46 kB │ gzip: 0.61 kB
|
|
27
|
+
dist/vite/index.js 1.47 kB │ gzip: 0.40 kB
|
|
28
|
+
dist/index.js 1.77 kB │ gzip: 0.48 kB
|
|
29
|
+
dist/vite/vite.esm.config.js 1.90 kB │ gzip: 0.84 kB
|
|
30
|
+
dist/vite/vite.commonjs.config.js 2.00 kB │ gzip: 0.90 kB
|
|
31
|
+
dist/vite/vite-plugin-remove-unused-translations.js 2.03 kB │ gzip: 0.92 kB
|
|
32
|
+
dist/vite/vite.threads.test.config.js 2.19 kB │ gzip: 0.94 kB
|
|
33
|
+
dist/vite/vite.test.config.js 2.24 kB │ gzip: 0.95 kB
|
|
34
|
+
dist/webpack/webpack.config.js 3.08 kB │ gzip: 1.23 kB
|
|
35
|
+
dist/vite/vite.backend.config.js 3.10 kB │ gzip: 1.27 kB
|
|
36
|
+
dist/dependencies.js 5.31 kB │ gzip: 1.81 kB
|
|
37
|
+
dist/vite/vite.frontend.config.js 5.68 kB │ gzip: 2.19 kB
|
|
38
|
+
|
|
39
|
+
[32m✓ built in 53ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @prosopo/config
|
|
2
2
|
|
|
3
|
+
## 3.3.6
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- c2ab027: chore(deps-dev): bump webpack-dev-server from 5.2.6 to 6.0.0
|
|
7
|
+
|
|
8
|
+
## 3.3.5
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 0e1171c: chore(deps): combined dependabot bumps (lodash, webpack-dev-server, sharp, i18next-http-middleware, actions/setup-node and transitive security updates)
|
|
12
|
+
- cb1b0b2: Honour /*#__PURE__*/ annotations when tree-shaking. Rolldown has no
|
|
13
|
+
`treeshake.preset`, so Rollup's "smallest" could not be carried across in the
|
|
14
|
+
Vite 8 upgrade; ignoring pure annotations retained dead library code that every
|
|
15
|
+
consumer shipped. Cuts ~17KB gzip off the procaptcha widget bundle with a
|
|
16
|
+
byte-identical detector bundle.
|
|
17
|
+
- 9fba3d3: Build workspace declarations before running tests. `turbo run test` depended only on `@prosopo/config#build`, so a package's dependencies were present in `dist` as bundled JavaScript with no `.d.ts`. Type checking then fell back to the compiled JS, which reports types as values and floods the run with implicit-any errors from other packages' output.
|
|
18
|
+
- e14fce6: chore(deps): bump vite to 6.4.3 and mongoose to 8.24.1, and adjust types for the mongoose 8.24 Document/ObjectId changes
|
|
19
|
+
- 89effc8: test(workspace): unit + type tests, fix root-path encoding, stale getters and coverage for non-`packages/` workspaces
|
|
20
|
+
|
|
21
|
+
- `getRootDir` used `new URL(...).pathname`, which is percent-encoded — a
|
|
22
|
+
checkout under a path containing a space or a `#` produced `%20`/`%23` and
|
|
23
|
+
every derived path failed to resolve. Now uses `fileURLToPath`.
|
|
24
|
+
- `getClientExampleDir` and `getDappExampleDir` returned paths for
|
|
25
|
+
`demos/client-example` and `demos/dapp-example`, neither of which exists any
|
|
26
|
+
more. Both were unused; removed.
|
|
27
|
+
- `findWorkspaceRoot` takes an optional injected dependency set so the search
|
|
28
|
+
can be tested against a synthetic tree, and no longer parses package.json
|
|
29
|
+
into an implicitly-`any` value.
|
|
30
|
+
- `ViteTestConfig` decided whether it was running inside a package by looking
|
|
31
|
+
for `/packages/` in the cwd, so workspaces under `dev/`, `demos/` and
|
|
32
|
+
`integration/` fell through to the repo-root globs and reported 0/0 coverage
|
|
33
|
+
regardless of what their tests covered.
|
|
34
|
+
|
|
3
35
|
## 3.3.4
|
|
4
36
|
### Patch Changes
|
|
5
37
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
|
@@ -1,152 +1,145 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
6
|
+
let node_child_process = require("node:child_process");
|
|
7
|
+
node_child_process = require_runtime.__toESM(node_child_process, 1);
|
|
8
|
+
let node_util = require("node:util");
|
|
9
|
+
node_util = require_runtime.__toESM(node_util, 1);
|
|
10
|
+
//#region src/dependencies.ts
|
|
11
|
+
var exec = node_util.default.promisify(node_child_process.default.exec);
|
|
12
|
+
var peerDepsRegex = /UNMET\sOPTIONAL\sDEPENDENCY\s+(@*[\w\-/.]+)@/;
|
|
13
|
+
var depsRegex = /\s+(@*[\w\-/.]+)@/;
|
|
14
|
+
var getTsconfigDir = (tsConfigPath) => ".json" === node_path.default.extname(tsConfigPath) ? node_path.default.dirname(tsConfigPath) : tsConfigPath;
|
|
11
15
|
async function getPackageDir(packageName) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new Error("CONFIG.INVALID_PACKAGE_DIR");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return packageDir.trim() || path.resolve();
|
|
16
|
+
let pkg = packageName;
|
|
17
|
+
if (packageName && !packageName.startsWith("@prosopo/")) pkg = `@prosopo/${packageName}`;
|
|
18
|
+
const pkgCommand = `npm list ${pkg} -ap`;
|
|
19
|
+
console.info(`Running command ${pkgCommand}`);
|
|
20
|
+
const { stdout: packageDir, stderr } = await exec(pkgCommand);
|
|
21
|
+
if (stderr) {
|
|
22
|
+
if (stderr.includes("ERR!")) throw new Error("CONFIG.INVALID_PACKAGE_DIR");
|
|
23
|
+
}
|
|
24
|
+
return packageDir.trim() || node_path.default.resolve();
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the tsconfig path for a reference using the initial tsconfig path and the reference path. If the reference
|
|
28
|
+
* does not contain a tsconfig filename, `tsconfig.json` will be appended to the path.
|
|
29
|
+
* @param initialTsConfigPath
|
|
30
|
+
* @param reference
|
|
31
|
+
*/
|
|
26
32
|
function getReferenceTsConfigPath(initialTsConfigPath, reference) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
if (!refTSConfigPath.endsWith(".json")) {
|
|
32
|
-
refTSConfigPath = path.resolve(refTSConfigPath, "tsconfig.json");
|
|
33
|
-
}
|
|
34
|
-
return refTSConfigPath;
|
|
33
|
+
let refTSConfigPath = node_path.default.resolve(getTsconfigDir(initialTsConfigPath), reference.path);
|
|
34
|
+
if (!refTSConfigPath.endsWith(".json")) refTSConfigPath = node_path.default.resolve(refTSConfigPath, "tsconfig.json");
|
|
35
|
+
return refTSConfigPath;
|
|
35
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the tsconfig paths for a package
|
|
39
|
+
* @param tsConfigPath the tsconfig path to start with
|
|
40
|
+
* @param ignorePatterns the patterns to ignore
|
|
41
|
+
* @param tsConfigPaths the tsconfig paths to add to
|
|
42
|
+
* @param includeInitialTsConfig return the initial tsconfig path in the returned array
|
|
43
|
+
*/
|
|
36
44
|
function getTsConfigs(tsConfigPath, ignorePatterns = [], tsConfigPaths = [], includeInitialTsConfig = true) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const refTSConfigPath = getReferenceTsConfigPath(
|
|
52
|
-
tsConfigPath,
|
|
53
|
-
reference
|
|
54
|
-
);
|
|
55
|
-
const newTsConfigs = getTsConfigs(
|
|
56
|
-
refTSConfigPath,
|
|
57
|
-
ignorePatterns,
|
|
58
|
-
tsConfigs
|
|
59
|
-
);
|
|
60
|
-
if (newTsConfigs.length > 0) {
|
|
61
|
-
const distinctTsConfigPaths = new Set(tsConfigs.concat(newTsConfigs));
|
|
62
|
-
tsConfigs = [...distinctTsConfigPaths];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return tsConfigs;
|
|
45
|
+
let tsConfigs = [...tsConfigPaths];
|
|
46
|
+
const references = JSON.parse(node_fs.default.readFileSync(tsConfigPath).toString()).references;
|
|
47
|
+
if (!tsConfigs.includes(tsConfigPath)) {
|
|
48
|
+
if (references) {
|
|
49
|
+
const ignore = ignorePatterns && ignorePatterns.length > 0 ? new RegExp(`${ignorePatterns.join("|")}`) : void 0;
|
|
50
|
+
if (includeInitialTsConfig) tsConfigs.push(tsConfigPath);
|
|
51
|
+
const filteredReferences = references.filter((reference) => ignore ? !ignore.test(reference.path) : false);
|
|
52
|
+
for (const reference of filteredReferences) {
|
|
53
|
+
const newTsConfigs = getTsConfigs(getReferenceTsConfigPath(tsConfigPath, reference), ignorePatterns, tsConfigs);
|
|
54
|
+
if (newTsConfigs.length > 0) tsConfigs = [...new Set(tsConfigs.concat(newTsConfigs))];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return tsConfigs;
|
|
68
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the workspace externals for a package
|
|
62
|
+
* @param tsConfigPath
|
|
63
|
+
* @param ignorePatterns
|
|
64
|
+
*/
|
|
69
65
|
async function getExternalsFromReferences(tsConfigPath, ignorePatterns = []) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
})
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
const externals = await Promise.all(promises);
|
|
98
|
-
console.debug({ externals });
|
|
99
|
-
return externals;
|
|
66
|
+
const tsConfigPaths = getTsConfigs(tsConfigPath, ignorePatterns, [], false);
|
|
67
|
+
console.debug({ tsConfigPaths });
|
|
68
|
+
const promises = [];
|
|
69
|
+
for (const refTsConfigPath of tsConfigPaths) {
|
|
70
|
+
const packageJsonPath = node_path.default.resolve(getTsconfigDir(refTsConfigPath), "package.json");
|
|
71
|
+
promises.push(new Promise((resolve, reject) => {
|
|
72
|
+
node_fs.default.stat(packageJsonPath, (err) => {
|
|
73
|
+
if (err) reject(err);
|
|
74
|
+
node_fs.default.readFile(packageJsonPath, (err, buffer) => {
|
|
75
|
+
if (err) reject(err);
|
|
76
|
+
else {
|
|
77
|
+
const pkg = JSON.parse(buffer.toString()).name;
|
|
78
|
+
resolve(pkg);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
const externals = await Promise.all(promises);
|
|
85
|
+
console.debug({ externals });
|
|
86
|
+
return externals;
|
|
100
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Get the dependencies for a package
|
|
90
|
+
* @param packageName
|
|
91
|
+
* @param production
|
|
92
|
+
*/
|
|
101
93
|
async function getDependencies(packageName, production) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
)
|
|
133
|
-
};
|
|
94
|
+
let cmd = production ? "npm ls -a --silent --omit=dev --package-lock-only" : "npm ls --silent -a --package-lock-only";
|
|
95
|
+
if (packageName) {
|
|
96
|
+
const packageDir = await getPackageDir(packageName);
|
|
97
|
+
cmd = `cd ${packageDir.trim()} && ${cmd}`;
|
|
98
|
+
console.info(`Running command ${cmd} in ${packageDir}`);
|
|
99
|
+
}
|
|
100
|
+
let concat = "";
|
|
101
|
+
try {
|
|
102
|
+
const { stdout, stderr } = await exec(cmd);
|
|
103
|
+
concat = stdout + stderr;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
const execError = error;
|
|
106
|
+
if (typeof execError.stdout === "string") concat = execError.stdout + (execError.stderr ?? "");
|
|
107
|
+
else throw error;
|
|
108
|
+
}
|
|
109
|
+
let deps = [];
|
|
110
|
+
let peerDeps = [];
|
|
111
|
+
for (const line of concat.split("\n")) if (line.includes("UNMET OPTIONAL DEPENDENCY")) {
|
|
112
|
+
const parts = line.match(peerDepsRegex);
|
|
113
|
+
if (parts && parts.length > 1) peerDeps.push(parts[1]);
|
|
114
|
+
} else {
|
|
115
|
+
const parts = line.match(depsRegex);
|
|
116
|
+
if (parts && parts.length > 1) deps.push(parts[1]);
|
|
117
|
+
}
|
|
118
|
+
deps = [...new Set(deps)];
|
|
119
|
+
peerDeps = [...new Set(peerDeps)];
|
|
120
|
+
return {
|
|
121
|
+
dependencies: deps.filter((x, i) => i === deps.indexOf(x)),
|
|
122
|
+
optionalPeerDependencies: peerDeps.filter((x, i) => i === peerDeps.indexOf(x))
|
|
123
|
+
};
|
|
134
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Filter out the dependencies we don't want
|
|
127
|
+
* @param deps
|
|
128
|
+
* @param filters
|
|
129
|
+
*/
|
|
135
130
|
function filterDependencies(deps, filters) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return { internal, external };
|
|
131
|
+
const depsWithLength = deps.filter((x, i) => i === deps.indexOf(x)).filter((dep) => dep.length > 0).sort();
|
|
132
|
+
const exclude = new RegExp(`${filters.join("|")}`);
|
|
133
|
+
const internal = [];
|
|
134
|
+
const external = [];
|
|
135
|
+
for (const dep of depsWithLength) if (exclude.test(dep)) external.push(dep);
|
|
136
|
+
else internal.push(dep);
|
|
137
|
+
return {
|
|
138
|
+
internal,
|
|
139
|
+
external
|
|
140
|
+
};
|
|
149
141
|
}
|
|
142
|
+
//#endregion
|
|
150
143
|
exports.filterDependencies = filterDependencies;
|
|
151
144
|
exports.getDependencies = getDependencies;
|
|
152
145
|
exports.getExternalsFromReferences = getExternalsFromReferences;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
require("./vite/
|
|
4
|
-
const
|
|
5
|
-
require("./
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.tsNoCheckPlugin =
|
|
2
|
+
const require_vite_plugin_close_and_copy = require("./vite/vite-plugin-close-and-copy.cjs");
|
|
3
|
+
const require_vite_plugin_externalize_obfuscator_deadcode = require("./vite/vite-plugin-externalize-obfuscator-deadcode.cjs");
|
|
4
|
+
const require_vite_plugin_sourcemap_exclude = require("./vite/vite-plugin-sourcemap-exclude.cjs");
|
|
5
|
+
const require_vite_test_config = require("./vite/vite.test.config.cjs");
|
|
6
|
+
const require_vite_threads_test_config = require("./vite/vite.threads.test.config.cjs");
|
|
7
|
+
const require_dependencies = require("./dependencies.cjs");
|
|
8
|
+
const require_vite_frontend_config = require("./vite/vite.frontend.config.cjs");
|
|
9
|
+
const require_vite_plugin_fix_absolute_imports = require("./vite/vite-plugin-fix-absolute-imports.cjs");
|
|
10
|
+
const require_vite_backend_config = require("./vite/vite.backend.config.cjs");
|
|
11
|
+
const require_vite_plugin_copy = require("./vite/vite-plugin-copy.cjs");
|
|
12
|
+
const require_vite_commonjs_config = require("./vite/vite.commonjs.config.cjs");
|
|
13
|
+
const require_vite_esm_config = require("./vite/vite.esm.config.cjs");
|
|
14
|
+
const require_vite_plugin_remove_unused_translations = require("./vite/vite-plugin-remove-unused-translations.cjs");
|
|
15
|
+
const require_TsNoCheckPlugin = require("./vite/TsNoCheckPlugin.cjs");
|
|
16
|
+
exports.ViteBackendConfig = require_vite_backend_config.default;
|
|
17
|
+
exports.ViteCommonJSConfig = require_vite_commonjs_config.default;
|
|
18
|
+
exports.ViteEsmConfig = require_vite_esm_config.default;
|
|
19
|
+
exports.ViteFrontendConfig = require_vite_frontend_config.default;
|
|
20
|
+
exports.VitePluginCloseAndCopy = require_vite_plugin_close_and_copy.default;
|
|
21
|
+
exports.VitePluginCopy = require_vite_plugin_copy.default;
|
|
22
|
+
exports.VitePluginExternalizeObfuscatorDeadCode = require_vite_plugin_externalize_obfuscator_deadcode.default;
|
|
23
|
+
exports.VitePluginFixAbsoluteImports = require_vite_plugin_fix_absolute_imports.default;
|
|
24
|
+
exports.VitePluginRemoveUnusedTranslations = require_vite_plugin_remove_unused_translations.default;
|
|
25
|
+
exports.VitePluginSourceMapExclude = require_vite_plugin_sourcemap_exclude.default;
|
|
26
|
+
exports.ViteTestConfig = require_vite_test_config.default;
|
|
27
|
+
exports.ViteThreadsTestConfig = require_vite_threads_test_config.default;
|
|
28
|
+
exports.filterDependencies = require_dependencies.filterDependencies;
|
|
29
|
+
exports.getDependencies = require_dependencies.getDependencies;
|
|
30
|
+
exports.getExternalsFromReferences = require_dependencies.getExternalsFromReferences;
|
|
31
|
+
exports.getTsConfigs = require_dependencies.getTsConfigs;
|
|
32
|
+
exports.tsNoCheckPlugin = require_TsNoCheckPlugin.tsNoCheckPlugin;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
|
+
//#region src/vite/TsNoCheckPlugin.ts
|
|
3
2
|
function tsNoCheckPlugin() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
};
|
|
3
|
+
return {
|
|
4
|
+
name: "vite-plugin-ts-nocheck",
|
|
5
|
+
generateBundle(_, bundle) {
|
|
6
|
+
for (const fileName in bundle) {
|
|
7
|
+
const chunk = bundle[fileName];
|
|
8
|
+
if (chunk.type === "chunk" && chunk.code) chunk.code = `// @ts-nocheck\n${chunk.code}`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
17
12
|
}
|
|
13
|
+
//#endregion
|
|
18
14
|
exports.tsNoCheckPlugin = tsNoCheckPlugin;
|