@gjsify/rolldown-plugin-gjsify 0.52.0 → 0.53.0
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/README.md +11 -0
- package/lib/app/browser.js +1 -0
- package/lib/app/gjs.js +14 -2
- package/lib/app/nativescript.js +1 -1
- package/lib/app/node.d.ts +1 -1
- package/lib/app/node.js +26 -10
- package/lib/index.d.ts +3 -1
- package/lib/index.js +3 -1
- package/lib/plugins/console-assign.d.ts +13 -0
- package/lib/plugins/console-assign.js +125 -0
- package/lib/plugins/css-as-string.js +126 -44
- package/lib/plugins/gi-renderer.d.ts +1 -1
- package/lib/plugins/gi-renderer.js +1 -1
- package/lib/plugins/gi-runtime-paths.js +5 -2
- package/lib/plugins/napi-node-addon.d.ts +48 -4
- package/lib/plugins/napi-node-addon.js +261 -85
- package/lib/plugins/node-native-external.d.ts +20 -0
- package/lib/plugins/node-native-external.js +145 -0
- package/lib/plugins/rewrite-node-modules-paths.d.ts +18 -1
- package/lib/plugins/rewrite-node-modules-paths.js +181 -25
- package/lib/plugins/unresolved-workspace-import.js +89 -68
- package/lib/shims/addon-resolve.d.ts +19 -0
- package/lib/shims/addon-resolve.js +193 -0
- package/lib/utils/addon-platform.d.ts +23 -0
- package/lib/utils/addon-platform.js +50 -0
- package/lib/utils/auto-globals.d.ts +6 -0
- package/lib/utils/auto-globals.js +13 -10
- package/lib/utils/declare-build-input.d.ts +13 -0
- package/lib/utils/declare-build-input.js +37 -0
- package/lib/utils/detect-free-globals.d.ts +3 -0
- package/lib/utils/detect-free-globals.js +1 -1
- package/lib/utils/entry-wrapper.js +6 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/inline-static-reads.d.ts +15 -1
- package/lib/utils/inline-static-reads.js +16 -8
- package/lib/utils/scan-globals.d.ts +2 -2
- package/lib/utils/scan-globals.js +20 -14
- package/lib/utils/zip-path.d.ts +9 -0
- package/lib/utils/zip-path.js +12 -0
- package/package.json +13 -9
|
@@ -126,20 +126,26 @@ export function isRegisterPathResolvable(registerPath, fromDir) {
|
|
|
126
126
|
const canonical = resolveRegisterAlias(registerPath);
|
|
127
127
|
const pkgName = packageNameFromRegisterPath(canonical);
|
|
128
128
|
const parts = pkgName.split('/');
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
// Several roots when the build may take a `@gjsify/*` from beside the running CLI
|
|
130
|
+
// (`toolchainAnchor`): the resolver would rescue the import, so this gate must not
|
|
131
|
+
// drop it first — it did, and `gjsify exec` rebuilt a consumer's bin with every
|
|
132
|
+
// global skipped because the PROJECT installs no `@gjsify/*` at all.
|
|
133
|
+
for (const start of typeof fromDir === 'string' ? [fromDir] : fromDir) {
|
|
134
|
+
// Walk up the directory tree mirroring Node's module-resolution
|
|
135
|
+
// algorithm: check <dir>/node_modules/<pkg>/package.json at each level.
|
|
136
|
+
let dir = start;
|
|
137
|
+
const root = dir.slice(0, dir.indexOf('/') + 1) || '/';
|
|
138
|
+
while (true) {
|
|
139
|
+
const candidate = join(dir, 'node_modules', ...parts, 'package.json');
|
|
140
|
+
if (existsSync(candidate))
|
|
141
|
+
return true;
|
|
142
|
+
if (dir === root)
|
|
143
|
+
break;
|
|
144
|
+
const parent = join(dir, '..');
|
|
145
|
+
if (parent === dir)
|
|
146
|
+
break;
|
|
147
|
+
dir = parent;
|
|
148
|
+
}
|
|
143
149
|
}
|
|
144
150
|
return false;
|
|
145
151
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does `path` run THROUGH a `.zip` archive (Yarn PnP's `.yarn/cache/<pkg>.zip/...`)?
|
|
3
|
+
*
|
|
4
|
+
* The separator is the host's as well as `/`: `relative()` and rolldown's module ids answer
|
|
5
|
+
* with `\` on win32, where a `.zip/`-only test never matched and a zip-resident module was
|
|
6
|
+
* sent down the on-disk path. `\` counts only there, because on POSIX it is a filename
|
|
7
|
+
* character. `separator` defaults to the host's; a parameter so both hosts are testable on one.
|
|
8
|
+
*/
|
|
9
|
+
export declare function hasZipSegment(path: string, separator?: string): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { sep } from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* Does `path` run THROUGH a `.zip` archive (Yarn PnP's `.yarn/cache/<pkg>.zip/...`)?
|
|
4
|
+
*
|
|
5
|
+
* The separator is the host's as well as `/`: `relative()` and rolldown's module ids answer
|
|
6
|
+
* with `\` on win32, where a `.zip/`-only test never matched and a zip-resident module was
|
|
7
|
+
* sent down the on-disk path. `\` counts only there, because on POSIX it is a filename
|
|
8
|
+
* character. `separator` defaults to the host's; a parameter so both hosts are testable on one.
|
|
9
|
+
*/
|
|
10
|
+
export function hasZipSegment(path, separator = sep) {
|
|
11
|
+
return path.includes('.zip/') || (separator === '\\' && path.includes('.zip\\'));
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/rolldown-plugin-gjsify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Rolldown / Rollup / Vite plugin orchestrator for GJS, Node, and Browser targets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
"./shims/module-resolve": {
|
|
26
26
|
"default": "./lib/shims/module-resolve.js"
|
|
27
27
|
},
|
|
28
|
+
"./shims/addon-resolve": {
|
|
29
|
+
"default": "./lib/shims/addon-resolve.js"
|
|
30
|
+
},
|
|
28
31
|
"./shims/unicorn-magic": {
|
|
29
32
|
"default": "./lib/shims/unicorn-magic.js"
|
|
30
33
|
}
|
|
@@ -60,11 +63,12 @@
|
|
|
60
63
|
],
|
|
61
64
|
"license": "MIT",
|
|
62
65
|
"dependencies": {
|
|
63
|
-
"@gjsify/console": "^0.
|
|
64
|
-
"@gjsify/resolve-npm": "^0.
|
|
65
|
-
"@gjsify/rolldown-plugin-deepkit": "^0.
|
|
66
|
-
"@gjsify/rolldown-plugin-pnp": "^0.
|
|
67
|
-
"@gjsify/
|
|
66
|
+
"@gjsify/console": "^0.53.0",
|
|
67
|
+
"@gjsify/resolve-npm": "^0.53.0",
|
|
68
|
+
"@gjsify/rolldown-plugin-deepkit": "^0.53.0",
|
|
69
|
+
"@gjsify/rolldown-plugin-pnp": "^0.53.0",
|
|
70
|
+
"@gjsify/utils": "^0.53.0",
|
|
71
|
+
"@gjsify/vite-plugin-blueprint": "^0.53.0",
|
|
68
72
|
"@rollup/pluginutils": "^5.4.0",
|
|
69
73
|
"acorn": "^8.17.0",
|
|
70
74
|
"acorn-typescript": "^1.4.13",
|
|
@@ -74,7 +78,7 @@
|
|
|
74
78
|
"sass": "^1.101.0"
|
|
75
79
|
},
|
|
76
80
|
"peerDependencies": {
|
|
77
|
-
"@gjsify/lightningcss-native": "^0.
|
|
81
|
+
"@gjsify/lightningcss-native": "^0.53.0",
|
|
78
82
|
"rolldown": "^1.1.4"
|
|
79
83
|
},
|
|
80
84
|
"peerDependenciesMeta": {
|
|
@@ -86,8 +90,8 @@
|
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
"devDependencies": {
|
|
89
|
-
"@gjsify/cli": "^0.
|
|
90
|
-
"@gjsify/unit": "^0.
|
|
93
|
+
"@gjsify/cli": "^0.53.0",
|
|
94
|
+
"@gjsify/unit": "^0.53.0",
|
|
91
95
|
"@types/node": "^25.9.2",
|
|
92
96
|
"rolldown": "^1.1.4",
|
|
93
97
|
"typescript": "^6.0.3"
|