@enact/cli 7.1.0 → 7.2.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/.travis.yml CHANGED
@@ -6,6 +6,7 @@ sudo: false
6
6
  install:
7
7
  - npm config set prefer-offline false
8
8
  - npm install
9
+ - npm link
9
10
 
10
11
  script:
11
12
  - npm run lint -- --report-unused-disable-directives --max-warnings 0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 7.2.0 (November 14, 2025)
2
+
3
+ ### pack
4
+
5
+ * Added `--no-linting` option to build without code linting.
6
+ * Fixed webpack config to webpack noise constrained to errors only.
7
+
8
+ ### test
9
+
10
+ * Updated to Jest 30.
11
+
1
12
  ## 7.1.0 (July 18, 2025)
2
13
 
3
14
  ### pack
package/bin/enact.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ /* eslint no-console: off, no-undef: off */
2
3
 
3
4
  'use strict';
4
5
 
@@ -1,4 +1,5 @@
1
1
  // @remove-file-on-eject
2
+ /* eslint no-console: off, no-undef: off */
2
3
  const path = require('path');
3
4
  const spawn = require('cross-spawn');
4
5
  const fs = require('fs-extra');
@@ -8,7 +9,7 @@ const doLink = require('./link').api;
8
9
 
9
10
  let chalk;
10
11
 
11
- function displayHelp() {
12
+ function displayHelp () {
12
13
  let e = 'node ' + path.relative(process.cwd(), __filename);
13
14
  if (require.main !== module) e = 'enact bootstrap';
14
15
 
@@ -36,7 +37,7 @@ function displayHelp() {
36
37
  process.exit(0);
37
38
  }
38
39
 
39
- function npmExec(args, cwd = process.cwd(), loglevel) {
40
+ function npmExec (args, cwd = process.cwd(), loglevel) {
40
41
  return new Promise((resolve, reject) => {
41
42
  if (loglevel) args.unshift('--loglevel', loglevel);
42
43
  const child = spawn('npm', args, {stdio: 'inherit', cwd});
@@ -50,11 +51,11 @@ function npmExec(args, cwd = process.cwd(), loglevel) {
50
51
  });
51
52
  }
52
53
 
53
- function newline() {
54
+ function newline () {
54
55
  console.log();
55
56
  }
56
57
 
57
- function api({
58
+ function api ({
58
59
  cwd = process.cwd(),
59
60
  base = true,
60
61
  sampler = true,
@@ -165,7 +166,7 @@ function api({
165
166
  });
166
167
  }
167
168
 
168
- function cli(args) {
169
+ function cli (args) {
169
170
  const opts = minimist(args, {
170
171
  boolean: ['base', 'sampler', 'allsamples', 'link', 'verbose', 'help'],
171
172
  string: ['loglevel', 'override'],
package/commands/clean.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint no-console: off, no-undef: off */
1
2
  /* eslint-env node, es6 */
2
3
  const path = require('path');
3
4
  const fs = require('fs-extra');
@@ -6,14 +7,10 @@ const packageRoot = require('@enact/dev-utils').packageRoot;
6
7
 
7
8
  let chalk;
8
9
 
9
- const build = 'build';
10
- const dist = 'dist';
11
- const node_modules = 'node_modules';
12
- const samples = 'samples';
13
10
  const ssTests = path.join('tests', 'screenshot');
14
11
  const uiTests = path.join('tests', 'ui');
15
12
 
16
- function displayHelp() {
13
+ function displayHelp () {
17
14
  let e = 'node ' + path.relative(process.cwd(), __filename);
18
15
  if (require.main !== module) e = 'enact clean';
19
16
 
@@ -32,25 +29,25 @@ function displayHelp() {
32
29
  process.exit(0);
33
30
  }
34
31
 
35
- function api({paths = [], all = false} = {}) {
36
- const known = [build, dist];
37
- if (all) known.push(node_modules);
38
- if (fs.existsSync(samples)) {
32
+ function api ({paths = [], all = false} = {}) {
33
+ const known = ['build', 'dist'];
34
+ if (all) known.push('node_modules');
35
+ if (fs.existsSync('samples')) {
39
36
  const sampleDirs = fs
40
- .readdirSync(samples)
41
- .map(p => path.join(samples, p))
37
+ .readdirSync('samples')
38
+ .map(p => path.join('samples', p))
42
39
  .filter(p => fs.existsSync(path.join(p, 'package.json')));
43
40
  sampleDirs.forEach(p => {
44
- known.push(path.join(p, build), path.join(p, dist));
45
- if (all) known.push(path.join(p, node_modules));
41
+ known.push(path.join(p, 'build'), path.join(p, 'dist'));
42
+ if (all) known.push(path.join(p, 'node_modules'));
46
43
  });
47
44
  }
48
- if (fs.existsSync(ssTests)) known.push(path.join(ssTests, dist));
49
- if (fs.existsSync(uiTests)) known.push(path.join(uiTests, dist));
45
+ if (fs.existsSync(ssTests)) known.push(path.join(ssTests, 'dist'));
46
+ if (fs.existsSync(uiTests)) known.push(path.join(uiTests, 'dist'));
50
47
  return Promise.all(paths.concat(known).map(d => fs.remove(d)));
51
48
  }
52
49
 
53
- function cli(args) {
50
+ function cli (args) {
54
51
  const opts = minimist(args, {
55
52
  boolean: ['help', 'all'],
56
53
  alias: {h: 'help', a: 'all'}
@@ -1,4 +1,5 @@
1
1
  // @remove-file-on-eject
2
+ /* eslint no-console: off, no-undef: off, no-undefined: off */
2
3
  /**
3
4
  * Portions of this source code file are from create-react-app, used under the
4
5
  * following MIT license:
@@ -146,7 +147,7 @@ const defaultGenerator = {
146
147
  }
147
148
  };
148
149
 
149
- function displayHelp() {
150
+ function displayHelp () {
150
151
  let e = 'node ' + path.relative(process.cwd(), __filename);
151
152
  if (require.main !== module) e = 'enact create';
152
153
 
@@ -167,7 +168,7 @@ function displayHelp() {
167
168
  process.exit(0);
168
169
  }
169
170
 
170
- function resolveTemplateGenerator(template) {
171
+ function resolveTemplateGenerator (template) {
171
172
  return new Promise((resolve, reject) => {
172
173
  let templatePath = path.join(TEMPLATE_DIR, template);
173
174
  if (!fs.existsSync(templatePath)) {
@@ -201,7 +202,7 @@ function resolveTemplateGenerator(template) {
201
202
  });
202
203
  }
203
204
 
204
- function copyTemplate(template, output, overwrite) {
205
+ function copyTemplate (template, output, overwrite) {
205
206
  const outputReadme = path.join(output, 'README.md');
206
207
  const outputGitIgnore = path.join(output, '.gitignore');
207
208
  let templateGitIgnore = fs.readdirSync(template).filter(f => ['.gitignore', 'gitignore'].includes(f))[0];
@@ -235,7 +236,7 @@ function copyTemplate(template, output, overwrite) {
235
236
  });
236
237
  }
237
238
 
238
- function npmInstall(directory, verbose, ...rest) {
239
+ function npmInstall (directory, verbose, ...rest) {
239
240
  const args = ['--loglevel', verbose ? 'verbose' : 'error', 'install', ...rest];
240
241
 
241
242
  return new Promise((resolve, reject) => {
@@ -250,7 +251,7 @@ function npmInstall(directory, verbose, ...rest) {
250
251
  });
251
252
  }
252
253
 
253
- function api(opts = {}) {
254
+ function api (opts = {}) {
254
255
  return resolveTemplateGenerator(opts.template).then(({generator, templatePath}) => {
255
256
  const params = Object.assign({}, opts, {opts, defaultGenerator, type: generator.type});
256
257
 
@@ -272,7 +273,7 @@ function api(opts = {}) {
272
273
  });
273
274
  }
274
275
 
275
- function cli(args) {
276
+ function cli (args) {
276
277
  const opts = minimist(args, {
277
278
  boolean: ['local', 'verbose', 'help'],
278
279
  string: ['template'],
package/commands/eject.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // @remove-file-on-eject
2
+ /* eslint no-console: off, no-undef: off */
2
3
  /**
3
4
  * Portions of this source code file are from create-react-app, used under the
4
5
  * following MIT license:
@@ -50,7 +51,7 @@ const bareTasks = {
50
51
  'test-watch': 'jest --config config/jest/jest.config.js --watch'
51
52
  };
52
53
 
53
- function displayHelp() {
54
+ function displayHelp () {
54
55
  let e = 'node ' + path.relative(process.cwd(), __filename);
55
56
  if (require.main !== module) e = 'enact eject';
56
57
 
@@ -67,7 +68,7 @@ function displayHelp() {
67
68
  process.exit(0);
68
69
  }
69
70
 
70
- function validateEject() {
71
+ function validateEject () {
71
72
  return prompts({
72
73
  type: 'confirm',
73
74
  name: 'shouldEject',
@@ -100,7 +101,7 @@ function validateEject() {
100
101
  });
101
102
  }
102
103
 
103
- function checkGitStatus() {
104
+ function checkGitStatus () {
104
105
  let status;
105
106
  try {
106
107
  const stdout = cp.execSync(`git status --porcelain`, {stdio: ['pipe', 'pipe', 'ignore']});
@@ -122,7 +123,7 @@ function checkGitStatus() {
122
123
  }
123
124
  }
124
125
 
125
- function verifyAbsent({dest}) {
126
+ function verifyAbsent ({dest}) {
126
127
  if (fs.existsSync(dest)) {
127
128
  throw new Error(
128
129
  `"${dest}" already exists in your app folder. We cannot ` +
@@ -133,7 +134,7 @@ function verifyAbsent({dest}) {
133
134
  }
134
135
  }
135
136
 
136
- function copySanitizedFile({src, dest}) {
137
+ function copySanitizedFile ({src, dest}) {
137
138
  let data = fs.readFileSync(src, {encoding: 'utf8'});
138
139
 
139
140
  // Skip flagged files
@@ -153,7 +154,7 @@ function copySanitizedFile({src, dest}) {
153
154
  fs.writeFileSync(dest, data, {encoding: 'utf8'});
154
155
  }
155
156
 
156
- function configurePackage(bare) {
157
+ function configurePackage (bare) {
157
158
  const own = require('../package.json');
158
159
  const app = require(path.resolve('package.json'));
159
160
  const backup = JSON.stringify(app, null, 2) + os.EOL;
@@ -237,7 +238,7 @@ function configurePackage(bare) {
237
238
  return conflicts;
238
239
  }
239
240
 
240
- function backupOld(files) {
241
+ function backupOld (files) {
241
242
  files.filter(fs.existsSync).forEach(f => {
242
243
  const backup = path.basename(f, path.extname(f)) + '.old' + path.extname(f);
243
244
  console.log(` Found existing ${chalk.cyan(f)}; backing up to ${chalk.cyan(backup)}`);
@@ -245,7 +246,7 @@ function backupOld(files) {
245
246
  });
246
247
  }
247
248
 
248
- function npmInstall() {
249
+ function npmInstall () {
249
250
  return new Promise((resolve, reject) => {
250
251
  const proc = spawn('npm', ['--loglevel', 'error', 'install'], {stdio: 'inherit', cwd: process.cwd()});
251
252
  proc.on('close', code => {
@@ -258,7 +259,7 @@ function npmInstall() {
258
259
  });
259
260
  }
260
261
 
261
- function api({bare = false} = {}) {
262
+ function api ({bare = false} = {}) {
262
263
  if (bare) {
263
264
  assets.pop();
264
265
  }
@@ -295,7 +296,7 @@ function api({bare = false} = {}) {
295
296
  });
296
297
  }
297
298
 
298
- function cli(args) {
299
+ function cli (args) {
299
300
  const opts = minimist(args, {
300
301
  boolean: ['bare', 'help'],
301
302
  alias: {b: 'bare', h: 'help'}
package/commands/info.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint no-console: off, no-undef: off */
1
2
  /* eslint-env node, es6 */
2
3
  const path = require('path');
3
4
  const fs = require('fs');
@@ -7,7 +8,7 @@ const resolveSync = require('resolve').sync;
7
8
 
8
9
  let chalk;
9
10
 
10
- function displayHelp() {
11
+ function displayHelp () {
11
12
  let e = 'node ' + path.relative(process.cwd(), __filename);
12
13
  if (require.main !== module) e = 'enact info';
13
14
 
@@ -23,7 +24,7 @@ function displayHelp() {
23
24
  process.exit(0);
24
25
  }
25
26
 
26
- function logVersion(pkg, rel = __dirname) {
27
+ function logVersion (pkg, rel = __dirname) {
27
28
  try {
28
29
  const jsonPath = resolveSync(pkg + '/package.json', {basedir: rel});
29
30
  const meta = require(jsonPath);
@@ -41,7 +42,7 @@ function logVersion(pkg, rel = __dirname) {
41
42
  }
42
43
  }
43
44
 
44
- function gitInfo(dir) {
45
+ function gitInfo (dir) {
45
46
  const git = (args = []) => {
46
47
  try {
47
48
  const result = spawn.sync('git', args, {encoding: 'utf8', cwd: dir, env: process.env});
@@ -60,7 +61,7 @@ function gitInfo(dir) {
60
61
  }
61
62
  }
62
63
 
63
- function globalModules() {
64
+ function globalModules () {
64
65
  try {
65
66
  const result = spawn.sync('npm', ['config', 'get', 'prefix', '-g'], {
66
67
  cwd: process.cwd(),
@@ -78,7 +79,7 @@ function globalModules() {
78
79
  }
79
80
  }
80
81
 
81
- function api({cliInfo = false, dev = false} = {}) {
82
+ function api ({cliInfo = false, dev = false} = {}) {
82
83
  return new Promise((resolve, reject) => {
83
84
  try {
84
85
  if (cliInfo) {
@@ -163,7 +164,7 @@ function api({cliInfo = false, dev = false} = {}) {
163
164
  });
164
165
  }
165
166
 
166
- function cli(args) {
167
+ function cli (args) {
167
168
  const opts = minimist(args, {
168
169
  boolean: ['cli', 'help'],
169
170
  alias: {h: 'help'}
@@ -1,3 +1,4 @@
1
+ /* eslint no-console: off, no-undef: off */
1
2
  /* eslint-env node, es6 */
2
3
  const path = require('path');
3
4
  const checker = require('license-checker');
@@ -9,7 +10,7 @@ let chalk;
9
10
  const pkgPathResolve = m => path.dirname(require.resolve(m + '/package.json'));
10
11
  const enactCLIProdModules = ['@babel/core', 'core-js'].map(pkgPathResolve);
11
12
 
12
- function displayHelp() {
13
+ function displayHelp () {
13
14
  let e = 'node ' + path.relative(process.cwd(), __filename);
14
15
  if (require.main !== module) e = 'enact license';
15
16
 
@@ -27,7 +28,7 @@ function displayHelp() {
27
28
  process.exit(0);
28
29
  }
29
30
 
30
- function api({modules = []} = {}) {
31
+ function api ({modules = []} = {}) {
31
32
  if (!modules.length) {
32
33
  modules = modules.concat(enactCLIProdModules, '.');
33
34
  }
@@ -47,7 +48,7 @@ function api({modules = []} = {}) {
47
48
  ).then(values => values.reduce((a, b) => Object.assign(a, b)));
48
49
  }
49
50
 
50
- function cli(args) {
51
+ function cli (args) {
51
52
  const opts = minimist(args, {
52
53
  boolean: ['help'],
53
54
  alias: {h: 'help'}
package/commands/link.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // @remove-file-on-eject
2
+ /* eslint no-console: off, no-undef: off */
2
3
  const path = require('path');
3
4
  const spawn = require('cross-spawn');
4
5
  const fs = require('fs-extra');
@@ -7,7 +8,7 @@ const packageRoot = require('@enact/dev-utils').packageRoot;
7
8
 
8
9
  let chalk;
9
10
 
10
- function displayHelp() {
11
+ function displayHelp () {
11
12
  let e = 'node ' + path.relative(process.cwd(), __filename);
12
13
  if (require.main !== module) e = 'enact link';
13
14
 
@@ -27,7 +28,7 @@ function displayHelp() {
27
28
  process.exit(0);
28
29
  }
29
30
 
30
- function globalModules(cwd) {
31
+ function globalModules (cwd) {
31
32
  return new Promise(resolve => {
32
33
  let prefix = '';
33
34
  const proc = spawn('npm', ['config', 'get', 'prefix', '-g'], {
@@ -50,7 +51,7 @@ function globalModules(cwd) {
50
51
  });
51
52
  }
52
53
 
53
- function api({cwd = process.cwd(), loglevel = 'error', verbose = false} = {}) {
54
+ function api ({cwd = process.cwd(), loglevel = 'error', verbose = false} = {}) {
54
55
  const linkArgs = ['--loglevel', verbose ? 'verbose' : loglevel, 'link'];
55
56
  const pkg = packageRoot(cwd);
56
57
  let enact = Object.keys(pkg.meta.dependencies || {}).concat(Object.keys(pkg.meta.devDependencies || {}));
@@ -85,7 +86,7 @@ function api({cwd = process.cwd(), loglevel = 'error', verbose = false} = {}) {
85
86
  });
86
87
  }
87
88
 
88
- function cli(args) {
89
+ function cli (args) {
89
90
  const opts = minimist(args, {
90
91
  boolean: ['verbose', 'help'],
91
92
  string: ['loglevel'],
package/commands/lint.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint no-console: off, no-undef: off */
1
2
  /* eslint-env node, es6 */
2
3
  const cp = require('child_process');
3
4
  const path = require('path');
@@ -9,7 +10,7 @@ const globOpts = {
9
10
  nodir: true
10
11
  };
11
12
 
12
- function displayHelp() {
13
+ function displayHelp () {
13
14
  let e = 'node ' + path.relative(process.cwd(), __filename);
14
15
  if (require.main !== module) e = 'enact lint';
15
16
 
@@ -30,11 +31,11 @@ function displayHelp() {
30
31
  process.exit(0);
31
32
  }
32
33
 
33
- function shouldESLint() {
34
+ function shouldESLint () {
34
35
  return glob.sync('**/*.+(js|jsx|ts|tsx)', globOpts).length > 0;
35
36
  }
36
37
 
37
- function eslint({strict = false, local = false, fix = false, eslintArgs = []} = {}) {
38
+ function eslint ({strict = false, local = false, fix = false, eslintArgs = []} = {}) {
38
39
  let args = [];
39
40
  if (strict) {
40
41
  args.push('--no-config-lookup', '--config', require.resolve('eslint-config-enact/strict'));
@@ -66,11 +67,11 @@ function eslint({strict = false, local = false, fix = false, eslintArgs = []} =
66
67
  });
67
68
  }
68
69
 
69
- function api(opts) {
70
+ function api (opts) {
70
71
  return Promise.resolve().then(() => shouldESLint() && eslint(opts));
71
72
  }
72
73
 
73
- function cli(args) {
74
+ function cli (args) {
74
75
  const opts = minimist(args, {
75
76
  boolean: ['local', 'strict', 'fix', 'help'],
76
77
  alias: {l: 'local', s: 'strict', framework: 'strict', f: 'fix', h: 'help'}
package/commands/pack.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint no-console: off, no-undef: off */
1
2
  /* eslint-env node, es6 */
2
3
  // @remove-on-eject-begin
3
4
  /**
@@ -23,7 +24,7 @@ const {optionParser: app, mixins, configHelper: helper} = require('@enact/dev-ut
23
24
  let chalk;
24
25
  let stripAnsi;
25
26
 
26
- function displayHelp() {
27
+ function displayHelp () {
27
28
  let e = 'node ' + path.relative(process.cwd(), __filename);
28
29
  if (require.main !== module) e = 'enact pack';
29
30
 
@@ -49,6 +50,7 @@ function displayHelp() {
49
50
  console.log(' (requires V8_MKSNAPSHOT set)');
50
51
  console.log(' -m, --meta JSON to override package.json enact metadata');
51
52
  console.log(' -c, --custom-skin Build with a custom skin');
53
+ console.log(' --no-linting Build without code linting');
52
54
  console.log(' --no-animation Build without effects such as animation and shadow');
53
55
  console.log(' --stats Output bundle analysis file');
54
56
  console.log(' --verbose Verbose log build details');
@@ -69,7 +71,7 @@ function displayHelp() {
69
71
  process.exit(0);
70
72
  }
71
73
 
72
- function details(err, stats, output) {
74
+ function details (err, stats, output) {
73
75
  let messages;
74
76
  if (err) {
75
77
  if (!err.message) return err;
@@ -139,7 +141,7 @@ function details(err, stats, output) {
139
141
  }
140
142
  }
141
143
 
142
- function copyPublicFolder(output) {
144
+ function copyPublicFolder (output) {
143
145
  const staticAssets = './public';
144
146
  if (fs.existsSync(staticAssets)) {
145
147
  fs.copySync(staticAssets, output, {
@@ -149,7 +151,7 @@ function copyPublicFolder(output) {
149
151
  }
150
152
 
151
153
  // Print a detailed summary of build files.
152
- function printFileSizes(stats, output) {
154
+ function printFileSizes (stats, output) {
153
155
  const assets = stats
154
156
  .toJson({all: false, assets: true, cachedAssets: true})
155
157
  .assets.filter(asset => /\.(js|css|bin)$/.test(asset.name))
@@ -178,7 +180,7 @@ function printFileSizes(stats, output) {
178
180
  });
179
181
  }
180
182
 
181
- function printErrorDetails(err, handler) {
183
+ function printErrorDetails (err, handler) {
182
184
  console.log();
183
185
  if (process.env.TSC_COMPILE_ON_ERROR === 'true') {
184
186
  console.log(
@@ -196,7 +198,7 @@ function printErrorDetails(err, handler) {
196
198
  }
197
199
 
198
200
  // Create the production build and print the deployment instructions.
199
- function build(config) {
201
+ function build (config) {
200
202
  if (process.env.NODE_ENV === 'development') {
201
203
  console.log('Creating a development build...');
202
204
  } else {
@@ -217,7 +219,7 @@ function build(config) {
217
219
  }
218
220
 
219
221
  // Create the build and watch for changes.
220
- function watch(config) {
222
+ function watch (config) {
221
223
  // Make sure webpack doesn't immediate bail on errors when watching.
222
224
  config.bail = false;
223
225
  if (process.env.NODE_ENV === 'development') {
@@ -235,7 +237,7 @@ function watch(config) {
235
237
  });
236
238
  }
237
239
 
238
- function api(opts = {}) {
240
+ function api (opts = {}) {
239
241
  if (opts.meta) {
240
242
  let meta = opts.meta;
241
243
  if (typeof meta === 'string') {
@@ -258,6 +260,7 @@ function api(opts = {}) {
258
260
  const configFactory = require('../config/webpack.config');
259
261
  const config = configFactory(
260
262
  opts.production ? 'production' : 'development',
263
+ !opts.linting,
261
264
  opts['content-hash'],
262
265
  opts.isomorphic,
263
266
  !opts.animation,
@@ -286,9 +289,10 @@ function api(opts = {}) {
286
289
  });
287
290
  }
288
291
 
289
- function cli(args) {
292
+ function cli (args) {
290
293
  const opts = minimist(args, {
291
294
  boolean: [
295
+ 'linting',
292
296
  'content-hash',
293
297
  'custom-skin',
294
298
  'minify',
@@ -305,7 +309,7 @@ function cli(args) {
305
309
  'help'
306
310
  ],
307
311
  string: ['externals', 'externals-public', 'locales', 'entry', 'ilib-additional-path', 'output', 'meta'],
308
- default: {minify: true, 'split-css': true, animation: true},
312
+ default: {minify: true, 'split-css': true, animation: true, linting: true},
309
313
  alias: {
310
314
  o: 'output',
311
315
  p: 'production',
package/commands/serve.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint no-console: off, no-undef: off */
1
2
  /* eslint-env node, es6 */
2
3
  // @remove-on-eject-begin
3
4
  /**
@@ -37,14 +38,16 @@ process.on('unhandledRejection', err => {
37
38
  // "npm run build" with no way to modify it yet, we provide a basic override
38
39
  // to console.log to ensure the correct output is displayed to the user.
39
40
  // prettier-ignore
40
- console.log = (log => (data, ...rest) =>
41
- typeof data === 'undefined'
42
- ? log()
43
- : typeof data === 'string'
44
- ? log(data.replace(/npm run build/, 'npm run pack-p'), ...rest)
45
- : log.call(this, data, ...rest))(console.log);
41
+ console.log = (log => (data, ...rest) => {
42
+ if (typeof data === 'undefined') {
43
+ return log();
44
+ } else if (typeof data === 'string') {
45
+ return log(data.replace(/npm run build/, 'npm run pack-p'), ...rest);
46
+ }
47
+ return log.call(this, data, ...rest);
48
+ })(console.log);
46
49
 
47
- function displayHelp() {
50
+ function displayHelp () {
48
51
  let e = 'node ' + path.relative(process.cwd(), __filename);
49
52
  if (require.main !== module) e = 'enact serve';
50
53
 
@@ -57,13 +60,14 @@ function displayHelp() {
57
60
  console.log(' -f, --fast Enables experimental frast refresh');
58
61
  console.log(' -p, --port Server port number');
59
62
  console.log(' -m, --meta JSON to override package.json enact metadata');
63
+ console.log(' --no-linting Build without code linting');
60
64
  console.log(' -v, --version Display version information');
61
65
  console.log(' -h, --help Display help information');
62
66
  console.log();
63
67
  process.exit(0);
64
68
  }
65
69
 
66
- function hotDevServer(config, fastRefresh) {
70
+ function hotDevServer (config, fastRefresh) {
67
71
  // Keep webpack alive when there are any errors, so user can fix and rebuild.
68
72
  config.bail = false;
69
73
  // Ensure the CLI version of Chalk is used for webpackHotDevClient
@@ -94,7 +98,7 @@ function hotDevServer(config, fastRefresh) {
94
98
  return config;
95
99
  }
96
100
 
97
- function devServerConfig(host, port, protocol, publicPath, proxy, allowedHost) {
101
+ function devServerConfig (host, port, protocol, publicPath, proxy, allowedHost) {
98
102
  let server = {
99
103
  type: 'http'
100
104
  };
@@ -218,7 +222,7 @@ function devServerConfig(host, port, protocol, publicPath, proxy, allowedHost) {
218
222
  },
219
223
  // `proxy` is run between `before` and `after` `webpack-dev-server` hooks
220
224
  proxy,
221
- setupMiddlewares(middlewares, devServer) {
225
+ setupMiddlewares (middlewares, devServer) {
222
226
  if (!devServer) {
223
227
  throw new Error('webpack-dev-server is not defined');
224
228
  }
@@ -247,7 +251,7 @@ function devServerConfig(host, port, protocol, publicPath, proxy, allowedHost) {
247
251
  };
248
252
  }
249
253
 
250
- function serve(config, host, port, open) {
254
+ function serve (config, host, port, open) {
251
255
  // We attempt to use the default port but if it is busy, we offer the user to
252
256
  // run on a different port. `detect()` Promise resolves to the next free port.
253
257
  return choosePort(host, port).then(resolvedPort => {
@@ -316,7 +320,7 @@ function serve(config, host, port, open) {
316
320
  });
317
321
  }
318
322
 
319
- function api(opts) {
323
+ function api (opts) {
320
324
  if (opts.meta) {
321
325
  let meta;
322
326
  try {
@@ -337,7 +341,7 @@ function api(opts) {
337
341
  // Setup the development config with additional webpack-dev-server customizations.
338
342
  const configFactory = require('../config/webpack.config');
339
343
  const fastRefresh = process.env.FAST_REFRESH || opts.fast;
340
- const config = hotDevServer(configFactory('development'), fastRefresh);
344
+ const config = hotDevServer(configFactory('development', !opts.linting), fastRefresh);
341
345
 
342
346
  // Tools like Cloud9 rely on this.
343
347
  const host = process.env.HOST || opts.host || '0.0.0.0';
@@ -351,10 +355,11 @@ function api(opts) {
351
355
  }
352
356
  }
353
357
 
354
- function cli(args) {
358
+ function cli (args) {
355
359
  const opts = minimist(args, {
356
360
  string: ['host', 'port', 'meta'],
357
- boolean: ['browser', 'fast', 'help'],
361
+ boolean: ['browser', 'fast', 'help', 'linting'],
362
+ default: {linting: true},
358
363
  alias: {b: 'browser', i: 'host', p: 'port', f: 'fast', m: 'meta', h: 'help'}
359
364
  });
360
365
  if (opts.help) displayHelp();
@@ -364,7 +369,7 @@ function cli(args) {
364
369
  import('chalk').then(({default: _chalk}) => {
365
370
  chalk = _chalk;
366
371
  api(opts).catch(err => {
367
- //console.error(chalk.red('ERROR: ') + (err.message || err));
372
+ // console.error(chalk.red('ERROR: ') + (err.message || err));
368
373
  console.log(err);
369
374
  process.exit(1);
370
375
  });