@atlaspack/cli 2.12.1-dev.3466 → 2.12.1-dev.3502
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/lib/cli.js +35 -2
- package/package.json +14 -14
- package/src/cli.js +44 -3
package/lib/cli.js
CHANGED
|
@@ -234,10 +234,9 @@ function makeDebugCommand() {
|
|
|
234
234
|
}
|
|
235
235
|
entries = entries.map(entry => _path().default.resolve(entry));
|
|
236
236
|
Object.assign(command, opts);
|
|
237
|
-
const Atlaspack = require('@atlaspack/core').default;
|
|
238
237
|
const fs = new (_fs().NodeFS)();
|
|
239
238
|
const options = await normalizeOptions(command, fs);
|
|
240
|
-
|
|
239
|
+
const Atlaspack = require('@atlaspack/core').default;
|
|
241
240
|
const atlaspack = new Atlaspack({
|
|
242
241
|
entries,
|
|
243
242
|
defaultConfig: require.resolve('@atlaspack/config-default', {
|
|
@@ -256,6 +255,40 @@ function makeDebugCommand() {
|
|
|
256
255
|
}
|
|
257
256
|
});
|
|
258
257
|
applyOptions(invalidate, commonOptions);
|
|
258
|
+
const buildAssetGraph = debug.command('build-asset-graph [input...]').description('Build the asset graph then exit').action(async (entries, opts, command) => {
|
|
259
|
+
try {
|
|
260
|
+
if (entries.length === 0) {
|
|
261
|
+
entries = ['.'];
|
|
262
|
+
}
|
|
263
|
+
entries = entries.map(entry => _path().default.resolve(entry));
|
|
264
|
+
Object.assign(command, opts);
|
|
265
|
+
const fs = new (_fs().NodeFS)();
|
|
266
|
+
const options = await normalizeOptions(command, fs);
|
|
267
|
+
const Atlaspack = require('@atlaspack/core').default;
|
|
268
|
+
const atlaspack = new Atlaspack({
|
|
269
|
+
entries,
|
|
270
|
+
defaultConfig: require.resolve('@atlaspack/config-default', {
|
|
271
|
+
paths: [fs.cwd(), __dirname]
|
|
272
|
+
}),
|
|
273
|
+
shouldPatchConsole: false,
|
|
274
|
+
...options,
|
|
275
|
+
shouldBuildLazily: true,
|
|
276
|
+
watchBackend: 'watchman',
|
|
277
|
+
featureFlags: {
|
|
278
|
+
...options.featureFlags,
|
|
279
|
+
fixQuadraticCacheInvalidation: 'NEW',
|
|
280
|
+
useLmdbJsLite: true
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
console.log('Created atlaspack instance');
|
|
284
|
+
await atlaspack.unstable_buildAssetGraph();
|
|
285
|
+
console.log('Done building asset graph');
|
|
286
|
+
process.exit(0);
|
|
287
|
+
} catch (err) {
|
|
288
|
+
handleUncaughtException(err);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
applyOptions(buildAssetGraph, commonOptions);
|
|
259
292
|
return debug;
|
|
260
293
|
}
|
|
261
294
|
program.addCommand(makeDebugCommand());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/cli",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
3
|
+
"version": "2.12.1-dev.3502+c2daeab5a",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"publishConfig": {
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"node": ">= 16.0.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaspack/config-default": "2.12.1-dev.
|
|
27
|
-
"@atlaspack/core": "2.12.1-dev.
|
|
28
|
-
"@atlaspack/diagnostic": "2.12.1-dev.
|
|
29
|
-
"@atlaspack/events": "2.12.1-dev.
|
|
30
|
-
"@atlaspack/feature-flags": "2.12.1-dev.
|
|
31
|
-
"@atlaspack/fs": "2.12.1-dev.
|
|
32
|
-
"@atlaspack/logger": "2.12.1-dev.
|
|
33
|
-
"@atlaspack/package-manager": "2.12.1-dev.
|
|
34
|
-
"@atlaspack/reporter-cli": "2.12.1-dev.
|
|
35
|
-
"@atlaspack/reporter-dev-server": "2.12.1-dev.
|
|
36
|
-
"@atlaspack/reporter-tracer": "2.12.1-dev.
|
|
37
|
-
"@atlaspack/utils": "2.12.1-dev.
|
|
26
|
+
"@atlaspack/config-default": "2.12.1-dev.3502+c2daeab5a",
|
|
27
|
+
"@atlaspack/core": "2.12.1-dev.3502+c2daeab5a",
|
|
28
|
+
"@atlaspack/diagnostic": "2.12.1-dev.3502+c2daeab5a",
|
|
29
|
+
"@atlaspack/events": "2.12.1-dev.3502+c2daeab5a",
|
|
30
|
+
"@atlaspack/feature-flags": "2.12.1-dev.3502+c2daeab5a",
|
|
31
|
+
"@atlaspack/fs": "2.12.1-dev.3502+c2daeab5a",
|
|
32
|
+
"@atlaspack/logger": "2.12.1-dev.3502+c2daeab5a",
|
|
33
|
+
"@atlaspack/package-manager": "2.12.1-dev.3502+c2daeab5a",
|
|
34
|
+
"@atlaspack/reporter-cli": "2.12.1-dev.3502+c2daeab5a",
|
|
35
|
+
"@atlaspack/reporter-dev-server": "2.12.1-dev.3502+c2daeab5a",
|
|
36
|
+
"@atlaspack/reporter-tracer": "2.12.1-dev.3502+c2daeab5a",
|
|
37
|
+
"@atlaspack/utils": "2.12.1-dev.3502+c2daeab5a",
|
|
38
38
|
"chalk": "^4.1.0",
|
|
39
39
|
"commander": "^7.0.0",
|
|
40
40
|
"get-port": "^4.2.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@babel/core": "^7.22.11",
|
|
45
45
|
"rimraf": "^5.0.5"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c2daeab5a12461903159dec34df5671eaaa9b749"
|
|
48
48
|
}
|
package/src/cli.js
CHANGED
|
@@ -248,12 +248,11 @@ function makeDebugCommand() {
|
|
|
248
248
|
entries = entries.map((entry) => path.resolve(entry));
|
|
249
249
|
|
|
250
250
|
Object.assign(command, opts);
|
|
251
|
-
|
|
252
|
-
const Atlaspack = require('@atlaspack/core').default;
|
|
253
251
|
const fs = new NodeFS();
|
|
254
252
|
const options = await normalizeOptions(command, fs);
|
|
255
253
|
|
|
256
|
-
|
|
254
|
+
const Atlaspack = require('@atlaspack/core').default;
|
|
255
|
+
|
|
257
256
|
const atlaspack = new Atlaspack({
|
|
258
257
|
entries,
|
|
259
258
|
defaultConfig: require.resolve('@atlaspack/config-default', {
|
|
@@ -274,6 +273,48 @@ function makeDebugCommand() {
|
|
|
274
273
|
});
|
|
275
274
|
applyOptions(invalidate, commonOptions);
|
|
276
275
|
|
|
276
|
+
const buildAssetGraph = debug
|
|
277
|
+
.command('build-asset-graph [input...]')
|
|
278
|
+
.description('Build the asset graph then exit')
|
|
279
|
+
.action(async (entries, opts, command: any) => {
|
|
280
|
+
try {
|
|
281
|
+
if (entries.length === 0) {
|
|
282
|
+
entries = ['.'];
|
|
283
|
+
}
|
|
284
|
+
entries = entries.map((entry) => path.resolve(entry));
|
|
285
|
+
|
|
286
|
+
Object.assign(command, opts);
|
|
287
|
+
const fs = new NodeFS();
|
|
288
|
+
const options = await normalizeOptions(command, fs);
|
|
289
|
+
|
|
290
|
+
const Atlaspack = require('@atlaspack/core').default;
|
|
291
|
+
|
|
292
|
+
const atlaspack = new Atlaspack({
|
|
293
|
+
entries,
|
|
294
|
+
defaultConfig: require.resolve('@atlaspack/config-default', {
|
|
295
|
+
paths: [fs.cwd(), __dirname],
|
|
296
|
+
}),
|
|
297
|
+
shouldPatchConsole: false,
|
|
298
|
+
...options,
|
|
299
|
+
shouldBuildLazily: true,
|
|
300
|
+
watchBackend: 'watchman',
|
|
301
|
+
featureFlags: {
|
|
302
|
+
...options.featureFlags,
|
|
303
|
+
fixQuadraticCacheInvalidation: 'NEW',
|
|
304
|
+
useLmdbJsLite: true,
|
|
305
|
+
},
|
|
306
|
+
});
|
|
307
|
+
console.log('Created atlaspack instance');
|
|
308
|
+
|
|
309
|
+
await atlaspack.unstable_buildAssetGraph();
|
|
310
|
+
console.log('Done building asset graph');
|
|
311
|
+
process.exit(0);
|
|
312
|
+
} catch (err) {
|
|
313
|
+
handleUncaughtException(err);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
applyOptions(buildAssetGraph, commonOptions);
|
|
317
|
+
|
|
277
318
|
return debug;
|
|
278
319
|
}
|
|
279
320
|
|