astro 6.0.0-alpha.0 → 6.0.0-alpha.2
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/astro-jsx.d.ts +11 -0
- package/client.d.ts +17 -41
- package/components/Code.astro +2 -2
- package/components/Image.astro +2 -2
- package/components/Picture.astro +1 -1
- package/dist/actions/consts.d.ts +2 -5
- package/dist/actions/consts.js +4 -8
- package/dist/actions/integration.js +2 -4
- package/dist/actions/runtime/client.d.ts +84 -3
- package/dist/actions/runtime/client.js +238 -7
- package/dist/actions/runtime/entrypoints/client.d.ts +7 -0
- package/dist/actions/runtime/entrypoints/client.js +91 -0
- package/dist/actions/runtime/entrypoints/route.d.ts +2 -0
- package/dist/actions/runtime/{route.js → entrypoints/route.js} +1 -1
- package/dist/actions/runtime/entrypoints/server.d.ts +6 -0
- package/dist/actions/runtime/entrypoints/server.js +33 -0
- package/dist/actions/runtime/server.d.ts +11 -18
- package/dist/actions/runtime/server.js +162 -82
- package/dist/actions/runtime/types.d.ts +64 -0
- package/dist/actions/utils.d.ts +2 -2
- package/dist/actions/utils.js +2 -2
- package/dist/actions/vite-plugin-actions.js +58 -47
- package/dist/assets/build/generate.d.ts +2 -2
- package/dist/assets/build/generate.js +12 -10
- package/dist/assets/consts.d.ts +1 -0
- package/dist/assets/consts.js +2 -0
- package/dist/assets/endpoint/config.js +2 -2
- package/dist/assets/endpoint/dev.js +7 -6
- package/dist/assets/fonts/config.d.ts +91 -350
- package/dist/assets/fonts/config.js +35 -136
- package/dist/assets/fonts/constants.js +1 -1
- package/dist/assets/fonts/core/dedupe-font-faces.d.ts +2 -0
- package/dist/assets/fonts/core/dedupe-font-faces.js +30 -0
- package/dist/assets/fonts/definitions.d.ts +9 -22
- package/dist/assets/fonts/infra/build-remote-font-provider-mod-resolver.d.ts +4 -0
- package/dist/assets/fonts/infra/build-remote-font-provider-mod-resolver.js +8 -0
- package/dist/assets/fonts/infra/build-url-proxy-hash-resolver.d.ts +15 -0
- package/dist/assets/fonts/infra/build-url-proxy-hash-resolver.js +20 -0
- package/dist/assets/fonts/infra/build-url-resolver.d.ts +12 -0
- package/dist/assets/fonts/infra/build-url-resolver.js +40 -0
- package/dist/assets/fonts/infra/cached-font-fetcher.d.ts +11 -0
- package/dist/assets/fonts/infra/cached-font-fetcher.js +42 -0
- package/dist/assets/fonts/infra/capsize-font-metrics-resolver.d.ts +18 -0
- package/dist/assets/fonts/infra/capsize-font-metrics-resolver.js +71 -0
- package/dist/assets/fonts/infra/data-collector.d.ts +10 -0
- package/dist/assets/fonts/infra/data-collector.js +35 -0
- package/dist/assets/fonts/infra/dev-remote-font-provider-mod-resolver.d.ts +9 -0
- package/dist/assets/fonts/infra/dev-remote-font-provider-mod-resolver.js +14 -0
- package/dist/assets/fonts/infra/dev-url-proxy-hash-resolver.d.ts +15 -0
- package/dist/assets/fonts/infra/dev-url-proxy-hash-resolver.js +37 -0
- package/dist/assets/fonts/infra/dev-url-resolver.d.ts +10 -0
- package/dist/assets/fonts/infra/dev-url-resolver.js +29 -0
- package/dist/assets/fonts/infra/font-type-extractor.d.ts +5 -0
- package/dist/assets/fonts/infra/font-type-extractor.js +21 -0
- package/dist/assets/fonts/infra/fontace-font-file-reader.d.ts +11 -0
- package/dist/assets/fonts/infra/fontace-font-file-reader.js +25 -0
- package/dist/assets/fonts/infra/levenshtein-string-matcher.d.ts +5 -0
- package/dist/assets/fonts/infra/levenshtein-string-matcher.js +145 -0
- package/dist/assets/fonts/infra/local-url-proxy-content-resolver.d.ts +4 -0
- package/dist/assets/fonts/infra/local-url-proxy-content-resolver.js +14 -0
- package/dist/assets/fonts/{implementations/css-renderer.d.ts → infra/minifiable-css-renderer.d.ts} +8 -3
- package/dist/assets/fonts/{implementations/css-renderer.js → infra/minifiable-css-renderer.js} +12 -10
- package/dist/assets/fonts/infra/remote-font-provider-resolver.d.ts +10 -0
- package/dist/assets/fonts/infra/remote-font-provider-resolver.js +49 -0
- package/dist/assets/fonts/infra/remote-url-proxy-content-resolver.d.ts +4 -0
- package/dist/assets/fonts/infra/remote-url-proxy-content-resolver.js +9 -0
- package/dist/assets/fonts/infra/require-local-provider-url-resolver.d.ts +9 -0
- package/dist/assets/fonts/infra/require-local-provider-url-resolver.js +22 -0
- package/dist/assets/fonts/infra/system-fallbacks-provider.d.ts +6 -0
- package/dist/assets/fonts/{implementations → infra}/system-fallbacks-provider.js +8 -11
- package/dist/assets/fonts/infra/unstorage-fs-storage.d.ts +11 -0
- package/dist/assets/fonts/infra/unstorage-fs-storage.js +26 -0
- package/dist/assets/fonts/infra/url-proxy.d.ts +16 -0
- package/dist/assets/fonts/infra/url-proxy.js +50 -0
- package/dist/assets/fonts/infra/xxhash-hasher.d.ts +7 -0
- package/dist/assets/fonts/infra/xxhash-hasher.js +18 -0
- package/dist/assets/fonts/orchestrate.d.ts +1 -2
- package/dist/assets/fonts/orchestrate.js +50 -17
- package/dist/assets/fonts/providers/index.d.ts +6 -24
- package/dist/assets/fonts/types.d.ts +138 -8
- package/dist/assets/fonts/utils.d.ts +1 -2
- package/dist/assets/fonts/vite-plugin-fonts.js +66 -65
- package/dist/assets/services/noop.js +11 -1
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/services/service.js +55 -51
- package/dist/assets/types.d.ts +2 -2
- package/dist/assets/utils/index.d.ts +1 -3
- package/dist/assets/utils/index.js +4 -9
- package/dist/assets/utils/{transformToPath.d.ts → node.d.ts} +15 -1
- package/dist/assets/utils/{node/emitAsset.js → node.js} +34 -6
- package/dist/assets/utils/svg.d.ts +2 -1
- package/dist/assets/utils/svg.js +30 -4
- package/dist/assets/vite-plugin-assets.js +36 -19
- package/dist/cli/add/index.js +21 -13
- package/dist/cli/create-key/infra/crypto-key-generator.d.ts +3 -1
- package/dist/cli/create-key/infra/crypto-key-generator.js +7 -9
- package/dist/cli/definitions.d.ts +19 -2
- package/dist/cli/dev/index.js +1 -1
- package/dist/cli/docs/core/open-docs.d.ts +5 -3
- package/dist/cli/docs/core/open-docs.js +2 -9
- package/dist/cli/docs/definitions.d.ts +3 -11
- package/dist/cli/docs/domain/cloud-ide.d.ts +1 -0
- package/dist/cli/docs/domain/cloud-ide.js +0 -0
- package/dist/cli/docs/infra/process-cloud-ide-provider.d.ts +5 -0
- package/dist/cli/docs/infra/process-cloud-ide-provider.js +6 -0
- package/dist/cli/flags.d.ts +1 -0
- package/dist/cli/index.js +78 -21
- package/dist/cli/info/core/get-package-manager.d.ts +8 -0
- package/dist/cli/info/core/get-package-manager.js +37 -0
- package/dist/cli/info/core/info.d.ts +21 -0
- package/dist/cli/info/core/info.js +21 -0
- package/dist/cli/info/definitions.d.ts +30 -0
- package/dist/cli/info/definitions.js +0 -0
- package/dist/cli/info/domain/debug-info.d.ts +1 -0
- package/dist/cli/info/domain/debug-info.js +0 -0
- package/dist/cli/info/infra/bun-package-manager.d.ts +5 -0
- package/dist/cli/info/infra/bun-package-manager.js +9 -0
- package/dist/cli/info/infra/cli-astro-config-resolver.d.ts +10 -0
- package/dist/cli/info/infra/cli-astro-config-resolver.js +36 -0
- package/dist/cli/info/infra/cli-clipboard.d.ts +13 -0
- package/dist/cli/info/infra/cli-clipboard.js +78 -0
- package/dist/cli/info/infra/cli-debug-info-provider.d.ts +15 -0
- package/dist/cli/info/infra/cli-debug-info-provider.js +57 -0
- package/dist/cli/info/infra/dev-debug-info-provider.d.ts +18 -0
- package/dist/cli/info/infra/dev-debug-info-provider.js +36 -0
- package/dist/cli/info/infra/noop-package-manager.d.ts +5 -0
- package/dist/cli/info/infra/noop-package-manager.js +9 -0
- package/dist/cli/info/infra/npm-package-manager.d.ts +10 -0
- package/dist/cli/info/infra/npm-package-manager.js +32 -0
- package/dist/cli/info/infra/pnpm-package-manager.d.ts +10 -0
- package/dist/cli/info/infra/pnpm-package-manager.js +33 -0
- package/dist/cli/info/infra/process-node-version-provider.d.ts +4 -0
- package/dist/cli/info/infra/process-node-version-provider.js +6 -0
- package/dist/cli/info/infra/process-package-manager-user-agent-provider.d.ts +4 -0
- package/dist/cli/info/infra/process-package-manager-user-agent-provider.js +7 -0
- package/dist/cli/info/infra/prompts-prompt.d.ts +11 -0
- package/dist/cli/info/infra/prompts-prompt.js +25 -0
- package/dist/cli/info/infra/styled-debug-info-formatter.d.ts +10 -0
- package/dist/cli/info/infra/styled-debug-info-formatter.js +29 -0
- package/dist/cli/info/infra/yarn-package-manager.d.ts +10 -0
- package/dist/cli/info/infra/yarn-package-manager.js +34 -0
- package/dist/cli/infra/build-time-astro-version-provider.d.ts +3 -1
- package/dist/cli/infra/build-time-astro-version-provider.js +4 -8
- package/dist/cli/infra/cli-command-runner.d.ts +7 -4
- package/dist/cli/infra/cli-command-runner.js +14 -10
- package/dist/cli/infra/logger-help-display.d.ts +11 -7
- package/dist/cli/infra/logger-help-display.js +62 -50
- package/dist/cli/infra/passthrough-text-styler.d.ts +9 -0
- package/dist/cli/infra/passthrough-text-styler.js +23 -0
- package/dist/cli/infra/piccolore-text-styler.d.ts +2 -0
- package/dist/cli/infra/piccolore-text-styler.js +5 -0
- package/dist/cli/infra/process-operating-system-provider.d.ts +6 -0
- package/dist/cli/infra/process-operating-system-provider.js +12 -0
- package/dist/cli/infra/tinyexec-command-executor.d.ts +6 -0
- package/dist/cli/infra/tinyexec-command-executor.js +34 -0
- package/dist/cli/install-package.js +1 -1
- package/dist/cli/preferences/index.js +6 -2
- package/dist/cli/preview/index.js +1 -1
- package/dist/cli/utils/format-version.js +1 -1
- package/dist/config/index.js +9 -5
- package/dist/container/index.js +19 -13
- package/dist/container/pipeline.d.ts +2 -1
- package/dist/container/pipeline.js +4 -11
- package/dist/container/vite-plugin-container.js +7 -4
- package/dist/content/config.d.ts +34 -40
- package/dist/content/content-layer.js +13 -18
- package/dist/content/loaders/errors.d.ts +3 -3
- package/dist/content/loaders/errors.js +5 -2
- package/dist/content/loaders/glob.js +6 -1
- package/dist/content/loaders/types.d.ts +11 -4
- package/dist/content/runtime-assets.d.ts +4 -4
- package/dist/content/runtime-assets.js +2 -2
- package/dist/content/runtime.d.ts +21 -20
- package/dist/content/runtime.js +14 -16
- package/dist/content/types-generator.js +90 -54
- package/dist/content/utils.d.ts +46 -338
- package/dist/content/utils.js +52 -50
- package/dist/content/vite-plugin-content-assets.d.ts +12 -4
- package/dist/content/vite-plugin-content-assets.js +152 -102
- package/dist/content/vite-plugin-content-imports.js +58 -40
- package/dist/content/vite-plugin-content-virtual-mod.js +95 -77
- package/dist/core/app/app.d.ts +5 -0
- package/dist/core/app/app.js +13 -0
- package/dist/core/app/base.d.ts +132 -0
- package/dist/core/app/base.js +448 -0
- package/dist/core/app/common.d.ts +6 -2
- package/dist/core/app/common.js +60 -33
- package/dist/core/app/dev/app.d.ts +15 -0
- package/dist/core/app/dev/app.js +86 -0
- package/dist/core/app/dev/pipeline.d.ts +13 -0
- package/dist/core/app/dev/pipeline.js +123 -0
- package/dist/core/app/entrypoint.d.ts +2 -0
- package/dist/core/app/entrypoint.js +15 -0
- package/dist/core/app/index.d.ts +7 -99
- package/dist/core/app/index.js +20 -486
- package/dist/core/app/logging.d.ts +3 -0
- package/dist/core/app/logging.js +11 -0
- package/dist/core/app/manifest.d.ts +9 -0
- package/dist/core/app/manifest.js +107 -0
- package/dist/core/app/middlewares.js +1 -1
- package/dist/core/app/node.js +14 -13
- package/dist/core/app/pipeline.d.ts +6 -5
- package/dist/core/app/pipeline.js +65 -49
- package/dist/core/app/types.d.ts +58 -22
- package/dist/core/app/validate-forwarded-headers.d.ts +16 -0
- package/dist/core/app/validate-forwarded-headers.js +60 -0
- package/dist/core/base-pipeline.d.ts +22 -14
- package/dist/core/base-pipeline.js +54 -6
- package/dist/core/build/app.d.ts +13 -0
- package/dist/core/build/app.js +38 -0
- package/dist/core/build/common.d.ts +1 -1
- package/dist/core/build/common.js +2 -2
- package/dist/core/build/generate.d.ts +1 -1
- package/dist/core/build/generate.js +96 -204
- package/dist/core/build/graph.js +2 -2
- package/dist/core/build/index.js +11 -16
- package/dist/core/build/internal.d.ts +2 -27
- package/dist/core/build/internal.js +1 -44
- package/dist/core/build/page-data.js +1 -1
- package/dist/core/build/pipeline.d.ts +15 -26
- package/dist/core/build/pipeline.js +106 -170
- package/dist/core/build/plugins/index.d.ts +4 -2
- package/dist/core/build/plugins/index.js +17 -23
- package/dist/core/build/plugins/plugin-analyzer.d.ts +2 -2
- package/dist/core/build/plugins/plugin-analyzer.js +5 -13
- package/dist/core/build/plugins/plugin-component-entry.d.ts +7 -2
- package/dist/core/build/plugins/plugin-component-entry.js +15 -17
- package/dist/core/build/plugins/plugin-css.d.ts +2 -2
- package/dist/core/build/plugins/plugin-css.js +90 -41
- package/dist/core/build/plugins/plugin-internals.d.ts +2 -2
- package/dist/core/build/plugins/plugin-internals.js +24 -18
- package/dist/core/build/plugins/plugin-manifest.d.ts +33 -5
- package/dist/core/build/plugins/plugin-manifest.js +89 -129
- package/dist/core/build/plugins/plugin-middleware.d.ts +2 -2
- package/dist/core/build/plugins/plugin-middleware.js +5 -7
- package/dist/core/build/plugins/plugin-noop.d.ts +3 -0
- package/dist/core/build/plugins/plugin-noop.js +35 -0
- package/dist/core/build/plugins/plugin-prerender.d.ts +2 -2
- package/dist/core/build/plugins/plugin-prerender.js +7 -64
- package/dist/core/build/plugins/plugin-scripts.d.ts +5 -2
- package/dist/core/build/plugins/plugin-scripts.js +5 -13
- package/dist/core/build/plugins/plugin-ssr.d.ts +2 -2
- package/dist/core/build/plugins/plugin-ssr.js +85 -139
- package/dist/core/build/plugins/util.d.ts +1 -25
- package/dist/core/build/plugins/util.js +0 -47
- package/dist/core/build/runtime.d.ts +26 -0
- package/dist/core/build/runtime.js +45 -0
- package/dist/core/build/static-build.d.ts +2 -2
- package/dist/core/build/static-build.js +181 -155
- package/dist/core/build/types.d.ts +1 -2
- package/dist/core/build/util.d.ts +0 -1
- package/dist/core/build/util.js +0 -7
- package/dist/core/compile/compile.d.ts +2 -3
- package/dist/core/compile/compile.js +2 -2
- package/dist/core/config/config.js +3 -3
- package/dist/core/config/index.d.ts +0 -1
- package/dist/core/config/index.js +0 -2
- package/dist/core/config/schemas/base.d.ts +336 -1434
- package/dist/core/config/schemas/base.js +42 -41
- package/dist/core/config/schemas/refined.d.ts +2 -2
- package/dist/core/config/schemas/refined.js +1 -1
- package/dist/core/config/schemas/relative.d.ts +672 -1761
- package/dist/core/config/schemas/relative.js +4 -4
- package/dist/core/config/settings.d.ts +3 -3
- package/dist/core/config/settings.js +5 -6
- package/dist/core/config/validate.js +13 -2
- package/dist/core/config/vite-load.js +12 -3
- package/dist/core/constants.d.ts +11 -0
- package/dist/core/constants.js +20 -1
- package/dist/core/create-vite.d.ts +2 -6
- package/dist/core/create-vite.js +35 -43
- package/dist/core/csp/common.d.ts +1 -1
- package/dist/core/csp/common.js +1 -1
- package/dist/core/csp/config.d.ts +8 -4
- package/dist/core/csp/config.js +1 -1
- package/dist/core/csp/runtime.d.ts +11 -0
- package/dist/core/csp/runtime.js +35 -0
- package/dist/core/dev/container.js +13 -7
- package/dist/core/dev/dev.js +2 -2
- package/dist/core/dev/restart.js +15 -6
- package/dist/core/errors/dev/runtime.d.ts +6 -0
- package/dist/core/errors/dev/runtime.js +27 -0
- package/dist/core/errors/dev/utils.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -1
- package/dist/core/errors/errors-data.d.ts +32 -16
- package/dist/core/errors/errors-data.js +23 -10
- package/dist/core/errors/errors.d.ts +3 -3
- package/dist/core/errors/errors.js +8 -8
- package/dist/core/errors/zod-error-map.d.ts +2 -2
- package/dist/core/errors/zod-error-map.js +26 -24
- package/dist/core/logger/core.js +1 -1
- package/dist/core/messages.d.ts +2 -2
- package/dist/core/messages.js +3 -3
- package/dist/core/middleware/callMiddleware.js +1 -1
- package/dist/core/middleware/defineMiddleware.d.ts +2 -0
- package/dist/core/middleware/defineMiddleware.js +6 -0
- package/dist/core/middleware/index.d.ts +3 -3
- package/dist/core/middleware/index.js +1 -3
- package/dist/core/middleware/sequence.js +4 -4
- package/dist/core/middleware/vite-plugin.d.ts +1 -1
- package/dist/core/middleware/vite-plugin.js +41 -24
- package/dist/core/module-loader/index.d.ts +2 -2
- package/dist/core/module-loader/index.js +1 -1
- package/dist/core/module-loader/{loader.d.ts → runner.d.ts} +6 -17
- package/dist/core/module-loader/{loader.js → runner.js} +3 -0
- package/dist/core/module-loader/vite.d.ts +3 -2
- package/dist/core/module-loader/vite.js +17 -13
- package/dist/core/preview/index.js +20 -3
- package/dist/core/preview/static-preview-server.js +11 -0
- package/dist/core/redirects/component.js +1 -2
- package/dist/core/redirects/index.d.ts +0 -1
- package/dist/core/redirects/index.js +1 -3
- package/dist/core/redirects/render.js +5 -2
- package/dist/core/render/paginate.d.ts +1 -1
- package/dist/core/render/paginate.js +8 -6
- package/dist/core/render/params-and-props.d.ts +2 -0
- package/dist/core/render/params-and-props.js +19 -6
- package/dist/core/render/route-cache.d.ts +3 -2
- package/dist/core/render/route-cache.js +6 -5
- package/dist/core/render-context.d.ts +6 -4
- package/dist/core/render-context.js +66 -25
- package/dist/core/routing/astro-designed-error-pages.js +2 -2
- package/dist/core/routing/default.js +1 -1
- package/dist/core/routing/helpers.d.ts +22 -0
- package/dist/core/routing/helpers.js +25 -0
- package/dist/core/routing/index.d.ts +1 -1
- package/dist/core/routing/index.js +2 -2
- package/dist/core/routing/manifest/create.d.ts +6 -1
- package/dist/core/routing/manifest/create.js +11 -14
- package/dist/core/routing/manifest/generator.d.ts +3 -1
- package/dist/core/routing/params.d.ts +2 -1
- package/dist/core/routing/params.js +3 -2
- package/dist/core/server-islands/endpoint.js +40 -19
- package/dist/core/server-islands/vite-plugin-server-islands.d.ts +1 -1
- package/dist/core/server-islands/vite-plugin-server-islands.js +106 -46
- package/dist/core/session/vite-plugin.d.ts +6 -0
- package/dist/core/session/vite-plugin.js +59 -0
- package/dist/core/session.d.ts +4 -2
- package/dist/core/session.js +8 -48
- package/dist/core/sync/index.d.ts +2 -5
- package/dist/core/sync/index.js +34 -22
- package/dist/core/util/pathname.d.ts +10 -0
- package/dist/core/util/pathname.js +17 -0
- package/dist/core/util.d.ts +2 -2
- package/dist/core/util.js +3 -3
- package/dist/core/viteUtils.d.ts +1 -0
- package/dist/core/viteUtils.js +2 -0
- package/dist/entrypoints/legacy.d.ts +2 -0
- package/dist/entrypoints/legacy.js +12 -0
- package/dist/entrypoints/prerender.d.ts +4 -0
- package/dist/entrypoints/prerender.js +7 -0
- package/dist/env/schema.d.ts +21 -251
- package/dist/env/schema.js +6 -3
- package/dist/env/vite-plugin-env.js +61 -42
- package/dist/env/vite-plugin-import-meta-env.js +45 -37
- package/dist/environments.d.ts +3 -0
- package/dist/environments.js +11 -0
- package/dist/events/error.d.ts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/utils.d.ts +1 -6
- package/dist/i18n/utils.js +1 -63
- package/dist/i18n/vite-plugin-i18n.d.ts +0 -5
- package/dist/i18n/vite-plugin-i18n.js +8 -26
- package/dist/integrations/hooks.d.ts +1 -1
- package/dist/integrations/hooks.js +10 -7
- package/dist/manifest/serialized.d.ts +9 -0
- package/dist/manifest/serialized.js +150 -0
- package/dist/manifest/virtual-module.d.ts +1 -4
- package/dist/manifest/virtual-module.js +100 -91
- package/dist/preferences/index.d.ts +1 -2
- package/dist/prefetch/vite-plugin-prefetch.js +20 -9
- package/dist/prerender/routing.d.ts +5 -7
- package/dist/prerender/routing.js +6 -17
- package/dist/runtime/client/dev-toolbar/ui-library/badge.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/button.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/card.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/highlight.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/radio-checkbox.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/select.d.ts +2 -2
- package/dist/runtime/client/dev-toolbar/ui-library/toggle.d.ts +2 -2
- package/dist/runtime/server/endpoint.js +1 -1
- package/dist/runtime/server/render/server-islands.js +5 -4
- package/dist/runtime/server/transition.d.ts +1 -0
- package/dist/template/4xx.js +3 -1
- package/dist/toolbar/vite-plugin-dev-toolbar.js +13 -7
- package/dist/transitions/events.d.ts +7 -0
- package/dist/transitions/router.js +7 -3
- package/dist/transitions/swap-functions.js +4 -0
- package/dist/transitions/vite-plugin-transitions.js +35 -22
- package/dist/types/astro.d.ts +8 -6
- package/dist/types/public/config.d.ts +438 -289
- package/dist/types/public/context.d.ts +3 -4
- package/dist/types/public/extendables.d.ts +2 -0
- package/dist/types/public/index.d.ts +2 -1
- package/dist/types/public/integrations.d.ts +23 -1
- package/dist/types/public/internal.d.ts +1 -16
- package/dist/types/public/preview.d.ts +6 -0
- package/dist/virtual-modules/i18n.d.ts +10 -2
- package/dist/virtual-modules/i18n.js +16 -7
- package/dist/virtual-modules/live-config.d.ts +1 -1
- package/dist/virtual-modules/live-config.js +1 -1
- package/dist/virtual-modules/middleware.d.ts +2 -1
- package/dist/virtual-modules/middleware.js +2 -1
- package/dist/vite-plugin-adapter-config/index.js +12 -5
- package/dist/vite-plugin-app/app.d.ts +47 -0
- package/dist/vite-plugin-app/app.js +410 -0
- package/dist/vite-plugin-app/createAstroServerApp.d.ts +8 -0
- package/dist/vite-plugin-app/createAstroServerApp.js +56 -0
- package/dist/vite-plugin-app/index.d.ts +3 -0
- package/dist/vite-plugin-app/index.js +19 -0
- package/dist/{vite-plugin-astro-server → vite-plugin-app}/pipeline.d.ts +6 -7
- package/dist/vite-plugin-app/pipeline.js +166 -0
- package/dist/vite-plugin-astro/index.js +215 -170
- package/dist/vite-plugin-astro-server/base.js +1 -1
- package/dist/vite-plugin-astro-server/controller.d.ts +1 -1
- package/dist/vite-plugin-astro-server/error.d.ts +3 -4
- package/dist/vite-plugin-astro-server/error.js +2 -5
- package/dist/vite-plugin-astro-server/index.d.ts +0 -1
- package/dist/vite-plugin-astro-server/index.js +0 -2
- package/dist/vite-plugin-astro-server/metadata.js +1 -1
- package/dist/vite-plugin-astro-server/plugin.d.ts +3 -7
- package/dist/vite-plugin-astro-server/plugin.js +40 -108
- package/dist/vite-plugin-astro-server/server-state.d.ts +1 -1
- package/dist/vite-plugin-astro-server/util.d.ts +2 -2
- package/dist/vite-plugin-astro-server/util.js +2 -1
- package/dist/vite-plugin-astro-server/vite.d.ts +2 -2
- package/dist/vite-plugin-astro-server/vite.js +7 -7
- package/dist/vite-plugin-chromedevtools/index.d.ts +7 -0
- package/dist/vite-plugin-chromedevtools/index.js +47 -0
- package/dist/vite-plugin-config-alias/index.js +59 -44
- package/dist/vite-plugin-css/index.d.ts +18 -0
- package/dist/vite-plugin-css/index.js +155 -0
- package/dist/vite-plugin-css/util.d.ts +5 -0
- package/dist/vite-plugin-css/util.js +8 -0
- package/dist/vite-plugin-environment/index.d.ts +15 -0
- package/dist/vite-plugin-environment/index.js +77 -0
- package/dist/vite-plugin-fileurl/index.js +6 -3
- package/dist/vite-plugin-head/index.d.ts +1 -2
- package/dist/vite-plugin-head/index.js +42 -58
- package/dist/vite-plugin-hmr-reload/index.js +2 -1
- package/dist/vite-plugin-html/index.d.ts +7 -4
- package/dist/vite-plugin-html/index.js +5 -3
- package/dist/vite-plugin-load-fallback/index.js +12 -5
- package/dist/vite-plugin-markdown/index.js +27 -8
- package/dist/vite-plugin-overlay/index.d.ts +2 -0
- package/dist/vite-plugin-overlay/index.js +21 -0
- package/dist/vite-plugin-pages/const.d.ts +2 -0
- package/dist/vite-plugin-pages/const.js +6 -0
- package/dist/vite-plugin-pages/index.d.ts +2 -0
- package/dist/vite-plugin-pages/index.js +7 -0
- package/dist/vite-plugin-pages/page.d.ts +7 -0
- package/dist/vite-plugin-pages/page.js +54 -0
- package/dist/vite-plugin-pages/pages.d.ts +8 -0
- package/dist/vite-plugin-pages/pages.js +63 -0
- package/dist/vite-plugin-pages/util.d.ts +8 -0
- package/dist/vite-plugin-pages/util.js +15 -0
- package/dist/vite-plugin-renderers/index.d.ts +9 -0
- package/dist/vite-plugin-renderers/index.js +45 -0
- package/dist/vite-plugin-routes/index.d.ts +14 -0
- package/dist/vite-plugin-routes/index.js +181 -0
- package/dist/vite-plugin-scripts/index.js +27 -25
- package/dist/vite-plugin-scripts/page-ssr.js +3 -2
- package/dist/vite-plugin-utils/index.d.ts +1 -0
- package/dist/vite-plugin-utils/index.js +2 -1
- package/dist/zod.d.ts +2 -2
- package/dist/zod.js +2 -2
- package/package.json +35 -32
- package/templates/content/module.mjs +1 -0
- package/templates/content/types.d.ts +24 -11
- package/types/actions.d.ts +1 -5
- package/types/content.d.ts +9 -11
- package/types/transitions.d.ts +25 -0
- package/dist/actions/loadActions.d.ts +0 -8
- package/dist/actions/loadActions.js +0 -13
- package/dist/actions/runtime/route.d.ts +0 -2
- package/dist/actions/runtime/shared.d.ts +0 -60
- package/dist/actions/runtime/shared.js +0 -296
- package/dist/actions/runtime/utils.d.ts +0 -25
- package/dist/actions/runtime/utils.js +0 -16
- package/dist/actions/runtime/virtual.d.ts +0 -4
- package/dist/actions/runtime/virtual.js +0 -127
- package/dist/assets/fonts/implementations/data-collector.d.ts +0 -3
- package/dist/assets/fonts/implementations/data-collector.js +0 -21
- package/dist/assets/fonts/implementations/error-handler.d.ts +0 -2
- package/dist/assets/fonts/implementations/error-handler.js +0 -41
- package/dist/assets/fonts/implementations/font-fetcher.d.ts +0 -8
- package/dist/assets/fonts/implementations/font-fetcher.js +0 -34
- package/dist/assets/fonts/implementations/font-file-reader.d.ts +0 -4
- package/dist/assets/fonts/implementations/font-file-reader.js +0 -26
- package/dist/assets/fonts/implementations/font-metrics-resolver.d.ts +0 -5
- package/dist/assets/fonts/implementations/font-metrics-resolver.js +0 -66
- package/dist/assets/fonts/implementations/font-type-extractor.d.ts +0 -4
- package/dist/assets/fonts/implementations/font-type-extractor.js +0 -22
- package/dist/assets/fonts/implementations/hasher.d.ts +0 -2
- package/dist/assets/fonts/implementations/hasher.js +0 -14
- package/dist/assets/fonts/implementations/levenshtein-string-matcher.d.ts +0 -2
- package/dist/assets/fonts/implementations/levenshtein-string-matcher.js +0 -147
- package/dist/assets/fonts/implementations/local-provider-url-resolver.d.ts +0 -5
- package/dist/assets/fonts/implementations/local-provider-url-resolver.js +0 -17
- package/dist/assets/fonts/implementations/remote-font-provider-mod-resolver.d.ts +0 -6
- package/dist/assets/fonts/implementations/remote-font-provider-mod-resolver.js +0 -20
- package/dist/assets/fonts/implementations/remote-font-provider-resolver.d.ts +0 -6
- package/dist/assets/fonts/implementations/remote-font-provider-resolver.js +0 -47
- package/dist/assets/fonts/implementations/storage.d.ts +0 -4
- package/dist/assets/fonts/implementations/storage.js +0 -14
- package/dist/assets/fonts/implementations/system-fallbacks-provider.d.ts +0 -11
- package/dist/assets/fonts/implementations/url-proxy-content-resolver.d.ts +0 -5
- package/dist/assets/fonts/implementations/url-proxy-content-resolver.js +0 -28
- package/dist/assets/fonts/implementations/url-proxy-hash-resolver.d.ts +0 -8
- package/dist/assets/fonts/implementations/url-proxy-hash-resolver.js +0 -39
- package/dist/assets/fonts/implementations/url-proxy.d.ts +0 -7
- package/dist/assets/fonts/implementations/url-proxy.js +0 -31
- package/dist/assets/fonts/implementations/url-resolver.d.ts +0 -11
- package/dist/assets/fonts/implementations/url-resolver.js +0 -55
- package/dist/assets/utils/node/emitAsset.d.ts +0 -15
- package/dist/assets/utils/remotePattern.d.ts +0 -3
- package/dist/assets/utils/remotePattern.js +0 -16
- package/dist/assets/utils/transformToPath.js +0 -32
- package/dist/cli/docs/domains/platform.d.ts +0 -1
- package/dist/cli/docs/infra/process-platform-provider.d.ts +0 -2
- package/dist/cli/docs/infra/process-platform-provider.js +0 -11
- package/dist/cli/docs/infra/tinyexec-command-executor.d.ts +0 -2
- package/dist/cli/docs/infra/tinyexec-command-executor.js +0 -30
- package/dist/cli/info/index.d.ts +0 -12
- package/dist/cli/info/index.js +0 -267
- package/dist/cli/infra/picocolors-text-styler.d.ts +0 -2
- package/dist/cli/infra/picocolors-text-styler.js +0 -7
- package/dist/core/build/css-asset-name.d.ts +0 -9
- package/dist/core/build/css-asset-name.js +0 -89
- package/dist/core/build/plugin.d.ts +0 -43
- package/dist/core/build/plugin.js +0 -61
- package/dist/core/build/plugins/plugin-actions.d.ts +0 -4
- package/dist/core/build/plugins/plugin-actions.js +0 -16
- package/dist/core/build/plugins/plugin-chunks.d.ts +0 -2
- package/dist/core/build/plugins/plugin-chunks.js +0 -33
- package/dist/core/build/plugins/plugin-pages.d.ts +0 -6
- package/dist/core/build/plugins/plugin-pages.js +0 -66
- package/dist/core/build/plugins/plugin-renderers.d.ts +0 -5
- package/dist/core/build/plugins/plugin-renderers.js +0 -54
- package/dist/core/middleware/loadMiddleware.d.ts +0 -7
- package/dist/core/middleware/loadMiddleware.js +0 -14
- package/dist/core/redirects/helpers.d.ts +0 -7
- package/dist/core/redirects/helpers.js +0 -10
- package/dist/core/routing/manifest/serialization.d.ts +0 -5
- package/dist/core/routing/manifest/serialization.js +0 -37
- package/dist/prerender/metadata.d.ts +0 -8
- package/dist/prerender/metadata.js +0 -18
- package/dist/vite-plugin-astro-server/css.d.ts +0 -13
- package/dist/vite-plugin-astro-server/css.js +0 -48
- package/dist/vite-plugin-astro-server/pipeline.js +0 -161
- package/dist/vite-plugin-astro-server/request.d.ts +0 -14
- package/dist/vite-plugin-astro-server/request.js +0 -66
- package/dist/vite-plugin-astro-server/route.d.ts +0 -25
- package/dist/vite-plugin-astro-server/route.js +0 -283
- package/dist/vite-plugin-scanner/index.d.ts +0 -10
- package/dist/vite-plugin-scanner/index.js +0 -87
- package/dist/vite-plugin-ssr-manifest/index.d.ts +0 -2
- package/dist/vite-plugin-ssr-manifest/index.js +0 -26
- /package/dist/{cli/docs/domains/platform.js → actions/runtime/types.js} +0 -0
- /package/dist/assets/fonts/{logic → core}/extract-unifont-providers.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/extract-unifont-providers.js +0 -0
- /package/dist/assets/fonts/{logic → core}/normalize-remote-font-faces.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/normalize-remote-font-faces.js +0 -0
- /package/dist/assets/fonts/{logic → core}/optimize-fallbacks.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/optimize-fallbacks.js +0 -0
- /package/dist/assets/fonts/{logic → core}/resolve-families.d.ts +0 -0
- /package/dist/assets/fonts/{logic → core}/resolve-families.js +0 -0
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export interface CommandExecutor {
|
|
6
|
-
execute: (command: string, args?: Array<string>, options?: {
|
|
7
|
-
cwd?: string;
|
|
8
|
-
env: Record<string, string | undefined>;
|
|
9
|
-
}) => Promise<{
|
|
10
|
-
stdout: string;
|
|
11
|
-
}>;
|
|
1
|
+
import type { CloudIde } from './domain/cloud-ide.js';
|
|
2
|
+
export interface CloudIdeProvider {
|
|
3
|
+
readonly name: CloudIde | null;
|
|
12
4
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CloudIde = 'gitpod';
|
|
File without changes
|
package/dist/cli/flags.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Arguments } from 'yargs-parser';
|
|
|
2
2
|
import { Logger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroInlineConfig } from '../types/public/config.js';
|
|
4
4
|
export type Flags = Arguments;
|
|
5
|
+
/** @deprecated Use AstroConfigResolver instead */
|
|
5
6
|
export declare function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig;
|
|
6
7
|
/**
|
|
7
8
|
* The `logging` is usually created from an `AstroInlineConfig`, but some flows like `add`
|
package/dist/cli/index.js
CHANGED
|
@@ -28,27 +28,26 @@ function resolveCommand(flags) {
|
|
|
28
28
|
async function runCommand(cmd, flags) {
|
|
29
29
|
const [
|
|
30
30
|
{ createLoggerFromFlags },
|
|
31
|
-
{
|
|
32
|
-
{
|
|
33
|
-
{
|
|
34
|
-
{
|
|
31
|
+
{ piccoloreTextStyler: textStyler },
|
|
32
|
+
{ BuildTimeAstroVersionProvider },
|
|
33
|
+
{ LoggerHelpDisplay },
|
|
34
|
+
{ CliCommandRunner }
|
|
35
35
|
] = await Promise.all([
|
|
36
36
|
import("./flags.js"),
|
|
37
|
-
import("./infra/
|
|
37
|
+
import("./infra/piccolore-text-styler.js"),
|
|
38
38
|
import("./infra/build-time-astro-version-provider.js"),
|
|
39
39
|
import("./infra/logger-help-display.js"),
|
|
40
40
|
import("./infra/cli-command-runner.js")
|
|
41
41
|
]);
|
|
42
42
|
const logger = createLoggerFromFlags(flags);
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const helpDisplay = createLoggerHelpDisplay({
|
|
43
|
+
const astroVersionProvider = new BuildTimeAstroVersionProvider();
|
|
44
|
+
const helpDisplay = new LoggerHelpDisplay({
|
|
46
45
|
logger,
|
|
47
46
|
flags,
|
|
48
47
|
textStyler,
|
|
49
48
|
astroVersionProvider
|
|
50
49
|
});
|
|
51
|
-
const runner =
|
|
50
|
+
const runner = new CliCommandRunner({ helpDisplay });
|
|
52
51
|
switch (cmd) {
|
|
53
52
|
/** Display --help flag */
|
|
54
53
|
case "help": {
|
|
@@ -66,35 +65,93 @@ async function runCommand(cmd, flags) {
|
|
|
66
65
|
return;
|
|
67
66
|
}
|
|
68
67
|
case "info": {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const [
|
|
69
|
+
{ ProcessOperatingSystemProvider },
|
|
70
|
+
{ CliAstroConfigResolver },
|
|
71
|
+
{ ProcessPackageManagerUserAgentProvider },
|
|
72
|
+
{ ProcessNodeVersionProvider },
|
|
73
|
+
{ CliDebugInfoProvider },
|
|
74
|
+
{ TinyexecCommandExecutor },
|
|
75
|
+
{ getPackageManager },
|
|
76
|
+
{ StyledDebugInfoFormatter },
|
|
77
|
+
{ PromptsPrompt },
|
|
78
|
+
{ CliClipboard },
|
|
79
|
+
{ PassthroughTextStyler },
|
|
80
|
+
{ infoCommand }
|
|
81
|
+
] = await Promise.all([
|
|
82
|
+
import("./infra/process-operating-system-provider.js"),
|
|
83
|
+
import("./info/infra/cli-astro-config-resolver.js"),
|
|
84
|
+
import("./info/infra/process-package-manager-user-agent-provider.js"),
|
|
85
|
+
import("./info/infra/process-node-version-provider.js"),
|
|
86
|
+
import("./info/infra/cli-debug-info-provider.js"),
|
|
87
|
+
import("./infra/tinyexec-command-executor.js"),
|
|
88
|
+
import("./info/core/get-package-manager.js"),
|
|
89
|
+
import("./info/infra/styled-debug-info-formatter.js"),
|
|
90
|
+
import("./info/infra/prompts-prompt.js"),
|
|
91
|
+
import("./info/infra/cli-clipboard.js"),
|
|
92
|
+
import("./infra/passthrough-text-styler.js"),
|
|
93
|
+
import("./info/core/info.js")
|
|
94
|
+
]);
|
|
95
|
+
const operatingSystemProvider = new ProcessOperatingSystemProvider();
|
|
96
|
+
const astroConfigResolver = new CliAstroConfigResolver({ flags });
|
|
97
|
+
const commandExecutor = new TinyexecCommandExecutor();
|
|
98
|
+
const packageManagerUserAgentProvider = new ProcessPackageManagerUserAgentProvider();
|
|
99
|
+
const nodeVersionProvider = new ProcessNodeVersionProvider();
|
|
100
|
+
const debugInfoProvider = new CliDebugInfoProvider({
|
|
101
|
+
config: await astroConfigResolver.resolve(),
|
|
102
|
+
astroVersionProvider,
|
|
103
|
+
operatingSystemProvider,
|
|
104
|
+
packageManager: await getPackageManager({
|
|
105
|
+
packageManagerUserAgentProvider,
|
|
106
|
+
commandExecutor
|
|
107
|
+
}),
|
|
108
|
+
nodeVersionProvider
|
|
109
|
+
});
|
|
110
|
+
const prompt = new PromptsPrompt({ force: flags.copy });
|
|
111
|
+
const clipboard = new CliClipboard({
|
|
112
|
+
commandExecutor,
|
|
113
|
+
logger,
|
|
114
|
+
operatingSystemProvider,
|
|
115
|
+
prompt
|
|
116
|
+
});
|
|
117
|
+
return await runner.run(infoCommand, {
|
|
118
|
+
logger,
|
|
119
|
+
debugInfoProvider,
|
|
120
|
+
getDebugInfoFormatter: ({ pretty }) => new StyledDebugInfoFormatter({
|
|
121
|
+
textStyler: pretty ? textStyler : new PassthroughTextStyler()
|
|
122
|
+
}),
|
|
123
|
+
clipboard
|
|
124
|
+
});
|
|
72
125
|
}
|
|
73
126
|
case "create-key": {
|
|
74
|
-
const [{
|
|
127
|
+
const [{ CryptoKeyGenerator }, { createKeyCommand }] = await Promise.all([
|
|
75
128
|
import("./create-key/infra/crypto-key-generator.js"),
|
|
76
129
|
import("./create-key/core/create-key.js")
|
|
77
130
|
]);
|
|
78
|
-
const keyGenerator =
|
|
131
|
+
const keyGenerator = new CryptoKeyGenerator();
|
|
79
132
|
return await runner.run(createKeyCommand, { logger, keyGenerator });
|
|
80
133
|
}
|
|
81
134
|
case "docs": {
|
|
82
135
|
const [
|
|
83
|
-
{
|
|
84
|
-
{
|
|
136
|
+
{ TinyexecCommandExecutor },
|
|
137
|
+
{ ProcessOperatingSystemProvider },
|
|
138
|
+
{ ProcessCloudIdeProvider },
|
|
85
139
|
{ openDocsCommand }
|
|
86
140
|
] = await Promise.all([
|
|
87
|
-
import("./
|
|
88
|
-
import("./
|
|
141
|
+
import("./infra/tinyexec-command-executor.js"),
|
|
142
|
+
import("./infra/process-operating-system-provider.js"),
|
|
143
|
+
import("./docs/infra/process-cloud-ide-provider.js"),
|
|
89
144
|
import("./docs/core/open-docs.js")
|
|
90
145
|
]);
|
|
91
|
-
const commandExecutor =
|
|
92
|
-
const
|
|
146
|
+
const commandExecutor = new TinyexecCommandExecutor();
|
|
147
|
+
const operatingSystemProvider = new ProcessOperatingSystemProvider();
|
|
148
|
+
const cloudIdeProvider = new ProcessCloudIdeProvider();
|
|
93
149
|
return await runner.run(openDocsCommand, {
|
|
94
150
|
url: "https://docs.astro.build/",
|
|
95
151
|
logger,
|
|
96
152
|
commandExecutor,
|
|
97
|
-
|
|
153
|
+
operatingSystemProvider,
|
|
154
|
+
cloudIdeProvider
|
|
98
155
|
});
|
|
99
156
|
}
|
|
100
157
|
case "telemetry": {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandExecutor } from '../../definitions.js';
|
|
2
|
+
import type { PackageManager, PackageManagerUserAgentProvider } from '../definitions.js';
|
|
3
|
+
interface Options {
|
|
4
|
+
packageManagerUserAgentProvider: PackageManagerUserAgentProvider;
|
|
5
|
+
commandExecutor: CommandExecutor;
|
|
6
|
+
}
|
|
7
|
+
export declare function getPackageManager({ packageManagerUserAgentProvider, commandExecutor, }: Options): Promise<PackageManager>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
async function getPackageManager({
|
|
2
|
+
packageManagerUserAgentProvider,
|
|
3
|
+
commandExecutor
|
|
4
|
+
}) {
|
|
5
|
+
if (!packageManagerUserAgentProvider.userAgent) {
|
|
6
|
+
const { NoopPackageManager } = await import("../infra/noop-package-manager.js");
|
|
7
|
+
return new NoopPackageManager();
|
|
8
|
+
}
|
|
9
|
+
const specifier = packageManagerUserAgentProvider.userAgent.split(" ")[0];
|
|
10
|
+
const _name = specifier.substring(0, specifier.lastIndexOf("/"));
|
|
11
|
+
const name = _name === "npminstall" ? "cnpm" : _name;
|
|
12
|
+
switch (name) {
|
|
13
|
+
case "pnpm": {
|
|
14
|
+
const { PnpmPackageManager } = await import("../infra/pnpm-package-manager.js");
|
|
15
|
+
return new PnpmPackageManager({ commandExecutor });
|
|
16
|
+
}
|
|
17
|
+
case "npm": {
|
|
18
|
+
const { NpmPackageManager } = await import("../infra/npm-package-manager.js");
|
|
19
|
+
return new NpmPackageManager({ commandExecutor });
|
|
20
|
+
}
|
|
21
|
+
case "yarn": {
|
|
22
|
+
const { YarnPackageManager } = await import("../infra/yarn-package-manager.js");
|
|
23
|
+
return new YarnPackageManager({ commandExecutor });
|
|
24
|
+
}
|
|
25
|
+
case "bun": {
|
|
26
|
+
const { BunPackageManager } = await import("../infra/bun-package-manager.js");
|
|
27
|
+
return new BunPackageManager();
|
|
28
|
+
}
|
|
29
|
+
default: {
|
|
30
|
+
const { NoopPackageManager } = await import("../infra/noop-package-manager.js");
|
|
31
|
+
return new NoopPackageManager();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
getPackageManager
|
|
37
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Logger } from '../../../core/logger/core.js';
|
|
2
|
+
import type { Clipboard, DebugInfoFormatter, DebugInfoProvider } from '../definitions.js';
|
|
3
|
+
interface Options {
|
|
4
|
+
debugInfoProvider: DebugInfoProvider;
|
|
5
|
+
getDebugInfoFormatter: (options: {
|
|
6
|
+
pretty: boolean;
|
|
7
|
+
}) => DebugInfoFormatter;
|
|
8
|
+
logger: Logger;
|
|
9
|
+
clipboard: Clipboard;
|
|
10
|
+
}
|
|
11
|
+
export declare const infoCommand: {
|
|
12
|
+
help: {
|
|
13
|
+
commandName: string;
|
|
14
|
+
tables: {
|
|
15
|
+
Flags: [string, string][];
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
run({ debugInfoProvider, getDebugInfoFormatter, logger, clipboard }: Options): Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineCommand } from "../../domain/command.js";
|
|
2
|
+
const infoCommand = defineCommand({
|
|
3
|
+
help: {
|
|
4
|
+
commandName: "astro info",
|
|
5
|
+
tables: {
|
|
6
|
+
Flags: [
|
|
7
|
+
["--help (-h)", "See all available flags."],
|
|
8
|
+
["--copy", "Force copy of the output."]
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
description: "Reports useful information about your current Astro environment. Useful for providing information when opening an issue."
|
|
12
|
+
},
|
|
13
|
+
async run({ debugInfoProvider, getDebugInfoFormatter, logger, clipboard }) {
|
|
14
|
+
const debugInfo = await debugInfoProvider.get();
|
|
15
|
+
logger.info("SKIP_FORMAT", getDebugInfoFormatter({ pretty: true }).format(debugInfo));
|
|
16
|
+
await clipboard.copy(getDebugInfoFormatter({ pretty: false }).format(debugInfo));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
infoCommand
|
|
21
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AstroConfig } from '../../types/public/index.js';
|
|
2
|
+
import type { DebugInfo } from './domain/debug-info.js';
|
|
3
|
+
export interface DebugInfoProvider {
|
|
4
|
+
get: () => Promise<DebugInfo>;
|
|
5
|
+
}
|
|
6
|
+
export interface DebugInfoFormatter {
|
|
7
|
+
format: (info: DebugInfo) => string;
|
|
8
|
+
}
|
|
9
|
+
export interface Clipboard {
|
|
10
|
+
copy: (text: string) => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export interface PackageManager {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
getPackageVersion: (name: string) => Promise<string | undefined>;
|
|
15
|
+
}
|
|
16
|
+
export interface AstroConfigResolver {
|
|
17
|
+
resolve: () => Promise<AstroConfig>;
|
|
18
|
+
}
|
|
19
|
+
export interface Prompt {
|
|
20
|
+
confirm: (input: {
|
|
21
|
+
message: string;
|
|
22
|
+
defaultValue?: boolean;
|
|
23
|
+
}) => Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export interface PackageManagerUserAgentProvider {
|
|
26
|
+
readonly userAgent: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface NodeVersionProvider {
|
|
29
|
+
readonly version: string;
|
|
30
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DebugInfo = Array<[string, string | Array<string>]>;
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AstroConfig } from '../../../types/public/index.js';
|
|
2
|
+
import type { Flags } from '../../flags.js';
|
|
3
|
+
import type { AstroConfigResolver } from '../definitions.js';
|
|
4
|
+
export declare class CliAstroConfigResolver implements AstroConfigResolver {
|
|
5
|
+
#private;
|
|
6
|
+
constructor({ flags }: {
|
|
7
|
+
flags: Flags;
|
|
8
|
+
});
|
|
9
|
+
resolve(): Promise<AstroConfig>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { resolveConfig } from "../../../core/config/config.js";
|
|
2
|
+
class CliAstroConfigResolver {
|
|
3
|
+
// TODO: find something better
|
|
4
|
+
#flags;
|
|
5
|
+
constructor({ flags }) {
|
|
6
|
+
this.#flags = flags;
|
|
7
|
+
}
|
|
8
|
+
async resolve() {
|
|
9
|
+
const { astroConfig } = await resolveConfig(
|
|
10
|
+
// TODO: consider testing flags => astro inline config
|
|
11
|
+
{
|
|
12
|
+
// Inline-only configs
|
|
13
|
+
configFile: typeof this.#flags.config === "string" ? this.#flags.config : void 0,
|
|
14
|
+
mode: typeof this.#flags.mode === "string" ? this.#flags.mode : void 0,
|
|
15
|
+
logLevel: this.#flags.verbose ? "debug" : this.#flags.silent ? "silent" : void 0,
|
|
16
|
+
force: this.#flags.force ? true : void 0,
|
|
17
|
+
// Astro user configs
|
|
18
|
+
root: typeof this.#flags.root === "string" ? this.#flags.root : void 0,
|
|
19
|
+
site: typeof this.#flags.site === "string" ? this.#flags.site : void 0,
|
|
20
|
+
base: typeof this.#flags.base === "string" ? this.#flags.base : void 0,
|
|
21
|
+
outDir: typeof this.#flags.outDir === "string" ? this.#flags.outDir : void 0,
|
|
22
|
+
server: {
|
|
23
|
+
port: typeof this.#flags.port === "number" ? this.#flags.port : void 0,
|
|
24
|
+
host: typeof this.#flags.host === "string" || typeof this.#flags.host === "boolean" ? this.#flags.host : void 0,
|
|
25
|
+
open: typeof this.#flags.open === "string" || typeof this.#flags.open === "boolean" ? this.#flags.open : void 0,
|
|
26
|
+
allowedHosts: typeof this.#flags.allowedHosts === "string" ? this.#flags.allowedHosts.split(",") : typeof this.#flags.allowedHosts === "boolean" && this.#flags.allowedHosts === true ? this.#flags.allowedHosts : []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"info"
|
|
30
|
+
);
|
|
31
|
+
return astroConfig;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
CliAstroConfigResolver
|
|
36
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Logger } from '../../../core/logger/core.js';
|
|
2
|
+
import type { CommandExecutor, OperatingSystemProvider } from '../../definitions.js';
|
|
3
|
+
import type { Clipboard, Prompt } from '../definitions.js';
|
|
4
|
+
export declare class CliClipboard implements Clipboard {
|
|
5
|
+
#private;
|
|
6
|
+
constructor({ operatingSystemProvider, commandExecutor, logger, prompt, }: {
|
|
7
|
+
operatingSystemProvider: OperatingSystemProvider;
|
|
8
|
+
commandExecutor: CommandExecutor;
|
|
9
|
+
logger: Logger;
|
|
10
|
+
prompt: Prompt;
|
|
11
|
+
});
|
|
12
|
+
copy(text: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
async function getExecInputForPlatform({
|
|
2
|
+
platform,
|
|
3
|
+
commandExecutor
|
|
4
|
+
}) {
|
|
5
|
+
if (platform === "darwin") {
|
|
6
|
+
return ["pbcopy"];
|
|
7
|
+
}
|
|
8
|
+
if (platform === "win32") {
|
|
9
|
+
return ["clip"];
|
|
10
|
+
}
|
|
11
|
+
const unixCommands = [
|
|
12
|
+
["xclip", ["-selection", "clipboard"]],
|
|
13
|
+
["wl-copy", []]
|
|
14
|
+
];
|
|
15
|
+
for (const [unixCommand, unixArgs] of unixCommands) {
|
|
16
|
+
try {
|
|
17
|
+
const { stdout } = await commandExecutor.execute("which", [unixCommand]);
|
|
18
|
+
if (stdout.trim()) {
|
|
19
|
+
return [unixCommand, unixArgs];
|
|
20
|
+
}
|
|
21
|
+
} catch {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
class CliClipboard {
|
|
28
|
+
#operatingSystemProvider;
|
|
29
|
+
#commandExecutor;
|
|
30
|
+
#logger;
|
|
31
|
+
#prompt;
|
|
32
|
+
constructor({
|
|
33
|
+
operatingSystemProvider,
|
|
34
|
+
commandExecutor,
|
|
35
|
+
logger,
|
|
36
|
+
prompt
|
|
37
|
+
}) {
|
|
38
|
+
this.#operatingSystemProvider = operatingSystemProvider;
|
|
39
|
+
this.#commandExecutor = commandExecutor;
|
|
40
|
+
this.#logger = logger;
|
|
41
|
+
this.#prompt = prompt;
|
|
42
|
+
}
|
|
43
|
+
async copy(text) {
|
|
44
|
+
text = text.trim();
|
|
45
|
+
const platform = this.#operatingSystemProvider.name;
|
|
46
|
+
const input = await getExecInputForPlatform({
|
|
47
|
+
platform,
|
|
48
|
+
commandExecutor: this.#commandExecutor
|
|
49
|
+
});
|
|
50
|
+
if (!input) {
|
|
51
|
+
this.#logger.warn("SKIP_FORMAT", "Clipboard command not found!");
|
|
52
|
+
this.#logger.info("SKIP_FORMAT", "Please manually copy the text above.");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!await this.#prompt.confirm({
|
|
56
|
+
message: "Copy to clipboard?",
|
|
57
|
+
defaultValue: true
|
|
58
|
+
})) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const [command, args] = input;
|
|
63
|
+
await this.#commandExecutor.execute(command, args, {
|
|
64
|
+
input: text,
|
|
65
|
+
stdio: ["pipe", "ignore", "ignore"]
|
|
66
|
+
});
|
|
67
|
+
this.#logger.info("SKIP_FORMAT", "Copied to clipboard!");
|
|
68
|
+
} catch {
|
|
69
|
+
this.#logger.error(
|
|
70
|
+
"SKIP_FORMAT",
|
|
71
|
+
"Sorry, something went wrong! Please copy the text above manually."
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
CliClipboard
|
|
78
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AstroConfig } from '../../../types/public/index.js';
|
|
2
|
+
import type { AstroVersionProvider, OperatingSystemProvider } from '../../definitions.js';
|
|
3
|
+
import type { DebugInfoProvider, NodeVersionProvider, PackageManager } from '../definitions.js';
|
|
4
|
+
import type { DebugInfo } from '../domain/debug-info.js';
|
|
5
|
+
export declare class CliDebugInfoProvider implements DebugInfoProvider {
|
|
6
|
+
#private;
|
|
7
|
+
constructor({ config, astroVersionProvider, packageManager, operatingSystemProvider, nodeVersionProvider, }: {
|
|
8
|
+
config: Pick<AstroConfig, 'output' | 'adapter' | 'integrations'>;
|
|
9
|
+
astroVersionProvider: AstroVersionProvider;
|
|
10
|
+
packageManager: PackageManager;
|
|
11
|
+
operatingSystemProvider: OperatingSystemProvider;
|
|
12
|
+
nodeVersionProvider: NodeVersionProvider;
|
|
13
|
+
});
|
|
14
|
+
get(): Promise<DebugInfo>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function withVersion(name, version) {
|
|
2
|
+
let result = name;
|
|
3
|
+
if (version) {
|
|
4
|
+
result += ` (${version})`;
|
|
5
|
+
}
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
8
|
+
class CliDebugInfoProvider {
|
|
9
|
+
#config;
|
|
10
|
+
#astroVersionProvider;
|
|
11
|
+
#packageManager;
|
|
12
|
+
#operatingSystemProvider;
|
|
13
|
+
#nodeVersionProvider;
|
|
14
|
+
constructor({
|
|
15
|
+
config,
|
|
16
|
+
astroVersionProvider,
|
|
17
|
+
packageManager,
|
|
18
|
+
operatingSystemProvider,
|
|
19
|
+
nodeVersionProvider
|
|
20
|
+
}) {
|
|
21
|
+
this.#config = config;
|
|
22
|
+
this.#astroVersionProvider = astroVersionProvider;
|
|
23
|
+
this.#packageManager = packageManager;
|
|
24
|
+
this.#operatingSystemProvider = operatingSystemProvider;
|
|
25
|
+
this.#nodeVersionProvider = nodeVersionProvider;
|
|
26
|
+
}
|
|
27
|
+
async get() {
|
|
28
|
+
const debugInfo = [
|
|
29
|
+
["Astro", `v${this.#astroVersionProvider.version}`],
|
|
30
|
+
["Node", this.#nodeVersionProvider.version],
|
|
31
|
+
["System", this.#operatingSystemProvider.displayName],
|
|
32
|
+
["Package Manager", this.#packageManager.name],
|
|
33
|
+
["Output", this.#config.output]
|
|
34
|
+
];
|
|
35
|
+
const viteVersion = await this.#packageManager.getPackageVersion("vite");
|
|
36
|
+
if (viteVersion) {
|
|
37
|
+
debugInfo.splice(1, 0, ["Vite", viteVersion]);
|
|
38
|
+
}
|
|
39
|
+
debugInfo.push([
|
|
40
|
+
"Adapter",
|
|
41
|
+
this.#config.adapter ? withVersion(
|
|
42
|
+
this.#config.adapter.name,
|
|
43
|
+
await this.#packageManager.getPackageVersion(this.#config.adapter.name)
|
|
44
|
+
) : "none"
|
|
45
|
+
]);
|
|
46
|
+
const integrations = await Promise.all(
|
|
47
|
+
this.#config.integrations.map(
|
|
48
|
+
async ({ name }) => withVersion(name, await this.#packageManager.getPackageVersion(name))
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
debugInfo.push(["Integrations", integrations.length > 0 ? integrations : "none"]);
|
|
52
|
+
return debugInfo;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
CliDebugInfoProvider
|
|
57
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AstroConfig } from '../../../types/public/index.js';
|
|
2
|
+
import type { AstroVersionProvider, OperatingSystemProvider } from '../../definitions.js';
|
|
3
|
+
import type { DebugInfoProvider, NodeVersionProvider, PackageManager } from '../definitions.js';
|
|
4
|
+
import type { DebugInfo } from '../domain/debug-info.js';
|
|
5
|
+
/**
|
|
6
|
+
* Returns debug info without any package versions, to avoid slowing down the dev server
|
|
7
|
+
*/
|
|
8
|
+
export declare class DevDebugInfoProvider implements DebugInfoProvider {
|
|
9
|
+
#private;
|
|
10
|
+
constructor({ config, astroVersionProvider, packageManager, operatingSystemProvider, nodeVersionProvider, }: {
|
|
11
|
+
config: Pick<AstroConfig, 'output' | 'adapter' | 'integrations'>;
|
|
12
|
+
astroVersionProvider: AstroVersionProvider;
|
|
13
|
+
packageManager: PackageManager;
|
|
14
|
+
operatingSystemProvider: OperatingSystemProvider;
|
|
15
|
+
nodeVersionProvider: NodeVersionProvider;
|
|
16
|
+
});
|
|
17
|
+
get(): Promise<DebugInfo>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
class DevDebugInfoProvider {
|
|
2
|
+
#config;
|
|
3
|
+
#astroVersionProvider;
|
|
4
|
+
#packageManager;
|
|
5
|
+
#operatingSystemProvider;
|
|
6
|
+
#nodeVersionProvider;
|
|
7
|
+
constructor({
|
|
8
|
+
config,
|
|
9
|
+
astroVersionProvider,
|
|
10
|
+
packageManager,
|
|
11
|
+
operatingSystemProvider,
|
|
12
|
+
nodeVersionProvider
|
|
13
|
+
}) {
|
|
14
|
+
this.#config = config;
|
|
15
|
+
this.#astroVersionProvider = astroVersionProvider;
|
|
16
|
+
this.#packageManager = packageManager;
|
|
17
|
+
this.#operatingSystemProvider = operatingSystemProvider;
|
|
18
|
+
this.#nodeVersionProvider = nodeVersionProvider;
|
|
19
|
+
}
|
|
20
|
+
async get() {
|
|
21
|
+
const debugInfo = [
|
|
22
|
+
["Astro", `v${this.#astroVersionProvider.version}`],
|
|
23
|
+
["Node", this.#nodeVersionProvider.version],
|
|
24
|
+
["System", this.#operatingSystemProvider.displayName],
|
|
25
|
+
["Package Manager", this.#packageManager.name],
|
|
26
|
+
["Output", this.#config.output],
|
|
27
|
+
["Adapter", this.#config.adapter?.name ?? "none"]
|
|
28
|
+
];
|
|
29
|
+
const integrations = this.#config.integrations.map((integration) => integration.name);
|
|
30
|
+
debugInfo.push(["Integrations", integrations.length > 0 ? integrations : "none"]);
|
|
31
|
+
return debugInfo;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
DevDebugInfoProvider
|
|
36
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandExecutor } from '../../definitions.js';
|
|
2
|
+
import type { PackageManager } from '../definitions.js';
|
|
3
|
+
export declare class NpmPackageManager implements PackageManager {
|
|
4
|
+
#private;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
constructor({ commandExecutor }: {
|
|
7
|
+
commandExecutor: CommandExecutor;
|
|
8
|
+
});
|
|
9
|
+
getPackageVersion(name: string): Promise<string | undefined>;
|
|
10
|
+
}
|