Skip to content

Commit

Permalink
Merge pull request #181 from tkhs0813/main
Browse files Browse the repository at this point in the history
Support Sveltekit
  • Loading branch information
Vic Shóstak authored Sep 3, 2024
2 parents 7326786 + 514763d commit 4fdcc3f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ Solid, Lit, Qwik, or pure JavaScript/TypeScript templates for your project.
The `Next.js` and `Nuxt` frontend parts will be generated using the latest
`create-next-app` and `nuxi` utilities.

| Name | Description | JavaScript | Typescript |
| --------------------- | -------------------- | ---------- | ---------- |
| [Next.js][nextjs_url] | A common Next.js app | `next` | `next-ts` |
| [Nuxt][nuxt_url] | A common Nuxt v3 app | - | `nuxt` |
| Name | Description | JavaScript | Typescript |
| -------------------------- | ---------------------- | ---------- | ----------- |
| [Next.js][nextjs_url] | A common Next.js app | `next` | `next-ts` |
| [Nuxt][nuxt_url] | A common Nuxt v3 app | - | `nuxt` |
| [Sveltekit][sveltekit_url] | A common Sveltekit app | - | `sveltekit` |

> ❗️ Please make sure that you have `npm` version `7` or higher installed to
> create the frontend part of the project correctly. If you run the
Expand Down Expand Up @@ -293,6 +294,7 @@ created by [Vic Shóstak][author] and distributed under
[preact_url]: https://preactjs.com/
[nextjs_url]: https://nextjs.org/
[nuxt_url]: https://v3.nuxtjs.org/
[sveltekit_url]: https://kit.svelte.dev/
[svelte_url]: https://svelte.dev/
[lit_url]: https://lit.dev/
[chi_url]: https://github.com/go-chi/chi
Expand Down
12 changes: 12 additions & 0 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ func runCreateCmd(cmd *cobra.Command, args []string) error {
); err != nil {
return err
}
case "sveltekit":
// Create a default frontend template with Sveltekit (Svelte, Typescript).
if err := cgapp.ExecCommand(
"npm",
[]string{
"create", "@svelte-add/kit@latest", "frontend",
"--",
"--with", "typescript+eslint+prettier",
}, true,
); err != nil {
return err
}
default:
// Create a default frontend template from Vite (Pure JS/TS, React, Preact, Vue, Svelte, Lit).
if err := cgapp.ExecCommand(
Expand Down
1 change: 1 addition & 0 deletions pkg/registry/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ var (
"nuxt",
"vue",
"vue-ts",
"sveltekit",
"svelte",
"svelte-ts",
"solid",
Expand Down

0 comments on commit 4fdcc3f

Please sign in to comment.