@prosopo/config 3.3.9 → 3.3.11
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 +7 -6
- package/.turbo/turbo-build$colon$tsc.log +4 -4
- package/.turbo/turbo-build.log +8 -7
- package/CHANGELOG.md +10 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/vite/NodejsPolarsNativeFilePlugin.cjs +57 -0
- package/dist/cjs/vite/index.cjs +2 -0
- package/dist/cjs/vite/vite.backend.config.cjs +3 -1
- package/dist/index.js +2 -1
- package/dist/vite/NodejsPolarsNativeFilePlugin.d.ts +5 -1
- package/dist/vite/NodejsPolarsNativeFilePlugin.d.ts.map +1 -1
- package/dist/vite/NodejsPolarsNativeFilePlugin.js +44 -48
- package/dist/vite/NodejsPolarsNativeFilePlugin.js.map +1 -1
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +2 -1
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/vite.backend.config.d.ts.map +1 -1
- package/dist/vite/vite.backend.config.js +3 -1
- package/dist/vite/vite.backend.config.js.map +1 -1
- package/package.json +1 -1
- package/src/vite/NodejsPolarsNativeFilePlugin.ts +31 -15
- package/src/vite/index.ts +1 -0
- package/src/vite/vite.backend.config.ts +8 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/config@3.3.
|
|
2
|
+
> @prosopo/config@3.3.11 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-production}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -9,7 +9,7 @@ ViteCommonJSConfig: .
|
|
|
9
9
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
10
10
|
Bundle build started
|
|
11
11
|
[2K
|
|
12
|
-
✓
|
|
12
|
+
✓ 21 modules transformed.
|
|
13
13
|
rendering chunks...
|
|
14
14
|
computing gzip size...
|
|
15
15
|
dist/cjs/webpack/index.cjs 0.00 kB │ gzip: 0.02 kB
|
|
@@ -21,16 +21,17 @@ dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip:
|
|
|
21
21
|
dist/cjs/vite/vite-plugin-modify-exports-files.cjs 1.36 kB │ gzip: 0.70 kB
|
|
22
22
|
dist/cjs/vite/vite-plugin-copy.cjs 1.60 kB │ gzip: 0.65 kB
|
|
23
23
|
dist/cjs/vite/vite-plugin-close-and-copy.cjs 1.77 kB │ gzip: 0.67 kB
|
|
24
|
-
dist/cjs/vite/index.cjs 2.26 kB │ gzip: 0.50 kB
|
|
25
24
|
dist/cjs/vite/vite-plugin-remove-unused-translations.cjs 2.34 kB │ gzip: 1.01 kB
|
|
25
|
+
dist/cjs/vite/NodejsPolarsNativeFilePlugin.cjs 2.37 kB │ gzip: 0.81 kB
|
|
26
26
|
dist/cjs/vite/vite.esm.config.cjs 2.39 kB │ gzip: 0.92 kB
|
|
27
|
+
dist/cjs/vite/index.cjs 2.45 kB │ gzip: 0.53 kB
|
|
27
28
|
dist/cjs/vite/vite.commonjs.config.cjs 2.52 kB │ gzip: 0.99 kB
|
|
28
29
|
dist/cjs/vite/vite.threads.test.config.cjs 2.52 kB │ gzip: 1.00 kB
|
|
29
30
|
dist/cjs/vite/vite.test.config.cjs 2.72 kB │ gzip: 1.04 kB
|
|
30
|
-
dist/cjs/index.cjs 2.
|
|
31
|
-
dist/cjs/vite/vite.backend.config.cjs 3.
|
|
31
|
+
dist/cjs/index.cjs 2.94 kB │ gzip: 0.64 kB
|
|
32
|
+
dist/cjs/vite/vite.backend.config.cjs 3.65 kB │ gzip: 1.36 kB
|
|
32
33
|
dist/cjs/webpack/webpack.config.cjs 3.72 kB │ gzip: 1.30 kB
|
|
33
34
|
dist/cjs/dependencies.cjs 5.87 kB │ gzip: 1.92 kB
|
|
34
35
|
dist/cjs/vite/vite.frontend.config.cjs 6.89 kB │ gzip: 2.40 kB
|
|
35
36
|
|
|
36
|
-
[32m✓ built in
|
|
37
|
+
[32m✓ built in 58ms[39m
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/config@3.3.
|
|
2
|
+
> @prosopo/config@3.3.11 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
12:12:05 PM - Projects in this build:
|
|
6
6
|
* tsconfig.json
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
12:12:05 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
12:12:05 PM - Building project '/home/runner/work/captcha/captcha/dev/config/tsconfig.json'...
|
|
11
11
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/config@3.3.
|
|
2
|
+
> @prosopo/config@3.3.11 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.11 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -13,7 +13,7 @@ ViteEsmConfig: .
|
|
|
13
13
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
14
14
|
Bundle build started
|
|
15
15
|
[2K
|
|
16
|
-
✓
|
|
16
|
+
✓ 21 modules transformed.
|
|
17
17
|
rendering chunks...
|
|
18
18
|
computing gzip size...
|
|
19
19
|
dist/webpack/index.js 0.01 kB │ gzip: 0.03 kB
|
|
@@ -25,16 +25,17 @@ dist/vite/vite-plugin-externalize-obfuscator-deadcode.js 0.69 kB │ gzip: 0.38
|
|
|
25
25
|
dist/vite/vite-plugin-copy.js 1.22 kB │ gzip: 0.57 kB
|
|
26
26
|
dist/vite/vite-plugin-modify-exports-files.js 1.33 kB │ gzip: 0.70 kB
|
|
27
27
|
dist/vite/vite-plugin-close-and-copy.js 1.46 kB │ gzip: 0.61 kB
|
|
28
|
-
dist/vite/index.js 1.
|
|
28
|
+
dist/vite/index.js 1.72 kB │ gzip: 0.46 kB
|
|
29
29
|
dist/vite/vite.esm.config.js 1.90 kB │ gzip: 0.84 kB
|
|
30
|
-
dist/
|
|
30
|
+
dist/vite/NodejsPolarsNativeFilePlugin.js 1.99 kB │ gzip: 0.71 kB
|
|
31
31
|
dist/vite/vite.commonjs.config.js 2.00 kB │ gzip: 0.90 kB
|
|
32
|
+
dist/index.js 2.03 kB │ gzip: 0.53 kB
|
|
32
33
|
dist/vite/vite-plugin-remove-unused-translations.js 2.03 kB │ gzip: 0.92 kB
|
|
33
34
|
dist/vite/vite.threads.test.config.js 2.19 kB │ gzip: 0.94 kB
|
|
34
35
|
dist/vite/vite.test.config.js 2.29 kB │ gzip: 0.96 kB
|
|
35
36
|
dist/webpack/webpack.config.js 3.08 kB │ gzip: 1.23 kB
|
|
36
|
-
dist/vite/vite.backend.config.js 3.
|
|
37
|
+
dist/vite/vite.backend.config.js 3.12 kB │ gzip: 1.28 kB
|
|
37
38
|
dist/dependencies.js 5.31 kB │ gzip: 1.81 kB
|
|
38
39
|
dist/vite/vite.frontend.config.js 5.91 kB │ gzip: 2.27 kB
|
|
39
40
|
|
|
40
|
-
[32m✓ built in
|
|
41
|
+
[32m✓ built in 44ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @prosopo/config
|
|
2
2
|
|
|
3
|
+
## 3.3.11
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 6db5d8b: Move image-captcha merkle tree computation and per-solution leaf hashing to a Rust napi module (@prosopo/native-merkle). ~4× faster on realistic 9-solution commits. Extends the cli bundle plugin so multiple native-* .node files can coexist without basename collision.
|
|
7
|
+
|
|
8
|
+
## 3.3.10
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 721c5ba: Move JA4 TLS fingerprint computation to a Rust napi module (@prosopo/native-ja4). Provider-side JA4 middleware is ~2.7× faster on realistic ClientHellos. The cli bundle plugin now copies the .node binary next to the bundle so it works in the container.
|
|
12
|
+
|
|
3
13
|
## 3.3.9
|
|
4
14
|
### Patch Changes
|
|
5
15
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ const require_vite_esm_config = require("./vite/vite.esm.config.cjs");
|
|
|
14
14
|
const require_vite_plugin_remove_unused_translations = require("./vite/vite-plugin-remove-unused-translations.cjs");
|
|
15
15
|
const require_TsNoCheckPlugin = require("./vite/TsNoCheckPlugin.cjs");
|
|
16
16
|
const require_vite_plugin_modify_exports_files = require("./vite/vite-plugin-modify-exports-files.cjs");
|
|
17
|
+
const require_NodejsPolarsNativeFilePlugin = require("./vite/NodejsPolarsNativeFilePlugin.cjs");
|
|
17
18
|
exports.ViteBackendConfig = require_vite_backend_config.default;
|
|
18
19
|
exports.ViteCommonJSConfig = require_vite_commonjs_config.default;
|
|
19
20
|
exports.ViteEsmConfig = require_vite_esm_config.default;
|
|
@@ -31,4 +32,5 @@ exports.filterDependencies = require_dependencies.filterDependencies;
|
|
|
31
32
|
exports.getDependencies = require_dependencies.getDependencies;
|
|
32
33
|
exports.getExternalsFromReferences = require_dependencies.getExternalsFromReferences;
|
|
33
34
|
exports.getTsConfigs = require_dependencies.getTsConfigs;
|
|
35
|
+
exports.nodejsPolarsNativeFilePlugin = require_NodejsPolarsNativeFilePlugin.nodejsPolarsNativeFilePlugin;
|
|
34
36
|
exports.tsNoCheckPlugin = require_TsNoCheckPlugin.tsNoCheckPlugin;
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
//#region src/vite/NodejsPolarsNativeFilePlugin.ts
|
|
7
|
+
var entrySrc = (e) => typeof e === "string" ? e : e.src;
|
|
8
|
+
var entryDestBasename = (e) => typeof e === "string" ? node_path.default.basename(e) : e.dest;
|
|
9
|
+
var nodejsPolarsNativeFilePlugin = (nodeFiles, outDir) => {
|
|
10
|
+
const name = "nodejs-polars-native-file-plugin";
|
|
11
|
+
return {
|
|
12
|
+
name,
|
|
13
|
+
resolveId(source, importer, options) {
|
|
14
|
+
for (const entry of nodeFiles) if (node_path.default.basename(source) === node_path.default.basename(entrySrc(entry))) {
|
|
15
|
+
console.debug(name, "resolves", source, "imported by", importer);
|
|
16
|
+
return source;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
},
|
|
20
|
+
transform(code, id) {
|
|
21
|
+
for (const entry of nodeFiles) if (node_path.default.basename(id) === node_path.default.basename(entrySrc(entry))) {
|
|
22
|
+
console.debug(name, "transform", id);
|
|
23
|
+
return `
|
|
24
|
+
// create a custom require function to load .node files
|
|
25
|
+
import { createRequire } from 'module';
|
|
26
|
+
const customRequire = createRequire(require('url').pathToFileURL(__filename).href)
|
|
27
|
+
|
|
28
|
+
// load the .node file expecting it to be in the same directory as the output bundle
|
|
29
|
+
const content = customRequire('./${entryDestBasename(entry)}')
|
|
30
|
+
|
|
31
|
+
// export the content straight back out again
|
|
32
|
+
export default content
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
return code;
|
|
36
|
+
},
|
|
37
|
+
load(id) {
|
|
38
|
+
for (const entry of nodeFiles) if (node_path.default.basename(id) === node_path.default.basename(entrySrc(entry))) {
|
|
39
|
+
console.debug(name, "load", id);
|
|
40
|
+
return "";
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
},
|
|
44
|
+
generateBundle(options, bundle) {
|
|
45
|
+
for (const entry of nodeFiles) {
|
|
46
|
+
const src = entrySrc(entry);
|
|
47
|
+
const out = `${outDir}/${entryDestBasename(entry)}`;
|
|
48
|
+
console.debug(name, "copy", src, "to", out);
|
|
49
|
+
const nodeFile = node_fs.default.readFileSync(src);
|
|
50
|
+
node_fs.default.mkdirSync(node_path.default.dirname(out), { recursive: true });
|
|
51
|
+
node_fs.default.writeFileSync(out, nodeFile);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.nodejsPolarsNativeFilePlugin = nodejsPolarsNativeFilePlugin;
|
package/dist/cjs/vite/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const require_vite_esm_config = require("./vite.esm.config.cjs");
|
|
|
12
12
|
const require_vite_plugin_remove_unused_translations = require("./vite-plugin-remove-unused-translations.cjs");
|
|
13
13
|
const require_TsNoCheckPlugin = require("./TsNoCheckPlugin.cjs");
|
|
14
14
|
const require_vite_plugin_modify_exports_files = require("./vite-plugin-modify-exports-files.cjs");
|
|
15
|
+
const require_NodejsPolarsNativeFilePlugin = require("./NodejsPolarsNativeFilePlugin.cjs");
|
|
15
16
|
exports.ViteBackendConfig = require_vite_backend_config.default;
|
|
16
17
|
exports.ViteCommonJSConfig = require_vite_commonjs_config.default;
|
|
17
18
|
exports.ViteEsmConfig = require_vite_esm_config.default;
|
|
@@ -25,4 +26,5 @@ exports.VitePluginRemoveUnusedTranslations = require_vite_plugin_remove_unused_t
|
|
|
25
26
|
exports.VitePluginSourceMapExclude = require_vite_plugin_sourcemap_exclude.default;
|
|
26
27
|
exports.ViteTestConfig = require_vite_test_config.default;
|
|
27
28
|
exports.ViteThreadsTestConfig = require_vite_threads_test_config.default;
|
|
29
|
+
exports.nodejsPolarsNativeFilePlugin = require_NodejsPolarsNativeFilePlugin.nodejsPolarsNativeFilePlugin;
|
|
28
30
|
exports.tsNoCheckPlugin = require_TsNoCheckPlugin.tsNoCheckPlugin;
|
|
@@ -18,7 +18,9 @@ async function vite_backend_config_default(packageName, packageVersion, bundleNa
|
|
|
18
18
|
"aws",
|
|
19
19
|
"webpack",
|
|
20
20
|
"vite",
|
|
21
|
-
"biome"
|
|
21
|
+
"biome",
|
|
22
|
+
"sharp",
|
|
23
|
+
"@img/"
|
|
22
24
|
]);
|
|
23
25
|
const allExternal = [
|
|
24
26
|
...node_module.builtinModules.filter((m) => m !== "punycode"),
|
package/dist/index.js
CHANGED
|
@@ -14,4 +14,5 @@ import vite_esm_config_default from "./vite/vite.esm.config.js";
|
|
|
14
14
|
import VitePluginRemoveUnusedTranslations from "./vite/vite-plugin-remove-unused-translations.js";
|
|
15
15
|
import { tsNoCheckPlugin } from "./vite/TsNoCheckPlugin.js";
|
|
16
16
|
import modifyExportsFilesPlugin from "./vite/vite-plugin-modify-exports-files.js";
|
|
17
|
-
|
|
17
|
+
import { nodejsPolarsNativeFilePlugin } from "./vite/NodejsPolarsNativeFilePlugin.js";
|
|
18
|
+
export { vite_backend_config_default as ViteBackendConfig, vite_commonjs_config_default as ViteCommonJSConfig, vite_esm_config_default as ViteEsmConfig, vite_frontend_config_default as ViteFrontendConfig, VitePluginCloseAndCopy, VitePluginCopy, VitePluginExternalizeObfuscatorDeadCode, VitePluginFixAbsoluteImports, modifyExportsFilesPlugin as VitePluginModifyExportsFiles, VitePluginRemoveUnusedTranslations, VitePluginSourcemapExclude as VitePluginSourceMapExclude, vite_test_config_default as ViteTestConfig, vite_threads_test_config_default as ViteThreadsTestConfig, filterDependencies, getDependencies, getExternalsFromReferences, getTsConfigs, nodejsPolarsNativeFilePlugin, tsNoCheckPlugin };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type NativeFileEntry = string | {
|
|
2
|
+
src: string;
|
|
3
|
+
dest: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const nodejsPolarsNativeFilePlugin: (nodeFiles: NativeFileEntry[], outDir: string) => {
|
|
2
6
|
name: string;
|
|
3
7
|
resolveId(source: string, importer: string | undefined, options: any): string | null;
|
|
4
8
|
transform(code: string, id: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodejsPolarsNativeFilePlugin.d.ts","sourceRoot":"","sources":["../../src/vite/NodejsPolarsNativeFilePlugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodejsPolarsNativeFilePlugin.d.ts","sourceRoot":"","sources":["../../src/vite/NodejsPolarsNativeFilePlugin.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAQrE,eAAO,MAAM,4BAA4B,cAC7B,eAAe,EAAE,UACpB,MAAM;;sBAMK,MAAM,YAAY,MAAM,GAAG,SAAS,WAAW,GAAG;oBAUpD,MAAM,MAAM,MAAM;aAwBzB,MAAM;4BAYS,GAAG,UAAU,GAAG;CAYzC,CAAC"}
|
|
@@ -1,58 +1,54 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
//#region src/vite/NodejsPolarsNativeFilePlugin.ts
|
|
4
|
+
var entrySrc = (e) => typeof e === "string" ? e : e.src;
|
|
5
|
+
var entryDestBasename = (e) => typeof e === "string" ? path.basename(e) : e.dest;
|
|
6
|
+
var nodejsPolarsNativeFilePlugin = (nodeFiles, outDir) => {
|
|
7
|
+
const name = "nodejs-polars-native-file-plugin";
|
|
8
|
+
return {
|
|
9
|
+
name,
|
|
10
|
+
resolveId(source, importer, options) {
|
|
11
|
+
for (const entry of nodeFiles) if (path.basename(source) === path.basename(entrySrc(entry))) {
|
|
12
|
+
console.debug(name, "resolves", source, "imported by", importer);
|
|
13
|
+
return source;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
},
|
|
17
|
+
transform(code, id) {
|
|
18
|
+
for (const entry of nodeFiles) if (path.basename(id) === path.basename(entrySrc(entry))) {
|
|
19
|
+
console.debug(name, "transform", id);
|
|
20
|
+
return `
|
|
21
21
|
// create a custom require function to load .node files
|
|
22
22
|
import { createRequire } from 'module';
|
|
23
23
|
const customRequire = createRequire(import.meta.url)
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
// load the .node file expecting it to be in the same directory as the output bundle
|
|
26
|
-
const content = customRequire('./${
|
|
27
|
-
|
|
26
|
+
const content = customRequire('./${entryDestBasename(entry)}')
|
|
27
|
+
|
|
28
28
|
// export the content straight back out again
|
|
29
29
|
export default content
|
|
30
30
|
`;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
53
|
-
fs.writeFileSync(out, nodeFile);
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
};
|
|
31
|
+
}
|
|
32
|
+
return code;
|
|
33
|
+
},
|
|
34
|
+
load(id) {
|
|
35
|
+
for (const entry of nodeFiles) if (path.basename(id) === path.basename(entrySrc(entry))) {
|
|
36
|
+
console.debug(name, "load", id);
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
},
|
|
41
|
+
generateBundle(options, bundle) {
|
|
42
|
+
for (const entry of nodeFiles) {
|
|
43
|
+
const src = entrySrc(entry);
|
|
44
|
+
const out = `${outDir}/${entryDestBasename(entry)}`;
|
|
45
|
+
console.debug(name, "copy", src, "to", out);
|
|
46
|
+
const nodeFile = fs.readFileSync(src);
|
|
47
|
+
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
48
|
+
fs.writeFileSync(out, nodeFile);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
57
52
|
};
|
|
58
|
-
//#
|
|
53
|
+
//#endregion
|
|
54
|
+
export { nodejsPolarsNativeFilePlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodejsPolarsNativeFilePlugin.js","sourceRoot":"","sources":["../../src/vite/NodejsPolarsNativeFilePlugin.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"NodejsPolarsNativeFilePlugin.js","sourceRoot":"","sources":["../../src/vite/NodejsPolarsNativeFilePlugin.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAW7B,MAAM,QAAQ,GAAG,CAAC,CAAkB,EAAU,EAAE,CAC/C,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAEnC,MAAM,iBAAiB,GAAG,CAAC,CAAkB,EAAU,EAAE,CACxD,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAEnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC3C,SAA4B,EAC5B,MAAc,EACb,EAAE;IACH,MAAM,IAAI,GAAG,kCAAkC,CAAC;IAChD,OAAO;QACN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AAO,IAAI,CAAC;QACb,CAAC;QAED,cAAc,CAAC,OAAY,EAAE,MAAW;YACvC,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAC5B,MAAM,YAAY,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC9C,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC;gBACxC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC5C,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;gBACtC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACrD,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YACjC,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ export { default as VitePluginRemoveUnusedTranslations } from "./vite-plugin-rem
|
|
|
12
12
|
export * from "./TsNoCheckPlugin.js";
|
|
13
13
|
export { default as VitePluginCopy } from "./vite-plugin-copy.js";
|
|
14
14
|
export { default as VitePluginModifyExportsFiles } from "./vite-plugin-modify-exports-files.js";
|
|
15
|
+
export { nodejsPolarsNativeFilePlugin } from "./NodejsPolarsNativeFilePlugin.js";
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/vite/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EA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AAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAC5G,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/vite/index.js
CHANGED
|
@@ -12,4 +12,5 @@ import vite_esm_config_default from "./vite.esm.config.js";
|
|
|
12
12
|
import VitePluginRemoveUnusedTranslations from "./vite-plugin-remove-unused-translations.js";
|
|
13
13
|
import { tsNoCheckPlugin } from "./TsNoCheckPlugin.js";
|
|
14
14
|
import modifyExportsFilesPlugin from "./vite-plugin-modify-exports-files.js";
|
|
15
|
-
|
|
15
|
+
import { nodejsPolarsNativeFilePlugin } from "./NodejsPolarsNativeFilePlugin.js";
|
|
16
|
+
export { vite_backend_config_default as ViteBackendConfig, vite_commonjs_config_default as ViteCommonJSConfig, vite_esm_config_default as ViteEsmConfig, vite_frontend_config_default as ViteFrontendConfig, VitePluginCloseAndCopy, VitePluginCopy, VitePluginExternalizeObfuscatorDeadCode, VitePluginFixAbsoluteImports, modifyExportsFilesPlugin as VitePluginModifyExportsFiles, VitePluginRemoveUnusedTranslations, VitePluginSourcemapExclude as VitePluginSourceMapExclude, vite_test_config_default as ViteTestConfig, vite_threads_test_config_default as ViteThreadsTestConfig, nodejsPolarsNativeFilePlugin, tsNoCheckPlugin };
|
package/dist/vite/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AACtH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAC5G,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AACtH,OAAO,EAAE,OA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AAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"vite.backend.config.d.ts","sourceRoot":"","sources":["../../src/vite/vite.backend.config.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAMvC,yBACC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjD,OAAO,CAAC,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,CAAC,CAyIrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.backend.config.js","sourceRoot":"","sources":["../../src/vite/vite.backend.config.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,uCAAuC,MAAM,kDAAkD,CAAC;AACvG,OAAO,4BAA4B,MAAM,uCAAuC,CAAC;AAEjF,MAAM,CAAC,OAAO,CAAC,KAAK,WACnB,WAAmB,EACnB,cAAsB,EACtB,UAAkB,EAClB,UAAkB,EAClB,KAAiD,EACjD,OAAgB,EAChB,IAAa,EACb,SAAkB;IAElB,MAAM,YAAY,GAAG,IAAI,KAAK,YAAY,CAAC;IAG3C,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,wBAAwB,EAAE,GACrD,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AE;gBACd,SAAS,EAAE;oBAIV,WAAW,EAAE,IAAI;oBACjB,iBAAiB,EAAE,IAAI;iBACvB;gBACD,QAAQ,EAAE,WAAW;gBACrB,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE;oBACP,cAAc,EAAE,GAAG,UAAU,mBAAmB;iBAChD;gBAED,OAAO,EAAE,CAAC,GAAG,EAAS,EAAE,IAAI,EAAS,CAAC;aACtC;SACD;QACD,OAAO,EAAE;YACR,uCAAuC,EAAE;YAEzC,4BAA4B,EAAE;YAE9B,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;SAC/C;KACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,8 +15,23 @@
|
|
|
15
15
|
import fs from "node:fs";
|
|
16
16
|
import path from "node:path";
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Each entry is either a plain path (copied under its original basename) or
|
|
20
|
+
* `{ src, dest }` where `dest` is the basename to write into `outDir`.
|
|
21
|
+
* Explicit `dest` lets consumers avoid collisions when they copy multiple
|
|
22
|
+
* .node files that napi-rs happens to name the same thing (each package it
|
|
23
|
+
* generates puts its binary at `index.<triple>.node`).
|
|
24
|
+
*/
|
|
25
|
+
export type NativeFileEntry = string | { src: string; dest: string };
|
|
26
|
+
|
|
27
|
+
const entrySrc = (e: NativeFileEntry): string =>
|
|
28
|
+
typeof e === "string" ? e : e.src;
|
|
29
|
+
|
|
30
|
+
const entryDestBasename = (e: NativeFileEntry): string =>
|
|
31
|
+
typeof e === "string" ? path.basename(e) : e.dest;
|
|
32
|
+
|
|
18
33
|
export const nodejsPolarsNativeFilePlugin = (
|
|
19
|
-
nodeFiles:
|
|
34
|
+
nodeFiles: NativeFileEntry[],
|
|
20
35
|
outDir: string,
|
|
21
36
|
) => {
|
|
22
37
|
const name = "nodejs-polars-native-file-plugin";
|
|
@@ -25,8 +40,8 @@ export const nodejsPolarsNativeFilePlugin = (
|
|
|
25
40
|
// biome-ignore lint/suspicious/noExplicitAny: TODO not sure of options type
|
|
26
41
|
resolveId(source: string, importer: string | undefined, options: any) {
|
|
27
42
|
// return the id if this plugin can resolve the import
|
|
28
|
-
for (const
|
|
29
|
-
if (path.basename(source) === path.basename(
|
|
43
|
+
for (const entry of nodeFiles) {
|
|
44
|
+
if (path.basename(source) === path.basename(entrySrc(entry))) {
|
|
30
45
|
console.debug(name, "resolves", source, "imported by", importer);
|
|
31
46
|
return source;
|
|
32
47
|
}
|
|
@@ -34,20 +49,22 @@ export const nodejsPolarsNativeFilePlugin = (
|
|
|
34
49
|
return null; // otherwise return null indicating that this plugin can't handle the import
|
|
35
50
|
},
|
|
36
51
|
transform(code: string, id: string) {
|
|
37
|
-
for (const
|
|
52
|
+
for (const entry of nodeFiles) {
|
|
38
53
|
// rewrite the code to import the .node file
|
|
39
|
-
if (path.basename(id) === path.basename(
|
|
54
|
+
if (path.basename(id) === path.basename(entrySrc(entry))) {
|
|
40
55
|
console.debug(name, "transform", id);
|
|
56
|
+
// Load the (possibly renamed) copy that lives beside the bundle.
|
|
57
|
+
const destBasename = entryDestBasename(entry);
|
|
41
58
|
// https://stackoverflow.com/questions/66378682/nodejs-loading-es-modules-and-native-addons-in-the-same-project
|
|
42
59
|
// this makes the .node file load at runtime from an esm context. .node files aren't native to esm, so we have to create a custom require function to load them. The custom require function is equivalent to the require function in commonjs, thus allowing the .node file to be loaded.
|
|
43
60
|
return `
|
|
44
61
|
// create a custom require function to load .node files
|
|
45
62
|
import { createRequire } from 'module';
|
|
46
63
|
const customRequire = createRequire(import.meta.url)
|
|
47
|
-
|
|
64
|
+
|
|
48
65
|
// load the .node file expecting it to be in the same directory as the output bundle
|
|
49
|
-
const content = customRequire('./${
|
|
50
|
-
|
|
66
|
+
const content = customRequire('./${destBasename}')
|
|
67
|
+
|
|
51
68
|
// export the content straight back out again
|
|
52
69
|
export default content
|
|
53
70
|
`;
|
|
@@ -56,8 +73,8 @@ export const nodejsPolarsNativeFilePlugin = (
|
|
|
56
73
|
return code;
|
|
57
74
|
},
|
|
58
75
|
load(id: string) {
|
|
59
|
-
for (const
|
|
60
|
-
if (path.basename(id) === path.basename(
|
|
76
|
+
for (const entry of nodeFiles) {
|
|
77
|
+
if (path.basename(id) === path.basename(entrySrc(entry))) {
|
|
61
78
|
console.debug(name, "load", id);
|
|
62
79
|
// whenever we encounter an import of the .node file, we return an empty string. This makes it look like the .node file is empty to the bundler. This is because we're going to copy the .node file to the output directory ourselves, so we don't want the bundler to include it in the output bundle (also because the bundler can't handle .node files, it tries to read them as js and then complains that it's invalid js)
|
|
63
80
|
const newCode = "";
|
|
@@ -68,11 +85,10 @@ export const nodejsPolarsNativeFilePlugin = (
|
|
|
68
85
|
},
|
|
69
86
|
// biome-ignore lint/suspicious/noExplicitAny: TODO not sure of options/bundle type
|
|
70
87
|
generateBundle(options: any, bundle: any) {
|
|
71
|
-
for (const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const out = `${outDir}/${
|
|
75
|
-
const src = `${fileAbs}`;
|
|
88
|
+
for (const entry of nodeFiles) {
|
|
89
|
+
const src = entrySrc(entry);
|
|
90
|
+
const destBasename = entryDestBasename(entry);
|
|
91
|
+
const out = `${outDir}/${destBasename}`;
|
|
76
92
|
console.debug(name, "copy", src, "to", out);
|
|
77
93
|
const nodeFile = fs.readFileSync(src);
|
|
78
94
|
fs.mkdirSync(path.dirname(out), { recursive: true });
|
package/src/vite/index.ts
CHANGED
|
@@ -25,3 +25,4 @@ export { default as VitePluginRemoveUnusedTranslations } from "./vite-plugin-rem
|
|
|
25
25
|
export * from "./TsNoCheckPlugin.js";
|
|
26
26
|
export { default as VitePluginCopy } from "./vite-plugin-copy.js";
|
|
27
27
|
export { default as VitePluginModifyExportsFiles } from "./vite-plugin-modify-exports-files.js";
|
|
28
|
+
export { nodejsPolarsNativeFilePlugin } from "./NodejsPolarsNativeFilePlugin.js";
|
|
@@ -44,12 +44,19 @@ export default async function (
|
|
|
44
44
|
? path.resolve(outputDir)
|
|
45
45
|
: path.resolve(packageDir, "dist/bundle");
|
|
46
46
|
|
|
47
|
-
// Get rid of any dependencies we don't want to bundle
|
|
47
|
+
// Get rid of any dependencies we don't want to bundle. `sharp` is a
|
|
48
|
+
// native module — bundling its JS shim but not the platform-specific
|
|
49
|
+
// binary in `@img/sharp-linux-x64/lib/sharp-linux-x64.node` produces a
|
|
50
|
+
// runtime "Could not load the sharp module" in the provider Docker
|
|
51
|
+
// image, so it stays external and is installed at container-build time
|
|
52
|
+
// via the generated package.json in docker/images/provider/dist/.
|
|
48
53
|
const { external, internal } = filterDependencies(deps, [
|
|
49
54
|
"aws",
|
|
50
55
|
"webpack",
|
|
51
56
|
"vite",
|
|
52
57
|
"biome",
|
|
58
|
+
"sharp",
|
|
59
|
+
"@img/",
|
|
53
60
|
]);
|
|
54
61
|
|
|
55
62
|
// `punycode` is a deprecated Node builtin that the userland npm package
|