Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Dec 6, 2022
2 parents c070f5a + a999fce commit dbfd266
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-ravens-attack.md
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

[fix] continuous optionals should not throw conflict error
2 changes: 1 addition & 1 deletion packages/adapter-auto/package.json
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@sveltejs/kit": "workspace:*",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"typescript": "^4.9.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare-workers/package.json
Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@cloudflare/kv-asset-handler": "^0.2.0",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"typescript": "^4.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/package.json
Expand Up @@ -37,7 +37,7 @@
"worktop": "0.8.0-next.14"
},
"devDependencies": {
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"@types/ws": "^8.5.3",
"typescript": "^4.9.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-netlify/package.json
Expand Up @@ -42,7 +42,7 @@
"@rollup/plugin-json": "^5.0.2",
"@rollup/plugin-node-resolve": "^15.0.1",
"@sveltejs/kit": "workspace:*",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"@types/set-cookie-parser": "^2.4.2",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-node/package.json
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@sveltejs/kit": "workspace:*",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"c8": "^7.12.0",
"polka": "^1.0.0-next.22",
"rimraf": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-static/package.json
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@sveltejs/kit": "workspace:*",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"sirv": "^2.0.2",
"svelte": "^3.53.1",
"typescript": "^4.9.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-vercel/package.json
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@sveltejs/kit": "workspace:*",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"typescript": "^4.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/kit/package.json
Expand Up @@ -28,7 +28,7 @@
"@types/connect": "^3.4.35",
"@types/marked": "^4.0.7",
"@types/mime": "^3.0.1",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"@types/sade": "^1.7.4",
"@types/set-cookie-parser": "^2.4.2",
"marked": "^4.2.3",
Expand Down
9 changes: 5 additions & 4 deletions packages/kit/src/core/sync/create_manifest_data/index.js
Expand Up @@ -486,10 +486,11 @@ function prevent_conflicts(routes) {
const matcher = split[i];
const next = split[i + 1];

permutations = [
...permutations.map((x) => x + next),
...permutations.map((x) => x + `<${matcher}>${next}`)
];
permutations = permutations.reduce((a, b) => {
a.push(b + next);
if (!(matcher === '*' && b.endsWith('//'))) a.push(b + `<${matcher}>${next}`);
return a;
}, /** @type {string[]} */ ([]));
}

for (const permutation of permutations) {
Expand Down
29 changes: 29 additions & 0 deletions packages/kit/src/core/sync/create_manifest_data/index.spec.js
Expand Up @@ -386,6 +386,35 @@ test('optional parameters', () => {
]);
});

test('nested optionals', () => {
const { nodes, routes } = create('samples/nested-optionals');
assert.equal(nodes.map(simplify_node), [
default_layout,
default_error,
{ component: 'samples/nested-optionals/[[a]]/[[b]]/+page.svelte' }
]);

assert.equal(routes.map(simplify_route), [
{
id: '/',
pattern: '/^/$/'
},
{
id: '/[[a]]/[[b]]',
pattern: '/^(?:/([^/]+))?(?:/([^/]+))?/?$/',
page: {
layouts: [0],
errors: [1],
leaf: nodes.findIndex((node) => node.component?.includes('/[[a]]/[[b]]'))
}
},
{
id: '/[[a]]',
pattern: '/^(?:/([^/]+))?/?$/'
}
]);
});

test('ignores files and directories with leading underscores', () => {
const { routes } = create('samples/hidden-underscore');

Expand Down
2 changes: 1 addition & 1 deletion packages/package/package.json
Expand Up @@ -16,7 +16,7 @@
"svelte2tsx": "~0.5.20"
},
"devDependencies": {
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"svelte": "^3.53.1",
"svelte-preprocess": "^4.10.7",
"typescript": "^4.9.3",
Expand Down
30 changes: 17 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sites/kit.svelte.dev/package.json
Expand Up @@ -15,7 +15,7 @@
"@sveltejs/amp": "workspace:*",
"@sveltejs/kit": "workspace:*",
"@sveltejs/site-kit": "^2.1.4",
"@types/node": "^16.18.3",
"@types/node": "^16.18.6",
"d3": "^7.7.0",
"d3-dsv": "^3.0.1",
"flexsearch": "^0.7.31",
Expand Down
3 changes: 1 addition & 2 deletions sites/kit.svelte.dev/src/routes/+layout.svelte
Expand Up @@ -60,8 +60,7 @@
position: relative;
margin: 0 auto;
padding-top: var(--sk-nav-height);
overflow: auto;
overflow-x: hidden;
overflow: hidden;
}
.small {
Expand Down

0 comments on commit dbfd266

Please sign in to comment.