sku 11.2.0 → 11.2.1

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,11 @@
1
1
  # sku
2
2
 
3
+ ## 11.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix loading of TS config files that use node builtins or external dependencies. ([#657](https://github.com/seek-oss/sku/pull/657))
8
+
3
9
  ## 11.2.0
4
10
 
5
11
  ### Minor Changes
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 esbuild = require('esbuild');
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 compiledConfig = esbuild.buildSync({
43
- entryPoints: [appSkuConfigPath],
44
- bundle: true,
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
- const [{ text: configSource }] = compiledConfig.outputFiles;
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
  };
@@ -201,7 +201,7 @@ The browser URL to open when running `sku start` or `sku start-ssr`. It will def
201
201
 
202
202
  ## languages
203
203
 
204
- type `Array<string>`
204
+ type `Array<string | { name: string }>`
205
205
 
206
206
  The languages your application supports.
207
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "11.2.0",
3
+ "version": "11.2.1",
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",
package/sku-types.d.ts CHANGED
@@ -192,7 +192,7 @@ export interface SkuConfig {
192
192
  *
193
193
  * @link https://seek-oss.github.io/sku/#/./docs/configuration?id=languages
194
194
  */
195
- languages?: string[];
195
+ languages?: Array<string | { name: string }>;
196
196
 
197
197
  /**
198
198
  * **Only for libraries**