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
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { critical, success } from "../../../private/utils/src/console/styles.mjs";
|
|
2
|
-
import "../../../
|
|
3
|
-
import
|
|
4
|
-
import { formatMs } from "../../../utils/formatMs.mjs";
|
|
5
|
-
import { makeWebpackConfig } from "../../../services/webpack/config/webpack.config.mjs";
|
|
6
|
-
import { cleanStaticRenderEntry, cleanTargetDirectory, copyPublicFiles, ensureTargetDirectory } from "../../../utils/buildFileUtils.mjs";
|
|
2
|
+
import { assertNoPublicHtmlFiles, cleanStaticRenderEntry, cleanTargetDirectory, copyPublicFiles, ensureTargetDirectory } from "../../../utils/buildFileUtils.mjs";
|
|
3
|
+
import { getDistDirectories } from "../../../utils/distDirectories.mjs";
|
|
7
4
|
import { run } from "../../../services/webpack/runWebpack.mjs";
|
|
5
|
+
import createHtmlRenderPlugin from "../../../services/webpack/config/plugins/createHtmlRenderPlugin.mjs";
|
|
6
|
+
import { makeWebpackConfig } from "../../../services/webpack/config/webpack.config.mjs";
|
|
7
|
+
import telemetry_default from "../../../services/telemetry/index.mjs";
|
|
8
8
|
import { runVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
9
9
|
import { configureProject, validatePeerDeps } from "../../../utils/configure.mjs";
|
|
10
10
|
import { assertPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
11
|
-
import
|
|
11
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
12
|
+
import { formatMs } from "../../../utils/formatMs.mjs";
|
|
12
13
|
import webpack from "webpack";
|
|
13
14
|
import { performance } from "node:perf_hooks";
|
|
14
|
-
|
|
15
|
+
// src/program/commands/build/webpack-build-handler.ts
|
|
15
16
|
const webpackBuildHandler = async ({ stats, skuContext }) => {
|
|
16
17
|
process.env.NODE_ENV = "production";
|
|
17
|
-
const { isLibrary, cspEnabled, paths } = skuContext;
|
|
18
|
+
const { isLibrary, cspEnabled, paths, distSubfolders } = skuContext;
|
|
18
19
|
await configureProject(skuContext);
|
|
19
20
|
await assertPathAliasImports(skuContext.pathAliases);
|
|
20
21
|
validatePeerDeps(skuContext);
|
|
21
22
|
try {
|
|
23
|
+
if (distSubfolders) await assertNoPublicHtmlFiles(skuContext);
|
|
22
24
|
await runVocabCompile(skuContext);
|
|
23
25
|
await ensureTargetDirectory(paths.target);
|
|
24
26
|
await cleanTargetDirectory(paths.target);
|
|
@@ -33,7 +35,14 @@ const webpackBuildHandler = async ({ stats, skuContext }) => {
|
|
|
33
35
|
if (!compiler) throw new Error("Failed to create webpack compiler");
|
|
34
36
|
await run(compiler, { stats });
|
|
35
37
|
await cleanStaticRenderEntry({ paths });
|
|
36
|
-
|
|
38
|
+
const { distClient } = getDistDirectories({
|
|
39
|
+
targetPath: paths.target,
|
|
40
|
+
useSubfolders: distSubfolders
|
|
41
|
+
});
|
|
42
|
+
await copyPublicFiles({
|
|
43
|
+
paths,
|
|
44
|
+
destination: distClient
|
|
45
|
+
});
|
|
37
46
|
const timeTaken = performance.now();
|
|
38
47
|
telemetry_default.timing("build", timeTaken, {
|
|
39
48
|
status: "success",
|
|
@@ -55,5 +64,4 @@ const webpackBuildHandler = async ({ stats, skuContext }) => {
|
|
|
55
64
|
if (process.env.SKU_FORCE_EXIT) process.exit();
|
|
56
65
|
}
|
|
57
66
|
};
|
|
58
|
-
//#endregion
|
|
59
67
|
export { webpackBuildHandler };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { critical, success } 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
|
-
import { formatMs } from "../../../utils/formatMs.mjs";
|
|
5
|
-
import { cleanTargetDirectory, copyPublicFiles, ensureTargetDirectory } from "../../../utils/buildFileUtils.mjs";
|
|
6
2
|
import { run } from "../../../services/webpack/runWebpack.mjs";
|
|
3
|
+
import { cleanTargetDirectory, copyPublicFiles, ensureTargetDirectory } from "../../../utils/buildFileUtils.mjs";
|
|
4
|
+
import { getDistDirectories } from "../../../utils/distDirectories.mjs";
|
|
7
5
|
import { makeWebpackConfig } from "../../../services/webpack/config/webpack.config.ssr.mjs";
|
|
6
|
+
import telemetry_default from "../../../services/telemetry/index.mjs";
|
|
8
7
|
import { runVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
9
8
|
import { configureProject, validatePeerDeps } from "../../../utils/configure.mjs";
|
|
10
9
|
import { assertPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
11
10
|
import { validatePolyfills } from "../../../utils/polyfillWarnings.mjs";
|
|
11
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
12
|
+
import { formatMs } from "../../../utils/formatMs.mjs";
|
|
12
13
|
import webpack from "webpack";
|
|
13
14
|
import { performance } from "node:perf_hooks";
|
|
14
|
-
|
|
15
|
+
// src/program/commands/build-ssr/build-ssr.action.ts
|
|
15
16
|
const buildSsrAction = async ({ stats, skuContext }) => {
|
|
16
17
|
if (skuContext.buildType) throw new Error("`sku build-ssr` is not used with `buildType`. Use `sku build` instead.");
|
|
17
18
|
if (skuContext.bundler === "vite") throw new Error("The command does not supported the Vite bundler at this time. SSR is only supported with Webpack.");
|
|
@@ -36,7 +37,14 @@ const buildSsrAction = async ({ stats, skuContext }) => {
|
|
|
36
37
|
if (!serverCompiler) throw new Error("Failed to create server webpack compiler");
|
|
37
38
|
await run(clientCompiler, { stats });
|
|
38
39
|
await run(serverCompiler, { stats });
|
|
39
|
-
|
|
40
|
+
const { distClient } = getDistDirectories({
|
|
41
|
+
targetPath: skuContext.paths.target,
|
|
42
|
+
useSubfolders: skuContext.distSubfolders
|
|
43
|
+
});
|
|
44
|
+
await copyPublicFiles({
|
|
45
|
+
paths: skuContext.paths,
|
|
46
|
+
destination: distClient
|
|
47
|
+
});
|
|
40
48
|
const timeTaken = performance.now();
|
|
41
49
|
telemetry_default.timing("build", timeTaken, {
|
|
42
50
|
status: "success",
|
|
@@ -58,5 +66,4 @@ const buildSsrAction = async ({ stats, skuContext }) => {
|
|
|
58
66
|
if (process.env.SKU_FORCE_EXIT) process.exit();
|
|
59
67
|
}
|
|
60
68
|
};
|
|
61
|
-
//#endregion
|
|
62
69
|
export { buildSsrAction };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { statsOption } from "../../options/stats.option.mjs";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
|
|
3
|
+
// src/program/commands/build-ssr/build-ssr.command.ts
|
|
4
4
|
const buildSsrCommand = new Command("build-ssr").description("Create a production build of a server-side rendered application.").addOption(statsOption).action(async (options) => {
|
|
5
5
|
const { buildSsrAction } = await import("./build-ssr.action.mjs");
|
|
6
6
|
await buildSsrAction(options);
|
|
7
7
|
});
|
|
8
|
-
//#endregion
|
|
9
8
|
export { buildSsrCommand };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import configureApp_default from "../../../utils/configureApp.mjs";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/configure/configure.action.ts
|
|
3
3
|
const configureAction = ({ skuContext }) => {
|
|
4
4
|
configureApp_default(skuContext);
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { configureAction };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/configure/configure.command.ts
|
|
3
3
|
const configureCommand = new Command("configure").description("Emit and update configuration files for your project.").action(async (options) => {
|
|
4
4
|
const { configureAction } = await import("./configure.action.mjs");
|
|
5
5
|
configureAction(options);
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { configureCommand };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { accentLight, critical } from "../../../private/utils/src/console/styles.mjs";
|
|
2
|
-
import "../../../private/utils/src/console/index.mjs";
|
|
3
2
|
import { configureProject } from "../../../utils/configure.mjs";
|
|
4
|
-
import { syncPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
5
3
|
import { fix } from "../../../services/eslint/runESLint.mjs";
|
|
6
4
|
import { write } from "../../../services/prettier.mjs";
|
|
5
|
+
import { syncPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
6
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
7
7
|
import { runLintChecks } from "../../../utils/runLintChecks.mjs";
|
|
8
|
-
|
|
8
|
+
// src/program/commands/format/format.action.ts
|
|
9
9
|
const formatAction = async (paths, { skuContext }) => {
|
|
10
10
|
await configureProject(skuContext);
|
|
11
11
|
const pathsToCheck = paths.length > 0 ? paths : void 0;
|
|
@@ -29,5 +29,4 @@ const formatAction = async (paths, { skuContext }) => {
|
|
|
29
29
|
}
|
|
30
30
|
console.log(accentLight("Formatting complete"));
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { formatAction };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/format/format.command.ts
|
|
3
3
|
const formatCommand = new Command("format").description("Apply all available lint and formatting fixes.").argument("[paths...]", "paths to format").action(async (paths, options) => {
|
|
4
4
|
const { formatAction } = await import("./format.action.mjs");
|
|
5
5
|
await formatAction(paths, options);
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { formatCommand };
|
|
@@ -9,7 +9,7 @@ import { startSsrCommand } from "./start-ssr/start-ssr.command.mjs";
|
|
|
9
9
|
import { translationsCommand } from "./translations/translations.command.mjs";
|
|
10
10
|
import { buildCommand } from "./build/build.command.mjs";
|
|
11
11
|
import { testCommand } from "./test/test.command.mjs";
|
|
12
|
-
|
|
12
|
+
// src/program/commands/index.ts
|
|
13
13
|
const commands = [
|
|
14
14
|
buildSsrCommand,
|
|
15
15
|
configureCommand,
|
|
@@ -23,5 +23,4 @@ const commands = [
|
|
|
23
23
|
buildCommand,
|
|
24
24
|
testCommand
|
|
25
25
|
];
|
|
26
|
-
//#endregion
|
|
27
26
|
export { commands };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { accentLight, critical } from "../../../private/utils/src/console/styles.mjs";
|
|
2
|
-
import "../../../
|
|
2
|
+
import { check } from "../../../services/eslint/runESLint.mjs";
|
|
3
|
+
import { check as check$1 } from "../../../services/prettier.mjs";
|
|
4
|
+
import { runTsc } from "../../../services/typescript/runTsc.mjs";
|
|
3
5
|
import { runVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
4
6
|
import { configureProject } from "../../../utils/configure.mjs";
|
|
5
7
|
import { checkPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
6
|
-
import { check } from "../../../services/eslint/runESLint.mjs";
|
|
7
|
-
import { check as check$1 } from "../../../services/prettier.mjs";
|
|
8
8
|
import { runLintChecks } from "../../../utils/runLintChecks.mjs";
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
10
|
+
// src/program/commands/lint/lint.action.ts
|
|
11
11
|
const lintAction = async (paths, { skuContext }) => {
|
|
12
12
|
await configureProject(skuContext);
|
|
13
13
|
const pathsToCheck = paths.length > 0 ? paths : void 0;
|
|
@@ -36,5 +36,4 @@ const lintAction = async (paths, { skuContext }) => {
|
|
|
36
36
|
}
|
|
37
37
|
console.log(accentLight("Linting complete"));
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
export { lintAction };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/lint/lint.command.ts
|
|
3
3
|
const lintCommand = new Command("lint").description("Run lint tooling over your code.").argument("[paths...]", "paths to lint").action(async (paths, options) => {
|
|
4
4
|
const { lintAction } = await import("./lint.action.mjs");
|
|
5
5
|
await lintAction(paths, options);
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { lintCommand };
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { accent, critical, strong } from "../../../private/utils/src/console/styles.mjs";
|
|
2
2
|
import { serverUrls } from "../../../private/utils/src/serverUrls.mjs";
|
|
3
|
-
import "../../../private/utils/src/index.mjs";
|
|
4
|
-
import "../../../private/utils/src/console/index.mjs";
|
|
5
|
-
import telemetry_default from "../../../services/telemetry/index.mjs";
|
|
6
3
|
import exists from "../../../utils/exists.mjs";
|
|
7
|
-
import {
|
|
4
|
+
import { getDistDirectories } from "../../../utils/distDirectories.mjs";
|
|
8
5
|
import { checkHosts, getAppHosts } from "../../../context/hosts.mjs";
|
|
9
|
-
import { getSiteForHost } from "../../../context/getSiteForHost.mjs";
|
|
10
|
-
import { getRouteWithLanguage, getValidLanguagesForRoute } from "../../../utils/language-utils.mjs";
|
|
11
6
|
import allocatePort from "../../../utils/allocatePort.mjs";
|
|
12
|
-
import createServer from "../../../utils/createServer.mjs";
|
|
13
7
|
import { openBrowser } from "../../../openBrowser.mjs";
|
|
8
|
+
import { getSiteForHost } from "../../../context/getSiteForHost.mjs";
|
|
14
9
|
import { resolveEnvironment } from "../../../context/resolveEnvironment.mjs";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
10
|
+
import telemetry_default from "../../../services/telemetry/index.mjs";
|
|
11
|
+
import createServer from "../../../utils/createServer.mjs";
|
|
12
|
+
import { getRouteWithLanguage, getValidLanguagesForRoute } from "../../../utils/language-utils.mjs";
|
|
13
|
+
import { configureProject, validatePeerDeps } from "../../../utils/configure.mjs";
|
|
14
|
+
import "../../../private/utils/src/index.mjs";
|
|
15
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
16
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
17
|
+
import { glob, readFile, stat } from "node:fs/promises";
|
|
17
18
|
import { closest } from "fastest-levenshtein";
|
|
18
19
|
import express from "express";
|
|
19
20
|
import handler from "serve-handler";
|
|
20
|
-
|
|
21
|
+
// src/program/commands/serve/serve.action.ts
|
|
21
22
|
const metadataHeaderMap = {
|
|
22
23
|
csp: "content-security-policy",
|
|
23
24
|
cspReportOnly: "content-security-policy-report-only",
|
|
24
25
|
reportingEndpoints: "reporting-endpoints"
|
|
25
26
|
};
|
|
26
27
|
const serveAction = async ({ site: preferredSite, environment: environmentOption, skuContext }) => {
|
|
27
|
-
const { port, paths, initialPath, routes, sites, httpsDevServer, hosts, languages } = skuContext;
|
|
28
|
+
const { port, paths, initialPath, routes, sites, httpsDevServer, hosts, languages, distSubfolders } = skuContext;
|
|
28
29
|
await configureProject(skuContext);
|
|
29
30
|
validatePeerDeps(skuContext);
|
|
30
31
|
telemetry_default.count("serve");
|
|
@@ -62,12 +63,17 @@ const serveAction = async ({ site: preferredSite, environment: environmentOption
|
|
|
62
63
|
value: "*"
|
|
63
64
|
}]
|
|
64
65
|
}];
|
|
66
|
+
const { distClient, distRendered } = getDistDirectories({
|
|
67
|
+
targetPath: paths.target,
|
|
68
|
+
useSubfolders: distSubfolders
|
|
69
|
+
});
|
|
70
|
+
const distRenderedSubPath = relative(paths.target, distRendered);
|
|
65
71
|
const metadataFilesPattern = join(environment, "**/index.html.json");
|
|
66
|
-
const metadataFiles = glob(metadataFilesPattern, { cwd:
|
|
72
|
+
const metadataFiles = glob(metadataFilesPattern, { cwd: distRendered });
|
|
67
73
|
for await (const metadataFile of metadataFiles) {
|
|
68
|
-
const { metadata } = JSON.parse(await readFile(join(
|
|
74
|
+
const { metadata } = JSON.parse(await readFile(join(distRendered, metadataFile), "utf-8"));
|
|
69
75
|
headers.push({
|
|
70
|
-
source: metadataFile.slice(0, -5),
|
|
76
|
+
source: join(distRenderedSubPath, metadataFile.slice(0, -5)),
|
|
71
77
|
headers: Object.entries(metadata).filter(([key]) => key in metadataHeaderMap).map(([key, value]) => ({
|
|
72
78
|
key: metadataHeaderMap[key],
|
|
73
79
|
value
|
|
@@ -79,7 +85,26 @@ const serveAction = async ({ site: preferredSite, environment: environmentOption
|
|
|
79
85
|
const devServerMiddleware = (await import(paths.devServerMiddleware)).default;
|
|
80
86
|
if (devServerMiddleware && typeof devServerMiddleware === "function") devServerMiddleware(app);
|
|
81
87
|
}
|
|
82
|
-
|
|
88
|
+
const getClientFilePath = async (pathname) => {
|
|
89
|
+
if (!pathname.startsWith(paths.publicPath)) return;
|
|
90
|
+
try {
|
|
91
|
+
const relativePath = decodeURIComponent(pathname.slice(paths.publicPath.length));
|
|
92
|
+
const absolutePath = resolve(distClient, relativePath);
|
|
93
|
+
if (absolutePath.startsWith(resolve(distClient) + sep) && (await stat(absolutePath)).isFile()) return `/${relativePath}`;
|
|
94
|
+
} catch {}
|
|
95
|
+
};
|
|
96
|
+
app.use(async (request, response) => {
|
|
97
|
+
if (distSubfolders) {
|
|
98
|
+
const clientFilePath = await getClientFilePath(request.path);
|
|
99
|
+
if (clientFilePath) {
|
|
100
|
+
request.url = clientFilePath;
|
|
101
|
+
return handler(request, response, {
|
|
102
|
+
public: distClient,
|
|
103
|
+
directoryListing: false,
|
|
104
|
+
headers
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
83
108
|
const [hostname] = request.headers.host?.split(":") || [];
|
|
84
109
|
const site = getSiteForHost(hostname, preferredSite, sites) || "";
|
|
85
110
|
const rewrites = routes.flatMap((route) => getValidLanguagesForRoute({
|
|
@@ -95,10 +120,10 @@ const serveAction = async ({ site: preferredSite, environment: environmentOption
|
|
|
95
120
|
const normalisedDestinationRoute = langRoute.split("/").map((part) => part.startsWith(":") ? `\\${part}` : part).join("/");
|
|
96
121
|
return {
|
|
97
122
|
source: normalisedSourceRoute,
|
|
98
|
-
destination: join(environment, site, normalisedDestinationRoute, "index.html")
|
|
123
|
+
destination: join(distRenderedSubPath, environment, site, normalisedDestinationRoute, "index.html")
|
|
99
124
|
};
|
|
100
125
|
}));
|
|
101
|
-
if (paths.publicPath !== "/") rewrites.push({
|
|
126
|
+
if (paths.publicPath !== "/" && !distSubfolders) rewrites.push({
|
|
102
127
|
source: join(paths.publicPath, ":asset+.:extension"),
|
|
103
128
|
destination: "/:asset.:extension"
|
|
104
129
|
});
|
|
@@ -134,5 +159,4 @@ const serveAction = async ({ site: preferredSite, environment: environmentOption
|
|
|
134
159
|
openBrowser(urls.first());
|
|
135
160
|
});
|
|
136
161
|
};
|
|
137
|
-
//#endregion
|
|
138
162
|
export { serveAction };
|
|
@@ -2,7 +2,7 @@ import { siteOption } from "../../options/site.option.mjs";
|
|
|
2
2
|
import { portOption, strictPortOption } from "../../options/port.option.mjs";
|
|
3
3
|
import { listUrlsOption } from "../../options/list-urls.mjs";
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
-
|
|
5
|
+
// src/program/commands/serve/serve.command.ts
|
|
6
6
|
const serveCommand = new Command("serve").description("Serve a production build of a statically-rendered application from your local machine.").addOption(siteOption).addOption(portOption).addOption(strictPortOption).addOption(listUrlsOption).action(async ({ site, skuContext }, command) => {
|
|
7
7
|
const { serveAction } = await import("./serve.action.mjs");
|
|
8
8
|
const { environment } = command.optsWithGlobals();
|
|
@@ -12,5 +12,4 @@ const serveCommand = new Command("serve").description("Serve a production build
|
|
|
12
12
|
skuContext
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
|
-
//#endregion
|
|
16
15
|
export { serveCommand };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import telemetry_default from "../../../services/telemetry/index.mjs";
|
|
2
1
|
import { setupHosts } from "../../../context/hosts.mjs";
|
|
3
|
-
|
|
2
|
+
import telemetry_default from "../../../services/telemetry/index.mjs";
|
|
3
|
+
// src/program/commands/setup-hosts/setup-hosts.action.ts
|
|
4
4
|
const setupHostsAction = async ({ skuContext }) => {
|
|
5
5
|
try {
|
|
6
6
|
await setupHosts(skuContext);
|
|
@@ -12,5 +12,4 @@ const setupHostsAction = async ({ skuContext }) => {
|
|
|
12
12
|
await telemetry_default.close();
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { setupHostsAction };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/setup-hosts/setup-hosts.command.ts
|
|
3
3
|
const setupHostsCommand = new Command("setup-hosts").description("Update your hosts file to point any configured hosts to your local machine.").action(async (options) => {
|
|
4
4
|
const { setupHostsAction } = await import("./setup-hosts.action.mjs");
|
|
5
5
|
await setupHostsAction(options);
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { setupHostsCommand };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { accent } from "../../../private/utils/src/console/styles.mjs";
|
|
2
|
-
import "../../../private/utils/src/console/index.mjs";
|
|
3
|
-
import { watchVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
4
2
|
import { configureProject, validatePeerDeps } from "../../../utils/configure.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { validatePolyfills } from "../../../utils/polyfillWarnings.mjs";
|
|
3
|
+
import { watchVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
7
4
|
import { checkHosts } from "../../../context/hosts.mjs";
|
|
5
|
+
import { validatePolyfills } from "../../../utils/polyfillWarnings.mjs";
|
|
6
|
+
import { assertPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
8
7
|
import { resolveEnvironment } from "../../../context/resolveEnvironment.mjs";
|
|
9
|
-
|
|
8
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
9
|
+
// src/program/commands/start/start.action.ts
|
|
10
10
|
const startAction = async ({ stats, skuContext }, command) => {
|
|
11
11
|
console.log(accent(`sku start`));
|
|
12
12
|
const { environment: environmentOption } = command.optsWithGlobals();
|
|
@@ -34,5 +34,4 @@ const startAction = async ({ stats, skuContext }, command) => {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { startAction };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { statsOption } from "../../options/stats.option.mjs";
|
|
2
2
|
import { portOption, strictPortOption } from "../../options/port.option.mjs";
|
|
3
|
-
import { listUrlsOption } from "../../options/list-urls.mjs";
|
|
4
3
|
import { convertLoadableOption } from "../../options/convertLoadable.option.mjs";
|
|
4
|
+
import { listUrlsOption } from "../../options/list-urls.mjs";
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
-
|
|
6
|
+
// src/program/commands/start/start.command.ts
|
|
7
7
|
const startCommand = new Command("start").description("Start the sku development server for a statically-rendered application.").addOption(statsOption).addOption(portOption).addOption(strictPortOption).addOption(listUrlsOption).addOption(convertLoadableOption).action(async (options, command) => {
|
|
8
8
|
const { startAction } = await import("./start.action.mjs");
|
|
9
9
|
await startAction(options, command);
|
|
10
10
|
});
|
|
11
|
-
//#endregion
|
|
12
11
|
export { startCommand };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { metricsMeasurers } from "../../../services/telemetry/metricsMeasurers.mjs";
|
|
2
1
|
import { viteService } from "../../../services/vite/index.mjs";
|
|
3
|
-
|
|
2
|
+
import { metricsMeasurers } from "../../../services/telemetry/metricsMeasurers.mjs";
|
|
3
|
+
// src/program/commands/start/vite-start-handler.ts
|
|
4
4
|
const viteStartHandler = async ({ skuContext, environment }) => {
|
|
5
5
|
await viteService.start({
|
|
6
6
|
skuContext,
|
|
@@ -8,5 +8,4 @@ const viteStartHandler = async ({ skuContext, environment }) => {
|
|
|
8
8
|
});
|
|
9
9
|
metricsMeasurers.skuStart.mark();
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { viteStartHandler };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { serverUrls } from "../../../private/utils/src/serverUrls.mjs";
|
|
2
|
-
import "../../../
|
|
2
|
+
import { openBrowser } from "../../../openBrowser.mjs";
|
|
3
|
+
import getCertificate from "../../../utils/certificate.mjs";
|
|
3
4
|
import getStatsConfig from "../../../services/webpack/config/statsConfig.mjs";
|
|
5
|
+
import createHtmlRenderPlugin from "../../../services/webpack/config/plugins/createHtmlRenderPlugin.mjs";
|
|
4
6
|
import { makeWebpackConfig } from "../../../services/webpack/config/webpack.config.mjs";
|
|
5
7
|
import { getAppHosts } from "../../../context/hosts.mjs";
|
|
8
|
+
import allocatePort from "../../../utils/allocatePort.mjs";
|
|
6
9
|
import { getSiteForHost } from "../../../context/getSiteForHost.mjs";
|
|
7
10
|
import { getMatchingRoute } from "../../../utils/routeMatcher.mjs";
|
|
8
11
|
import { getLanguageFromRoute, getRouteWithLanguage } from "../../../utils/language-utils.mjs";
|
|
9
|
-
import
|
|
10
|
-
import getCertificate from "../../../utils/certificate.mjs";
|
|
11
|
-
import createHtmlRenderPlugin from "../../../services/webpack/config/plugins/createHtmlRenderPlugin.mjs";
|
|
12
|
-
import { openBrowser } from "../../../openBrowser.mjs";
|
|
12
|
+
import "../../../private/utils/src/index.mjs";
|
|
13
13
|
import webpack from "webpack";
|
|
14
14
|
import WebpackDevServer from "webpack-dev-server";
|
|
15
15
|
import exceptionFormatter from "exception-formatter";
|
|
16
|
-
|
|
16
|
+
// src/program/commands/start/webpack-start-handler.ts
|
|
17
17
|
const localhost = "0.0.0.0";
|
|
18
18
|
const hot = process.env.SKU_HOT !== "false";
|
|
19
19
|
const webpackStartHandler = async ({ stats: statsOption, environment, skuContext }) => {
|
|
@@ -128,5 +128,4 @@ const webpackStartHandler = async ({ stats: statsOption, environment, skuContext
|
|
|
128
128
|
openBrowser(urls.first());
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
|
-
//#endregion
|
|
132
131
|
export { webpackStartHandler };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { validatePolyfills } from "../../../utils/polyfillWarnings.mjs";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/start-ssr/start-ssr.action.ts
|
|
3
3
|
const startSsrAction = async ({ stats, skuContext }) => {
|
|
4
4
|
if (skuContext.buildType) throw new Error("`sku start-ssr` is not used with `buildType`. Use `sku start` instead.");
|
|
5
5
|
if (skuContext.bundler === "vite") throw new Error("The command does not supported the Vite bundler at this time. SSR is only supported with Webpack.");
|
|
@@ -10,5 +10,4 @@ const startSsrAction = async ({ stats, skuContext }) => {
|
|
|
10
10
|
skuContext
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { startSsrAction };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { statsOption } from "../../options/stats.option.mjs";
|
|
2
2
|
import { listUrlsOption } from "../../options/list-urls.mjs";
|
|
3
3
|
import { Command } from "commander";
|
|
4
|
-
|
|
4
|
+
// src/program/commands/start-ssr/start-ssr.command.ts
|
|
5
5
|
const startSsrCommand = new Command("start-ssr").description("Start the sku development server for a server-rendered application.").addOption(statsOption).addOption(listUrlsOption).action(async (options) => {
|
|
6
6
|
const { startSsrAction } = await import("./start-ssr.action.mjs");
|
|
7
7
|
await startSsrAction(options);
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { startSsrCommand };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { requireFromCwd } from "../../../private/utils/src/filesystem/cwd.mjs";
|
|
2
2
|
import { serverUrls } from "../../../private/utils/src/serverUrls.mjs";
|
|
3
|
-
import "../../../
|
|
4
|
-
import getStatsConfig from "../../../services/webpack/config/statsConfig.mjs";
|
|
3
|
+
import getCertificate from "../../../utils/certificate.mjs";
|
|
5
4
|
import { cleanTargetDirectory, copyPublicFiles, ensureTargetDirectory } from "../../../utils/buildFileUtils.mjs";
|
|
6
|
-
import { makeWebpackConfig } from "../../../services/webpack/config/webpack.config.ssr.mjs";
|
|
7
|
-
import { watchVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
8
|
-
import { configureProject, validatePeerDeps } from "../../../utils/configure.mjs";
|
|
9
|
-
import { assertPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
10
5
|
import { checkHosts, getAppHosts } from "../../../context/hosts.mjs";
|
|
6
|
+
import { makeWebpackConfig } from "../../../services/webpack/config/webpack.config.ssr.mjs";
|
|
7
|
+
import getStatsConfig from "../../../services/webpack/config/statsConfig.mjs";
|
|
11
8
|
import allocatePort from "../../../utils/allocatePort.mjs";
|
|
12
|
-
import getCertificate from "../../../utils/certificate.mjs";
|
|
13
9
|
import { openBrowser } from "../../../openBrowser.mjs";
|
|
14
10
|
import { createServerManager } from "../../../services/serverManager.mjs";
|
|
11
|
+
import { watchVocabCompile } from "../../../services/vocab/runVocab.mjs";
|
|
12
|
+
import { configureProject, validatePeerDeps } from "../../../utils/configure.mjs";
|
|
13
|
+
import { assertPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
14
|
+
import "../../../private/utils/src/index.mjs";
|
|
15
15
|
import { createDebug } from "obug";
|
|
16
16
|
import path from "node:path";
|
|
17
17
|
import webpack from "webpack";
|
|
18
18
|
import WebpackDevServer from "webpack-dev-server";
|
|
19
|
-
|
|
19
|
+
// src/program/commands/start-ssr/webpack-start-ssr-handler.ts
|
|
20
20
|
const log = createDebug("sku:start-ssr");
|
|
21
21
|
const hot = process.env.SKU_HOT !== "false";
|
|
22
22
|
const pluginName = "sku-start-ssr";
|
|
@@ -150,5 +150,4 @@ const webpackStartSsrHandler = async ({ stats: statsOption, skuContext }) => {
|
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
|
-
//#endregion
|
|
154
153
|
export { webpackStartSsrHandler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import isCI_default from "../../../utils/isCI.mjs";
|
|
2
2
|
import { createDebug } from "obug";
|
|
3
3
|
import { run } from "jest";
|
|
4
|
-
|
|
4
|
+
// src/program/commands/test/jest-test-handler.ts
|
|
5
5
|
const log = createDebug("sku:jest");
|
|
6
6
|
const runJestTests = async ({ args = [] }) => {
|
|
7
7
|
const jestPreset = "sku";
|
|
@@ -11,5 +11,4 @@ const runJestTests = async ({ args = [] }) => {
|
|
|
11
11
|
if (isCI_default) jestArgv.push("--ci");
|
|
12
12
|
run(jestArgv);
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { runJestTests };
|
|
@@ -3,7 +3,7 @@ import { configureProject } from "../../../utils/configure.mjs";
|
|
|
3
3
|
import { assertPathAliasImports } from "../../../utils/pathAliasImports.mjs";
|
|
4
4
|
import { runJestTests } from "./jest-test-handler.mjs";
|
|
5
5
|
import { vitestHandler } from "./vitest-test-handler.mjs";
|
|
6
|
-
|
|
6
|
+
// src/program/commands/test/test.action.ts
|
|
7
7
|
const testAction = async ({ skuContext }, { args = [] }) => {
|
|
8
8
|
await configureProject(skuContext);
|
|
9
9
|
await assertPathAliasImports(skuContext.pathAliases);
|
|
@@ -17,5 +17,4 @@ const testAction = async ({ skuContext }, { args = [] }) => {
|
|
|
17
17
|
}
|
|
18
18
|
runJestTests({ args });
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { testAction };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
|
|
2
|
+
// src/program/commands/test/test.command.ts
|
|
3
3
|
const testCommand = new Command("test").description("Run unit tests.").allowUnknownOption(true).allowExcessArguments(true).action(async (options, argsObject) => {
|
|
4
4
|
const { testAction } = await import("./test.action.mjs");
|
|
5
5
|
await testAction(options, argsObject);
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { testCommand };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { critical, strong } from "../../../private/utils/src/console/styles.mjs";
|
|
2
2
|
import { hasErrorCode } from "../../../utils/error-guards.mjs";
|
|
3
|
-
import "../../../private/utils/src/console/index.mjs";
|
|
4
3
|
import { createConfig } from "../../../services/vite/helpers/config/createConfig.mjs";
|
|
5
|
-
|
|
4
|
+
import "../../../private/utils/src/console/index.mjs";
|
|
5
|
+
// src/program/commands/test/vitest-test-handler.ts
|
|
6
6
|
const vitestHandler = async ({ skuContext, args }) => {
|
|
7
7
|
const { parseCLI, startVitest } = await lazyLoadVitest();
|
|
8
8
|
const viteConfigOverride = createConfig(skuContext);
|
|
@@ -34,5 +34,4 @@ const lazyLoadVitest = async () => {
|
|
|
34
34
|
throw error;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { vitestHandler };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { accentLight, strong } from "../../../../../private/utils/src/console/styles.mjs";
|
|
2
|
-
import "../../../../../private/utils/src/console/index.mjs";
|
|
3
|
-
import { configureProject } from "../../../../../utils/configure.mjs";
|
|
4
2
|
import { getResolvedVocabConfig } from "../../helpers/translation-helpers.mjs";
|
|
3
|
+
import { configureProject } from "../../../../../utils/configure.mjs";
|
|
4
|
+
import "../../../../../private/utils/src/console/index.mjs";
|
|
5
5
|
import { compile } from "@vocab/core";
|
|
6
|
-
|
|
6
|
+
// src/program/commands/translations/commands/compile/compile.action.ts
|
|
7
7
|
const log = (message) => console.log(accentLight(message));
|
|
8
8
|
const compileAction = async ({ watch, skuContext }) => {
|
|
9
9
|
await configureProject(skuContext);
|
|
@@ -21,5 +21,4 @@ const compileAction = async ({ watch, skuContext }) => {
|
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { compileAction };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { watchOption } from "../../../../options/watch.option.mjs";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
|
|
3
|
+
// src/program/commands/translations/commands/compile/compile.command.ts
|
|
4
4
|
const compileCommand = new Command("compile").description("Compile translations defined in .vocab directories.").addOption(watchOption).action(async (options) => {
|
|
5
5
|
const { compileAction } = await import("./compile.action.mjs");
|
|
6
6
|
await compileAction(options);
|
|
7
7
|
});
|
|
8
|
-
//#endregion
|
|
9
8
|
export { compileCommand };
|