@lipemat/js-boilerplate 10.4.0-beta.6 → 10.4.0-beta.7
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.
|
@@ -12,9 +12,14 @@ const args = process.argv.slice( 2 );
|
|
|
12
12
|
const scriptIndex = args.findIndex(
|
|
13
13
|
x => 'browserslist' === x || 'start' === x || 'dist' === x || 'test' === x || 'lint' === x || 'fix-pnp' === x,
|
|
14
14
|
);
|
|
15
|
-
|
|
15
|
+
let script = -1 === scriptIndex ? args[ 0 ] : args[ scriptIndex ];
|
|
16
16
|
const nodeArgs = scriptIndex > 0 ? args.slice( 0, scriptIndex ) : [];
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
const TS_CONVERTED_SCRIPTS = [
|
|
20
|
+
'test',
|
|
21
|
+
];
|
|
22
|
+
|
|
18
23
|
switch ( script ) {
|
|
19
24
|
case 'browserslist':
|
|
20
25
|
case 'dist':
|
|
@@ -28,6 +33,10 @@ switch ( script ) {
|
|
|
28
33
|
spawn.sync( 'npm', [ 'install', '-g', 'ts-node' ] );
|
|
29
34
|
}
|
|
30
35
|
|
|
36
|
+
if ( TS_CONVERTED_SCRIPTS.includes( script ) ) {
|
|
37
|
+
script = script + '.ts';
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
// Run the script.
|
|
32
41
|
const result = spawn.sync(
|
|
33
42
|
'ts-node',
|
package/config/jest.config.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// So we have something to check against for adjusting things like babel.config.js.
|
|
2
|
-
global.__TEST__ = true;
|
|
3
|
-
|
|
4
1
|
const path = require( 'path' );
|
|
5
2
|
const packageConfig = require( '../helpers/package-config' );
|
|
6
3
|
const fs = require( 'fs' );
|
|
@@ -8,6 +5,11 @@ const fs = require( 'fs' );
|
|
|
8
5
|
const babelConfig = require( '../helpers/config' ).getConfig( 'babel.config' );
|
|
9
6
|
delete babelConfig.cacheDirectory;
|
|
10
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @todo Rename this file to `jest.config.ts` in version 11.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
11
13
|
let jestConfig = {
|
|
12
14
|
globals: {
|
|
13
15
|
__TEST__: true,
|
|
@@ -28,7 +30,7 @@ let jestConfig = {
|
|
|
28
30
|
'^.+\\.[tj]sx?$': [ 'babel-jest', babelConfig ],
|
|
29
31
|
},
|
|
30
32
|
setupFilesAfterEnv: [
|
|
31
|
-
// @todo Remove old "tests" directory
|
|
33
|
+
// @todo Remove old "tests" directory in version 11.
|
|
32
34
|
path.resolve( packageConfig.workingDirectory, 'tests/setup.js' ),
|
|
33
35
|
path.resolve( packageConfig.workingDirectory, 'tests/setup.ts' ),
|
|
34
36
|
|
|
@@ -41,6 +43,8 @@ let jestConfig = {
|
|
|
41
43
|
* Allows overriding configurations in the project `/config/jest.config.js` file.
|
|
42
44
|
* We don't actually need to do this because `jest.config.js` in the project root
|
|
43
45
|
* is already an override of this file, but we support it anyway to keep things consistent.
|
|
46
|
+
*
|
|
47
|
+
* @todo Remove in version 11.
|
|
44
48
|
*/
|
|
45
49
|
try {
|
|
46
50
|
const localConfig = require( path.resolve( packageConfig.workingDirectory + '/config', 'jest.config.js' ) );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lipemat/js-boilerplate",
|
|
3
|
-
"version": "10.4.0-beta.
|
|
3
|
+
"version": "10.4.0-beta.7",
|
|
4
4
|
"description": "Dependencies and scripts for a no config JavaScript app",
|
|
5
5
|
"author": "Mat Lipe",
|
|
6
6
|
"license": "MIT",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"react-dom": "^18.2.0",
|
|
79
79
|
"react-refresh": "^0.14.0",
|
|
80
80
|
"style-loader": "^3.3.1",
|
|
81
|
+
"ts-node": "^10.9.1",
|
|
81
82
|
"typescript": "^5.1.3",
|
|
82
83
|
"update-notifier": "^4.1.3",
|
|
83
84
|
"webpack": "^5.72.1",
|
package/tsconfig.json
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
"extends": "./config/tsconfig.json",
|
|
3
3
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
4
4
|
"display": "JS Boilerplate",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"module": "CommonJS"
|
|
7
|
-
},
|
|
8
5
|
"include": [
|
|
9
6
|
"bin/**/*",
|
|
10
7
|
"config/**/*",
|
|
@@ -12,5 +9,9 @@
|
|
|
12
9
|
"lib/**/*",
|
|
13
10
|
"jest/**/*",
|
|
14
11
|
"scripts/**/*"
|
|
15
|
-
]
|
|
12
|
+
],
|
|
13
|
+
"compilerOptions": {
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"module": "CommonJS"
|
|
16
|
+
}
|
|
16
17
|
}
|
|
File without changes
|