@gjsify/cli 0.4.24 → 0.4.26
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/dist/cli.gjs.mjs +122 -123
- package/lib/commands/install.js +27 -6
- package/package.json +15 -15
package/lib/commands/install.js
CHANGED
|
@@ -121,12 +121,33 @@ function depKindFromArgs(args) {
|
|
|
121
121
|
async function projectInstallNative(args) {
|
|
122
122
|
const cwd = process.cwd();
|
|
123
123
|
const pkgPath = join(cwd, 'package.json');
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
// gjsify install is a node_modules-linker installer (like `npm install`
|
|
125
|
+
// or `yarn --nodeLinker node-modules`): it materialises a node_modules/
|
|
126
|
+
// tree + gjsify-lock.json. It deliberately does NOT produce a Yarn PnP
|
|
127
|
+
// install, and the two resolution strategies cannot coexist — a leftover
|
|
128
|
+
// `.pnp.cjs` makes Node ignore the node_modules/ tree we write, leaving a
|
|
129
|
+
// silently broken project.
|
|
130
|
+
//
|
|
131
|
+
// Native PnP *generation* (a byte-identical `.pnp.cjs` + `.yarn/cache/*.zip`
|
|
132
|
+
// that yarn itself would accept) is intentionally out of scope: it would
|
|
133
|
+
// mean replicating yarn's libzip-deterministic archives, SHA-512 cache
|
|
134
|
+
// keys, cache-version tracking and virtual-locator synthesis, and would
|
|
135
|
+
// only ever match a single yarn release. So we stop here with actionable
|
|
136
|
+
// guidance instead of half-doing it.
|
|
137
|
+
//
|
|
138
|
+
// We do NOT point users at `GJSIFY_INSTALL_BACKEND=npm` from this error:
|
|
139
|
+
// that backend chokes on `workspace:` specs (`EUNSUPPORTEDPROTOCOL`),
|
|
140
|
+
// which is exactly what the workspace repos that reach this branch have.
|
|
141
|
+
const pnpResidue = ['.pnp.cjs', '.pnp.loader.mjs'].filter((f) => existsSync(join(cwd, f)));
|
|
142
|
+
if (pnpResidue.length > 0) {
|
|
143
|
+
throw new Error(`gjsify install uses the node_modules linker and cannot run in a Yarn PnP ` +
|
|
144
|
+
`project (found ${pnpResidue.join(', ')} in ${cwd}).\n\n` +
|
|
145
|
+
`• If this project uses \`gjsify install\` to manage dependencies, these PnP ` +
|
|
146
|
+
`files are stale residue from an earlier \`yarn install\` — remove them and re-run:\n` +
|
|
147
|
+
` rm -f .pnp.cjs .pnp.loader.mjs && rm -rf .yarn/cache .yarn/unplugged\n` +
|
|
148
|
+
` gjsify install\n\n` +
|
|
149
|
+
`• If instead you want Yarn to manage dependencies, set \`nodeLinker: node-modules\` ` +
|
|
150
|
+
`in .yarnrc.yml and run \`yarn install\` (not \`gjsify install\`).`);
|
|
130
151
|
}
|
|
131
152
|
// Workspace install (no args, root pkg.json has `workspaces`).
|
|
132
153
|
// Project-local `gjsify install <pkg>` inside a workspace child still
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.26",
|
|
4
4
|
"description": "CLI for Gjsify",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -120,18 +120,18 @@
|
|
|
120
120
|
"cli"
|
|
121
121
|
],
|
|
122
122
|
"dependencies": {
|
|
123
|
-
"@gjsify/buffer": "^0.4.
|
|
124
|
-
"@gjsify/create-app": "^0.4.
|
|
125
|
-
"@gjsify/node-globals": "^0.4.
|
|
126
|
-
"@gjsify/node-polyfills": "^0.4.
|
|
127
|
-
"@gjsify/npm-registry": "^0.4.
|
|
128
|
-
"@gjsify/resolve-npm": "^0.4.
|
|
129
|
-
"@gjsify/rolldown-plugin-gjsify": "^0.4.
|
|
130
|
-
"@gjsify/rolldown-plugin-pnp": "^0.4.
|
|
131
|
-
"@gjsify/semver": "^0.4.
|
|
132
|
-
"@gjsify/tar": "^0.4.
|
|
133
|
-
"@gjsify/web-polyfills": "^0.4.
|
|
134
|
-
"@gjsify/workspace": "^0.4.
|
|
123
|
+
"@gjsify/buffer": "^0.4.26",
|
|
124
|
+
"@gjsify/create-app": "^0.4.26",
|
|
125
|
+
"@gjsify/node-globals": "^0.4.26",
|
|
126
|
+
"@gjsify/node-polyfills": "^0.4.26",
|
|
127
|
+
"@gjsify/npm-registry": "^0.4.26",
|
|
128
|
+
"@gjsify/resolve-npm": "^0.4.26",
|
|
129
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.4.26",
|
|
130
|
+
"@gjsify/rolldown-plugin-pnp": "^0.4.26",
|
|
131
|
+
"@gjsify/semver": "^0.4.26",
|
|
132
|
+
"@gjsify/tar": "^0.4.26",
|
|
133
|
+
"@gjsify/web-polyfills": "^0.4.26",
|
|
134
|
+
"@gjsify/workspace": "^0.4.26",
|
|
135
135
|
"cosmiconfig": "^9.0.1",
|
|
136
136
|
"get-tsconfig": "^4.14.0",
|
|
137
137
|
"pkg-types": "^2.3.1",
|
|
@@ -139,12 +139,12 @@
|
|
|
139
139
|
"yargs": "^18.0.0"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"@gjsify/unit": "^0.4.
|
|
142
|
+
"@gjsify/unit": "^0.4.26",
|
|
143
143
|
"@types/yargs": "^17.0.35",
|
|
144
144
|
"typescript": "^6.0.3"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|
|
147
|
-
"@gjsify/rolldown-native": "^0.4.
|
|
147
|
+
"@gjsify/rolldown-native": "^0.4.26"
|
|
148
148
|
},
|
|
149
149
|
"peerDependenciesMeta": {
|
|
150
150
|
"@gjsify/rolldown-native": {
|