-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add optional chaining back to
finalise
hook (#8846)
* fix: add optional chaining back to `finalise` hook * add a test * remove check task * Update .changeset/grumpy-islands-collect.md --------- Co-authored-by: Rich Harris <hello@rich-harris.dev>
- Loading branch information
1 parent
089c405
commit 7cdb7a6
Showing
14 changed files
with
120 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 | ||
--- | ||
|
||
fix: preserve build error messages |
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,7 @@ | ||
.DS_Store | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env.* | ||
!.env.example |
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 @@ | ||
engine-strict=true |
18 changes: 18 additions & 0 deletions
18
packages/kit/test/build-errors/apps/syntax-error/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,18 @@ | ||
{ | ||
"name": "syntax-error", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/kit": "workspace:^", | ||
"svelte": "^3.55.1", | ||
"svelte-check": "^3.0.2", | ||
"typescript": "^4.9.4", | ||
"vite": "^4.0.4" | ||
}, | ||
"type": "module" | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/kit/test/build-errors/apps/syntax-error/src/app.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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
%sveltekit.head% | ||
</head> | ||
<body> | ||
<div>%sveltekit.body%</div> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
packages/kit/test/build-errors/apps/syntax-error/src/lib/test.server.js
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 @@ | ||
export const should_explode = 'boom'; |
1 change: 1 addition & 0 deletions
1
packages/kit/test/build-errors/apps/syntax-error/src/routes/+page.svelte
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 @@ | ||
<div |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
packages/kit/test/build-errors/apps/syntax-error/svelte.config.js
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 @@ | ||
/** @type {import('@sveltejs/kit').Config} */ | ||
const config = {}; | ||
|
||
export default config; |
19 changes: 19 additions & 0 deletions
19
packages/kit/test/build-errors/apps/syntax-error/tsconfig.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,19 @@ | ||
{ | ||
"extends": "./.svelte-kit/tsconfig.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"checkJs": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"noEmit": true, | ||
"paths": { | ||
"types": ["../../../../types/internal"], | ||
"$lib": ["./src/lib"], | ||
"$lib/*": ["./src/lib/*"] | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/kit/test/build-errors/apps/syntax-error/vite.config.js
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,14 @@ | ||
import { sveltekit } from '@sveltejs/kit/vite'; | ||
import path from 'path'; | ||
|
||
/** @type {import('vite').UserConfig} */ | ||
const config = { | ||
plugins: [sveltekit()], | ||
server: { | ||
fs: { | ||
allow: [path.resolve('../../../../src')] | ||
} | ||
} | ||
}; | ||
|
||
export default config; |
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,23 @@ | ||
import { test } from 'uvu'; | ||
import * as assert from 'uvu/assert'; | ||
import { execSync } from 'node:child_process'; | ||
import path from 'node:path'; | ||
|
||
test('$lib/*.server.* is not statically importable from the client', () => { | ||
try { | ||
execSync('pnpm build', { | ||
cwd: path.join(process.cwd(), 'apps/syntax-error'), | ||
stdio: 'pipe', | ||
timeout: 60000 | ||
}); | ||
} catch (err) { | ||
assert.ok( | ||
err.message.includes('Unexpected end of input'), | ||
`received unexpected exception message ${err.message}` | ||
); | ||
return; | ||
} | ||
assert.unreachable(); | ||
}); | ||
|
||
test.run(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.