@xh/hoist-dev-utils 6.0.0 → 7.0.0-SNAPSHOT.1665098347172
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/README.md +13 -9
- package/configureWebpack.js +4 -4
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ including Webpack Dev Server, Babel, and other essential loaders.
|
|
|
14
14
|
|
|
15
15
|
In most cases this package could be the _only_ dev dependency required by Hoist React apps, although
|
|
16
16
|
apps might wish to configure additional tooling such as stylelint (for linting SASS files) or
|
|
17
|
-
lint-staged (for running linters as a pre-commit git hook). See the
|
|
17
|
+
lint-staged and husky (for running linters as a pre-commit git hook). See the
|
|
18
18
|
[Toolbox package.json](https://github.com/xh/toolbox/blob/develop/client-app/package.json) for
|
|
19
|
-
examples of
|
|
19
|
+
examples of these libraries in action.
|
|
20
20
|
|
|
21
21
|
### Webpack configuration
|
|
22
22
|
|
|
@@ -56,7 +56,6 @@ versioned 1.2.3 release).
|
|
|
56
56
|
See the [Hoist React docs](https://github.com/xh/hoist-react/blob/develop/docs/build-and-deploy.md)
|
|
57
57
|
for step-by-step details on the build process.
|
|
58
58
|
|
|
59
|
-
|
|
60
59
|
### Favicons
|
|
61
60
|
|
|
62
61
|
To include a favicon with your app, provide the `favicon` option to `configureWebpack()`. This can be either
|
|
@@ -71,27 +70,32 @@ return configureWebpack({
|
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
If your app is intended to be used on mobile devices, you may want to also include a wider variety of favicons.
|
|
74
|
-
The following files will be automatically bundled in your app's manifest.json if they are found your
|
|
73
|
+
The following files will be automatically bundled in your app's manifest.json if they are found in your project's
|
|
74
|
+
`/client-app/public` folder:
|
|
75
75
|
|
|
76
76
|
+ `favicon-192.png` (192px x 192px)
|
|
77
77
|
+ `favicon-512.png` (512px x 512px)
|
|
78
78
|
+ `apple-touch-icon.png` (180px x 180px)
|
|
79
79
|
|
|
80
80
|
You can use the `svg-favicon.sh` script to automatically create these favicons from a square SVG. Note that this script
|
|
81
|
-
requires inkscape to be installed. Download the latest version from [https://inkscape.org/](https://inkscape.org/)
|
|
81
|
+
requires inkscape to be installed. Download the latest version from [https://inkscape.org/](https://inkscape.org/) or
|
|
82
|
+
install on Mac via Homebrew with `brew install inkscape`.
|
|
82
83
|
|
|
83
|
-
Inkscape includes a command-line interface which is leveraged by the script. In order for the script to be able to use
|
|
84
|
-
you must first symlink Inkscape to `/usr/local/bin
|
|
84
|
+
Inkscape includes a command-line interface which is leveraged by the script. In order for the script to be able to use
|
|
85
|
+
it, you must first symlink Inkscape to `/usr/local/bin`. (Note this step is _not_ required if you have installed via
|
|
86
|
+
Homebrew.)
|
|
85
87
|
|
|
86
88
|
```shell
|
|
87
89
|
ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
|
|
88
90
|
/usr/local/bin/inkscape
|
|
89
91
|
```
|
|
90
92
|
|
|
91
|
-
Then run the script, passing a path to the SVG file as the argument
|
|
93
|
+
Then run the script, passing a path to the SVG file as the argument. The command below assumes that you have
|
|
94
|
+
`hoist-dev-utils` checked out as a sibling of your top-level project directory, and that you are running the command
|
|
95
|
+
from within `$projectDir/client-app/public`:
|
|
92
96
|
|
|
93
97
|
```shell
|
|
94
|
-
|
|
98
|
+
../../../hoist-dev-utils/svg-favicon.sh favicon.svg
|
|
95
99
|
```
|
|
96
100
|
|
|
97
101
|
### ESLint Configuration
|
package/configureWebpack.js
CHANGED
|
@@ -374,7 +374,7 @@ async function configureWebpack(env) {
|
|
|
374
374
|
// Add JSX to support imports from .jsx source w/o needing to add the extension.
|
|
375
375
|
// Include "*" to continue supporting other imports that *do* specify an extension
|
|
376
376
|
// within the import statement (i.e. `import './foo.png'`). Yes, it's confusing.
|
|
377
|
-
extensions: ['*', '.js', '.jsx', '.json']
|
|
377
|
+
extensions: ['*', '.js', '.ts', '.jsx', '.tsx', '.json']
|
|
378
378
|
},
|
|
379
379
|
|
|
380
380
|
// Ensure Webpack can find loaders installed both within the top-level node_modules dir for
|
|
@@ -424,15 +424,16 @@ async function configureWebpack(env) {
|
|
|
424
424
|
},
|
|
425
425
|
|
|
426
426
|
//------------------------
|
|
427
|
-
// JS processing
|
|
427
|
+
// JS/TS processing
|
|
428
428
|
// Transpile via Babel, with presets/plugins to support Hoist's use of modern / staged JS features.
|
|
429
429
|
//------------------------
|
|
430
430
|
{
|
|
431
|
-
test: /\.(jsx?)$/,
|
|
431
|
+
test: /\.(jsx?)$|\.(tsx?)$/,
|
|
432
432
|
use: {
|
|
433
433
|
loader: 'babel-loader',
|
|
434
434
|
options: {
|
|
435
435
|
presets: [
|
|
436
|
+
'@babel/preset-typescript',
|
|
436
437
|
'@babel/preset-react',
|
|
437
438
|
[
|
|
438
439
|
'@babel/preset-env',
|
|
@@ -702,7 +703,6 @@ async function configureWebpack(env) {
|
|
|
702
703
|
};
|
|
703
704
|
}
|
|
704
705
|
|
|
705
|
-
|
|
706
706
|
//------------------------
|
|
707
707
|
// Implementation
|
|
708
708
|
//------------------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist-dev-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-SNAPSHOT.1665098347172",
|
|
4
4
|
"description": "Utilities for configuring builds of Hoist-React client applications.",
|
|
5
5
|
"repository": "github:xh/hoist-dev-utils",
|
|
6
6
|
"homepage": "https://github.com/xh/hoist-dev-utils",
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
"@babel/plugin-proposal-decorators": "~7.18.9",
|
|
16
16
|
"@babel/preset-env": "~7.18.9",
|
|
17
17
|
"@babel/preset-react": "~7.18.6",
|
|
18
|
+
"@babel/preset-typescript": "~7.18.6",
|
|
18
19
|
"@cerner/duplicate-package-checker-webpack-plugin": "~2.3.0",
|
|
19
20
|
"@types/lodash": "^4.0.0",
|
|
20
21
|
"@types/react": "^17.0.0",
|
|
21
|
-
"@xh/eslint-config": "
|
|
22
|
+
"@xh/eslint-config": "5.0.0-SNAPSHOT.1665096041564",
|
|
22
23
|
"autoprefixer": "~10.4.7",
|
|
23
24
|
"babel-loader": "~8.2.5",
|
|
24
25
|
"babel-plugin-transform-imports": "~2.0.0",
|