diff --git a/.changeset/selfish-lamps-joke.md b/.changeset/selfish-lamps-joke.md new file mode 100644 index 000000000000..b2003ab2f1b7 --- /dev/null +++ b/.changeset/selfish-lamps-joke.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-auto': major +--- + +feat: update Vercel, Cloudflare Pages, and Netlify adapter major versions diff --git a/packages/adapter-auto/adapters.js b/packages/adapter-auto/adapters.js index edf9e3436e20..0c45dcaec3ae 100644 --- a/packages/adapter-auto/adapters.js +++ b/packages/adapter-auto/adapters.js @@ -7,19 +7,19 @@ export const adapters = [ name: 'Vercel', test: () => !!process.env.VERCEL, module: '@sveltejs/adapter-vercel', - version: '4' + version: '5' }, { name: 'Cloudflare Pages', test: () => !!process.env.CF_PAGES, module: '@sveltejs/adapter-cloudflare', - version: '3' + version: '4' }, { name: 'Netlify', test: () => !!process.env.NETLIFY, module: '@sveltejs/adapter-netlify', - version: '3' + version: '4' }, { name: 'Azure Static Web Apps', diff --git a/packages/adapter-auto/package.json b/packages/adapter-auto/package.json index ef4fbc3ba707..e58aa5697640 100644 --- a/packages/adapter-auto/package.json +++ b/packages/adapter-auto/package.json @@ -36,13 +36,15 @@ "scripts": { "lint": "prettier --check .", "format": "pnpm lint --write", - "check": "tsc" + "check": "tsc", + "test": "vitest run" }, "devDependencies": { "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^5.0.1", "@types/node": "^18.19.48", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "vitest": "^2.1.6" }, "dependencies": { "import-meta-resolve": "^4.1.0" diff --git a/packages/adapter-auto/test/adapters.spec.js b/packages/adapter-auto/test/adapters.spec.js new file mode 100644 index 000000000000..abb873fa6a78 --- /dev/null +++ b/packages/adapter-auto/test/adapters.spec.js @@ -0,0 +1,16 @@ +import { assert, test } from 'vitest'; +import { adapters } from 'adapters.js'; +import { existsSync, readFileSync } from 'node:fs'; + +test('adapter versions are up to date', () => { + for (const adapter of adapters) { + const dir = adapter.module.replace('@sveltejs/', ''); + const package_json = `../${dir}/package.json`; + if (!existsSync(package_json)) { + continue; + } + const adapter_version = JSON.parse(readFileSync(package_json, 'utf-8')).version; + const [major] = adapter_version.split('.'); + assert.equal(adapter.version, major, `${adapter.name} adapter is outdated`); + } +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 873ed72ba864..5bba65421e5f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,9 @@ importers: typescript: specifier: ^5.3.3 version: 5.6.3 + vitest: + specifier: ^2.1.6 + version: 2.1.6(@types/node@18.19.50)(lightningcss@1.24.1) packages/adapter-cloudflare: dependencies: