softleader-nuxt-core 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -15
- package/assets/css/layout.css +662 -0
- package/assets/css/main.css +78 -0
- package/assets/icons/index.ts +44 -0
- package/assets/icons/smile.svg +1 -0
- package/assets/mdi/css/materialdesignicons.css +30070 -0
- package/assets/mdi/fonts/materialdesignicons-webfont.eot +0 -0
- package/assets/mdi/fonts/materialdesignicons-webfont.ttf +0 -0
- package/assets/mdi/fonts/materialdesignicons-webfont.woff +0 -0
- package/assets/mdi/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/bin/init.mjs +135 -0
- package/composables/useApiRegistry.ts +30 -0
- package/configs/default.json +14 -0
- package/configs/eslintrc/all.js +0 -0
- package/configs/git/commit-types.cjs +72 -0
- package/configs/git/commitlint.config.cjs +81 -0
- package/configs/git/cz-config.cjs +74 -0
- package/core/repositories/index.ts +9 -0
- package/i18n/locales/en-US.json +54 -0
- package/i18n/locales/zh-TW.json +54 -0
- package/nuxt.config.ts +3 -3
- package/package.json +8 -2
- package/plugins/api.ts +24 -16
- package/.eslintrc.cjs +0 -25
- package/.prettierrc +0 -10
package/README.md
CHANGED
|
@@ -1,27 +1,68 @@
|
|
|
1
|
-
# Nuxt Core Layer
|
|
1
|
+
# Nuxt Core Layer (`softleader-nuxt-core`)
|
|
2
2
|
|
|
3
|
-
這是 Nuxt 3 Core Layer
|
|
3
|
+
這是 Nuxt 3 Core Layer,提供可重用的基礎架構、元件和工具,協助開發團隊快速建立一致且高品質的 Nuxt 3 應用。
|
|
4
4
|
|
|
5
5
|
## 包含內容
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- 基礎 Layout
|
|
7
|
+
- 設計系統元件
|
|
8
|
+
- 基礎 Layout 與路由設定
|
|
9
9
|
- 全域樣式與設計 Tokens
|
|
10
|
-
- 共用 Composables
|
|
11
|
-
-
|
|
10
|
+
- 共用 Composables 與 Utils
|
|
11
|
+
- 統一的開發工具配置(搭配 Nuxt 3 Eslint 等)
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 使用情境一:在既有專案中使用 (Layer 繼承)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
如果你已經有一個 Nuxt 3 專案,你可以直接將此 Layer 擴展進你的專案中,藉此享有所有組件、功能和設定。
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
1. **安裝依賴**
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install softleader-nuxt-core
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **配置 `nuxt.config.ts`**
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
export default defineNuxtConfig({
|
|
27
|
+
extends: ["softleader-nuxt-core"],
|
|
28
|
+
// ... 其他你的專案設定
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. **啟用 ESLint / Prettier (選用)**
|
|
33
|
+
由於此專案依賴 `@nuxt/eslint-config`,建議你的專案也在根目錄設定對應的 Eslint 配置:
|
|
34
|
+
```bash
|
|
35
|
+
npm i -D @nuxt/eslint-config eslint
|
|
36
|
+
```
|
|
37
|
+
並在你的 `eslint.config.mjs` 中繼承 Nuxt 預設配置。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 使用情境二:快速建立全新專案 (Scaffolding CLI)
|
|
42
|
+
|
|
43
|
+
如果你想在一個新的(或空的)資料夾內建立完整包含 `softleader-nuxt-core` 的專案,我們提供了一個內建的命令列工具。
|
|
23
44
|
|
|
24
|
-
|
|
45
|
+
1. **透過 npx 執行初始化腳本**
|
|
46
|
+
你可以直接使用 `npx` 搭配套件名稱,並指定你的專案名稱(例如 `my-new-app`):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx softleader-nuxt-core init my-new-app
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. **進入專案並啟動**
|
|
53
|
+
指令執行完成後,請進入生成的專案資料夾並啟動開發伺服器:
|
|
54
|
+
```bash
|
|
55
|
+
cd my-new-app
|
|
56
|
+
npm install # 若 CLI 尚未安裝完畢
|
|
57
|
+
npm run dev
|
|
58
|
+
```
|
|
59
|
+
這會自動生成 `package.json`、`app.vue`、`nuxt.config.ts` 等必要檔案,並且已經預先設定好 `extends: ['softleader-nuxt-core']`。
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 開發 Core Layer 說明
|
|
64
|
+
|
|
65
|
+
若你是 `softleader-nuxt-core` 的開發者:
|
|
25
66
|
|
|
26
67
|
```bash
|
|
27
68
|
# 安裝依賴
|
|
@@ -33,3 +74,18 @@ npm run lint
|
|
|
33
74
|
# 型別檢查
|
|
34
75
|
npm run typecheck
|
|
35
76
|
```
|
|
77
|
+
|
|
78
|
+
### 發布至 npm
|
|
79
|
+
|
|
80
|
+
為了讓其他開發者能透過 `npx` 使用此腳本或載入此 Layer,您必須將本專案發布到 npm registry。
|
|
81
|
+
|
|
82
|
+
1. **更新版本號**:確保 `package.json` 中的 `version` 已更新。
|
|
83
|
+
2. **登入 npm** (若尚未登入):
|
|
84
|
+
```bash
|
|
85
|
+
npm login
|
|
86
|
+
```
|
|
87
|
+
3. **發布套件**:
|
|
88
|
+
```bash
|
|
89
|
+
npm publish
|
|
90
|
+
```
|
|
91
|
+
_(若是發布到公司私有 registry,請確認 `.npmrc` 中有設定正確的 registry url)_
|