create-young-proj 0.13.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +31 -22
- package/dist/index.mjs +34 -34
- package/package.json +12 -11
- package/template-nuxt-admin/README.md +23 -16
- package/template-nuxt-website/README.md +117 -0
- package/template-uni-app/README.md +5 -0
- package/template-admin-server/.editorconfig +0 -11
- package/template-admin-server/.nvmrc +0 -1
- package/template-admin-server/.vscode/extensions.json +0 -6
- package/template-admin-server/.vscode/settings.json +0 -4
- package/template-admin-server/_gitignore +0 -15
- package/template-admin-server/boot.mjs +0 -11
- package/template-admin-server/package.json +0 -60
- package/template-admin-server/rome.json +0 -22
- package/template-admin-server/src/config/config.default.ts +0 -56
- package/template-admin-server/src/configuration.ts +0 -47
- package/template-admin-server/src/controller/admin.controller.ts +0 -397
- package/template-admin-server/src/controller/api.controller.ts +0 -98
- package/template-admin-server/src/controller/base.controller.ts +0 -70
- package/template-admin-server/src/controller/dto/api.ts +0 -47
- package/template-admin-server/src/controller/dto/index.ts +0 -36
- package/template-admin-server/src/controller/dto/menu.ts +0 -41
- package/template-admin-server/src/controller/dto/role.ts +0 -41
- package/template-admin-server/src/controller/dto/user.ts +0 -52
- package/template-admin-server/src/controller/menu.controller.ts +0 -138
- package/template-admin-server/src/controller/role.controller.ts +0 -116
- package/template-admin-server/src/controller/user.controller.ts +0 -108
- package/template-admin-server/src/entities/Api.ts +0 -29
- package/template-admin-server/src/entities/BaseCreate.ts +0 -30
- package/template-admin-server/src/entities/Menu.ts +0 -39
- package/template-admin-server/src/entities/Role.ts +0 -36
- package/template-admin-server/src/entities/User.ts +0 -35
- package/template-admin-server/src/entities/index.ts +0 -10
- package/template-admin-server/src/filter/default.filter.ts +0 -22
- package/template-admin-server/src/filter/notfound.filter.ts +0 -23
- package/template-admin-server/src/middleware/helper.middleware.ts +0 -28
- package/template-admin-server/src/middleware/index.ts +0 -9
- package/template-admin-server/src/middleware/jwt.middleware.ts +0 -32
- package/template-admin-server/src/middleware/report.middleware.ts +0 -26
- package/template-admin-server/src/service/api.service.ts +0 -174
- package/template-admin-server/src/service/basic.ts +0 -118
- package/template-admin-server/src/service/index.ts +0 -10
- package/template-admin-server/src/service/menu.service.ts +0 -139
- package/template-admin-server/src/service/role.service.ts +0 -286
- package/template-admin-server/src/service/user.service.ts +0 -124
- package/template-admin-server/src/strategy/jwt.strategy.ts +0 -26
- package/template-admin-server/src/types/index.ts +0 -42
- package/template-admin-server/src/types/types.d.ts +0 -31
- package/template-admin-server/tsconfig.json +0 -24
- package/template-nuxt-admin/.eslintrc +0 -14
- package/template-nuxt-admin/.vscode/extensions.json +0 -12
- package/template-nuxt-admin/.vscode/settings.json +0 -25
- package/template-nuxt-admin/Dockerfile +0 -41
- package/template-nuxt-admin/_gitignore +0 -23
- package/template-nuxt-admin/_npmrc +0 -2
- package/template-nuxt-admin/app.vue +0 -41
- package/template-nuxt-admin/boot.mjs +0 -16
- package/template-nuxt-admin/components/ScreenFull.vue +0 -19
- package/template-nuxt-admin/components/TopSearch.vue +0 -77
- package/template-nuxt-admin/components/TopUser.vue +0 -72
- package/template-nuxt-admin/components/YoungChangePassword.vue +0 -97
- package/template-nuxt-admin/components/YoungCodeInput.vue +0 -66
- package/template-nuxt-admin/components/YoungLink.vue +0 -24
- package/template-nuxt-admin/components/YoungLoading.vue +0 -39
- package/template-nuxt-admin/components/layout/Footer.vue +0 -29
- package/template-nuxt-admin/components/layout/Logo.vue +0 -54
- package/template-nuxt-admin/components/layout/Main.vue +0 -26
- package/template-nuxt-admin/components/layout/NavBar.vue +0 -89
- package/template-nuxt-admin/components/layout/SideBar.vue +0 -96
- package/template-nuxt-admin/components/layout/SubMenu.vue +0 -52
- package/template-nuxt-admin/components/layout/TabsBar.vue +0 -184
- package/template-nuxt-admin/composables/api.ts +0 -105
- package/template-nuxt-admin/composables/apis/delete.ts +0 -37
- package/template-nuxt-admin/composables/apis/get.ts +0 -83
- package/template-nuxt-admin/composables/apis/index.ts +0 -10
- package/template-nuxt-admin/composables/apis/patch.ts +0 -74
- package/template-nuxt-admin/composables/apis/post.ts +0 -85
- package/template-nuxt-admin/composables/config.ts +0 -13
- package/template-nuxt-admin/composables/icon.ts +0 -27
- package/template-nuxt-admin/composables/nav.ts +0 -75
- package/template-nuxt-admin/composables/tags.ts +0 -136
- package/template-nuxt-admin/composables/user.ts +0 -46
- package/template-nuxt-admin/config/.devrc +0 -1
- package/template-nuxt-admin/config/.onlinerc +0 -1
- package/template-nuxt-admin/config/.testrc +0 -1
- package/template-nuxt-admin/env.d.ts +0 -47
- package/template-nuxt-admin/error.vue +0 -61
- package/template-nuxt-admin/layouts/blank.vue +0 -9
- package/template-nuxt-admin/layouts/default.vue +0 -125
- package/template-nuxt-admin/middleware/auth.global.ts +0 -69
- package/template-nuxt-admin/nuxt.config.ts +0 -106
- package/template-nuxt-admin/package.json +0 -64
- package/template-nuxt-admin/pages/home/[id].vue +0 -28
- package/template-nuxt-admin/pages/index.vue +0 -15
- package/template-nuxt-admin/pages/login.vue +0 -199
- package/template-nuxt-admin/pages/system/api.vue +0 -179
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +0 -335
- package/template-nuxt-admin/pages/system/menuList.vue +0 -353
- package/template-nuxt-admin/pages/system/role.vue +0 -145
- package/template-nuxt-admin/pages/system/user.vue +0 -225
- package/template-nuxt-admin/plugins/directive.ts +0 -26
- package/template-nuxt-admin/public/bg.webp +0 -0
- package/template-nuxt-admin/public/default_avatar.svg +0 -1
- package/template-nuxt-admin/public/favicon.svg +0 -2
- package/template-nuxt-admin/public/image_placeholder.svg +0 -15
- package/template-nuxt-admin/public/logo.svg +0 -2
- package/template-nuxt-admin/public/tabbar_bg.png +0 -0
- package/template-nuxt-admin/server/api/[...all].ts +0 -10
- package/template-nuxt-admin/server/plugins/env.ts +0 -87
- package/template-nuxt-admin/server/routes/get/env.ts +0 -13
- package/template-nuxt-admin/server/tsconfig.json +0 -3
- package/template-nuxt-admin/server/utils/index.ts +0 -36
- package/template-nuxt-admin/styles/element.scss +0 -30
- package/template-nuxt-admin/styles/index.scss +0 -59
- package/template-nuxt-admin/styles/variable.scss +0 -103
- package/template-nuxt-admin/tsconfig.json +0 -7
- package/template-nuxt-admin/typings/global.d.ts +0 -16
- package/template-nuxt-admin/typings/system.d.ts +0 -66
- package/template-nuxt-admin/typings/user.d.ts +0 -19
- package/template-nuxt-admin/uno.config.ts +0 -40
- package/template-nuxt-admin/utils/tool.ts +0 -199
- package/template-nuxt-admin/yarn.lock +0 -8487
- package/template-uni-app/.eslintignore +0 -1
- package/template-uni-app/.eslintrc +0 -16
- package/template-uni-app/.vscode/.server-controller-port.log +0 -5
- package/template-uni-app/.vscode/css.code-snippets +0 -398
- package/template-uni-app/.vscode/extensions.json +0 -12
- package/template-uni-app/.vscode/js.code-snippets +0 -1669
- package/template-uni-app/.vscode/settings.json +0 -25
- package/template-uni-app/.vscode/vue-html.code-snippets +0 -682
- package/template-uni-app/_env +0 -3
- package/template-uni-app/_env.development +0 -11
- package/template-uni-app/_env.production +0 -8
- package/template-uni-app/_env.test +0 -11
- package/template-uni-app/_gitignore +0 -3
- package/template-uni-app/_npmrc +0 -2
- package/template-uni-app/auto-imports.d.ts +0 -413
- package/template-uni-app/components.d.ts +0 -17
- package/template-uni-app/custom-plugins/index.ts +0 -7
- package/template-uni-app/custom-plugins/multiconf.ts +0 -74
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +0 -43
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +0 -10
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +0 -15
- package/template-uni-app/dist/dev/mp-weixin/app.js +0 -92
- package/template-uni-app/dist/dev/mp-weixin/app.json +0 -51
- package/template-uni-app/dist/dev/mp-weixin/app.wxss +0 -2378
- package/template-uni-app/dist/dev/mp-weixin/common/assets.js +0 -13
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +0 -9166
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +0 -81
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +0 -108
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +0 -55
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +0 -88
- package/template-uni-app/dist/dev/mp-weixin/config/enum.js +0 -21
- package/template-uni-app/dist/dev/mp-weixin/config/index.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/config/map.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +0 -29
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +0 -6
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.js +0 -56
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +0 -9
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js +0 -98
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +0 -125
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +0 -37
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +0 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.js +0 -50
- package/template-uni-app/dist/dev/mp-weixin/pages/index.json +0 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/pages/my.json +0 -3
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/project.config.json +0 -55
- package/template-uni-app/dist/dev/mp-weixin/project.private.config.json +0 -6
- package/template-uni-app/dist/dev/mp-weixin/static/back.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/h.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/more.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/network.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/store/index.js +0 -8
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +0 -13
- package/template-uni-app/dist/dev/mp-weixin/store/system.js +0 -14
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +0 -78
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +0 -83
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +0 -27
- package/template-uni-app/index.html +0 -23
- package/template-uni-app/manifest.config.ts +0 -88
- package/template-uni-app/package.json +0 -108
- package/template-uni-app/pages.config.ts +0 -58
- package/template-uni-app/pnpm-lock.yaml +0 -9967
- package/template-uni-app/src/App.vue +0 -79
- package/template-uni-app/src/apis/index.ts +0 -54
- package/template-uni-app/src/apis/requests/get.ts +0 -52
- package/template-uni-app/src/apis/requests/index.ts +0 -8
- package/template-uni-app/src/apis/requests/post.ts +0 -23
- package/template-uni-app/src/components/young-loading/young-loading.vue +0 -36
- package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +0 -35
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +0 -252
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +0 -145
- package/template-uni-app/src/config/enum.ts +0 -47
- package/template-uni-app/src/config/index.ts +0 -8
- package/template-uni-app/src/config/map.ts +0 -15
- package/template-uni-app/src/env.d.ts +0 -36
- package/template-uni-app/src/layouts/default.vue +0 -22
- package/template-uni-app/src/layouts/tabbar.vue +0 -38
- package/template-uni-app/src/main.ts +0 -20
- package/template-uni-app/src/manifest.json +0 -75
- package/template-uni-app/src/pages/demo/index.vue +0 -30
- package/template-uni-app/src/pages/index.vue +0 -65
- package/template-uni-app/src/pages/my.vue +0 -30
- package/template-uni-app/src/pages.json +0 -74
- package/template-uni-app/src/static/back.png +0 -0
- package/template-uni-app/src/static/h.png +0 -0
- package/template-uni-app/src/static/home.png +0 -0
- package/template-uni-app/src/static/home_active.png +0 -0
- package/template-uni-app/src/static/more.png +0 -0
- package/template-uni-app/src/static/my.png +0 -0
- package/template-uni-app/src/static/my_active.png +0 -0
- package/template-uni-app/src/static/network.png +0 -0
- package/template-uni-app/src/store/index.ts +0 -16
- package/template-uni-app/src/store/local/index.ts +0 -42
- package/template-uni-app/src/store/system.ts +0 -21
- package/template-uni-app/src/typings/global.d.ts +0 -7
- package/template-uni-app/src/uni.scss +0 -76
- package/template-uni-app/src/utils/auth.ts +0 -204
- package/template-uni-app/src/utils/index.ts +0 -11
- package/template-uni-app/src/utils/map.ts +0 -98
- package/template-uni-app/src/utils/modal.ts +0 -120
- package/template-uni-app/src/utils/route.ts +0 -151
- package/template-uni-app/src/utils/system.ts +0 -67
- package/template-uni-app/tsconfig.json +0 -16
- package/template-uni-app/unocss.config.ts +0 -30
- package/template-uni-app/vite.config.ts +0 -63
- package/template-uni-app/volar.config.js +0 -6
- package/template-vue-mobile/.vscode/base.code-snippets +0 -24
- package/template-vue-mobile/.vscode/extensions.json +0 -10
- package/template-vue-mobile/.vscode/settings.json +0 -7
- package/template-vue-mobile/Dockerfile +0 -42
- package/template-vue-mobile/_env +0 -6
- package/template-vue-mobile/_gitignore +0 -30
- package/template-vue-mobile/boot.mjs +0 -16
- package/template-vue-mobile/build/custom-plugin.ts +0 -30
- package/template-vue-mobile/build/index.ts +0 -7
- package/template-vue-mobile/build/plugins.ts +0 -68
- package/template-vue-mobile/config/.devrc +0 -2
- package/template-vue-mobile/config/.onlinerc +0 -1
- package/template-vue-mobile/config/.testrc +0 -1
- package/template-vue-mobile/index.html +0 -25
- package/template-vue-mobile/nitro.config.ts +0 -19
- package/template-vue-mobile/package.json +0 -48
- package/template-vue-mobile/plugins/env.ts +0 -26
- package/template-vue-mobile/public/vite.svg +0 -1
- package/template-vue-mobile/rome.json +0 -24
- package/template-vue-mobile/routes/[...all].ts +0 -11
- package/template-vue-mobile/routes/get/env.ts +0 -25
- package/template-vue-mobile/src/App.vue +0 -29
- package/template-vue-mobile/src/auto-components.d.ts +0 -24
- package/template-vue-mobile/src/auto-imports.d.ts +0 -289
- package/template-vue-mobile/src/components/Init.vue +0 -36
- package/template-vue-mobile/src/global.d.ts +0 -7
- package/template-vue-mobile/src/hooks/useVerifyCode.ts +0 -46
- package/template-vue-mobile/src/layouts/blank.vue +0 -9
- package/template-vue-mobile/src/layouts/default.vue +0 -27
- package/template-vue-mobile/src/layouts/sub.vue +0 -20
- package/template-vue-mobile/src/main.ts +0 -35
- package/template-vue-mobile/src/modules/1-router.ts +0 -40
- package/template-vue-mobile/src/modules/2-pinia.ts +0 -10
- package/template-vue-mobile/src/modules/3-net.ts +0 -46
- package/template-vue-mobile/src/modules/4-auth.ts +0 -64
- package/template-vue-mobile/src/views/[...all_404].vue +0 -557
- package/template-vue-mobile/src/views/base/login.vue +0 -110
- package/template-vue-mobile/src/views/base/resetPasswd.vue +0 -88
- package/template-vue-mobile/src/views/index.vue +0 -18
- package/template-vue-mobile/src/views/my.vue +0 -15
- package/template-vue-mobile/src/views/sub.vue +0 -18
- package/template-vue-mobile/src/vite-env.d.ts +0 -43
- package/template-vue-mobile/tsconfig.json +0 -21
- package/template-vue-mobile/tsconfig.node.json +0 -9
- package/template-vue-mobile/unocss.config.ts +0 -47
- package/template-vue-mobile/vite.config.ts +0 -32
- package/template-vue-mobile/yarn.lock +0 -4395
- package/template-vue-thin/.vscode/extensions.json +0 -10
- package/template-vue-thin/.vscode/settings.json +0 -4
- package/template-vue-thin/_env +0 -1
- package/template-vue-thin/_gitignore +0 -29
- package/template-vue-thin/index.html +0 -21
- package/template-vue-thin/package.json +0 -40
- package/template-vue-thin/public/vite.svg +0 -1
- package/template-vue-thin/src/App.vue +0 -9
- package/template-vue-thin/src/layouts/blank.vue +0 -9
- package/template-vue-thin/src/layouts/default.vue +0 -12
- package/template-vue-thin/src/layouts/list.vue +0 -12
- package/template-vue-thin/src/main.ts +0 -58
- package/template-vue-thin/src/views/[...all_404].vue +0 -488
- package/template-vue-thin/src/views/index.vue +0 -19
- package/template-vue-thin/src/views/list.vue +0 -17
- package/template-vue-thin/src/vite-env.d.ts +0 -22
- package/template-vue-thin/tsconfig.json +0 -21
- package/template-vue-thin/tsconfig.node.json +0 -9
- package/template-vue-thin/unocss.config.ts +0 -47
- package/template-vue-thin/vite.config.ts +0 -64
package/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# 从现有模板快速创建工程
|
2
2
|
|
3
|
+
[![](https://img.shields.io/badge/Author-BluesYoung--web-blue)](https://gitee.com/BluesYoung-web) [![npm](https://img.shields.io/npm/v/create-young-proj)](https://www.npmjs.com/package/create-young-proj)
|
4
|
+
|
5
|
+
[![code style](https://antfu.me/badge-code-style.svg)](https://github.com/antfu/eslint-config)
|
6
|
+
|
7
|
+
|
3
8
|
```bash
|
4
9
|
npm create young-proj@latest
|
5
10
|
yarn create young-proj@latest
|
@@ -9,46 +14,50 @@ pnpm create young-proj@latest
|
|
9
14
|
🚧 WIP
|
10
15
|
|
11
16
|
- [x] template-vue-thin
|
12
|
-
- [x]
|
17
|
+
- [x] template-nuxt-admin
|
13
18
|
- [x] template-admin-server
|
14
19
|
- [x] template-vue-mobile
|
15
20
|
- [x] template-uni-app
|
16
|
-
- [
|
17
|
-
- [ ] template-ssr
|
18
|
-
- [ ] template-solidjs-ssr
|
21
|
+
- [x] template-nuxt3-website
|
19
22
|
|
20
|
-
## template-
|
23
|
+
## template-nuxt-admin
|
21
24
|
|
22
|
-
|
25
|
+
管理后台,基于 `nuxt3` 开发,完整性更高,开发体验及用户体验都更好
|
23
26
|
|
24
|
-
|
27
|
+
与 `template-admin-server` 配套使用
|
25
28
|
|
26
|
-
|
29
|
+
## template-nuxt-website
|
27
30
|
|
28
|
-
`
|
31
|
+
官网,基于 `nuxt3` 开发,完整性更高,开发体验及用户体验都更好
|
29
32
|
|
30
|
-
|
33
|
+
完善的响应式支持,PC/移动端自适应
|
31
34
|
|
32
|
-
|
35
|
+
`ssr`,完善的 `seo`
|
33
36
|
|
34
|
-
##
|
37
|
+
## template-uni-app
|
35
38
|
|
36
|
-
|
39
|
+
通用小程序模板,基于 `Vue3` + `uni-app` 开发,[详见](./template-uni-app/README.md)
|
37
40
|
|
38
|
-
|
41
|
+
## template-vue-mobile
|
39
42
|
|
40
|
-
|
43
|
+
移动端模板,在 `template-vue-thin` 的基础上加入 `vant4` 开发
|
41
44
|
|
42
|
-
|
45
|
+
目前测试过的最低兼容为 支付宝/钉钉 内置浏览器(`Chrome69`)
|
43
46
|
|
44
|
-
|
47
|
+
## template-vue-thin
|
45
48
|
|
46
|
-
|
49
|
+
极简 `Vue-TS` 工程,无 `UI` 框架
|
47
50
|
|
48
|
-
|
51
|
+
自带 `polyfill`
|
49
52
|
|
50
|
-
|
53
|
+
`Pinia` 状态管理
|
51
54
|
|
52
|
-
|
55
|
+
`Unocss` 样式自动生成
|
56
|
+
|
57
|
+
`API` 自动导入,组件自动导入
|
58
|
+
|
59
|
+
基于文件目录的自动路由
|
60
|
+
|
61
|
+
## template-admin-server
|
53
62
|
|
54
|
-
|
63
|
+
后端服务程序,基于 [midwayjs](https://www.midwayjs.org/) 开发
|
package/dist/index.mjs
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
import T from"node:fs";import C from"node:path";import{fileURLToPath as Ne}from"node:url";import je from"child_process";import lt from"path";import at from"fs";import Fe from"readline";import Le from"events";var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},U={exports:{}},ht,jt;function Ye(){if(jt)return ht;jt=1,ht=i,i.sync=o;var s=at;function t(n,r){var l=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var c=0;c<l.length;c++){var h=l[c].toLowerCase();if(h&&n.substr(-h.length).toLowerCase()===h)return!0}return!1}function e(n,r,l){return!n.isSymbolicLink()&&!n.isFile()?!1:t(r,l)}function i(n,r,l){s.stat(n,function(c,h){l(c,c?!1:e(h,n,r))})}function o(n,r){return e(s.statSync(n),n,r)}return ht}var ut,Ft;function He(){if(Ft)return ut;Ft=1,ut=t,t.sync=e;var s=at;function t(n,r,l){s.stat(n,function(c,h){l(c,c?!1:i(h,r))})}function e(n,r){return i(s.statSync(n),r)}function i(n,r){return n.isFile()&&o(n,r)}function o(n,r){var l=n.mode,c=n.uid,h=n.gid,$=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),f=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),b=parseInt("010",8),p=parseInt("001",8),S=a|b,E=l&p||l&b&&h===f||l&a&&c===$||l&S&&$===0;return E}return ut}var tt;process.platform==="win32"||Ve.TESTING_WINDOWS?tt=Ye():tt=He();var Be=ct;ct.sync=Ue;function ct(s,t,e){if(typeof t=="function"&&(e=t,t={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,o){ct(s,t||{},function(n,r){n?o(n):i(r)})})}tt(s,t||{},function(i,o){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,o=!1),e(i,o)})}function Ue(s,t){try{return tt.sync(s,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES")return!1;throw e}}const z=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Lt=lt,ze=z?";":":",Vt=Be,Yt=s=>Object.assign(new Error(`not found: ${s}`),{code:"ENOENT"}),Ht=(s,t)=>{const e=t.colon||ze,i=s.match(/\//)||z&&s.match(/\\/)?[""]:[...z?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(e)],o=z?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=z?o.split(e):[""];return z&&s.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:i,pathExt:n,pathExtExe:o}},Bt=(s,t,e)=>{typeof t=="function"&&(e=t,t={}),t||(t={});const{pathEnv:i,pathExt:o,pathExtExe:n}=Ht(s,t),r=[],l=h=>new Promise(($,f)=>{if(h===i.length)return t.all&&r.length?$(r):f(Yt(s));const a=i[h],b=/^".*"$/.test(a)?a.slice(1,-1):a,p=Lt.join(b,s),S=!b&&/^\.[\\\/]/.test(s)?s.slice(0,2)+p:p;$(c(S,h,0))}),c=(h,$,f)=>new Promise((a,b)=>{if(f===o.length)return a(l($+1));const p=o[f];Vt(h+p,{pathExt:n},(S,E)=>{if(!S&&E)if(t.all)r.push(h+p);else return a(h+p);return a(c(h,$,f+1))})});return e?l(0).then(h=>e(null,h),e):l(0)},We=(s,t)=>{t=t||{};const{pathEnv:e,pathExt:i,pathExtExe:o}=Ht(s,t),n=[];for(let r=0;r<e.length;r++){const l=e[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,h=Lt.join(c,s),$=!c&&/^\.[\\\/]/.test(s)?s.slice(0,2)+h:h;for(let f=0;f<i.length;f++){const a=$+i[f];try{if(Vt.sync(a,{pathExt:o}))if(t.all)n.push(a);else return a}catch{}}}if(t.all&&n.length)return n;if(t.nothrow)return null;throw Yt(s)};var Ge=Bt;Bt.sync=We;var dt={exports:{}};const Ut=(s={})=>{const t=s.env||process.env;return(s.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};dt.exports=Ut,dt.exports.default=Ut;const zt=lt,Je=Ge,Ke=dt.exports;function Wt(s,t){const e=s.options.env||process.env,i=process.cwd(),o=s.options.cwd!=null,n=o&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(s.options.cwd)}catch{}let r;try{r=Je.sync(s.command,{path:e[Ke({env:e})],pathExt:t?zt.delimiter:void 0})}catch{}finally{n&&process.chdir(i)}return r&&(r=zt.resolve(o?s.options.cwd:"",r)),r}function qe(s){return Wt(s)||Wt(s,!0)}var Ze=qe,ft={};const pt=/([()\][%!^"`<>&|;, *?])/g;function Xe(s){return s=s.replace(pt,"^$1"),s}function Qe(s,t){return s=`${s}`,s=s.replace(/(\\*)"/g,'$1$1\\"'),s=s.replace(/(\\*)$/,"$1$1"),s=`"${s}"`,s=s.replace(pt,"^$1"),t&&(s=s.replace(pt,"^$1")),s}ft.command=Xe,ft.argument=Qe;var ts=/^#!(.*)/;const es=ts;var ss=(s="")=>{const t=s.match(es);if(!t)return null;const[e,i]=t[0].replace(/#! ?/,"").split(" "),o=e.split("/").pop();return o==="env"?i:i?`${o} ${i}`:o};const mt=at,is=ss;function rs(s){const e=Buffer.alloc(150);let i;try{i=mt.openSync(s,"r"),mt.readSync(i,e,0,150,0),mt.closeSync(i)}catch{}return is(e.toString())}var ns=rs;const os=lt,Gt=Ze,Jt=ft,ls=ns,as=process.platform==="win32",hs=/\.(?:com|exe)$/i,us=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function cs(s){s.file=Gt(s);const t=s.file&&ls(s.file);return t?(s.args.unshift(s.file),s.command=t,Gt(s)):s.file}function ds(s){if(!as)return s;const t=cs(s),e=!hs.test(t);if(s.options.forceShell||e){const i=us.test(t);s.command=os.normalize(s.command),s.command=Jt.command(s.command),s.args=s.args.map(n=>Jt.argument(n,i));const o=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${o}"`],s.command=process.env.comspec||"cmd.exe",s.options.windowsVerbatimArguments=!0}return s}function fs(s,t,e){t&&!Array.isArray(t)&&(e=t,t=null),t=t?t.slice(0):[],e=Object.assign({},e);const i={command:s,args:t,options:e,file:void 0,original:{command:s,args:t}};return e.shell?i:ds(i)}var ps=fs;const gt=process.platform==="win32";function vt(s,t){return Object.assign(new Error(`${t} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${s.command}`,path:s.command,spawnargs:s.args})}function ms(s,t){if(!gt)return;const e=s.emit;s.emit=function(i,o){if(i==="exit"){const n=Kt(o,t);if(n)return e.call(s,"error",n)}return e.apply(s,arguments)}}function Kt(s,t){return gt&&s===1&&!t.file?vt(t.original,"spawn"):null}function gs(s,t){return gt&&s===1&&!t.file?vt(t.original,"spawnSync"):null}var vs={hookChildProcess:ms,verifyENOENT:Kt,verifyENOENTSync:gs,notFoundError:vt};const qt=je,bt=ps,wt=vs;function Zt(s,t,e){const i=bt(s,t,e),o=qt.spawn(i.command,i.args,i.options);return wt.hookChildProcess(o,i),o}function bs(s,t,e){const i=bt(s,t,e),o=qt.spawnSync(i.command,i.args,i.options);return o.error=o.error||wt.verifyENOENTSync(o.status,i),o}U.exports=Zt,U.exports.spawn=Zt,U.exports.sync=bs,U.exports._parse=bt,U.exports._enoent=wt;var ws=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(u){e.bools[u]=!0});var i={};Object.keys(t.alias||{}).forEach(function(u){i[u]=[].concat(t.alias[u]),i[u].forEach(function(w){i[w]=[u].concat(i[u].filter(function(P){return w!==P}))})}),[].concat(t.string).filter(Boolean).forEach(function(u){e.strings[u]=!0,i[u]&&(e.strings[i[u]]=!0)});var o=t.default||{},n={_:[]};Object.keys(e.bools).forEach(function(u){c(u,o[u]===void 0?!1:o[u])});var r=[];s.indexOf("--")!==-1&&(r=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));function l(u,w){return e.allBools&&/^--[^=]+$/.test(w)||e.strings[u]||e.bools[u]||i[u]}function c(u,w,P){if(!(P&&e.unknownFn&&!l(u,P)&&e.unknownFn(P)===!1)){var g=!e.strings[u]&&Xt(w)?Number(w):w;h(n,u.split("."),g),(i[u]||[]).forEach(function(K){h(n,K.split("."),g)})}}function h(u,w,P){for(var g=u,K=0;K<w.length-1;K++){var x=w[K];if(Qt(g,x))return;g[x]===void 0&&(g[x]={}),(g[x]===Object.prototype||g[x]===Number.prototype||g[x]===String.prototype)&&(g[x]={}),g[x]===Array.prototype&&(g[x]=[]),g=g[x]}var x=w[w.length-1];Qt(g,x)||((g===Object.prototype||g===Number.prototype||g===String.prototype)&&(g={}),g===Array.prototype&&(g=[]),g[x]===void 0||e.bools[x]||typeof g[x]=="boolean"?g[x]=P:Array.isArray(g[x])?g[x].push(P):g[x]=[g[x],P])}function $(u){return i[u].some(function(w){return e.bools[w]})}for(var f=0;f<s.length;f++){var a=s[f];if(/^--.+=/.test(a)){var b=a.match(/^--([^=]+)=([\s\S]*)$/),p=b[1],S=b[2];e.bools[p]&&(S=S!=="false"),c(p,S,a)}else if(/^--no-.+/.test(a)){var p=a.match(/^--no-(.+)/)[1];c(p,!1,a)}else if(/^--.+/.test(a)){var p=a.match(/^--(.+)/)[1],E=s[f+1];E!==void 0&&!/^-/.test(E)&&!e.bools[p]&&!e.allBools&&(i[p]?!$(p):!0)?(c(p,E,a),f++):/^(true|false)$/.test(E)?(c(p,E==="true",a),f++):c(p,e.strings[p]?"":!0,a)}else if(/^-[^-]+/.test(a)){for(var O=a.slice(1,-1).split(""),V=!1,d=0;d<O.length;d++){var E=a.slice(d+2);if(E==="-"){c(O[d],E,a);continue}if(/[A-Za-z]/.test(O[d])&&/=/.test(E)){c(O[d],E.split("=")[1],a),V=!0;break}if(/[A-Za-z]/.test(O[d])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(E)){c(O[d],E,a),V=!0;break}if(O[d+1]&&O[d+1].match(/\W/)){c(O[d],a.slice(d+2),a),V=!0;break}else c(O[d],e.strings[O[d]]?"":!0,a)}var p=a.slice(-1)[0];!V&&p!=="-"&&(s[f+1]&&!/^(-|--)[^-]/.test(s[f+1])&&!e.bools[p]&&(i[p]?!$(p):!0)?(c(p,s[f+1],a),f++):s[f+1]&&/^(true|false)$/.test(s[f+1])?(c(p,s[f+1]==="true",a),f++):c(p,e.strings[p]?"":!0,a))}else if((!e.unknownFn||e.unknownFn(a)!==!1)&&n._.push(e.strings._||!Xt(a)?a:Number(a)),t.stopEarly){n._.push.apply(n._,s.slice(f+1));break}}return Object.keys(o).forEach(function(u){ys(n,u.split("."))||(h(n,u.split("."),o[u]),(i[u]||[]).forEach(function(w){h(n,w.split("."),o[u])}))}),t["--"]?(n["--"]=new Array,r.forEach(function(u){n["--"].push(u)})):r.forEach(function(u){n._.push(u)}),n};function ys(s,t){var e=s;t.slice(0,-1).forEach(function(o){e=e[o]||{}});var i=t[t.length-1];return i in e}function Xt(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function Qt(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var te={};const{FORCE_COLOR:$s,NODE_DISABLE_COLORS:xs,TERM:Ss}=process.env,m={enabled:!xs&&Ss!=="dumb"&&$s!=="0",reset:v(0,0),bold:v(1,22),dim:v(2,22),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),grey:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49)};function ee(s,t){let e=0,i,o="",n="";for(;e<s.length;e++)i=s[e],o+=i.open,n+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return o+t+n}function Es(s,t){let e={has:s,keys:t};return e.reset=m.reset.bind(e),e.bold=m.bold.bind(e),e.dim=m.dim.bind(e),e.italic=m.italic.bind(e),e.underline=m.underline.bind(e),e.inverse=m.inverse.bind(e),e.hidden=m.hidden.bind(e),e.strikethrough=m.strikethrough.bind(e),e.black=m.black.bind(e),e.red=m.red.bind(e),e.green=m.green.bind(e),e.yellow=m.yellow.bind(e),e.blue=m.blue.bind(e),e.magenta=m.magenta.bind(e),e.cyan=m.cyan.bind(e),e.white=m.white.bind(e),e.gray=m.gray.bind(e),e.grey=m.grey.bind(e),e.bgBlack=m.bgBlack.bind(e),e.bgRed=m.bgRed.bind(e),e.bgGreen=m.bgGreen.bind(e),e.bgYellow=m.bgYellow.bind(e),e.bgBlue=m.bgBlue.bind(e),e.bgMagenta=m.bgMagenta.bind(e),e.bgCyan=m.bgCyan.bind(e),e.bgWhite=m.bgWhite.bind(e),e}function v(s,t){let e={open:`\x1B[${s}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(s)||(this.has.push(s),this.keys.push(e)),i===void 0?this:m.enabled?ee(this.keys,i+""):i+""):i===void 0?Es([s],[e]):m.enabled?ee([e],i+""):i+""}}var M=m,Ts=(s,t)=>{if(!(s.meta&&s.name!=="escape")){if(s.ctrl){if(s.name==="a")return"first";if(s.name==="c"||s.name==="d")return"abort";if(s.name==="e")return"last";if(s.name==="g")return"reset"}if(t){if(s.name==="j")return"down";if(s.name==="k")return"up"}return s.name==="return"||s.name==="enter"?"submit":s.name==="backspace"?"delete":s.name==="delete"?"deleteForward":s.name==="abort"?"abort":s.name==="escape"?"exit":s.name==="tab"?"next":s.name==="pagedown"?"nextPage":s.name==="pageup"?"prevPage":s.name==="home"?"home":s.name==="end"?"end":s.name==="up"?"up":s.name==="down"?"down":s.name==="right"?"right":s.name==="left"?"left":!1}},yt=s=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof s=="string"?s.replace(e,""):s};const $t="\x1B",y=`${$t}[`,Os="\x07",xt={to(s,t){return t?`${y}${t+1};${s+1}H`:`${y}${s+1}G`},move(s,t){let e="";return s<0?e+=`${y}${-s}D`:s>0&&(e+=`${y}${s}C`),t<0?e+=`${y}${-t}A`:t>0&&(e+=`${y}${t}B`),e},up:(s=1)=>`${y}${s}A`,down:(s=1)=>`${y}${s}B`,forward:(s=1)=>`${y}${s}C`,backward:(s=1)=>`${y}${s}D`,nextLine:(s=1)=>`${y}E`.repeat(s),prevLine:(s=1)=>`${y}F`.repeat(s),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${$t}7`,restore:`${$t}8`},Ps={up:(s=1)=>`${y}S`.repeat(s),down:(s=1)=>`${y}T`.repeat(s)},Cs={screen:`${y}2J`,up:(s=1)=>`${y}1J`.repeat(s),down:(s=1)=>`${y}J`.repeat(s),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(s){let t="";for(let e=0;e<s;e++)t+=this.line+(e<s-1?xt.up():"");return s&&(t+=xt.left),t}};var D={cursor:xt,scroll:Ps,erase:Cs,beep:Os};const Ms=yt,{erase:se,cursor:Ds}=D,_s=s=>[...Ms(s)].length;var Is=function(s,t){if(!t)return se.line+Ds.to(0);let e=0;const i=s.split(/\r?\n/);for(let o of i)e+=1+Math.floor(Math.max(_s(o)-1,0)/t);return se.lines(e)};const q={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},As={arrowUp:q.arrowUp,arrowDown:q.arrowDown,arrowLeft:q.arrowLeft,arrowRight:q.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Rs=process.platform==="win32"?As:q;var ie=Rs;const W=M,Y=ie,St=Object.freeze({password:{scale:1,render:s=>"*".repeat(s.length)},emoji:{scale:2,render:s=>"\u{1F603}".repeat(s.length)},invisible:{scale:0,render:s=>""},default:{scale:1,render:s=>`${s}`}}),ks=s=>St[s]||St.default,Z=Object.freeze({aborted:W.red(Y.cross),done:W.green(Y.tick),exited:W.yellow(Y.cross),default:W.cyan("?")}),Ns=(s,t,e)=>t?Z.aborted:e?Z.exited:s?Z.done:Z.default,js=s=>W.gray(s?Y.ellipsis:Y.pointerSmall),Fs=(s,t)=>W.gray(s?t?Y.pointerSmall:"+":Y.line);var Ls={styles:St,render:ks,symbols:Z,symbol:Ns,delimiter:js,item:Fs};const Vs=yt;var Ys=function(s,t){let e=String(Vs(s)||"").split(/\r?\n/);return t?e.map(i=>Math.ceil(i.length/t)).reduce((i,o)=>i+o):e.length},Hs=(s,t={})=>{const e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(s||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((n,r)=>(r.length+e.length>=i||n[n.length-1].length+r.length+1<i?n[n.length-1]+=` ${r}`:n.push(`${e}${r}`),n),[e]).join(`
|
1
|
+
import S from"node:fs";import T from"node:path";import{fileURLToPath as Le}from"node:url";import Ye from"child_process";import at from"path";import ut from"fs";import He from"readline";import Ve from"events";var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var W={exports:{}},dt,Vt;function ke(){if(Vt)return dt;Vt=1,dt=i,i.sync=n;var e=ut;function t(o,r){var l=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var f=0;f<l.length;f++){var h=l[f].toLowerCase();if(h&&o.substr(-h.length).toLowerCase()===h)return!0}return!1}function s(o,r,l){return!o.isSymbolicLink()&&!o.isFile()?!1:t(r,l)}function i(o,r,l){e.stat(o,function(f,h){l(f,f?!1:s(h,o,r))})}function n(o,r){return s(e.statSync(o),o,r)}return dt}var ft,Bt;function We(){if(Bt)return ft;Bt=1,ft=t,t.sync=s;var e=ut;function t(o,r,l){e.stat(o,function(f,h){l(f,f?!1:i(h,r))})}function s(o,r){return i(e.statSync(o),r)}function i(o,r){return o.isFile()&&n(o,r)}function n(o,r){var l=o.mode,f=o.uid,h=o.gid,$=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),p=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),d=parseInt("010",8),m=parseInt("001",8),x=a|d,P=l&m||l&d&&h===p||l&a&&f===$||l&x&&$===0;return P}return ft}var et;process.platform==="win32"||Be.TESTING_WINDOWS?et=ke():et=We();var ze=pt;pt.sync=Ge;function pt(e,t,s){if(typeof t=="function"&&(s=t,t={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){pt(e,t||{},function(o,r){o?n(o):i(r)})})}et(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),s(i,n)})}function Ge(e,t){try{return et.sync(e,t||{})}catch(s){if(t&&t.ignoreErrors||s.code==="EACCES")return!1;throw s}}const z=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",kt=at,Ue=z?";":":",Wt=ze,zt=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Gt=(e,t)=>{const s=t.colon||Ue,i=e.match(/\//)||z&&e.match(/\\/)?[""]:[...z?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(s)],n=z?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=z?n.split(s):[""];return z&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},Ut=(e,t,s)=>{typeof t=="function"&&(s=t,t={}),t||(t={});const{pathEnv:i,pathExt:n,pathExtExe:o}=Gt(e,t),r=[],l=h=>new Promise(($,p)=>{if(h===i.length)return t.all&&r.length?$(r):p(zt(e));const a=i[h],d=/^".*"$/.test(a)?a.slice(1,-1):a,m=kt.join(d,e),x=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;$(f(x,h,0))}),f=(h,$,p)=>new Promise((a,d)=>{if(p===n.length)return a(l($+1));const m=n[p];Wt(h+m,{pathExt:o},(x,P)=>{if(!x&&P)if(t.all)r.push(h+m);else return a(h+m);return a(f(h,$,p+1))})});return s?l(0).then(h=>s(null,h),s):l(0)},Ke=(e,t)=>{t=t||{};const{pathEnv:s,pathExt:i,pathExtExe:n}=Gt(e,t),o=[];for(let r=0;r<s.length;r++){const l=s[r],f=/^".*"$/.test(l)?l.slice(1,-1):l,h=kt.join(f,e),$=!f&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;for(let p=0;p<i.length;p++){const a=$+i[p];try{if(Wt.sync(a,{pathExt:n}))if(t.all)o.push(a);else return a}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw zt(e)};var Je=Ut;Ut.sync=Ke;var mt={exports:{}};const Kt=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};mt.exports=Kt,mt.exports.default=Kt;var qe=mt.exports;const Jt=at,Ze=Je,Xe=qe;function qt(e,t){const s=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let r;try{r=Ze.sync(e.command,{path:s[Xe({env:s})],pathExt:t?Jt.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return r&&(r=Jt.resolve(n?e.options.cwd:"",r)),r}function Qe(e){return qt(e)||qt(e,!0)}var ts=Qe,gt={};const vt=/([()\][%!^"`<>&|;, *?])/g;function es(e){return e=e.replace(vt,"^$1"),e}function ss(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(vt,"^$1"),t&&(e=e.replace(vt,"^$1")),e}gt.command=es,gt.argument=ss;var is=/^#!(.*)/;const rs=is;var ns=(e="")=>{const t=e.match(rs);if(!t)return null;const[s,i]=t[0].replace(/#! ?/,"").split(" "),n=s.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n};const bt=ut,os=ns;function ls(e){const s=Buffer.alloc(150);let i;try{i=bt.openSync(e,"r"),bt.readSync(i,s,0,150,0),bt.closeSync(i)}catch{}return os(s.toString())}var hs=ls;const as=at,Zt=ts,Xt=gt,us=hs,cs=process.platform==="win32",ds=/\.(?:com|exe)$/i,fs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ps(e){e.file=Zt(e);const t=e.file&&us(e.file);return t?(e.args.unshift(e.file),e.command=t,Zt(e)):e.file}function ms(e){if(!cs)return e;const t=ps(e),s=!ds.test(t);if(e.options.forceShell||s){const i=fs.test(t);e.command=as.normalize(e.command),e.command=Xt.command(e.command),e.args=e.args.map(o=>Xt.argument(o,i));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function gs(e,t,s){t&&!Array.isArray(t)&&(s=t,t=null),t=t?t.slice(0):[],s=Object.assign({},s);const i={command:e,args:t,options:s,file:void 0,original:{command:e,args:t}};return s.shell?i:ms(i)}var vs=gs;const wt=process.platform==="win32";function yt(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function bs(e,t){if(!wt)return;const s=e.emit;e.emit=function(i,n){if(i==="exit"){const o=Qt(n,t);if(o)return s.call(e,"error",o)}return s.apply(e,arguments)}}function Qt(e,t){return wt&&e===1&&!t.file?yt(t.original,"spawn"):null}function ws(e,t){return wt&&e===1&&!t.file?yt(t.original,"spawnSync"):null}var ys={hookChildProcess:bs,verifyENOENT:Qt,verifyENOENTSync:ws,notFoundError:yt};const te=Ye,$t=vs,xt=ys;function ee(e,t,s){const i=$t(e,t,s),n=te.spawn(i.command,i.args,i.options);return xt.hookChildProcess(n,i),n}function $s(e,t,s){const i=$t(e,t,s),n=te.spawnSync(i.command,i.args,i.options);return n.error=n.error||xt.verifyENOENTSync(n.status,i),n}W.exports=ee,W.exports.spawn=ee,W.exports.sync=$s,W.exports._parse=$t,W.exports._enoent=xt;var xs=W.exports;const Ss=ct(xs);function Es(e,t){var s=e;t.slice(0,-1).forEach(function(n){s=s[n]||{}});var i=t[t.length-1];return i in s}function se(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function ie(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}var Os=function(e,t){t||(t={});var s={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(s.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?s.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(u){s.bools[u]=!0});var i={};function n(u){return i[u].some(function(b){return s.bools[b]})}Object.keys(t.alias||{}).forEach(function(u){i[u]=[].concat(t.alias[u]),i[u].forEach(function(b){i[b]=[u].concat(i[u].filter(function(O){return b!==O}))})}),[].concat(t.string).filter(Boolean).forEach(function(u){s.strings[u]=!0,i[u]&&[].concat(i[u]).forEach(function(b){s.strings[b]=!0})});var o=t.default||{},r={_:[]};function l(u,b){return s.allBools&&/^--[^=]+$/.test(b)||s.strings[u]||s.bools[u]||i[u]}function f(u,b,O){for(var v=u,J=0;J<b.length-1;J++){var _=b[J];if(ie(v,_))return;v[_]===void 0&&(v[_]={}),(v[_]===Object.prototype||v[_]===Number.prototype||v[_]===String.prototype)&&(v[_]={}),v[_]===Array.prototype&&(v[_]=[]),v=v[_]}var R=b[b.length-1];ie(v,R)||((v===Object.prototype||v===Number.prototype||v===String.prototype)&&(v={}),v===Array.prototype&&(v=[]),v[R]===void 0||s.bools[R]||typeof v[R]=="boolean"?v[R]=O:Array.isArray(v[R])?v[R].push(O):v[R]=[v[R],O])}function h(u,b,O){if(!(O&&s.unknownFn&&!l(u,O)&&s.unknownFn(O)===!1)){var v=!s.strings[u]&&se(b)?Number(b):b;f(r,u.split("."),v),(i[u]||[]).forEach(function(J){f(r,J.split("."),v)})}}Object.keys(s.bools).forEach(function(u){h(u,o[u]===void 0?!1:o[u])});var $=[];e.indexOf("--")!==-1&&($=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var p=0;p<e.length;p++){var a=e[p],d,m;if(/^--.+=/.test(a)){var x=a.match(/^--([^=]+)=([\s\S]*)$/);d=x[1];var P=x[2];s.bools[d]&&(P=P!=="false"),h(d,P,a)}else if(/^--no-.+/.test(a))d=a.match(/^--no-(.+)/)[1],h(d,!1,a);else if(/^--.+/.test(a))d=a.match(/^--(.+)/)[1],m=e[p+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!s.bools[d]&&!s.allBools&&(!i[d]||!n(d))?(h(d,m,a),p+=1):/^(true|false)$/.test(m)?(h(d,m==="true",a),p+=1):h(d,s.strings[d]?"":!0,a);else if(/^-[^-]+/.test(a)){for(var E=a.slice(1,-1).split(""),V=!1,c=0;c<E.length;c++){if(m=a.slice(c+2),m==="-"){h(E[c],m,a);continue}if(/[A-Za-z]/.test(E[c])&&m[0]==="="){h(E[c],m.slice(1),a),V=!0;break}if(/[A-Za-z]/.test(E[c])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){h(E[c],m,a),V=!0;break}if(E[c+1]&&E[c+1].match(/\W/)){h(E[c],a.slice(c+2),a),V=!0;break}else h(E[c],s.strings[E[c]]?"":!0,a)}d=a.slice(-1)[0],!V&&d!=="-"&&(e[p+1]&&!/^(-|--)[^-]/.test(e[p+1])&&!s.bools[d]&&(!i[d]||!n(d))?(h(d,e[p+1],a),p+=1):e[p+1]&&/^(true|false)$/.test(e[p+1])?(h(d,e[p+1]==="true",a),p+=1):h(d,s.strings[d]?"":!0,a))}else if((!s.unknownFn||s.unknownFn(a)!==!1)&&r._.push(s.strings._||!se(a)?a:Number(a)),t.stopEarly){r._.push.apply(r._,e.slice(p+1));break}}return Object.keys(o).forEach(function(u){Es(r,u.split("."))||(f(r,u.split("."),o[u]),(i[u]||[]).forEach(function(b){f(r,b.split("."),o[u])}))}),t["--"]?r["--"]=$.slice():$.forEach(function(u){r._.push(u)}),r};const Ts=ct(Os);var re={};const{FORCE_COLOR:Cs,NODE_DISABLE_COLORS:Ms,TERM:Ps}=process.env,g={enabled:!Ms&&Ps!=="dumb"&&Cs!=="0",reset:w(0,0),bold:w(1,22),dim:w(2,22),italic:w(3,23),underline:w(4,24),inverse:w(7,27),hidden:w(8,28),strikethrough:w(9,29),black:w(30,39),red:w(31,39),green:w(32,39),yellow:w(33,39),blue:w(34,39),magenta:w(35,39),cyan:w(36,39),white:w(37,39),gray:w(90,39),grey:w(90,39),bgBlack:w(40,49),bgRed:w(41,49),bgGreen:w(42,49),bgYellow:w(43,49),bgBlue:w(44,49),bgMagenta:w(45,49),bgCyan:w(46,49),bgWhite:w(47,49)};function ne(e,t){let s=0,i,n="",o="";for(;s<e.length;s++)i=e[s],n+=i.open,o+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return n+t+o}function _s(e,t){let s={has:e,keys:t};return s.reset=g.reset.bind(s),s.bold=g.bold.bind(s),s.dim=g.dim.bind(s),s.italic=g.italic.bind(s),s.underline=g.underline.bind(s),s.inverse=g.inverse.bind(s),s.hidden=g.hidden.bind(s),s.strikethrough=g.strikethrough.bind(s),s.black=g.black.bind(s),s.red=g.red.bind(s),s.green=g.green.bind(s),s.yellow=g.yellow.bind(s),s.blue=g.blue.bind(s),s.magenta=g.magenta.bind(s),s.cyan=g.cyan.bind(s),s.white=g.white.bind(s),s.gray=g.gray.bind(s),s.grey=g.grey.bind(s),s.bgBlack=g.bgBlack.bind(s),s.bgRed=g.bgRed.bind(s),s.bgGreen=g.bgGreen.bind(s),s.bgYellow=g.bgYellow.bind(s),s.bgBlue=g.bgBlue.bind(s),s.bgMagenta=g.bgMagenta.bind(s),s.bgCyan=g.bgCyan.bind(s),s.bgWhite=g.bgWhite.bind(s),s}function w(e,t){let s={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(s)),i===void 0?this:g.enabled?ne(this.keys,i+""):i+""):i===void 0?_s([e],[s]):g.enabled?ne([s],i+""):i+""}}var C=g,Ds=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}},St=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),s=new RegExp(t,"g");return typeof e=="string"?e.replace(s,""):e};const Et="\x1B",y=`${Et}[`,Is="\x07",Ot={to(e,t){return t?`${y}${t+1};${e+1}H`:`${y}${e+1}G`},move(e,t){let s="";return e<0?s+=`${y}${-e}D`:e>0&&(s+=`${y}${e}C`),t<0?s+=`${y}${-t}A`:t>0&&(s+=`${y}${t}B`),s},up:(e=1)=>`${y}${e}A`,down:(e=1)=>`${y}${e}B`,forward:(e=1)=>`${y}${e}C`,backward:(e=1)=>`${y}${e}D`,nextLine:(e=1)=>`${y}E`.repeat(e),prevLine:(e=1)=>`${y}F`.repeat(e),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${Et}7`,restore:`${Et}8`},Rs={up:(e=1)=>`${y}S`.repeat(e),down:(e=1)=>`${y}T`.repeat(e)},As={screen:`${y}2J`,up:(e=1)=>`${y}1J`.repeat(e),down:(e=1)=>`${y}J`.repeat(e),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?Ot.up():"");return e&&(t+=Ot.left),t}};var M={cursor:Ot,scroll:Rs,erase:As,beep:Is};const js=St,{erase:oe,cursor:Ns}=M,Fs=e=>[...js(e)].length;var Ls=function(e,t){if(!t)return oe.line+Ns.to(0);let s=0;const i=e.split(/\r?\n/);for(let n of i)s+=1+Math.floor(Math.max(Fs(n)-1,0)/t);return oe.lines(s)};const q={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Ys={arrowUp:q.arrowUp,arrowDown:q.arrowDown,arrowLeft:q.arrowLeft,arrowRight:q.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Hs=process.platform==="win32"?Ys:q;var le=Hs;const G=C,B=le,Tt=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"\u{1F603}".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),Vs=e=>Tt[e]||Tt.default,Z=Object.freeze({aborted:G.red(B.cross),done:G.green(B.tick),exited:G.yellow(B.cross),default:G.cyan("?")}),Bs=(e,t,s)=>t?Z.aborted:s?Z.exited:e?Z.done:Z.default,ks=e=>G.gray(e?B.ellipsis:B.pointerSmall),Ws=(e,t)=>G.gray(e?t?B.pointerSmall:"+":B.line);var zs={styles:Tt,render:Vs,symbols:Z,symbol:Bs,delimiter:ks,item:Ws};const Gs=St;var Us=function(e,t){let s=String(Gs(e)||"").split(/\r?\n/);return t?s.map(i=>Math.ceil(i.length/t)).reduce((i,n)=>i+n):s.length},Ks=(e,t={})=>{const s=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(e||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,r)=>(r.length+s.length>=i||o[o.length-1].length+r.length+1<i?o[o.length-1]+=` ${r}`:o.push(`${s}${r}`),o),[s]).join(`
|
2
2
|
`)).join(`
|
3
|
-
`)},
|
3
|
+
`)},Js=(e,t,s)=>{s=s||t;let i=Math.min(t-s,e-Math.floor(s/2));i<0&&(i=0);let n=Math.min(i+s,t);return{startIndex:i,endIndex:n}},D={action:Ds,clear:Ls,style:zs,strip:St,figures:le,lines:Us,wrap:Ks,entriesToDisplay:Js};const he=He,{action:qs}=D,Zs=Ve,{beep:Xs,cursor:Qs}=M,ti=C;let ei=class extends Zs{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const s=he.createInterface({input:this.in,escapeCodeTimeout:50});he.emitKeypressEvents(this.in,s),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,r)=>{let l=qs(r,i);l===!1?this._&&this._(o,r):typeof this[l]=="function"?this[l](r):this.bell()};this.close=()=>{this.out.write(Qs.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),s.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Xs)}render(){this.onRender(ti),this.firstRender&&(this.firstRender=!1)}};var L=ei;const st=C,si=L,{erase:ii,cursor:X}=M,{style:Ct,clear:Mt,lines:ri,figures:ni}=D;class oi extends si{constructor(t={}){super(t),this.transform=Ct.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Mt("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=st.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
4
4
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
5
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,
|
6
|
-
`).reduce((t,
|
7
|
-
${i?" ":
|
5
|
+
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,s){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),s=this.value.slice(this.cursor);this.value=`${t}${s}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor+1);this.value=`${t}${s}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(X.down(ri(this.outputError,this.out.columns)-1)+Mt(this.outputError,this.out.columns)),this.out.write(Mt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ct.symbol(this.done,this.aborted),st.bold(this.msg),Ct.delimiter(this.done),this.red?st.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
6
|
+
`).reduce((t,s,i)=>t+`
|
7
|
+
${i?" ":ni.pointerSmall} ${st.red().italic(s)}`,"")),this.out.write(ii.line+X.to(0)+this.outputText+X.save+this.outputError+X.restore+X.move(this.cursorOffset,0)))}}var li=oi;const A=C,hi=L,{style:ae,clear:ue,figures:it,wrap:ai,entriesToDisplay:ui}=D,{cursor:ci}=M;class di extends hi{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((s,i)=>(typeof s=="string"&&(s={title:s,value:i}),{title:s&&(s.title||s.value||s),value:s&&(s.value===void 0?i:s.value),description:s&&s.description,selected:s&&s.selected,disabled:s&&s.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=ue("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
8
8
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
9
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,
|
10
|
-
`;for(let i=t;i<
|
11
|
-
`+
|
12
|
-
`}}this.out.write(this.outputText)}}var
|
9
|
+
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,s){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(ci.hide):this.out.write(ue(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:s}=ui(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[ae.symbol(this.done,this.aborted),A.bold(this.msg),ae.delimiter(!1),this.done?this.selection.title:this.selection.disabled?A.yellow(this.warn):A.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
10
|
+
`;for(let i=t;i<s;i++){let n,o,r="",l=this.choices[i];i===t&&t>0?o=it.arrowUp:i===s-1&&s<this.choices.length?o=it.arrowDown:o=" ",l.disabled?(n=this.cursor===i?A.gray().underline(l.title):A.strikethrough().gray(l.title),o=(this.cursor===i?A.bold().gray(it.pointer)+" ":" ")+o):(n=this.cursor===i?A.cyan().underline(l.title):l.title,o=(this.cursor===i?A.cyan(it.pointer)+" ":" ")+o,l.description&&this.cursor===i&&(r=` - ${l.description}`,(o.length+n.length+r.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(r=`
|
11
|
+
`+ai(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${A.gray(r)}
|
12
|
+
`}}this.out.write(this.outputText)}}var fi=di;const rt=C,pi=L,{style:ce,clear:mi}=D,{cursor:de,erase:gi}=M;class vi extends pi{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
13
13
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
14
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,
|
14
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,s){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(de.hide):this.out.write(mi(this.outputText,this.out.columns)),super.render(),this.outputText=[ce.symbol(this.done,this.aborted),rt.bold(this.msg),ce.delimiter(this.done),this.value?this.inactive:rt.cyan().underline(this.inactive),rt.gray("/"),this.value?rt.cyan().underline(this.active):this.active].join(" "),this.out.write(gi.line+de.to(0)+this.outputText))}}var bi=vi;let wi=class Ht{constructor({token:t,date:s,parts:i,locales:n}){this.token=t,this.date=s||new Date,this.parts=i||[this],this.locales=n||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find((s,i)=>i>t&&s instanceof Ht)}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const s=t.indexOf(this);return t.find((i,n)=>n>s&&i instanceof Ht)}toString(){return String(this.date)}};var j=wi;const yi=j;let $i=class extends yi{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};var xi=$i;const Si=j,Ei=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th");let Oi=class extends Si{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),s=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+Ei(t):this.token==="d"?s+1:this.token==="ddd"?this.locales.weekdaysShort[s]:this.token==="dddd"?this.locales.weekdays[s]:t}};var Ti=Oi;const Ci=j;let Mi=class extends Ci{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};var Pi=Mi;const _i=j;let Di=class extends _i{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};var Ii=Di;const Ri=j;let Ai=class extends Ri{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};var ji=Ai;const Ni=j;let Fi=class extends Ni{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}};var Li=Fi;const Yi=j;let Hi=class extends Yi{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};var Vi=Hi;const Bi=j;let ki=class extends Bi{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};var Wi=ki,zi={DatePart:j,Meridiem:xi,Day:Ti,Hours:Pi,Milliseconds:Ii,Minutes:ji,Month:Li,Seconds:Vi,Year:Wi};const Pt=C,Gi=L,{style:fe,clear:pe,figures:Ui}=D,{erase:Ki,cursor:me}=M,{DatePart:ge,Meridiem:Ji,Day:qi,Hours:Zi,Milliseconds:Xi,Minutes:Qi,Month:tr,Seconds:er,Year:sr}=zi,ir=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,ve={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new qi(e),3:e=>new tr(e),4:e=>new sr(e),5:e=>new Ji(e),6:e=>new Zi(e),7:e=>new Qi(e),8:e=>new er(e),9:e=>new Xi(e)},rr={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class nr extends Gi{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(rr,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=pe("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let s;for(this.parts=[];s=ir.exec(t);){let n=s.shift(),o=s.findIndex(r=>r!=null);this.parts.push(o in ve?ve[o]({token:s[o]||n,date:this.date,parts:this.parts,locales:this.locales}):s[o]||n)}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof ge)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
15
15
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
16
|
-
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(
|
17
|
-
`).reduce((t,
|
18
|
-
${i?" ":
|
16
|
+
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(s=>s instanceof ge)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(me.hide):this.out.write(pe(this.outputText,this.out.columns)),super.render(),this.outputText=[fe.symbol(this.done,this.aborted),Pt.bold(this.msg),fe.delimiter(!1),this.parts.reduce((t,s,i)=>t.concat(i===this.cursor&&!this.done?Pt.cyan().underline(s.toString()):s),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
17
|
+
`).reduce((t,s,i)=>t+`
|
18
|
+
${i?" ":Ui.pointerSmall} ${Pt.red().italic(s)}`,"")),this.out.write(Ki.line+me.to(0)+this.outputText))}}var or=nr;const nt=C,lr=L,{cursor:ot,erase:hr}=M,{style:_t,figures:ar,clear:be,lines:ur}=D,cr=/[0-9]/,Dt=e=>e!==void 0,we=(e,t)=>{let s=Math.pow(10,t);return Math.round(e*s)/s};class dr extends lr{constructor(t={}){super(t),this.transform=_t.render(t.style),this.msg=t.message,this.initial=Dt(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=Dt(t.min)?t.min:-1/0,this.max=Dt(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=nt.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${we(t,this.round)}`),this._value=we(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||cr.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
19
19
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
20
|
-
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,
|
21
|
-
`).reduce((t,
|
22
|
-
${i?" ":
|
23
|
-
`),this.close()}submit(){const t=this.value.filter(
|
24
|
-
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(
|
20
|
+
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,s){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ot.down(ur(this.outputError,this.out.columns)-1)+be(this.outputError,this.out.columns)),this.out.write(be(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[_t.symbol(this.done,this.aborted),nt.bold(this.msg),_t.delimiter(this.done),!this.done||!this.done&&!this.placeholder?nt[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
21
|
+
`).reduce((t,s,i)=>t+`
|
22
|
+
${i?" ":ar.pointerSmall} ${nt.red().italic(s)}`,"")),this.out.write(hr.line+ot.to(0)+this.outputText+ot.save+this.outputError+ot.restore))}}var fr=dr;const I=C,{cursor:pr}=M,mr=L,{clear:ye,figures:Y,style:$e,wrap:gr,entriesToDisplay:vr}=D;let br=class extends mr{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((s,i)=>(typeof s=="string"&&(s={title:s,value:i}),{title:s&&(s.title||s.value||s),description:s&&s.description,value:s&&(s.value===void 0?i:s.value),selected:s&&s.selected,disabled:s&&s.disabled})),this.clear=ye("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
23
|
+
`),this.close()}submit(){const t=this.value.filter(s=>s.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
24
|
+
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(s=>s.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter(s=>!s.disabled).forEach(s=>s.selected=t),this.render()}_(t,s){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
25
25
|
Instructions:
|
26
|
-
${
|
27
|
-
${
|
26
|
+
${Y.arrowUp}/${Y.arrowDown}: Highlight option
|
27
|
+
${Y.arrowLeft}/${Y.arrowRight}/[space]: Toggle selection
|
28
28
|
`+(this.maxChoices===void 0?` a: Toggle all
|
29
|
-
`:"")+" enter/return: Complete answer":""}renderOption(t,
|
30
|
-
`+
|
31
|
-
`+
|
32
|
-
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(
|
29
|
+
`:"")+" enter/return: Complete answer":""}renderOption(t,s,i,n){const o=(s.selected?I.green(Y.radioOn):Y.radioOff)+" "+n+" ";let r,l;return s.disabled?r=t===i?I.gray().underline(s.title):I.strikethrough().gray(s.title):(r=t===i?I.cyan().underline(s.title):s.title,t===i&&s.description&&(l=` - ${s.description}`,(o.length+r.length+l.length>=this.out.columns||s.description.split(/\r?\n/).length>1)&&(l=`
|
30
|
+
`+gr(s.description,{margin:o.length,width:this.out.columns})))),o+r+I.gray(l||"")}paginateOptions(t){if(t.length===0)return I.red("No matches for this query.");let{startIndex:s,endIndex:i}=vr(this.cursor,t.length,this.optionsPerPage),n,o=[];for(let r=s;r<i;r++)r===s&&s>0?n=Y.arrowUp:r===i-1&&i<t.length?n=Y.arrowDown:n=" ",o.push(this.renderOption(this.cursor,t[r],r,n));return`
|
31
|
+
`+o.join(`
|
32
|
+
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(s=>s.selected).map(s=>s.title).join(", ");const t=[I.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(I.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(pr.hide),super.render();let t=[$e.symbol(this.done,this.aborted),I.bold(this.msg),$e.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=I.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=ye(t,this.out.columns)}};var xe=br;const Q=C,wr=L,{erase:yr,cursor:Se}=M,{style:It,clear:Ee,figures:Rt,wrap:$r,entriesToDisplay:xr}=D,Oe=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),Sr=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),Er=(e,t)=>{const s=e.findIndex(i=>i.value===t||i.title===t);return s>-1?s:void 0};class Or extends wr{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:Er(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=It.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ee("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=Oe(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){const s=this.completing=this.suggest(this.input,this.choices),i=await s;if(this.completing!==s)return;this.suggestions=i.map((o,r,l)=>({title:Sr(l,r),value:Oe(l,r),description:o.description})),this.completing=!1;const n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
33
33
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
34
34
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
35
|
-
`),this.close()}_(t,
|
36
|
-
|
35
|
+
`),this.close()}_(t,s){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),s=this.input.slice(this.cursor);this.input=`${t}${s}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor+1);this.input=`${t}${s}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,s,i,n){let o,r=i?Rt.arrowUp:n?Rt.arrowDown:" ",l=s?Q.cyan().underline(t.title):t.title;return r=(s?Q.cyan(Rt.pointer)+" ":" ")+r,t.description&&(o=` - ${t.description}`,(r.length+l.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
|
36
|
+
`+$r(t.description,{margin:3,width:this.out.columns}))),r+" "+l+Q.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Se.hide):this.out.write(Ee(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:s}=xr(this.select,this.choices.length,this.limit);if(this.outputText=[It.symbol(this.done,this.aborted,this.exited),Q.bold(this.msg),It.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,s).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===s-1&&s<this.choices.length)).join(`
|
37
37
|
`);this.outputText+=`
|
38
|
-
`+(i||Q.gray(this.fallback.title))}this.out.write(
|
38
|
+
`+(i||Q.gray(this.fallback.title))}this.out.write(yr.line+Se.to(0)+this.outputText)}}var Tr=Or;const N=C,{cursor:Cr}=M,Mr=xe,{clear:Te,style:Ce,figures:U}=D;class Pr extends Mr{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=Te("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const s=this.filteredOptions.findIndex(i=>i===t);this.cursor=s<0?0:s,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(s=>s.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,s){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
39
39
|
Instructions:
|
40
|
-
${
|
41
|
-
${
|
40
|
+
${U.arrowUp}/${U.arrowDown}: Highlight option
|
41
|
+
${U.arrowLeft}/${U.arrowRight}/[space]: Toggle selection
|
42
42
|
[a,b,c]/delete: Filter choices
|
43
43
|
enter/return: Complete answer
|
44
44
|
`:""}renderCurrentInput(){return`
|
45
|
-
Filtered results for: ${this.inputValue?this.inputValue:
|
46
|
-
`}renderOption(t,
|
45
|
+
Filtered results for: ${this.inputValue?this.inputValue:N.gray("Enter something to filter")}
|
46
|
+
`}renderOption(t,s,i){let n;return s.disabled?n=t===i?N.gray().underline(s.title):N.strikethrough().gray(s.title):n=t===i?N.cyan().underline(s.title):s.title,(s.selected?N.green(U.radioOn):U.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(s=>s.selected).map(s=>s.title).join(", ");const t=[N.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(N.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Cr.hide),super.render();let t=[Ce.symbol(this.done,this.aborted),N.bold(this.msg),Ce.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=N.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Te(t,this.out.columns)}}var _r=Pr;const Me=C,Dr=L,{style:Pe,clear:Ir}=D,{erase:Rr,cursor:_e}=M;class Ar extends Dr{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
47
47
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
48
|
-
`),this.close()}_(t,
|
49
|
-
Scaffolding project in ${h}...`);const
|
48
|
+
`),this.close()}_(t,s){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(_e.hide):this.out.write(Ir(this.outputText,this.out.columns)),super.render(),this.outputText=[Pe.symbol(this.done,this.aborted),Me.bold(this.msg),Pe.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Me.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Rr.line+_e.to(0)+this.outputText))}}var jr=Ar,Nr={TextPrompt:li,SelectPrompt:fi,TogglePrompt:bi,DatePrompt:or,NumberPrompt:fr,MultiselectPrompt:xe,AutocompletePrompt:Tr,AutocompleteMultiselectPrompt:_r,ConfirmPrompt:jr};(function(e){const t=e,s=Nr,i=r=>r;function n(r,l,f={}){return new Promise((h,$)=>{const p=new s[r](l),a=f.onAbort||i,d=f.onSubmit||i,m=f.onExit||i;p.on("state",l.onState||i),p.on("submit",x=>h(d(x))),p.on("exit",x=>h(m(x))),p.on("abort",x=>$(a(x)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:f=>f.split(l).map(h=>h.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=f=>f.filter(h=>h.selected).map(h=>h.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=f=>f.filter(h=>h.selected).map(h=>h.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(f=>f.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(re);const At=re,Fr=["suggest","format","onState","validate","onRender","type"],De=()=>{};async function H(e=[],{onSubmit:t=De,onCancel:s=De}={}){const i={},n=H._override||{};e=[].concat(e);let o,r,l,f,h,$;const p=async(a,d,m=!1)=>{if(!(!m&&a.validate&&a.validate(d)!==!0))return a.format?await a.format(d,i):d};for(r of e)if({name:f,type:h}=r,typeof h=="function"&&(h=await h(o,{...i},r),r.type=h),!!h){for(let a in r){if(Fr.includes(a))continue;let d=r[a];r[a]=typeof d=="function"?await d(o,{...i},$):d}if($=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:f,type:h}=r,At[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(n[r.name]!==void 0&&(o=await p(r,n[r.name]),o!==void 0)){i[f]=o;continue}try{o=H._injected?Lr(H._injected,r.initial):await At[h](r),i[f]=o=await p(r,o,!0),l=await t(r,o,i)}catch{l=!await s(r,i)}if(l)return i}return i}function Lr(e,t){const s=e.shift();if(s instanceof Error)throw s;return s===void 0?t:s}function Yr(e){H._injected=(H._injected||[]).concat(e)}function Hr(e){H._override=Object.assign({},e)}var Vr=Object.assign(H,{prompt:H,prompts:At,inject:Yr,override:Hr});const Br=ct(Vr);let k=!0;const K=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let tt=0;if(K.process&&K.process.env&&K.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:s,TERM:i,COLORTERM:n}=K.process.env;t||s||e==="0"?k=!1:e==="1"||e==="2"||e==="3"?k=!0:i==="dumb"?k=!1:"CI"in K.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in K.process.env)?k=!0:k=process.stdout.isTTY,k&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?tt=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?tt=2:tt=1)}let Ie={enabled:k,supportLevel:tt};function lt(e,t,s=1){const i=`\x1B[${e}m`,n=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Ie.enabled&&Ie.supportLevel>=s?i+(""+r).replace(o,i)+n:""+r}const F=lt(0,0),Re=lt(31,39),jt=lt(32,39),ht=lt(34,39),Nt=Ts(process.argv.slice(2),{string:["_"]}),Ft=process.cwd(),Lt=[{name:"vue",display:"Young Designed Vue Template",color:jt,variants:[{name:"nuxt-admin",display:"Nuxt3 Admin",color:ht},{name:"nuxt-website",display:"Nuxt3 Website",color:ht},{name:"vue-mobile",display:"Vue3 Mobile",color:ht},{name:"uni-app",display:"Vue3 uni-app",color:ht},{name:"vue-thin",display:"Vue3 mini demo",color:jt},{name:"admin-server",display:"Node Server Based on Midwayjs",color:jt}]},{name:"vite",display:"Vite Formal",color:F,variants:[{name:"create-vite",display:"create-vite",color:F,customCommand:"npm create vite@latest TARGET_DIR"}]},{name:"others",display:"Others",color:F,variants:[{name:"create-vite-extra",display:"create-vite-extra \u2197",color:F,customCommand:"npm create vite-extra@latest TARGET_DIR"}]}],Ae=Lt.map(e=>e.variants&&e.variants.map(t=>t.name)||[e.name]).reduce((e,t)=>e.concat(t),[]),kr={_gitignore:".gitignore",_npmrc:".npmrc",_nvmrc:".nvmrc"},Wr=/_env.*/,Yt="vite-project";async function zr(){const e=je(Nt._[0]),t=Nt.template||Nt.t;let s=e||Yt;const i=()=>s==="."?T.basename(T.resolve()):s;let n;try{n=await Br([{type:e?null:"text",name:"projectName",message:F("Project name:"),initial:Yt,onState:c=>{s=je(c.value)||Yt}},{type:()=>!S.existsSync(s)||Kr(s)?null:"confirm",name:"overwrite",message:()=>`${s==="."?"Current directory":`Target directory "${s}"`} is not empty. Remove existing files and continue?`},{type:(c,{overwrite:u})=>{if(u===!1)throw new Error(`${Re("\u2716")} Operation cancelled`);return null},name:"overwriteChecker"},{type:()=>Fe(i())?null:"text",name:"packageName",message:F("Package name:"),initial:()=>Gr(i()),validate:c=>Fe(c)||"Invalid package.json name"},{type:t&&Ae.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!Ae.includes(t)?F(`"${t}" isn't a valid template. Please choose from below: `):F("Select a framework:"),initial:0,choices:Lt.map(c=>{const u=c.color;return{title:u(c.display||c.name),value:c}})},{type:c=>c&&c.variants?"select":null,name:"variant",message:F("Select a variant:"),choices:c=>c.variants.map(u=>{const b=u.color;return{title:b(u.display||u.name),value:u.name,disabled:u.wip||u.deprecated}})}],{onCancel:()=>{throw new Error(`${Re("\u2716")} Operation cancelled`)}})}catch(c){console.log(c.message);return}const{framework:o,overwrite:r,packageName:l,variant:f}=n,h=T.join(Ft,s);r?Jr(h):S.existsSync(h)||S.mkdirSync(h,{recursive:!0});const $=f||o?.name||t,p=qr(process.env.npm_config_user_agent),a=p?p.name:"npm",d=a==="yarn"&&p?.version.startsWith("1."),{customCommand:m}=Lt.flatMap(c=>c.variants).find(c=>c.name===$)??{};if(m){const c=m.replace("TARGET_DIR",s).replace(/^npm create/,`${a} create`).replace("@latest",()=>d?"":"@latest").replace(/^npm exec/,()=>a==="pnpm"?"pnpm dlx":a==="yarn"&&!d?"yarn dlx":"npm exec"),[u,...b]=c.split(" "),{status:O}=Ss.sync(u,b,{stdio:"inherit"});process.exit(O??0)}console.log(`
|
49
|
+
Scaffolding project in ${h}...`);const x=T.resolve(Le(import.meta.url),"../..",`template-${$}`),P=(c,u)=>{const b=T.join(h,kr[c]??Wr.test(c)?c.replace("_","."):c);u?S.writeFileSync(b,u):Ne(T.join(x,c),b)},E=S.readdirSync(x);for(const c of E.filter(u=>u!=="package.json"))P(c);const V=JSON.parse(S.readFileSync(T.join(x,"package.json"),"utf-8"));switch(V.name=l||i(),P("package.json",JSON.stringify(V,null,2)),console.log(`
|
50
50
|
Done. Now run:
|
51
|
-
`),h!==
|
51
|
+
`),h!==Ft&&console.log(` cd ${T.relative(Ft,h)}`),a){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${a} install`),console.log(` ${a} run dev`);break}console.log()}function je(e){return e?.trim().replace(/\/+$/g,"")}function Ne(e,t){S.statSync(e).isDirectory()?Ur(e,t):S.copyFileSync(e,t)}function Fe(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function Gr(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ur(e,t){S.mkdirSync(t,{recursive:!0});for(const s of S.readdirSync(e)){const i=T.resolve(e,s),n=T.resolve(t,s);Ne(i,n)}}function Kr(e){const t=S.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function Jr(e){if(S.existsSync(e))for(const t of S.readdirSync(e))t!==".git"&&S.rmSync(T.resolve(e,t),{recursive:!0,force:!0})}function qr(e){if(!e)return;const t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}zr().catch(e=>{console.error(e)});
|
package/package.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-young-proj",
|
3
|
-
"
|
3
|
+
"type": "module",
|
4
|
+
"version": "1.0.0",
|
4
5
|
"description": "create project from template",
|
5
6
|
"author": "BluesYoung-web",
|
6
7
|
"license": "MIT",
|
@@ -24,10 +25,10 @@
|
|
24
25
|
"cyp": "index.mjs"
|
25
26
|
},
|
26
27
|
"files": [
|
28
|
+
"dist",
|
27
29
|
"index.mjs",
|
28
30
|
"init.mjs",
|
29
|
-
"template-*"
|
30
|
-
"dist"
|
31
|
+
"template-*"
|
31
32
|
],
|
32
33
|
"engines": {
|
33
34
|
"node": "^14.18.0 || >=16.0.0"
|
@@ -40,17 +41,17 @@
|
|
40
41
|
"postinstall": "node ./init.mjs"
|
41
42
|
},
|
42
43
|
"devDependencies": {
|
43
|
-
"@antfu/eslint-config": "^
|
44
|
-
"@types/node": "
|
44
|
+
"@antfu/eslint-config": "^1.1.0",
|
45
|
+
"@types/node": "^20.8.10",
|
45
46
|
"cross-spawn": "^7.0.3",
|
46
|
-
"eslint": "^8.
|
47
|
-
"jiti": "^1.
|
48
|
-
"kolorist": "^1.
|
49
|
-
"lint-staged": "^
|
50
|
-
"minimist": "^1.2.
|
47
|
+
"eslint": "^8.53.0",
|
48
|
+
"jiti": "^1.21.0",
|
49
|
+
"kolorist": "^1.8.0",
|
50
|
+
"lint-staged": "^15.0.2",
|
51
|
+
"minimist": "^1.2.8",
|
51
52
|
"prompts": "^2.4.2",
|
52
53
|
"simple-git-hooks": "^2.9.0",
|
53
|
-
"unbuild": "^
|
54
|
+
"unbuild": "^2.0.0"
|
54
55
|
},
|
55
56
|
"simple-git-hooks": {
|
56
57
|
"pre-commit": "npx lint-staged"
|
@@ -1,44 +1,50 @@
|
|
1
1
|
# 基于 Nuxt 3 的后台
|
2
2
|
|
3
|
+
[![](https://img.shields.io/badge/Author-BluesYoung--web-blue)](https://gitee.com/BluesYoung-web)
|
4
|
+
|
5
|
+
|
3
6
|
[![code style](https://antfu.me/badge-code-style.svg)](https://github.com/antfu/eslint-config)
|
4
7
|
|
5
8
|
## 与旧版的区别
|
6
9
|
|
7
10
|
### 所有的页面都是默认缓存的
|
8
11
|
|
9
|
-
- 原有的 route 代码块,使用 definePageMeta 宏进行定义
|
12
|
+
- 原有的 `route` 代码块,使用 `definePageMeta` 宏进行定义
|
10
13
|
|
11
|
-
- 所有需要 keep-alive
|
14
|
+
- 所有需要 `keep-alive` 的页面,`setup` 里面直接执行的函数或者 `onMounted` 包裹的函数,全部替换为 `useTabReOpen` 进行包裹
|
12
15
|
|
13
|
-
- 所有不需要 keep-alive
|
16
|
+
- 所有不需要 `keep-alive` 的页面,`setup` 里面直接执行的函数或者 `onMounted` 包裹的函数,全部替换为 `useTabNoCache` 进行包裹
|
14
17
|
|
15
|
-
- onUnmounted 包裹的函数,全部替换为 useTabClose 进行包裹
|
18
|
+
- `onUnmounted` 包裹的函数,全部替换为 `useTabClose` 进行包裹
|
16
19
|
|
17
20
|
### 组件库(@bluesyoung/ui-vue3-element-plus)
|
18
21
|
|
19
22
|
> 自 0.13.0 开始,YoungDialog 默认表现为 Drawer !!!, 可通过设置 as='dialog' 改为 Dialog
|
20
23
|
|
21
|
-
|
24
|
+
> 自 1.2.1 开始,常规使用下,组件、类型以及方法都可以自动按需导入,<del>渲染函数及 tsx 可能仍需手动导入</del>
|
25
|
+
- 需要显示注册模块 (`@bluesyoung/ui-vue3-element-plus/nuxt`)
|
22
26
|
|
23
|
-
|
27
|
+
> 自 1.3.0 开始,可以全量按需自动导入
|
28
|
+
|
29
|
+
### 其他
|
24
30
|
|
25
|
-
-
|
31
|
+
- 路由跳转,使用 `navigateTo` 替换 `router`
|
26
32
|
|
27
|
-
-
|
33
|
+
- 二次确认弹窗,统一使用 `useConfirm`(自带汉化,代码更精简)
|
28
34
|
|
29
|
-
-
|
35
|
+
- `prompt` 情况更复杂,需自行汉化
|
30
36
|
|
31
|
-
-
|
32
|
-
- hooks 直接修改扩展名为 .tsx
|
33
|
-
- vue 内修改 lang 为 tsx
|
37
|
+
- `alert` 使用频率不高,自行汉化
|
34
38
|
|
35
|
-
-
|
39
|
+
- 使用 `tsx` 代替 `h`:
|
40
|
+
- `hooks` 直接修改扩展名为 `.tsx`
|
41
|
+
- `vue` 内修改 `lang` 为 `tsx`
|
36
42
|
|
37
|
-
- 一些存在于 keep-alive 页面内的组件,需要在例如
|
43
|
+
- 一些存在于 `keep-alive` 页面内的组件,需要在例如 `@focus` 内 `getList()`,或者使用 `useTabReOpen` 替换 `onMounted`
|
38
44
|
|
39
|
-
- 尽量使用 YoungTablePro 而不是 YoungTable
|
45
|
+
- 尽量使用 `YoungTablePro` 而不是 `YoungTable`
|
40
46
|
|
41
|
-
- 保持页面美观,页面内容全部使用 ElCard 进行包裹
|
47
|
+
- 保持页面美观,页面内容全部使用 `ElCard` 进行包裹
|
42
48
|
|
43
49
|
- **SelectOption 的值不要给 null !!!**
|
44
50
|
|
@@ -54,6 +60,7 @@ npm i -g young-commit
|
|
54
60
|
|
55
61
|
### 使用
|
56
62
|
|
63
|
+
> **依赖 which 命令,Windows 环境请在 git bash 内执行!!!**
|
57
64
|
|
58
65
|
- 正常使用 `git add` 将要提交的文件添加到暂存区
|
59
66
|
|