sku 14.0.0 → 14.0.2

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.
Files changed (276) hide show
  1. package/CHANGELOG.md +173 -3
  2. package/dist/bin/sku.d.ts +1 -0
  3. package/dist/bin/sku.js +2 -0
  4. package/dist/config/babel/babelConfig.d.ts +29 -0
  5. package/dist/config/babel/babelConfig.js +91 -0
  6. package/dist/config/eslint/ignores.d.ts +9 -0
  7. package/dist/config/eslint/ignores.js +23 -0
  8. package/dist/config/eslint/importOrder.d.ts +22 -0
  9. package/dist/config/eslint/importOrder.js +38 -0
  10. package/dist/config/eslint/index.d.ts +2 -0
  11. package/dist/config/eslint/index.js +18 -0
  12. package/dist/config/jest/fileMock.cjs +2 -0
  13. package/dist/config/jest/fileMock.d.cts +2 -0
  14. package/dist/config/jest/getClassNames.d.ts +2 -0
  15. package/dist/config/jest/getClassNames.js +10 -0
  16. package/dist/config/jest/jest-preset.d.ts +2 -0
  17. package/dist/config/jest/jest-preset.js +42 -0
  18. package/dist/config/jest/jsBabelTransform.d.ts +2 -0
  19. package/dist/config/jest/jsBabelTransform.js +9 -0
  20. package/dist/config/jest/tsBabelTransform.d.ts +2 -0
  21. package/dist/config/jest/tsBabelTransform.js +10 -0
  22. package/dist/config/lintStaged/lintStagedConfig.d.ts +3 -0
  23. package/dist/config/lintStaged/lintStagedConfig.js +15 -0
  24. package/dist/config/prettier/prettierConfig.d.ts +3 -0
  25. package/dist/config/prettier/prettierConfig.js +6 -0
  26. package/dist/config/storybook/index.cjs +38 -0
  27. package/dist/config/storybook/index.d.cts +23 -0
  28. package/dist/config/storybook/storybookWebpackConfig.d.ts +4 -0
  29. package/dist/config/storybook/storybookWebpackConfig.js +54 -0
  30. package/dist/config/targets.json +3 -0
  31. package/dist/config/typescript/tsconfig.d.ts +2 -0
  32. package/dist/config/typescript/tsconfig.js +46 -0
  33. package/dist/config/vocab/vocab.d.ts +15 -0
  34. package/dist/config/vocab/vocab.js +23 -0
  35. package/dist/config/webpack/cache.d.ts +9 -0
  36. package/dist/config/webpack/cache.js +15 -0
  37. package/dist/config/webpack/plugins/bundleAnalyzer.d.ts +5 -0
  38. package/dist/config/webpack/plugins/bundleAnalyzer.js +8 -0
  39. package/dist/config/webpack/plugins/createHtmlRenderPlugin.d.ts +9 -0
  40. package/dist/config/webpack/plugins/createHtmlRenderPlugin.js +100 -0
  41. package/dist/config/webpack/plugins/metrics-plugin/index.d.ts +13 -0
  42. package/dist/config/webpack/plugins/metrics-plugin/index.js +46 -0
  43. package/dist/config/webpack/plugins/sku-webpack-plugin/index.d.ts +10 -0
  44. package/dist/config/webpack/plugins/sku-webpack-plugin/index.js +179 -0
  45. package/dist/config/webpack/plugins/sku-webpack-plugin/validateOptions.d.ts +16 -0
  46. package/dist/config/webpack/plugins/sku-webpack-plugin/validateOptions.js +108 -0
  47. package/dist/config/webpack/resolveModules.d.ts +2 -0
  48. package/dist/config/webpack/resolveModules.js +18 -0
  49. package/dist/config/webpack/sourceMaps.d.ts +4 -0
  50. package/dist/config/webpack/sourceMaps.js +8 -0
  51. package/dist/config/webpack/statsConfig.d.ts +10 -0
  52. package/dist/config/webpack/statsConfig.js +11 -0
  53. package/dist/config/webpack/types.d.ts +11 -0
  54. package/dist/config/webpack/types.js +1 -0
  55. package/dist/config/webpack/utils/index.d.ts +6 -0
  56. package/dist/config/webpack/utils/index.js +12 -0
  57. package/dist/config/webpack/utils/loaders.d.ts +61 -0
  58. package/dist/config/webpack/utils/loaders.js +69 -0
  59. package/dist/config/webpack/utils/resolvePackage.d.ts +8 -0
  60. package/dist/config/webpack/utils/resolvePackage.js +74 -0
  61. package/dist/config/webpack/webpack.config.d.ts +3 -0
  62. package/dist/config/webpack/webpack.config.js +293 -0
  63. package/dist/config/webpack/webpack.config.ssr.d.ts +3 -0
  64. package/dist/config/webpack/webpack.config.ssr.js +258 -0
  65. package/dist/context/configPath.d.ts +2 -0
  66. package/dist/context/configPath.js +38 -0
  67. package/dist/context/configSchema.d.ts +3 -0
  68. package/dist/context/configSchema.js +192 -0
  69. package/dist/context/defaultClientEntry.d.ts +2 -0
  70. package/dist/context/defaultClientEntry.js +1 -0
  71. package/dist/context/defaultCompilePackages.d.ts +2 -0
  72. package/dist/context/defaultCompilePackages.js +57 -0
  73. package/dist/context/defaultSkuConfig.d.ts +40 -0
  74. package/dist/context/defaultSkuConfig.js +43 -0
  75. package/dist/context/index.d.ts +59 -0
  76. package/dist/context/index.js +126 -0
  77. package/dist/context/packageManager.d.ts +2 -0
  78. package/dist/context/packageManager.js +5 -0
  79. package/dist/context/validateConfig.d.ts +3 -0
  80. package/dist/context/validateConfig.js +65 -0
  81. package/dist/entry/client/index.d.ts +1 -0
  82. package/dist/entry/client/index.js +33 -0
  83. package/dist/entry/clientContextKey.d.ts +2 -0
  84. package/dist/entry/clientContextKey.js +1 -0
  85. package/dist/entry/csp.d.ts +11 -0
  86. package/dist/entry/csp.js +80 -0
  87. package/dist/entry/libraryRender/index.d.ts +3 -0
  88. package/dist/entry/libraryRender/index.js +13 -0
  89. package/dist/entry/makeExtractor.d.ts +5 -0
  90. package/dist/entry/makeExtractor.jsx +74 -0
  91. package/dist/entry/render/index.d.ts +4 -0
  92. package/dist/entry/render/index.js +61 -0
  93. package/dist/entry/render/render-to-string.d.ts +7 -0
  94. package/dist/entry/render/render-to-string.js +68 -0
  95. package/dist/entry/server/index.d.ts +1 -0
  96. package/dist/entry/server/index.js +50 -0
  97. package/dist/entry/server/server.d.ts +4 -0
  98. package/dist/entry/server/server.js +60 -0
  99. package/dist/index.d.cts +1 -0
  100. package/dist/index.d.ts +1 -0
  101. package/dist/index.js +1 -0
  102. package/dist/lib/SkuConfigUpdater.d.ts +27 -0
  103. package/dist/lib/SkuConfigUpdater.js +128 -0
  104. package/dist/lib/allocatePort.d.ts +5 -0
  105. package/dist/lib/allocatePort.js +13 -0
  106. package/dist/lib/banner.d.ts +2 -0
  107. package/dist/lib/banner.js +39 -0
  108. package/dist/lib/buildFileUtils.d.ts +4 -0
  109. package/dist/lib/buildFileUtils.js +37 -0
  110. package/dist/lib/certificate.d.ts +2 -0
  111. package/dist/lib/certificate.js +83 -0
  112. package/dist/lib/configure.d.ts +2 -0
  113. package/dist/lib/configure.js +113 -0
  114. package/dist/lib/copyDirContents.d.ts +2 -0
  115. package/dist/lib/copyDirContents.js +33 -0
  116. package/dist/lib/createServer.d.ts +3 -0
  117. package/dist/lib/createServer.js +12 -0
  118. package/dist/lib/cwd.d.ts +13 -0
  119. package/dist/lib/cwd.js +26 -0
  120. package/dist/lib/eslintMigration.d.ts +29 -0
  121. package/dist/lib/eslintMigration.js +51 -0
  122. package/dist/lib/exists.d.ts +6 -0
  123. package/dist/lib/exists.js +14 -0
  124. package/dist/lib/getSiteForHost.d.ts +2 -0
  125. package/dist/lib/getSiteForHost.js +12 -0
  126. package/dist/lib/hosts.d.ts +3 -0
  127. package/dist/lib/hosts.js +51 -0
  128. package/dist/lib/install.d.ts +3 -0
  129. package/dist/lib/install.js +8 -0
  130. package/dist/lib/isCI.d.ts +2 -0
  131. package/dist/lib/isCI.js +1 -0
  132. package/dist/lib/isCompilePackage.d.ts +2 -0
  133. package/dist/lib/isCompilePackage.js +13 -0
  134. package/dist/lib/isEmptyDir.d.ts +5 -0
  135. package/dist/lib/isEmptyDir.js +12 -0
  136. package/dist/lib/language-utils.d.ts +5 -0
  137. package/dist/lib/language-utils.js +65 -0
  138. package/dist/lib/lint.d.ts +1 -0
  139. package/dist/lib/lint.js +2 -0
  140. package/dist/lib/managedConfigBanner.d.ts +5 -0
  141. package/dist/lib/managedConfigBanner.js +6 -0
  142. package/dist/lib/openBrowser/index.d.ts +2 -0
  143. package/dist/lib/openBrowser/index.js +60 -0
  144. package/dist/lib/packageManager.d.ts +20 -0
  145. package/dist/lib/packageManager.js +106 -0
  146. package/dist/lib/preCommit.d.ts +2 -0
  147. package/dist/lib/preCommit.js +19 -0
  148. package/dist/lib/program/commands/build/build.action.d.ts +5 -0
  149. package/dist/lib/program/commands/build/build.action.js +53 -0
  150. package/dist/lib/program/commands/build/build.command.d.ts +3 -0
  151. package/dist/lib/program/commands/build/build.command.js +11 -0
  152. package/dist/lib/program/commands/build-ssr/build-ssr.action.d.ts +4 -0
  153. package/dist/lib/program/commands/build-ssr/build-ssr.action.js +53 -0
  154. package/dist/lib/program/commands/build-ssr/build-ssr.command.d.ts +2 -0
  155. package/dist/lib/program/commands/build-ssr/build-ssr.command.js +10 -0
  156. package/dist/lib/program/commands/configure/configure.action.d.ts +1 -0
  157. package/dist/lib/program/commands/configure/configure.action.js +4 -0
  158. package/dist/lib/program/commands/configure/configure.command.d.ts +2 -0
  159. package/dist/lib/program/commands/configure/configure.command.js +8 -0
  160. package/dist/lib/program/commands/format/format.action.d.ts +1 -0
  161. package/dist/lib/program/commands/format/format.action.js +20 -0
  162. package/dist/lib/program/commands/format/format.command.d.ts +2 -0
  163. package/dist/lib/program/commands/format/format.command.js +9 -0
  164. package/dist/lib/program/commands/index.d.ts +1 -0
  165. package/dist/lib/program/commands/index.js +30 -0
  166. package/dist/lib/program/commands/init/init.action.d.ts +3 -0
  167. package/dist/lib/program/commands/init/init.action.js +179 -0
  168. package/dist/lib/program/commands/init/init.command.d.ts +2 -0
  169. package/dist/lib/program/commands/init/init.command.js +16 -0
  170. package/dist/lib/program/commands/lint/lint.action.d.ts +1 -0
  171. package/dist/lib/program/commands/lint/lint.action.js +29 -0
  172. package/dist/lib/program/commands/lint/lint.command.d.ts +2 -0
  173. package/dist/lib/program/commands/lint/lint.command.js +9 -0
  174. package/dist/lib/program/commands/pre-commit/pre-commit.action.d.ts +1 -0
  175. package/dist/lib/program/commands/pre-commit/pre-commit.action.js +11 -0
  176. package/dist/lib/program/commands/pre-commit/pre-commit.command.d.ts +2 -0
  177. package/dist/lib/program/commands/pre-commit/pre-commit.command.js +8 -0
  178. package/dist/lib/program/commands/serve/serve.action.d.ts +5 -0
  179. package/dist/lib/program/commands/serve/serve.action.js +124 -0
  180. package/dist/lib/program/commands/serve/serve.command.d.ts +2 -0
  181. package/dist/lib/program/commands/serve/serve.command.js +13 -0
  182. package/dist/lib/program/commands/setup-hosts/setup-hosts.action.d.ts +1 -0
  183. package/dist/lib/program/commands/setup-hosts/setup-hosts.action.js +15 -0
  184. package/dist/lib/program/commands/setup-hosts/setup-hosts.command.d.ts +3 -0
  185. package/dist/lib/program/commands/setup-hosts/setup-hosts.command.js +9 -0
  186. package/dist/lib/program/commands/start/start.action.d.ts +5 -0
  187. package/dist/lib/program/commands/start/start.action.js +146 -0
  188. package/dist/lib/program/commands/start/start.command.d.ts +3 -0
  189. package/dist/lib/program/commands/start/start.command.js +12 -0
  190. package/dist/lib/program/commands/start-ssr/start-ssr.action.d.ts +4 -0
  191. package/dist/lib/program/commands/start-ssr/start-ssr.action.js +137 -0
  192. package/dist/lib/program/commands/start-ssr/start-ssr.command.d.ts +3 -0
  193. package/dist/lib/program/commands/start-ssr/start-ssr.command.js +11 -0
  194. package/dist/lib/program/commands/test/test.action.d.ts +4 -0
  195. package/dist/lib/program/commands/test/test.action.js +21 -0
  196. package/dist/lib/program/commands/test/test.command.d.ts +3 -0
  197. package/dist/lib/program/commands/test/test.command.js +11 -0
  198. package/dist/lib/program/commands/translations/commands/compile/compile.action.d.ts +3 -0
  199. package/dist/lib/program/commands/translations/commands/compile/compile.action.js +27 -0
  200. package/dist/lib/program/commands/translations/commands/compile/compile.command.d.ts +3 -0
  201. package/dist/lib/program/commands/translations/commands/compile/compile.command.js +11 -0
  202. package/dist/lib/program/commands/translations/commands/index.d.ts +1 -0
  203. package/dist/lib/program/commands/translations/commands/index.js +12 -0
  204. package/dist/lib/program/commands/translations/commands/pull/pull.action.d.ts +1 -0
  205. package/dist/lib/program/commands/translations/commands/pull/pull.action.js +23 -0
  206. package/dist/lib/program/commands/translations/commands/pull/pull.command.d.ts +3 -0
  207. package/dist/lib/program/commands/translations/commands/pull/pull.command.js +7 -0
  208. package/dist/lib/program/commands/translations/commands/push/delete-unused-keys.option.d.ts +2 -0
  209. package/dist/lib/program/commands/translations/commands/push/delete-unused-keys.option.js +2 -0
  210. package/dist/lib/program/commands/translations/commands/push/push.action.d.ts +3 -0
  211. package/dist/lib/program/commands/translations/commands/push/push.action.js +23 -0
  212. package/dist/lib/program/commands/translations/commands/push/push.command.d.ts +3 -0
  213. package/dist/lib/program/commands/translations/commands/push/push.command.js +11 -0
  214. package/dist/lib/program/commands/translations/commands/validate/validate.action.d.ts +1 -0
  215. package/dist/lib/program/commands/translations/commands/validate/validate.action.js +22 -0
  216. package/dist/lib/program/commands/translations/commands/validate/validate.command.d.ts +3 -0
  217. package/dist/lib/program/commands/translations/commands/validate/validate.command.js +7 -0
  218. package/dist/lib/program/commands/translations/helpers/translation-helpers.d.ts +18 -0
  219. package/dist/lib/program/commands/translations/helpers/translation-helpers.js +26 -0
  220. package/dist/lib/program/commands/translations/translations.command.d.ts +3 -0
  221. package/dist/lib/program/commands/translations/translations.command.js +8 -0
  222. package/dist/lib/program/index.d.ts +2 -0
  223. package/dist/lib/program/index.js +32 -0
  224. package/dist/lib/program/options/config/config.option.d.ts +2 -0
  225. package/dist/lib/program/options/config/config.option.js +2 -0
  226. package/dist/lib/program/options/debug/debug.option.d.ts +2 -0
  227. package/dist/lib/program/options/debug/debug.option.js +2 -0
  228. package/dist/lib/program/options/environment/environment.option.d.ts +2 -0
  229. package/dist/lib/program/options/environment/environment.option.js +2 -0
  230. package/dist/lib/program/options/packageManager/packageManager.option.d.ts +2 -0
  231. package/dist/lib/program/options/packageManager/packageManager.option.js +2 -0
  232. package/dist/lib/program/options/port/port.option.d.ts +2 -0
  233. package/dist/lib/program/options/port/port.option.js +2 -0
  234. package/dist/lib/program/options/site/site.option.d.ts +2 -0
  235. package/dist/lib/program/options/site/site.option.js +2 -0
  236. package/dist/lib/program/options/stats/stats.option.d.ts +5 -0
  237. package/dist/lib/program/options/stats/stats.option.js +12 -0
  238. package/dist/lib/program/options/watch/watch.option.d.ts +2 -0
  239. package/dist/lib/program/options/watch/watch.option.js +2 -0
  240. package/dist/lib/resolveEnvironment.d.ts +3 -0
  241. package/dist/lib/resolveEnvironment.js +13 -0
  242. package/dist/lib/routeMatcher.d.ts +2 -0
  243. package/dist/lib/routeMatcher.js +15 -0
  244. package/dist/lib/runBin.d.ts +10 -0
  245. package/dist/lib/runBin.js +28 -0
  246. package/dist/lib/runESLint.d.ts +2 -0
  247. package/dist/lib/runESLint.js +62 -0
  248. package/dist/lib/runPrettier.d.ts +2 -0
  249. package/dist/lib/runPrettier.js +56 -0
  250. package/dist/lib/runTsc.d.ts +2 -0
  251. package/dist/lib/runTsc.js +14 -0
  252. package/dist/lib/runVocab.d.ts +2 -0
  253. package/dist/lib/runVocab.js +16 -0
  254. package/dist/lib/runWebpack.d.ts +4 -0
  255. package/dist/lib/runWebpack.js +15 -0
  256. package/dist/lib/serverManager.d.ts +6 -0
  257. package/dist/lib/serverManager.js +50 -0
  258. package/dist/lib/suggestScript.d.ts +5 -0
  259. package/dist/lib/suggestScript.js +26 -0
  260. package/dist/lib/toPosixPath.d.ts +5 -0
  261. package/dist/lib/toPosixPath.js +6 -0
  262. package/dist/lib/utils/configure.d.ts +2 -0
  263. package/dist/lib/utils/configure.js +29 -0
  264. package/dist/lib/utils/debug.d.ts +3 -0
  265. package/dist/lib/utils/debug.js +8 -0
  266. package/dist/lib/utils/error-guards.d.ts +6 -0
  267. package/dist/lib/utils/error-guards.js +8 -0
  268. package/dist/lib/validatePeerDeps.d.ts +2 -0
  269. package/dist/lib/validatePeerDeps.js +90 -0
  270. package/dist/telemetry/index.d.ts +2 -0
  271. package/dist/telemetry/index.js +31 -0
  272. package/dist/telemetry/provider.d.ts +10 -0
  273. package/dist/telemetry/provider.js +36 -0
  274. package/dist/types/types.d.ts +418 -0
  275. package/dist/types/types.js +1 -0
  276. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,175 @@
1
1
  # sku
2
2
 
3
+ ## 14.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Reduce config loading log noise ([#1169](https://github.com/seek-oss/sku/pull/1169))
8
+
9
+ ## 14.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Fix release ([#1165](https://github.com/seek-oss/sku/pull/1165))
14
+
15
+ ## 14.0.0
16
+
17
+ - Migrating `sku` to ESM from commonjs ([#1156](https://github.com/seek-oss/sku/pull/1156))
18
+
19
+ **BREAKING CHANGE**:
20
+
21
+ Most of [`sku`s API entrypoints](https://seek-oss.github.io/sku/#/./docs/api) are now ESM. Consumers that use the following API entrypoints may need to convert some of their configuration files to ESM:
22
+
23
+ ***
24
+
25
+ `sku/webpack-plugin` is now an ES module and has to be imported as such.
26
+
27
+ If you are using `require()` to import `sku/webpack-plugin` you will have to change it to `import`.
28
+
29
+ ```diff
30
+ - const SkuWebpackPlugin = require('sku/webpack-plugin');
31
+ + import SkuWebpackPlugin from 'sku/webpack-plugin';
32
+ ```
33
+
34
+ > [!NOTE]
35
+ > The file that is importing `sku/webpack-plugin` must also be an ES module so further changes may be required.
36
+
37
+ ***
38
+
39
+ `sku/config/eslint` is a new entrypoint that exposes `sku`'s flat ESLint configuration. It now only supports ESM.
40
+
41
+ - Update `eslint-config-seek` to v14 ([#1156](https://github.com/seek-oss/sku/pull/1156))
42
+
43
+ Alongside the migration to ESLint v9, `eslint-config-seek` has been updated to v14 which supports the new flat config format.
44
+
45
+ Some lint rules have been changed or renamed, so consumers should run `sku format` to automatically update their code to conform to the new rules. You may still need to manually review and adjust your code after running `sku format` as not all issues are auto-fixable.
46
+
47
+ > [!NOTE]
48
+ > You may need to migrate your ESLint configuration before running `sku format`.
49
+ > Please read the release notes for more information on how to migrate your ESLint configuration.
50
+
51
+ Additionally, `eslint-plugin-import` has been replaced with `eslint-plugin-import-x`. You should replace any references to `eslint-plugin-import` with `eslint-plugin-import-x` and any `import/` rules with `import-x/`.
52
+
53
+ See the [`eslint-config-seek` release notes] for more information.
54
+
55
+ [`eslint-config-seek` release notes]: https://github.com/seek-oss/eslint-config-seek/blob/master/CHANGELOG.md#eslint-config-seek
56
+
57
+ - Change the CLI to commander.js. ([#1156](https://github.com/seek-oss/sku/pull/1156))
58
+
59
+ **BREAKING CHANGE**
60
+
61
+ `sku` now uses [commander.js](https://github.com/tj/commander.js) for its CLI. The CLI options and commands are now more narrowly defined and scoped. Some combinations of options that were previously possible may no longer work.
62
+
63
+ The new `-h, --help` flag now shows the help output generated by commander.js and shows the available commands and options.
64
+
65
+ The following option flags are now available in their respective scope
66
+
67
+ #### Global options
68
+
69
+ - the `-e, --environment` option
70
+ - the `-c, --config` option
71
+ - the `-d, --debug` option
72
+ - **new:** the `-h, --help` option
73
+ - **new:** the `-v, --version` option
74
+
75
+ #### Scoped options
76
+
77
+ - the `build`, `build-ssr`, `start`, and `start-ssr` commands have the following options
78
+ - `-s, --stats` option
79
+ - the `serve` command now has the following options
80
+ - `--port` option
81
+ - `--site` option
82
+ - the `translation compile` command now has the following options
83
+ - `-w, --watch` option
84
+ - the `translation push` command now has the following option
85
+ - `--delete-unused-keys` option
86
+ - the `init` command now has the following options
87
+ - `-p, --package-manager` option. This has changed from `--packageManager` preferring `kebab-case` over `camelCase` for option flags.
88
+ - `--verbose` option
89
+
90
+ - Update to ESLint v9 ([#1156](https://github.com/seek-oss/sku/pull/1156))
91
+
92
+ ESLint v9 defaults to the new [flat config format]. As such, `sku`'s ESLint config has been migrated to this new format, and consumers will need to migrate any custom overrides set via `dangerouslySetESLintConfig` to the new format as well.
93
+
94
+ For example, if you are overriding an ESLint rule, you can migrate to the new config format like so:
95
+
96
+ ```diff
97
+ dangerouslySetESLintConfig: (config) => {
98
+ - return {
99
+ - ...config,
100
+ - rules: {
101
+ - ...config.rules,
102
+ - 'no-console': 'off'
103
+ - }
104
+ - };
105
+ + return [
106
+ + ...config,
107
+ + {
108
+ + rules: {
109
+ + 'no-console': 'off'
110
+ + }
111
+ + }
112
+ + ];
113
+ }
114
+ ```
115
+
116
+ More complicated overrides such as the use of plugins or modification of parser options may require a more involved migration. Please refer to the [migration guide] for more information.
117
+
118
+ Additionally, the `.eslintignore` file is no longer used by ESLint. Instead, [ignore patterns] are now configured directly in your ESLint config file. Since `sku` controls your ESLint config, you can configure any custom ignore patterns in your sku config via the new `eslintIgnore` option.
119
+
120
+ For example:
121
+
122
+ ```ts
123
+ import type { SkuConfig } from 'sku';
124
+
125
+ export default {
126
+ eslintIgnore: ['a-large-file.js', '**/generated/'],
127
+ } satisfies SkuConfig;
128
+ ```
129
+
130
+ > [!TIP]
131
+ > Upon installation, `sku` will automatically try to migrate any custom entries in your `.eslintignore` to the new `eslintIgnore` configuration.
132
+ > **This migration must be done locally, it will not be committed to your repository from CI.**
133
+ > If this migration fails, you will need to manually migrate any custom ignore entries.
134
+
135
+ > [!IMPORTANT]
136
+ > Changes to ignore patterns or other ESLint configuration via `eslintIgnore` and `dangerouslySetESLintConfig` respectively will no longer be reflected directly in your `eslint.config.js` file.
137
+ > The `sku/config/eslint` entrypoint handles the composition of these configurations.
138
+ > The best way to visualize your final ESLint configuration is use the official [ESLint config inspector].
139
+
140
+ [flat config format]: https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
141
+ [migration guide]: https://eslint.org/docs/latest/use/configure/migration-guide
142
+ [ignore patterns]: https://eslint.org/docs/latest/use/configure/ignore
143
+ [ESLint config inspector]: https://github.com/eslint/config-inspector
144
+
145
+ - Drop support for Node.js versions below 20.18.2 ([#1156](https://github.com/seek-oss/sku/pull/1156))
146
+
147
+ **BREAKING CHANGE**:
148
+
149
+ The minimum supported Node.js version is now 20.18.2. Consumers must upgrade to Node.js v20.18.2 or later.
150
+
151
+ - Drop support for React 17.x ([#1156](https://github.com/seek-oss/sku/pull/1156))
152
+
153
+ **BREAKING CHANGE**
154
+
155
+ React 17 is no longer supported. Consumers will need to upgrade to React 18. Consumers still on v17 should follow the [How to Upgrade to React 18 guide]. Additionally, ensure any dependencies that rely on React are compatible with React 18.
156
+
157
+ [How to Upgrade to React 18 guide]: https://react.dev/blog/2022/03/08/react-18-upgrade-guide
158
+
159
+ ### Minor Changes
160
+
161
+ - Expose `sku`'s ESLint config under `sku/config/eslint` entrypoint ([#1156](https://github.com/seek-oss/sku/pull/1156))
162
+
163
+ This entrypoint is used by sku to configure ESLint. Most consumers will not need to use this entrypoint directly.
164
+
165
+ - Add support for `.mjs` sku configuration files ([#1156](https://github.com/seek-oss/sku/pull/1156))
166
+
167
+ In addition to `sku.config.ts` and `sku.config.js`, sku will now also look for a `sku.config.mjs` file when attempting to resolve your application's configuration file.
168
+
169
+ ### Patch Changes
170
+
171
+ - `sku init`: Ensure latest React 18 version is installed in new projects as React 19 is not yet supported ([#1156](https://github.com/seek-oss/sku/pull/1156))
172
+
3
173
  ## 13.4.1
4
174
 
5
175
  ### Patch Changes
@@ -394,8 +564,8 @@
394
564
  // package.json
395
565
  {
396
566
  "scripts": {
397
- "storybook": "sku translations compile && storybook dev" // or storybook build
398
- }
567
+ "storybook": "sku translations compile && storybook dev", // or storybook build
568
+ },
399
569
  }
400
570
  ```
401
571
 
@@ -1435,7 +1605,7 @@
1435
1605
  // package.json
1436
1606
  {
1437
1607
  "skuSkipConfigure": true,
1438
- "skuSkipValidatePeerDeps": true
1608
+ "skuSkipValidatePeerDeps": true,
1439
1609
  }
1440
1610
  ```
1441
1611
 
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { program } from '../lib/program/index.js';
2
+ program.parse();
@@ -0,0 +1,29 @@
1
+ import type { PluginItem } from '@babel/core';
2
+ type BabelConfigOptions = {
3
+ target: 'node' | 'browser' | 'jest';
4
+ lang: 'js' | 'ts';
5
+ browserslist?: string[];
6
+ displayNamesProd?: boolean;
7
+ removeAssertionsInProduction?: boolean;
8
+ hot?: boolean;
9
+ rootResolution?: boolean;
10
+ };
11
+ declare const _default: ({ target, lang, browserslist, displayNamesProd, removeAssertionsInProduction, hot, rootResolution, }: BabelConfigOptions) => {
12
+ presets: ((string | {
13
+ targets: string[] | undefined;
14
+ shippedProposals: boolean;
15
+ })[] | (string | {
16
+ isTSX: boolean;
17
+ allExtensions: boolean;
18
+ onlyRemoveTypeImports: boolean;
19
+ })[] | (string | {
20
+ runtime: string;
21
+ development: boolean;
22
+ })[] | null)[];
23
+ plugins: PluginItem[];
24
+ cacheDirectory?: boolean | undefined;
25
+ cacheCompression?: boolean | undefined;
26
+ babelrc: boolean;
27
+ sourceType: string;
28
+ };
29
+ export default _default;
@@ -0,0 +1,91 @@
1
+ import { cwd } from '../../lib/cwd.js';
2
+ import { createRequire } from 'node:module';
3
+ const require = createRequire(import.meta.url);
4
+ export default ({ target, lang = 'js', browserslist, displayNamesProd = false, removeAssertionsInProduction = true, hot = false, rootResolution = false, }) => {
5
+ const isBrowser = target === 'browser';
6
+ const isJest = target === 'jest';
7
+ const isProductionBuild = process.env.NODE_ENV === 'production';
8
+ const plugins = [
9
+ [
10
+ require.resolve('babel-plugin-module-resolver'),
11
+ {
12
+ root: rootResolution ? [cwd()] : undefined,
13
+ extensions: ['.mjs', '.js', '.json', '.ts', '.tsx'],
14
+ },
15
+ ],
16
+ require.resolve('babel-plugin-macros'),
17
+ require.resolve('@loadable/babel-plugin'),
18
+ require.resolve('@babel/plugin-transform-runtime'),
19
+ ];
20
+ if (hot && isBrowser) {
21
+ plugins.push([
22
+ require.resolve('react-refresh/babel'),
23
+ { skipEnvCheck: true },
24
+ ]);
25
+ }
26
+ if (isJest) {
27
+ plugins.push([
28
+ require.resolve('babel-plugin-transform-remove-imports'),
29
+ {
30
+ test: /\.css$/,
31
+ remove: 'effects',
32
+ },
33
+ ]);
34
+ }
35
+ if (isProductionBuild) {
36
+ plugins.push(require.resolve('babel-plugin-transform-react-remove-prop-types'), require.resolve('@babel/plugin-transform-react-constant-elements'));
37
+ if (displayNamesProd) {
38
+ plugins.push(require.resolve('@zendesk/babel-plugin-react-displayname'));
39
+ }
40
+ if (removeAssertionsInProduction) {
41
+ plugins.push([
42
+ require.resolve('babel-plugin-unassert'),
43
+ {
44
+ variables: ['assert', 'invariant'],
45
+ modules: ['assert', 'node:assert', 'tiny-invariant'],
46
+ },
47
+ ]);
48
+ }
49
+ }
50
+ const presets = [
51
+ [
52
+ require.resolve('@babel/preset-env'),
53
+ {
54
+ targets: browserslist,
55
+ shippedProposals: true,
56
+ },
57
+ ],
58
+ lang === 'ts'
59
+ ? [
60
+ require.resolve('@babel/preset-typescript'),
61
+ {
62
+ isTSX: true,
63
+ allExtensions: true,
64
+ // babel equivalent of tsconfig `verbatimModuleSyntax: true`
65
+ onlyRemoveTypeImports: true,
66
+ },
67
+ ]
68
+ : null,
69
+ [
70
+ require.resolve('@babel/preset-react'),
71
+ {
72
+ runtime: 'automatic',
73
+ development: !isProductionBuild,
74
+ },
75
+ ],
76
+ ].filter(Boolean);
77
+ return {
78
+ babelrc: false,
79
+ sourceType: isBrowser ? 'unambiguous' : 'module',
80
+ // `babel-jest` does not support the `cacheDirectory` option.
81
+ // It is only used by `babel-loader`.
82
+ ...(!isJest
83
+ ? {
84
+ cacheDirectory: true,
85
+ cacheCompression: false,
86
+ }
87
+ : {}),
88
+ presets,
89
+ plugins,
90
+ };
91
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Create a new ESLint ignores configuration object
3
+ */
4
+ export declare const createEslintIgnoresConfig: ({ hasLanguagesConfig, target, }: {
5
+ hasLanguagesConfig: boolean;
6
+ target: string | undefined;
7
+ }) => {
8
+ ignores: string[];
9
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Create a new ESLint ignores configuration object
3
+ */
4
+ export const createEslintIgnoresConfig = ({ hasLanguagesConfig, target, }) => {
5
+ // ESLint migrates ignore entries differently depending on whether a path contains a subdirectory.
6
+ // We want the sku target to match the migrated entry so it ends up excluded in the migrated
7
+ // output.
8
+ const targetIgnore = target && target.includes('/') ? `${target}/` : `**/${target}/`;
9
+ const ignores = [
10
+ hasLanguagesConfig && '**/*.vocab/index.ts',
11
+ '**/.eslintcache',
12
+ '**/eslint.config.js',
13
+ '**/.prettierrc',
14
+ '**/coverage/',
15
+ targetIgnore,
16
+ '**/report/',
17
+ '**/tsconfig.json',
18
+ '**/pnpm-lock.yaml',
19
+ ].filter(Boolean);
20
+ return {
21
+ ignores,
22
+ };
23
+ };
@@ -0,0 +1,22 @@
1
+ export declare const importOrderConfig: {
2
+ rules: {
3
+ 'import-x/order': (string | {
4
+ 'newlines-between': string;
5
+ alphabetize: {
6
+ order: string;
7
+ };
8
+ groups: string[];
9
+ pathGroups: {
10
+ pattern: string;
11
+ group: string;
12
+ position: string;
13
+ patternOptions: {
14
+ matchBase: boolean;
15
+ };
16
+ }[];
17
+ })[];
18
+ };
19
+ settings?: {
20
+ 'import-x/internal-regex': string;
21
+ } | undefined;
22
+ };
@@ -0,0 +1,38 @@
1
+ import { basename } from 'node:path';
2
+ import { paths, rootResolution } from '../../context/index.js';
3
+ const internalRegex = `^(${paths.src
4
+ .map((srcPath) => basename(srcPath))
5
+ .join('|')})/`;
6
+ const rootResolutionConfig = {
7
+ settings: {
8
+ 'import-x/internal-regex': internalRegex,
9
+ },
10
+ };
11
+ export const importOrderConfig = {
12
+ ...(rootResolution ? rootResolutionConfig : undefined),
13
+ rules: {
14
+ 'import-x/order': [
15
+ 'error',
16
+ {
17
+ 'newlines-between': 'always',
18
+ alphabetize: { order: 'asc' },
19
+ groups: [
20
+ 'builtin',
21
+ 'external',
22
+ 'internal',
23
+ 'parent',
24
+ 'sibling',
25
+ 'index',
26
+ ],
27
+ pathGroups: [
28
+ {
29
+ pattern: '*.css',
30
+ group: 'index',
31
+ position: 'after',
32
+ patternOptions: { matchBase: true },
33
+ },
34
+ ],
35
+ },
36
+ ],
37
+ },
38
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const eslintConfigSku: Linter.Config[] | undefined;
@@ -0,0 +1,18 @@
1
+ // @ts-expect-error `eslint-config-seek` has no types yet
2
+ import eslintConfigSeek from 'eslint-config-seek';
3
+ import { importOrderConfig } from './importOrder.js';
4
+ import { createEslintIgnoresConfig } from './ignores.js';
5
+ import { eslintDecorator, eslintIgnore, languages, paths, } from '../../context/index.js';
6
+ const { relativeTarget } = paths;
7
+ const _eslintConfigSku = [
8
+ createEslintIgnoresConfig({
9
+ hasLanguagesConfig: Boolean(languages && languages.length > 0),
10
+ target: relativeTarget,
11
+ }),
12
+ ...eslintConfigSeek,
13
+ importOrderConfig,
14
+ ...(eslintIgnore && eslintIgnore.length > 0
15
+ ? [{ ignores: eslintIgnore }]
16
+ : []),
17
+ ];
18
+ export const eslintConfigSku = eslintDecorator?.(_eslintConfigSku);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ module.exports = 'MOCK_FILE';
@@ -0,0 +1,2 @@
1
+ declare const _exports: string;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _default(css: any): string[];
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export default (css) => {
2
+ const classNames = [];
3
+ const classNameRegEx = /\.([-_a-zA-Z0-9]+)(?=[\.:\[\s{]|$)/gm;
4
+ let match = classNameRegEx.exec(css);
5
+ while (match !== null) {
6
+ classNames.push(match[1]);
7
+ match = classNameRegEx.exec(css);
8
+ }
9
+ return classNames;
10
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("jest").Config;
2
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import escapeRegex from 'escape-string-regexp';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { cwd } from '../../lib/cwd.js';
4
+ import { paths, rootResolution, jestDecorator } from '../../context/index.js';
5
+ const slash = '[/\\\\]'; // Cross-platform path delimiter regex
6
+ const compilePackagesRegex = paths.compilePackages
7
+ .map((pkg) => `.*${escapeRegex(pkg)}`)
8
+ .join('|');
9
+ /** @type {import('jest').Config} */
10
+ export default jestDecorator({
11
+ testEnvironment: 'jsdom',
12
+ setupFilesAfterEnv: paths.setupTests,
13
+ prettierPath: fileURLToPath(import.meta.resolve('prettier')),
14
+ modulePaths: rootResolution ? [cwd()] : undefined,
15
+ testMatch: [
16
+ // Default values, but with 'ts' + 'tsx' support
17
+ // (https://jestjs.io/docs/en/configuration.html#testmatch-array-string)
18
+ '**/__tests__/**/*.(js|ts|tsx)',
19
+ '**/?(*.)+(spec|test).(js|ts|tsx)',
20
+ ],
21
+ testPathIgnorePatterns: [
22
+ `<rootDir>${slash}(${paths.target}|node_modules)${slash}`,
23
+ ],
24
+ moduleFileExtensions: ['js', 'json', 'ts', 'tsx'],
25
+ moduleNameMapper: {
26
+ '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|svg)$': fileURLToPath(import.meta.resolve('./fileMock.cjs')),
27
+ },
28
+ transform: {
29
+ '\\.css\\.ts$': fileURLToPath(import.meta.resolve('@vanilla-extract/jest-transform')),
30
+ '\\.tsx?$': fileURLToPath(import.meta.resolve('./tsBabelTransform.js')),
31
+ '\\.[cm]?js$': fileURLToPath(import.meta.resolve('./jsBabelTransform.js')),
32
+ },
33
+ transformIgnorePatterns: [
34
+ // Allow 'compilePackages' code to be transformed in tests by overriding
35
+ // the default, which normally excludes everything in node_modules.
36
+ `node_modules${slash}(?!(${compilePackagesRegex}))`,
37
+ ],
38
+ watchPlugins: [
39
+ fileURLToPath(import.meta.resolve('jest-watch-typeahead/filename')),
40
+ fileURLToPath(import.meta.resolve('jest-watch-typeahead/testname')),
41
+ ],
42
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import(".pnpm/@jest+transform@29.7.0/node_modules/@jest/transform").SyncTransformer<import("@babel/core").TransformOptions> | Promise<import(".pnpm/@jest+transform@29.7.0/node_modules/@jest/transform").SyncTransformer<import("@babel/core").TransformOptions>>;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import babelJest from 'babel-jest';
2
+ import { rootResolution } from '../../context/index.js';
3
+ import babelConfig from '../babel/babelConfig.js';
4
+ import targets from '../targets.json' with { type: 'json' };
5
+ export default babelJest.createTransformer(babelConfig({
6
+ target: 'jest',
7
+ rootResolution,
8
+ browserslist: targets.browserslistNodeTarget,
9
+ }));
@@ -0,0 +1,2 @@
1
+ declare const _default: import(".pnpm/@jest+transform@29.7.0/node_modules/@jest/transform").SyncTransformer<import("@babel/core").TransformOptions> | Promise<import(".pnpm/@jest+transform@29.7.0/node_modules/@jest/transform").SyncTransformer<import("@babel/core").TransformOptions>>;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import babelJest from 'babel-jest';
2
+ import { rootResolution } from '../../context/index.js';
3
+ import babelConfig from '../babel/babelConfig.js';
4
+ import targets from '../targets.json' with { type: 'json' };
5
+ export default babelJest.createTransformer(babelConfig({
6
+ target: 'jest',
7
+ lang: 'ts',
8
+ rootResolution,
9
+ browserslist: targets.browserslistNodeTarget,
10
+ }));
@@ -0,0 +1,3 @@
1
+ import type { Config } from 'lint-staged';
2
+ declare const config: Config;
3
+ export default config;
@@ -0,0 +1,15 @@
1
+ import { isYarn, getCommand } from '../../lib/packageManager.js';
2
+ import { lintExtensions } from '../../lib/lint.js';
3
+ const config = {
4
+ [`**/*.{${lintExtensions},md}`]: ['sku format', 'sku lint'],
5
+ // Yarn lock integrity check
6
+ ...(isYarn
7
+ ? {
8
+ '+(package.json|yarn.lock)':
9
+ // The function form allows running the command without file arguments
10
+ // https://github.com/lint-staged/lint-staged#example-run-tsc-on-changes-to-typescript-files-but-do-not-pass-any-filename-arguments
11
+ () => getCommand('yarn', 'install', ['--check-files']),
12
+ }
13
+ : {}),
14
+ };
15
+ export default config;
@@ -0,0 +1,3 @@
1
+ import type { Options } from 'prettier';
2
+ declare const options: Options;
3
+ export default options;
@@ -0,0 +1,6 @@
1
+ const options = {
2
+ singleQuote: true,
3
+ tabWidth: 2,
4
+ trailingComma: 'all',
5
+ };
6
+ export default options;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // @ts-check
3
+ /**
4
+ * This file and all its dependencies must be CJS
5
+ * https://github.com/storybookjs/storybook/pull/23018
6
+ */
7
+ /** @typedef {import("@storybook/react-webpack5").StorybookConfig} StorybookConfig */
8
+ /** @typedef {import("webpack").Configuration} Configuration */
9
+ /**
10
+ * @typedef {object} WebpackOptions
11
+ * @property {'PRODUCTION' | 'DEVELOPMENT' | undefined} [configType]
12
+ */
13
+ /**
14
+ * @typedef {function(Configuration, WebpackOptions): Promise<Configuration>} AsyncWebpackFinal
15
+ */
16
+ /** @type AsyncWebpackFinal */
17
+ const webpackFinal = async (config, { configType }) => {
18
+ const makeStorybookWebpackConfig = (await import('./storybookWebpackConfig.js')).default;
19
+ return makeStorybookWebpackConfig(config, {
20
+ // sku storybook -> configType === 'DEVELOPMENT'
21
+ // sku build-storybook -> configType === 'PRODUCTION'
22
+ isDevServer: configType === 'DEVELOPMENT',
23
+ });
24
+ };
25
+ /** @type {NonNullable<StorybookConfig['babel']>} */
26
+ const babel = async () => {
27
+ const createBabelConfig = (await import('../babel/babelConfig.js')).default;
28
+ return createBabelConfig({
29
+ target: 'browser',
30
+ lang: 'ts',
31
+ browserslist: ['chrome > 122'],
32
+ displayNamesProd: true,
33
+ });
34
+ };
35
+ module.exports = {
36
+ webpackFinal,
37
+ babel,
38
+ };
@@ -0,0 +1,23 @@
1
+ export type StorybookConfig = import("@storybook/react-webpack5").StorybookConfig;
2
+ export type Configuration = import("webpack").Configuration;
3
+ export type WebpackOptions = {
4
+ configType?: "PRODUCTION" | "DEVELOPMENT" | undefined;
5
+ };
6
+ export type AsyncWebpackFinal = (arg0: Configuration, arg1: WebpackOptions) => Promise<Configuration>;
7
+ /**
8
+ * This file and all its dependencies must be CJS
9
+ * https://github.com/storybookjs/storybook/pull/23018
10
+ */
11
+ /** @typedef {import("@storybook/react-webpack5").StorybookConfig} StorybookConfig */
12
+ /** @typedef {import("webpack").Configuration} Configuration */
13
+ /**
14
+ * @typedef {object} WebpackOptions
15
+ * @property {'PRODUCTION' | 'DEVELOPMENT' | undefined} [configType]
16
+ */
17
+ /**
18
+ * @typedef {function(Configuration, WebpackOptions): Promise<Configuration>} AsyncWebpackFinal
19
+ */
20
+ /** @type AsyncWebpackFinal */
21
+ export const webpackFinal: AsyncWebpackFinal;
22
+ /** @type {NonNullable<StorybookConfig['babel']>} */
23
+ export const babel: NonNullable<StorybookConfig["babel"]>;
@@ -0,0 +1,4 @@
1
+ declare function _default(config: import("webpack").Configuration, { isDevServer }: {
2
+ isDevServer: boolean;
3
+ }): import("webpack").Configuration;
4
+ export default _default;