@gjsify/cli 0.16.0 → 0.16.1
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 +112 -112
- package/lib/commands/pack.js +25 -11
- package/package.json +18 -18
package/lib/commands/pack.js
CHANGED
|
@@ -172,8 +172,18 @@ export async function packWorkspace(wsDir, opts = {}) {
|
|
|
172
172
|
* Walk the workspace and return the list of files to include in the tarball,
|
|
173
173
|
* relative to `wsDir`. Mirrors npm pack's selection rules:
|
|
174
174
|
*
|
|
175
|
-
* - If pkg.files exists:
|
|
176
|
-
*
|
|
175
|
+
* - If pkg.files exists: the array is an ALLOWLIST that overrides
|
|
176
|
+
* .gitignore / .npmignore entirely. Every file under an allowlisted
|
|
177
|
+
* path/dir ships from disk; only the hardcoded implicit-exclusion set
|
|
178
|
+
* (node_modules, .git, lockfiles, … — applied by `walkAll` /
|
|
179
|
+
* `expandFilesPatterns`) and npm's always-ignore names are dropped.
|
|
180
|
+
* This matches `npm pack`: a `files` entry re-includes a path even when
|
|
181
|
+
* .gitignore/.npmignore would drop it (verified against `npm pack
|
|
182
|
+
* --dry-run`). Trimming `files`-allowlisted content by .gitignore
|
|
183
|
+
* silently dropped build-generated-but-allowlisted files like
|
|
184
|
+
* adwaita-web's `src/styles.generated.ts` (gitignored, allowlisted via
|
|
185
|
+
* `files: ["src"]`) — shipping a broken tarball whose `src/index.ts`
|
|
186
|
+
* imported a file the tarball didn't contain.
|
|
177
187
|
* - Otherwise: walk everything, apply .npmignore + .gitignore, drop the
|
|
178
188
|
* implicit-exclusion set (node_modules, .git, …)
|
|
179
189
|
*
|
|
@@ -185,18 +195,22 @@ function collectFiles(wsDir, pkg) {
|
|
|
185
195
|
const filesField = Array.isArray(pkg.files)
|
|
186
196
|
? pkg.files.filter((f) => typeof f === 'string')
|
|
187
197
|
: null;
|
|
188
|
-
|
|
198
|
+
const out = new Set();
|
|
189
199
|
if (filesField) {
|
|
190
|
-
|
|
200
|
+
// A `files` allowlist overrides .gitignore/.npmignore — ship every
|
|
201
|
+
// allowlisted path from disk. `expandFilesPatterns` already excludes
|
|
202
|
+
// the NEVER_INCLUDED_BASENAMES set (node_modules, .git, lockfiles, …)
|
|
203
|
+
// via `walkAll`, so junk is still kept out.
|
|
204
|
+
for (const f of expandFilesPatterns(wsDir, filesField))
|
|
205
|
+
out.add(f);
|
|
191
206
|
}
|
|
192
207
|
else {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
out.add(f);
|
|
208
|
+
// No `files` field — walk everything and apply .npmignore/.gitignore.
|
|
209
|
+
const ignore = loadIgnore(wsDir);
|
|
210
|
+
for (const f of walkAll(wsDir)) {
|
|
211
|
+
if (!ignore(f))
|
|
212
|
+
out.add(f);
|
|
213
|
+
}
|
|
200
214
|
}
|
|
201
215
|
for (const f of always) {
|
|
202
216
|
if (existsSync(join(wsDir, f)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/cli",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "CLI for Gjsify",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -122,33 +122,33 @@
|
|
|
122
122
|
"cli"
|
|
123
123
|
],
|
|
124
124
|
"dependencies": {
|
|
125
|
-
"@gjsify/buffer": "^0.16.
|
|
126
|
-
"@gjsify/create-app": "^0.16.
|
|
127
|
-
"@gjsify/node-globals": "^0.16.
|
|
128
|
-
"@gjsify/node-polyfills": "^0.16.
|
|
129
|
-
"@gjsify/npm-registry": "^0.16.
|
|
130
|
-
"@gjsify/resolve-npm": "^0.16.
|
|
131
|
-
"@gjsify/rolldown-plugin-gjsify": "^0.16.
|
|
132
|
-
"@gjsify/rolldown-plugin-pnp": "^0.16.
|
|
133
|
-
"@gjsify/semver": "^0.16.
|
|
134
|
-
"@gjsify/tar": "^0.16.
|
|
135
|
-
"@gjsify/tsc": "^0.16.
|
|
136
|
-
"@gjsify/web-polyfills": "^0.16.
|
|
137
|
-
"@gjsify/workspace": "^0.16.
|
|
125
|
+
"@gjsify/buffer": "^0.16.1",
|
|
126
|
+
"@gjsify/create-app": "^0.16.1",
|
|
127
|
+
"@gjsify/node-globals": "^0.16.1",
|
|
128
|
+
"@gjsify/node-polyfills": "^0.16.1",
|
|
129
|
+
"@gjsify/npm-registry": "^0.16.1",
|
|
130
|
+
"@gjsify/resolve-npm": "^0.16.1",
|
|
131
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.16.1",
|
|
132
|
+
"@gjsify/rolldown-plugin-pnp": "^0.16.1",
|
|
133
|
+
"@gjsify/semver": "^0.16.1",
|
|
134
|
+
"@gjsify/tar": "^0.16.1",
|
|
135
|
+
"@gjsify/tsc": "^0.16.1",
|
|
136
|
+
"@gjsify/web-polyfills": "^0.16.1",
|
|
137
|
+
"@gjsify/workspace": "^0.16.1",
|
|
138
138
|
"cosmiconfig": "^9.0.2",
|
|
139
139
|
"get-tsconfig": "^4.14.0",
|
|
140
140
|
"pkg-types": "^2.3.1",
|
|
141
|
-
"rolldown": "^1.1.
|
|
141
|
+
"rolldown": "^1.1.4",
|
|
142
142
|
"yargs": "^18.0.0"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@gjsify/unit": "^0.16.
|
|
145
|
+
"@gjsify/unit": "^0.16.1",
|
|
146
146
|
"@types/yargs": "^17.0.35",
|
|
147
147
|
"typescript": "^6.0.3"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
150
|
-
"@gjsify/oxfmt-native": "^0.16.
|
|
151
|
-
"@gjsify/rolldown-native": "^0.16.
|
|
150
|
+
"@gjsify/oxfmt-native": "^0.16.1",
|
|
151
|
+
"@gjsify/rolldown-native": "^0.16.1"
|
|
152
152
|
},
|
|
153
153
|
"peerDependenciesMeta": {
|
|
154
154
|
"@gjsify/oxfmt-native": {
|