sku 15.12.1 → 15.13.0
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 +36 -0
- package/dist/config/storybook.cjs +28 -5
- package/dist/packages/sku/package.mjs +5 -5
- package/dist/services/bundlerConstants.mjs +5 -0
- package/dist/services/vite/plugins/build.mjs +2 -0
- package/dist/services/vocab/config.mjs +1 -0
- package/dist/services/webpack/config/utils/loaders.mjs +1 -4
- package/dist/webpack-plugin.mjs +23 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# sku
|
|
2
2
|
|
|
3
|
+
## 15.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `webpack`: Add support for Vite-style query parameters when importing SVG files ([#1538](https://github.com/seek-oss/sku/pull/1538))
|
|
8
|
+
|
|
9
|
+
To support migration from webpack to Vite, SVG imports in webpack now support the same `raw`, `inline` and `url` query parameters as Vite. This allows you to specify how the SVG should be imported: as a raw string, a base64 data URL, or an asset URL. See [the image asset docs] for more information.
|
|
10
|
+
|
|
11
|
+
If your application is still using webpack, it is recommended to run the following codemod to automatically migrate all SVG imports to use the `raw` query parameter:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pnpm dlx @sku-lib/codemod svg-import-query-param .
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This will ensure consistent SVG import behaviour when the time comes to migrate your application to Vite. The `url` and `inline` query parameters can also be used, however they aren't a drop-in replacement for the existing import behaviour (i.e. without any query paramters).
|
|
18
|
+
|
|
19
|
+
[the image asset docs]: https://seek-oss.github.io/sku/#/./docs/extra-features?id=importing-image-assets
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- `vite`: Align asset inline limit with webpack ([#1538](https://github.com/seek-oss/sku/pull/1538))
|
|
24
|
+
|
|
25
|
+
To align with sku's webpack config, image assets imported in a Vite app that are smaller than 10,000 bytes will now be inlined as base64-encoded [`data` URLs](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data). Previously the limit was 4,096 bytes.
|
|
26
|
+
|
|
27
|
+
- `vocab`: Set `projectRoot` in vocab config to fix crash with `tinyglobby@0.2.16` ([#1542](https://github.com/seek-oss/sku/pull/1542))
|
|
28
|
+
|
|
29
|
+
## 15.12.2
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Update `vite-plugin-cjs-interop` and `@vitejs/plugin-basic-ssl` dependencies to `vite@8`-compatible versions ([#1531](https://github.com/seek-oss/sku/pull/1531))
|
|
34
|
+
|
|
35
|
+
- Update `svgo-loader` dependency to `^5.0.0` ([#1535](https://github.com/seek-oss/sku/pull/1535))
|
|
36
|
+
|
|
37
|
+
- Update `picomatch` to `^4.0.4` to address CVE-2026-33671 and CVE-2026-33672 ([#1537](https://github.com/seek-oss/sku/pull/1537))
|
|
38
|
+
|
|
3
39
|
## 15.12.1
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -1779,10 +1779,7 @@ const makeExternalCssLoaders = (options) => {
|
|
|
1779
1779
|
};
|
|
1780
1780
|
const makeSvgLoaders = () => [{
|
|
1781
1781
|
loader: require$8.resolve("svgo-loader"),
|
|
1782
|
-
options: { plugins: [{
|
|
1783
|
-
name: "preset-default",
|
|
1784
|
-
params: { overrides: { removeViewBox: false } }
|
|
1785
|
-
}, {
|
|
1782
|
+
options: { plugins: ["preset-default", {
|
|
1786
1783
|
name: "addAttributesToSVGElement",
|
|
1787
1784
|
params: { attributes: [{ focusable: false }] }
|
|
1788
1785
|
}] }
|
|
@@ -1984,6 +1981,10 @@ const validateOptions = (options) => {
|
|
|
1984
1981
|
//#region src/config/targets.json
|
|
1985
1982
|
var browserslistNodeTarget = "node 22.19.0";
|
|
1986
1983
|
|
|
1984
|
+
//#endregion
|
|
1985
|
+
//#region src/services/bundlerConstants.ts
|
|
1986
|
+
const assetsInlineLimitBytes = 1e4;
|
|
1987
|
+
|
|
1987
1988
|
//#endregion
|
|
1988
1989
|
//#region src/services/webpack/config/plugins/skuWebpackPlugin.ts
|
|
1989
1990
|
var SkuWebpackPlugin = class {
|
|
@@ -2087,13 +2088,34 @@ var SkuWebpackPlugin = class {
|
|
|
2087
2088
|
include: this.include,
|
|
2088
2089
|
type: "asset",
|
|
2089
2090
|
generator: { emit: target === "browser" },
|
|
2090
|
-
parser: { dataUrlCondition: { maxSize:
|
|
2091
|
+
parser: { dataUrlCondition: { maxSize: assetsInlineLimitBytes } }
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
test: SVG,
|
|
2095
|
+
include: this.include,
|
|
2096
|
+
type: "asset/source",
|
|
2097
|
+
use: makeSvgLoaders()
|
|
2091
2098
|
},
|
|
2092
2099
|
{
|
|
2093
2100
|
test: SVG,
|
|
2101
|
+
resourceQuery: /raw/,
|
|
2094
2102
|
include: this.include,
|
|
2095
2103
|
type: "asset/source",
|
|
2096
2104
|
use: makeSvgLoaders()
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
test: SVG,
|
|
2108
|
+
resourceQuery: /inline/,
|
|
2109
|
+
include: this.include,
|
|
2110
|
+
type: "asset/inline",
|
|
2111
|
+
use: makeSvgLoaders()
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
test: SVG,
|
|
2115
|
+
resourceQuery: /url/,
|
|
2116
|
+
include: this.include,
|
|
2117
|
+
type: "asset/resource",
|
|
2118
|
+
use: makeSvgLoaders()
|
|
2097
2119
|
}
|
|
2098
2120
|
];
|
|
2099
2121
|
compiler.options.module.rules.push(...rules);
|
|
@@ -2203,6 +2225,7 @@ const getVocabConfig = ({ languages }) => {
|
|
|
2203
2225
|
return null;
|
|
2204
2226
|
}
|
|
2205
2227
|
const result = {
|
|
2228
|
+
projectRoot: process.cwd(),
|
|
2206
2229
|
devLanguage: "en",
|
|
2207
2230
|
ignore: ["node_modules/sku/**", "node_modules/vocab/**"],
|
|
2208
2231
|
languages,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "15.
|
|
2
|
+
var version = "15.13.0";
|
|
3
3
|
var package_default = {
|
|
4
4
|
name: "sku",
|
|
5
5
|
version,
|
|
@@ -92,7 +92,7 @@ var package_default = {
|
|
|
92
92
|
"@vanilla-extract/jest-transform": "catalog:",
|
|
93
93
|
"@vanilla-extract/vite-plugin": "catalog:",
|
|
94
94
|
"@vanilla-extract/webpack-plugin": "catalog:",
|
|
95
|
-
"@vitejs/plugin-basic-ssl": "^2.
|
|
95
|
+
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
|
96
96
|
"@vitejs/plugin-react": "^6.0.1",
|
|
97
97
|
"@vocab/core": "^1.6.2",
|
|
98
98
|
"@vocab/phrase": "^2.2.0",
|
|
@@ -142,7 +142,7 @@ var package_default = {
|
|
|
142
142
|
"node-html-parser": "^7.0.1",
|
|
143
143
|
"open": "^10.1.2",
|
|
144
144
|
"path-to-regexp": "^6.3.0",
|
|
145
|
-
"picomatch": "^4.0.
|
|
145
|
+
"picomatch": "^4.0.4",
|
|
146
146
|
"postcss": "^8.5.8",
|
|
147
147
|
"postcss-loader": "^8.0.0",
|
|
148
148
|
"prettier": "~3.8.0",
|
|
@@ -155,11 +155,11 @@ var package_default = {
|
|
|
155
155
|
"serialize-javascript": "^7.0.4",
|
|
156
156
|
"serve-handler": "^6.1.3",
|
|
157
157
|
"sort-package-json": "^3.6.0",
|
|
158
|
-
"svgo-loader": "^
|
|
158
|
+
"svgo-loader": "^5.0.0",
|
|
159
159
|
"terser-webpack-plugin": "^5.1.4",
|
|
160
160
|
"typescript": "~5.9.0",
|
|
161
161
|
"vite": "catalog:",
|
|
162
|
-
"vite-plugin-cjs-interop": "^
|
|
162
|
+
"vite-plugin-cjs-interop": "^3.0.0",
|
|
163
163
|
"vite-tsconfig-paths": "^6.1.1",
|
|
164
164
|
"webpack": "^5.105.4",
|
|
165
165
|
"webpack-bundle-analyzer": "^5.1.1",
|
|
@@ -2,6 +2,7 @@ import { __require } from "../../../_virtual/rolldown_runtime.mjs";
|
|
|
2
2
|
import { makePluginName } from "../helpers/makePluginName.mjs";
|
|
3
3
|
import { createOutDir, renderEntryChunkName } from "../helpers/bundleConfig.mjs";
|
|
4
4
|
import browserslistToEsbuild from "../helpers/browserslist-to-esbuild.mjs";
|
|
5
|
+
import { assetsInlineLimitBytes } from "../../bundlerConstants.mjs";
|
|
5
6
|
import { createVocabChunks } from "@vocab/vite/chunks";
|
|
6
7
|
|
|
7
8
|
//#region src/services/vite/plugins/build.ts
|
|
@@ -16,6 +17,7 @@ const buildPlugin = ({ skuContext }) => {
|
|
|
16
17
|
build: {
|
|
17
18
|
target: browserslistToEsbuild(skuContext.supportedBrowsers),
|
|
18
19
|
assetsDir: "",
|
|
20
|
+
assetsInlineLimit: assetsInlineLimitBytes,
|
|
19
21
|
rolldownOptions: { output: { codeSplitting: { groups: [{ name: (id, ctx) => {
|
|
20
22
|
const languageChunkName = createVocabChunks(id, ctx);
|
|
21
23
|
if (languageChunkName) return languageChunkName;
|
|
@@ -25,10 +25,7 @@ const makeExternalCssLoaders = (options) => {
|
|
|
25
25
|
};
|
|
26
26
|
const makeSvgLoaders = () => [{
|
|
27
27
|
loader: require.resolve("svgo-loader"),
|
|
28
|
-
options: { plugins: [{
|
|
29
|
-
name: "preset-default",
|
|
30
|
-
params: { overrides: { removeViewBox: false } }
|
|
31
|
-
}, {
|
|
28
|
+
options: { plugins: ["preset-default", {
|
|
32
29
|
name: "addAttributesToSVGElement",
|
|
33
30
|
params: { attributes: [{ focusable: false }] }
|
|
34
31
|
}] }
|
package/dist/webpack-plugin.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defaultCompilePackages, detectedCompilePackagePaths } from "./context/defaultCompilePackages.mjs";
|
|
2
2
|
import { rootResolutionFileExtensions } from "./config/fileResolutionExtensions.mjs";
|
|
3
3
|
import { browserslistNodeTarget } from "./config/targets.mjs";
|
|
4
|
+
import { assetsInlineLimitBytes } from "./services/bundlerConstants.mjs";
|
|
4
5
|
import { makeExternalCssLoaders, makeJsLoaders, makeSvgLoaders } from "./services/webpack/config/utils/loaders.mjs";
|
|
5
6
|
import { resolvePackage } from "./services/webpack/config/utils/resolvePackage.mjs";
|
|
6
7
|
import { IMAGE, JAVASCRIPT, SVG, TYPESCRIPT } from "./services/webpack/config/utils/index.mjs";
|
|
@@ -111,13 +112,34 @@ var SkuWebpackPlugin = class {
|
|
|
111
112
|
include: this.include,
|
|
112
113
|
type: "asset",
|
|
113
114
|
generator: { emit: target === "browser" },
|
|
114
|
-
parser: { dataUrlCondition: { maxSize:
|
|
115
|
+
parser: { dataUrlCondition: { maxSize: assetsInlineLimitBytes } }
|
|
115
116
|
},
|
|
116
117
|
{
|
|
117
118
|
test: SVG,
|
|
118
119
|
include: this.include,
|
|
119
120
|
type: "asset/source",
|
|
120
121
|
use: makeSvgLoaders()
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
test: SVG,
|
|
125
|
+
resourceQuery: /raw/,
|
|
126
|
+
include: this.include,
|
|
127
|
+
type: "asset/source",
|
|
128
|
+
use: makeSvgLoaders()
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
test: SVG,
|
|
132
|
+
resourceQuery: /inline/,
|
|
133
|
+
include: this.include,
|
|
134
|
+
type: "asset/inline",
|
|
135
|
+
use: makeSvgLoaders()
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
test: SVG,
|
|
139
|
+
resourceQuery: /url/,
|
|
140
|
+
include: this.include,
|
|
141
|
+
type: "asset/resource",
|
|
142
|
+
use: makeSvgLoaders()
|
|
121
143
|
}
|
|
122
144
|
];
|
|
123
145
|
compiler.options.module.rules.push(...rules);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sku",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.13.0",
|
|
4
4
|
"description": "Front-end development toolkit, powered by Webpack, Babel, Vanilla Extract and Jest",
|
|
5
5
|
"types": "./dist/index.d.mts",
|
|
6
6
|
"bin": {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@vanilla-extract/jest-transform": "^1.1.21",
|
|
97
97
|
"@vanilla-extract/vite-plugin": "^5.2.1",
|
|
98
98
|
"@vanilla-extract/webpack-plugin": "^2.3.26",
|
|
99
|
-
"@vitejs/plugin-basic-ssl": "^2.
|
|
99
|
+
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
|
100
100
|
"@vitejs/plugin-react": "^6.0.1",
|
|
101
101
|
"@vocab/core": "^1.6.2",
|
|
102
102
|
"@vocab/phrase": "^2.2.0",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"node-html-parser": "^7.0.1",
|
|
147
147
|
"open": "^10.1.2",
|
|
148
148
|
"path-to-regexp": "^6.3.0",
|
|
149
|
-
"picomatch": "^4.0.
|
|
149
|
+
"picomatch": "^4.0.4",
|
|
150
150
|
"postcss": "^8.5.8",
|
|
151
151
|
"postcss-loader": "^8.0.0",
|
|
152
152
|
"prettier": "~3.8.0",
|
|
@@ -159,11 +159,11 @@
|
|
|
159
159
|
"serialize-javascript": "^7.0.4",
|
|
160
160
|
"serve-handler": "^6.1.3",
|
|
161
161
|
"sort-package-json": "^3.6.0",
|
|
162
|
-
"svgo-loader": "^
|
|
162
|
+
"svgo-loader": "^5.0.0",
|
|
163
163
|
"terser-webpack-plugin": "^5.1.4",
|
|
164
164
|
"typescript": "~5.9.0",
|
|
165
165
|
"vite": "^8.0.1",
|
|
166
|
-
"vite-plugin-cjs-interop": "^
|
|
166
|
+
"vite-plugin-cjs-interop": "^3.0.0",
|
|
167
167
|
"vite-tsconfig-paths": "^6.1.1",
|
|
168
168
|
"webpack": "^5.105.4",
|
|
169
169
|
"webpack-bundle-analyzer": "^5.1.1",
|