create-jnrs-vue 1.2.11 → 1.2.13
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 +4 -4
- package/bin/create.mjs +35 -48
- package/bin/upgrade.mjs +1 -1
- package/jnrs-vue/.cspell.json +17 -0
- package/{jnrs-template-vue → jnrs-vue}/README.md +2 -2
- package/{jnrs-template-vue → jnrs-vue}/index.html +1 -1
- package/{jnrs-template-vue → jnrs-vue}/package.json +3 -2
- package/package.json +2 -2
- /package/{jnrs-template-vue → jnrs-vue}/.env.development +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/.env.production +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/.prettierrc.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/auto-imports.d.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/components.d.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/eslint.config.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/public/favicon.ico +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/public/system/menu.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/App.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/api/common/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/api/demos/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/api/request.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/api/system/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/api/user/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/fonts/.keep +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/fonts/AlibabaPuHuiTi-Regular.woff2 +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/fonts/AlimamaShuHeiTi-Bold.woff2 +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/images/common/403.png +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/images/common/404.png +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/images/common/avatar.png +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/images/common/jnrs-white.svg +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/styles/animation.scss +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/styles/common.scss +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/styles/fonts.scss +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/styles/index.scss +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/styles/init.scss +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/assets/styles/root.scss +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/components/common/CardTable.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/components/common/DictTag.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/components/common/ImageView.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/components/common/PdfView.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/components/select/SelectManager.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/directives/permissions.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/BlankLayout.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/RouterTabs /344/277/256/345/244/215/350/267/257/347/224/261/350/267/263/350/275/254/346/220/272/345/270/246/345/217/202/346/225/260/351/227/256/351/242/230.vue" +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/RouterTabs.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/SideMenu.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/SideMenuItem.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/TopHeader.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/layout/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/locales/en.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/locales/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/locales/zhCn.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/main.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/router/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/router/routes.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/types/env.d.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/types/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/types/webSocket.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/utils/file.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/utils/packages.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/utils/permissions.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/common/403.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/common/404.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/demos/crud/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/demos/simpleTable/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/demos/unitTest/RequestPage.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/demos/unitTest/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/home/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/lingshuSmart/editorPage.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/login/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/dict/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/menu/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/mine/baseInfo.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/mine/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/mine/securitySettings.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/role/editDialog.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/system/role/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/src/views/visual/index.vue +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/tsconfig.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/vite.config.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/fail.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/file/mock-pdf.pdf +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/file/mock-png-0.png +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/file/mock-png-1.png +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/file.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/index.ts +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/detailsRes.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/dictItemRes.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/dictRes.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/loginRes_admin.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/loginRes_user.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/roleRes.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/json/tableRes.json +0 -0
- /package/{jnrs-template-vue → jnrs-vue}/viteMockServe/success.ts +0 -0
package/README.md
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
TypeScript、Vue3 生态
|
|
8
8
|
|
|
9
9
|
## 🧩 安装使用说明
|
|
10
|
-
新项目默认名称为 jnrs-
|
|
10
|
+
新项目默认名称为 jnrs-vue
|
|
11
11
|
```shell
|
|
12
12
|
# ✅ 正确用法
|
|
13
13
|
# 创建新项目
|
|
14
|
-
pnpm create jnrs-
|
|
14
|
+
pnpm create jnrs-vue@latest
|
|
15
15
|
# 在当前目录下创建项目
|
|
16
|
-
pnpm create jnrs-
|
|
16
|
+
pnpm create jnrs-vue@latest .
|
|
17
17
|
|
|
18
18
|
# 安装依赖/启动开发/打包构建
|
|
19
19
|
pnpm i
|
|
@@ -29,7 +29,7 @@ pnpm add create-jnrs-vue
|
|
|
29
29
|
|
|
30
30
|
## 📂 模板项目主要结构
|
|
31
31
|
```Text
|
|
32
|
-
jnrs-
|
|
32
|
+
jnrs-vue/
|
|
33
33
|
├── viteMockServe/ # Mock 服务配置
|
|
34
34
|
├── public/ # 静态资源
|
|
35
35
|
├── src/ # 源码目录
|
package/bin/create.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @Author : TanRui
|
|
3
3
|
* @WeChat : Tan578853789
|
|
4
4
|
* @File : create.mjs
|
|
5
|
-
* @Date : 2026/
|
|
6
|
-
* @Desc. :
|
|
5
|
+
* @Date : 2026/03/16
|
|
6
|
+
* @Desc. : 脚手架创建脚本
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { fileURLToPath } from 'url'
|
|
@@ -72,20 +72,11 @@ function toValidPackageName(projectName) {
|
|
|
72
72
|
.replace(/[^a-z0-9-~@/._]/g, '-')
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// 提取 workspace:* 依赖
|
|
76
|
-
function extractWorkspaceDeps(pkg) {
|
|
77
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies }
|
|
78
|
-
const workspaceDeps = Object.entries(deps)
|
|
79
|
-
.filter(([_, value]) => value === 'workspace:*')
|
|
80
|
-
.map(([name]) => name)
|
|
81
|
-
return workspaceDeps
|
|
82
|
-
}
|
|
83
|
-
|
|
84
75
|
async function main() {
|
|
85
76
|
const argv = minimist(process.argv.slice(2), { string: ['_'] })
|
|
86
77
|
let targetDir = argv._[0]
|
|
87
78
|
|
|
88
|
-
//
|
|
79
|
+
// 判断是否使用当前目录
|
|
89
80
|
const isCurrentDir = targetDir === '.'
|
|
90
81
|
|
|
91
82
|
if (!targetDir) {
|
|
@@ -93,7 +84,7 @@ async function main() {
|
|
|
93
84
|
type: 'text',
|
|
94
85
|
name: 'name',
|
|
95
86
|
message: '项目名称:',
|
|
96
|
-
initial: 'jnrs-
|
|
87
|
+
initial: 'jnrs-vue',
|
|
97
88
|
validate: (input) => {
|
|
98
89
|
if (!input) return '请输入项目名称!'
|
|
99
90
|
if (existsSync(input)) return '目录已存在!'
|
|
@@ -118,51 +109,47 @@ async function main() {
|
|
|
118
109
|
}
|
|
119
110
|
|
|
120
111
|
const root = isCurrentDir ? process.cwd() : join(process.cwd(), targetDir.trim())
|
|
121
|
-
const templateDir = join(__dirname, '..', 'jnrs-
|
|
112
|
+
const templateDir = join(__dirname, '..', 'jnrs-vue')
|
|
122
113
|
|
|
123
114
|
await fs.cp(templateDir, root, { recursive: true })
|
|
124
115
|
|
|
125
|
-
|
|
126
|
-
const
|
|
116
|
+
// 定义可选的内部模块
|
|
117
|
+
const allWorkspaceDeps = ['@jnrs/shared', '@jnrs/vue-core', '@jnrs/lingshu-smart']
|
|
118
|
+
const defaultSelected = ['@jnrs/shared', '@jnrs/vue-core']
|
|
127
119
|
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
:
|
|
131
|
-
|
|
132
|
-
|
|
120
|
+
const { selected: selectedWorkspaceDeps } = await prompts({
|
|
121
|
+
type: 'multiselect',
|
|
122
|
+
name: 'selected',
|
|
123
|
+
message: '请选择要包含的内部依赖模块(默认选中常用模块):',
|
|
124
|
+
choices: allWorkspaceDeps.map((dep) => ({
|
|
125
|
+
title: dep,
|
|
126
|
+
value: dep,
|
|
127
|
+
selected: defaultSelected.includes(dep)
|
|
128
|
+
})),
|
|
129
|
+
instructions: false
|
|
130
|
+
})
|
|
133
131
|
|
|
134
|
-
//
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (allWorkspaceDeps.length > 0) {
|
|
139
|
-
const defaultSelected = ['@jnrs/shared', '@jnrs/vue-core'].filter((dep) => allWorkspaceDeps.includes(dep))
|
|
140
|
-
|
|
141
|
-
const { selected } = await prompts({
|
|
142
|
-
type: 'multiselect',
|
|
143
|
-
name: 'selected',
|
|
144
|
-
message: '请选择要包含的 workspace 依赖(默认选中常用模块):',
|
|
145
|
-
choices: allWorkspaceDeps.map((dep) => ({
|
|
146
|
-
title: dep,
|
|
147
|
-
value: dep,
|
|
148
|
-
selected: defaultSelected.includes(dep)
|
|
149
|
-
})),
|
|
150
|
-
instructions: false
|
|
151
|
-
})
|
|
132
|
+
// 读取并更新 package.json
|
|
133
|
+
const pkgPath = join(root, 'package.json')
|
|
134
|
+
const pkg = JSON.parse(await fs.readFile(pkgPath, 'utf8'))
|
|
152
135
|
|
|
153
|
-
|
|
136
|
+
pkg.dependencies = pkg.dependencies || {}
|
|
137
|
+
pkg.devDependencies = pkg.devDependencies || {}
|
|
154
138
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
delete pkg[section][dep]
|
|
161
|
-
}
|
|
139
|
+
// 移除未选中的模块(无论在 dependencies 还是 devDependencies)
|
|
140
|
+
for (const section of ['dependencies', 'devDependencies']) {
|
|
141
|
+
for (const dep of Object.keys(pkg[section])) {
|
|
142
|
+
if (allWorkspaceDeps.includes(dep) && !selectedWorkspaceDeps?.includes(dep)) {
|
|
143
|
+
delete pkg[section][dep]
|
|
162
144
|
}
|
|
163
145
|
}
|
|
164
146
|
}
|
|
165
|
-
|
|
147
|
+
|
|
148
|
+
// 设置包名
|
|
149
|
+
const pkgName = isCurrentDir
|
|
150
|
+
? toValidPackageName(process.cwd().split(/[\\/]/).pop() || 'jnrs-vue')
|
|
151
|
+
: toValidPackageName(targetDir)
|
|
152
|
+
pkg.name = pkgName
|
|
166
153
|
|
|
167
154
|
await fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2))
|
|
168
155
|
|
package/bin/upgrade.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "jnrs-
|
|
3
|
-
"version": "1.2.
|
|
2
|
+
"name": "jnrs-vue",
|
|
3
|
+
"version": "1.2.13",
|
|
4
4
|
"description": "JNRS 信息化管理系统",
|
|
5
5
|
"author": "talia_tan",
|
|
6
6
|
"private": true,
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
38
38
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
39
39
|
"@vue/tsconfig": "^0.8.1",
|
|
40
|
+
"cspell": "^9.7.0",
|
|
40
41
|
"eslint": "^9.39.1",
|
|
41
42
|
"eslint-plugin-vue": "~10.4.0",
|
|
42
43
|
"jiti": "^2.6.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-jnrs-vue",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.13",
|
|
4
4
|
"description": "巨能前端工程化开发,Vue 项目模板脚手架",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"bin",
|
|
25
|
-
"jnrs-
|
|
25
|
+
"jnrs-vue",
|
|
26
26
|
"README.md",
|
|
27
27
|
"LICENSE"
|
|
28
28
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|