sku 13.0.1 → 13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # sku
2
2
 
3
+ ## 13.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Replace `sku/config/jest` entrypoint with `sku/jest-preset` ([#1024](https://github.com/seek-oss/sku/pull/1024))
8
+
9
+ **BREAKING CHANGE FOR CUSTOM JEST CONFIG**:
10
+
11
+ This breaking change will only affect a very small number of projects that have a custom Jest configuration/wish to debug tests in their IDE, and it is intended to be a quick fix/improvement for a feature released in `sku@13.0.0`. Therefore, it's not being released as a major version.
12
+
13
+ The `sku/config/jest` entrypoint has been removed in favor of a new `sku/jest-preset` entrypoint. The `sku/jest-preset` module is a better way to expose a [jest preset], rather than a relative path (the previous implementation), as it works even if `sku` is hoisted to a parent `node_modules` directory.
14
+
15
+ **MIGRATION GUIDE**:
16
+
17
+ ```diff
18
+ // jest.config.js
19
+ - const { preset } = require('sku/config/jest');
20
+
21
+ /** @type {import('jest').Config} */
22
+ module.exports = {
23
+ // If you've already migrated to sku v13
24
+ - preset,
25
+ // If you're still on sku v12.x
26
+ - preset: 'sku/config/jest',
27
+ + preset: 'sku',
28
+ };
29
+ ```
30
+
31
+ [jest preset]: https://jestjs.io/docs/configuration#preset-string
32
+
3
33
  ## 13.0.1
4
34
 
5
35
  ### Patch Changes
@@ -10,22 +40,20 @@
10
40
 
11
41
  ### Major Changes
12
42
 
13
- - Export jest preset path ([#984](https://github.com/seek-oss/sku/pull/984))
43
+ - Export jest preset ([#984](https://github.com/seek-oss/sku/pull/984))
14
44
 
15
45
  **BREAKING CHANGE**:
16
46
 
17
- The jest preset is now accessible via a relative path rather than pointing to a module. This may affect users that require a jest config for debugging tests in their IDE. See the [testing documentation] for more information.
47
+ The jest preset is now accessible via the `sku` preset. This may affect users that require a jest config for debugging tests in their IDE. See the [testing documentation] for more information.
18
48
 
19
49
  **MIGRATION GUIDE**:
20
50
 
21
51
  ```diff
22
52
  // jest.config.js
23
- + const { preset } = require('sku/config/jest');
24
-
25
53
  /** @type {import('jest').Config} */
26
54
  module.exports = {
27
55
  - preset: 'sku/config/jest',
28
- + preset,
56
+ + preset: 'sku',
29
57
  };
30
58
  ```
31
59
 
@@ -170,6 +198,26 @@
170
198
  }
171
199
  ```
172
200
 
201
+ If you have a [multi-language] application, you will want to compile your translations before running the Storybook CLI:
202
+
203
+ ```jsonc
204
+ // package.json
205
+ {
206
+ "scripts": {
207
+ "storybook": "sku translations compile && storybook dev" // or storybook build
208
+ }
209
+ }
210
+ ```
211
+
212
+ If you want to run a development Storybook and see Vocab translations update in real time, you can run the [`sku translations compile --watch`][translations compile watch] command at the same time as `storybook dev`.
213
+ This can be achieved via a package such as [`concurrently`], or if you are using `pnpm` you can use `pnpm`'s built-in support for [running multiple scripts] in parallel.
214
+
215
+ Please read the [Storybook CLI documentation] for more information.
216
+
217
+ [multi-language]: ./docs/multi-language
218
+ [translations compile watch]: ./docs/cli?id=translations-compile
219
+ [`concurrently`]: https://www.npmjs.com/package/concurrently
220
+ [running multiple scripts]: https://pnpm.io/8.x/cli/run#running-multiple-scripts
173
221
  [storybook cli]: https://storybook.js.org/docs/cli/
174
222
 
175
223
  #### Update Storybook imports
package/package.json CHANGED
@@ -1,19 +1,14 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "13.0.1",
3
+ "version": "13.0.2",
4
4
  "description": "Front-end development toolkit, powered by Webpack, Babel, Vanilla Extract and Jest",
5
5
  "types": "./sku-types.d.ts",
6
6
  "bin": {
7
7
  "sku": "./bin/sku.js"
8
8
  },
9
9
  "exports": {
10
- ".": {
11
- "types": "./sku-types.d.ts"
12
- },
13
- "./config/jest": {
14
- "default": "./config/jest/index.js",
15
- "types": "./config/jest/index.d.ts"
16
- },
10
+ ".": "./sku-types.d.ts",
11
+ "./jest-preset": "./config/jest/jest-preset.js",
17
12
  "./config/storybook": {
18
13
  "default": "./config/storybook/index.js",
19
14
  "types": "./config/storybook/index.d.ts"
@@ -145,6 +140,7 @@
145
140
  "devDependencies": {
146
141
  "@types/cross-spawn": "^6.0.3",
147
142
  "@types/debug": "^4.1.12",
143
+ "@types/eslint": "^8.56.10",
148
144
  "@types/minimist": "^1.2.5",
149
145
  "@types/picomatch": "^2.3.3",
150
146
  "@types/react": "^18.2.3",
package/scripts/test.js CHANGED
@@ -11,12 +11,12 @@ const log = debug('sku:jest');
11
11
  await runVocabCompile();
12
12
 
13
13
  // https://jestjs.io/docs/configuration#preset-string
14
- const { preset } = require('../config/jest');
15
- log(`Using Jest preset at ${preset}`);
14
+ const jestPreset = 'sku';
15
+ log(`Using '${jestPreset}' Jest preset`);
16
16
 
17
17
  const jestArgv = [...argv];
18
18
 
19
- jestArgv.push('--preset', preset);
19
+ jestArgv.push('--preset', jestPreset);
20
20
 
21
21
  if (isCI) {
22
22
  jestArgv.push('--ci');
@@ -1 +0,0 @@
1
- export const preset: string;
@@ -1,8 +0,0 @@
1
- // @ts-check
2
-
3
- // Relative preset paths must start with `./` or jest complains
4
- const preset = './node_modules/sku/config/jest/jest-preset.js';
5
-
6
- module.exports = {
7
- preset,
8
- };