Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/svelte/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ src/shared/version.js
/test/**/_actual*
/test/**/expected*
/test/**/_output
/test/**/shards/*.test.js
/types
!rollup.config.js
!vitest.config.js
2 changes: 1 addition & 1 deletion packages/svelte/scripts/generate-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));

fs.writeFileSync(
'./src/shared/version.js',
`/** @type {string} */\nexport const VERSION = '${pkg.version}';`
`// generated during release, do not modify\n\n/** @type {string} */\nexport const VERSION = '${pkg.version}';\n`
);
4 changes: 3 additions & 1 deletion packages/svelte/src/shared/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// generated during release, do not modify

/** @type {string} */
export const VERSION = '4.0.0-next.0';
export const VERSION = '4.0.0-next.0';
16 changes: 16 additions & 0 deletions packages/svelte/test/version/version.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { fileURLToPath } from 'node:url';
import { assert, describe, it } from 'vitest';
import { VERSION } from 'svelte/compiler';
import { try_load_json } from '../helpers.js';

describe('svelte/compiler VERSION', () => {
it('should be the exact version from package.json');
const pkg = try_load_json(
fileURLToPath(new URL(`../../../../packages/svelte/package.json`, import.meta.url))
);
assert.equal(
VERSION,
pkg.version,
`VERSION export in src/shared/version.js does not equal version in package.json`
);
});