@enact/cli 5.0.2 → 5.1.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/.travis.yml +1 -1
- package/CHANGELOG.md +17 -0
- package/commands/info.js +1 -0
- package/commands/pack.js +2 -1
- package/config/babel.config.js +1 -132
- package/docs/building-apps.md +22 -0
- package/npm-shrinkwrap.json +114368 -36865
- package/package.json +78 -87
package/.travis.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 5.1.1 (February 10, 2023)
|
|
2
|
+
|
|
3
|
+
* Fixed `eslint-plugin-react` version to `7.31.11` temporarily.
|
|
4
|
+
* Updated dependencies.
|
|
5
|
+
|
|
6
|
+
### pack
|
|
7
|
+
|
|
8
|
+
* Updated `babel.config.js` to use `babel-preset-enact` module that holds the babel config for Enact.
|
|
9
|
+
|
|
10
|
+
## 5.1.0 (November 4, 2022)
|
|
11
|
+
|
|
12
|
+
* Unpinned versions of dependencies.
|
|
13
|
+
|
|
14
|
+
### pack
|
|
15
|
+
|
|
16
|
+
* Added `--custom-skin` option to build with custom skin for sandstone apps.
|
|
17
|
+
|
|
1
18
|
## 5.0.2 (September 16, 2022)
|
|
2
19
|
|
|
3
20
|
* Pinned versions of dependencies as same as 5.0.0.
|
package/commands/info.js
CHANGED
|
@@ -103,6 +103,7 @@ function api({cliInfo = false, dev = false} = {}) {
|
|
|
103
103
|
console.log(chalk.yellow.bold('==Enact Components=='));
|
|
104
104
|
[
|
|
105
105
|
'@enact/dev-utils',
|
|
106
|
+
'babel-preset-enact',
|
|
106
107
|
'eslint-config-enact',
|
|
107
108
|
'eslint-plugin-enact',
|
|
108
109
|
'postcss-resolution-independence'
|
package/commands/pack.js
CHANGED
|
@@ -46,6 +46,7 @@ function displayHelp() {
|
|
|
46
46
|
console.log(' -s, --snapshot Generate V8 snapshot blob');
|
|
47
47
|
console.log(' (requires V8_MKSNAPSHOT set)');
|
|
48
48
|
console.log(' -m, --meta JSON to override package.json enact metadata');
|
|
49
|
+
console.log(' -c, --custom-skin Build with a custom skin');
|
|
49
50
|
console.log(' --stats Output bundle analysis file');
|
|
50
51
|
console.log(' --verbose Verbose log build details');
|
|
51
52
|
console.log(' -v, --version Display version information');
|
|
@@ -59,7 +60,6 @@ function displayHelp() {
|
|
|
59
60
|
--externals Specify a local directory path to the standalone external framework
|
|
60
61
|
--externals-public Remote public path to the external framework for use injecting into HTML
|
|
61
62
|
--externals-polyfill Flag whether to use external polyfill (or include in framework build)
|
|
62
|
-
--custom-skin To use a custom skin for build
|
|
63
63
|
--ilib-additional-path Specify iLib additional resources path
|
|
64
64
|
*/
|
|
65
65
|
process.exit(0);
|
|
@@ -301,6 +301,7 @@ function cli(args) {
|
|
|
301
301
|
l: 'locales',
|
|
302
302
|
s: 'snapshot',
|
|
303
303
|
m: 'meta',
|
|
304
|
+
c: 'custom-skin',
|
|
304
305
|
w: 'watch',
|
|
305
306
|
h: 'help'
|
|
306
307
|
}
|
package/config/babel.config.js
CHANGED
|
@@ -1,132 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* babel.config.js
|
|
3
|
-
*
|
|
4
|
-
* A Babel javascript configuration dynamically setup for Enact
|
|
5
|
-
* development environment on target platforms.
|
|
6
|
-
*/
|
|
7
|
-
const path = require('path');
|
|
8
|
-
|
|
9
|
-
// Check if JSX transform is able
|
|
10
|
-
const hasJsxRuntime = (() => {
|
|
11
|
-
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
require.resolve('react/jsx-runtime');
|
|
17
|
-
return true;
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
})();
|
|
22
|
-
|
|
23
|
-
module.exports = function (api) {
|
|
24
|
-
const env = process.env.BABEL_ENV || process.env.NODE_ENV;
|
|
25
|
-
const es5Standalone = process.env.ES5 && process.env.ES5 !== 'false';
|
|
26
|
-
|
|
27
|
-
if (api && api.cache) api.cache(() => env + es5Standalone);
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
presets: [
|
|
31
|
-
[
|
|
32
|
-
require('@babel/preset-env').default,
|
|
33
|
-
{
|
|
34
|
-
exclude: [
|
|
35
|
-
// Exclude transforms that make all code slower
|
|
36
|
-
'transform-typeof-symbol',
|
|
37
|
-
// Exclude chunky/costly transforms
|
|
38
|
-
'transform-regenerator',
|
|
39
|
-
// Ignore web features since window and DOM is not available
|
|
40
|
-
// in a V8 snapshot blob.
|
|
41
|
-
// TODO: investigates ways to include but delay loading.
|
|
42
|
-
'web.dom-collections.for-each',
|
|
43
|
-
'web.dom-collections.iterator',
|
|
44
|
-
'web.immediate',
|
|
45
|
-
'web.queue-microtask',
|
|
46
|
-
'web.timers',
|
|
47
|
-
'web.url',
|
|
48
|
-
'web.url.to-json',
|
|
49
|
-
'web.url-search-params'
|
|
50
|
-
],
|
|
51
|
-
forceAllTransforms: es5Standalone,
|
|
52
|
-
useBuiltIns: 'entry',
|
|
53
|
-
corejs: 3
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
[
|
|
57
|
-
require('@babel/preset-react').default,
|
|
58
|
-
{
|
|
59
|
-
// Adds component stack to warning messages
|
|
60
|
-
// Adds __self attribute to JSX which React will use for some warnings
|
|
61
|
-
development: env !== 'production' && !es5Standalone,
|
|
62
|
-
// Will use the native built-in instead of trying to polyfill
|
|
63
|
-
// behavior for any plugins that require one.
|
|
64
|
-
...(!hasJsxRuntime ? {useBuiltIns: true} : {runtime: 'automatic'})
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
['@babel/preset-typescript']
|
|
68
|
-
],
|
|
69
|
-
plugins: [
|
|
70
|
-
// Stage 0
|
|
71
|
-
// '@babel/plugin-proposal-function-bind',
|
|
72
|
-
|
|
73
|
-
// Stage 1
|
|
74
|
-
require('@babel/plugin-proposal-export-default-from').default,
|
|
75
|
-
// '@babel/plugin-proposal-logical-assignment-operators',
|
|
76
|
-
// ['@babel/plugin-proposal-pipeline-operator', { 'proposal': 'minimal' }],
|
|
77
|
-
// '@babel/plugin-proposal-do-expressions',
|
|
78
|
-
|
|
79
|
-
// Stage 2
|
|
80
|
-
[require('@babel/plugin-proposal-decorators').default, false],
|
|
81
|
-
require('@babel/plugin-proposal-export-namespace-from').default,
|
|
82
|
-
require('@babel/plugin-proposal-numeric-separator').default,
|
|
83
|
-
// '@babel/plugin-proposal-function-sent',
|
|
84
|
-
// '@babel/plugin-proposal-throw-expressions',
|
|
85
|
-
|
|
86
|
-
// Stage 3
|
|
87
|
-
require('@babel/plugin-syntax-dynamic-import').default,
|
|
88
|
-
[require('@babel/plugin-proposal-class-properties').default, {loose: true}],
|
|
89
|
-
[require('@babel/plugin-proposal-private-methods').default, {loose: true}],
|
|
90
|
-
[require('@babel/plugin-proposal-private-property-in-object').default, {loose: true}],
|
|
91
|
-
// '@babel/plugin-syntax-import-meta',
|
|
92
|
-
// '@babel/plugin-proposal-json-strings'
|
|
93
|
-
|
|
94
|
-
// Soon to be included within pre-env; include here until then
|
|
95
|
-
require('@babel/plugin-proposal-optional-chaining').default,
|
|
96
|
-
require('@babel/plugin-proposal-nullish-coalescing-operator').default,
|
|
97
|
-
|
|
98
|
-
!es5Standalone && [
|
|
99
|
-
require('@babel/plugin-transform-runtime').default,
|
|
100
|
-
{
|
|
101
|
-
corejs: false,
|
|
102
|
-
helpers: true,
|
|
103
|
-
// Explicitly resolve runtime version to avoid issue
|
|
104
|
-
// https://github.com/babel/babel/issues/10261
|
|
105
|
-
version: require('@babel/runtime/package.json').version,
|
|
106
|
-
regenerator: false,
|
|
107
|
-
useESModules: !es5Standalone,
|
|
108
|
-
// @remove-on-eject-begin
|
|
109
|
-
// Undocumented option to use CLI-contained runtime, ensuring
|
|
110
|
-
// the correct version
|
|
111
|
-
absoluteRuntime: path.dirname(require.resolve('@babel/runtime/package.json'))
|
|
112
|
-
// @remove-on-eject-end
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
|
|
116
|
-
require('babel-plugin-dev-expression'),
|
|
117
|
-
env === 'test' && !es5Standalone && require('babel-plugin-dynamic-import-node').default,
|
|
118
|
-
env === 'production' && !es5Standalone && require('@babel/plugin-transform-react-inline-elements').default,
|
|
119
|
-
env === 'production' &&
|
|
120
|
-
!es5Standalone && [
|
|
121
|
-
require('babel-plugin-transform-react-remove-prop-types').default,
|
|
122
|
-
{removeImport: true}
|
|
123
|
-
]
|
|
124
|
-
].filter(Boolean),
|
|
125
|
-
overrides: [
|
|
126
|
-
{
|
|
127
|
-
test: /\.tsx?$/,
|
|
128
|
-
plugins: [[require('@babel/plugin-proposal-decorators').default, {legacy: true}]]
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
};
|
|
132
|
-
};
|
|
1
|
+
module.exports = require('babel-preset-enact');
|
package/docs/building-apps.md
CHANGED
|
@@ -22,6 +22,7 @@ order: 4
|
|
|
22
22
|
"all" - All locales that iLib supports
|
|
23
23
|
-s, --snapshot Generate V8 snapshot blob
|
|
24
24
|
(requires V8_MKSNAPSHOT set)
|
|
25
|
+
-c, --custom-skin Build with a custom skin
|
|
25
26
|
--stats Output bundle analysis file
|
|
26
27
|
|
|
27
28
|
```
|
|
@@ -196,6 +197,27 @@ try to set `NODE_PATH` to point global node_modules directory like below.
|
|
|
196
197
|
export NODE_PATH=/path/to/your/global/node_modules
|
|
197
198
|
```
|
|
198
199
|
|
|
200
|
+
## Custom Skin Support
|
|
201
|
+
|
|
202
|
+
Sandstone supports custom skin features to let you easily override the colors of components. All you need to do is build your app with `--custom-skin` option and add a CSS file named `custom_skin.css` which includes a preset of colors, under the `customizations` folder in the build result like below.
|
|
203
|
+
|
|
204
|
+
```none
|
|
205
|
+
my-app/
|
|
206
|
+
README.md
|
|
207
|
+
.gitignore
|
|
208
|
+
package.json
|
|
209
|
+
dist/
|
|
210
|
+
customizations/
|
|
211
|
+
custom_skin.css
|
|
212
|
+
main.css
|
|
213
|
+
main.js
|
|
214
|
+
...
|
|
215
|
+
node_modules/
|
|
216
|
+
src/
|
|
217
|
+
resources/
|
|
218
|
+
webos-meta/
|
|
219
|
+
```
|
|
220
|
+
|
|
199
221
|
## Isomorphic Support & Prerendering
|
|
200
222
|
By using the isomorphic code layout option, your project bundle will be outputted in a versatile universal code format allowing potential usage outside the browser. The Enact CLI takes advantage of this mode by additionally generating an HTML output of your project and embedding it directly with the resulting **index.html**. By default, isomorphic mode will attempt to prerender only `en-US`, however with the `--locales` option, a wide variety of locales can be specified and prerendered. More details on isomorphic support and its limitations can be found [here](./isomorphic-support.md).
|
|
201
223
|
|