@enact/cli 6.1.3 → 7.0.0-alpha.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
- ## 6.1.3 (October 17, 2024)
1
+ ## 7.0.0-alpha.2 (December 6, 2024)
2
2
 
3
- * No significant changes.
3
+ * Updated dependencies.
4
+
5
+ ## 7.0.0-alpha.1 (July 24, 2024)
6
+
7
+ * Updated the minimum version of Node to `18.12.0`.
8
+ * Updated all dependencies to the latest including `webpack-dev-server` version 5 and `@testing-library/react` version 15.
9
+
10
+ ### pack
11
+
12
+ * Updated `css-loader` to 7.x and changed `css-loader` options to restore 6.x behavior.
13
+ * Added `--no-animation` option to build without effects such as animation and shadow.
4
14
 
5
15
  ## 6.1.2 (March 13, 2024)
6
16
 
package/commands/pack.js CHANGED
@@ -49,6 +49,7 @@ function displayHelp() {
49
49
  console.log(' (requires V8_MKSNAPSHOT set)');
50
50
  console.log(' -m, --meta JSON to override package.json enact metadata');
51
51
  console.log(' -c, --custom-skin Build with a custom skin');
52
+ console.log(' --no-animation Build without effects such as animation and shadow');
52
53
  console.log(' --stats Output bundle analysis file');
53
54
  console.log(' --verbose Verbose log build details');
54
55
  console.log(' -v, --version Display version information');
@@ -64,7 +65,6 @@ function displayHelp() {
64
65
  --externals-public Remote public path to the external framework for use injecting into HTML
65
66
  --externals-polyfill Flag whether to use external polyfill (or include in framework build)
66
67
  --ilib-additional-path Specify iLib additional resources path
67
- --no-animation Build without effects such as animation and shadow
68
68
  */
69
69
  process.exit(0);
70
70
  }
@@ -265,7 +265,7 @@ function api(opts = {}) {
265
265
  );
266
266
 
267
267
  // Set any entry path override
268
- if (opts.entry) helper.replaceMain(config, path.resolve(opts.entry));
268
+ if (opts.entry || app.entry) helper.replaceEntry(config, opts.entry || app.entry);
269
269
 
270
270
  // Set any output path override
271
271
  if (opts.output) config.output.path = path.resolve(opts.output);
package/commands/serve.js CHANGED
@@ -95,12 +95,17 @@ function hotDevServer(config, fastRefresh) {
95
95
  }
96
96
 
97
97
  function devServerConfig(host, port, protocol, publicPath, proxy, allowedHost) {
98
- let https = false;
98
+ let server = {
99
+ type: 'http'
100
+ };
99
101
  const {SSL_CRT_FILE, SSL_KEY_FILE} = process.env;
100
102
  if (protocol === 'https' && [SSL_CRT_FILE, SSL_KEY_FILE].every(f => f && fs.existsSync(f))) {
101
- https = {
102
- cert: fs.readFileSync(SSL_CRT_FILE),
103
- key: fs.readFileSync(SSL_KEY_FILE)
103
+ server = {
104
+ type: 'https',
105
+ options: {
106
+ cert: fs.readFileSync(SSL_CRT_FILE),
107
+ key: fs.readFileSync(SSL_KEY_FILE)
108
+ }
104
109
  };
105
110
  }
106
111
  const disableFirewall = !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
@@ -126,7 +131,7 @@ function devServerConfig(host, port, protocol, publicPath, proxy, allowedHost) {
126
131
  // want to allow setting the allowedHosts manually for more complex setups
127
132
  allowedHosts: disableFirewall ? 'all' : [allowedHost],
128
133
  // Enable HTTPS if the HTTPS environment variable is set to 'true'
129
- https,
134
+ server,
130
135
  host,
131
136
  port,
132
137
  // Allow cross-origin HTTP requests
@@ -296,7 +301,7 @@ function serve(config, host, port, open) {
296
301
 
297
302
  ['SIGINT', 'SIGTERM'].forEach(sig => {
298
303
  process.on(sig, () => {
299
- devServer.close();
304
+ devServer.stopCallback(() => {});
300
305
  process.exit();
301
306
  });
302
307
  });
@@ -304,7 +309,7 @@ function serve(config, host, port, open) {
304
309
  if (process.env.CI !== 'true') {
305
310
  // Gracefully exit when stdin ends
306
311
  process.stdin.on('end', () => {
307
- devServer.close();
312
+ devServer.stopCallback(() => {});
308
313
  process.exit();
309
314
  });
310
315
  }
package/config/dotenv.js CHANGED
@@ -22,7 +22,7 @@ module.exports = {
22
22
  .map(env => path.join(context, env))
23
23
  .forEach(env => {
24
24
  if (fs.existsSync(env)) {
25
- expand(dotenv.config({path: env}));
25
+ expand(dotenv.config({path: env, processEnv: {}}));
26
26
  }
27
27
  });
28
28
  }
@@ -100,11 +100,22 @@ module.exports = function (
100
100
  // from them won't be in the main CSS file.
101
101
  // When INLINE_STYLES env var is set, instead of MiniCssExtractPlugin, uses
102
102
  // `style` loader to dynamically inline CSS in style tags at runtime.
103
+ const mergedCssLoaderOptions = {
104
+ ...cssLoaderOptions,
105
+ modules: {
106
+ ...cssLoaderOptions.modules,
107
+ // Options to restore 6.x behavior:
108
+ // https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#700-2024-04-04
109
+ namedExport: false,
110
+ exportLocalsConvention: 'as-is'
111
+ }
112
+ };
113
+
103
114
  const loaders = [
104
115
  process.env.INLINE_STYLES ? require.resolve('style-loader') : MiniCssExtractPlugin.loader,
105
116
  {
106
117
  loader: require.resolve('css-loader'),
107
- options: Object.assign({sourceMap: shouldUseSourceMap}, cssLoaderOptions, {
118
+ options: Object.assign({sourceMap: shouldUseSourceMap}, mergedCssLoaderOptions, {
108
119
  url: {
109
120
  filter: url => {
110
121
  // Don't handle absolute path urls
@@ -26,6 +26,7 @@ order: 4
26
26
  (requires V8_MKSNAPSHOT set)
27
27
  -m, --meta JSON to override package.json enact metadata
28
28
  -c, --custom-skin Build with a custom skin
29
+ --no-animation Build without effects such as animation and shadow
29
30
  --stats Output bundle analysis file
30
31
  --verbose Verbose log build details
31
32
  -v, --version Display version information
@@ -224,6 +225,10 @@ my-app/
224
225
  webos-meta/
225
226
  ```
226
227
 
228
+ ## Build without Effects
229
+
230
+ To accommodate devices with lower performance, the Enact CLI offers the `--no-animation` option. This option disables animations and graphical effects, including shadows. When activated, it sets the `ENACT_PACK_NO_ANIMATION` environment variable. This variable allows UI libraries like Sandstone to conditionally disable effects. Additionally, you can leverage this variable in your application to achieve the same outcome. Thus, you can develop an app devoid of these effects and do so without modifying your codebase.
231
+
227
232
  ## Caching
228
233
 
229
234
  For supporting better [`caching`](https://webpack.js.org/guides/caching/), Enact CLI provides `--content-hash` option to add a unique hash to each output file name based on the content of an asset.