@enact/cli 5.0.0 → 5.0.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 +7 -0
- package/README.md +16 -2
- package/config/webpack.config.js +6 -12
- package/docs/building-apps.md +8 -9
- package/npm-shrinkwrap.json +45589 -2953
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -92,7 +92,6 @@ For example:
|
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
96
95
|
## Displaying Lint Output in the Editor
|
|
97
96
|
|
|
98
97
|
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
|
|
@@ -104,6 +103,21 @@ You would need to install an ESLint plugin for your editor first.
|
|
|
104
103
|
Ever since ESLint 6, global installs of ESLint configs are no longer supported.
|
|
105
104
|
To work around this new limitation, while still supporting in-editor linting, we've created a new [eslint-config-enact-proxy](https://github.com/enactjs/eslint-config-enact-proxy) package.
|
|
106
105
|
The [eslint-config-enact-proxy](https://github.com/enactjs/eslint-config-enact-proxy) acts like a small proxy config, redirecting ESLint to use a globally-installed Enact ESLint config.
|
|
106
|
+
`eslint-config-enact-proxy` needs to be installed locally on a project to enable in-editor linting:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
npm install --save-dev eslint-config-enact-proxy
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Also, you need to modify `eslintConfig` property in `package.json`:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
"eslintConfig": {
|
|
116
|
+
"extends": "enact-proxy"
|
|
117
|
+
},
|
|
118
|
+
```
|
|
119
|
+
>**NOTE**: For strict mode, use `"extends": "enact-proxy/strict"`.
|
|
120
|
+
|
|
107
121
|
In order for in-editor linting to work with our updated ESLint config, you'll need to upgrade to ESLint 7 or later. This can be installed globally by running:
|
|
108
122
|
|
|
109
123
|
```sh
|
|
@@ -113,7 +127,7 @@ npm install -g eslint
|
|
|
113
127
|
Then, you will need to uninstall any previous globally-installed Enact linting package (everything but eslint itself):
|
|
114
128
|
|
|
115
129
|
```sh
|
|
116
|
-
npm
|
|
130
|
+
npm uninstall -g eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-babel @babel/eslint-parser eslint-plugin-jest eslint-plugin-enact eslint-config-enact
|
|
117
131
|
```
|
|
118
132
|
|
|
119
133
|
## Copyright and License Information
|
package/config/webpack.config.js
CHANGED
|
@@ -320,8 +320,7 @@ module.exports = function (env, isomorphic = false, ilibAdditionalResourcesPath)
|
|
|
320
320
|
use: getStyleLoaders({
|
|
321
321
|
importLoaders: 1,
|
|
322
322
|
modules: {
|
|
323
|
-
getLocalIdent
|
|
324
|
-
mode: 'local'
|
|
323
|
+
getLocalIdent
|
|
325
324
|
}
|
|
326
325
|
})
|
|
327
326
|
},
|
|
@@ -332,8 +331,7 @@ module.exports = function (env, isomorphic = false, ilibAdditionalResourcesPath)
|
|
|
332
331
|
use: getStyleLoaders({
|
|
333
332
|
importLoaders: 1,
|
|
334
333
|
modules: {
|
|
335
|
-
...(app.forceCSSModules ? {getLocalIdent} : {})
|
|
336
|
-
mode: 'icss'
|
|
334
|
+
...(app.forceCSSModules ? {getLocalIdent} : {mode: 'icss'})
|
|
337
335
|
}
|
|
338
336
|
}),
|
|
339
337
|
// Don't consider CSS imports dead code even if the
|
|
@@ -347,8 +345,7 @@ module.exports = function (env, isomorphic = false, ilibAdditionalResourcesPath)
|
|
|
347
345
|
use: getLessStyleLoaders({
|
|
348
346
|
importLoaders: 2,
|
|
349
347
|
modules: {
|
|
350
|
-
getLocalIdent
|
|
351
|
-
mode: 'local'
|
|
348
|
+
getLocalIdent
|
|
352
349
|
}
|
|
353
350
|
})
|
|
354
351
|
},
|
|
@@ -357,8 +354,7 @@ module.exports = function (env, isomorphic = false, ilibAdditionalResourcesPath)
|
|
|
357
354
|
use: getLessStyleLoaders({
|
|
358
355
|
importLoaders: 2,
|
|
359
356
|
modules: {
|
|
360
|
-
...(app.forceCSSModules ? {getLocalIdent} : {})
|
|
361
|
-
mode: 'icss'
|
|
357
|
+
...(app.forceCSSModules ? {getLocalIdent} : {mode: 'icss'})
|
|
362
358
|
}
|
|
363
359
|
}),
|
|
364
360
|
sideEffects: true
|
|
@@ -370,8 +366,7 @@ module.exports = function (env, isomorphic = false, ilibAdditionalResourcesPath)
|
|
|
370
366
|
use: getScssStyleLoaders({
|
|
371
367
|
importLoaders: 3,
|
|
372
368
|
modules: {
|
|
373
|
-
getLocalIdent
|
|
374
|
-
mode: 'local'
|
|
369
|
+
getLocalIdent
|
|
375
370
|
}
|
|
376
371
|
})
|
|
377
372
|
},
|
|
@@ -381,8 +376,7 @@ module.exports = function (env, isomorphic = false, ilibAdditionalResourcesPath)
|
|
|
381
376
|
use: getScssStyleLoaders({
|
|
382
377
|
importLoaders: 3,
|
|
383
378
|
modules: {
|
|
384
|
-
...(app.forceCSSModules ? {getLocalIdent} : {})
|
|
385
|
-
mode: 'icss'
|
|
379
|
+
...(app.forceCSSModules ? {getLocalIdent} : {mode: 'icss'})
|
|
386
380
|
}
|
|
387
381
|
})
|
|
388
382
|
},
|
package/docs/building-apps.md
CHANGED
|
@@ -115,13 +115,6 @@ To use Sass, install Sass globally:
|
|
|
115
115
|
npm install -g sass
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
Note: If you receive an error when building the app that says `Cannot find module 'sass'`, try to set `NODE_PATH` to point global
|
|
119
|
-
node_modules directory like below.
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
export NODE_PATH=/path/to/your/global/node_modules
|
|
123
|
-
```
|
|
124
|
-
|
|
125
118
|
Now you can rename `src/App.css` to `src/App.scss` or `src/App.sass` and for using CSS modules, `src/App.module.scss` or `src/App.module.sass`. And update `src/App.js` to import `src/App.scss`. Enact CLI will compile these files properly through webpack for you.
|
|
126
119
|
|
|
127
120
|
More information can be found [here](https://sass-lang.com/guide) to learn about Sass.
|
|
@@ -137,8 +130,6 @@ To use Tailwindcss, install Tailwindcss globally:
|
|
|
137
130
|
npm install -g tailwindcss
|
|
138
131
|
```
|
|
139
132
|
|
|
140
|
-
Note: If you receive an error when building the app that says `Cannot find module 'tailwindcss'`, try to set `NODE_PATH` to point global node_modules directory.
|
|
141
|
-
|
|
142
133
|
And then run the init command to generate tailwind.config.js in your app:
|
|
143
134
|
|
|
144
135
|
```bash
|
|
@@ -197,6 +188,14 @@ const MainPanel = kind({
|
|
|
197
188
|
|
|
198
189
|
More information can be found [here](https://tailwindcss.com/docs) to learn about tailwindcss.
|
|
199
190
|
|
|
191
|
+
### Troubleshooting
|
|
192
|
+
If you receive an error when building the app that says `Cannot find module: 'typescript/sass/tailwindcss'` after installing the modules above(e.g. `typescript`, `sass`, or `tailwindcss`) globally,
|
|
193
|
+
try to set `NODE_PATH` to point global node_modules directory like below.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
export NODE_PATH=/path/to/your/global/node_modules
|
|
197
|
+
```
|
|
198
|
+
|
|
200
199
|
## Isomorphic Support & Prerendering
|
|
201
200
|
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).
|
|
202
201
|
|