@enact/cli 6.1.2 → 7.0.0-alpha.1
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 +10 -0
- package/commands/pack.js +1 -1
- package/commands/serve.js +12 -7
- package/config/dotenv.js +1 -1
- package/config/webpack.config.js +12 -1
- package/docs/building-apps.md +5 -0
- package/npm-shrinkwrap.json +19473 -17978
- package/package.json +39 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 7.0.0-alpha.1 (July 24, 2024)
|
|
2
|
+
|
|
3
|
+
* Updated the minimum version of Node to `18.12.0`.
|
|
4
|
+
* Updated all dependencies to the latest including `webpack-dev-server` version 5 and `@testing-library/react` version 15.
|
|
5
|
+
|
|
6
|
+
### pack
|
|
7
|
+
|
|
8
|
+
* Updated `css-loader` to 7.x and changed `css-loader` options to restore 6.x behavior.
|
|
9
|
+
* Added `--no-animation` option to build without effects such as animation and shadow.
|
|
10
|
+
|
|
1
11
|
## 6.1.2 (March 13, 2024)
|
|
2
12
|
|
|
3
13
|
* Updated docs to cover the latest commands of `enact pack`.
|
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');
|
|
@@ -63,7 +64,6 @@ function displayHelp() {
|
|
|
63
64
|
--externals-public Remote public path to the external framework for use injecting into HTML
|
|
64
65
|
--externals-polyfill Flag whether to use external polyfill (or include in framework build)
|
|
65
66
|
--ilib-additional-path Specify iLib additional resources path
|
|
66
|
-
--no-animation Build without effects such as animation and shadow
|
|
67
67
|
*/
|
|
68
68
|
process.exit(0);
|
|
69
69
|
}
|
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
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
312
|
+
devServer.stopCallback(() => {});
|
|
308
313
|
process.exit();
|
|
309
314
|
});
|
|
310
315
|
}
|
package/config/dotenv.js
CHANGED
package/config/webpack.config.js
CHANGED
|
@@ -99,11 +99,22 @@ module.exports = function (
|
|
|
99
99
|
// from them won't be in the main CSS file.
|
|
100
100
|
// When INLINE_STYLES env var is set, instead of MiniCssExtractPlugin, uses
|
|
101
101
|
// `style` loader to dynamically inline CSS in style tags at runtime.
|
|
102
|
+
const mergedCssLoaderOptions = {
|
|
103
|
+
...cssLoaderOptions,
|
|
104
|
+
modules: {
|
|
105
|
+
...cssLoaderOptions.modules,
|
|
106
|
+
// Options to restore 6.x behavior:
|
|
107
|
+
// https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#700-2024-04-04
|
|
108
|
+
namedExport: false,
|
|
109
|
+
exportLocalsConvention: 'as-is'
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
102
113
|
const loaders = [
|
|
103
114
|
process.env.INLINE_STYLES ? require.resolve('style-loader') : MiniCssExtractPlugin.loader,
|
|
104
115
|
{
|
|
105
116
|
loader: require.resolve('css-loader'),
|
|
106
|
-
options: Object.assign({sourceMap: shouldUseSourceMap},
|
|
117
|
+
options: Object.assign({sourceMap: shouldUseSourceMap}, mergedCssLoaderOptions, {
|
|
107
118
|
url: {
|
|
108
119
|
filter: url => {
|
|
109
120
|
// Don't handle absolute path urls
|
package/docs/building-apps.md
CHANGED
|
@@ -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.
|