From 136d4575fa575c08e02dbc58e2e174e9de01ad53 Mon Sep 17 00:00:00 2001 From: seek-oss-ci <34733141+seek-oss-ci@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:02:11 +1000 Subject: [PATCH] Version Packages (#1011) Co-authored-by: github-actions[bot] --- .changeset/brave-balloons-repair.md | 5 - .changeset/chilly-maps-care.md | 24 -- .changeset/clever-rocks-accept.md | 22 -- .changeset/dull-colts-fetch.md | 135 ---------- .changeset/early-rocks-chew.md | 17 -- .changeset/eight-news-retire.md | 9 - .changeset/eleven-tools-grin.md | 9 - .changeset/fifty-dolls-behave.md | 5 - .changeset/flat-fans-matter.md | 28 -- .changeset/good-cooks-behave.md | 9 - .changeset/happy-phones-watch.md | 30 --- .changeset/loud-trees-melt.md | 11 - .changeset/many-deers-check.md | 26 -- .changeset/mighty-paws-compare.md | 5 - .changeset/mighty-teachers-grow.md | 9 - .changeset/moody-dodos-rescue.md | 11 - .changeset/moody-taxis-occur.md | 9 - .changeset/odd-mugs-enjoy.md | 22 -- .changeset/shy-books-trade.md | 15 -- .changeset/slow-ads-complain.md | 9 - .changeset/stupid-seals-think.md | 26 -- .changeset/tiny-trainers-attend.md | 9 - .changeset/tough-terms-double.md | 9 - .changeset/wild-terms-accept.md | 9 - packages/sku/CHANGELOG.md | 400 ++++++++++++++++++++++++++++ packages/sku/package.json | 2 +- 26 files changed, 401 insertions(+), 464 deletions(-) delete mode 100644 .changeset/brave-balloons-repair.md delete mode 100644 .changeset/chilly-maps-care.md delete mode 100644 .changeset/clever-rocks-accept.md delete mode 100644 .changeset/dull-colts-fetch.md delete mode 100644 .changeset/early-rocks-chew.md delete mode 100644 .changeset/eight-news-retire.md delete mode 100644 .changeset/eleven-tools-grin.md delete mode 100644 .changeset/fifty-dolls-behave.md delete mode 100644 .changeset/flat-fans-matter.md delete mode 100644 .changeset/good-cooks-behave.md delete mode 100644 .changeset/happy-phones-watch.md delete mode 100644 .changeset/loud-trees-melt.md delete mode 100644 .changeset/many-deers-check.md delete mode 100644 .changeset/mighty-paws-compare.md delete mode 100644 .changeset/mighty-teachers-grow.md delete mode 100644 .changeset/moody-dodos-rescue.md delete mode 100644 .changeset/moody-taxis-occur.md delete mode 100644 .changeset/odd-mugs-enjoy.md delete mode 100644 .changeset/shy-books-trade.md delete mode 100644 .changeset/slow-ads-complain.md delete mode 100644 .changeset/stupid-seals-think.md delete mode 100644 .changeset/tiny-trainers-attend.md delete mode 100644 .changeset/tough-terms-double.md delete mode 100644 .changeset/wild-terms-accept.md diff --git a/.changeset/brave-balloons-repair.md b/.changeset/brave-balloons-repair.md deleted file mode 100644 index b943b8bc8..000000000 --- a/.changeset/brave-balloons-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'sku': patch ---- - -Loosen `esbuild` dependency version to help prevent multiple versions of it ending up in `node_modules` diff --git a/.changeset/chilly-maps-care.md b/.changeset/chilly-maps-care.md deleted file mode 100644 index 073bb039e..000000000 --- a/.changeset/chilly-maps-care.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -'sku': major ---- - -Export jest preset path - -**BREAKING CHANGE**: - -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. - -**MIGRATION GUIDE**: - -```diff -// jest.config.js -+ const { preset } = require('sku/config/jest'); - -/** @type {import('jest').Config} */ -module.exports = { -- preset: 'sku/config/jest', -+ preset, -}; -``` - -[testing documentation]: https://seek-oss.github.io/sku/#/./docs/testing diff --git a/.changeset/clever-rocks-accept.md b/.changeset/clever-rocks-accept.md deleted file mode 100644 index aa9f9c92b..000000000 --- a/.changeset/clever-rocks-accept.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'sku': major ---- - -Update default supported browsers - -`sku` applications and libraries now default to supporting more recent browser versions: - -| Browser | Oldest supported version | -| ---------------- | ------------------------ | -| Chrome | 84 | -| Edge | 84 | -| Safari | 14.1 | -| Firefox | 63 | -| Samsung Internet | 14.0 | - -**BREAKING CHANGE**: - -Production builds will now contain code that may not be compatible with older browser versions. If your application still needs to support older browsers, you can configure a custom [browserslist] query via the [`supportedBrowsers`] configuration option in your sku config. - -[browserslist]: https://browsersl.ist/ -[`supportedBrowser`]: https://seek-oss.github.io/sku/#/./docs/configuration?id=supportedbrowsers diff --git a/.changeset/dull-colts-fetch.md b/.changeset/dull-colts-fetch.md deleted file mode 100644 index 176b79557..000000000 --- a/.changeset/dull-colts-fetch.md +++ /dev/null @@ -1,135 +0,0 @@ ---- -'sku': major ---- - -Remove Storybook-related features from `sku` - -**BREAKING CHANGE** - -All Storybook-related features have been removed from `sku`. Sku no longer installs Storybook dependencies, configures Storybook, provides Storybook CLI commands, or re-exports Storybook APIs. If you are using Storybook, you will need to install Storybook dependencies yourself. See [`sku`'s Storybook documentation][storybook docs] for more information. - -[storybook docs]: https://seek-oss.github.io/sku/#/./docs/storybook - -**MIGRATION GUIDE**: - -#### Update your `sku` config - -The following `sku` configuration options have been removed: - -- `storybookAddons` -- `storybookPort` -- `storybookStoryStore` -- `storybookTarget` - -Please remove these properties from your sku configuration file, but keep the values around for use later in the migration. -#### Update your ignore files - -Sku no longer manages certain Storybook-related ignore file entries. -Run `sku configure` to update your ignore files: - -```sh -pnpm exec sku configure -``` - -You will need to re-add your `storybookTarget` value (from the previous step) to your `.prettierignore`, `.eslintignore`, and `.gitignore` files. - -#### Install Storybook dependencies - -`sku` was previously installing Storybook v7 dependencies for you. The first command below will install the latest (v8) Storybook dependencies. - -If you wish to stay on Storybook v7 for the time being, use the second command below. - -**NOTE**: Consumers that still depend on the deprecated `storiesOf` API will need to stay on Storybook v7 until they migrate away from this API. - -```sh -# Storybook v8 -pnpm install -D storybook @storybook/react @storybook/react-webpack5 @storybook/addon-webpack5-compiler-babel -``` - -```sh -# Storybook v7 -pnpm install -D storybook@^7.6.17 @storybook/react@^7.6.17 @storybook/react-webpack5@^7.6.17 -``` - -#### Configure Storybook - -Sku no longer configures your [Storybook main configuration file][sb main] for you. To migrate to a minimal, `sku`-compatible Storybook configuration, first locate your `.storybook/main.js` file. - -```js -// .storybook/main.js - Old configuration - -/** THIS FILE IS GENERATED BY SKU, MANUAL CHANGES WILL BE DISCARDED **/ -import storybookConfig from 'sku/config/storybook'; - -export default { ...storybookConfig }; -``` - -Rename this file to `.storybook/main.ts` and replace its contents with the following, making adjustments as necessary for your project: - -```ts -// .storybook/main.ts - New configuration - -import { babel, webpackFinal } from 'sku/config/storybook'; -import type { StorybookConfig } from '@storybook/react-webpack5'; - -export default { - stories: ['../src/**/*.stories.tsx'], - features: { - // Required for Storybook v7 if using the `storiesOf` API. - // If you set `storybookStoryStore: false` in your sku config, you will want this. - storyStoreV7: false, - }, - framework: { - name: '@storybook/react-webpack5', - options: { - builder: { - fsCache: true, // For faster startup times after the first `storybook dev` - }, - }, - }, - addons: [ - // Copy addons from your `storybookAddons` sku config here - '@storybook/addon-webpack5-compiler-babel', // Required for Storybook >=8.0.0 - ], - babel, - webpackFinal, -} satisfies StorybookConfig; -``` - -See [`sku`'s Storybook documentation][storybook docs] for more information on configuring Storybook. - -[sb main]: https://storybook.js.org/docs/api/main-config/main-config -[storybook docs]: https://seek-oss.github.io/sku/#/./docs/storybook - -#### Update `package.json` scripts - -The `sku` CLI no longer provides the `sku storybook` and `sku build-storybook` commands. Please migrate to [the official Storybook CLI][storybook cli]: - -```diff -// package.json -{ - "scripts": { -- "storybook": "sku storybook", - // Replace 8081 with your previously configured `storybookPort`, - // if you configured one and wish to keep it -+ "storybook": "storybook dev --port 8081", -- "build:storybook": "sku build-storybook" - // Replace `dist-storybook` with your previously configured `storybookTarget`, - // if you configured one and wish to keep it -+ "build:storybook": "storybook build --output-dir dist-storybook" - } -} -``` - -[storybook cli]: https://storybook.js.org/docs/cli/ - -#### Update Storybook imports - -`sku` no longer re-exports Storybook APIs under the `sku/@storybook/react` entrypoint. Please update your imports to use the official Storybook package: - -```diff -// MyComponent.stories.tsx - --import type { Meta } from 'sku/@storybook/react'; -+import type { Meta } from '@storybook/react'; -``` diff --git a/.changeset/early-rocks-chew.md b/.changeset/early-rocks-chew.md deleted file mode 100644 index ac592c650..000000000 --- a/.changeset/early-rocks-chew.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'sku': major ---- - -Remove LESS style support - -**BREAKING CHANGE**: - -[LESS] style support has been removed. - -**MIGRATION GUIDE**: - -Please migrate all styles defined in `.less` files to [Vanilla Extract] styles. `*.less.d.ts` files are no longer git-ignored and should be deleted. Reach out in [`#sku-support`] if you need help with this migration. - -[Vanilla Extract]: https://seek-oss.github.io/sku/#/./docs/styling?id=vanilla-extract -[LESS]: http://lesscss.org/ -[`#sku-support`]: https://seek.enterprise.slack.com/archives/CDL5VP5NU diff --git a/.changeset/eight-news-retire.md b/.changeset/eight-news-retire.md deleted file mode 100644 index a440019aa..000000000 --- a/.changeset/eight-news-retire.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Target `sku`'s minimum supported node version when building the server entry - -**BREAKING CHANGE** - -When building the server entry, the output code was previously transpiled to be compatible with a relatively old version of Node.js. This change updates the version to mirror sku's minimum supported Node.js version (18.20.0 at time of writing). SSR users should ensure their server's Node.js runtime is up-to-date with the minimum supported version. diff --git a/.changeset/eleven-tools-grin.md b/.changeset/eleven-tools-grin.md deleted file mode 100644 index 92c50f44a..000000000 --- a/.changeset/eleven-tools-grin.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': minor ---- - -Upgrade `eslint` to `^8.56.0` and `eslint-config-seek` to `^13.0.0` - -Due to changes in `eslint-config-seek@13.x`, consumers may see new linting errors or warnings. Some of these may be auto-fixable via `sku format`, but others may require manual intervention. Please see [the `eslint-config-seek` changelog][changelog] for more information. - -[changelog]: https://github.com/seek-oss/eslint-config-seek/blob/master/CHANGELOG.md diff --git a/.changeset/fifty-dolls-behave.md b/.changeset/fifty-dolls-behave.md deleted file mode 100644 index a0d23713a..000000000 --- a/.changeset/fifty-dolls-behave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'sku': patch ---- - -Update `@vocab/phrase` dependency to `^2.0.1` diff --git a/.changeset/flat-fans-matter.md b/.changeset/flat-fans-matter.md deleted file mode 100644 index 1e9732e77..000000000 --- a/.changeset/flat-fans-matter.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -'sku': minor ---- - -Add `dom.iterable` to the tsconfig `lib` compiler option - -This change provides type definitions for iterable APIs on some DOM APIs. For example, this enables using [`for...of` syntax] or the [`keys()`] method on `URLSearchParams`: - -```ts -const params = new URLSearchParams('a=1&b=2'); - -for (const [key, value] of params) { - // Prints: - // a 1 - // b 2 - console.log(key, value); -} - -for (const key of params.keys()) { - // Prints: - // a - // b - console.log(key); -} -``` - -[`for...of` syntax]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of -[`keys()`]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/keys diff --git a/.changeset/good-cooks-behave.md b/.changeset/good-cooks-behave.md deleted file mode 100644 index 347cdfee2..000000000 --- a/.changeset/good-cooks-behave.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Drop support for Node.js versions below 18.20.0 - -**BREAKING CHANGE**: - -The minimum supported Node.js version is now 18.20.0. Consumers must upgrade to Node.js v18.20.0 or later. diff --git a/.changeset/happy-phones-watch.md b/.changeset/happy-phones-watch.md deleted file mode 100644 index c58d0d5df..000000000 --- a/.changeset/happy-phones-watch.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -'sku': major ---- - -Remove support for `orderImports` config option - -**BREAKING CHANGE:** - -`orderImports` is now always enabled and has been removed from the configuration options. - -**MIGRATION GUIDE** - -> To reduce the number of changes when migrating to `sku` v13 you may choose to enable `orderImports` and run `sku format` before upgrading. - -Remove `orderImports` from `sku.config.ts`: - -```diff -// sku.config.ts - -import { type SkuConfig } from 'sku'; - -export default { -- orderImports: false, -- orderImports: true, -} satisfies SkuConfig; -``` - -Then run `sku format`. - -**Note:** Changing import order can affect the behaviour of your application. After running `sku format`, please ensure your app still works and looks as expected. Additionally, `@ts-ignore` comments above imports will **not** be moved as part of the autofix. These comments will need be moved manually. diff --git a/.changeset/loud-trees-melt.md b/.changeset/loud-trees-melt.md deleted file mode 100644 index a6ba5b8ad..000000000 --- a/.changeset/loud-trees-melt.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'sku': major ---- - -Remove support for the `env` config property - -**BREAKING CHANGE**: - -Support for the `env` config property has been removed. This config property was deprecated in sku v7.0.0 in favour of the `environments` property. Please see the [sku v7 migration guide] for more information. - -[sku v7 migration guide]: https://github.com/seek-oss/sku/blob/f37ea1dcbe2d6403bba6897c7a9e0cb9b231c74c/docs/migration-guides/v7.0.0.md#env diff --git a/.changeset/many-deers-check.md b/.changeset/many-deers-check.md deleted file mode 100644 index 2ba108013..000000000 --- a/.changeset/many-deers-check.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -'sku': major ---- - -`sourceMapsProd` is now `true` by default - -**BREAKING CHANGE**: - -`sourceMapsProd` is now `true` by default. To enable the previous behaviour, set `sourceMapsProd: false` in your sku config: - -```ts -// sku.config.ts -import type { SkuConfig } from 'sku'; - -export default { - sourceMapsProd: false, -} satisfies SkuConfig; -``` - -**NOTE**: Production source maps can increase memory usage during builds to the point where the Node process exhausts its heap memory. If this occurs, you can increase the memory limit for the Node process by setting the `NODE_OPTIONS` environment variable to `--max-old-space-size=4096` (or a higher value) before running the build command. - -For example: - -```sh -NODE_OPTIONS=--max-old-space-size=4096 sku build -``` diff --git a/.changeset/mighty-paws-compare.md b/.changeset/mighty-paws-compare.md deleted file mode 100644 index c4b97259a..000000000 --- a/.changeset/mighty-paws-compare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'sku': patch ---- - -Update `@swc/core` dependency to `^1.6.13` diff --git a/.changeset/mighty-teachers-grow.md b/.changeset/mighty-teachers-grow.md deleted file mode 100644 index 46fef053a..000000000 --- a/.changeset/mighty-teachers-grow.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Add peer dependency on `@types/react@^17.0.0 || ^18.0.0` - -**BREAKING CHANGE** - -`sku` now has a peer dependency on `@types/react@^17.0.0 || ^18.0.0`. Most, if not all consumers of `sku` should already have `@types/react` installed, but if not, you will need to install it. diff --git a/.changeset/moody-dodos-rescue.md b/.changeset/moody-dodos-rescue.md deleted file mode 100644 index da40719d7..000000000 --- a/.changeset/moody-dodos-rescue.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'sku': major ---- - -Add explicit package exports - -**BREAKING CHANGE**: - -Importing from arbitrary subpaths within `sku` is no longer possible. See the [API documentation] for a comprehensive list of `sku`'s API entrypoints. - -[API documentation]: https://seek-oss.github.io/sku/#/./docs/api diff --git a/.changeset/moody-taxis-occur.md b/.changeset/moody-taxis-occur.md deleted file mode 100644 index 83d0e8143..000000000 --- a/.changeset/moody-taxis-occur.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Remove support for the `--env` CLI argument - -**BREAKING CHANGE**: - -Support for the `--env` CLI argument has been removed. This argument was replaced long ago by the `--envrironment` argument. There is currently no consumer usage of this argument, so there should be no changes required. diff --git a/.changeset/odd-mugs-enjoy.md b/.changeset/odd-mugs-enjoy.md deleted file mode 100644 index d4e150dff..000000000 --- a/.changeset/odd-mugs-enjoy.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'sku': major ---- - -Remove type-only imports during transpilation and enforce correct type-only import syntax with `verbatimModuleSyntax: true` - -This change enables babel to mimic the behaviour of TypeScript's [`verbatimModuleSyntax`] compiler option. The following code demonstrates the result of this change when transpiling TypeScript to JavaScript: - -```ts -// Erased entirely -import type { A } from "a"; - -// Rewritten to `import { b } from "bcd";` -import { b, type c, type d } from "bcd"; - -// Rewritten to `import {} from "xyz";` -import { type xyz } from "xyz"; -``` - -This change is not expected to have an effect on bundled application code or library code. However, it may surface some TypeScript errors in `compilePackage` dependencies that do not adhere to the correct type-only import syntax. These errors should be fixed in the dependency's codebase. - -[`verbatimModuleSyntax`]: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax diff --git a/.changeset/shy-books-trade.md b/.changeset/shy-books-trade.md deleted file mode 100644 index f66ba0479..000000000 --- a/.changeset/shy-books-trade.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'sku': major ---- - -`sku init`: Install dependencies with the package manager that was used to run the command - -**BREAKING CHANGE**: - -The `sku init` command will now install dependencies with the package manager that was used to run the command. This can be overridden via the `--packageManager` flag: - -```sh -npx sku init my-app # Will install dependencies using npm -pnpm dlx sku init my-app # Will install dependencies using pnpm -npx sku init --packageManager yarn my-app # Will install dependencies using yarn -``` diff --git a/.changeset/slow-ads-complain.md b/.changeset/slow-ads-complain.md deleted file mode 100644 index d0786fb3d..000000000 --- a/.changeset/slow-ads-complain.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Drop support for `react` versions below `17.0.0` - -**BREAKING CHANGE** - -`sku` no longer supports react versions below `17.0.0`. Please upgrade your react version to `17.0.0` or higher. diff --git a/.changeset/stupid-seals-think.md b/.changeset/stupid-seals-think.md deleted file mode 100644 index 3eb27590f..000000000 --- a/.changeset/stupid-seals-think.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -'sku': major ---- - -Remove support for `persistentCache` configuration option - -**BREAKING CHANGE:** - -Disabling `persistentCache` was previously necessary when using [treat], which is no longer supported in `sku`. `persistentCache` is now always enabled and has been removed from the configuration options. - -[treat]: https://seek-oss.github.io/treat/ - -**MIGRATION GUIDE:** - -Remove the `persistentCache` option from your sku config. - -```diff -// sku.config.ts - -import { type SkuConfig } from 'sku'; - -export default { -- persistentCache: false, -- persistentCache: true, -} satisfies SkuConfig; -``` \ No newline at end of file diff --git a/.changeset/tiny-trainers-attend.md b/.changeset/tiny-trainers-attend.md deleted file mode 100644 index 83e845e87..000000000 --- a/.changeset/tiny-trainers-attend.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Drop explicit file extensions when calling `prettier` - -**BREAKING CHANGE**: - -`sku` no longer passes explicit extensions to `prettier` during `sku lint`/`sku format`. Instead, your application's root directory will be the target, and `prettier` will format all files it supports. This may result in some files being formatted that were not previously formatted by `prettier`. diff --git a/.changeset/tough-terms-double.md b/.changeset/tough-terms-double.md deleted file mode 100644 index a5618c0b6..000000000 --- a/.changeset/tough-terms-double.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Remove support for the `--tenant` CLI argument - -**BREAKING CHANGE**: - -Support for the `--tenant` CLI argument has been removed. This is an old argument that has been unused within `sku` for a long time. There is currently no consumer usage of this argument, so there should be no changes required. diff --git a/.changeset/wild-terms-accept.md b/.changeset/wild-terms-accept.md deleted file mode 100644 index 0722acf89..000000000 --- a/.changeset/wild-terms-accept.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'sku': major ---- - -Remove support for the `--build` CLI argument - -**BREAKING CHANGE**: - -SUpport for the `--build` CLI argument has been removed. This is an old argument that has been unused within `sku` for a long time. There is currently no consumer usage of this argument, so there should be no changes required. diff --git a/packages/sku/CHANGELOG.md b/packages/sku/CHANGELOG.md index 0396ab8be..9d1bb716d 100644 --- a/packages/sku/CHANGELOG.md +++ b/packages/sku/CHANGELOG.md @@ -1,5 +1,405 @@ # sku +## 13.0.0 + +### Major Changes + +- Export jest preset path ([#984](https://github.com/seek-oss/sku/pull/984)) + + **BREAKING CHANGE**: + + 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. + + **MIGRATION GUIDE**: + + ```diff + // jest.config.js + + const { preset } = require('sku/config/jest'); + + /** @type {import('jest').Config} */ + module.exports = { + - preset: 'sku/config/jest', + + preset, + }; + ``` + + [testing documentation]: https://seek-oss.github.io/sku/#/./docs/testing + +- Update default supported browsers ([#1000](https://github.com/seek-oss/sku/pull/1000)) + + `sku` applications and libraries now default to supporting more recent browser versions: + + | Browser | Oldest supported version | + | ---------------- | ------------------------ | + | Chrome | 84 | + | Edge | 84 | + | Safari | 14.1 | + | Firefox | 63 | + | Samsung Internet | 14.0 | + + **BREAKING CHANGE**: + + Production builds will now contain code that may not be compatible with older browser versions. If your application still needs to support older browsers, you can configure a custom [browserslist] query via the [`supportedBrowsers`] configuration option in your sku config. + + [browserslist]: https://browsersl.ist/ + [`supportedBrowser`]: https://seek-oss.github.io/sku/#/./docs/configuration?id=supportedbrowsers + +- Remove Storybook-related features from `sku` ([#996](https://github.com/seek-oss/sku/pull/996)) + + **BREAKING CHANGE** + + All Storybook-related features have been removed from `sku`. Sku no longer installs Storybook dependencies, configures Storybook, provides Storybook CLI commands, or re-exports Storybook APIs. If you are using Storybook, you will need to install Storybook dependencies yourself. See [`sku`'s Storybook documentation][storybook docs] for more information. + + [storybook docs]: https://seek-oss.github.io/sku/#/./docs/storybook + + **MIGRATION GUIDE**: + + #### Update your `sku` config + + The following `sku` configuration options have been removed: + + - `storybookAddons` + - `storybookPort` + - `storybookStoryStore` + - `storybookTarget` + + Please remove these properties from your sku configuration file, but keep the values around for use later in the migration. + + #### Update your ignore files + + Sku no longer manages certain Storybook-related ignore file entries. + Run `sku configure` to update your ignore files: + + ```sh + pnpm exec sku configure + ``` + + You will need to re-add your `storybookTarget` value (from the previous step) to your `.prettierignore`, `.eslintignore`, and `.gitignore` files. + + #### Install Storybook dependencies + + `sku` was previously installing Storybook v7 dependencies for you. The first command below will install the latest (v8) Storybook dependencies. + + If you wish to stay on Storybook v7 for the time being, use the second command below. + + **NOTE**: Consumers that still depend on the deprecated `storiesOf` API will need to stay on Storybook v7 until they migrate away from this API. + + ```sh + # Storybook v8 + pnpm install -D storybook @storybook/react @storybook/react-webpack5 @storybook/addon-webpack5-compiler-babel + ``` + + ```sh + # Storybook v7 + pnpm install -D storybook@^7.6.17 @storybook/react@^7.6.17 @storybook/react-webpack5@^7.6.17 + ``` + + #### Configure Storybook + + Sku no longer configures your [Storybook main configuration file][sb main] for you. To migrate to a minimal, `sku`-compatible Storybook configuration, first locate your `.storybook/main.js` file. + + ```js + // .storybook/main.js - Old configuration + + /** THIS FILE IS GENERATED BY SKU, MANUAL CHANGES WILL BE DISCARDED **/ + import storybookConfig from 'sku/config/storybook'; + + export default { ...storybookConfig }; + ``` + + Rename this file to `.storybook/main.ts` and replace its contents with the following, making adjustments as necessary for your project: + + ```ts + // .storybook/main.ts - New configuration + + import { babel, webpackFinal } from 'sku/config/storybook'; + import type { StorybookConfig } from '@storybook/react-webpack5'; + + export default { + stories: ['../src/**/*.stories.tsx'], + features: { + // Required for Storybook v7 if using the `storiesOf` API. + // If you set `storybookStoryStore: false` in your sku config, you will want this. + storyStoreV7: false, + }, + framework: { + name: '@storybook/react-webpack5', + options: { + builder: { + fsCache: true, // For faster startup times after the first `storybook dev` + }, + }, + }, + addons: [ + // Copy addons from your `storybookAddons` sku config here + '@storybook/addon-webpack5-compiler-babel', // Required for Storybook >=8.0.0 + ], + babel, + webpackFinal, + } satisfies StorybookConfig; + ``` + + See [`sku`'s Storybook documentation][storybook docs] for more information on configuring Storybook. + + [sb main]: https://storybook.js.org/docs/api/main-config/main-config + [storybook docs]: https://seek-oss.github.io/sku/#/./docs/storybook + + #### Update `package.json` scripts + + The `sku` CLI no longer provides the `sku storybook` and `sku build-storybook` commands. Please migrate to [the official Storybook CLI][storybook cli]: + + ```diff + // package.json + { + "scripts": { + - "storybook": "sku storybook", + // Replace 8081 with your previously configured `storybookPort`, + // if you configured one and wish to keep it + + "storybook": "storybook dev --port 8081", + - "build:storybook": "sku build-storybook" + // Replace `dist-storybook` with your previously configured `storybookTarget`, + // if you configured one and wish to keep it + + "build:storybook": "storybook build --output-dir dist-storybook" + } + } + ``` + + [storybook cli]: https://storybook.js.org/docs/cli/ + + #### Update Storybook imports + + `sku` no longer re-exports Storybook APIs under the `sku/@storybook/react` entrypoint. Please update your imports to use the official Storybook package: + + ```diff + // MyComponent.stories.tsx + + -import type { Meta } from 'sku/@storybook/react'; + +import type { Meta } from '@storybook/react'; + ``` + +- Remove LESS style support ([#1005](https://github.com/seek-oss/sku/pull/1005)) + + **BREAKING CHANGE**: + + [LESS] style support has been removed. + + **MIGRATION GUIDE**: + + Please migrate all styles defined in `.less` files to [Vanilla Extract] styles. `*.less.d.ts` files are no longer git-ignored and should be deleted. Reach out in [`#sku-support`] if you need help with this migration. + + [Vanilla Extract]: https://seek-oss.github.io/sku/#/./docs/styling?id=vanilla-extract + [LESS]: http://lesscss.org/ + [`#sku-support`]: https://seek.enterprise.slack.com/archives/CDL5VP5NU + +- Target `sku`'s minimum supported node version when building the server entry ([#1006](https://github.com/seek-oss/sku/pull/1006)) + + **BREAKING CHANGE** + + When building the server entry, the output code was previously transpiled to be compatible with a relatively old version of Node.js. This change updates the version to mirror sku's minimum supported Node.js version (18.20.0 at time of writing). SSR users should ensure their server's Node.js runtime is up-to-date with the minimum supported version. + +- Drop support for Node.js versions below 18.20.0 ([#986](https://github.com/seek-oss/sku/pull/986)) + + **BREAKING CHANGE**: + + The minimum supported Node.js version is now 18.20.0. Consumers must upgrade to Node.js v18.20.0 or later. + +- Remove support for `orderImports` config option ([#1014](https://github.com/seek-oss/sku/pull/1014)) + + **BREAKING CHANGE:** + + `orderImports` is now always enabled and has been removed from the configuration options. + + **MIGRATION GUIDE** + + > To reduce the number of changes when migrating to `sku` v13 you may choose to enable `orderImports` and run `sku format` before upgrading. + + Remove `orderImports` from `sku.config.ts`: + + ```diff + // sku.config.ts + + import { type SkuConfig } from 'sku'; + + export default { + - orderImports: false, + - orderImports: true, + } satisfies SkuConfig; + ``` + + Then run `sku format`. + + **Note:** Changing import order can affect the behaviour of your application. After running `sku format`, please ensure your app still works and looks as expected. Additionally, `@ts-ignore` comments above imports will **not** be moved as part of the autofix. These comments will need be moved manually. + +- Remove support for the `env` config property ([#980](https://github.com/seek-oss/sku/pull/980)) + + **BREAKING CHANGE**: + + Support for the `env` config property has been removed. This config property was deprecated in sku v7.0.0 in favour of the `environments` property. Please see the [sku v7 migration guide] for more information. + + [sku v7 migration guide]: https://github.com/seek-oss/sku/blob/f37ea1dcbe2d6403bba6897c7a9e0cb9b231c74c/docs/migration-guides/v7.0.0.md#env + +- `sourceMapsProd` is now `true` by default ([#979](https://github.com/seek-oss/sku/pull/979)) + + **BREAKING CHANGE**: + + `sourceMapsProd` is now `true` by default. To enable the previous behaviour, set `sourceMapsProd: false` in your sku config: + + ```ts + // sku.config.ts + import type { SkuConfig } from 'sku'; + + export default { + sourceMapsProd: false, + } satisfies SkuConfig; + ``` + + **NOTE**: Production source maps can increase memory usage during builds to the point where the Node process exhausts its heap memory. If this occurs, you can increase the memory limit for the Node process by setting the `NODE_OPTIONS` environment variable to `--max-old-space-size=4096` (or a higher value) before running the build command. + + For example: + + ```sh + NODE_OPTIONS=--max-old-space-size=4096 sku build + ``` + +- Add peer dependency on `@types/react@^17.0.0 || ^18.0.0` ([#1016](https://github.com/seek-oss/sku/pull/1016)) + + **BREAKING CHANGE** + + `sku` now has a peer dependency on `@types/react@^17.0.0 || ^18.0.0`. Most, if not all consumers of `sku` should already have `@types/react` installed, but if not, you will need to install it. + +- Add explicit package exports ([#984](https://github.com/seek-oss/sku/pull/984)) + + **BREAKING CHANGE**: + + Importing from arbitrary subpaths within `sku` is no longer possible. See the [API documentation] for a comprehensive list of `sku`'s API entrypoints. + + [API documentation]: https://seek-oss.github.io/sku/#/./docs/api + +- Remove support for the `--env` CLI argument ([#980](https://github.com/seek-oss/sku/pull/980)) + + **BREAKING CHANGE**: + + Support for the `--env` CLI argument has been removed. This argument was replaced long ago by the `--envrironment` argument. There is currently no consumer usage of this argument, so there should be no changes required. + +- Remove type-only imports during transpilation and enforce correct type-only import syntax with `verbatimModuleSyntax: true` ([#983](https://github.com/seek-oss/sku/pull/983)) + + This change enables babel to mimic the behaviour of TypeScript's [`verbatimModuleSyntax`] compiler option. The following code demonstrates the result of this change when transpiling TypeScript to JavaScript: + + ```ts + // Erased entirely + import type { A } from 'a'; + + // Rewritten to `import { b } from "bcd";` + import { b, type c, type d } from 'bcd'; + + // Rewritten to `import {} from "xyz";` + import { type xyz } from 'xyz'; + ``` + + This change is not expected to have an effect on bundled application code or library code. However, it may surface some TypeScript errors in `compilePackage` dependencies that do not adhere to the correct type-only import syntax. These errors should be fixed in the dependency's codebase. + + [`verbatimModuleSyntax`]: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax + +- `sku init`: Install dependencies with the package manager that was used to run the command ([#982](https://github.com/seek-oss/sku/pull/982)) + + **BREAKING CHANGE**: + + The `sku init` command will now install dependencies with the package manager that was used to run the command. This can be overridden via the `--packageManager` flag: + + ```sh + npx sku init my-app # Will install dependencies using npm + pnpm dlx sku init my-app # Will install dependencies using pnpm + npx sku init --packageManager yarn my-app # Will install dependencies using yarn + ``` + +- Drop support for `react` versions below `17.0.0` ([#1016](https://github.com/seek-oss/sku/pull/1016)) + + **BREAKING CHANGE** + + `sku` no longer supports react versions below `17.0.0`. Please upgrade your react version to `17.0.0` or higher. + +- Remove support for `persistentCache` configuration option ([#1013](https://github.com/seek-oss/sku/pull/1013)) + + **BREAKING CHANGE:** + + Disabling `persistentCache` was previously necessary when using [treat], which is no longer supported in `sku`. `persistentCache` is now always enabled and has been removed from the configuration options. + + [treat]: https://seek-oss.github.io/treat/ + + **MIGRATION GUIDE:** + + Remove the `persistentCache` option from your sku config. + + ```diff + // sku.config.ts + + import { type SkuConfig } from 'sku'; + + export default { + - persistentCache: false, + - persistentCache: true, + } satisfies SkuConfig; + ``` + +- Drop explicit file extensions when calling `prettier` ([#985](https://github.com/seek-oss/sku/pull/985)) + + **BREAKING CHANGE**: + + `sku` no longer passes explicit extensions to `prettier` during `sku lint`/`sku format`. Instead, your application's root directory will be the target, and `prettier` will format all files it supports. This may result in some files being formatted that were not previously formatted by `prettier`. + +- Remove support for the `--tenant` CLI argument ([#980](https://github.com/seek-oss/sku/pull/980)) + + **BREAKING CHANGE**: + + Support for the `--tenant` CLI argument has been removed. This is an old argument that has been unused within `sku` for a long time. There is currently no consumer usage of this argument, so there should be no changes required. + +- Remove support for the `--build` CLI argument ([#980](https://github.com/seek-oss/sku/pull/980)) + + **BREAKING CHANGE**: + + SUpport for the `--build` CLI argument has been removed. This is an old argument that has been unused within `sku` for a long time. There is currently no consumer usage of this argument, so there should be no changes required. + +### Minor Changes + +- Upgrade `eslint` to `^8.56.0` and `eslint-config-seek` to `^13.0.0` ([#986](https://github.com/seek-oss/sku/pull/986)) + + Due to changes in `eslint-config-seek@13.x`, consumers may see new linting errors or warnings. Some of these may be auto-fixable via `sku format`, but others may require manual intervention. Please see [the `eslint-config-seek` changelog][changelog] for more information. + + [changelog]: https://github.com/seek-oss/eslint-config-seek/blob/master/CHANGELOG.md + +- Add `dom.iterable` to the tsconfig `lib` compiler option ([#983](https://github.com/seek-oss/sku/pull/983)) + + This change provides type definitions for iterable APIs on some DOM APIs. For example, this enables using [`for...of` syntax] or the [`keys()`] method on `URLSearchParams`: + + ```ts + const params = new URLSearchParams('a=1&b=2'); + + for (const [key, value] of params) { + // Prints: + // a 1 + // b 2 + console.log(key, value); + } + + for (const key of params.keys()) { + // Prints: + // a + // b + console.log(key); + } + ``` + + [`for...of` syntax]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of + [`keys()`]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/keys + +### Patch Changes + +- Loosen `esbuild` dependency version to help prevent multiple versions of it ending up in `node_modules` ([#1018](https://github.com/seek-oss/sku/pull/1018)) + +- Update `@vocab/phrase` dependency to `^2.0.1` ([#1018](https://github.com/seek-oss/sku/pull/1018)) + +- Update `@swc/core` dependency to `^1.6.13` ([#1018](https://github.com/seek-oss/sku/pull/1018)) + ## 12.8.1 ### Patch Changes diff --git a/packages/sku/package.json b/packages/sku/package.json index 82fcd598f..dd3c8b6d1 100644 --- a/packages/sku/package.json +++ b/packages/sku/package.json @@ -1,6 +1,6 @@ { "name": "sku", - "version": "12.8.1", + "version": "13.0.0", "description": "Front-end development toolkit, powered by Webpack, Babel, Vanilla Extract and Jest", "types": "./sku-types.d.ts", "bin": {