sku@16.0.0
There are a lot of changes in this major release, however most consumers should only need to run the following to address the majority of issues:
pnpm dlx @sku-lib/codemod migrate-root-resolution . && pnpm sku formatYou will also need to update any @sku-lib/* packages to the latest version.
It is still strongly recommended to read the entire release notes.
Major Changes
-
config: RemoverootResolutionin favour of native subpath imports (#1651)Node.js can now resolve path aliases natively via subpath imports in
package.json#imports.sku'spathAliasesoption now uses this and works with both thewebpackandvitebundlers.BREAKING CHANGE:
skugeneratestsconfig.json#pathsfrom yourpathAliasesoption and mirrors them intopackage.json#importsso aliases resolve natively at build time. Specifiers must use a#prefix, soimport x from 'src/foo'becomesimport x from '#src/foo'.skutakes ownership of thepackage.jsonimportsfield and keeps it in sync withpathAliases, so you no longer need to maintainimportsby hand.To migrate, run the
migrate-root-resolutioncodemod to update your project. It rewritessrc/...imports to#src/...and adds the matching#src/*entry to thepathAliasesoption in your sku config:pnpm dlx @sku-lib/codemod migrate-root-resolution .After running the codemod, your sku config will contain:
export default { pathAliases: { '#src/*': './src/*', }, } satisfies SkuConfig;
Note: Any other custom aliases will need to be manually migrated by adding the alias to
pathAliasesand find-and-replacing the specifier in your codebase to add a#prefix. -
deps: Update minimum supported Node.js version to 24.16.0 (#1651)BREAKING CHANGE:
Node.js versions below v24.16.0 are no longer supported. Please upgrade to at least v24.16.0.
-
deps: TypeScript updated to version 6 (#1651)BREAKING CHANGE:
sku now generates a TypeScript 6 compatible
tsconfig.jsonfor you, so most projects will not need changes. However, TypeScript 6 ships new defaults and deprecations that may affect your source code, dependencies, or any custom config. See the TypeScript 6.0 announcement or the 5.x to 6.0 migration guide for full details.Run
sku configureto regenerate yourtsconfig.json, thensku lintto surface anything below.Most likely to need attention
-
Missing
@typespackages. TypeScript no longer auto-loads every@types/*package. In sku, onlynodeandjest(when using the Jest test runner) are included by default. If you seeCannot find name/Cannot find type definitionerrors for globals, add them viadangerouslySetTSConfig:dangerouslySetTSConfig: (config) => ({ ...config, compilerOptions: { ...config.compilerOptions, types: [...config.compilerOptions.types, 'cypress'], }, }),
If you customize your tsconfig
- Remove
baseUrl— deprecated in TS 6, will be removed in TS 7. If you setbaseUrlviadangerouslySetTSConfig, remove it. For import aliases, use thepathAliasesconfig option instead. - Remove deprecated options if you set any of these in
dangerouslySetTSConfig:downlevelIteration,outFile,alwaysStrict: false,esModuleInterop: false,allowSyntheticDefaultImports: false,moduleResolution: node/node10/classic,module: amd/umd/system/none,target: es3/es5.
Source code updates (less common)
- Import attributes: replace
import x from './data.json' assert { type: 'json' }withwith { type: 'json' }. - Namespaces: replace
module Foo { }withnamespace Foo { }. - CJS default imports: replace
import * as x from 'cjs-pkg'withimport x from 'cjs-pkg'(interop is always on now). - Inference edge cases: TS 6's improved method inference can change a few inferred types — add explicit annotations where needed.
Tooling & dependencies
- Dependencies with legacy
.d.tssyntax: Oldmodule Foo { }namespaces may need upgrading, forking, or patching. - Temporal polyfills: If you used
@js-temporal/polyfillortemporal-polyfill, they are now no longer type-compatible with the new built-inTemporallib types.
Tip: if deprecation errors come from options you set via
dangerouslySetTSConfig, you can addignoreDeprecations: '6.0'there to silence them temporarily. This will stop working in TypeScript 7. -
-
deps: Updatepath-to-regexpdependency from^6.3.0to8.4.2(#1651)This update spans two major versions. Please read the release notes for both v7 and v8.
BREAKING CHANGE:
The change most likely to impact
skuconsumers is the requirement that wildcards (*) now must specify a key name, just like path parameters (:). In most cases this should be a simple migration:/home/*->/home/*rest.It is highly recommended to review all routes configured in your application and test navigation to these routes to ensure they still function as expected.
-
lint: Skip the TypeScript check when file paths are provided (#1651)Previously,
sku lint <path>ran ESLint and Prettier on the given paths but still ran TypeScript across the entire project. This is because TypeScript ignores yourtsconfig.jsonwhen filenames are passed explicitly, so the check can't be scoped to a single path. This unexpected behaviour has now been removed.BREAKING CHANGE:
skunow skips the TypeScript check entirely when a file path is provided. To replicate the previous behaviour, runtscmanually first:{ "scripts": { - "lint-path": "sku lint <path>" + "lint-path": "tsc && sku lint <path>" } } -
storybook: Drop support for Storybook v7, v8 and v9 (#1651)BREAKING CHANGE:
sku's@storybook/react-webpack5peer dependency range no longer includes^7.0.0 || ^8.0.0 || ^9.0.0.^10.0.0is now the only supported version range. Consumers must upgrade@storybook/react-wepback5and any other Storybook-related dependencies to at least v10.Please refer to the Storybook v10 migration guide for breaking changes as well as guidance on automatically upgrading your Storybook to v10.
-
config: Deprecate CommonJSmodule.exportsformat for sku configs (#1651)BREAKING CHANGE:
Sku config files must now be ESM syntax. If CommonJS is used,
skuwill display a banner and exit.-module.exports = { +export default { ..., };
-
configure: Remove automatic.eslintignoremigration (#1651)Automatic
.eslintignoremigration was added in sku v14 as part of the migration to ESLint v9's flat config format. This automatic migration logic no longer serves a purpose for most sku consumers, so it has been removed.BREAKING CHANGE:
Consumers upgrading from sku v13 or older should first migrate to v14 or v15 before attempting to migrate to v16.
-
deps: Drop support forvitestversions below4.1.0(#1651)BREAKING CHANGE:
skuno longer supportsvitestversions below4.1.0. Consumers that usevitestmust upgrade theirvitestdependency to4.1.0or later. -
format: Throws if Prettier cannot complete formatting (invalid syntax, missing config, etc.) (#1651)BREAKING CHANGE:
Previously,
sku formatwould silently fail if Prettier was unable to complete formatting due to invalid syntax, missing config, etc. This has now been changed to throw an error. -
init: Removeinitcommand (#1651)BREAKING CHANGE:
The
initcommand was deprecated in v15.0.0 and is now removed.
To create a newskuproject, use@sku-lib/create. -
lint|format: Promotepackage.jsonkey sorting lint rule fromwarntoerror(#1651)BREAKING CHANGE:
Unsorted keys in
package.jsonwill now be treated as errors. Runningsku formatwill automatically fix this error. -
pre-commit: Removepre-commitcommand (#1651)BREAKING CHANGE:
The
pre-commitcommand saw very little use and bundledlint-staged(and its many transitive dependencies) into everyskuinstall. Setting this up yourself is straightforward and gives you full control over which commands run before each commit, so this feature has been removed.Sku's pre-commit hook documentation has been updated to support projects wanting to continue using this feature. See the pre-commit hook documentation for a full migration guide.
-
start-srr: SSR server now accessible via webpack dev server (#1651)When running
sku start-ssr, users would previously access the SSR server directly. Static assets would then be loaded from the webpack dev server on a separate host.
sku start-ssrwill now proxy requests from the webpack dev server to the consumer's app (the SSR server), allowing the dev server to act as a single entrypoint.BREAKING CHANGE:
When starting the dev server consumers may notice some changes:
- A new port used when opening the browser window
- Changes to the path used when loading assets
See Development server entry for more information.
-
storybook: Publish Storybook config as ESM-only (#1651)BREAKING CHANGE:
The Storybook config available via the
sku/config/storybookentrypoint is now published as ESM-only and requires a version of Storybook that supports ESM config. This change is coupled with dropping support for older Storybook versions, so a compatible (ESM-supporting) version is guaranteed as part of the required Storybook upgrade. -
telemetry: Remove interop for very old versions of@seek/sku-telemetry(#1651)BREAKING CHANGE:
skuis no longer compatible with@seek/sku-telemetryversions below v1.3.0. v1.3.0 was released almost 6 years ago so most consumers are unlikely to be affected. -
vite: Align build output file names with webpack conventions (#1651)Chunk and asset file names generated by
vitebuilds have been updated to more closely align with webpack naming conventions.BREAKING CHANGE:
Relying on specific output file names is brittle and strongly discouraged — if you do, verify that any dependent systems still work as expected.
-
webpack: Remove deprecated default export fromsku/webpack-pluginentrypoint (#1651)BREAKING CHANGE:
The named export
SkuWebpackPluginis now the only export provided by thesku/webpack-pluginentrypoint.-import SkuWebpackPlugin from 'sku/webpack-plugin'; +import { SkuWebpackPlugin } from 'sku/webpack-plugin';
-
webpack: Replacecssnanowithlightningcssfor CSS minification (#1651)Both Webpack and Vite apps now use
lightningcssfor CSS minification.BREAKING CHANGE:
The structure of minified CSS output by webpack apps has changed, though the resulting styles should be unaffected. We recommend testing a production build to confirm.
Minor Changes
-
configure: Display a warning banner when React 18 is detected (#1651)Sku fully supports React 19 and it is recommended for use. A warning banner will be displayed when React 18 is detected to encourage applications to upgrade.
-
deps: Updateprettierdependency from~3.8.0to~3.9.0(#1651)This change may result in some code formatting changes. Please review the Prettier 3.9.0 release notes.
-
lint: Run all lint checks instead of bailing on the first failure (#1651)Previously, a single failing lint check would halt the entire process, so you'd only see errors from the first check to fail and would have to fix them before any other errors surfaced.
To surface everything at once,
skunow runs all lint checks even when some fail. You'll see errors from every check in a single run, and the process still exits with a non-zero code if any errors are found. -
vite: Enable support for configuring a public assets directory via thepublicoption in sku config (#1651)Previously, the
publicconfiguration option was only supported in Webpack apps. It is now also supported in Vite apps.
Patch Changes
-
config: Use asyncjitiAPI to load sku config asynchronously (#1651) -
deps: Unpinwebpack-dev-serverdependency (#1651)webpack-dev-server@5.2.1changed dev server behaviour to be more secure when handling cross-origin requests. This resulted in CORS errors in sku SSR apps during local development. Thewebpack-dev-serverdependency version was restricted to older versions insku@14.8.0to temporarily mitigate this issue.This issue has now been resolved, and the dependency has been unpinned. SSR consumers that were overriding
webpack-dev-serverto a specific version in theirpackage.jsonshould now be able to remove such restrictions. -
deps: Moverolldownto a dev dependency (#1651) -
deps: Replacecross-spawnwithtinyexec(#1651) -
deps: Replacedeathpackage with internal implementation (#1651) -
deps: Updatevite-plugin-cjs-interopdependency from^3.0.0to^4.0.3(#1651) -
deps: Replaceescape-string-regexpdependency with nativeRegExp.escape(#1651) -
deps: Replacedebugwithobug(#1651) -
deps: Update@vanilla-extract/vite-plugindependency to^5.2.5(#1651) -
deps: Replacefind-upwithempathic(#1651) -
deps: Replacepretty-msdependency with nativeIntl.DurationFormat(#1651) -
deps: Replaceopenwithtiny-open(#1651) -
deps: Memoize route matching, replacenano-memoizedependency withmemoize(#1651) -
jest: Convert internal file mock to ESM (#1651)The internal file mock used by sku to mock asset imports in Jest tests has been converted to ESM
-
loadable: Shipsku/@loadable/componentas compiled JavaScript instead of TypeScript source (#1651)This entrypoint previously resolved to an uncompiled
.tsfile. It now resolves to a compiled.mjsfile. -
vite: ApplydangerouslySetViteConfigafter internal sku config (#1651)Changes made in
dangerouslySetViteConfigwill now be applied aftersku's internal vite config. This ensures user-configured overrides are honored regardless of the order ofsku's internal vite plugins. -
Updated dependencies [
a5bd7bf]:- @sku-lib/vite@2.0.2