sku 11.2.3 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 11.2.3
4
12
 
5
13
  ### Patch 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.map(escapeRegex).join('|');
4
+ const compilePackagesRegex = paths.compilePackages
5
+ .map((pkg) => `.*${escapeRegex(pkg)}`)
6
+ .join('|');
5
7
 
6
8
  module.exports = {
7
9
  testEnvironment: 'jsdom',
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "11.2.3",
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": {