This repository has been archived by the owner on Feb 10, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vercel): copy static assets after all integrations (#508)
* fix(vercel): copy static assets after all integrations * Format * Fix logic * Format
- Loading branch information
Showing
8 changed files
with
142 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/vercel': patch | ||
--- | ||
|
||
Fixes a bug that prevented static assets generated by integrations from being deployed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/vercel/test/fixtures/integration-assets/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import vercel from '@astrojs/vercel'; | ||
import { defineConfig } from 'astro/config'; | ||
|
||
import sitemap from '@astrojs/sitemap'; | ||
|
||
export default defineConfig({ | ||
site: 'https://example.com', | ||
adapter: vercel({}), | ||
integrations: [sitemap()] | ||
}); |
10 changes: 10 additions & 0 deletions
10
packages/vercel/test/fixtures/integration-assets/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "@test/astro-vercel-integration-assets", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"@astrojs/sitemap": "^3.2.1", | ||
"@astrojs/vercel": "workspace:*", | ||
"astro": "^5.1.6" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/vercel/test/fixtures/integration-assets/src/pages/one.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>One</title> | ||
</head> | ||
<body> | ||
<h1>One</h1> | ||
</body> | ||
</html> |
8 changes: 8 additions & 0 deletions
8
packages/vercel/test/fixtures/integration-assets/src/pages/two.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html> | ||
<head> | ||
<title>Two</title> | ||
</head> | ||
<body> | ||
<h1>Two</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import assert from 'node:assert/strict'; | ||
import { before, describe, it } from 'node:test'; | ||
import { loadFixture } from './test-utils.js'; | ||
|
||
describe('Assets generated by integrations', () => { | ||
/** @type {import('./test-utils.js').Fixture} */ | ||
let fixture; | ||
|
||
before(async () => { | ||
fixture = await loadFixture({ | ||
root: './fixtures/integration-assets/', | ||
}); | ||
await fixture.build(); | ||
}); | ||
|
||
it('moves static assets generated by integrations to the correct location', async () => { | ||
const sitemap = await fixture.readFile('../.vercel/output/static/sitemap-index.xml'); | ||
assert(sitemap.includes('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">')); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.