Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] remove Sverdle from Stackblitz template #7448

Merged
merged 2 commits into from
Oct 31, 2022
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
5 changes: 5 additions & 0 deletions .changeset/great-geese-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

[fix] remove Sverdle from Stackblitz template
19 changes: 19 additions & 0 deletions packages/create-svelte/scripts/update-template-repo-contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,22 @@ await create(repo, {
prettier: true,
playwright: false
});

// Remove the Sverdle from the template because it doesn't work within Stackblitz (cookies not set)
fs.rmSync(path.join(repo, 'src', 'routes', 'sverdle'), { force: true, recursive: true });

const header_file = path.join(repo, 'src', 'routes', 'Header.svelte');
const header = fs.readFileSync(header_file, 'utf-8');
fs.writeFileSync(
header_file,
// Remove the Sverdle link from the header
header.replace(/<\/li>\s+<li.+?'\/sverdle'[\s\S]+?<\/li>/, '</li>')
);

const about_file = path.join(repo, 'src', 'routes', 'about', '+page.svelte');
const about = fs.readFileSync(about_file, 'utf-8');
fs.writeFileSync(
about_file,
// Remove the Sverdle paragraph from the about page
about.replace(/<\/p>\s+<p>\s+?[\s\S]+?Sverdle[\s\S]+?<\/p>/, '</p>')
);