sku@13.0.0
Major Changes
-
Export jest preset path (#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:
// jest.config.js + const { preset } = require('sku/config/jest'); /** @type {import('jest').Config} */ module.exports = { - preset: 'sku/config/jest', + preset, };
-
Update default supported browsers (#1000)
skuapplications 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
supportedBrowsersconfiguration option in your sku config. -
Remove Storybook-related features from
sku(#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. Seesku's Storybook documentation for more information.MIGRATION GUIDE:
Update your
skuconfigThe following
skuconfiguration options have been removed:storybookAddonsstorybookPortstorybookStoryStorestorybookTarget
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.
Runsku configureto update your ignore files:pnpm exec sku configureYou will need to re-add your
storybookTargetvalue (from the previous step) to your.prettierignore,.eslintignore, and.gitignorefiles.Install Storybook dependencies
skuwas 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
storiesOfAPI will need to stay on Storybook v7 until they migrate away from this API.Storybook v8:
pnpm install -D storybook @storybook/react @storybook/react-webpack5 @storybook/addon-webpack5-compiler-babel
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 for you. To migrate to a minimal,
sku-compatible Storybook configuration, first locate your.storybook/main.jsfile.// .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.tsand replace its contents with the following, making adjustments as necessary for your project:// .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 for more information on configuring Storybook.Update
package.jsonscriptsThe
skuCLI no longer provides thesku storybookandsku build-storybookcommands. Please migrate to the official Storybook CLI:// 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" } }Update Storybook imports
skuno longer re-exports Storybook APIs under thesku/@storybook/reactentrypoint. Please update your imports to use the official Storybook package:// MyComponent.stories.tsx -import type { Meta } from 'sku/@storybook/react'; +import type { Meta } from '@storybook/react';
-
Remove LESS style support (#1005)
BREAKING CHANGE:
LESS style support has been removed.
MIGRATION GUIDE:
Please migrate all styles defined in
.lessfiles to Vanilla Extract styles.*.less.d.tsfiles are no longer git-ignored and should be deleted. Reach out in#sku-supportif you need help with this migration. -
Target
sku's minimum supported node version when building the server entry (#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)
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
orderImportsconfig option (#1014)BREAKING CHANGE:
orderImportsis now always enabled and has been removed from the configuration options.MIGRATION GUIDE
To reduce the number of changes when migrating to
skuv13 you may choose to enableorderImportsand runsku formatbefore upgrading.Remove
orderImportsfromsku.config.ts:// 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-ignorecomments above imports will not be moved as part of the autofix. These comments will need be moved manually. -
Remove support for the
envconfig property (#980)BREAKING CHANGE:
Support for the
envconfig property has been removed. This config property was deprecated in sku v7.0.0 in favour of theenvironmentsproperty. Please see the sku v7 migration guide for more information. -
sourceMapsProdis nowtrueby default (#979)BREAKING CHANGE:
sourceMapsProdis nowtrueby default. To enable the previous behaviour, setsourceMapsProd: falsein your sku config:// 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_OPTIONSenvironment variable to--max-old-space-size=4096(or a higher value) before running the build command.For example:
NODE_OPTIONS=--max-old-space-size=4096 sku build
-
Add peer dependency on
@types/react@^17.0.0 || ^18.0.0(#1016)BREAKING CHANGE
skunow has a peer dependency on@types/react@^17.0.0 || ^18.0.0. Most, if not all consumers ofskushould already have@types/reactinstalled, but if not, you will need to install it. -
Add explicit package exports (#984)
BREAKING CHANGE:
Importing from arbitrary subpaths within
skuis no longer possible. See the API documentation for a comprehensive list ofsku's API entrypoints. -
Remove support for the
--envCLI argument (#980)BREAKING CHANGE:
Support for the
--envCLI argument has been removed. This argument was replaced long ago by the--envrironmentargument. 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)This change enables babel to mimic the behaviour of TypeScript's
verbatimModuleSyntaxcompiler option. The following code demonstrates the result of this change when transpiling TypeScript to JavaScript:// 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
compilePackagedependencies that do not adhere to the correct type-only import syntax. These errors should be fixed in the dependency's codebase. -
sku init: Install dependencies with the package manager that was used to run the command (#982)BREAKING CHANGE:
The
sku initcommand will now install dependencies with the package manager that was used to run the command. This can be overridden via the--packageManagerflag: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
reactversions below17.0.0(#1016)BREAKING CHANGE
skuno longer supports react versions below17.0.0. Please upgrade your react version to17.0.0or higher. -
Remove support for
persistentCacheconfiguration option (#1013)BREAKING CHANGE:
Disabling
persistentCachewas previously necessary when using treat, which is no longer supported insku.persistentCacheis now always enabled and has been removed from the configuration options.MIGRATION GUIDE:
Remove the
persistentCacheoption from your sku config.// sku.config.ts import { type SkuConfig } from 'sku'; export default { - persistentCache: false, - persistentCache: true, } satisfies SkuConfig; -
Drop explicit file extensions when calling
prettier(#985)BREAKING CHANGE:
skuno longer passes explicit extensions toprettierduringsku lint/sku format. Instead, your application's root directory will be the target, andprettierwill format all files it supports. This may result in some files being formatted that were not previously formatted byprettier. -
Remove support for the
--tenantCLI argument (#980)BREAKING CHANGE:
Support for the
--tenantCLI argument has been removed. This is an old argument that has been unused withinskufor a long time. There is currently no consumer usage of this argument, so there should be no changes required. -
Remove support for the
--buildCLI argument (#980)BREAKING CHANGE:
SUpport for the
--buildCLI argument has been removed. This is an old argument that has been unused withinskufor a long time. There is currently no consumer usage of this argument, so there should be no changes required.
Minor Changes
-
Upgrade
eslintto^8.56.0andeslint-config-seekto^13.0.0(#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 viasku format, but others may require manual intervention. Please see theeslint-config-seekchangelog for more information. -
Add
dom.iterableto the tsconfiglibcompiler option (#983)This change provides type definitions for iterable APIs on some DOM APIs. For example, this enables using
for...ofsyntax or thekeys()method onURLSearchParams: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); }