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/dist/types/types.d.mts
CHANGED
|
@@ -6,7 +6,6 @@ import { Server as Server$1 } from "node:https";
|
|
|
6
6
|
import { Express, RequestHandler } from "express";
|
|
7
7
|
import { Linter } from "eslint";
|
|
8
8
|
import { TestUserConfig } from "vitest/node";
|
|
9
|
-
//#region src/types/types.d.ts
|
|
10
9
|
type ViteRenderFunction = (options: {
|
|
11
10
|
createUnsafeNonce?: () => string;
|
|
12
11
|
clientEntry: string;
|
|
@@ -83,6 +82,7 @@ interface SkuSiteObject {
|
|
|
83
82
|
languages?: readonly string[];
|
|
84
83
|
}
|
|
85
84
|
type SkuSite = string | SkuSiteObject;
|
|
85
|
+
/** @knipignore Must be exported for declaration emit of the default config */
|
|
86
86
|
interface TransformOutputPathFunctionParams {
|
|
87
87
|
environment: string | undefined;
|
|
88
88
|
site: string | undefined;
|
|
@@ -212,6 +212,22 @@ interface SkuConfigBase {
|
|
|
212
212
|
* @link https://seek-oss.github.io/sku/configuration#displaynamesprod
|
|
213
213
|
*/
|
|
214
214
|
displayNamesProd?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* When `true`, build output is split into subfolders of `<target>` instead of being written to its root:
|
|
217
|
+
*
|
|
218
|
+
* - Static apps: `sku build` writes rendered HTML documents to `<target>/rendered`,
|
|
219
|
+
* and all other output (including files from `public`) to `<target>/client`.
|
|
220
|
+
* `public` must not contain `.html` files.
|
|
221
|
+
* - Webpack SSR apps: `sku build-ssr` writes client assets (including files from `public`) to `<target>/client`,
|
|
222
|
+
* and the server bundle to `<target>/server`.
|
|
223
|
+
*
|
|
224
|
+
* Managed Data Mode output is always split into `<target>/client` and `<target>/server`,
|
|
225
|
+
* so this option isn't needed.
|
|
226
|
+
*
|
|
227
|
+
* @default false
|
|
228
|
+
* @link https://seek-oss.github.io/sku/configuration#distsubfolders
|
|
229
|
+
*/
|
|
230
|
+
distSubfolders?: boolean;
|
|
215
231
|
/**
|
|
216
232
|
* **Only for static apps**
|
|
217
233
|
*
|
|
@@ -601,5 +617,4 @@ type SkuConfig = SkuConfigBase & (({
|
|
|
601
617
|
} & WebpackSkuConfig) | ({
|
|
602
618
|
bundler: 'vite';
|
|
603
619
|
} & ViteSkuConfig));
|
|
604
|
-
|
|
605
|
-
export { Render, RenderAppProps, RenderCallbackParams, RenderableRoute, Server$2 as Server, SkuConfig, SkuConfigBase, SkuLanguage, SkuProvider, SkuRoute, SkuRouteObject, SkuSiteObject, TransformOutputPathFunctionParams, ViteRenderFunction, ViteSkuConfig, WebpackSkuConfig };
|
|
620
|
+
export { Render, RenderAppProps, RenderCallbackParams, RenderableRoute, Server$2 as Server, SkuConfig, SkuLanguage, SkuRoute, SkuRouteObject, SkuSiteObject, TransformOutputPathFunctionParams, ViteRenderFunction };
|
|
@@ -2,7 +2,7 @@ import { caution, strong } from "../private/utils/src/console/styles.mjs";
|
|
|
2
2
|
import "../private/utils/src/console/index.mjs";
|
|
3
3
|
import { createDebug } from "obug";
|
|
4
4
|
import getPort from "get-port";
|
|
5
|
-
|
|
5
|
+
// src/utils/allocatePort.ts
|
|
6
6
|
const debug = createDebug("sku:allocatePort");
|
|
7
7
|
const allocatePort = async ({ port, host, strictPort = false }) => {
|
|
8
8
|
debug(`Finding available port with request for ${port}`);
|
|
@@ -16,5 +16,4 @@ const allocatePort = async ({ port, host, strictPort = false }) => {
|
|
|
16
16
|
}
|
|
17
17
|
return actualPort;
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { allocatePort as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
2
|
-
import "../private/utils/src/index.mjs";
|
|
3
2
|
import exists from "./exists.mjs";
|
|
4
3
|
import { copyDirContents } from "./copyDirContents.mjs";
|
|
4
|
+
import "../private/utils/src/index.mjs";
|
|
5
5
|
import { join, relative } from "node:path";
|
|
6
6
|
import { mkdir, rm } from "node:fs/promises";
|
|
7
7
|
import { fdir } from "fdir";
|
|
8
|
-
|
|
8
|
+
// src/utils/buildFileUtils.ts
|
|
9
9
|
const cleanTargetDirectory = async (target, includeDirectory = false) => {
|
|
10
10
|
const files = await new fdir().withBasePath().withMaxDepth(1).withDirs().glob(includeDirectory ? "**/*" : `${target}/*`).crawl(target).withPromise();
|
|
11
11
|
for (const file of files) await rm(file, {
|
|
@@ -13,11 +13,11 @@ const cleanTargetDirectory = async (target, includeDirectory = false) => {
|
|
|
13
13
|
force: true
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
const copyPublicFiles = async ({ paths }) => {
|
|
16
|
+
const copyPublicFiles = async ({ paths, destination = paths.target }) => {
|
|
17
17
|
if (!await exists(paths.public)) return;
|
|
18
18
|
const currentCwd = cwd();
|
|
19
|
-
console.log(`Copying public assets from "${relative(currentCwd, paths.public)}" to "${relative(currentCwd,
|
|
20
|
-
await copyDirContents(join(paths.public), join(
|
|
19
|
+
console.log(`Copying public assets from "${relative(currentCwd, paths.public)}" to "${relative(currentCwd, destination)}"`);
|
|
20
|
+
await copyDirContents(join(paths.public), join(destination));
|
|
21
21
|
};
|
|
22
22
|
const ensureTargetDirectory = async (target) => {
|
|
23
23
|
await mkdir(target, { recursive: true });
|
|
@@ -26,5 +26,15 @@ const cleanStaticRenderEntry = async ({ paths }) => {
|
|
|
26
26
|
const files = await new fdir().withBasePath().filter((file) => file.endsWith("render.js")).crawl(paths.target).withPromise();
|
|
27
27
|
for (const file of files) await rm(file);
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Throws if the public folder (including nested folders) contains any `.html` files.
|
|
31
|
+
*/
|
|
32
|
+
const assertNoPublicHtmlFiles = async ({ paths }) => {
|
|
33
|
+
if (!await exists(paths.public)) return;
|
|
34
|
+
const htmlFiles = await new fdir().withRelativePaths().filter((file) => /\.html$/i.test(file)).crawl(paths.public).withPromise();
|
|
35
|
+
if (htmlFiles.length > 0) {
|
|
36
|
+
const relativePublic = relative(cwd(), paths.public);
|
|
37
|
+
throw new Error(`HTML files must not be in the public folder when 'distSubfolders' is enabled, but found: ${htmlFiles.map((file) => `"${join(relativePublic, file)}"`).join(", ")}`);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export { assertNoPublicHtmlFiles, cleanStaticRenderEntry, cleanTargetDirectory, copyPublicFiles, ensureTargetDirectory };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getPathFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
2
2
|
import { accent } from "../private/utils/src/console/styles.mjs";
|
|
3
3
|
import "../private/utils/src/index.mjs";
|
|
4
|
-
import "../private/utils/src/console/index.mjs";
|
|
5
4
|
import telemetry_default from "../services/telemetry/index.mjs";
|
|
6
5
|
import exists from "./exists.mjs";
|
|
6
|
+
import "../private/utils/src/console/index.mjs";
|
|
7
7
|
import { mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
8
8
|
import { performance } from "node:perf_hooks";
|
|
9
9
|
import { generate } from "selfsigned";
|
|
10
|
-
|
|
10
|
+
// src/utils/certificate.ts
|
|
11
11
|
const certificateTtl = 864e5;
|
|
12
12
|
const createSelfSignedCertificate = ({ hosts }) => {
|
|
13
13
|
console.log(accent("Generating self-signed certificate"));
|
|
@@ -70,5 +70,4 @@ const getCertificate = async (certificateDirName = ".ssl", hosts) => {
|
|
|
70
70
|
}
|
|
71
71
|
return readFile(certificatePath, { encoding: "utf8" });
|
|
72
72
|
};
|
|
73
|
-
//#endregion
|
|
74
73
|
export { getCertificate as default };
|
package/dist/utils/configure.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { log } from "./debug.mjs";
|
|
2
|
-
import { getPathFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
3
1
|
import "../private/utils/src/index.mjs";
|
|
2
|
+
import { getPathFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
4
3
|
import { validatePeerDeps as validatePeerDeps$1 } from "./validatePeerDeps.mjs";
|
|
4
|
+
import { log } from "./debug.mjs";
|
|
5
5
|
import fs from "node:fs";
|
|
6
|
-
|
|
6
|
+
// src/utils/configure.ts
|
|
7
7
|
let skipConfigure = false;
|
|
8
8
|
let skipValidatePeerDeps = false;
|
|
9
9
|
const packageJson = getPathFromCwd("./package.json");
|
|
@@ -27,5 +27,4 @@ const validatePeerDeps = (skuContext) => {
|
|
|
27
27
|
}
|
|
28
28
|
validatePeerDeps$1(skuContext);
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { configureProject, validatePeerDeps };
|
|
@@ -5,9 +5,10 @@ import "../private/utils/src/index.mjs";
|
|
|
5
5
|
import { banner } from "../private/utils/src/console/banner.mjs";
|
|
6
6
|
import "../private/utils/src/console/index.mjs";
|
|
7
7
|
import options from "../config/prettier.mjs";
|
|
8
|
+
import { createTSConfig } from "../services/typescript/tsconfig.mjs";
|
|
8
9
|
import { bundleReportFolder } from "../services/webpack/config/plugins/bundleAnalyzer.mjs";
|
|
9
10
|
import getCertificate from "./certificate.mjs";
|
|
10
|
-
import {
|
|
11
|
+
import { coverageFolder } from "./coverageFolder.mjs";
|
|
11
12
|
import { validateSkuConfigFormat } from "./validateSkuConfigFormat.mjs";
|
|
12
13
|
import { getPnpmConfigDependencies } from "../services/packageManager/getPnpmConfigDependencies.mjs";
|
|
13
14
|
import { validatePnpmConfig } from "../services/packageManager/pnpmConfig.mjs";
|
|
@@ -17,8 +18,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
17
18
|
import { rm } from "node:fs/promises";
|
|
18
19
|
import dedent from "dedent";
|
|
19
20
|
import ensureGitignore from "ensure-gitignore";
|
|
20
|
-
|
|
21
|
-
const coverageFolder = "coverage";
|
|
21
|
+
// src/utils/configureApp.ts
|
|
22
22
|
const convertToForwardSlashPaths = (pathStr) => pathStr.replace(/\\/g, "/");
|
|
23
23
|
const addSep = (p) => `${p}${path.sep}`;
|
|
24
24
|
const warnOnSkuDependency = () => {
|
|
@@ -85,5 +85,4 @@ var configureApp_default = async (skuContext) => {
|
|
|
85
85
|
}
|
|
86
86
|
warnOnLegacyReact();
|
|
87
87
|
};
|
|
88
|
-
//#endregion
|
|
89
88
|
export { configureApp_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasErrorCode } from "./error-guards.mjs";
|
|
2
2
|
import { cp, stat } from "node:fs/promises";
|
|
3
|
-
|
|
3
|
+
// src/utils/copyDirContents.ts
|
|
4
4
|
const copyDirContents = async (srcPath, destPath) => {
|
|
5
5
|
if (!(await stat(srcPath)).isDirectory()) throw new Error(`Source ${srcPath} is not a directory`);
|
|
6
6
|
try {
|
|
@@ -10,5 +10,4 @@ const copyDirContents = async (srcPath, destPath) => {
|
|
|
10
10
|
}
|
|
11
11
|
await cp(srcPath, destPath, { recursive: true });
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { copyDirContents };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import getCertificate from "./certificate.mjs";
|
|
2
2
|
import { createServer } from "node:http";
|
|
3
3
|
import { createServer as createServer$1 } from "node:https";
|
|
4
|
-
|
|
4
|
+
// src/utils/createServer.ts
|
|
5
5
|
const createServer$2 = async ({ requestListener, httpsDevServer, hosts }) => {
|
|
6
6
|
if (!httpsDevServer) return createServer(requestListener);
|
|
7
7
|
const pems = await getCertificate(".ssl", hosts);
|
|
@@ -10,5 +10,4 @@ const createServer$2 = async ({ requestListener, httpsDevServer, hosts }) => {
|
|
|
10
10
|
cert: pems
|
|
11
11
|
}, requestListener);
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { createServer$2 as default };
|
package/dist/utils/csp.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// src/utils/csp.ts
|
|
3
3
|
const parseCspReportTo = (cspReportTo) => {
|
|
4
4
|
if (cspReportTo === void 0) return;
|
|
5
5
|
if (Array.isArray(cspReportTo)) {
|
|
@@ -16,5 +16,4 @@ const parseCspReportTo = (cspReportTo) => {
|
|
|
16
16
|
return { endpoint: cspReportTo };
|
|
17
17
|
};
|
|
18
18
|
const stringifyReportingEndpoints = (reportingEndpoints) => Array.from(new Set(reportingEndpoints.map(({ endpoint, url }) => `${endpoint}="${url ?? ""}"`))).join(", ");
|
|
19
|
-
//#endregion
|
|
20
19
|
export { parseCspReportTo, stringifyReportingEndpoints };
|
package/dist/utils/debug.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createDebug, enable } from "obug";
|
|
2
|
-
|
|
2
|
+
// src/utils/debug.ts
|
|
3
3
|
const log = createDebug("sku:bin");
|
|
4
4
|
const initDebug = () => {
|
|
5
5
|
process.env.DEBUG = `sku:*${`,${process.env.DEBUG}` || ""}`;
|
|
6
6
|
enable(process.env.DEBUG);
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { initDebug, log };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDeprecatedPolyfill } from "./polyfillDetector.mjs";
|
|
2
|
-
|
|
2
|
+
// src/utils/detectUnnecessaryPolyfillsFromConfig.ts
|
|
3
3
|
/**
|
|
4
4
|
* Detects unnecessary polyfills from the configured polyfills array
|
|
5
5
|
* by matching package names against the registry.
|
|
@@ -13,5 +13,4 @@ const detectUnnecessaryPolyfillsFromConfig = (polyfills) => polyfills.reduce((ac
|
|
|
13
13
|
});
|
|
14
14
|
return acc;
|
|
15
15
|
}, []);
|
|
16
|
-
//#endregion
|
|
17
16
|
export { detectUnnecessaryPolyfillsFromConfig };
|
|
@@ -2,7 +2,7 @@ import { getPathFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
|
2
2
|
import "../private/utils/src/index.mjs";
|
|
3
3
|
import { getDeprecatedPolyfill } from "./polyfillDetector.mjs";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
|
-
|
|
5
|
+
// src/utils/detectUnnecessaryPolyfillsFromDependencies.ts
|
|
6
6
|
/**
|
|
7
7
|
* Detects unnecessary polyfills from package.json dependencies
|
|
8
8
|
* by matching package names against the registry.
|
|
@@ -33,5 +33,4 @@ const detectUnnecessaryPolyfillsFromDependencies = () => {
|
|
|
33
33
|
throw new Error(`Failed to read or parse package.json at ${packageJsonPath}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { detectUnnecessaryPolyfillsFromDependencies };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
// src/utils/distDirectories.ts
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the output directories for a build target.
|
|
5
|
+
*
|
|
6
|
+
* - `distClient`: client assets and `public` files
|
|
7
|
+
* - `distRendered`: rendered HTML and metadata (static builds only)
|
|
8
|
+
* - `distServer`: the SSR server build
|
|
9
|
+
*
|
|
10
|
+
* With `useSubfolders` off, every directory is the target itself (the legacy layout).
|
|
11
|
+
*/
|
|
12
|
+
const getDistDirectories = ({ targetPath, useSubfolders }) => ({
|
|
13
|
+
distClient: useSubfolders ? path.join(targetPath, "client") : targetPath,
|
|
14
|
+
distRendered: useSubfolders ? path.join(targetPath, "rendered") : targetPath,
|
|
15
|
+
distServer: useSubfolders ? path.join(targetPath, "server") : targetPath
|
|
16
|
+
});
|
|
17
|
+
export { getDistDirectories };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/error-guards.ts
|
|
2
2
|
const hasErrorCode = (e) => typeof e === "object" && e !== null && "code" in e && typeof e.code === "string";
|
|
3
3
|
const hasErrorMessage = (e) => typeof e === "object" && e !== null && "message" in e && typeof e.message === "string";
|
|
4
|
-
//#endregion
|
|
5
4
|
export { hasErrorCode, hasErrorMessage };
|
package/dist/utils/execAsync.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { exec } from "node:child_process";
|
|
2
|
-
|
|
2
|
+
// src/utils/execAsync.ts
|
|
3
3
|
function execAsync(command, options) {
|
|
4
4
|
return new Promise((res, rej) => {
|
|
5
5
|
exec(command, options, (error, stdout) => {
|
|
@@ -8,5 +8,4 @@ function execAsync(command, options) {
|
|
|
8
8
|
});
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { execAsync };
|
package/dist/utils/exists.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { access } from "node:fs/promises";
|
|
2
|
-
|
|
2
|
+
// src/utils/exists.ts
|
|
3
3
|
/**
|
|
4
4
|
* Convenience wrapper for fs.access that returns `true` if the access check was successful and `false` otherwise
|
|
5
5
|
*/
|
|
@@ -11,5 +11,4 @@ const exists = async (path) => {
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { exists as default };
|
package/dist/utils/formatMs.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/formatMs.ts
|
|
2
2
|
const formatter = new Intl.DurationFormat("en", { style: "narrow" });
|
|
3
3
|
/**
|
|
4
4
|
* Formats a duration in milliseconds as a human-readable string (e.g. `500ms`, `1m 5s`).
|
|
@@ -18,5 +18,4 @@ const formatMs = (milliseconds) => {
|
|
|
18
18
|
milliseconds: ms
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { formatMs };
|
package/dist/utils/isCI.mjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { routeMatcher } from "./routeMatcher.mjs";
|
|
2
2
|
import { createDebug } from "obug";
|
|
3
|
-
|
|
3
|
+
// src/utils/language-utils.ts
|
|
4
4
|
const log = createDebug("sku:language-middleware");
|
|
5
5
|
function getValidLanguagesForRoute({ route, languages, sites }) {
|
|
6
6
|
const routeIsForSpecificSite = typeof route.siteIndex === "number";
|
|
7
7
|
let languagesToRender = [null];
|
|
8
|
-
if (languages)
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
if (languages) {
|
|
9
|
+
if (route.languages) languagesToRender = route.languages.slice();
|
|
10
|
+
else if (routeIsForSpecificSite) languagesToRender = sites[route.siteIndex ?? 0].languages?.slice() || languages;
|
|
11
|
+
else languagesToRender = languages;
|
|
12
|
+
}
|
|
11
13
|
const languageNames = languagesToRender.map((lang) => lang && typeof lang !== "string" ? lang.name : lang);
|
|
12
14
|
log(`Using languages ${languageNames.join(", ")} for route:`, route.name || route.route);
|
|
13
15
|
return languageNames;
|
|
@@ -54,5 +56,4 @@ function getLanguageFromRoute(path, route, skuConfig) {
|
|
|
54
56
|
function getRouteWithLanguage(routePath, language) {
|
|
55
57
|
return routePath.replace(/(\$|\:)language/g, language || "");
|
|
56
58
|
}
|
|
57
|
-
//#endregion
|
|
58
59
|
export { getLanguageFromRoute, getRouteWithLanguage, getValidLanguagesForRoute };
|
|
@@ -2,11 +2,11 @@ import { getPathFromCwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
|
2
2
|
import { accentLight, secondary } from "../private/utils/src/console/styles.mjs";
|
|
3
3
|
import "../private/utils/src/index.mjs";
|
|
4
4
|
import { hasErrorMessage } from "./error-guards.mjs";
|
|
5
|
-
import "../private/utils/src/console/index.mjs";
|
|
6
5
|
import { suggestScript } from "./suggestScript.mjs";
|
|
6
|
+
import "../private/utils/src/console/index.mjs";
|
|
7
7
|
import { createDebug } from "obug";
|
|
8
8
|
import { readFile, writeFile } from "node:fs/promises";
|
|
9
|
-
|
|
9
|
+
// src/utils/pathAliasImports.ts
|
|
10
10
|
const debug = createDebug("sku:path-alias-imports");
|
|
11
11
|
const makeSyncedPackageJson = async (pathAliases) => {
|
|
12
12
|
const packageJsonPath = getPathFromCwd("package.json");
|
|
@@ -61,5 +61,4 @@ const assertPathAliasImports = async (pathAliases = {}) => {
|
|
|
61
61
|
suggestScript("format");
|
|
62
62
|
process.exit(1);
|
|
63
63
|
};
|
|
64
|
-
//#endregion
|
|
65
64
|
export { assertPathAliasImports, checkPathAliasImports, syncPathAliasImports };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { POLYFILL_REGISTRY } from "./polyfillRegistry.mjs";
|
|
2
2
|
import { detectUnnecessaryPolyfillsFromDependencies } from "./detectUnnecessaryPolyfillsFromDependencies.mjs";
|
|
3
3
|
import { detectUnnecessaryPolyfillsFromConfig } from "./detectUnnecessaryPolyfillsFromConfig.mjs";
|
|
4
|
-
|
|
4
|
+
// src/utils/polyfillDetector.ts
|
|
5
5
|
/**
|
|
6
6
|
* Gets the polyfill registry entry for a given polyfill name, or null if not deprecated
|
|
7
7
|
*/
|
|
@@ -22,5 +22,4 @@ const detectUnnecessaryPolyfills = (polyfills) => {
|
|
|
22
22
|
configPolyfills.forEach((polyfill) => polyfillMap.set(polyfill.polyfillName, polyfill));
|
|
23
23
|
return Array.from(polyfillMap.values());
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { detectUnnecessaryPolyfills, getDeprecatedPolyfill };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/polyfillRegistry.ts
|
|
2
2
|
/**
|
|
3
3
|
* Registry of polyfills that are unnecessary for sku's supported browsers
|
|
4
4
|
*/
|
|
@@ -32,5 +32,4 @@ const POLYFILL_REGISTRY = {
|
|
|
32
32
|
"raf/polyfill": { reason: "requestAnimationFrame is well established and works across many devices and browser versions. It has been available across browsers since July 2015." },
|
|
33
33
|
"url-search-params-polyfill": { reason: "URLSearchParams is well established and works across many devices and browser versions. It has been available across browsers since April 2018." }
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { POLYFILL_REGISTRY };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { caution, critical, secondary, strong } from "../private/utils/src/console/styles.mjs";
|
|
2
|
-
import "../private/utils/src/console/index.mjs";
|
|
3
|
-
import telemetry_default from "../services/telemetry/index.mjs";
|
|
4
2
|
import { detectUnnecessaryPolyfills } from "./polyfillDetector.mjs";
|
|
5
|
-
|
|
3
|
+
import telemetry_default from "../services/telemetry/index.mjs";
|
|
4
|
+
import "../private/utils/src/console/index.mjs";
|
|
5
|
+
// src/utils/polyfillWarnings.ts
|
|
6
6
|
/**
|
|
7
7
|
* Validates and displays warnings for unnecessary polyfills in a clean, formatted way
|
|
8
8
|
*/
|
|
@@ -28,5 +28,4 @@ const displayPolyfillWarning = (polyfill) => {
|
|
|
28
28
|
else console.log(secondary(` Action: Remove from ${polyfill.dependencyType} in package.json`));
|
|
29
29
|
console.log();
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { validatePolyfills };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { cwd } from "../private/utils/src/filesystem/cwd.mjs";
|
|
2
2
|
import "../private/utils/src/index.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
|
-
|
|
4
|
+
// src/utils/resolvePolyfills.ts
|
|
5
5
|
const require = createRequire(import.meta.url);
|
|
6
6
|
const resolvePolyfills = (polyfills) => polyfills.map((polyfill) => require.resolve(polyfill, { paths: [cwd()] }));
|
|
7
|
-
//#endregion
|
|
8
7
|
export { resolvePolyfills };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSiteForHost } from "../context/getSiteForHost.mjs";
|
|
2
2
|
import memoize from "memoize";
|
|
3
3
|
import { match } from "path-to-regexp";
|
|
4
|
-
|
|
4
|
+
// src/utils/routeMatcher.ts
|
|
5
5
|
/**
|
|
6
6
|
* Finds the appropriate route for a given URL
|
|
7
7
|
*
|
|
@@ -22,5 +22,4 @@ const createRouteMatcher = (route) => {
|
|
|
22
22
|
return match(normalisedRoute);
|
|
23
23
|
};
|
|
24
24
|
const routeMatcher = memoize(createRouteMatcher);
|
|
25
|
-
//#endregion
|
|
26
25
|
export { getMatchingRoute, routeMatcher };
|
package/dist/utils/runBin.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { x } from "tinyexec";
|
|
4
|
-
|
|
4
|
+
// src/utils/runBin.ts
|
|
5
5
|
const require = createRequire(import.meta.url);
|
|
6
6
|
const resolveBin = (packageName, binName) => {
|
|
7
7
|
const packageJson = require(`${packageName}/package.json`);
|
|
@@ -13,5 +13,4 @@ const spawnPromise = async (commandPath, args, options) => {
|
|
|
13
13
|
return { exitCode };
|
|
14
14
|
};
|
|
15
15
|
const runBin = ({ packageName, binName, args, options }) => spawnPromise(resolveBin(packageName, binName), args, options);
|
|
16
|
-
//#endregion
|
|
17
16
|
export { runBin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/runLintChecks.ts
|
|
2
2
|
/**
|
|
3
3
|
* Runs the provided lint checks sequentially, returning `true` if any
|
|
4
4
|
* check exits with a non-zero exit code.
|
|
@@ -11,5 +11,4 @@ const runLintChecks = async (checks) => {
|
|
|
11
11
|
}
|
|
12
12
|
return hasFailure;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { runLintChecks };
|
|
@@ -3,7 +3,7 @@ import { accent, strong } from "../private/utils/src/console/styles.mjs";
|
|
|
3
3
|
import { getExecuteCommand, getRunCommand } from "../private/utils/src/packageManager/packageManager.mjs";
|
|
4
4
|
import "../private/utils/src/index.mjs";
|
|
5
5
|
import "../private/utils/src/console/index.mjs";
|
|
6
|
-
|
|
6
|
+
// src/utils/suggestScript.ts
|
|
7
7
|
const findPackageScriptName = (scriptContents) => {
|
|
8
8
|
let pkg;
|
|
9
9
|
try {
|
|
@@ -23,5 +23,4 @@ const suggestScript = (scriptName, options) => {
|
|
|
23
23
|
const suggestedScript = getSuggestedScript(scriptName, options);
|
|
24
24
|
console.log(accent(`To fix this issue, run '${strong(suggestedScript)}'`));
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { suggestScript };
|
|
@@ -9,7 +9,7 @@ import { readFileSync } from "node:fs";
|
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import semver from "semver";
|
|
11
11
|
import { fdir } from "fdir";
|
|
12
|
-
|
|
12
|
+
// src/utils/validatePeerDeps.ts
|
|
13
13
|
const asyncMap = (list, fn) => Promise.all(list.map((item) => fn(item)));
|
|
14
14
|
const singletonPackages = ["@vanilla-extract/css"];
|
|
15
15
|
const validatePeerDeps = async ({ paths }) => {
|
|
@@ -64,5 +64,4 @@ const validatePeerDeps = async ({ paths }) => {
|
|
|
64
64
|
console.error(e);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { validatePeerDeps };
|
|
@@ -2,7 +2,7 @@ import { accent } from "../private/utils/src/console/styles.mjs";
|
|
|
2
2
|
import { banner } from "../private/utils/src/console/banner.mjs";
|
|
3
3
|
import "../private/utils/src/console/index.mjs";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
|
-
|
|
5
|
+
// src/utils/validateSkuConfigFormat.ts
|
|
6
6
|
/**
|
|
7
7
|
* Matches a reference to the CommonJS `module.exports` anywhere in the file.
|
|
8
8
|
* `module` is a restricted word in ESM, so `module.exports` should never
|
|
@@ -18,5 +18,4 @@ const validateSkuConfigFormat = (appSkuConfigPath) => {
|
|
|
18
18
|
process.exit(1);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { isCjsSkuConfig, validateSkuConfigFormat };
|
|
@@ -5,7 +5,7 @@ import { banner } from "../private/utils/src/console/banner.mjs";
|
|
|
5
5
|
import "../private/utils/src/console/index.mjs";
|
|
6
6
|
import { createDebug } from "obug";
|
|
7
7
|
import semver from "semver";
|
|
8
|
-
|
|
8
|
+
// src/utils/warnOnLegacyReact.ts
|
|
9
9
|
const MIN_REACT_VERSION = "19.0.0";
|
|
10
10
|
const debug = createDebug("sku:warnOnLegacyReact");
|
|
11
11
|
const warnOnLegacyReact = () => {
|
|
@@ -17,5 +17,4 @@ const warnOnLegacyReact = () => {
|
|
|
17
17
|
debug("React not found, skipping warning");
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { warnOnLegacyReact };
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { stringifyReportingEndpoints } from "../utils/csp.mjs";
|
|
2
|
-
import { createPreRenderedHtml } from "../services/vite/helpers/html/createPreRenderedHtml.mjs";
|
|
3
1
|
import { createOutDir, renderEntryChunkName } from "../services/vite/helpers/bundleConfig.mjs";
|
|
2
|
+
import { createPreRenderedHtml } from "../services/vite/helpers/html/createPreRenderedHtml.mjs";
|
|
4
3
|
import createCSPHandler from "../services/webpack/entry/csp.mjs";
|
|
5
4
|
import { ensureTargetDirectory } from "../utils/buildFileUtils.mjs";
|
|
5
|
+
import { stringifyReportingEndpoints } from "../utils/csp.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { writeFile } from "node:fs/promises";
|
|
8
8
|
import { createCollector } from "@sku-lib/vite/collector";
|
|
9
9
|
import { mockAdapter, setAdapter } from "@vanilla-extract/css/adapter";
|
|
10
10
|
import { workerData } from "node:worker_threads";
|
|
11
|
-
|
|
11
|
+
// src/services/vite/helpers/prerender/prerenderWorker.ts
|
|
12
12
|
setAdapter(mockAdapter);
|
|
13
13
|
const typedWorkerData = workerData;
|
|
14
14
|
if (!typedWorkerData || typedWorkerData.jobs.length === 0) process.exit(0);
|
|
15
|
-
const { sharedWorkerData: { cspEnabled, cspDelivery, cspExtraScriptSrcHosts, cspReportTo, cspReportOnlyEnabled, cspReportOnlyExtraScriptSrcHosts, cspReportOnlyReportTo, manifest, publicPath, targetPath }, jobs } = typedWorkerData;
|
|
15
|
+
const { sharedWorkerData: { cspEnabled, cspDelivery, cspExtraScriptSrcHosts, cspReportTo, cspReportOnlyEnabled, cspReportOnlyExtraScriptSrcHosts, cspReportOnlyReportTo, manifest, publicPath, targetPath, distSubfolders }, jobs } = typedWorkerData;
|
|
16
16
|
if (!targetPath) throw new Error("targetPath is required in workerData");
|
|
17
|
-
const outDir = createOutDir(
|
|
17
|
+
const outDir = createOutDir({
|
|
18
|
+
targetPath,
|
|
19
|
+
useSubfolders: distSubfolders
|
|
20
|
+
});
|
|
18
21
|
let render;
|
|
19
22
|
try {
|
|
20
23
|
render = (await import(path.join(outDir.ssg, renderEntryChunkName))).default;
|
|
@@ -88,5 +91,4 @@ await Promise.all(jobs.map(async ({ environment, filePath, site, route, routeNam
|
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
}));
|
|
91
|
-
//#endregion
|
|
92
94
|
export {};
|
package/dist/webpack/client.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import clientContextKey_default from "../utils/constants/clientContextKey.mjs";
|
|
|
2
2
|
import { loadableReady } from "@loadable/component";
|
|
3
3
|
import client from "__sku_alias__clientEntry";
|
|
4
4
|
import dedent from "dedent";
|
|
5
|
-
|
|
5
|
+
// src/services/webpack/entry/client/index.ts
|
|
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.
|
|
@@ -26,5 +26,4 @@ loadableReady(() => {
|
|
|
26
26
|
if (dataElement) clientContext = JSON.parse(dataElement.textContent || "{}");
|
|
27
27
|
client(clientContext);
|
|
28
28
|
});
|
|
29
|
-
//#endregion
|
|
30
29
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import render from "__sku_alias__renderEntry";
|
|
2
|
-
|
|
2
|
+
// src/services/webpack/entry/libraryRender/index.ts
|
|
3
3
|
const libraryName = __SKU_LIBRARY_NAME__;
|
|
4
4
|
const libraryFile = __SKU_LIBRARY_FILE__;
|
|
5
5
|
const libraryPath = `${__SKU_PUBLIC_PATH__}${libraryFile ?? libraryName}`;
|
|
@@ -15,5 +15,4 @@ var libraryRender_default = (renderParams) => {
|
|
|
15
15
|
bodyTags: `<script src="${libraryPath}.js"><\/script>`
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { libraryRender_default as default };
|