소스 검색

[create]Default template is skt

dufu1991 3 년 전
부모
커밋
768d99155b

+ 3 - 3
packages/create-stdf/README.md

@@ -28,7 +28,7 @@ npx create-stdf@latest
 
 ...and follow the prompts.
 
-You can also directly specify the project name and the template you want to use via additional command line options. For example, to create a new project named `my-app` using the **Vite + Svelte + Tailwind + STDF** template, run:
+You can also directly specify the project name and the template you want to use via additional command line options. For example, to create a new project named `my-app` using the **SvelteKit + Tailwind + STDF** template, run:
 
 ```bash
 # bun
@@ -64,9 +64,9 @@ Template presets include:
 
 | abbreviation | template                                     | description         |
 | ------------ | -------------------------------------------- | ------------------- |
-| vt           | Vite + Tailwind + Svelte + STDF              | default             |
+| skt          | SvelteKit + Tailwind + STDF                  | default             |
+| vt           | Vite + Tailwind + Svelte + STDF              | -                   |
 | vu           | Vite + UnoCSS + Svelte + STDF                | -                   |
-| skt          | SvelteKit + Tailwind + STDF                  | -                   |
 | sku          | SvelteKit + UnoCSS + STDF                    | -                   |
 | vtt          | Vite + Tailwind + TypeScript + Svelte + STDF | Has not adapted yet |
 | vut          | Vite + UnoCSS + TypeScript + Svelte + STDF   | Has not adapted yet |

+ 3 - 3
packages/create-stdf/README_CN.md

@@ -28,7 +28,7 @@ npx create-stdf@latest
 
 ...然后按照提示进行操作。
 
-你也可以通过额外的命令行选项直接指定项目名称和要使用的模板。例如,如果要使用 **Vite + Svelte + Tailwind + STDF** 模板创建一个名为 `my-app` 的新项目,请运行:
+你也可以通过额外的命令行选项直接指定项目名称和要使用的模板。例如,如果要使用 **SvelteKit + Tailwind + STDF** 模板创建一个名为 `my-app` 的新项目,请运行:
 
 ```bash
 # bun
@@ -64,9 +64,9 @@ npm create stdf@latest my-app -t vu
 
 | 简写 | 模板                                         | 描述     |
 | ---- | -------------------------------------------- | -------- |
-| vt   | Vite + Tailwind + Svelte + STDF              | 默认     |
+| skt  | SvelteKit + Tailwind + STDF                  | 默认     |
+| vt   | Vite + Tailwind + Svelte + STDF              | -        |
 | vu   | Vite + UnoCSS + Svelte + STDF                | -        |
-| skt  | SvelteKit + Tailwind + STDF                  | -        |
 | sku  | SvelteKit + UnoCSS + STDF                    | -        |
 | vtt  | Vite + Tailwind + TypeScript + Svelte + STDF | 尚未适配 |
 | vut  | Vite + UnoCSS + TypeScript + Svelte + STDF   | 尚未适配 |

+ 1 - 1
packages/create-stdf/package.json

@@ -1,6 +1,6 @@
 {
 	"name": "create-stdf",
-	"version": "0.0.49",
+	"version": "0.0.50",
 	"description": "A CLI for creating new STDF projects",
 	"bin": {
 		"create-stdf": "index.js"

+ 3 - 3
packages/create-stdf/src/index.js

@@ -60,9 +60,9 @@ lang = argvLanguage && languages.find(item => item.value === argvLanguage) ? lan
 // 模板列表
 // Template list
 const templateOptions = [
+	{ value: 'skt', label: 'SvelteKit + Tailwind', template: 'sveltekit-tailwind', finish: true },
 	{ value: 'vt', label: 'Vite + Tailwind', template: 'vite-tailwind', finish: true },
 	{ value: 'vu', label: 'Vite + UnoCSS', template: 'vite-uno', finish: true },
-	{ value: 'skt', label: 'SvelteKit + Tailwind', template: 'sveltekit-tailwind', finish: true },
 	{ value: 'sku', label: 'SvelteKit + UnoCSS', template: 'sveltekit-uno', finish: true },
 	{ value: 'vtt', label: 'Vite + Tailwind + TypeScript', template: 'vite-tailwind-typescript', finish: false },
 	{ value: 'vut', label: 'Vite + UnoCSS + TypeScript', template: 'vite-uno-typescript', finish: false },
@@ -70,8 +70,8 @@ const templateOptions = [
 	{ value: 'skut', label: 'SvelteKit + UnoCSS + TypeScript', template: 'sveltekit-uno-typescript', finish: false },
 ];
 
-// 如果命令行参数中有项目名称,但没有模板名称,直接使用默认模板 vt
-// If there is a project name in the command line parameters, but no template name, use the default template vt directly
+// 如果命令行参数中有项目名称,但没有模板名称,直接使用默认模板 skt
+// If there is a project name in the command line parameters, but no template name, use the default template skt directly
 if (argvProjectName && !argvTemplate) {
 	createFunc(argvProjectName, templateOptions[0]);
 }

+ 2 - 2
packages/create-stdf/templates/sveltekit-tailwind/package.json

@@ -1,5 +1,5 @@
 {
-	"name": "kit",
+	"name": "stdf-project",
 	"version": "0.0.1",
 	"scripts": {
 		"dev": "vite dev",
@@ -9,7 +9,7 @@
 	"devDependencies": {
 		"@fontsource/fira-mono": "^4.5.10",
 		"@neoconfetti/svelte": "^1.0.0",
-		"@sveltejs/adapter-auto": "^2.0.0",
+		"@sveltejs/adapter-static": "^2.0.3",
 		"@sveltejs/kit": "^1.20.4",
 		"autoprefixer": "^10.4.15",
 		"postcss": "^8.4.28",

+ 4 - 2
packages/create-stdf/templates/sveltekit-tailwind/svelte.config.js

@@ -1,4 +1,4 @@
-import adapter from '@sveltejs/adapter-auto';
+import adapter from '@sveltejs/adapter-static';
 import { vitePreprocess } from '@sveltejs/kit/vite';
 
 /** @type {import('@sveltejs/kit').Config} */
@@ -7,7 +7,9 @@ const config = {
 		// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
 		// If your environment is not supported or you settled on a specific environment, switch out the adapter.
 		// See https://kit.svelte.dev/docs/adapters for more information about adapters.
-		adapter: adapter(),
+		adapter: adapter({
+			fallback: 'index.html', // may differ from host to host
+		}),
 	},
 	onwarn: (warning, handler) => {
 		if (warning.code.startsWith('a11y-')) {

+ 1 - 1
packages/create-stdf/templates/sveltekit-uno/package.json

@@ -1,5 +1,5 @@
 {
-	"name": "kit",
+	"name": "stdf-project",
 	"version": "0.0.1",
 	"scripts": {
 		"dev": "vite dev",