sku 11.2.0 → 11.2.4
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/.github/workflows/validate.yml +1 -1
- package/CHANGELOG.md +31 -0
- package/config/jest/jestConfig.js +3 -1
- package/config/typescript/tsconfig.js +1 -2
- package/config/webpack/resolveModules.js +17 -0
- package/config/webpack/webpack.config.js +6 -0
- package/config/webpack/webpack.config.ssr.js +5 -0
- package/context/index.js +6 -23
- package/docs/docs/configuration.md +1 -1
- package/package.json +3 -2
- package/sku-types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# sku
|
|
2
2
|
|
|
3
|
+
## 11.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Ensure compile packages within nested node_modules are transformed in jest ([#664](https://github.com/seek-oss/sku/pull/664))
|
|
8
|
+
|
|
9
|
+
- Include `@babel/runtime` in render builds to ensure it is importable ([#664](https://github.com/seek-oss/sku/pull/664))
|
|
10
|
+
|
|
11
|
+
## 11.2.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Prevents typescript from being upgraded to 4.5.x ([#662](https://github.com/seek-oss/sku/pull/662))
|
|
16
|
+
|
|
17
|
+
Typescript 4.5 has caused a lot of issues with packages included with sku (braid, vanilla-extract) that are caused by a regression that's been introduced in the type checker.
|
|
18
|
+
It seems to be fixed in 4.6.0-dev, but that won't be available until late February.
|
|
19
|
+
|
|
20
|
+
To prevent things blowing up in the meantime, the version of typescript has been update to keep it below 4.5, at least until a patch is released in 4.5
|
|
21
|
+
|
|
22
|
+
## 11.2.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- The autogenerated tsconfig.json no longer explicitly excludes `node_modules` ([#660](https://github.com/seek-oss/sku/pull/660))
|
|
27
|
+
|
|
28
|
+
## 11.2.1
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Fix loading of TS config files that use node builtins or external dependencies. ([#657](https://github.com/seek-oss/sku/pull/657))
|
|
33
|
+
|
|
3
34
|
## 11.2.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const escapeRegex = require('escape-string-regexp');
|
|
2
2
|
const { paths } = require('../../context');
|
|
3
3
|
const slash = '[/\\\\]'; // Cross-platform path delimiter regex
|
|
4
|
-
const compilePackagesRegex = paths.compilePackages
|
|
4
|
+
const compilePackagesRegex = paths.compilePackages
|
|
5
|
+
.map((pkg) => `.*${escapeRegex(pkg)}`)
|
|
6
|
+
.join('|');
|
|
5
7
|
|
|
6
8
|
module.exports = {
|
|
7
9
|
testEnvironment: 'jsdom',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { cwd
|
|
1
|
+
const { cwd } = require('../../lib/cwd');
|
|
2
2
|
const { paths, rootResolution } = require('../../context');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
|
|
@@ -34,7 +34,6 @@ module.exports = () => {
|
|
|
34
34
|
target: 'es5',
|
|
35
35
|
},
|
|
36
36
|
include: includePaths,
|
|
37
|
-
exclude: [getPathFromCwd('node_modules')],
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
if (rootResolution) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const modules = ['node_modules'];
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
const skuPath = require.resolve('sku/package.json');
|
|
5
|
+
|
|
6
|
+
// If the project is using pnpm then we add the sku node_modules directory
|
|
7
|
+
// to the modules array. This allows dependecies of sku to be importable
|
|
8
|
+
// as part of the build process. This is specifically useful for
|
|
9
|
+
// @babel/plugin-transform-runtime as it inject imports to @babel/runtime.
|
|
10
|
+
if (skuPath.includes('.pnpm')) {
|
|
11
|
+
modules.push(path.join(skuPath, '../..'));
|
|
12
|
+
}
|
|
13
|
+
} catch (e) {
|
|
14
|
+
// Ignore errors as if sku isn't resolvable then we don't need to apply the pnpm fix
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = modules;
|
|
@@ -24,6 +24,7 @@ const { getVocabConfig } = require('../vocab/vocab');
|
|
|
24
24
|
const statsConfig = require('./statsConfig');
|
|
25
25
|
const getSourceMapSetting = require('./sourceMaps');
|
|
26
26
|
const getCacheSettings = require('./cache');
|
|
27
|
+
const modules = require('./resolveModules');
|
|
27
28
|
|
|
28
29
|
const {
|
|
29
30
|
paths,
|
|
@@ -161,6 +162,7 @@ const makeWebpackConfig = ({
|
|
|
161
162
|
},
|
|
162
163
|
resolve: {
|
|
163
164
|
alias: { __sku_alias__clientEntry: paths.clientEntry },
|
|
165
|
+
modules,
|
|
164
166
|
},
|
|
165
167
|
module: {
|
|
166
168
|
rules: [
|
|
@@ -274,6 +276,9 @@ const makeWebpackConfig = ({
|
|
|
274
276
|
allowlist: [
|
|
275
277
|
'classnames', // Workaround for https://github.com/JedWatson/classnames/issues/240
|
|
276
278
|
|
|
279
|
+
// Include '@babel/runtime' in render builds to workaround ESM imports in html-render-webpack-plugin
|
|
280
|
+
/@babel\/runtime/,
|
|
281
|
+
|
|
277
282
|
// webpack-node-externals compares the `import` or `require` expression to this list,
|
|
278
283
|
// not the package name, so we map each packageName to a pattern. This ensures it
|
|
279
284
|
// matches when importing a file within a package e.g. import { Text } from 'seek-style-guide/react'.
|
|
@@ -298,6 +303,7 @@ const makeWebpackConfig = ({
|
|
|
298
303
|
},
|
|
299
304
|
resolve: {
|
|
300
305
|
alias: { __sku_alias__renderEntry: paths.renderEntry },
|
|
306
|
+
modules,
|
|
301
307
|
},
|
|
302
308
|
module: {
|
|
303
309
|
rules: [
|
|
@@ -35,6 +35,7 @@ const { getVocabConfig } = require('../vocab/vocab');
|
|
|
35
35
|
const statsConfig = require('./statsConfig');
|
|
36
36
|
const getSourceMapSetting = require('./sourceMaps');
|
|
37
37
|
const getCacheSettings = require('./cache');
|
|
38
|
+
const modules = require('./resolveModules');
|
|
38
39
|
|
|
39
40
|
const makeWebpackConfig = ({
|
|
40
41
|
clientPort,
|
|
@@ -123,6 +124,9 @@ const makeWebpackConfig = ({
|
|
|
123
124
|
},
|
|
124
125
|
emitOnErrors: isProductionBuild,
|
|
125
126
|
},
|
|
127
|
+
resolve: {
|
|
128
|
+
modules,
|
|
129
|
+
},
|
|
126
130
|
module: {
|
|
127
131
|
rules: [
|
|
128
132
|
...(isDevServer
|
|
@@ -244,6 +248,7 @@ const makeWebpackConfig = ({
|
|
|
244
248
|
alias: {
|
|
245
249
|
__sku_alias__serverEntry: paths.serverEntry,
|
|
246
250
|
},
|
|
251
|
+
modules,
|
|
247
252
|
},
|
|
248
253
|
target: 'node',
|
|
249
254
|
node: {
|
package/context/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const chalk = require('chalk');
|
|
4
|
-
const
|
|
4
|
+
const { register } = require('esbuild-register/dist/node');
|
|
5
5
|
const { getPathFromCwd } = require('../lib/cwd');
|
|
6
6
|
const args = require('../config/args');
|
|
7
7
|
const defaultSkuConfig = require('./defaultSkuConfig');
|
|
@@ -10,17 +10,6 @@ const validateConfig = require('./validateConfig');
|
|
|
10
10
|
const defaultCompilePackages = require('./defaultCompilePackages');
|
|
11
11
|
const isCompilePackage = require('../lib/isCompilePackage');
|
|
12
12
|
|
|
13
|
-
const evaluateConfig = (configSource) => {
|
|
14
|
-
const exports = {
|
|
15
|
-
default: {},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line no-eval
|
|
19
|
-
const moduleExports = eval(configSource);
|
|
20
|
-
|
|
21
|
-
return moduleExports || exports.default;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
13
|
const getSkuConfig = () => {
|
|
25
14
|
let appSkuConfigPath;
|
|
26
15
|
const tsPath = getPathFromCwd('sku.config.ts');
|
|
@@ -39,20 +28,14 @@ const getSkuConfig = () => {
|
|
|
39
28
|
};
|
|
40
29
|
}
|
|
41
30
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
write: false,
|
|
46
|
-
outdir: 'out',
|
|
47
|
-
target: ['node14'],
|
|
48
|
-
format: 'cjs',
|
|
49
|
-
});
|
|
31
|
+
const { unregister } = register({ target: 'node14' });
|
|
32
|
+
|
|
33
|
+
const newConfig = require(appSkuConfigPath);
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
const newConfig = evaluateConfig(configSource);
|
|
35
|
+
unregister();
|
|
53
36
|
|
|
54
37
|
return {
|
|
55
|
-
appSkuConfig: newConfig,
|
|
38
|
+
appSkuConfig: newConfig.default || newConfig,
|
|
56
39
|
appSkuConfigPath,
|
|
57
40
|
};
|
|
58
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sku",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.4",
|
|
4
4
|
"description": "Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"ensure-gitignore": "^1.1.2",
|
|
107
107
|
"env-ci": "^5.0.0",
|
|
108
108
|
"esbuild": "^0.13.13",
|
|
109
|
+
"esbuild-register": "^3.2.0",
|
|
109
110
|
"escape-string-regexp": "^4.0.0",
|
|
110
111
|
"eslint": "^7.18.0",
|
|
111
112
|
"eslint-config-seek": "^7.0.8",
|
|
@@ -150,7 +151,7 @@
|
|
|
150
151
|
"traverse": "^0.6.6",
|
|
151
152
|
"treat": "^2.0.4",
|
|
152
153
|
"tree-kill": "^1.2.1",
|
|
153
|
-
"typescript": "
|
|
154
|
+
"typescript": ">=4.1.3 <4.5.0",
|
|
154
155
|
"validate-npm-package-name": "^3.0.0",
|
|
155
156
|
"webpack": "^5.47.1",
|
|
156
157
|
"webpack-bundle-analyzer": "^4.4.2",
|
package/sku-types.d.ts
CHANGED