Skip to content
Closed
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/honest-eagles-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': major
---

breaking: make `build` script build the app, and add a new `package` script
2 changes: 1 addition & 1 deletion packages/create-svelte/templates/skeletonlib/.meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"title": "Library skeleton project",
"title": "Library project",
"description": "Barebones scaffolding for your new Svelte library"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.1",
"scripts": {
"dev": "vite dev",
"build": "svelte-kit sync && svelte-package",
"build": "vite build && npm run package",
"package": "svelte-kit sync && svelte-package",
Copy link
Contributor

@gtm-nayan gtm-nayan Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC svelte-package doesn't do checking and svelte-check isn't included in the library template so the generated types go unused. svelte-check and a check command should probably be added in as well esp with #8484 merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I wonder if we should try and make svelte-check only apply to packaged files rather than the entire app — would be annoying if you couldn't publish because of a finicky type error in your docs site that you don't really care about

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that we could create a tsconfig.lib.json which only includes the files inside lib and reference that from svelte-check

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels a bit messy to create a new file, and if config.kit.files.lib changed the developer would also need to change tsconfig.lib.json... perhaps there's a way to integrate checking into the svelte-package command instead?

"prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1"
},
"devDependencies": {
Expand Down