-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #9937 --------- Co-authored-by: Rich Harris <hello@rich-harris.dev> Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Rich Harris <git@rich-harris.dev> Co-authored-by: Ivan Hofer <ivan.hofer@outlok.com>
- Loading branch information
1 parent
ade7283
commit 316a4af
Showing
8 changed files
with
42 additions
and
1 deletion.
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 @@ | ||
--- | ||
'@sveltejs/kit': patch | ||
--- | ||
|
||
feat: export `VERSION` from `@sveltejs/kit` |
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
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
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
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 @@ | ||
import fs from 'node:fs'; | ||
|
||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); | ||
|
||
fs.writeFileSync( | ||
'./src/version.js', | ||
`// generated during release, do not modify\n\n/** @type {string} */\nexport const VERSION = '${pkg.version}';\n` | ||
); |
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
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,4 @@ | ||
// generated during release, do not modify | ||
|
||
/** @type {string} */ | ||
export const VERSION = '1.20.4'; |
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,19 @@ | ||
import { fileURLToPath } from 'node:url'; | ||
import { readFileSync } from 'node:fs'; | ||
import { assert, describe, it } from 'vitest'; | ||
|
||
// runs the version generation as a side-effect of importing | ||
import '../scripts/generate-version.js'; | ||
|
||
describe('@sveltejs/kit VERSION', async () => { | ||
it('should be the exact version from package.json'); | ||
const { VERSION } = await import('./version.js'); | ||
const pkg = JSON.parse( | ||
readFileSync(fileURLToPath(new URL('../package.json', import.meta.url)), 'utf-8') | ||
); | ||
assert.equal( | ||
VERSION, | ||
pkg.version, | ||
'VERSION export in src/version.js does not equal version in package.json' | ||
); | ||
}); |