parcel 2.0.0-dev.1526 → 2.0.0-dev.1563

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.
Files changed (3) hide show
  1. package/lib/cli.js +32 -2
  2. package/package.json +14 -14
  3. package/src/cli.js +35 -2
package/lib/cli.js CHANGED
@@ -131,14 +131,42 @@ process.on('unhandledRejection', handleUncaughtException);
131
131
  program.storeOptionsAsProperties();
132
132
  program.version(_package.version);
133
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
+
134
161
  // --no-cache, --cache-dir, --no-source-maps, --no-autoinstall, --global?, --public-url, --log-level
135
162
  // --no-content-hash, --experimental-scope-hoisting, --detailed-report
136
-
137
163
  const commonOptions = {
138
164
  '--no-cache': 'disable the filesystem cache',
139
165
  '--config <path>': 'specify which config to use. can be a path or a package name',
140
166
  '--cache-dir <path>': 'set the cache directory. defaults to ".parcel-cache"',
141
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),
142
170
  '--no-source-maps': 'disable sourcemaps',
143
171
  '--target [name]': ['only build given target(s)', (val, list) => list.concat([val]), []],
144
172
  '--log-level <level>': new (_commander().default.Option)('--log-level <level>', 'set the log level').choices(['none', 'error', 'warn', 'info', 'verbose']),
@@ -161,7 +189,7 @@ const commonOptions = {
161
189
  if (val !== 'true' && val !== 'false') {
162
190
  throw new Error(`Feature flag ${name} must be set to true or false`);
163
191
  }
164
- featureFlagValue = val;
192
+ featureFlagValue = val === 'true';
165
193
  }
166
194
  previousValue[name] = (_featureFlagValue = featureFlagValue) !== null && _featureFlagValue !== void 0 ? _featureFlagValue : String(val);
167
195
  } else {
@@ -454,6 +482,8 @@ async function normalizeOptions(command, inputFS) {
454
482
  shouldDisableCache: command.cache === false,
455
483
  cacheDir: command.cacheDir,
456
484
  watchDir: command.watchDir,
485
+ watchBackend: command.watchBackend,
486
+ watchIgnore: command.watchIgnore,
457
487
  config: command.config,
458
488
  mode,
459
489
  hmrOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parcel",
3
- "version": "2.0.0-dev.1526+70889ca07",
3
+ "version": "2.0.0-dev.1563+c422b7ff3",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -21,18 +21,18 @@
21
21
  "node": ">= 12.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "@parcel/config-default": "2.0.0-dev.1528+70889ca07",
25
- "@parcel/core": "2.0.0-dev.1526+70889ca07",
26
- "@parcel/diagnostic": "2.0.0-dev.1528+70889ca07",
27
- "@parcel/events": "2.0.0-dev.1528+70889ca07",
28
- "@parcel/feature-flags": "2.12.1-dev.3151+70889ca07",
29
- "@parcel/fs": "2.0.0-dev.1528+70889ca07",
30
- "@parcel/logger": "2.0.0-dev.1528+70889ca07",
31
- "@parcel/package-manager": "2.0.0-dev.1528+70889ca07",
32
- "@parcel/reporter-cli": "2.0.0-dev.1528+70889ca07",
33
- "@parcel/reporter-dev-server": "2.0.0-dev.1528+70889ca07",
34
- "@parcel/reporter-tracer": "2.12.1-dev.3151+70889ca07",
35
- "@parcel/utils": "2.0.0-dev.1528+70889ca07",
24
+ "@parcel/config-default": "2.0.0-dev.1565+c422b7ff3",
25
+ "@parcel/core": "2.0.0-dev.1563+c422b7ff3",
26
+ "@parcel/diagnostic": "2.0.0-dev.1565+c422b7ff3",
27
+ "@parcel/events": "2.0.0-dev.1565+c422b7ff3",
28
+ "@parcel/feature-flags": "2.12.1-dev.3188+c422b7ff3",
29
+ "@parcel/fs": "2.0.0-dev.1565+c422b7ff3",
30
+ "@parcel/logger": "2.0.0-dev.1565+c422b7ff3",
31
+ "@parcel/package-manager": "2.0.0-dev.1565+c422b7ff3",
32
+ "@parcel/reporter-cli": "2.0.0-dev.1565+c422b7ff3",
33
+ "@parcel/reporter-dev-server": "2.0.0-dev.1565+c422b7ff3",
34
+ "@parcel/reporter-tracer": "2.12.1-dev.3188+c422b7ff3",
35
+ "@parcel/utils": "2.0.0-dev.1565+c422b7ff3",
36
36
  "chalk": "^4.1.0",
37
37
  "commander": "^7.0.0",
38
38
  "get-port": "^4.2.0"
@@ -41,5 +41,5 @@
41
41
  "@babel/core": "^7.22.11",
42
42
  "@parcel/babel-register": "2.12.0"
43
43
  },
44
- "gitHead": "70889ca07dccb95e21e4c6a2844d632e3723faf4"
44
+ "gitHead": "c422b7ff3c383779781ea5169d86191508b01e5b"
45
45
  }
package/src/cli.js CHANGED
@@ -66,9 +66,31 @@ process.on('unhandledRejection', handleUncaughtException);
66
66
  program.storeOptionsAsProperties();
67
67
  program.version(version);
68
68
 
69
+ // Only display choices available to callers OS
70
+ let watcherBackendChoices = ['brute-force'];
71
+ switch (process.platform) {
72
+ case 'darwin': {
73
+ watcherBackendChoices.push('watchman', 'fs-events');
74
+ break;
75
+ }
76
+ case 'linux': {
77
+ watcherBackendChoices.push('watchman', 'inotify');
78
+ break;
79
+ }
80
+ case 'win32': {
81
+ watcherBackendChoices.push('watchman', 'windows');
82
+ break;
83
+ }
84
+ case 'freebsd' || 'openbsd': {
85
+ watcherBackendChoices.push('watchman');
86
+ break;
87
+ }
88
+ default:
89
+ break;
90
+ }
91
+
69
92
  // --no-cache, --cache-dir, --no-source-maps, --no-autoinstall, --global?, --public-url, --log-level
70
93
  // --no-content-hash, --experimental-scope-hoisting, --detailed-report
71
-
72
94
  const commonOptions = {
73
95
  '--no-cache': 'disable the filesystem cache',
74
96
  '--config <path>':
@@ -76,6 +98,14 @@ const commonOptions = {
76
98
  '--cache-dir <path>': 'set the cache directory. defaults to ".parcel-cache"',
77
99
  '--watch-dir <path>':
78
100
  'set the root watch directory. defaults to nearest lockfile or source control dir.',
101
+ '--watch-ignore [path]': [
102
+ `list of directories watcher should not be tracking for changes. defaults to ['.git', '.hg']`,
103
+ dirs => dirs.split(','),
104
+ ],
105
+ '--watch-backend': new commander.Option(
106
+ '--watch-backend <name>',
107
+ 'set watcher backend',
108
+ ).choices(watcherBackendChoices),
79
109
  '--no-source-maps': 'disable sourcemaps',
80
110
  '--target [name]': [
81
111
  'only build given target(s)',
@@ -116,7 +146,7 @@ const commonOptions = {
116
146
  `Feature flag ${name} must be set to true or false`,
117
147
  );
118
148
  }
119
- featureFlagValue = val;
149
+ featureFlagValue = val === 'true';
120
150
  }
121
151
  previousValue[name] = featureFlagValue ?? String(val);
122
152
  } else {
@@ -497,10 +527,13 @@ async function normalizeOptions(
497
527
  if (typeof input !== 'string') return [];
498
528
  return input.split(',').map(value => value.trim());
499
529
  };
530
+
500
531
  return {
501
532
  shouldDisableCache: command.cache === false,
502
533
  cacheDir: command.cacheDir,
503
534
  watchDir: command.watchDir,
535
+ watchBackend: command.watchBackend,
536
+ watchIgnore: command.watchIgnore,
504
537
  config: command.config,
505
538
  mode,
506
539
  hmrOptions,