sku 16.5.0 → 16.6.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 +31 -0
- package/dist/@loadable/component.mjs +1 -2
- package/dist/_virtual/_rolldown/runtime.mjs +2 -3
- package/dist/bin/sku.mjs +1 -2
- package/dist/config/babel.mjs +1 -2
- package/dist/config/eslint/ignores.mjs +1 -2
- package/dist/config/eslint/importOrder.mjs +1 -2
- package/dist/config/eslint/jsonFiles.mjs +1 -2
- package/dist/config/eslint/plugins/package-json.mjs +1 -2
- package/dist/config/eslint.d.mts +0 -2
- package/dist/config/eslint.mjs +2 -3
- package/dist/config/fileResolutionExtensions.mjs +1 -2
- package/dist/config/prettier.d.mts +0 -2
- package/dist/config/prettier.mjs +1 -2
- package/dist/config/storybook/viteConfig.d.mts +0 -2
- package/dist/config/storybook/viteConfig.mjs +1 -2
- package/dist/config/storybook/webpackConfig.d.mts +0 -2
- package/dist/config/storybook/webpackConfig.mjs +3 -4
- package/dist/config/targets.mjs +1 -2
- package/dist/context/cjsInteropDeps.mjs +1 -2
- package/dist/context/configPath.mjs +1 -2
- package/dist/context/configSchema.mjs +2 -2
- package/dist/context/createSkuContext.mjs +4 -3
- package/dist/context/defaultClientEntry.mjs +1 -2
- package/dist/context/defaultCompilePackages.mjs +1 -2
- package/dist/context/defaultSkuConfig.mjs +2 -2
- package/dist/context/getSiteForHost.mjs +1 -2
- package/dist/context/hosts.mjs +3 -4
- package/dist/context/hostsFile.mjs +2 -3
- package/dist/context/resolveEnvironment.mjs +1 -2
- package/dist/context/validateConfig.mjs +10 -4
- package/dist/context/validatePathAliases.mjs +1 -2
- package/dist/entries/ssr-client.dev.mjs +1 -2
- package/dist/entries/ssr-client.mjs +1 -2
- package/dist/entries/ssr-server.d.mts +0 -2
- package/dist/entries/ssr-server.mjs +2 -3
- package/dist/entries/vite-client.mjs +1 -2
- package/dist/entries/vite-render.d.mts +0 -2
- package/dist/entries/vite-render.mjs +1 -2
- package/dist/jest/file-mock.d.mts +0 -2
- package/dist/jest/file-mock.mjs +1 -2
- package/dist/jest/js-transform.d.mts +0 -2
- package/dist/jest/js-transform.mjs +1 -2
- package/dist/jest/ts-transform.d.mts +0 -2
- package/dist/jest/ts-transform.mjs +1 -2
- package/dist/jest-preset.d.mts +0 -2
- package/dist/jest-preset.mjs +1 -2
- package/dist/node_modules/.pnpm/ansi-regex@6.5.0/node_modules/ansi-regex/index.mjs +9 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.mjs +1 -2
- package/dist/node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.mjs +1 -2
- package/dist/node_modules/.pnpm/{get-east-asian-width@1.6.0 → get-east-asian-width@1.7.0}/node_modules/get-east-asian-width/index.mjs +3 -4
- package/dist/node_modules/.pnpm/{get-east-asian-width@1.6.0 → get-east-asian-width@1.7.0}/node_modules/get-east-asian-width/lookup-data.mjs +18 -13
- package/dist/node_modules/.pnpm/{get-east-asian-width@1.6.0 → get-east-asian-width@1.7.0}/node_modules/get-east-asian-width/lookup.mjs +3 -4
- package/dist/node_modules/.pnpm/{get-east-asian-width@1.6.0 → get-east-asian-width@1.7.0}/node_modules/get-east-asian-width/utilities.mjs +1 -2
- package/dist/node_modules/.pnpm/indent-string@5.0.0/node_modules/indent-string/index.mjs +1 -2
- package/dist/node_modules/.pnpm/package-manager-detector@0.2.11/node_modules/package-manager-detector/dist/commands.mjs +1 -2
- package/dist/node_modules/.pnpm/package-manager-detector@0.2.11/node_modules/package-manager-detector/dist/constants.mjs +1 -2
- package/dist/node_modules/.pnpm/package-manager-detector@0.2.11/node_modules/package-manager-detector/dist/detect.mjs +2 -3
- package/dist/node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/index.mjs +1 -2
- package/dist/node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/macro.mjs +1 -2
- package/dist/node_modules/.pnpm/{rolldown@1.2.2 → rolldown@1.2.16}/node_modules/rolldown/dist/filter-index.mjs +1 -2
- package/dist/node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.mjs +2 -3
- package/dist/node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.mjs +2 -3
- package/dist/node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.mjs +2 -3
- package/dist/openBrowser.mjs +2 -3
- package/dist/package.mjs +1 -2
- package/dist/packages/sku/package.mjs +2 -3
- package/dist/private/utils/src/console/banner.mjs +2 -3
- package/dist/private/utils/src/console/styles.mjs +1 -2
- package/dist/private/utils/src/filesystem/cwd.mjs +1 -2
- package/dist/private/utils/src/filesystem/index.mjs +1 -2
- package/dist/private/utils/src/packageManager/index.mjs +1 -2
- package/dist/private/utils/src/packageManager/packageManager.mjs +1 -2
- package/dist/private/utils/src/packageManager/skuPackageManager.mjs +0 -1
- package/dist/private/utils/src/path/toPosixPath.mjs +1 -2
- package/dist/private/utils/src/serverUrls.mjs +1 -2
- package/dist/program/commands/build/build.action.mjs +1 -2
- package/dist/program/commands/build/build.command.mjs +1 -2
- package/dist/program/commands/build/vite-build-handler.mjs +6 -7
- package/dist/program/commands/build/webpack-build-handler.mjs +18 -10
- package/dist/program/commands/build-ssr/build-ssr.action.mjs +14 -7
- package/dist/program/commands/build-ssr/build-ssr.command.mjs +1 -2
- package/dist/program/commands/configure/configure.action.mjs +1 -2
- package/dist/program/commands/configure/configure.command.mjs +1 -2
- package/dist/program/commands/format/format.action.mjs +3 -4
- package/dist/program/commands/format/format.command.mjs +1 -2
- package/dist/program/commands/index.mjs +1 -2
- package/dist/program/commands/lint/lint.action.mjs +5 -6
- package/dist/program/commands/lint/lint.command.mjs +1 -2
- package/dist/program/commands/serve/serve.action.mjs +42 -18
- package/dist/program/commands/serve/serve.command.mjs +1 -2
- package/dist/program/commands/setup-hosts/setup-hosts.action.mjs +2 -3
- package/dist/program/commands/setup-hosts/setup-hosts.command.mjs +1 -2
- package/dist/program/commands/start/start.action.mjs +5 -6
- package/dist/program/commands/start/start.command.mjs +2 -3
- package/dist/program/commands/start/vite-start-handler.mjs +2 -3
- package/dist/program/commands/start/webpack-start-handler.mjs +6 -7
- package/dist/program/commands/start-ssr/start-ssr.action.mjs +1 -2
- package/dist/program/commands/start-ssr/start-ssr.command.mjs +1 -2
- package/dist/program/commands/start-ssr/webpack-start-ssr-handler.mjs +8 -9
- package/dist/program/commands/test/jest-test-handler.mjs +1 -2
- package/dist/program/commands/test/test.action.mjs +1 -2
- package/dist/program/commands/test/test.command.mjs +1 -2
- package/dist/program/commands/test/vitest-test-handler.mjs +2 -3
- package/dist/program/commands/translations/commands/compile/compile.action.mjs +3 -4
- package/dist/program/commands/translations/commands/compile/compile.command.mjs +1 -2
- package/dist/program/commands/translations/commands/index.mjs +1 -2
- package/dist/program/commands/translations/commands/pull/pull.action.mjs +3 -4
- package/dist/program/commands/translations/commands/pull/pull.command.mjs +1 -2
- package/dist/program/commands/translations/commands/push/auto-translate.option.mjs +1 -2
- package/dist/program/commands/translations/commands/push/delete-unused-keys.option.mjs +1 -2
- package/dist/program/commands/translations/commands/push/push.action.mjs +3 -4
- package/dist/program/commands/translations/commands/push/push.command.mjs +1 -2
- package/dist/program/commands/translations/commands/validate/validate.action.mjs +3 -4
- package/dist/program/commands/translations/commands/validate/validate.command.mjs +1 -2
- package/dist/program/commands/translations/helpers/translation-helpers.mjs +1 -2
- package/dist/program/commands/translations/translations.command.mjs +1 -2
- package/dist/program/hooks/preAction/preAction.hook.mjs +1 -2
- package/dist/program/index.mjs +2 -3
- package/dist/program/options/config.option.mjs +1 -2
- package/dist/program/options/convertLoadable.option.mjs +1 -2
- package/dist/program/options/debug.option.mjs +1 -2
- package/dist/program/options/environment.option.mjs +1 -2
- package/dist/program/options/list-urls.mjs +1 -2
- package/dist/program/options/port.option.mjs +1 -2
- package/dist/program/options/site.option.mjs +1 -2
- package/dist/program/options/stats.option.mjs +0 -1
- package/dist/program/options/watch.option.mjs +1 -2
- package/dist/runtime.d.mts +1 -1
- package/dist/services/bundlerConstants.mjs +1 -2
- package/dist/services/eslint/lint.mjs +1 -2
- package/dist/services/eslint/runESLint.mjs +2 -3
- package/dist/services/packageManager/getPnpmConfigDependencies.mjs +1 -2
- package/dist/services/packageManager/pnpmConfig.mjs +1 -2
- package/dist/services/prettier.mjs +4 -5
- package/dist/services/serverManager.mjs +1 -2
- package/dist/services/telemetry/index.mjs +1 -2
- package/dist/services/telemetry/metricsMeasurers.mjs +1 -2
- package/dist/services/telemetry/provider.mjs +1 -2
- package/dist/services/typescript/runTsc.mjs +2 -3
- package/dist/services/typescript/tsconfig.mjs +35 -26
- package/dist/services/vite/helpers/allocateClientPort.mjs +1 -2
- package/dist/services/vite/helpers/browserslist-to-esbuild.mjs +1 -2
- package/dist/services/vite/helpers/bundleConfig.mjs +11 -6
- package/dist/services/vite/helpers/config/createConfig.mjs +1 -2
- package/dist/services/vite/helpers/config/dependencyGraph.mjs +1 -2
- package/dist/services/vite/helpers/html/createPreRenderedHtml.mjs +1 -2
- package/dist/services/vite/helpers/makePluginName.mjs +1 -2
- package/dist/services/vite/helpers/prerender/prerenderConcurrently.mjs +15 -8
- package/dist/services/vite/helpers/printServerUrls.mjs +2 -3
- package/dist/services/vite/helpers/resolveManifestModuleId.mjs +1 -2
- package/dist/services/vite/helpers/serializeConfig.mjs +1 -2
- package/dist/services/vite/index.mjs +1 -2
- package/dist/services/vite/plugins/build.mjs +11 -9
- package/dist/services/vite/plugins/bundleAnalyzer.mjs +1 -2
- package/dist/services/vite/plugins/config.mjs +2 -3
- package/dist/services/vite/plugins/dangerouslySetViteConfig.mjs +1 -2
- package/dist/services/vite/plugins/devServer.mjs +2 -3
- package/dist/services/vite/plugins/entrySideEffects.mjs +2 -3
- package/dist/services/vite/plugins/esbuild/convertLoadableDepOptimizePlugin.mjs +2 -3
- package/dist/services/vite/plugins/esbuild/fixViteVanillaExtractDepScanPlugin.mjs +1 -2
- package/dist/services/vite/plugins/httpsDevServer.mjs +1 -2
- package/dist/services/vite/plugins/lazyRouteModuleId/injectLazyRouteModuleId.mjs +1 -2
- package/dist/services/vite/plugins/lazyRouteModuleId/lazyRouteModuleIdPlugin.mjs +1 -2
- package/dist/services/vite/plugins/middleware.mjs +4 -5
- package/dist/services/vite/plugins/polyfills.mjs +2 -3
- package/dist/services/vite/plugins/preloadPlugin/helpers/constants.mjs +1 -2
- package/dist/services/vite/plugins/preloadPlugin/helpers/convertWebpackToViteImport.mjs +1 -2
- package/dist/services/vite/plugins/preloadPlugin/helpers/getViteLoadableSpecifierName.mjs +1 -2
- package/dist/services/vite/plugins/preloadPlugin/helpers/getWebpackLoadableSpecifierName.mjs +1 -2
- package/dist/services/vite/plugins/preloadPlugin/helpers/injectModuleID.mjs +1 -2
- package/dist/services/vite/plugins/preloadPlugin/helpers/rewriteWebpackLoadableImports.mjs +1 -2
- package/dist/services/vite/plugins/preloadPlugin/preloadPlugin.mjs +2 -3
- package/dist/services/vite/plugins/setNoExternal.mjs +2 -3
- package/dist/services/vite/plugins/ssr.mjs +10 -8
- package/dist/services/vite/plugins/ssrCss/collect.mjs +1 -2
- package/dist/services/vite/plugins/ssrCss/constants.mjs +1 -2
- package/dist/services/vite/plugins/ssrCss/plugin.mjs +2 -3
- package/dist/services/vite/plugins/static.mjs +8 -6
- package/dist/services/vite/plugins/stripServerConfig.mjs +1 -2
- package/dist/services/vite/plugins/telemetry.mjs +2 -3
- package/dist/services/vite/plugins/telemetryClients.mjs +2 -3
- package/dist/services/vite/plugins/telemetryEvents.mjs +1 -2
- package/dist/services/vite/skuPlugin.mjs +1 -2
- package/dist/services/vite/ssr/abortReason.mjs +1 -2
- package/dist/services/vite/ssr/bindCommit.mjs +1 -2
- package/dist/services/vite/ssr/bootstrap.mjs +1 -2
- package/dist/services/vite/ssr/build.mjs +8 -6
- package/dist/services/vite/ssr/buildSiteRouteTrees.mjs +1 -2
- package/dist/services/vite/ssr/buildSiteStaticHandlers.mjs +1 -2
- package/dist/services/vite/ssr/clientManifestPath.mjs +3 -4
- package/dist/services/vite/ssr/collectRouteHeaders.mjs +1 -2
- package/dist/services/vite/ssr/createDevSsrServer.mjs +3 -4
- package/dist/services/vite/ssr/createDocumentAttempt.mjs +1 -2
- package/dist/services/vite/ssr/createHtmlRenderMiddleware.mjs +2 -3
- package/dist/services/vite/ssr/createInsertHtmlTransform.mjs +1 -2
- package/dist/services/vite/ssr/createSsrRequestContextStore.mjs +1 -2
- package/dist/services/vite/ssr/createWebRequest.mjs +1 -2
- package/dist/services/vite/ssr/csp.mjs +1 -2
- package/dist/services/vite/ssr/defineEntry.d.mts +0 -2
- package/dist/services/vite/ssr/defineEntry.mjs +1 -2
- package/dist/services/vite/ssr/documentAssets.d.mts +0 -2
- package/dist/services/vite/ssr/documentAssets.mjs +1 -2
- package/dist/services/vite/ssr/entryTypeExtractors.d.mts +0 -2
- package/dist/services/vite/ssr/getModuleIds.mjs +1 -2
- package/dist/services/vite/ssr/getStaticContextFromError.mjs +1 -2
- package/dist/services/vite/ssr/insertHtml.d.mts +0 -2
- package/dist/services/vite/ssr/insertHtml.mjs +1 -2
- package/dist/services/vite/ssr/installSsrRequestContextStorage.mjs +1 -2
- package/dist/services/vite/ssr/listen.mjs +1 -2
- package/dist/services/vite/ssr/normaliseClientContext.mjs +1 -2
- package/dist/services/vite/ssr/preloadRoute.d.mts +0 -2
- package/dist/services/vite/ssr/preloadRoute.mjs +1 -2
- package/dist/services/vite/ssr/readRoutesEntry.mjs +1 -2
- package/dist/services/vite/ssr/render.mjs +2 -3
- package/dist/services/vite/ssr/requestContext.d.mts +0 -2
- package/dist/services/vite/ssr/requestContext.mjs +1 -2
- package/dist/services/vite/ssr/resolveAssets.d.mts +0 -2
- package/dist/services/vite/ssr/resolveAssets.mjs +2 -3
- package/dist/services/vite/ssr/resolveConfigSiteNames.mjs +1 -2
- package/dist/services/vite/ssr/selectForSite.mjs +1 -2
- package/dist/services/vite/ssr/sendResponse.mjs +1 -2
- package/dist/services/vite/ssr/skuContext.d.mts +0 -2
- package/dist/services/vite/ssr/skuContext.mjs +1 -2
- package/dist/services/vite/ssr/ssrRequestContextMiddleware.mjs +1 -2
- package/dist/services/vite/ssr/ssrServerShared.mjs +0 -1
- package/dist/services/vite/ssr/start.mjs +1 -2
- package/dist/services/vite/ssr/startProductionSsrServer.mjs +2 -3
- package/dist/services/vite/ssr/streamDocument.mjs +1 -2
- package/dist/services/vite/ssr/types.d.mts +1 -3
- package/dist/services/vite/ssr/wrapPipeWithInsertHtml.mjs +1 -2
- package/dist/services/vite/static/build.mjs +18 -6
- package/dist/services/vite/static/start.mjs +2 -3
- package/dist/services/vocab/config.mjs +1 -2
- package/dist/services/vocab/runVocab.mjs +1 -2
- package/dist/services/webpack/config/cache.mjs +1 -2
- package/dist/services/webpack/config/plugins/bundleAnalyzer.mjs +1 -2
- package/dist/services/webpack/config/plugins/createHtmlRenderPlugin.mjs +8 -4
- package/dist/services/webpack/config/plugins/metricsPlugin.mjs +1 -2
- package/dist/services/webpack/config/plugins/validateOptions.d.mts +0 -2
- package/dist/services/webpack/config/plugins/validateOptions.mjs +1 -2
- package/dist/services/webpack/config/resolveModules.mjs +1 -2
- package/dist/services/webpack/config/sourceMaps.mjs +1 -2
- package/dist/services/webpack/config/statsConfig.mjs +1 -2
- package/dist/services/webpack/config/utils/index.mjs +1 -2
- package/dist/services/webpack/config/utils/loaders.mjs +1 -2
- package/dist/services/webpack/config/utils/resolvePackage.mjs +1 -2
- package/dist/services/webpack/config/webpack.config.mjs +12 -8
- package/dist/services/webpack/config/webpack.config.ssr.mjs +15 -11
- package/dist/services/webpack/entry/csp.mjs +1 -2
- package/dist/services/webpack/entry/makeExtractor.mjs +1 -2
- package/dist/services/webpack/entry/render/render-to-string.mjs +1 -2
- package/dist/services/webpack/entry/server/server.mjs +2 -3
- package/dist/services/webpack/runWebpack.mjs +1 -2
- package/dist/types/types.d.mts +18 -3
- package/dist/utils/allocatePort.mjs +1 -2
- package/dist/utils/buildFileUtils.mjs +17 -7
- package/dist/utils/certificate.mjs +2 -3
- package/dist/utils/configure.mjs +3 -4
- package/dist/utils/configureApp.mjs +3 -4
- package/dist/utils/constants/clientContextKey.mjs +1 -2
- package/dist/utils/copyDirContents.mjs +1 -2
- package/dist/utils/coverageFolder.mjs +3 -0
- package/dist/utils/createServer.mjs +1 -2
- package/dist/utils/csp.mjs +1 -2
- package/dist/utils/debug.mjs +1 -2
- package/dist/utils/detectUnnecessaryPolyfillsFromConfig.mjs +1 -2
- package/dist/utils/detectUnnecessaryPolyfillsFromDependencies.mjs +1 -2
- package/dist/utils/distDirectories.mjs +17 -0
- package/dist/utils/error-guards.mjs +1 -2
- package/dist/utils/execAsync.mjs +1 -2
- package/dist/utils/exists.mjs +1 -2
- package/dist/utils/formatMs.mjs +1 -2
- package/dist/utils/isCI.mjs +1 -2
- package/dist/utils/language-utils.mjs +6 -5
- package/dist/utils/pathAliasImports.mjs +2 -3
- package/dist/utils/polyfillDetector.mjs +1 -2
- package/dist/utils/polyfillRegistry.mjs +1 -2
- package/dist/utils/polyfillWarnings.mjs +3 -4
- package/dist/utils/resolvePolyfills.mjs +1 -2
- package/dist/utils/routeMatcher.mjs +1 -2
- package/dist/utils/runBin.mjs +1 -2
- package/dist/utils/runLintChecks.mjs +1 -2
- package/dist/utils/suggestScript.mjs +1 -2
- package/dist/utils/validatePeerDeps.mjs +1 -2
- package/dist/utils/validateSkuConfigFormat.mjs +1 -2
- package/dist/utils/warnOnLegacyReact.mjs +1 -2
- package/dist/vite/prerender-worker.mjs +8 -6
- package/dist/webpack/client.mjs +1 -2
- package/dist/webpack/library-render.d.mts +0 -2
- package/dist/webpack/library-render.mjs +1 -2
- package/dist/webpack/render.d.mts +0 -2
- package/dist/webpack/render.mjs +3 -4
- package/dist/webpack/server.mjs +1 -2
- package/dist/webpack-plugin.d.mts +0 -2
- package/dist/webpack-plugin.mjs +3 -4
- package/package.json +2 -2
- package/dist/node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.mjs +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# sku
|
|
2
2
|
|
|
3
|
+
## 16.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `distSubfolders` option ([#1742](https://github.com/seek-oss/sku/pull/1742))
|
|
8
|
+
|
|
9
|
+
When set to `true`, build output is split into a subfolder per intended use, instead of writing everything to the root of `dist`:
|
|
10
|
+
|
|
11
|
+
- Static apps (Vite or webpack): `sku build` writes HTML documents to `dist/rendered` and every other file (including files from `public`) to `dist/client`.
|
|
12
|
+
- Webpack SSR apps: `sku build-ssr` writes client assets (including files from `public`) to `dist/client` and the server bundle to `dist/server`.
|
|
13
|
+
|
|
14
|
+
`sku serve` serves both the default and subfolder static layouts.
|
|
15
|
+
|
|
16
|
+
The option is rejected with `buildType: 'ssr'`, whose output is already split into `dist/client` and `dist/server`.
|
|
17
|
+
When it is enabled, `public` must not contain `.html` files.
|
|
18
|
+
|
|
19
|
+
This option defaults to `false`, and will default to `true` in a future major release.
|
|
20
|
+
|
|
21
|
+
`client`, `rendered` and `server` are now reserved and can't be used as `environments` names, regardless of whether the option is enabled.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Fix rolldown `codeSplitting` warning ([#1746](https://github.com/seek-oss/sku/pull/1746))
|
|
26
|
+
|
|
27
|
+
- `sku lint`: Exclude sku's generated output from TypeScript type checking ([#1744](https://github.com/seek-oss/sku/pull/1744))
|
|
28
|
+
|
|
29
|
+
The generated `tsconfig.json` now excludes the build `target` directory, `coverage` and `report`.
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`abd8fc6`](https://github.com/seek-oss/sku/commit/abd8fc66510267f05b644ecbf2e0a88d9f93812c)]:
|
|
32
|
+
- @sku-lib/vite@2.0.4
|
|
33
|
+
|
|
3
34
|
## 16.5.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
11
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
12
|
key = keys[i];
|
|
@@ -21,5 +21,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
value: mod,
|
|
22
22
|
enumerable: true
|
|
23
23
|
}) : target, mod));
|
|
24
|
-
//#endregion
|
|
25
24
|
export { __commonJSMin, __toESM };
|
package/dist/bin/sku.mjs
CHANGED
package/dist/config/babel.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
|
|
2
|
+
// src/config/babel.ts
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
4
|
var babel_default = ({ target, lang = "js", browserslist, displayNamesProd = false, removeAssertionsInProduction = true, hot = false }) => {
|
|
5
5
|
const isBrowser = target === "browser";
|
|
@@ -50,5 +50,4 @@ var babel_default = ({ target, lang = "js", browserslist, displayNamesProd = fal
|
|
|
50
50
|
plugins
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
53
|
export { babel_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/config/eslint/ignores.ts
|
|
2
2
|
/**
|
|
3
3
|
* Create a new ESLint ignores configuration object
|
|
4
4
|
*/
|
|
@@ -16,5 +16,4 @@ const createEslintIgnoresConfig = ({ hasLanguagesConfig, target }) => {
|
|
|
16
16
|
"**/pnpm-lock.yaml"
|
|
17
17
|
].filter(Boolean) };
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { createEslintIgnoresConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/config/eslint/importOrder.ts
|
|
2
2
|
const importOrderConfig = { rules: { "import-x/order": ["error", {
|
|
3
3
|
"newlines-between": "always",
|
|
4
4
|
alphabetize: { order: "asc" },
|
|
@@ -17,5 +17,4 @@ const importOrderConfig = { rules: { "import-x/order": ["error", {
|
|
|
17
17
|
patternOptions: { matchBase: true }
|
|
18
18
|
}]
|
|
19
19
|
}] } };
|
|
20
|
-
//#endregion
|
|
21
20
|
export { importOrderConfig };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsonProcessor, packageJsonPlugin } from "./plugins/package-json.mjs";
|
|
2
|
-
|
|
2
|
+
// src/config/eslint/jsonFiles.ts
|
|
3
3
|
const createJsonFilesConfig = () => [{
|
|
4
4
|
plugins: { "package-json": packageJsonPlugin },
|
|
5
5
|
files: ["**/package.json"],
|
|
6
6
|
rules: { "package-json/sort": "error" },
|
|
7
7
|
processor: jsonProcessor
|
|
8
8
|
}];
|
|
9
|
-
//#endregion
|
|
10
9
|
export { createJsonFilesConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { sortPackageJson } from "sort-package-json";
|
|
3
|
-
|
|
3
|
+
// src/config/eslint/plugins/package-json.ts
|
|
4
4
|
const sortRule = {
|
|
5
5
|
meta: {
|
|
6
6
|
docs: { description: "Enforce package.json sorting" },
|
|
@@ -53,5 +53,4 @@ const jsonProcessor = {
|
|
|
53
53
|
supportsAutofix: true
|
|
54
54
|
};
|
|
55
55
|
const packageJsonPlugin = { rules: { sort: sortRule } };
|
|
56
|
-
//#endregion
|
|
57
56
|
export { jsonProcessor, packageJsonPlugin };
|
package/dist/config/eslint.d.mts
CHANGED
package/dist/config/eslint.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getSkuContext } from "../context/createSkuContext.mjs";
|
|
2
1
|
import { importOrderConfig } from "./eslint/importOrder.mjs";
|
|
3
2
|
import { createEslintIgnoresConfig } from "./eslint/ignores.mjs";
|
|
3
|
+
import { getSkuContext } from "../context/createSkuContext.mjs";
|
|
4
4
|
import { createJsonFilesConfig } from "./eslint/jsonFiles.mjs";
|
|
5
|
-
|
|
5
|
+
// src/config/eslint/config.ts
|
|
6
6
|
const createEslintConfig = async ({ configPath } = {}) => {
|
|
7
7
|
const { eslintDecorator, eslintIgnore, languages, paths, testRunner } = await getSkuContext({ configPath });
|
|
8
8
|
const { relativeTarget } = paths;
|
|
@@ -23,5 +23,4 @@ async function importEslintConfig({ testRunner = "jest" }) {
|
|
|
23
23
|
if (testRunner === "vitest") return import("eslint-config-seek/vitest");
|
|
24
24
|
return import("eslint-config-seek");
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { createEslintConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/config/fileResolutionExtensions.ts
|
|
2
2
|
const extensions = {
|
|
3
3
|
js: [
|
|
4
4
|
"mjs",
|
|
@@ -19,5 +19,4 @@ const fileResolutionExtensions = [
|
|
|
19
19
|
".json",
|
|
20
20
|
...extensions.ts.map(prependDot)
|
|
21
21
|
];
|
|
22
|
-
//#endregion
|
|
23
22
|
export { extensions, fileResolutionExtensions };
|
package/dist/config/prettier.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fixViteVanillaExtractDepScanPlugin } from "../../services/vite/plugins/esbuild/fixViteVanillaExtractDepScanPlugin.mjs";
|
|
2
2
|
import { mergeConfig } from "vite";
|
|
3
3
|
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
4
|
-
|
|
4
|
+
// src/config/storybook/viteConfig.ts
|
|
5
5
|
const nodeEnvByStorybookConfigType = {
|
|
6
6
|
PRODUCTION: "production",
|
|
7
7
|
DEVELOPMENT: "development"
|
|
@@ -18,5 +18,4 @@ const viteFinal = (config, { configType }) => {
|
|
|
18
18
|
optimizeDeps: { rolldownOptions: { plugins: [fixViteVanillaExtractDepScanPlugin()] } }
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { viteFinal };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Configuration } from "webpack";
|
|
2
2
|
import { StorybookConfig } from "@storybook/react-webpack5";
|
|
3
|
-
//#region src/config/storybook/webpackConfig.d.ts
|
|
4
3
|
interface WebpackOptions {
|
|
5
4
|
configType?: 'PRODUCTION' | 'DEVELOPMENT' | undefined;
|
|
6
5
|
}
|
|
7
6
|
type AsyncWebpackFinal = (configuration: Configuration, webpackOptions: WebpackOptions) => Promise<Configuration>;
|
|
8
7
|
declare const webpackFinal: AsyncWebpackFinal;
|
|
9
8
|
declare const babel: NonNullable<StorybookConfig['babel']>;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { babel, webpackFinal };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { makeWebpackConfig } from "../../services/webpack/config/webpack.config.mjs";
|
|
2
|
+
import { resolvePackage } from "../../services/webpack/config/utils/resolvePackage.mjs";
|
|
1
3
|
import { getSkuContext } from "../../context/createSkuContext.mjs";
|
|
2
4
|
import babel_default from "../babel.mjs";
|
|
3
|
-
import { resolvePackage } from "../../services/webpack/config/utils/resolvePackage.mjs";
|
|
4
|
-
import { makeWebpackConfig } from "../../services/webpack/config/webpack.config.mjs";
|
|
5
5
|
import { merge } from "webpack-merge";
|
|
6
|
-
|
|
6
|
+
// src/config/storybook/webpackConfig.ts
|
|
7
7
|
const webpackFinal = async (config, { configType }) => makeStorybookWebpackConfig(config, { isDevServer: configType === "DEVELOPMENT" });
|
|
8
8
|
const babel = async () => babel_default({
|
|
9
9
|
target: "browser",
|
|
@@ -41,5 +41,4 @@ const makeStorybookWebpackConfig = async (config, { isDevServer }) => {
|
|
|
41
41
|
stats: "errors-only"
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { babel, webpackFinal };
|
package/dist/config/targets.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { requireFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
|
2
2
|
import "../private/utils/src/index.mjs";
|
|
3
3
|
import { createDebug } from "obug";
|
|
4
4
|
import { intersects } from "semver";
|
|
5
|
-
|
|
5
|
+
// src/context/cjsInteropDeps.ts
|
|
6
6
|
const log = createDebug("sku:cjsInteropDependencies");
|
|
7
7
|
const getCjsInteropDeps = ({ dependsOnApolloClient, cjsInteropDependencies }) => {
|
|
8
8
|
const fallbackCjsInteropDependencies = {
|
|
@@ -28,5 +28,4 @@ const getCjsInteropDeps = ({ dependsOnApolloClient, cjsInteropDependencies }) =>
|
|
|
28
28
|
return fallbackCjsInteropDependencies;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { getCjsInteropDeps };
|
|
@@ -4,7 +4,7 @@ import "../private/utils/src/index.mjs";
|
|
|
4
4
|
import "../private/utils/src/console/index.mjs";
|
|
5
5
|
import { createDebug } from "obug";
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
7
|
-
|
|
7
|
+
// src/context/configPath.ts
|
|
8
8
|
const debug = createDebug("sku:config");
|
|
9
9
|
const supportedSkuConfigExtensions = [
|
|
10
10
|
"ts",
|
|
@@ -40,5 +40,4 @@ const resolveAppSkuConfigPath = ({ configPath }) => {
|
|
|
40
40
|
debug(`Failed to find a supported ${strong("sku.config")} file (supported formats are ${supportedSkuConfigExtensions.map((ext) => `sku.config.${ext}`).join(", ")})`);
|
|
41
41
|
return null;
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { resolveAppSkuConfigPath };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Validator from "fastest-validator";
|
|
2
|
-
|
|
2
|
+
// src/context/configSchema.ts
|
|
3
3
|
const validator = new Validator();
|
|
4
4
|
const languagesToCompile = {
|
|
5
5
|
optional: true,
|
|
@@ -179,6 +179,7 @@ var configSchema_default = validator.compile({
|
|
|
179
179
|
type: "boolean",
|
|
180
180
|
optional: true
|
|
181
181
|
},
|
|
182
|
+
distSubfolders: { type: "boolean" },
|
|
182
183
|
httpsDevServer: { type: "boolean" },
|
|
183
184
|
devServerMiddleware: {
|
|
184
185
|
type: "string",
|
|
@@ -197,5 +198,4 @@ var configSchema_default = validator.compile({
|
|
|
197
198
|
optional: true
|
|
198
199
|
}
|
|
199
200
|
});
|
|
200
|
-
//#endregion
|
|
201
201
|
export { configSchema_default as default };
|
|
@@ -2,16 +2,16 @@ import { parseCspReportTo } from "../utils/csp.mjs";
|
|
|
2
2
|
import { getPathFromCwd, requireFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
3
3
|
import "../private/utils/src/index.mjs";
|
|
4
4
|
import defaultSkuConfig_default from "./defaultSkuConfig.mjs";
|
|
5
|
-
import defaultClientEntry_default from "./defaultClientEntry.mjs";
|
|
6
5
|
import validateConfig_default from "./validateConfig.mjs";
|
|
7
6
|
import { defaultCompilePackages, detectedCompilePackages, detectedCompilePackagesSync } from "./defaultCompilePackages.mjs";
|
|
7
|
+
import defaultClientEntry_default from "./defaultClientEntry.mjs";
|
|
8
8
|
import { resolveAppSkuConfigPath } from "./configPath.mjs";
|
|
9
9
|
import { getCjsInteropDeps } from "./cjsInteropDeps.mjs";
|
|
10
10
|
import { validatePathAliases } from "./validatePathAliases.mjs";
|
|
11
11
|
import { createDebug } from "obug";
|
|
12
12
|
import { existsSync } from "node:fs";
|
|
13
13
|
import { createJiti } from "jiti";
|
|
14
|
-
|
|
14
|
+
// src/context/createSkuContext.ts
|
|
15
15
|
const jiti = createJiti(import.meta.url);
|
|
16
16
|
const debug = createDebug("sku:config");
|
|
17
17
|
let storedSkuContext;
|
|
@@ -145,9 +145,11 @@ const createSkuContext = async ({ configPath, port: portArg, strictPort }) => {
|
|
|
145
145
|
dependsOnApolloClient,
|
|
146
146
|
cjsInteropDependencies
|
|
147
147
|
});
|
|
148
|
+
const distSubfolders = skuConfig.buildType !== "ssr" && !isLibrary && skuConfig.distSubfolders;
|
|
148
149
|
return {
|
|
149
150
|
bundler: skuConfig.bundler,
|
|
150
151
|
buildType: skuConfig.buildType,
|
|
152
|
+
distSubfolders,
|
|
151
153
|
testRunner: skuConfig.testRunner,
|
|
152
154
|
configPath: appConfigPath,
|
|
153
155
|
publicPath,
|
|
@@ -193,5 +195,4 @@ const createSkuContext = async ({ configPath, port: portArg, strictPort }) => {
|
|
|
193
195
|
buildCjsInteropDependencies
|
|
194
196
|
};
|
|
195
197
|
};
|
|
196
|
-
//#endregion
|
|
197
198
|
export { createSkuContext, getSkuContext };
|
|
@@ -9,7 +9,7 @@ import { createDebug } from "obug";
|
|
|
9
9
|
import { dirname, posix } from "node:path";
|
|
10
10
|
import { existsSync, opendirSync } from "node:fs";
|
|
11
11
|
import { fdir } from "fdir";
|
|
12
|
-
|
|
12
|
+
// src/context/defaultCompilePackages.ts
|
|
13
13
|
const debug = createDebug("sku:compilePackages");
|
|
14
14
|
const require = createRequire(import.meta.url);
|
|
15
15
|
const seekDependencyGlob = "**/@seek/*/package.json";
|
|
@@ -97,5 +97,4 @@ const detectedCompilePackages = async () => {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
const defaultCompilePackages = ["sku", "braid-design-system"];
|
|
100
|
-
//#endregion
|
|
101
100
|
export { defaultCompilePackages, detectedCompilePackages, detectedCompilePackagesSync };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import browserslistConfigSeek from "browserslist-config-seek";
|
|
3
|
-
|
|
3
|
+
// src/context/defaultSkuConfig.ts
|
|
4
4
|
const defaultDecorator = (a) => a;
|
|
5
5
|
var defaultSkuConfig_default = {
|
|
6
6
|
bundler: "webpack",
|
|
@@ -31,6 +31,7 @@ var defaultSkuConfig_default = {
|
|
|
31
31
|
libraryFile: void 0,
|
|
32
32
|
sourceMapsProd: true,
|
|
33
33
|
displayNamesProd: false,
|
|
34
|
+
distSubfolders: false,
|
|
34
35
|
dangerouslySetJestConfig: defaultDecorator,
|
|
35
36
|
dangerouslySetESLintConfig: defaultDecorator,
|
|
36
37
|
dangerouslySetTSConfig: defaultDecorator,
|
|
@@ -56,5 +57,4 @@ var defaultSkuConfig_default = {
|
|
|
56
57
|
dangerouslySetVitestConfig: defaultDecorator,
|
|
57
58
|
vitePlugins: []
|
|
58
59
|
};
|
|
59
|
-
//#endregion
|
|
60
60
|
export { defaultSkuConfig_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/context/getSiteForHost.ts
|
|
2
2
|
/**
|
|
3
3
|
* Gets the site name for a given hostname.
|
|
4
4
|
* If no site is found (i.e., localhost), it will return the default site or the first site if no default site is provided.
|
|
@@ -9,5 +9,4 @@ const getSiteForHost = (hostname, defaultSite, sites) => {
|
|
|
9
9
|
if (matchingSite) return matchingSite.name;
|
|
10
10
|
return defaultSite ? defaultSite : sites[0].name;
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { getSiteForHost };
|
package/dist/context/hosts.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { caution, critical, strong } from "../private/utils/src/console/styles.mjs";
|
|
2
|
-
import { hasErrorCode } from "../utils/error-guards.mjs";
|
|
3
|
-
import "../private/utils/src/console/index.mjs";
|
|
4
2
|
import { suggestScript } from "../utils/suggestScript.mjs";
|
|
3
|
+
import { hasErrorCode } from "../utils/error-guards.mjs";
|
|
5
4
|
import { addSystemHosts, readSystemHosts } from "./hostsFile.mjs";
|
|
5
|
+
import "../private/utils/src/console/index.mjs";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
|
-
|
|
7
|
+
// src/context/hosts.ts
|
|
8
8
|
const isLocalhostHost = (host) => {
|
|
9
9
|
const normalised = host.toLowerCase();
|
|
10
10
|
return normalised === "localhost" || normalised.endsWith(".localhost");
|
|
@@ -49,5 +49,4 @@ const checkHosts = async (skuContext) => {
|
|
|
49
49
|
}
|
|
50
50
|
} catch {}
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { checkHosts, getAppHosts, setupHosts };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { appendFile, readFile } from "node:fs/promises";
|
|
3
|
-
|
|
3
|
+
// src/context/hostsFile.ts
|
|
4
4
|
const getHostsFilePath = () => process.platform === "win32" ? path.win32.join(process.env.SystemRoot ?? "C:\\Windows", "System32", "drivers", "etc", "hosts") : "/etc/hosts";
|
|
5
5
|
const parseHostsFile = (contents) => contents.split(/\r?\n/).flatMap((line) => {
|
|
6
6
|
const [ip, ...hosts] = line.replace(/#.*/, "").trim().split(/\s+/);
|
|
@@ -22,5 +22,4 @@ const addSystemHosts = async (entries, filePath = getHostsFilePath()) => {
|
|
|
22
22
|
await appendFile(filePath, `${separator}${missingLines.join(eol)}${eol}`);
|
|
23
23
|
return missingLines;
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
export { addSystemHosts, getHostsFilePath, parseHostsFile, readSystemHosts };
|
|
25
|
+
export { addSystemHosts, parseHostsFile, readSystemHosts };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { critical, strong } from "../private/utils/src/console/styles.mjs";
|
|
2
2
|
import "../private/utils/src/console/index.mjs";
|
|
3
|
-
|
|
3
|
+
// src/context/resolveEnvironment.ts
|
|
4
4
|
const resolveEnvironment = ({ environment: environmentOption, skuContext }) => {
|
|
5
5
|
const environment = environmentOption || skuContext.environments?.[0] || "";
|
|
6
6
|
if (environment) {
|
|
@@ -12,5 +12,4 @@ const resolveEnvironment = ({ environment: environmentOption, skuContext }) => {
|
|
|
12
12
|
}
|
|
13
13
|
return environment;
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { resolveEnvironment };
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { getPathFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
2
2
|
import { caution, critical, strong } from "../private/utils/src/console/styles.mjs";
|
|
3
|
-
import "../private/utils/src/index.mjs";
|
|
4
|
-
import defaultSkuConfig_default from "./defaultSkuConfig.mjs";
|
|
5
3
|
import configSchema_default from "./configSchema.mjs";
|
|
4
|
+
import defaultSkuConfig_default from "./defaultSkuConfig.mjs";
|
|
6
5
|
import defaultClientEntry_default from "./defaultClientEntry.mjs";
|
|
7
6
|
import { hasErrorMessage } from "../utils/error-guards.mjs";
|
|
8
7
|
import "../private/utils/src/console/index.mjs";
|
|
8
|
+
import "../private/utils/src/index.mjs";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import browserslist from "browserslist";
|
|
11
11
|
import { closest } from "fastest-levenshtein";
|
|
12
|
-
|
|
12
|
+
// src/context/validateConfig.ts
|
|
13
13
|
const availableConfigKeys = Object.keys(defaultSkuConfig_default);
|
|
14
|
+
const reservedEnvironmentNames = [
|
|
15
|
+
"client",
|
|
16
|
+
"rendered",
|
|
17
|
+
"server"
|
|
18
|
+
];
|
|
14
19
|
const exitWithErrors = (errors) => {
|
|
15
20
|
console.log(strong(critical("Errors in sku config:")));
|
|
16
21
|
errors.forEach((e) => {
|
|
@@ -35,6 +40,8 @@ var validateConfig_default = (skuConfig, appSkuConfig = {}) => {
|
|
|
35
40
|
}
|
|
36
41
|
if (skuConfig.libraryEntry && !skuConfig.libraryName) errors.push(`🚫 '${strong("libraryEntry")}' must have a corresponding '${strong("libraryName")}' option. More details: ${strong("https://github.com/seek-oss/sku#building-a-library")}`);
|
|
37
42
|
if (skuConfig.buildType === "ssr" && skuConfig.bundler !== "vite") errors.push(`🚫 '${strong("buildType: ssr")}' is only supported with the Vite bundler.`);
|
|
43
|
+
if (skuConfig.distSubfolders && skuConfig.buildType === "ssr") errors.push(`🚫 '${strong("distSubfolders")}' is not supported with '${strong("buildType: ssr")}'. SSR output is always split into 'client' and 'server'.`);
|
|
44
|
+
for (const reservedName of reservedEnvironmentNames) if (skuConfig.environments?.includes(reservedName)) errors.push(`🚫 '${strong(reservedName)}' is reserved and cannot be used as an environment name.`);
|
|
38
45
|
if (skuConfig.buildType === "ssr" && skuConfig.bundler === "vite" && skuConfig.publicPath && (/^https?:\/\//i.test(skuConfig.publicPath) || skuConfig.publicPath.startsWith("//"))) errors.push(`🚫 SSR requires a relative '${strong("publicPath")}' (e.g. '/' or '/static/'). Absolute http(s) / CDN publicPath is not supported.`);
|
|
39
46
|
if (skuConfig.buildType === "ssr" && skuConfig.bundler === "vite" && Object.prototype.hasOwnProperty.call(appSkuConfig, "serverPort")) errors.push(`🚫 SSR does not support '${strong("serverPort")}'. Use '${strong("port")}' for both \`sku start\` and the production default listen port (overridable via \`PORT\`).`);
|
|
40
47
|
if (skuConfig.buildType === "ssr" && skuConfig.bundler === "vite" && skuConfig.public && existsSync(getPathFromCwd(skuConfig.public))) errors.push(`🚫 SSR does not support the '${strong("public")}' assets folder ('${strong(skuConfig.public)}'). Import assets from modules instead so they go through the optimisation pipeline.`);
|
|
@@ -52,5 +59,4 @@ var validateConfig_default = (skuConfig, appSkuConfig = {}) => {
|
|
|
52
59
|
}
|
|
53
60
|
if (errors.length > 0) exitWithErrors(errors);
|
|
54
61
|
};
|
|
55
|
-
//#endregion
|
|
56
62
|
export { validateConfig_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { critical, strong } from "../private/utils/src/console/styles.mjs";
|
|
2
2
|
import "../private/utils/src/console/index.mjs";
|
|
3
|
-
|
|
3
|
+
// src/context/validatePathAliases.ts
|
|
4
4
|
/**
|
|
5
5
|
* Validate `pathAliases`. `sku` mirrors these into the `package.json` `imports`
|
|
6
6
|
* field, which only supports `#`-prefixed subpath import specifiers, and aliases
|
|
@@ -19,5 +19,4 @@ const validatePathAliases = (pathAliases) => {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { validatePathAliases };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "../services/vite/plugins/telemetryClients.mjs";
|
|
2
2
|
import "@vitejs/plugin-react/preamble";
|
|
3
|
-
|
|
3
|
+
// src/services/vite/entries/ssr-client.dev.tsx
|
|
4
4
|
if (import.meta.hot) import.meta.hot.on("vite:afterUpdate", () => {
|
|
5
5
|
document.querySelectorAll("[data-ssr-css]").forEach((node) => node.remove());
|
|
6
6
|
});
|
|
7
7
|
import("./ssr-client.mjs");
|
|
8
|
-
//#endregion
|
|
9
8
|
export {};
|
|
@@ -11,7 +11,7 @@ import * as routesEntry from "__sku_alias__routesEntry";
|
|
|
11
11
|
import { SkuProvider } from "#runtime/skuContext";
|
|
12
12
|
import { registerSiteRouteTree } from "#runtime/preloadRoute";
|
|
13
13
|
import { DocumentAssetLinks } from "#runtime/documentAssets";
|
|
14
|
-
|
|
14
|
+
// src/services/vite/entries/ssr-client.tsx
|
|
15
15
|
const { routes, mapRoutePath } = readRoutesEntry(routesEntry);
|
|
16
16
|
const entry = clientEntry.default;
|
|
17
17
|
if (entry == null || typeof entry !== "object") throw new Error(`SSR clientEntry must export default an object (via defineServerEntry / defineClientEntry). Missing or invalid default export.`);
|
|
@@ -55,5 +55,4 @@ const hydrate = async () => {
|
|
|
55
55
|
hydrate().catch((error) => {
|
|
56
56
|
console.error(error);
|
|
57
57
|
});
|
|
58
|
-
//#endregion
|
|
59
58
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { RenderAssets, RenderManifest, RenderOptions, RenderResult, SkuMiddleware, SkuOnListen } from "../services/vite/ssr/types.mjs";
|
|
2
2
|
import "virtual:sku/entry-side-effects";
|
|
3
3
|
import { Request as Request$1 } from "express";
|
|
4
|
-
//#region src/services/vite/entries/ssr-server.d.ts
|
|
5
4
|
declare const middleware: SkuMiddleware | undefined, onListen: SkuOnListen | undefined;
|
|
6
5
|
declare const render: (request: Request, req: Request$1, assets: RenderAssets, options?: RenderOptions, manifest?: RenderManifest) => Promise<RenderResult>;
|
|
7
|
-
//#endregion
|
|
8
6
|
export { middleware, onListen, render };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { buildSiteStaticHandlers } from "../services/vite/ssr/buildSiteStaticHandlers.mjs";
|
|
1
2
|
import { buildSiteRouteTrees } from "../services/vite/ssr/buildSiteRouteTrees.mjs";
|
|
2
3
|
import { readRoutesEntry } from "../services/vite/ssr/readRoutesEntry.mjs";
|
|
3
|
-
import { buildSiteStaticHandlers } from "../services/vite/ssr/buildSiteStaticHandlers.mjs";
|
|
4
4
|
import { render as render$1 } from "../services/vite/ssr/render.mjs";
|
|
5
5
|
import "virtual:sku/entry-side-effects";
|
|
6
6
|
import * as routesEntry from "__sku_alias__routesEntry";
|
|
7
7
|
import * as serverEntry from "__sku_alias__serverEntry";
|
|
8
|
-
|
|
8
|
+
// src/services/vite/entries/ssr-server.tsx
|
|
9
9
|
const { routes, mapRoutePath } = readRoutesEntry(routesEntry);
|
|
10
10
|
const entry = serverEntry.default;
|
|
11
11
|
if (entry == null || typeof entry !== "object") throw new Error(`SSR serverEntry must export default an object (via defineServerEntry / defineClientEntry). Missing or invalid default export.`);
|
|
@@ -32,5 +32,4 @@ if (import.meta.env.PROD) {
|
|
|
32
32
|
render
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { middleware, onListen, render };
|
|
@@ -2,7 +2,7 @@ import "virtual:sku/entry-side-effects";
|
|
|
2
2
|
import "virtual:sku/polyfills";
|
|
3
3
|
import client from "__sku_alias__clientEntry";
|
|
4
4
|
import dedent from "dedent";
|
|
5
|
-
|
|
5
|
+
// src/services/vite/entries/vite-client.tsx
|
|
6
6
|
if (process.env.NODE_ENV === "development") {
|
|
7
7
|
if (typeof client !== "function") throw new Error(dedent`
|
|
8
8
|
The sku client entry ('${__SKU_CLIENT_PATH__}') must export a function that calls hydrateRoot. e.g.
|
|
@@ -35,5 +35,4 @@ const startClient = async () => {
|
|
|
35
35
|
client(clientContext);
|
|
36
36
|
};
|
|
37
37
|
startClient();
|
|
38
|
-
//#endregion
|
|
39
38
|
export {};
|
|
@@ -3,7 +3,7 @@ import { createDebug } from "obug";
|
|
|
3
3
|
import "virtual:sku/entry-side-effects";
|
|
4
4
|
import { createCollector } from "@sku-lib/vite/collector";
|
|
5
5
|
import render from "__sku_alias__renderEntry";
|
|
6
|
-
|
|
6
|
+
// src/services/vite/entries/vite-render.tsx
|
|
7
7
|
const log = createDebug("sku:vite-render");
|
|
8
8
|
const viteRender = async ({ environment, language, route, routeName, site, clientEntry, createUnsafeNonce }) => {
|
|
9
9
|
log(`Rendering route: ${routeName}:${route}`);
|
|
@@ -20,5 +20,4 @@ const viteRender = async ({ environment, language, route, routeName, site, clien
|
|
|
20
20
|
createUnsafeNonce
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { viteRender };
|
package/dist/jest/file-mock.mjs
CHANGED