diff --git a/packages/astro/src/assets/index.ts b/packages/astro/src/assets/index.ts new file mode 100644 index 000000000..9eeccf250 --- /dev/null +++ b/packages/astro/src/assets/index.ts @@ -0,0 +1,3 @@ +export { getConfiguredImageService, getImage } from './internal.js'; +export { baseService, isLocalService } from './services/service.js'; +export { type LocalImageProps, type RemoteImageProps } from './types.js'; diff --git a/packages/astro/src/runtime/compiler/index.ts b/packages/astro/src/runtime/compiler/index.ts new file mode 100644 index 000000000..6123d6199 --- /dev/null +++ b/packages/astro/src/runtime/compiler/index.ts @@ -0,0 +1,20 @@ +// NOTE: Although this entrypoint is exported, it is internal API and may change at any time. + +export { + Fragment, + addAttribute, + createAstro, + createComponent, + createTransitionScope, + defineScriptVars, + defineStyleVars, + maybeRenderHead, + mergeSlots, + render, + renderComponent, + renderHead, + renderSlot, + renderTransition, + spreadAttributes, + unescapeHTML, +} from '../server/index.js'; diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js index 622ede1f6..1f4cc47a1 100644 --- a/packages/astro/test/test-utils.js +++ b/packages/astro/test/test-utils.js @@ -12,7 +12,8 @@ import sync from '../dist/core/sync/index.js'; import { RESOLVED_SPLIT_MODULE_ID } from '../dist/core/build/plugins/plugin-ssr.js'; import { getVirtualModulePageNameFromPath } from '../dist/core/build/plugins/util.js'; import { makeSplitEntryPointFileName } from '../dist/core/build/static-build.js'; -import { mergeConfig, resolveConfig } from '../dist/core/config/index.js'; +import { resolveConfig } from '../dist/core/config/config.js'; +import { mergeConfig } from "../dist/core/config/merge.js"; import { nodeLogDestination } from '../dist/core/logger/node.js'; // Disable telemetry when running tests diff --git a/packages/astro/test/units/compile/invalid-css.test.js b/packages/astro/test/units/compile/invalid-css.test.js index 7a0303437..744569466 100644 --- a/packages/astro/test/units/compile/invalid-css.test.js +++ b/packages/astro/test/units/compile/invalid-css.test.js @@ -1,8 +1,8 @@ -import { resolveConfig } from 'vite'; import { expect } from 'chai'; -import { cachedCompilation } from '../../../dist/core/compile/index.js'; -import { AggregateError } from '../../../dist/core/errors/index.js'; import { pathToFileURL } from 'node:url'; +import { resolveConfig } from 'vite'; +import { cachedCompilation } from '../../../dist/core/compile/cache.js'; +import { AggregateError } from '../../../dist/core/errors/index.js'; describe('astro/src/core/compile', () => { describe('Invalid CSS', () => { diff --git a/packages/astro/test/units/config/config-resolve.test.js b/packages/astro/test/units/config/config-resolve.test.js index c3c19da64..ff8f7a374 100644 --- a/packages/astro/test/units/config/config-resolve.test.js +++ b/packages/astro/test/units/config/config-resolve.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { resolveConfig } from '../../../dist/core/config/index.js'; +import { resolveConfig } from '../../../dist/core/config/config.js'; describe('resolveConfig', () => { it('resolves relative inline root correctly', async () => { diff --git a/packages/astro/test/units/config/config-server.test.js b/packages/astro/test/units/config/config-server.test.js index 8a60c53bf..ca3c6cf58 100644 --- a/packages/astro/test/units/config/config-server.test.js +++ b/packages/astro/test/units/config/config-server.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; import { flagsToAstroInlineConfig } from '../../../dist/cli/flags.js'; -import { resolveConfig } from '../../../dist/core/config/index.js'; +import { resolveConfig } from '../../../dist/core/config/config.js'; const cwd = fileURLToPath(new URL('../../fixtures/config-host/', import.meta.url)); diff --git a/packages/astro/test/units/config/config-tsconfig.test.js b/packages/astro/test/units/config/config-tsconfig.test.js index 4b87793a9..83585a285 100644 --- a/packages/astro/test/units/config/config-tsconfig.test.js +++ b/packages/astro/test/units/config/config-tsconfig.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; -import { loadTSConfig, updateTSConfigForFramework } from '../../../dist/core/config/index.js'; +import { loadTSConfig, updateTSConfigForFramework } from '../../../dist/core/config/tsconfig.js'; import * as path from 'node:path'; import * as tsr from 'tsconfig-resolver'; diff --git a/packages/astro/test/units/content-collections/error-map.test.js b/packages/astro/test/units/content-collections/error-map.test.js index 4284ad721..20ebafc31 100644 --- a/packages/astro/test/units/content-collections/error-map.test.js +++ b/packages/astro/test/units/content-collections/error-map.test.js @@ -1,5 +1,5 @@ import { z } from '../../../zod.mjs'; -import { errorMap } from '../../../dist/content/index.js'; +import { errorMap } from '../../../dist/content/error-map.js'; import { fixLineEndings } from '../../test-utils.js'; import { expect } from 'chai'; diff --git a/packages/astro/test/units/content-collections/frontmatter.test.js b/packages/astro/test/units/content-collections/frontmatter.test.js index f06b33710..cf3d23cee 100644 --- a/packages/astro/test/units/content-collections/frontmatter.test.js +++ b/packages/astro/test/units/content-collections/frontmatter.test.js @@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url'; import nodeFS from 'node:fs'; import path from 'node:path'; -import { attachContentServerListeners } from '../../../dist/content/index.js'; +import { attachContentServerListeners } from '../../../dist/content/server-listeners.js'; import { createFs, runInContainer, triggerFSEvent } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/cookies/delete.test.js b/packages/astro/test/units/cookies/delete.test.js index f4c9fab53..f0965886b 100644 --- a/packages/astro/test/units/cookies/delete.test.js +++ b/packages/astro/test/units/cookies/delete.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { AstroCookies } from '../../../dist/core/cookies/index.js'; +import { AstroCookies } from '../../../dist/core/cookies/cookies.js'; import { apply as applyPolyfill } from '../../../dist/core/polyfill.js'; applyPolyfill(); diff --git a/packages/astro/test/units/cookies/error.test.js b/packages/astro/test/units/cookies/error.test.js index 9cfe1ec0f..3800848ec 100644 --- a/packages/astro/test/units/cookies/error.test.js +++ b/packages/astro/test/units/cookies/error.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { AstroCookies } from '../../../dist/core/cookies/index.js'; +import { AstroCookies } from '../../../dist/core/cookies/cookies.js'; import { apply as applyPolyfill } from '../../../dist/core/polyfill.js'; applyPolyfill(); diff --git a/packages/astro/test/units/cookies/get.test.js b/packages/astro/test/units/cookies/get.test.js index 216128907..aa8392ebb 100644 --- a/packages/astro/test/units/cookies/get.test.js +++ b/packages/astro/test/units/cookies/get.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { AstroCookies } from '../../../dist/core/cookies/index.js'; +import { AstroCookies } from '../../../dist/core/cookies/cookies.js'; import { apply as applyPolyfill } from '../../../dist/core/polyfill.js'; applyPolyfill(); diff --git a/packages/astro/test/units/cookies/has.test.js b/packages/astro/test/units/cookies/has.test.js index c4cb4776a..7289da111 100644 --- a/packages/astro/test/units/cookies/has.test.js +++ b/packages/astro/test/units/cookies/has.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { AstroCookies } from '../../../dist/core/cookies/index.js'; +import { AstroCookies } from '../../../dist/core/cookies/cookies.js'; import { apply as applyPolyfill } from '../../../dist/core/polyfill.js'; applyPolyfill(); diff --git a/packages/astro/test/units/cookies/set.test.js b/packages/astro/test/units/cookies/set.test.js index 0913bcc7d..08a793a34 100644 --- a/packages/astro/test/units/cookies/set.test.js +++ b/packages/astro/test/units/cookies/set.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { AstroCookies } from '../../../dist/core/cookies/index.js'; +import { AstroCookies } from '../../../dist/core/cookies/cookies.js'; import { apply as applyPolyfill } from '../../../dist/core/polyfill.js'; applyPolyfill(); diff --git a/packages/astro/test/units/dev/restart.test.js b/packages/astro/test/units/dev/restart.test.js index 1b00d5c6a..5f8cbf0ed 100644 --- a/packages/astro/test/units/dev/restart.test.js +++ b/packages/astro/test/units/dev/restart.test.js @@ -3,9 +3,9 @@ import * as cheerio from 'cheerio'; import { fileURLToPath } from 'node:url'; import { - createContainerWithAutomaticRestart, startContainer, -} from '../../../dist/core/dev/index.js'; +} from '../../../dist/core/dev/container.js'; +import { createContainerWithAutomaticRestart } from '../../../dist/core/dev/restart.js'; import { createFs, createRequestAndResponse, triggerFSEvent } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/render/head.test.js b/packages/astro/test/units/render/head.test.js index d2580e30d..17b0ea436 100644 --- a/packages/astro/test/units/render/head.test.js +++ b/packages/astro/test/units/render/head.test.js @@ -9,7 +9,8 @@ import { renderHead, Fragment, } from '../../../dist/runtime/server/index.js'; -import { createRenderContext, tryRenderRoute } from '../../../dist/core/render/index.js'; +import { createRenderContext } from '../../../dist/core/render/context.js'; +import { tryRenderRoute } from "../../../dist/core/render/core.js"; import { createBasicEnvironment } from '../test-utils.js'; import * as cheerio from 'cheerio'; diff --git a/packages/astro/test/units/render/jsx.test.js b/packages/astro/test/units/render/jsx.test.js index 1464b5b0c..ed7745109 100644 --- a/packages/astro/test/units/render/jsx.test.js +++ b/packages/astro/test/units/render/jsx.test.js @@ -8,10 +8,11 @@ import { import { jsx } from '../../../dist/jsx-runtime/index.js'; import { createRenderContext, - tryRenderRoute, - loadRenderer, -} from '../../../dist/core/render/index.js'; -import { createAstroJSXComponent, renderer as jsxRenderer } from '../../../dist/jsx/index.js'; +} from '../../../dist/core/render/context.js'; +import { tryRenderRoute } from "../../../dist/core/render/core.js"; +import { loadRenderer } from '../../../dist/core/render/renderer.js'; +import { createAstroJSXComponent } from '../../../dist/jsx/component.js'; +import { default as jsxRenderer } from "../../../dist/jsx/renderer.js"; import { createBasicEnvironment } from '../test-utils.js'; const createAstroModule = (AstroComponent) => ({ default: AstroComponent }); diff --git a/packages/astro/test/units/routing/route-matching.test.js b/packages/astro/test/units/routing/route-matching.test.js index 6f4724893..7c8875543 100644 --- a/packages/astro/test/units/routing/route-matching.test.js +++ b/packages/astro/test/units/routing/route-matching.test.js @@ -4,7 +4,8 @@ import { createRequestAndResponse, defaultLogger, } from '../test-utils.js'; -import { createRouteManifest, matchAllRoutes } from '../../../dist/core/routing/index.js'; +import { createRouteManifest } from '../../../dist/core/routing/manifest/create.js'; +import { matchAllRoutes } from '../../../dist/core/routing/match.js'; import { fileURLToPath } from 'node:url'; import { createViteLoader } from '../../../dist/core/module-loader/vite.js'; import { expect } from 'chai'; diff --git a/packages/astro/test/units/shiki/shiki.test.js b/packages/astro/test/units/shiki/shiki.test.js index d88f3c31e..1c574015d 100644 --- a/packages/astro/test/units/shiki/shiki.test.js +++ b/packages/astro/test/units/shiki/shiki.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; -import { createContainer } from '../../../dist/core/dev/index.js'; -import { createViteLoader } from '../../../dist/core/module-loader/index.js'; +import { createContainer } from '../../../dist/core/dev/container.js'; +import { createViteLoader } from '../../../dist/core/module-loader/vite.js'; import { createBasicSettings, defaultLogger } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/test-utils.js b/packages/astro/test/units/test-utils.js index f8d6dce24..8a7804ea6 100644 --- a/packages/astro/test/units/test-utils.js +++ b/packages/astro/test/units/test-utils.js @@ -4,11 +4,11 @@ import { EventEmitter } from 'node:events'; import realFS from 'node:fs'; import npath from 'node:path'; import { fileURLToPath } from 'node:url'; -import { getDefaultClientDirectives } from '../../dist/core/client-directive/index.js'; +import { getDefaultClientDirectives } from '../../dist/core/client-directive/default.js'; import { nodeLogDestination } from '../../dist/core/logger/node.js'; -import { createEnvironment } from '../../dist/core/render/index.js'; +import { createEnvironment } from '../../dist/core/render/environment.js'; import { RouteCache } from '../../dist/core/render/route-cache.js'; -import { resolveConfig } from '../../dist/core/config/index.js'; +import { resolveConfig } from '../../dist/core/config/config.js'; import { createBaseSettings } from '../../dist/core/config/settings.js'; import { createContainer } from '../../dist/core/dev/container.js'; import { unixify } from './correct-path.js'; diff --git a/packages/astro/test/units/vite-plugin-astro-server/controller.test.js b/packages/astro/test/units/vite-plugin-astro-server/controller.test.js index 0864d8964..fde2ec571 100644 --- a/packages/astro/test/units/vite-plugin-astro-server/controller.test.js +++ b/packages/astro/test/units/vite-plugin-astro-server/controller.test.js @@ -1,9 +1,9 @@ import { expect } from 'chai'; -import { createLoader } from '../../../dist/core/module-loader/index.js'; +import { createLoader } from '../../../dist/core/module-loader/loader.js'; import { createController, runWithErrorHandling, -} from '../../../dist/vite-plugin-astro-server/index.js'; +} from '../../../dist/vite-plugin-astro-server/controller.js'; describe('vite-plugin-astro-server', () => { describe('controller', () => { diff --git a/packages/astro/test/units/vite-plugin-astro-server/request.test.js b/packages/astro/test/units/vite-plugin-astro-server/request.test.js index d3472c56b..f9ba431c1 100644 --- a/packages/astro/test/units/vite-plugin-astro-server/request.test.js +++ b/packages/astro/test/units/vite-plugin-astro-server/request.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { createLoader } from '../../../dist/core/module-loader/index.js'; -import { createRouteManifest } from '../../../dist/core/routing/index.js'; +import { createLoader } from '../../../dist/core/module-loader/loader.js'; +import { createRouteManifest } from '../../../dist/core/routing/manifest/create.js'; import { createComponent, render } from '../../../dist/runtime/server/index.js'; import { createController, handleRequest } from '../../../dist/vite-plugin-astro-server/index.js'; import {