Skip to content

Commit

Permalink
complete validators renaming (#4408)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Mar 21, 2022
1 parent 435b242 commit 2865f41
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-mayflies-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Fix error link for fallthrough replacement
2 changes: 1 addition & 1 deletion documentation/docs/13-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ An object containing zero or more of the following `string` values:
- `assets` — a place to put static files that should have stable URLs and undergo no processing, such as `favicon.ico` or `manifest.json`
- `hooks` — the location of your hooks module (see [Hooks](/docs/hooks))
- `lib` — your app's internal library, accessible throughout the codebase as `$lib`
- `params` — a directory containing [parameter validators](/docs/routing#advanced-routing-validation)
- `params` — a directory containing [parameter matchers](/docs/routing#advanced-routing-matching)
- `routes` — the files that define the structure of your app (see [Routing](/docs/routing))
- `serviceWorker` — the location of your service worker's entry point (see [Service workers](/docs/service-workers))
- `template` — the location of the template for HTML responses
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/core/sync/create_manifest_data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export default function create_manifest_data({
matchers[type] = path.join(params_base, file);
} else {
throw new Error(
`Validator names must match /^[a-zA-Z_][a-zA-Z0-9_]*$/ — "${file}" is invalid`
`Matcher names must match /^[a-zA-Z_][a-zA-Z0-9_]*$/ — "${file}" is invalid`
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/core/sync/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import path from 'path';
import create_manifest_data from './create_manifest_data/index.js';
import { copy_assets } from './copy_assets.js';
import { write_manifest } from './write_manifest.js';
import { write_matchers } from './write_matchers.js';
import { write_root } from './write_root.js';
import { write_tsconfig } from './write_tsconfig.js';
import { write_types } from './write_types.js';
import { write_validators } from './write_validators.js';

/** @param {import('types').ValidatedConfig} config */
export function init(config) {
Expand All @@ -22,7 +22,7 @@ export function update(config) {

write_manifest(manifest_data, base, output);
write_root(manifest_data, output);
write_validators(manifest_data, output);
write_matchers(manifest_data, output);
write_types(config, manifest_data);

return { manifest_data };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { write_if_changed } from './utils.js';
* @param {import('types').ManifestData} manifest_data
* @param {string} output
*/
export function write_validators(manifest_data, output) {
export function write_matchers(manifest_data, output) {
const imports = [];
const matchers = [];

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ export function create_client({ target, session, base, trailing_slash }) {
// @ts-expect-error
if (node.loaded.fallthrough) {
throw new Error(
'fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-validation'
'fallthrough is no longer supported. Use matchers instead: https://kit.svelte.dev/docs/routing#advanced-routing-matching'
);
}

Expand Down

0 comments on commit 2865f41

Please sign in to comment.