@servicetitan/startup 38.0.0 → 38.2.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/bin/js-yaml.js +2 -2
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +32 -10
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +6 -0
- package/dist/cli/commands/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/bundle-package.js +59 -0
- package/dist/cli/commands/bundle-package.js.map +1 -0
- package/dist/cli/commands/bundle-vite.js +13 -4
- package/dist/cli/commands/bundle-vite.js.map +1 -1
- package/dist/cli/commands/bundle-webpack.js +13 -4
- package/dist/cli/commands/bundle-webpack.js.map +1 -1
- package/dist/cli/commands/clean.js +13 -4
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/command.d.ts +13 -0
- package/dist/cli/commands/command.d.ts.map +1 -0
- package/dist/cli/commands/command.js +74 -0
- package/dist/cli/commands/command.js.map +1 -0
- package/dist/cli/commands/convert-eslint-config.js +14 -7
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.js +13 -4
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +13 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +14 -21
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +13 -4
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.js +13 -4
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +15 -7
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +13 -4
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-list.js +13 -4
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +13 -4
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +13 -4
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.js +13 -4
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
- package/dist/cli/commands/mfe-publish.js +13 -4
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/mfe-purge-cache.js +13 -4
- package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
- package/dist/cli/commands/prepare-package.js +13 -4
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +1 -1
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +3 -5
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/bundle-package.d.ts +41 -0
- package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-package.js +54 -0
- package/dist/cli/commands/registry/bundle-package.js.map +1 -0
- package/dist/cli/commands/registry/command-registry.d.ts +42 -18
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +10 -19
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/install.d.ts +0 -16
- package/dist/cli/commands/registry/install.d.ts.map +1 -1
- package/dist/cli/commands/registry/install.js +1 -17
- package/dist/cli/commands/registry/install.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +1 -1
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +3 -5
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/review/review.js +14 -7
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js +1 -3
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
- package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js +1 -3
- package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js +1 -3
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js.map +1 -1
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js +5 -12
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +5 -12
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js +1 -3
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -3
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js +1 -3
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js.map +1 -1
- package/dist/cli/commands/review/rules/require-tsconfig-references.js +1 -3
- package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -1
- package/dist/cli/commands/review/utils/compare-version.js +8 -19
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +1 -0
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +20 -6
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +37 -14
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.js +13 -4
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/styles-check.js +13 -4
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/test/runners/jest.js +1 -3
- package/dist/cli/commands/test/runners/jest.js.map +1 -1
- package/dist/cli/commands/test/tests.js +13 -4
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +1 -6
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +2 -20
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +17 -13
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts +3 -0
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +41 -9
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts +9 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.js +18 -2
- package/dist/cli/tasks/swc-compile-package/get-swc-options.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts +3 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +17 -3
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/task.d.ts +2 -1
- package/dist/cli/tasks/task.d.ts.map +1 -1
- package/dist/cli/tasks/task.js +6 -3
- package/dist/cli/tasks/task.js.map +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -3
- package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
- package/dist/cli/utils/cli-git.d.ts +7 -0
- package/dist/cli/utils/cli-git.d.ts.map +1 -1
- package/dist/cli/utils/cli-git.js +30 -0
- package/dist/cli/utils/cli-git.js.map +1 -1
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +8 -1
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/cli-os.d.ts +7 -1
- package/dist/cli/utils/cli-os.d.ts.map +1 -1
- package/dist/cli/utils/cli-os.js +42 -0
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/compile.d.ts.map +1 -1
- package/dist/cli/utils/compile.js +7 -4
- package/dist/cli/utils/compile.js.map +1 -1
- package/dist/cli/utils/copy-files.js +1 -0
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/index.d.ts +1 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +1 -1
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/process-tree.js +2 -6
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/resolve-bundler.d.ts.map +1 -1
- package/dist/cli/utils/resolve-bundler.js +2 -1
- package/dist/cli/utils/resolve-bundler.js.map +1 -1
- package/dist/cli/utils/ts-config.d.ts +1 -1
- package/dist/cli/utils/ts-config.d.ts.map +1 -1
- package/dist/cli/utils/ts-config.js +1 -3
- package/dist/cli/utils/ts-config.js.map +1 -1
- package/dist/cli/utils/with-exponential-backoff.d.ts +7 -0
- package/dist/cli/utils/with-exponential-backoff.d.ts.map +1 -0
- package/dist/cli/utils/with-exponential-backoff.js +28 -0
- package/dist/cli/utils/with-exponential-backoff.js.map +1 -0
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +6 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/postinstall.js +118 -0
- package/dist/scripts/generate-bin-wrappers.js +203 -0
- package/dist/storybook-config/swc.d.ts +6 -0
- package/dist/storybook-config/swc.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +2 -1
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +21 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +15 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +176 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/utils/exit-when-parent-exits.d.ts +6 -0
- package/dist/utils/exit-when-parent-exits.d.ts.map +1 -0
- package/dist/utils/exit-when-parent-exits.js +37 -0
- package/dist/utils/exit-when-parent-exits.js.map +1 -0
- package/dist/utils/find-up.d.ts +1 -1
- package/dist/utils/find-up.d.ts.map +1 -1
- package/dist/utils/find-up.js +2 -2
- package/dist/utils/find-up.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +6 -3
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +10 -2
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/log.js +1 -3
- package/dist/utils/log.js.map +1 -1
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
- package/dist/vite/build-shared-dependencies.js +2 -0
- package/dist/vite/build-shared-dependencies.js.map +1 -1
- package/dist/vite/config/base-config.d.ts.map +1 -1
- package/dist/vite/config/base-config.js +12 -1
- package/dist/vite/config/base-config.js.map +1 -1
- package/dist/vite/config/create-filtering-logger.d.ts.map +1 -1
- package/dist/vite/config/create-filtering-logger.js +6 -2
- package/dist/vite/config/create-filtering-logger.js.map +1 -1
- package/dist/vite/config/create-vite-config.js +7 -2
- package/dist/vite/config/create-vite-config.js.map +1 -1
- package/dist/vite/config/load-config-file.js +8 -19
- package/dist/vite/config/load-config-file.js.map +1 -1
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.html +2 -2
- package/dist/vite/index.js +16 -0
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugins/chain-source-maps-plugin.js +1 -1
- package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -1
- package/dist/vite/plugins/clean-plugin.js +1 -1
- package/dist/vite/plugins/clean-plugin.js.map +1 -1
- package/dist/vite/plugins/css-injector-plugin.js +1 -1
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -1
- package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/design-system-guard-plugin.js +10 -5
- package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.js +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -1
- package/dist/vite/plugins/externals-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/externals-plugin.js +11 -5
- package/dist/vite/plugins/externals-plugin.js.map +1 -1
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/html-plugin.js +5 -3
- package/dist/vite/plugins/html-plugin.js.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +2 -2
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.js +36 -24
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/index.d.ts +3 -0
- package/dist/vite/plugins/index.d.ts.map +1 -1
- package/dist/vite/plugins/index.js +3 -0
- package/dist/vite/plugins/index.js.map +1 -1
- package/dist/vite/plugins/less-tilde-plugin.d.ts +8 -0
- package/dist/vite/plugins/less-tilde-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/less-tilde-plugin.js +53 -0
- package/dist/vite/plugins/less-tilde-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +1 -1
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -1
- package/dist/vite/plugins/metadata-plugin.js +1 -1
- package/dist/vite/plugins/metadata-plugin.js.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.js +30 -14
- package/dist/vite/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/vite/plugins/react-refresh-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/react-refresh-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/index.js +20 -0
- package/dist/vite/plugins/react-refresh-plugin/index.js.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts +4 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js +143 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js +14 -11
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -1
- package/dist/vite/plugins/style-urls-plugin.js +1 -1
- package/dist/vite/plugins/style-urls-plugin.js.map +1 -1
- package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/virtual-modules-plugin.js +9 -6
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/window-externals-plugin.d.ts +22 -0
- package/dist/vite/plugins/window-externals-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/window-externals-plugin.js +74 -0
- package/dist/vite/plugins/window-externals-plugin.js.map +1 -0
- package/dist/webpack/bundle-webpack.d.ts.map +1 -1
- package/dist/webpack/bundle-webpack.js +6 -1
- package/dist/webpack/bundle-webpack.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +17 -12
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +1 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +1 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/configuration.expose-loader.js +13 -0
- package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/index.js +1 -0
- package/dist/webpack/utils/index.d.ts +1 -0
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +1 -0
- package/dist/webpack/utils/index.js.map +1 -1
- package/dist/webpack/utils/normalize-proxy-config.d.ts +6 -0
- package/dist/webpack/utils/normalize-proxy-config.d.ts.map +1 -0
- package/dist/webpack/utils/normalize-proxy-config.js +52 -0
- package/dist/webpack/utils/normalize-proxy-config.js.map +1 -0
- package/package.json +32 -26
- package/src/cli/commands/__tests__/build.test.ts +81 -20
- package/src/cli/commands/__tests__/bundle-package.test.ts +65 -0
- package/src/cli/commands/__tests__/command.test.ts +154 -0
- package/src/cli/commands/__tests__/init.test.ts +1 -1
- package/src/cli/commands/__tests__/install.test.ts +5 -72
- package/src/cli/commands/__tests__/mfe-check.test.ts +26 -5
- package/src/cli/commands/__tests__/run-task.test.ts +20 -1
- package/src/cli/commands/__tests__/start.test.ts +77 -16
- package/src/cli/commands/build.ts +15 -6
- package/src/cli/commands/bundle-package.ts +20 -0
- package/src/cli/commands/command.ts +64 -0
- package/src/cli/commands/init.ts +0 -1
- package/src/cli/commands/install.ts +5 -21
- package/src/cli/commands/mfe-check.ts +6 -10
- package/src/cli/commands/registry/build.ts +3 -2
- package/src/cli/commands/registry/bundle-package.ts +22 -0
- package/src/cli/commands/registry/command-registry.ts +2 -0
- package/src/cli/commands/registry/install.ts +1 -6
- package/src/cli/commands/registry/start.ts +3 -2
- package/src/cli/commands/run-task.ts +8 -2
- package/src/cli/commands/start.ts +17 -6
- package/src/cli/commands/types.ts +2 -6
- package/src/cli/index.ts +3 -0
- package/src/cli/tasks/__tests__/cli-task.test.ts +181 -69
- package/src/cli/tasks/__tests__/task.test.ts +40 -45
- package/src/cli/tasks/cli-task.ts +43 -2
- package/src/cli/tasks/swc-compile-package/__tests__/get-swc-options.test.ts +46 -4
- package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +25 -4
- package/src/cli/tasks/swc-compile-package/get-swc-options.ts +14 -1
- package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +6 -2
- package/src/cli/tasks/task.ts +8 -2
- package/src/cli/tasks/tsc-compile/__tests__/tsc-compile.test.ts +8 -32
- package/src/cli/tasks/tsc-compile-package/__tests__/tsc-compile-package.test.ts +10 -19
- package/src/cli/utils/__tests__/cli-git.test.ts +54 -3
- package/src/cli/utils/__tests__/cli-npm.test.ts +33 -0
- package/src/cli/utils/__tests__/cli-os.test.ts +183 -4
- package/src/cli/utils/__tests__/compile.test.ts +37 -2
- package/src/cli/utils/__tests__/copy-files.test.ts +1 -1
- package/src/cli/utils/__tests__/with-exponential-backoff.test.ts +119 -0
- package/src/cli/utils/cli-git.ts +27 -1
- package/src/cli/utils/cli-npm.ts +19 -4
- package/src/cli/utils/cli-os.ts +44 -0
- package/src/cli/utils/compile.ts +8 -1
- package/src/cli/utils/copy-files.ts +1 -1
- package/src/cli/utils/index.ts +1 -1
- package/src/cli/utils/resolve-bundler.ts +2 -1
- package/src/cli/utils/ts-config.ts +1 -1
- package/src/cli/utils/with-exponential-backoff.ts +28 -0
- package/src/core/constants.ts +2 -0
- package/src/storybook-config/__tests__/vite-final.test.ts +6 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +26 -12
- package/src/storybook-config/webpack-final.ts +10 -4
- package/src/telemetry/__tests__/telemetry.test.ts +326 -0
- package/src/telemetry/index.ts +2 -0
- package/src/telemetry/telemetry.ts +134 -0
- package/src/utils/__tests__/exit-when-parent-exits.test.ts +87 -0
- package/src/utils/__tests__/find-up.test.ts +49 -0
- package/src/utils/__tests__/get-configuration.test.ts +62 -0
- package/src/utils/exit-when-parent-exits.ts +33 -0
- package/src/utils/find-up.ts +2 -2
- package/src/utils/get-configuration.ts +14 -5
- package/src/utils/index.ts +1 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +39 -5
- package/src/vite/build-shared-dependencies.ts +2 -1
- package/src/vite/config/__tests__/base-config.test.ts +12 -4
- package/src/vite/config/__tests__/create-css-config.test.ts +2 -6
- package/src/vite/config/__tests__/create-filtering-logger.test.ts +3 -2
- package/src/vite/config/__tests__/create-vite-config.test.ts +6 -3
- package/src/vite/config/base-config.ts +13 -1
- package/src/vite/config/create-filtering-logger.ts +8 -2
- package/src/vite/config/create-vite-config.ts +6 -3
- package/src/vite/index.html +2 -2
- package/src/vite/index.ts +2 -0
- package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/clean-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +15 -3
- package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/externals-plugin.test.ts +24 -3
- package/src/vite/plugins/__tests__/html-plugin.test.ts +10 -3
- package/src/vite/plugins/__tests__/html-template.test.ts +10 -2
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +30 -6
- package/src/vite/plugins/__tests__/less-tilde-plugin.test.ts +91 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +35 -25
- package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +20 -9
- package/src/vite/plugins/__tests__/window-externals-plugin.test.ts +128 -0
- package/src/vite/plugins/chain-source-maps-plugin.ts +1 -1
- package/src/vite/plugins/clean-plugin.ts +1 -1
- package/src/vite/plugins/css-injector-plugin.ts +1 -1
- package/src/vite/plugins/design-system-guard-plugin.ts +11 -8
- package/src/vite/plugins/dev-server-routing-plugin.ts +1 -1
- package/src/vite/plugins/externals-plugin.ts +15 -6
- package/src/vite/plugins/html-plugin.ts +4 -2
- package/src/vite/plugins/ignore-modules-plugin.ts +32 -23
- package/src/vite/plugins/index.ts +3 -0
- package/src/vite/plugins/less-tilde-plugin.ts +64 -0
- package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +1 -1
- package/src/vite/plugins/metadata-plugin.ts +1 -1
- package/src/vite/plugins/moment-locales-plugin.ts +24 -14
- package/src/vite/plugins/react-refresh-plugin/README.md +165 -0
- package/src/vite/plugins/react-refresh-plugin/__tests__/react-refresh-plugin.test.ts +366 -0
- package/src/vite/plugins/react-refresh-plugin/__tests__/refresh-runtime.test.ts +193 -0
- package/src/vite/plugins/react-refresh-plugin/index.ts +1 -0
- package/src/vite/plugins/react-refresh-plugin/react-refresh-plugin.ts +144 -0
- package/src/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/shared-dependencies-plugin.test.ts +21 -16
- package/src/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.ts +13 -12
- package/src/vite/plugins/style-urls-plugin.ts +1 -1
- package/src/vite/plugins/virtual-modules-plugin.ts +8 -7
- package/src/vite/plugins/window-externals-plugin.ts +94 -0
- package/src/webpack/__tests__/bundle-webpack.test.ts +32 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +27 -1
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -5
- package/src/webpack/__tests__/create-webpack-config.test.ts +10 -6
- package/src/webpack/bundle-webpack.ts +7 -1
- package/src/webpack/configs/optimization-config.ts +22 -11
- package/src/webpack/configs/output-config.ts +1 -1
- package/src/webpack/utils/__tests__/normalize-proxy-config.test.ts +121 -0
- package/src/webpack/utils/index.ts +1 -0
- package/src/webpack/utils/normalize-proxy-config.ts +59 -0
- package/tsconfig/types.d.ts +10 -0
- package/dist/cli/utils/get-bundle-command.d.ts +0 -3
- package/dist/cli/utils/get-bundle-command.d.ts.map +0 -1
- package/dist/cli/utils/get-bundle-command.js +0 -16
- package/dist/cli/utils/get-bundle-command.js.map +0 -1
- package/src/cli/utils/__tests__/get-bundle-command.test.ts +0 -23
- package/src/cli/utils/get-bundle-command.ts +0 -5
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Telemetry () {
|
|
13
|
+
return Telemetry;
|
|
14
|
+
},
|
|
15
|
+
get telemetry () {
|
|
16
|
+
return telemetry;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _install = require("@servicetitan/install");
|
|
20
|
+
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
21
|
+
const _cligit = require("../cli/utils/cli-git");
|
|
22
|
+
const _core = require("../core");
|
|
23
|
+
function _define_property(obj, key, value) {
|
|
24
|
+
if (key in obj) {
|
|
25
|
+
Object.defineProperty(obj, key, {
|
|
26
|
+
value: value,
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true
|
|
30
|
+
});
|
|
31
|
+
} else obj[key] = value;
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
function _interop_require_default(obj) {
|
|
35
|
+
return obj && obj.__esModule ? obj : {
|
|
36
|
+
default: obj
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const DDSOURCE = 'frontend-platform';
|
|
40
|
+
const SERVICE = 'startup';
|
|
41
|
+
const SITE = 'datadoghq.com';
|
|
42
|
+
const REQUEST_TIMEOUT_MS = 2000;
|
|
43
|
+
function toError(error) {
|
|
44
|
+
if (error instanceof Error) {
|
|
45
|
+
return {
|
|
46
|
+
message: error.message,
|
|
47
|
+
kind: error.name,
|
|
48
|
+
stack: error.stack
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (typeof error === 'string') {
|
|
52
|
+
return {
|
|
53
|
+
message: error
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return {
|
|
58
|
+
message: JSON.stringify(error)
|
|
59
|
+
};
|
|
60
|
+
} catch (unused) {
|
|
61
|
+
return {
|
|
62
|
+
message: 'unserializable error value'
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function getClientToken() {
|
|
67
|
+
if (process.env.DATADOG_CLIENT_TOKEN) {
|
|
68
|
+
return process.env.DATADOG_CLIENT_TOKEN;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const secrets = require('@servicetitan/secrets');
|
|
72
|
+
return secrets.datadogStartupClientToken;
|
|
73
|
+
} catch (unused) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function getBaseContext() {
|
|
78
|
+
var _process_env_AI_AGENT;
|
|
79
|
+
const git = await (0, _cligit.gitGetContext)();
|
|
80
|
+
return {
|
|
81
|
+
service: SERVICE,
|
|
82
|
+
repo: git.repo,
|
|
83
|
+
branch: git.branch,
|
|
84
|
+
startupVersion: (0, _core.getStartupVersion)(),
|
|
85
|
+
ci: (0, _install.isCI)(),
|
|
86
|
+
agent: Boolean((_process_env_AI_AGENT = process.env.AI_AGENT) !== null && _process_env_AI_AGENT !== void 0 ? _process_env_AI_AGENT : process.env.CURSOR_AGENT),
|
|
87
|
+
hostname: _os.default.hostname(),
|
|
88
|
+
os: process.platform,
|
|
89
|
+
node: process.versions.node,
|
|
90
|
+
usr: {
|
|
91
|
+
email: git.userEmail,
|
|
92
|
+
name: git.userName
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
async function resolveContext() {
|
|
97
|
+
const clientToken = getClientToken();
|
|
98
|
+
if (!clientToken) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
const baseAttributes = await getBaseContext().catch(()=>({}));
|
|
102
|
+
return {
|
|
103
|
+
clientToken,
|
|
104
|
+
baseAttributes
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
class Telemetry {
|
|
108
|
+
info(name, attributes = {}) {
|
|
109
|
+
this.event(name, 'info', attributes);
|
|
110
|
+
}
|
|
111
|
+
warn(name, attributes = {}) {
|
|
112
|
+
this.event(name, 'warn', attributes);
|
|
113
|
+
}
|
|
114
|
+
error(name, error, attributes = {}) {
|
|
115
|
+
this.event(name, 'error', {
|
|
116
|
+
...attributes,
|
|
117
|
+
error: toError(error)
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async flush() {
|
|
121
|
+
/*
|
|
122
|
+
* Promise.all, not allSettled: pending requests never reject, and swallowing
|
|
123
|
+
* here would leave failures asymmetric on whether flush ran (a race).
|
|
124
|
+
*/ await Promise.all([
|
|
125
|
+
...this.pendingRequests
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
init() {
|
|
129
|
+
var _this_initPromise;
|
|
130
|
+
(_this_initPromise = this.initPromise) !== null && _this_initPromise !== void 0 ? _this_initPromise : this.initPromise = resolveContext();
|
|
131
|
+
return this.initPromise;
|
|
132
|
+
}
|
|
133
|
+
event(name, status, attributes) {
|
|
134
|
+
try {
|
|
135
|
+
this.send({
|
|
136
|
+
message: name,
|
|
137
|
+
status,
|
|
138
|
+
date: Date.now(),
|
|
139
|
+
...attributes
|
|
140
|
+
});
|
|
141
|
+
} catch (unused) {} // eslint-disable-line no-empty
|
|
142
|
+
}
|
|
143
|
+
send(event) {
|
|
144
|
+
const request = this.init().then((context)=>{
|
|
145
|
+
if (!context) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const { clientToken, baseAttributes } = context;
|
|
149
|
+
const controller = new AbortController();
|
|
150
|
+
const timer = setTimeout(()=>controller.abort(), REQUEST_TIMEOUT_MS);
|
|
151
|
+
timer.unref();
|
|
152
|
+
const url = `https://browser-intake-${SITE}/api/v2/logs` + `?dd-api-key=${encodeURIComponent(clientToken)}&ddsource=${DDSOURCE}`;
|
|
153
|
+
return fetch(url, {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers: {
|
|
156
|
+
'Content-Type': 'application/json'
|
|
157
|
+
},
|
|
158
|
+
body: JSON.stringify([
|
|
159
|
+
{
|
|
160
|
+
...baseAttributes,
|
|
161
|
+
...event
|
|
162
|
+
}
|
|
163
|
+
]),
|
|
164
|
+
signal: controller.signal
|
|
165
|
+
}).finally(()=>clearTimeout(timer));
|
|
166
|
+
}).catch(()=>{}).finally(()=>this.pendingRequests.delete(request));
|
|
167
|
+
this.pendingRequests.add(request);
|
|
168
|
+
}
|
|
169
|
+
constructor(){
|
|
170
|
+
_define_property(this, "initPromise", void 0);
|
|
171
|
+
_define_property(this, "pendingRequests", new Set());
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const telemetry = new Telemetry();
|
|
175
|
+
|
|
176
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/telemetry/telemetry.ts"],"sourcesContent":["import { isCI } from '@servicetitan/install';\nimport os from 'os';\nimport { gitGetContext } from '../cli/utils/cli-git';\nimport { getStartupVersion } from '../core';\n\nconst DDSOURCE = 'frontend-platform';\nconst SERVICE = 'startup';\nconst SITE = 'datadoghq.com';\nconst REQUEST_TIMEOUT_MS = 2000;\n\ntype Status = 'info' | 'warn' | 'error';\nexport type AttributeValue = string | number | boolean | undefined;\nexport type Attributes = Record<string, AttributeValue | Record<string, AttributeValue>>;\n\ninterface Context {\n clientToken: string;\n baseAttributes: Attributes;\n}\n\nfunction toError(error: unknown): { message: string; kind?: string; stack?: string } {\n if (error instanceof Error) {\n return { message: error.message, kind: error.name, stack: error.stack };\n }\n if (typeof error === 'string') {\n return { message: error };\n }\n try {\n return { message: JSON.stringify(error) };\n } catch {\n return { message: 'unserializable error value' };\n }\n}\n\nfunction getClientToken(): string | undefined {\n if (process.env.DATADOG_CLIENT_TOKEN) {\n return process.env.DATADOG_CLIENT_TOKEN;\n }\n try {\n const secrets = require('@servicetitan/secrets') as {\n datadogStartupClientToken?: string;\n };\n return secrets.datadogStartupClientToken;\n } catch {\n return undefined;\n }\n}\n\nasync function getBaseContext(): Promise<Attributes> {\n const git = await gitGetContext();\n return {\n service: SERVICE,\n repo: git.repo,\n branch: git.branch,\n startupVersion: getStartupVersion(),\n ci: isCI(),\n agent: Boolean(process.env.AI_AGENT ?? process.env.CURSOR_AGENT),\n hostname: os.hostname(),\n os: process.platform,\n node: process.versions.node,\n usr: { email: git.userEmail, name: git.userName },\n };\n}\n\nasync function resolveContext(): Promise<Context | undefined> {\n const clientToken = getClientToken();\n if (!clientToken) {\n return undefined;\n }\n const baseAttributes = await getBaseContext().catch(() => ({}));\n return { clientToken, baseAttributes };\n}\n\nexport class Telemetry {\n private initPromise?: Promise<Context | undefined>;\n private readonly pendingRequests = new Set<Promise<unknown>>();\n\n info(name: string, attributes: Attributes = {}): void {\n this.event(name, 'info', attributes);\n }\n\n warn(name: string, attributes: Attributes = {}): void {\n this.event(name, 'warn', attributes);\n }\n\n error(name: string, error: unknown, attributes: Attributes = {}): void {\n this.event(name, 'error', { ...attributes, error: toError(error) });\n }\n\n async flush(): Promise<void> {\n /*\n * Promise.all, not allSettled: pending requests never reject, and swallowing\n * here would leave failures asymmetric on whether flush ran (a race).\n */\n await Promise.all([...this.pendingRequests]);\n }\n\n private init(): Promise<Context | undefined> {\n this.initPromise ??= resolveContext();\n return this.initPromise;\n }\n\n private event(name: string, status: Status, attributes: Attributes): void {\n try {\n this.send({ message: name, status, date: Date.now(), ...attributes });\n } catch {} // eslint-disable-line no-empty\n }\n\n private send(event: Attributes): void {\n const request = this.init()\n .then(context => {\n if (!context) {\n return;\n }\n const { clientToken, baseAttributes } = context;\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);\n timer.unref();\n const url =\n `https://browser-intake-${SITE}/api/v2/logs` +\n `?dd-api-key=${encodeURIComponent(clientToken)}&ddsource=${DDSOURCE}`;\n return fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify([{ ...baseAttributes, ...event }]),\n signal: controller.signal,\n }).finally(() => clearTimeout(timer));\n })\n .catch(() => {})\n .finally(() => this.pendingRequests.delete(request));\n this.pendingRequests.add(request);\n }\n}\n\nexport const telemetry = new Telemetry();\n"],"names":["Telemetry","telemetry","DDSOURCE","SERVICE","SITE","REQUEST_TIMEOUT_MS","toError","error","Error","message","kind","name","stack","JSON","stringify","getClientToken","process","env","DATADOG_CLIENT_TOKEN","secrets","require","datadogStartupClientToken","undefined","getBaseContext","git","gitGetContext","service","repo","branch","startupVersion","getStartupVersion","ci","isCI","agent","Boolean","AI_AGENT","CURSOR_AGENT","hostname","os","platform","node","versions","usr","email","userEmail","userName","resolveContext","clientToken","baseAttributes","catch","info","attributes","event","warn","flush","Promise","all","pendingRequests","init","initPromise","status","send","date","Date","now","request","then","context","controller","AbortController","timer","setTimeout","abort","unref","url","encodeURIComponent","fetch","method","headers","body","signal","finally","clearTimeout","delete","add","Set"],"mappings":";;;;;;;;;;;QAwEaA;eAAAA;;QA6DAC;eAAAA;;;yBArIQ;2DACN;wBACe;sBACI;;;;;;;;;;;;;;;;;AAElC,MAAMC,WAAW;AACjB,MAAMC,UAAU;AAChB,MAAMC,OAAO;AACb,MAAMC,qBAAqB;AAW3B,SAASC,QAAQC,KAAc;IAC3B,IAAIA,iBAAiBC,OAAO;QACxB,OAAO;YAAEC,SAASF,MAAME,OAAO;YAAEC,MAAMH,MAAMI,IAAI;YAAEC,OAAOL,MAAMK,KAA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;oBAAE,gBAAgB;gBAAmB;gBAC9CC,MAAMlE,KAAKC,SAAS,CAAC;oBAAC;wBAAE,GAAGkC,cAAc;wBAAE,GAAGI,KAAK;oBAAC;iBAAE;gBACtD4B,QAAQZ,WAAWY,MAAM;YAC7B,GAAGC,OAAO,CAAC,IAAMC,aAAaZ;QAClC,GACCrB,KAAK,CAAC,KAAO,GACbgC,OAAO,CAAC,IAAM,IAAI,CAACxB,eAAe,CAAC0B,MAAM,CAAClB;QAC/C,IAAI,CAACR,eAAe,CAAC2B,GAAG,CAACnB;IAC7B;;QAzDA,uBAAQN,eAAR,KAAA;QACA,uBAAiBF,mBAAkB,IAAI4B;;AAyD3C;AAEO,MAAMpF,YAAY,IAAID"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exits current process when the parent identified by process.env.STARTUP_PARENT_PID
|
|
3
|
+
* is no longer running. Use `callback` to override default behavior.
|
|
4
|
+
*/
|
|
5
|
+
export declare function exitWhenParentExits(command: string, callback?: () => void): void;
|
|
6
|
+
//# sourceMappingURL=exit-when-parent-exits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-when-parent-exits.d.ts","sourceRoot":"","sources":["../../src/utils/exit-when-parent-exits.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,IAA4B,QAchG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "exitWhenParentExits", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return exitWhenParentExits;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _log = require("./log");
|
|
12
|
+
const POLL_INTERVAL_MS = 1000;
|
|
13
|
+
function exitWhenParentExits(command, callback = ()=>process.exit(0)) {
|
|
14
|
+
const parentPid = Number(process.env.STARTUP_PARENT_PID);
|
|
15
|
+
if (!parentPid) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const interval = setInterval(()=>{
|
|
19
|
+
if (!isRunning(parentPid)) {
|
|
20
|
+
clearInterval(interval);
|
|
21
|
+
_log.log.info(`${command} shutting down`);
|
|
22
|
+
callback();
|
|
23
|
+
}
|
|
24
|
+
}, POLL_INTERVAL_MS);
|
|
25
|
+
interval.unref();
|
|
26
|
+
}
|
|
27
|
+
function isRunning(pid) {
|
|
28
|
+
try {
|
|
29
|
+
// signal 0 sends nothing; it only checks whether the pid exists
|
|
30
|
+
process.kill(pid, 0);
|
|
31
|
+
return true;
|
|
32
|
+
} catch (unused) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=exit-when-parent-exits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/exit-when-parent-exits.ts"],"sourcesContent":["import { log } from './log';\n\nconst POLL_INTERVAL_MS = 1000;\n\n/**\n * Exits current process when the parent identified by process.env.STARTUP_PARENT_PID\n * is no longer running. Use `callback` to override default behavior.\n */\nexport function exitWhenParentExits(command: string, callback: () => void = () => process.exit(0)) {\n const parentPid = Number(process.env.STARTUP_PARENT_PID);\n if (!parentPid) {\n return;\n }\n\n const interval = setInterval(() => {\n if (!isRunning(parentPid)) {\n clearInterval(interval);\n log.info(`${command} shutting down`);\n callback();\n }\n }, POLL_INTERVAL_MS);\n interval.unref();\n}\n\nfunction isRunning(pid: number) {\n try {\n // signal 0 sends nothing; it only checks whether the pid exists\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n"],"names":["exitWhenParentExits","POLL_INTERVAL_MS","command","callback","process","exit","parentPid","Number","env","STARTUP_PARENT_PID","interval","setInterval","isRunning","clearInterval","log","info","unref","pid","kill"],"mappings":";;;;+BAQgBA;;;eAAAA;;;qBARI;AAEpB,MAAMC,mBAAmB;AAMlB,SAASD,oBAAoBE,OAAe,EAAEC,WAAuB,IAAMC,QAAQC,IAAI,CAAC,EAAE;IAC7F,MAAMC,YAAYC,OAAOH,QAAQI,GAAG,CAACC,kBAAkB;IACvD,IAAI,CAACH,WAAW;QACZ;IACJ;IAEA,MAAMI,WAAWC,YAAY;QACzB,IAAI,CAACC,UAAUN,YAAY;YACvBO,cAAcH;YACdI,QAAG,CAACC,IAAI,CAAC,GAAGb,QAAQ,cAAc,CAAC;YACnCC;QACJ;IACJ,GAAGF;IACHS,SAASM,KAAK;AAClB;AAEA,SAASJ,UAAUK,GAAW;IAC1B,IAAI;QACA,gEAAgE;QAChEb,QAAQc,IAAI,CAACD,KAAK;QAClB,OAAO;IACX,EAAE,eAAM;QACJ,OAAO;IACX;AACJ"}
|
package/dist/utils/find-up.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function findUp<T>(callback: (directory: string) => T | undefined): NonNullable<T> | undefined;
|
|
1
|
+
export declare function findUp<T>(callback: (directory: string) => T | undefined, from?: string): NonNullable<T> | undefined;
|
|
2
2
|
//# sourceMappingURL=find-up.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-up.d.ts","sourceRoot":"","sources":["../../src/utils/find-up.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"find-up.d.ts","sourceRoot":"","sources":["../../src/utils/find-up.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,EAAE,IAAI,SAAO,8BASpF"}
|
package/dist/utils/find-up.js
CHANGED
|
@@ -14,8 +14,8 @@ function _interop_require_default(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function findUp(callback) {
|
|
18
|
-
let directory = _nodepath.default.resolve(
|
|
17
|
+
function findUp(callback, from = './') {
|
|
18
|
+
let directory = _nodepath.default.resolve(from);
|
|
19
19
|
do {
|
|
20
20
|
const result = callback(directory);
|
|
21
21
|
if (result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/find-up.ts"],"sourcesContent":["import path from 'node:path';\n\nexport function findUp<T>(callback: (directory: string) => T | undefined) {\n let directory = path.resolve(
|
|
1
|
+
{"version":3,"sources":["../../src/utils/find-up.ts"],"sourcesContent":["import path from 'node:path';\n\nexport function findUp<T>(callback: (directory: string) => T | undefined, from = './') {\n let directory = path.resolve(from);\n do {\n const result = callback(directory);\n if (result) {\n return result;\n }\n directory = path.resolve(path.join(directory, '../'));\n } while (path.parse(directory).name);\n}\n"],"names":["findUp","callback","from","directory","path","resolve","result","join","parse","name"],"mappings":";;;;+BAEgBA;;;eAAAA;;;iEAFC;;;;;;AAEV,SAASA,OAAUC,QAA8C,EAAEC,OAAO,IAAI;IACjF,IAAIC,YAAYC,iBAAI,CAACC,OAAO,CAACH;IAC7B,GAAG;QACC,MAAMI,SAASL,SAASE;QACxB,IAAIG,QAAQ;YACR,OAAOA;QACX;QACAH,YAAYC,iBAAI,CAACC,OAAO,CAACD,iBAAI,CAACG,IAAI,CAACJ,WAAW;IAClD,QAASC,iBAAI,CAACI,KAAK,CAACL,WAAWM,IAAI,CAAE;AACzC"}
|
|
@@ -6,10 +6,11 @@ import type svgr from 'vite-plugin-svgr';
|
|
|
6
6
|
import type { ViteUserConfig } from 'vitest/config';
|
|
7
7
|
import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
|
|
8
8
|
import type { ReviewConfiguration } from '../cli/commands/review';
|
|
9
|
+
import { bundleConstants } from '../core/constants';
|
|
9
10
|
import { LocationOrJson } from './types';
|
|
10
11
|
type VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;
|
|
11
12
|
type ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;
|
|
12
|
-
export type Bundler =
|
|
13
|
+
export type Bundler = ElementType<typeof bundleConstants.bundlers>;
|
|
13
14
|
export declare const allowedWebpackDevServerOptions: readonly ["headers", "port", "proxy", "static"];
|
|
14
15
|
export interface MinifyJSOptions {
|
|
15
16
|
compress?: boolean;
|
|
@@ -46,6 +47,7 @@ export interface NodeConfiguration {
|
|
|
46
47
|
}
|
|
47
48
|
export declare enum CommandName {
|
|
48
49
|
'build' = "build",
|
|
50
|
+
'bundle-package' = "bundle-package",
|
|
49
51
|
'bundle-vite' = "bundle-vite",
|
|
50
52
|
'bundle-webpack' = "bundle-webpack",
|
|
51
53
|
'clean' = "clean",
|
|
@@ -111,7 +113,7 @@ interface WebComponentOptions {
|
|
|
111
113
|
*/
|
|
112
114
|
branches?: Record<string, WebComponentBranchConfigs>;
|
|
113
115
|
}
|
|
114
|
-
type Configuration = {
|
|
116
|
+
export type Configuration = {
|
|
115
117
|
'bundler'?: Bundler;
|
|
116
118
|
'jest'?: JestConfiguration;
|
|
117
119
|
'legacy'?: boolean;
|
|
@@ -152,7 +154,8 @@ export declare function getSwcCompilePackageConfiguration(): import("@swc/cli").
|
|
|
152
154
|
export declare function isBundle(locationOrJson?: LocationOrJson): boolean;
|
|
153
155
|
export declare function isDevServerDisabled(): boolean;
|
|
154
156
|
export declare function isViteDevServerDisabled(): boolean;
|
|
155
|
-
export declare function
|
|
157
|
+
export declare function getSharedDependencies(locationOrJson?: LocationOrJson): Record<string, string> | undefined;
|
|
158
|
+
export declare function isExposeSharedDependencies(locationOrJson?: LocationOrJson): boolean;
|
|
156
159
|
export declare function isLegacy(locationOrJson?: LocationOrJson): boolean;
|
|
157
160
|
export declare function isLegacyRoot(): boolean;
|
|
158
161
|
export declare function isStyleCheckDisabled(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,IAAI,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,IAAI,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,qBAAqB,GAAG,WAAW,CAAC,UAAU,CAA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B,YAGlC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,cAAc,sCAKpE;AAED,wBAAgB,0BAA0B,CAAC,cAAc,CAAC,EAAE,cAAc,WAKzE;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAEvD;AAED,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,cAAc,CAAC,cAAc,GAAE,cAAqB,WAEnE"}
|
|
@@ -33,6 +33,9 @@ _export(exports, {
|
|
|
33
33
|
get getReviewConfiguration () {
|
|
34
34
|
return getReviewConfiguration;
|
|
35
35
|
},
|
|
36
|
+
get getSharedDependencies () {
|
|
37
|
+
return getSharedDependencies;
|
|
38
|
+
},
|
|
36
39
|
get getStylelintConfiguration () {
|
|
37
40
|
return getStylelintConfiguration;
|
|
38
41
|
},
|
|
@@ -101,6 +104,7 @@ const allowedWebpackDevServerOptions = [
|
|
|
101
104
|
];
|
|
102
105
|
var CommandName = /*#__PURE__*/ function(CommandName) {
|
|
103
106
|
CommandName["build"] = "build";
|
|
107
|
+
CommandName["bundle-package"] = "bundle-package";
|
|
104
108
|
CommandName["bundle-vite"] = "bundle-vite";
|
|
105
109
|
CommandName["bundle-webpack"] = "bundle-webpack";
|
|
106
110
|
CommandName["clean"] = "clean";
|
|
@@ -220,9 +224,13 @@ function isDevServerDisabled() {
|
|
|
220
224
|
function isViteDevServerDisabled() {
|
|
221
225
|
return getViteConfiguration().devServer === false;
|
|
222
226
|
}
|
|
223
|
-
function
|
|
227
|
+
function getSharedDependencies(locationOrJson) {
|
|
228
|
+
var _getConfiguration_shareddependencies;
|
|
229
|
+
return (_getConfiguration_shareddependencies = getConfiguration(locationOrJson)['shared-dependencies']) !== null && _getConfiguration_shareddependencies !== void 0 ? _getConfiguration_shareddependencies : getWebpackConfiguration(locationOrJson)['shared-dependencies'];
|
|
230
|
+
}
|
|
231
|
+
function isExposeSharedDependencies(locationOrJson) {
|
|
224
232
|
var _getConfiguration_exposeshareddependencies;
|
|
225
|
-
return ((_getConfiguration_exposeshareddependencies = getConfiguration()['expose-shared-dependencies']) !== null && _getConfiguration_exposeshareddependencies !== void 0 ? _getConfiguration_exposeshareddependencies : getWebpackConfiguration()['expose-shared-dependencies']) === true;
|
|
233
|
+
return ((_getConfiguration_exposeshareddependencies = getConfiguration(locationOrJson)['expose-shared-dependencies']) !== null && _getConfiguration_exposeshareddependencies !== void 0 ? _getConfiguration_exposeshareddependencies : getWebpackConfiguration(locationOrJson)['expose-shared-dependencies']) === true;
|
|
226
234
|
}
|
|
227
235
|
function isLegacy(locationOrJson) {
|
|
228
236
|
return getConfiguration(locationOrJson).legacy === true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import type { Config } from '@jest/types';\nimport type { swcDir } from '@swc/cli';\nimport type { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport type { LinterOptions } from 'stylelint';\nimport type svgr from 'vite-plugin-svgr';\nimport type { ViteUserConfig } from 'vitest/config';\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { ReviewConfiguration } from '../cli/commands/review';\nimport { getFolders } from './get-folders';\nimport { getPackageName } from './get-package-name';\nimport { log } from './log';\nimport { readJson, readJsonSafe } from './read-json';\nimport { LocationOrJson } from './types';\n\ntype VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport type Bundler = 'vite' | 'webpack';\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n> {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n 'shared-dependencies'?: Record<string, string>;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport interface JestConfiguration extends Omit<Config.Argv, '_' | '$0'> {\n omitDefault?: string[];\n}\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-vite' = 'bundle-vite',\n 'bundle-webpack' = 'bundle-webpack',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-check' = 'mfe-check',\n 'mfe-generate-metadata' = 'mfe-generate-metadata',\n 'mfe-list' = 'mfe-list',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-package-rollback' = 'mfe-package-rollback',\n 'mfe-publish' = 'mfe-publish',\n 'mfe-purge-cache' = 'mfe-purge-cache',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'stylelint' = 'stylelint',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'] & {\n omitDefault?: string[];\n};\n\nexport interface HtmlPluginOptions {\n title?: string;\n favicon?: string;\n template?: string;\n}\n\nexport interface SvgrPluginOptions {\n include?: VitePluginSvgrOptions['include'];\n exclude?: VitePluginSvgrOptions['exclude'];\n svgrOptions?: VitePluginSvgrOptions['svgrOptions'];\n}\n\nexport interface PluginOverrides {\n html?: HtmlPluginOptions;\n svgr?: SvgrPluginOptions;\n}\n\nexport interface ViteBundlerConfig {\n port?: number;\n omitDefault?: string[];\n minify?: MinifyOptions;\n pluginOverrides?: PluginOverrides;\n}\n\nexport interface VitePackageJsonOverride extends ViteBundlerConfig {\n config?: Omit<import('vite').UserConfig, 'plugins'>;\n devServer?: false;\n}\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\ntype Configuration = {\n 'bundler'?: Bundler;\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'expose-process-env'?: string[];\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n 'vite'?: false | VitePackageJsonOverride;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getExposeProcessEnv(): string[] {\n return getConfiguration()['expose-process-env'] ?? [];\n}\n\nexport function getViteConfiguration(): VitePackageJsonOverride {\n const { vite } = getConfiguration();\n return typeof vite === 'object' ? vite : {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n const { webpack, vite } = getConfiguration(locationOrJson);\n assertBundlersAgree(webpack, vite, locationOrJson);\n return webpack !== false && vite !== false;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isViteDevServerDisabled() {\n return getViteConfiguration().devServer === false;\n}\n\nexport function isExposeSharedDependencies() {\n return (\n (getConfiguration()['expose-shared-dependencies'] ??\n getWebpackConfiguration()['expose-shared-dependencies']) === true\n );\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n\n/*\n * Require that Vite and Webpack configurations agree whether package is a bundle.\n */\nfunction assertBundlersAgree(\n webpack: Configuration['webpack'],\n vite: Configuration['vite'],\n locationOrJson?: LocationOrJson\n) {\n if (webpack === undefined || vite === undefined || !!webpack === !!vite) {\n return;\n }\n\n const mismatch =\n webpack === false\n ? { falsy: 'cli.webpack', truthy: 'cli.vite' }\n : { falsy: 'cli.vite', truthy: 'cli.webpack' };\n\n throw new Error(\n `package ${getPackageName(locationOrJson)} has conflicting webpack ` +\n `and vite configurations: ${mismatch.falsy} is false but ` +\n `${mismatch.truthy} is not`\n );\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getExposeProcessEnv","getJestConfiguration","getReviewConfiguration","getStylelintConfiguration","getSwcCompilePackageConfiguration","getViteConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isViteDevServerDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vite","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","assertBundlersAgree","webpackConfiguration","devServer","legacy","legacyRoot","mismatch","falsy","truthy","Error","getPackageName"],"mappings":";;;;;;;;;;;QAqEYA;eAAAA;;QA/CCC;eAAAA;;QAgJGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAiBAC;eAAAA;;QAbAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAiEAC;eAAAA;;QAzDAC;eAAAA;;QAKAC;eAAAA;;QAmCAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAMAC;eAAAA;;QASAC;eAAAA;;QAOAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAnBAC;eAAAA;;QAuBAC;eAAAA;;;2DAvSD;6DACE;4BAMU;gCACI;qBACX;0BACmB;;;;;;AAShC,MAAMtB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAAA;;AAiGL,SAASE,iBAAiBsB,iBAAiC,IAAI;;IAClE,MAAMC,OACF,OAAOD,mBAAmB,WACpBE,IAAAA,kBAAQ,EAACC,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACnCA;IACV,eAAOC,iBAAAA,2BAAAA,KAAMI,GAAG,uCAAI,CAAC;AACzB;AAEO,SAAS1B,qBAAqBqB,iBAAiC,IAAI;;IACtE,MAAMC,OACF,OAAOD,mBAAmB,WACpBM,IAAAA,sBAAY,EAACH,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACvCA;IACV,eAAOC,iBAAAA,2BAAAA,KAAMI,GAAG,uCAAI,CAAC;AACzB;AAEO,SA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oDAAAA,8BAAgC6C,UAAU,MAAK;AAC1D;AAEO,SAASrC;IACZ,OAAOP,yBAAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASS,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACX,6BAA6BW;AAC1C;AAEA;;CAEC,GACD,SAAS8B,oBACLd,OAAiC,EACjCF,IAA2B,EAC3Bd,cAA+B;IAE/B,IAAIgB,YAAYS,aAAaX,SAASW,aAAa,CAAC,CAACT,YAAY,CAAC,CAACF,MAAM;QACrE;IACJ;IAEA,MAAMqB,WACFnB,YAAY,QACN;QAAEoB,OAAO;QAAeC,QAAQ;IAAW,IAC3C;QAAED,OAAO;QAAYC,QAAQ;IAAc;IAErD,MAAM,IAAIC,MACN,CAAC,QAAQ,EAAEC,IAAAA,8BAAc,EAACvC,gBAAgB,yBAAyB,CAAC,GAChE,CAAC,yBAAyB,EAAEmC,SAASC,KAAK,CAAC,cAAc,CAAC,GAC1D,GAAGD,SAASE,MAAM,CAAC,OAAO,CAAC;AAEvC"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import type { Config } from '@jest/types';\nimport type { swcDir } from '@swc/cli';\nimport type { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport type { LinterOptions } from 'stylelint';\nimport type svgr from 'vite-plugin-svgr';\nimport type { ViteUserConfig } from 'vitest/config';\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { ReviewConfiguration } from '../cli/commands/review';\nimport { bundleConstants } from '../core/constants';\nimport { getFolders } from './get-folders';\nimport { getPackageName } from './get-package-name';\nimport { log } from './log';\nimport { readJson, readJsonSafe } from './read-json';\nimport { LocationOrJson } from './types';\n\ntype VitePluginSvgrOptions = NonNullable<Parameters<typeof svgr>[0]>;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport type Bundler = ElementType<typeof bundleConstants.bundlers>;\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n> {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n 'shared-dependencies'?: Record<string, string>;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport interface JestConfiguration extends Omit<Config.Argv, '_' | '$0'> {\n omitDefault?: string[];\n}\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-package' = 'bundle-package',\n 'bundle-vite' = 'bundle-vite',\n 'bundle-webpack' = 'bundle-webpack',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-check' = 'mfe-check',\n 'mfe-generate-metadata' = 'mfe-generate-metadata',\n 'mfe-list' = 'mfe-list',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-package-rollback' = 'mfe-package-rollback',\n 'mfe-publish' = 'mfe-publish',\n 'mfe-purge-cache' = 'mfe-purge-cache',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'stylelint' = 'stylelint',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'] & {\n omitDefault?: string[];\n};\n\nexport interface HtmlPluginOptions {\n title?: string;\n favicon?: string;\n template?: string;\n}\n\nexport interface SvgrPluginOptions {\n include?: VitePluginSvgrOptions['include'];\n exclude?: VitePluginSvgrOptions['exclude'];\n svgrOptions?: VitePluginSvgrOptions['svgrOptions'];\n}\n\nexport interface PluginOverrides {\n html?: HtmlPluginOptions;\n svgr?: SvgrPluginOptions;\n}\n\nexport interface ViteBundlerConfig {\n port?: number;\n omitDefault?: string[];\n minify?: MinifyOptions;\n pluginOverrides?: PluginOverrides;\n}\n\nexport interface VitePackageJsonOverride extends ViteBundlerConfig {\n config?: Omit<import('vite').UserConfig, 'plugins'>;\n devServer?: false;\n}\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\nexport type Configuration = {\n 'bundler'?: Bundler;\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'expose-process-env'?: string[];\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n 'vite'?: false | VitePackageJsonOverride;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getExposeProcessEnv(): string[] {\n return getConfiguration()['expose-process-env'] ?? [];\n}\n\nexport function getViteConfiguration(): VitePackageJsonOverride {\n const { vite } = getConfiguration();\n return typeof vite === 'object' ? vite : {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n const { webpack, vite } = getConfiguration(locationOrJson);\n assertBundlersAgree(webpack, vite, locationOrJson);\n return webpack !== false && vite !== false;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isViteDevServerDisabled() {\n return getViteConfiguration().devServer === false;\n}\n\nexport function getSharedDependencies(locationOrJson?: LocationOrJson) {\n return (\n getConfiguration(locationOrJson)['shared-dependencies'] ??\n getWebpackConfiguration(locationOrJson)['shared-dependencies']\n );\n}\n\nexport function isExposeSharedDependencies(locationOrJson?: LocationOrJson) {\n return (\n (getConfiguration(locationOrJson)['expose-shared-dependencies'] ??\n getWebpackConfiguration(locationOrJson)['expose-shared-dependencies']) === true\n );\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n\n/*\n * Require that Vite and Webpack configurations agree whether package is a bundle.\n */\nfunction assertBundlersAgree(\n webpack: Configuration['webpack'],\n vite: Configuration['vite'],\n locationOrJson?: LocationOrJson\n) {\n if (webpack === undefined || vite === undefined || !!webpack === !!vite) {\n return;\n }\n\n const mismatch =\n webpack === false\n ? { falsy: 'cli.webpack', truthy: 'cli.vite' }\n : { falsy: 'cli.vite', truthy: 'cli.webpack' };\n\n throw new Error(\n `package ${getPackageName(locationOrJson)} has conflicting webpack ` +\n `and vite configurations: ${mismatch.falsy} is false but ` +\n `${mismatch.truthy} is not`\n );\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getExposeProcessEnv","getJestConfiguration","getReviewConfiguration","getSharedDependencies","getStylelintConfiguration","getSwcCompilePackageConfiguration","getViteConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isViteDevServerDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vite","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","assertBundlersAgree","webpackConfiguration","devServer","legacy","legacyRoot","mismatch","falsy","truthy","Error","getPackageName"],"mappings":";;;;;;;;;;;QAsEYA;eAAAA;;QA/CCC;eAAAA;;QAiJGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAiBAC;eAAAA;;QAbAC;eAAAA;;QAKAC;eAAAA;;QAwFAC;eAAAA;;QApFAC;eAAAA;;QAiEAC;eAAAA;;QAzDAC;eAAAA;;QAKAC;eAAAA;;QAmCAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAMAC;eAAAA;;QAgBAC;eAAAA;;QAOAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QA1BAC;eAAAA;;QA8BAC;eAAAA;;;2DAhTD;6DACE;4BAOU;gCACI;qBACX;0BACmB;;;;;;AAShC,MAAMvB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAAA;;AAkGL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,CAAC;AAEvC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,gCAAgC,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
_export_star(require("./exit-when-parent-exits"), exports);
|
|
5
6
|
_export_star(require("./find-packages"), exports);
|
|
6
7
|
_export_star(require("./find-up"), exports);
|
|
7
8
|
_export_star(require("./format-duration"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './format-relative-date';\nexport * from './get-base-tsconfig';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-default-test-excludes';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-tsconfig';\nexport * from './get-tsconfig-with-fallback';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './omit';\nexport * from './pick';\nexport * from './prettify';\nexport * from './read-json';\nexport * from './to-array';\nexport type * from './types';\nexport * from './validate-shared-dependencies';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './exit-when-parent-exits';\nexport * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './format-relative-date';\nexport * from './get-base-tsconfig';\nexport * from './get-branch-configs';\nexport * from './get-configuration';\nexport * from './get-default-test-excludes';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-tsconfig';\nexport * from './get-tsconfig-with-fallback';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './omit';\nexport * from './pick';\nexport * from './prettify';\nexport * from './read-json';\nexport * from './to-array';\nexport type * from './types';\nexport * from './validate-shared-dependencies';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
|
package/dist/utils/log.js
CHANGED
package/dist/utils/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU
|
|
1
|
+
{"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU;;;;;;;;;;;;;;;;;AAI5B,MAAMC;IAOF,IAAIC,YAAY;QACZ,OAAO,IAAIC,OAAOC,kBAAkB,CAACC,WAAW;YAC5CC,QAAQ;YACRC,MAAM;YACNC,QAAQ;YACRC,QAAQ;YACRC,wBAAwB;QAC5B;IACJ;IAEAC,KAAK,GAAGA,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,IAAAA,cAAK,KAAIJ,QAAQ;IAC1C;IAEAK,KAAK,GAAGL,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACC,IAAI,IAAIP,QAAQ;IACpD;IAEAQ,QAAQ,GAAGR,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACG,KAAK,IAAIT,QAAQ;IACrD;IAEAU,QAAQ,GAAGV,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACK,MAAM,IAAIX,QAAQ;IACtD;IAEAY,MAAM,GAAGZ,IAAc,EAAE;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACO,GAAG,IAAIb,QAAQ;IACnD;IAEAc,MAAMC,SAAiB,EAAE,GAAGf,IAAW,EAAE;QACrC,IAAIgB,MAAM,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH;QAC5B,IAAI,CAACC,KAAK;YACNA,MAAMG,IAAAA,kBAAW,EAACJ;YAClB,IAAI,CAACE,QAAQ,CAACG,GAAG,CAACL,WAAWC;QACjC;QACA,IAAIA,IAAIK,OAAO,IAAIrB,KAAKsB,MAAM,EAAE;YAC5B,MAAM,CAACC,WAAW,GAAGC,KAAK,GAAGxB,KAAKyB,GAAG,CAACC,CAAAA,MAAQ,OAAOA,QAAQ,aAAaA,QAAQA;YAClFV,IAAIO,cAAcC;QACtB;QACA,OAAOR;IACX;IA7CA,aAAc;QAFd,uBAAiBC,YAAjB,KAAA;QAGI,IAAI,CAACA,QAAQ,GAAG,IAAIU;IACxB;AA4CJ;AAEO,MAAMtC,MAAM,IAAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-shared-dependencies.d.ts","sourceRoot":"","sources":["../../src/vite/build-shared-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,mBAAmB,EAItB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"build-shared-dependencies.d.ts","sourceRoot":"","sources":["../../src/vite/build-shared-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,mBAAmB,EAItB,MAAM,SAAS,CAAC;AAKjB,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,mBAAmB,iBAmBzE"}
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "buildSharedDependencies", {
|
|
|
11
11
|
const _vite = require("vite");
|
|
12
12
|
const _core = require("../core");
|
|
13
13
|
const _config = require("./config");
|
|
14
|
+
const _plugins = require("./plugins");
|
|
14
15
|
const _shareddependenciesplugin = require("./plugins/shared-dependencies-plugin");
|
|
15
16
|
async function buildSharedDependencies(options) {
|
|
16
17
|
var _config_build, _config_build1, _config_build2, _config_build3;
|
|
@@ -27,6 +28,7 @@ async function buildSharedDependencies(options) {
|
|
|
27
28
|
},
|
|
28
29
|
mode: getMode(context),
|
|
29
30
|
plugins: [
|
|
31
|
+
(0, _plugins.cleanPlugin)(context),
|
|
30
32
|
getSharedDependenciesPlugin(context)
|
|
31
33
|
],
|
|
32
34
|
build: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/vite/build-shared-dependencies.ts"],"sourcesContent":["import { build } from 'vite';\nimport {\n BuildContext,\n BuildContextOptions,\n bundleConstants,\n createBuildContext,\n resolveOutputPath,\n} from '../core';\nimport { createViteConfig } from './config';\nimport { sharedDependenciesPlugin } from './plugins/shared-dependencies-plugin';\n\nexport async function buildSharedDependencies(options: BuildContextOptions) {\n const config = await createViteConfig(options);\n const context = createBuildContext({ ...options, emitExposedDependencies: true });\n\n await build({\n configFile: false,\n oxc: {\n minify: config.oxc ? config.oxc.minify : undefined,\n legalComments: 'none',\n },\n mode: getMode(context),\n plugins: [getSharedDependenciesPlugin(context)],\n build: {\n outDir: resolveOutputPath(context, config.build?.outDir),\n minify: config.build?.minify,\n cssMinify: config.build?.cssMinify,\n terserOptions: config.build?.terserOptions,\n },\n });\n}\n\nfunction getMode(context: BuildContext) {\n return context.build.isProduction\n ? bundleConstants.mode.production\n : bundleConstants.mode.development;\n}\n\nfunction getSharedDependenciesPlugin(context: BuildContext) {\n const { destination: metadataDir, sharedDependencies: dependencies } = context.package;\n\n const css: Record<string, string[]> = {};\n if (dependencies['@servicetitan/design-system']) {\n css['design-system'] = [\n '@servicetitan/tokens/core/tokens.css',\n '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',\n '@servicetitan/design-system/dist/system.min.css',\n ];\n }\n\n return sharedDependenciesPlugin({ css, dependencies, metadataDir });\n}\n"],"names":["buildSharedDependencies","options","config","createViteConfig","context","createBuildContext","emitExposedDependencies","build","configFile","oxc","minify","undefined","legalComments","mode","getMode","plugins","getSharedDependenciesPlugin","outDir","resolveOutputPath","cssMinify","terserOptions","isProduction","bundleConstants","production","development","destination","metadataDir","sharedDependencies","dependencies","package","css","sharedDependenciesPlugin"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../src/vite/build-shared-dependencies.ts"],"sourcesContent":["import { build } from 'vite';\nimport {\n BuildContext,\n BuildContextOptions,\n bundleConstants,\n createBuildContext,\n resolveOutputPath,\n} from '../core';\nimport { createViteConfig } from './config';\nimport { cleanPlugin } from './plugins';\nimport { sharedDependenciesPlugin } from './plugins/shared-dependencies-plugin';\n\nexport async function buildSharedDependencies(options: BuildContextOptions) {\n const config = await createViteConfig(options);\n const context = createBuildContext({ ...options, emitExposedDependencies: true });\n\n await build({\n configFile: false,\n oxc: {\n minify: config.oxc ? config.oxc.minify : undefined,\n legalComments: 'none',\n },\n mode: getMode(context),\n plugins: [cleanPlugin(context), getSharedDependenciesPlugin(context)],\n build: {\n outDir: resolveOutputPath(context, config.build?.outDir),\n minify: config.build?.minify,\n cssMinify: config.build?.cssMinify,\n terserOptions: config.build?.terserOptions,\n },\n });\n}\n\nfunction getMode(context: BuildContext) {\n return context.build.isProduction\n ? bundleConstants.mode.production\n : bundleConstants.mode.development;\n}\n\nfunction getSharedDependenciesPlugin(context: BuildContext) {\n const { destination: metadataDir, sharedDependencies: dependencies } = context.package;\n\n const css: Record<string, string[]> = {};\n if (dependencies['@servicetitan/design-system']) {\n css['design-system'] = [\n '@servicetitan/tokens/core/tokens.css',\n '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css',\n '@servicetitan/design-system/dist/system.min.css',\n ];\n }\n\n return sharedDependenciesPlugin({ css, dependencies, metadataDir });\n}\n"],"names":["buildSharedDependencies","options","config","createViteConfig","context","createBuildContext","emitExposedDependencies","build","configFile","oxc","minify","undefined","legalComments","mode","getMode","plugins","cleanPlugin","getSharedDependenciesPlugin","outDir","resolveOutputPath","cssMinify","terserOptions","isProduction","bundleConstants","production","development","destination","metadataDir","sharedDependencies","dependencies","package","css","sharedDependenciesPlugin"],"mappings":";;;;+BAYsBA;;;eAAAA;;;sBAZA;sBAOf;wBAC0B;yBACL;0CACa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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../../src/vite/config/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../../src/vite/config/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAC;AA8BjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAkD5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAgFxE"}
|
|
@@ -24,6 +24,10 @@ function importMetaRemap(...definitions) {
|
|
|
24
24
|
}
|
|
25
25
|
function createPlugins(context) {
|
|
26
26
|
const entries = [
|
|
27
|
+
[
|
|
28
|
+
'reactRefresh',
|
|
29
|
+
(0, _plugins.reactRefreshPlugin)(context)
|
|
30
|
+
],
|
|
27
31
|
[
|
|
28
32
|
'bundleStat',
|
|
29
33
|
(0, _plugins.bundleStatPlugin)(context)
|
|
@@ -127,12 +131,19 @@ function createBaseConfig(context) {
|
|
|
127
131
|
}
|
|
128
132
|
},
|
|
129
133
|
define: {
|
|
134
|
+
/*
|
|
135
|
+
* Some dependencies assume Node's `global` exists (webpack polyfills this
|
|
136
|
+
* automatically for browser targets; Vite does not).
|
|
137
|
+
*/ global: 'globalThis',
|
|
130
138
|
...importMetaRemap((0, _core.defineExposedDependencies)(context), (0, _core.defineExposedInstanceDependencies)(context), (0, _core.defineWebComponentName)(context)),
|
|
131
139
|
...(_getProcessEnv = (0, _core.getProcessEnv)(context)) !== null && _getProcessEnv !== void 0 ? _getProcessEnv : {}
|
|
132
140
|
},
|
|
133
141
|
optimizeDeps: {
|
|
134
142
|
include: [
|
|
135
|
-
'@servicetitan/startup-utils'
|
|
143
|
+
'@servicetitan/startup-utils',
|
|
144
|
+
'react-refresh/runtime',
|
|
145
|
+
'react/jsx-runtime',
|
|
146
|
+
'react/jsx-dev-runtime'
|
|
136
147
|
],
|
|
137
148
|
/*
|
|
138
149
|
* Top-level plugins don't run during dependency pre-bundling, so
|