@atlaspack/cli 2.12.1-dev.3356

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 ADDED
@@ -0,0 +1,515 @@
1
+ "use strict";
2
+
3
+ function _core() {
4
+ const data = require("@atlaspack/core");
5
+ _core = function () {
6
+ return data;
7
+ };
8
+ return data;
9
+ }
10
+ function _fs() {
11
+ const data = require("@atlaspack/fs");
12
+ _fs = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _diagnostic() {
18
+ const data = _interopRequireDefault(require("@atlaspack/diagnostic"));
19
+ _diagnostic = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ function _utils() {
25
+ const data = require("@atlaspack/utils");
26
+ _utils = function () {
27
+ return data;
28
+ };
29
+ return data;
30
+ }
31
+ function _events() {
32
+ const data = require("@atlaspack/events");
33
+ _events = function () {
34
+ return data;
35
+ };
36
+ return data;
37
+ }
38
+ function _logger() {
39
+ const data = require("@atlaspack/logger");
40
+ _logger = function () {
41
+ return data;
42
+ };
43
+ return data;
44
+ }
45
+ function _chalk() {
46
+ const data = _interopRequireDefault(require("chalk"));
47
+ _chalk = function () {
48
+ return data;
49
+ };
50
+ return data;
51
+ }
52
+ function _commander() {
53
+ const data = _interopRequireDefault(require("commander"));
54
+ _commander = function () {
55
+ return data;
56
+ };
57
+ return data;
58
+ }
59
+ function _path() {
60
+ const data = _interopRequireDefault(require("path"));
61
+ _path = function () {
62
+ return data;
63
+ };
64
+ return data;
65
+ }
66
+ function _getPort() {
67
+ const data = _interopRequireDefault(require("get-port"));
68
+ _getPort = function () {
69
+ return data;
70
+ };
71
+ return data;
72
+ }
73
+ var _package = require("../package.json");
74
+ function _featureFlags() {
75
+ const data = require("@atlaspack/feature-flags");
76
+ _featureFlags = function () {
77
+ return data;
78
+ };
79
+ return data;
80
+ }
81
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82
+ const program = new (_commander().default.Command)();
83
+
84
+ // Exit codes in response to signals are traditionally
85
+ // 128 + signal value
86
+ // https://tldp.org/LDP/abs/html/exitcodes.html
87
+ const SIGINT_EXIT_CODE = 130;
88
+ async function logUncaughtError(e) {
89
+ if (e instanceof _diagnostic().default) {
90
+ for (let diagnostic of e.diagnostics) {
91
+ let {
92
+ message,
93
+ codeframe,
94
+ stack,
95
+ hints,
96
+ documentation
97
+ } = await (0, _utils().prettyDiagnostic)(diagnostic);
98
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error(_chalk().default.red(message));
99
+ if (codeframe || stack) {
100
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error('');
101
+ }
102
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error(codeframe);
103
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error(stack);
104
+ if ((stack || codeframe) && hints.length > 0) {
105
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error('');
106
+ }
107
+ for (let h of hints) {
108
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error(_chalk().default.blue(h));
109
+ }
110
+ if (documentation) {
111
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error(_chalk().default.magenta.bold(documentation));
112
+ }
113
+ }
114
+ } else {
115
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error(e);
116
+ }
117
+
118
+ // A hack to definitely ensure we logged the uncaught exception
119
+ await new Promise(resolve => setTimeout(resolve, 100));
120
+ }
121
+ const handleUncaughtException = async exception => {
122
+ try {
123
+ await logUncaughtError(exception);
124
+ } catch (err) {
125
+ console.error(exception);
126
+ console.error(err);
127
+ }
128
+ process.exit(1);
129
+ };
130
+ process.on('unhandledRejection', handleUncaughtException);
131
+ program.storeOptionsAsProperties();
132
+ program.version(_package.version);
133
+
134
+ // Only display choices available to callers OS
135
+ let watcherBackendChoices = ['brute-force'];
136
+ switch (process.platform) {
137
+ case 'darwin':
138
+ {
139
+ watcherBackendChoices.push('watchman', 'fs-events');
140
+ break;
141
+ }
142
+ case 'linux':
143
+ {
144
+ watcherBackendChoices.push('watchman', 'inotify');
145
+ break;
146
+ }
147
+ case 'win32':
148
+ {
149
+ watcherBackendChoices.push('watchman', 'windows');
150
+ break;
151
+ }
152
+ case 'freebsd' || 'openbsd':
153
+ {
154
+ watcherBackendChoices.push('watchman');
155
+ break;
156
+ }
157
+ default:
158
+ break;
159
+ }
160
+
161
+ // --no-cache, --cache-dir, --no-source-maps, --no-autoinstall, --global?, --public-url, --log-level
162
+ // --no-content-hash, --experimental-scope-hoisting, --detailed-report
163
+ const commonOptions = {
164
+ '--no-cache': 'disable the filesystem cache',
165
+ '--config <path>': 'specify which config to use. can be a path or a package name',
166
+ '--cache-dir <path>': 'set the cache directory. defaults to ".atlaspack-cache"',
167
+ '--watch-dir <path>': 'set the root watch directory. defaults to nearest lockfile or source control dir.',
168
+ '--watch-ignore [path]': [`list of directories watcher should not be tracking for changes. defaults to ['.git', '.hg']`, dirs => dirs.split(',')],
169
+ '--watch-backend': new (_commander().default.Option)('--watch-backend <name>', 'set watcher backend').choices(watcherBackendChoices),
170
+ '--no-source-maps': 'disable sourcemaps',
171
+ '--target [name]': ['only build given target(s)', (val, list) => list.concat([val]), []],
172
+ '--log-level <level>': new (_commander().default.Option)('--log-level <level>', 'set the log level').choices(['none', 'error', 'warn', 'info', 'verbose']),
173
+ '--dist-dir <dir>': 'output directory to write to when unspecified by targets',
174
+ '--no-autoinstall': 'disable autoinstall',
175
+ '--profile': 'enable sampling build profiling',
176
+ '--trace': 'enable build tracing',
177
+ '-V, --version': 'output the version number',
178
+ '--detailed-report [count]': ['print the asset timings and sizes in the build report', parseOptionInt],
179
+ '--reporter <name>': ['additional reporters to run', (val, acc) => {
180
+ acc.push(val);
181
+ return acc;
182
+ }, []],
183
+ '--feature-flag <name=value>': ['sets the value of a feature flag', (value, previousValue) => {
184
+ let [name, val] = value.split('=');
185
+ if (name in _featureFlags().DEFAULT_FEATURE_FLAGS) {
186
+ let featureFlagValue;
187
+ if (typeof _featureFlags().DEFAULT_FEATURE_FLAGS[name] === 'boolean') {
188
+ if (val !== 'true' && val !== 'false') {
189
+ throw new Error(`Feature flag ${name} must be set to true or false`);
190
+ }
191
+ featureFlagValue = val === 'true';
192
+ }
193
+ previousValue[name] = featureFlagValue ?? String(val);
194
+ } else {
195
+ _logger().INTERNAL_ORIGINAL_CONSOLE.warn(`Unknown feature flag ${name} specified, it will be ignored`);
196
+ }
197
+ return previousValue;
198
+ }, {}]
199
+ };
200
+ var hmrOptions = {
201
+ '--no-hmr': 'disable hot module replacement',
202
+ '-p, --port <port>': ['set the port to serve on. defaults to $PORT or 1234', process.env.PORT],
203
+ '--host <host>': 'set the host to listen on, defaults to listening on all interfaces',
204
+ '--https': 'serves files over HTTPS',
205
+ '--cert <path>': 'path to certificate to use with HTTPS',
206
+ '--key <path>': 'path to private key to use with HTTPS',
207
+ '--hmr-port <port>': ['hot module replacement port', process.env.HMR_PORT],
208
+ '--hmr-host <host>': ['hot module replacement host', process.env.HMR_HOST]
209
+ };
210
+ function applyOptions(cmd, options) {
211
+ for (let opt in options) {
212
+ const option = options[opt];
213
+ if (option instanceof _commander().default.Option) {
214
+ cmd.addOption(option);
215
+ } else {
216
+ cmd.option(opt, ...(Array.isArray(option) ? option : [option]));
217
+ }
218
+ }
219
+ }
220
+ let serve = program.command('serve [input...]').description('starts a development server').option('--public-url <url>', 'the path prefix for absolute urls').option('--open [browser]', 'automatically open in specified browser, defaults to default browser').option('--watch-for-stdin', 'exit when stdin closes').option('--lazy [includes]', 'Build async bundles on demand, when requested in the browser. Defaults to all async bundles, unless a comma separated list of source file globs is provided. Only async bundles whose entry points match these globs will be built lazily').option('--lazy-exclude <excludes>', 'Can only be used in combination with --lazy. Comma separated list of source file globs, async bundles whose entry points match these globs will not be built lazily').action(runCommand);
221
+ applyOptions(serve, hmrOptions);
222
+ applyOptions(serve, commonOptions);
223
+ let watch = program.command('watch [input...]').description('starts the bundler in watch mode').option('--public-url <url>', 'the path prefix for absolute urls').option('--no-content-hash', 'disable content hashing').option('--watch-for-stdin', 'exit when stdin closes').action(runCommand);
224
+ applyOptions(watch, hmrOptions);
225
+ applyOptions(watch, commonOptions);
226
+ let build = program.command('build [input...]').description('bundles for production').option('--no-optimize', 'disable minification').option('--no-scope-hoist', 'disable scope-hoisting').option('--public-url <url>', 'the path prefix for absolute urls').option('--no-content-hash', 'disable content hashing').action(runCommand);
227
+ applyOptions(build, commonOptions);
228
+ program.command('help [command]').description('display help information for a command').action(function (command) {
229
+ let cmd = program.commands.find(c => c.name() === command) || program;
230
+ cmd.help();
231
+ });
232
+ program.on('--help', function () {
233
+ _logger().INTERNAL_ORIGINAL_CONSOLE.log('');
234
+ _logger().INTERNAL_ORIGINAL_CONSOLE.log(' Run `' + _chalk().default.bold('atlaspack help <command>') + '` for more information on specific commands');
235
+ _logger().INTERNAL_ORIGINAL_CONSOLE.log('');
236
+ });
237
+
238
+ // Override to output option description if argument was missing
239
+ // $FlowFixMe[prop-missing]
240
+ _commander().default.Command.prototype.optionMissingArgument = function (option) {
241
+ _logger().INTERNAL_ORIGINAL_CONSOLE.error("error: option `%s' argument missing", option.flags);
242
+ _logger().INTERNAL_ORIGINAL_CONSOLE.log(program.createHelp().optionDescription(option));
243
+ process.exit(1);
244
+ };
245
+
246
+ // Make serve the default command except for --help
247
+ var args = process.argv;
248
+ if (args[2] === '--help' || args[2] === '-h') args[2] = 'help';
249
+ if (!args[2] || !program.commands.some(c => c.name() === args[2])) {
250
+ args.splice(2, 0, 'serve');
251
+ }
252
+ program.parse(args);
253
+ function runCommand(...args) {
254
+ run(...args).catch(handleUncaughtException);
255
+ }
256
+ async function run(entries, _opts,
257
+ // using pre v7 Commander options as properties
258
+ command) {
259
+ if (entries.length === 0) {
260
+ entries = ['.'];
261
+ }
262
+ entries = entries.map(entry => _path().default.resolve(entry));
263
+ let Atlaspack = require('@atlaspack/core').default;
264
+ let fs = new (_fs().NodeFS)();
265
+ let options = await normalizeOptions(command, fs);
266
+ let atlaspack = new Atlaspack({
267
+ entries,
268
+ defaultConfig: require.resolve('@atlaspack/config-default', {
269
+ paths: [fs.cwd(), __dirname]
270
+ }),
271
+ shouldPatchConsole: false,
272
+ ...options
273
+ });
274
+ let disposable = new (_events().Disposable)();
275
+ let unsubscribe;
276
+ let isExiting;
277
+ async function exit(exitCode = 0) {
278
+ if (isExiting) {
279
+ return;
280
+ }
281
+ isExiting = true;
282
+ if (unsubscribe != null) {
283
+ await unsubscribe();
284
+ } else if (atlaspack.isProfiling) {
285
+ await atlaspack.stopProfiling();
286
+ }
287
+ if (process.stdin.isTTY && process.stdin.isRaw) {
288
+ // $FlowFixMe
289
+ process.stdin.setRawMode(false);
290
+ }
291
+ disposable.dispose();
292
+ process.exit(exitCode);
293
+ }
294
+ const isWatching = command.name() === 'watch' || command.name() === 'serve';
295
+ if (process.stdin.isTTY) {
296
+ // $FlowFixMe
297
+ process.stdin.setRawMode(true);
298
+ require('readline').emitKeypressEvents(process.stdin);
299
+ let stream = process.stdin.on('keypress', async (char, key) => {
300
+ if (!key.ctrl) {
301
+ return;
302
+ }
303
+ switch (key.name) {
304
+ case 'c':
305
+ // Detect the ctrl+c key, and gracefully exit after writing the asset graph to the cache.
306
+ // This is mostly for tools that wrap Atlaspack as a child process like yarn and npm.
307
+ //
308
+ // Setting raw mode prevents SIGINT from being sent in response to ctrl-c:
309
+ // https://nodejs.org/api/tty.html#tty_readstream_setrawmode_mode
310
+ //
311
+ // We don't use the SIGINT event for this because when run inside yarn, the parent
312
+ // yarn process ends before Atlaspack and it appears that Atlaspack has ended while it may still
313
+ // be cleaning up. Handling events from stdin prevents this impression.
314
+ //
315
+ // When watching, a 0 success code is acceptable when Atlaspack is interrupted with ctrl-c.
316
+ // When building, fail with a code as if we received a SIGINT.
317
+ await exit(isWatching ? 0 : SIGINT_EXIT_CODE);
318
+ break;
319
+ case 'e':
320
+ await (atlaspack.isProfiling ? atlaspack.stopProfiling() : atlaspack.startProfiling());
321
+ break;
322
+ case 'y':
323
+ await atlaspack.takeHeapSnapshot();
324
+ break;
325
+ }
326
+ });
327
+ disposable.add(() => {
328
+ stream.destroy();
329
+ });
330
+ }
331
+ if (isWatching) {
332
+ ({
333
+ unsubscribe
334
+ } = await atlaspack.watch(err => {
335
+ if (err) {
336
+ throw err;
337
+ }
338
+ }));
339
+ if (command.open && options.serveOptions) {
340
+ await (0, _utils().openInBrowser)(`${options.serveOptions.https ? 'https' : 'http'}://${options.serveOptions.host || 'localhost'}:${options.serveOptions.port}`, command.open);
341
+ }
342
+ if (command.watchForStdin) {
343
+ process.stdin.on('end', async () => {
344
+ _logger().INTERNAL_ORIGINAL_CONSOLE.log('STDIN closed, ending');
345
+ await exit();
346
+ });
347
+ process.stdin.resume();
348
+ }
349
+
350
+ // In non-tty cases, respond to SIGINT by cleaning up. Since we're watching,
351
+ // a 0 success code is acceptable.
352
+ process.on('SIGINT', () => exit());
353
+ process.on('SIGTERM', () => exit());
354
+ } else {
355
+ try {
356
+ await atlaspack.run();
357
+ } catch (err) {
358
+ // If an exception is thrown during Atlaspack.build, it is given to reporters in a
359
+ // buildFailure event, and has been shown to the user.
360
+ if (!(err instanceof _core().BuildError)) {
361
+ await logUncaughtError(err);
362
+ }
363
+ await exit(1);
364
+ }
365
+ await exit();
366
+ }
367
+ }
368
+ function parsePort(portValue) {
369
+ let parsedPort = Number(portValue);
370
+
371
+ // Throw an error if port value is invalid...
372
+ if (!Number.isInteger(parsedPort)) {
373
+ throw new Error(`Port ${portValue} is not a valid integer.`);
374
+ }
375
+ return parsedPort;
376
+ }
377
+ function parseOptionInt(value) {
378
+ const parsedValue = parseInt(value, 10);
379
+ if (isNaN(parsedValue)) {
380
+ throw new (_commander().default.InvalidOptionArgumentError)('Must be an integer.');
381
+ }
382
+ return parsedValue;
383
+ }
384
+ async function normalizeOptions(command, inputFS) {
385
+ let nodeEnv;
386
+ if (command.name() === 'build') {
387
+ nodeEnv = process.env.NODE_ENV || 'production';
388
+ // Autoinstall unless explicitly disabled or we detect a CI environment.
389
+ command.autoinstall = !(command.autoinstall === false || process.env.CI);
390
+ } else {
391
+ nodeEnv = process.env.NODE_ENV || 'development';
392
+ }
393
+
394
+ // Set process.env.NODE_ENV to a default if undefined so that it is
395
+ // available in JS configs and plugins.
396
+ process.env.NODE_ENV = nodeEnv;
397
+ let https = !!command.https;
398
+ if (command.cert && command.key) {
399
+ https = {
400
+ cert: command.cert,
401
+ key: command.key
402
+ };
403
+ }
404
+ let serveOptions = false;
405
+ let {
406
+ host
407
+ } = command;
408
+
409
+ // Ensure port is valid and available
410
+ let port = parsePort(command.port || '1234');
411
+ let originalPort = port;
412
+ if (command.name() === 'serve' || command.hmr) {
413
+ try {
414
+ port = await (0, _getPort().default)({
415
+ port,
416
+ host
417
+ });
418
+ } catch (err) {
419
+ throw new (_diagnostic().default)({
420
+ diagnostic: {
421
+ message: `Could not get available port: ${err.message}`,
422
+ origin: 'atlaspack',
423
+ stack: err.stack
424
+ }
425
+ });
426
+ }
427
+ if (port !== originalPort) {
428
+ let errorMessage = `Port "${originalPort}" could not be used`;
429
+ if (command.port != null) {
430
+ // Throw the error if the user defined a custom port
431
+ throw new Error(errorMessage);
432
+ } else {
433
+ // Atlaspack logger is not set up at this point, so just use native INTERNAL_ORIGINAL_CONSOLE
434
+ _logger().INTERNAL_ORIGINAL_CONSOLE.warn(errorMessage);
435
+ }
436
+ }
437
+ }
438
+ if (command.name() === 'serve') {
439
+ let {
440
+ publicUrl
441
+ } = command;
442
+ serveOptions = {
443
+ https,
444
+ port,
445
+ host,
446
+ publicUrl
447
+ };
448
+ }
449
+ let hmrOptions = null;
450
+ if (command.name() !== 'build' && command.hmr !== false) {
451
+ let hmrport = command.hmrPort ? parsePort(command.hmrPort) : port;
452
+ let hmrhost = command.hmrHost ? command.hmrHost : host;
453
+ hmrOptions = {
454
+ port: hmrport,
455
+ host: hmrhost
456
+ };
457
+ }
458
+ if (command.detailedReport === true) {
459
+ command.detailedReport = '10';
460
+ }
461
+ let additionalReporters = [{
462
+ packageName: '@atlaspack/reporter-cli',
463
+ resolveFrom: __filename
464
+ }, ...command.reporter.map(packageName => ({
465
+ packageName,
466
+ resolveFrom: _path().default.join(inputFS.cwd(), 'index')
467
+ }))];
468
+ if (command.trace) {
469
+ additionalReporters.unshift({
470
+ packageName: '@atlaspack/reporter-tracer',
471
+ resolveFrom: __filename
472
+ });
473
+ }
474
+ let mode = command.name() === 'build' ? 'production' : 'development';
475
+ const normalizeIncludeExcludeList = input => {
476
+ if (typeof input !== 'string') return [];
477
+ return input.split(',').map(value => value.trim());
478
+ };
479
+ return {
480
+ shouldDisableCache: command.cache === false,
481
+ cacheDir: command.cacheDir,
482
+ watchDir: command.watchDir,
483
+ watchBackend: command.watchBackend,
484
+ watchIgnore: command.watchIgnore,
485
+ config: command.config,
486
+ mode,
487
+ hmrOptions,
488
+ shouldContentHash: hmrOptions ? false : command.contentHash,
489
+ serveOptions,
490
+ targets: command.target.length > 0 ? command.target : null,
491
+ shouldAutoInstall: command.autoinstall ?? true,
492
+ logLevel: command.logLevel,
493
+ shouldProfile: command.profile,
494
+ shouldTrace: command.trace,
495
+ shouldBuildLazily: typeof command.lazy !== 'undefined',
496
+ lazyIncludes: normalizeIncludeExcludeList(command.lazy),
497
+ lazyExcludes: normalizeIncludeExcludeList(command.lazyExclude),
498
+ shouldBundleIncrementally: process.env.ATLASPACK_INCREMENTAL_BUNDLING === 'false' ? false : true,
499
+ detailedReport: command.detailedReport != null ? {
500
+ assetsPerBundle: parseInt(command.detailedReport, 10)
501
+ } : null,
502
+ env: {
503
+ NODE_ENV: nodeEnv
504
+ },
505
+ additionalReporters,
506
+ defaultTargetOptions: {
507
+ shouldOptimize: command.optimize != null ? command.optimize : mode === 'production',
508
+ sourceMaps: command.sourceMaps ?? true,
509
+ shouldScopeHoist: command.scopeHoist,
510
+ publicUrl: command.publicUrl,
511
+ distDir: command.distDir
512
+ },
513
+ featureFlags: command.featureFlag
514
+ };
515
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@atlaspack/cli",
3
+ "version": "2.12.1-dev.3356+8b1a7da8f",
4
+ "description": "Blazing fast, zero configuration web application bundler",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/atlassian-labs/atlaspack.git"
12
+ },
13
+ "bin": {
14
+ "atlaspack": "bin/atlaspack.js"
15
+ },
16
+ "main": "lib/bin.js",
17
+ "source": "src/bin.js",
18
+ "scripts": {
19
+ "prepack": "./ensure-no-dev-lib.sh",
20
+ "dev:prepare": "rimraf ./lib/ && mkdir -p lib && cp ./bin/dev-bin.js ./lib/bin.js"
21
+ },
22
+ "engines": {
23
+ "node": ">= 16.0.0"
24
+ },
25
+ "dependencies": {
26
+ "@atlaspack/config-default": "2.12.1-dev.3356+8b1a7da8f",
27
+ "@atlaspack/core": "2.12.1-dev.3356+8b1a7da8f",
28
+ "@atlaspack/diagnostic": "2.12.1-dev.3356+8b1a7da8f",
29
+ "@atlaspack/events": "2.12.1-dev.3356+8b1a7da8f",
30
+ "@atlaspack/feature-flags": "2.12.1-dev.3356+8b1a7da8f",
31
+ "@atlaspack/fs": "2.12.1-dev.3356+8b1a7da8f",
32
+ "@atlaspack/logger": "2.12.1-dev.3356+8b1a7da8f",
33
+ "@atlaspack/package-manager": "2.12.1-dev.3356+8b1a7da8f",
34
+ "@atlaspack/reporter-cli": "2.12.1-dev.3356+8b1a7da8f",
35
+ "@atlaspack/reporter-dev-server": "2.12.1-dev.3356+8b1a7da8f",
36
+ "@atlaspack/reporter-tracer": "2.12.1-dev.3356+8b1a7da8f",
37
+ "@atlaspack/utils": "2.12.1-dev.3356+8b1a7da8f",
38
+ "chalk": "^4.1.0",
39
+ "commander": "^7.0.0",
40
+ "get-port": "^4.2.0"
41
+ },
42
+ "devDependencies": {
43
+ "@atlaspack/babel-register": "2.12.0",
44
+ "@babel/core": "^7.22.11",
45
+ "rimraf": "^5.0.5"
46
+ },
47
+ "gitHead": "8b1a7da8f8d35174d53b02048bff9bcdb1e346f1"
48
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "@atlaspack/eslint-config",
3
+ "rules": {
4
+ "no-console": "off"
5
+ }
6
+ }
package/src/bin.js ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ if (
6
+ process.env.ATLASPACK_BUILD_ENV !== 'production' ||
7
+ process.env.ATLASPACK_SELF_BUILD
8
+ ) {
9
+ require('@atlaspack/babel-register');
10
+ }
11
+
12
+ require('./cli');