@lipemat/js-boilerplate 7.0.0-beta.2 → 7.0.0-beta.3
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 +7 -5
- package/config/webpack.dev.js +7 -4
- package/config/webpack.dist.js +5 -5
- package/helpers/package-config.js +2 -2
- package/package.json +1 -1
- package/scripts/lint.js +2 -1
package/README.md
CHANGED
|
@@ -15,11 +15,11 @@ A zero configuration starting point for a React or non React app.
|
|
|
15
15
|
yarn add @lipemat/js-boilerplate
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
## Version
|
|
18
|
+
## Version 7
|
|
19
19
|
|
|
20
|
-
**Version
|
|
20
|
+
**Version 7 has some backward incompatibilities and should be updated with focus and thoroughness.**
|
|
21
21
|
|
|
22
|
-
[Migration instructions are here.](https://github.com/lipemat/js-boilerplate/wiki/Version-
|
|
22
|
+
[Migration instructions are here.](https://github.com/lipemat/js-boilerplate/wiki/Version-7-Migration)
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
Add the following to your package.json. (this may also be found in the `templates` directory.
|
|
@@ -142,9 +142,11 @@ in your `package.json` to have it transformed.
|
|
|
142
142
|
If you are using https in your local environment, you may point to the certificates in your package.json like so:
|
|
143
143
|
|
|
144
144
|
```json
|
|
145
|
+
{
|
|
145
146
|
"certificates": {
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
"cert": "<path to -crt.pem file>",
|
|
148
|
+
"key": "<path to -key.pem file>"
|
|
148
149
|
}
|
|
150
|
+
}
|
|
149
151
|
```
|
|
150
152
|
|
package/config/webpack.dev.js
CHANGED
|
@@ -25,6 +25,9 @@ if ( configHelper.hasLocalOverride( 'tsconfig.json', true ) ) {
|
|
|
25
25
|
logger: {
|
|
26
26
|
devServer: false,
|
|
27
27
|
},
|
|
28
|
+
typescript: {
|
|
29
|
+
configFile: config.workingDirectory + '/tsconfig.json',
|
|
30
|
+
},
|
|
28
31
|
} ) );
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -32,14 +35,14 @@ const entry = {
|
|
|
32
35
|
master: [
|
|
33
36
|
'webpack-dev-server/client?' + config.url + ':3000',
|
|
34
37
|
'webpack/hot/only-dev-server',
|
|
35
|
-
'
|
|
38
|
+
config.workingDirectory + '/src/index.js',
|
|
36
39
|
],
|
|
37
40
|
};
|
|
38
41
|
|
|
39
|
-
// Loads an admin.js file if it exists
|
|
40
|
-
if ( fs.existsSync( path.resolve( config.workingDirectory, '
|
|
42
|
+
// Loads an admin.js file if it exists.
|
|
43
|
+
if ( fs.existsSync( path.resolve( config.workingDirectory, '/src/admin.js' ) ) ) {
|
|
41
44
|
entry.admin = [ ...entry.master ];
|
|
42
|
-
entry.admin.splice( -1, 1, '
|
|
45
|
+
entry.admin.splice( -1, 1, config.workingDirectory + '/src/admin.js' );
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
module.exports = {
|
package/config/webpack.dist.js
CHANGED
|
@@ -12,14 +12,14 @@ const SriPlugin = require( 'webpack-subresource-integrity' );
|
|
|
12
12
|
|
|
13
13
|
const entry = {
|
|
14
14
|
master: [
|
|
15
|
-
'
|
|
15
|
+
config.workingDirectory + '/src/index.js',
|
|
16
16
|
],
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
// Loads an admin.js file if it exists
|
|
20
|
-
if ( fs.existsSync( path.resolve( config.workingDirectory, '
|
|
19
|
+
// Loads an admin.js file if it exists.
|
|
20
|
+
if ( fs.existsSync( path.resolve( config.workingDirectory, '/src/admin.js' ) ) ) {
|
|
21
21
|
entry.admin = [ ...entry.master ];
|
|
22
|
-
entry.admin.splice( -1, 1, '
|
|
22
|
+
entry.admin.splice( -1, 1, config.workingDirectory + '/src/admin.js' );
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
module.exports = {
|
|
@@ -55,7 +55,7 @@ module.exports = {
|
|
|
55
55
|
output: {
|
|
56
56
|
path: path.resolve( config.workingDirectory, 'dist' ),
|
|
57
57
|
filename: '[name].js',
|
|
58
|
-
publicPath: config.
|
|
58
|
+
publicPath: config.themeUrlPath + 'js/dist/',
|
|
59
59
|
chunkFilename: '[name].[chunkhash].js',
|
|
60
60
|
crossOriginLoading: 'anonymous',
|
|
61
61
|
},
|
|
@@ -6,8 +6,8 @@ const fs = require( 'fs' );
|
|
|
6
6
|
const workingDirectory = fs.realpathSync( process.cwd() );
|
|
7
7
|
|
|
8
8
|
let packageConfig = require( path.resolve( workingDirectory, 'package.json' ) );
|
|
9
|
-
packageConfig.workingDirectory = workingDirectory;
|
|
10
|
-
packageConfig.
|
|
9
|
+
packageConfig.workingDirectory = packageConfig.jsPath ? path.resolve( packageConfig.jsPath ) : workingDirectory;
|
|
10
|
+
packageConfig.themeUrlPath = packageConfig.themeUrlPath || '/';
|
|
11
11
|
packageConfig.url = packageConfig.url || 'http://localhost';
|
|
12
12
|
packageConfig.root = packageConfig.root || './';
|
|
13
13
|
packageConfig.regenerate_revision = packageConfig.regenerate_revision || false;
|
package/package.json
CHANGED
package/scripts/lint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
const eslint = require( 'eslint/lib/cli' );
|
|
2
|
+
const packageConfig = require( '../helpers/package-config' );
|
|
2
3
|
|
|
3
|
-
eslint.execute( [ '', '', 'src', '--fix', '--ext', '.tsx,.ts,.js,.jsx' ] );
|
|
4
|
+
eslint.execute( [ '', '', packageConfig.workingDirectory + '/src', '--fix', '--ext', '.tsx,.ts,.js,.jsx' ] );
|