diff options
author | 2023-08-01 16:34:22 -0700 | |
---|---|---|
committer | 2023-08-01 18:34:22 -0500 | |
commit | c00b6f0c49027125ea3026e89b21fef84380d187 (patch) | |
tree | b49fac3f1d63979ffb78c726946dedfb2a5f1db9 | |
parent | 2f06923764ff61b758604776e288c8ed5f1cebea (diff) | |
download | astro-c00b6f0c49027125ea3026e89b21fef84380d187.tar.gz astro-c00b6f0c49027125ea3026e89b21fef84380d187.tar.zst astro-c00b6f0c49027125ea3026e89b21fef84380d187.zip |
Fix astro/app import (#7821)
* core -> core.js
* changeset
* test
---------
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
-rw-r--r-- | .changeset/four-ways-tap.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/app/index.ts | 2 | ||||
-rw-r--r-- | packages/astro/test/import-app.test.js | 13 | ||||
-rw-r--r-- | pnpm-lock.yaml | 6 |
4 files changed, 25 insertions, 1 deletions
diff --git a/.changeset/four-ways-tap.md b/.changeset/four-ways-tap.md new file mode 100644 index 000000000..89af56e0a --- /dev/null +++ b/.changeset/four-ways-tap.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes an issue that prevents importing `'astro/app'` diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index 288385598..da025609a 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -12,7 +12,7 @@ import { consoleLogDestination } from '../logger/console.js'; import { error, type LogOptions } from '../logger/core.js'; import { prependForwardSlash, removeTrailingForwardSlash } from '../path.js'; import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; -import { isResponse } from '../render/core'; +import { isResponse } from '../render/core.js'; import { createEnvironment, createRenderContext, diff --git a/packages/astro/test/import-app.test.js b/packages/astro/test/import-app.test.js new file mode 100644 index 000000000..7ac536306 --- /dev/null +++ b/packages/astro/test/import-app.test.js @@ -0,0 +1,13 @@ +import { expect } from 'chai'; + +describe('Import astro/app', async () => { + + it('Successfully imports astro/app', async () => { + try { + await import('astro/app'); + expect(true).to.be.true; + } catch (err) { + expect.fail(undefined, undefined, `Importing astro/app should not throw an error: ${err}`); + } + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82c130ed9..3d66633af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2721,6 +2721,12 @@ importers: specifier: ^10.15.1 version: 10.15.1 + packages/astro/test/fixtures/import-app: + dependencies: + astro: + specifier: workspace:* + version: link:../../.. + packages/astro/test/fixtures/import-ts-with-js: dependencies: astro: |