Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
84dfc1f0c3 | |||
5f20cb4093 | |||
17f1a59deb | |||
f0f8aa7ed7 | |||
52294af069 |
3
.browserslistrc
Normal file
@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
31
.eslintrc.js
Normal file
@ -0,0 +1,31 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended",
|
||||
"@vue/typescript/recommended",
|
||||
"@vue/prettier",
|
||||
"@vue/prettier/@typescript-eslint",
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
},
|
||||
rules: {
|
||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
"**/__tests__/*.{j,t}s?(x)",
|
||||
"**/tests/unit/**/*.spec.{j,t}s?(x)",
|
||||
],
|
||||
env: {
|
||||
jest: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
31
.gitignore
vendored
@ -1,5 +1,26 @@
|
||||
/node_modules
|
||||
/.next
|
||||
src/.umi
|
||||
out
|
||||
.webpack
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
/src/.umi
|
||||
|
||||
/tests/e2e/videos/
|
||||
/tests/e2e/screenshots/
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
147
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
// setting.json
|
||||
{
|
||||
"debug.console.fontFamily": "JetBrains Mono",
|
||||
// 控制在运行预启动任务后遇到错误时应该怎么做。debugAnyway: 忽略任务错误并开始调试。
|
||||
"debug.onTaskErrors": "debugAnyway",
|
||||
// 控制编辑器是否应在对屏幕阅读器进行了优化的模式下运行。设置为“开”将禁用自动换行。
|
||||
"editor.accessibilitySupport": "off",
|
||||
// 控制是否启用平滑插入动画
|
||||
"editor.cursorSmoothCaretAnimation": "on",
|
||||
"editor.find.addExtraSpaceOnTop": false,
|
||||
// 这个控制是否启用字体连字
|
||||
"editor.fontLigatures": "'ss01', 'ss02', 'ss03', 'ss06', 'zero'",
|
||||
// 控制编辑器是否应呈现垂直字形边距。字形边距最常用于调试。
|
||||
"editor.glyphMargin": true,
|
||||
// 控制是否在编辑器中自动显示内联建议。
|
||||
"editor.inlineSuggest.enabled": true,
|
||||
// 在通过鼠标添加多个光标时使用的修改键。“转到定义”和“打开链接”功能所需的鼠标动作将会相应调整,不与多光标修改键冲突
|
||||
"editor.multiCursorModifier": "ctrlCmd",
|
||||
"editor.tabSize": 2,
|
||||
"editor.fontWeight": 440,
|
||||
"editor.fontFamily": "JetBrains Mono, Menlo, Monaco, 'Courier New', monospace",
|
||||
// 控制是否突出显示可能与基本 ASCII 字符混淆的字符,但当前用户区域设置中常见的字符除外。
|
||||
"editor.unicodeHighlight.ambiguousCharacters": false,
|
||||
// 控制是否突出显示仅保留空格或完全没有宽度的字符。
|
||||
"editor.unicodeHighlight.invisibleCharacters": false,
|
||||
// ESLint要验证的语言
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"vue",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"less",
|
||||
"mpx",
|
||||
"json",
|
||||
"markdown"
|
||||
],
|
||||
// 不显示eslint校验的警告信息
|
||||
"eslint.quiet": true,
|
||||
// eslint保存时只修复有问题的代码
|
||||
"eslint.codeActionsOnSave.mode": "problems",
|
||||
"eslint.format.enable": true,
|
||||
// 文件自动延迟保存
|
||||
"files.autoSaveDelay": 5000,
|
||||
// 默认行尾字符。 LF
|
||||
"files.eol": "\n",
|
||||
// 启用简单文件对话框。启用时,简单文件对话框将替换系统文件对话框。
|
||||
"files.simpleDialog.enable": true,
|
||||
// 同步 Git 存储库前请先进行确认。
|
||||
"git.confirmSync": false,
|
||||
"git.autofetch": true,
|
||||
// 控制如何处理工作区中的松散文件
|
||||
"security.workspace.trust.untrustedFiles": "open",
|
||||
"vetur.validation.template": false,
|
||||
// 编辑器左侧目录树偏移量
|
||||
"workbench.tree.indent": 10,
|
||||
"workbench.iconTheme": "file-icons",
|
||||
"workbench.startupEditor": "newUntitledFile",
|
||||
"workbench.productIconTheme": "icons-carbon",
|
||||
"workbench.colorTheme": "Community Material Theme Palenight High Contrast",
|
||||
// 控制无标题提示应该是编辑器或浮动按钮中的内联文本,还是应该隐藏。
|
||||
"workbench.editor.untitled.hint": "hidden",
|
||||
// 调整对话框窗口的外观。
|
||||
"window.dialogStyle": "custom",
|
||||
// 启用 macOS Sierra 窗口选项卡。请注意,更改在完全重新启动程序后才能生效。同时,开启原生选项卡将禁用自定义标题栏样式。
|
||||
"window.nativeTabs": true, // this is great, macOS only
|
||||
// 调整窗口标题栏的外观。在 Linux 和 Windows 上,此设置也会影响应用程序和上下文菜单的外观。更改需要完全重新启动才能应用。
|
||||
"window.titleBarStyle": "custom",
|
||||
// 控制工作台中活动栏的可见性。
|
||||
"workbench.activityBar.visible": true,
|
||||
// 控制在会话期间显示已打开文件的编辑器是否应在被其他进程删除或重命名时自动关闭。
|
||||
// 禁用此功能将使编辑器在此类事件中保持打开状态。
|
||||
// 请注意,从应用程序内删除将始终关闭编辑器,且永远不会关闭具有未保存更改的编辑器以保留数据。
|
||||
"workbench.editor.closeOnFileDelete": true,
|
||||
// 控制是否在具有未保存更改的编辑器的选项卡上绘制顶部边框。
|
||||
"workbench.editor.highlightModifiedTabs": true,
|
||||
// 控制在工作台中字体的渲染方式。antialiased: 进行像素而不是次像素级别的字体平滑。可能会导致字体整体显示得更细
|
||||
"workbench.fontAliasing": "antialiased",
|
||||
// 控制列表和树是否具有平滑滚动效果。
|
||||
"workbench.list.smoothScrolling": true,
|
||||
// 控制侧边栏和活动栏的位置。它们可以显示在工作台的左侧或右侧。
|
||||
"workbench.sideBar.location": "left",
|
||||
// 控制扩展的自动更新行为。更新是从 Microsoft 联机服务中获取的。
|
||||
// onlyEnabledExtensions: 仅为已启用的扩展自动下载并安装更新。将不会自动更新已禁用的扩展。
|
||||
"extensions.autoUpdate": "onlyEnabledExtensions",
|
||||
// 启用后,将不会显示扩展建议的通知。
|
||||
"extensions.ignoreRecommendations": true,
|
||||
// 控制终端光标是否闪烁。
|
||||
"terminal.integrated.cursorBlinking": true,
|
||||
// 控制终端光标的样式。
|
||||
"terminal.integrated.cursorStyle": "underline",
|
||||
// 要在终端中用于非粗体文本的字体粗细。接受“正常”和“加粗”这两个关键字,或接受 1-1000 之间的数字。
|
||||
"terminal.integrated.fontWeight": "300",
|
||||
// 当必须关闭终端进程(例如当窗口或应用程序关闭时)时,这将确定何时应还原以前的终端会话内容,以及在下次打开工作区时重新创建的进程。
|
||||
"terminal.integrated.persistentSessionReviveProcess": "never",
|
||||
// 控制终端选项卡是否以列表的形式显示在终端的一侧。如果禁用此功能,将改为显示下拉列表。
|
||||
"terminal.integrated.tabs.enabled": true,
|
||||
// 删除时,是否确认
|
||||
"explorer.confirmDelete": false,
|
||||
// 控制在资源管理器内拖放移动文件或文件夹时是否进行确认。
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
// 实验性。控制是否已在资源管理器中启用文件嵌套。文件嵌套允许目录中的相关文件在单个父文件下以可视方式组合在一起。
|
||||
"explorer.experimental.fileNesting.enabled": true,
|
||||
// 实验性。控制是否自动展开文件嵌套。
|
||||
"explorer.experimental.fileNesting.expand": false,
|
||||
// 实验性。控制资源管理器中文件的嵌套。
|
||||
"explorer.experimental.fileNesting.patterns": {
|
||||
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
|
||||
"*.js": "$(capture).js.map, $(capture).min.js, $(capture).d.ts",
|
||||
"*.jsx": "$(capture).js",
|
||||
"*.ts": "$(capture).js, $(capture).*.ts",
|
||||
"*.tsx": "$(capture).ts",
|
||||
"*.vue": "$(capture).*.ts, $(capture).*.js",
|
||||
"index.d.ts": "*.d.ts",
|
||||
"shims.d.ts": "*.d.ts",
|
||||
"*.cpp": "$(capture).hpp, $(capture).h, $(capture).hxx",
|
||||
"*.cxx": "$(capture).hpp, $(capture).h, $(capture).hxx",
|
||||
"*.cc": "$(capture).hpp, $(capture).h, $(capture).hxx",
|
||||
"*.c": "$(capture).h",
|
||||
"go.mod": ".air*, go.sum",
|
||||
"default.nix": "shell.nix",
|
||||
"flake.nix": "flake.lock",
|
||||
"BUILD.bazel": "*.bzl, *.bazel, *.bazelrc, bazel.rc, .bazelignore, .bazelproject, WORKSPACE",
|
||||
"CMakeLists.txt": "*.cmake, *.cmake.in, .cmake-format.yaml, CMakePresets.json",
|
||||
".clang-tidy": ".clang-format",
|
||||
".env": "*.env, .env.*, env.d.ts",
|
||||
"dockerfile": ".dockerignore, dockerfile*",
|
||||
"package.json": ".browserslist*, .circleci*, .codecov, .commitlint*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitpod*, .huskyrc*, .jslint*, .lintstagedrc*, .markdownlint*, .mocha*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .releaserc*, .sentry*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, api-extractor.json, appveyor*, ava.config.*, azure-pipelines*, bower.json, build.config.*, commitlint*, crowdin*, cypress.json, dangerfile*, dprint.json, firebase.json, grunt*, gulp*, jasmine.*, jenkins*, jest.config.*, jsconfig.*, karma*, lerna*, lint-staged*, nest-cli.*, netlify*, nodemon*, nx.*, package-lock.json, playwright.config.*, pm2.*, pnpm*, prettier*, pullapprove*, puppeteer.config.*, renovate*, rollup.config.*, stylelint*, tsconfig.*, tsdoc.*, tslint*, tsup.config.*, turbo*, typedoc*, vercel*, vetur.config.*, vitest.config.*, webpack.config.*, workspace.json, xo.config.*, yarn*",
|
||||
"rush.json": ".browserslist*, .circleci*, .codecov, .commitlint*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitpod*, .huskyrc*, .jslint*, .lintstagedrc*, .markdownlint*, .mocha*, .node-version, .nodemon*, .npm*, .nvmrc, .pm2*, .pnp.*, .pnpm*, .prettier*, .releaserc*, .sentry*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .vscode*, .watchman*, .xo-config*, .yamllint*, .yarnrc*, api-extractor.json, appveyor*, ava.config.*, azure-pipelines*, bower.json, build.config.*, commitlint*, crowdin*, cypress.json, dangerfile*, dprint.json, firebase.json, grunt*, gulp*, jasmine.*, jenkins*, jest.config.*, jsconfig.*, karma*, lerna*, lint-staged*, nest-cli.*, netlify*, nodemon*, nx.*, package-lock.json, playwright.config.*, pm2.*, pnpm*, prettier*, pullapprove*, puppeteer.config.*, renovate*, rollup.config.*, stylelint*, tsconfig.*, tsdoc.*, tslint*, tsup.config.*, turbo*, typedoc*, vercel*, vetur.config.*, vitest.config.*, webpack.config.*, workspace.json, xo.config.*, yarn*",
|
||||
"readme.*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md",
|
||||
"cargo.toml": ".clippy.toml, .rustfmt.toml, cargo.lock, clippy.toml, cross.toml, rust-toolchain.toml, rustfmt.toml",
|
||||
"gemfile": ".ruby-version, gemfile.lock",
|
||||
"composer.json": "composer.lock, phpunit.xml*, psalm*.xml",
|
||||
"vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .htmlnanorc*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, index.html, jasmine.*, jest.config.*, jsconfig.*, karma*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
|
||||
"vue.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .htmlnanorc*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
|
||||
"nuxt.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .htmlnanorc*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
|
||||
"next.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .htmlnanorc*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, next-env.d.ts, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
|
||||
"svelte.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .htmlnanorc*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, mdsvex.config.js, playwright.config.*, postcss.config.*, puppeteer.config.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*",
|
||||
"remix.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .htmlnanorc*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, cssnano.config.*, cypress.json, env.d.ts, htmlnanorc.*, jasmine.*, jest.config.*, jsconfig.*, karma*, playwright.config.*, postcss.config.*, puppeteer.config.*, remix.*, svgo.config.*, tailwind.config.*, tsconfig.*, tsdoc.*, unocss.config.*, vitest.config.*, webpack.config.*, windi.config.*"
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||
}
|
||||
}
|
58
README.md
@ -1,34 +1,36 @@
|
||||
## 目前已有脚手架列表
|
||||
# nicecode-vue-cli
|
||||
|
||||
| 名称 | 说明 | 技术栈 |
|
||||
| ------- | --------------------------- | --------------------- |
|
||||
| nextJs | 基于 React 的服务端渲染方案 | nextJs + axios + antd |
|
||||
| ReactJs | 基于 React 的业务型脚手架 | umiJs + axios + antd |
|
||||
| TaroJs | 基于 React 的多端适配方案 | TaroJs 全家桶 |
|
||||
| Vue | 基于 Vue 的业务型脚手架 | vueJs 全家桶 |
|
||||
| Gulp | 基于 Gulp 的清凉型脚手架 | -- |
|
||||
|
||||
## 快速上手
|
||||
|
||||
### 1. 安装相关依赖
|
||||
|
||||
```js
|
||||
// 推荐
|
||||
yarn global add @nicecode/cli
|
||||
|
||||
// or
|
||||
// npm install @nicecode/cli -g
|
||||
## Project setup
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### 2. 运行命令
|
||||
|
||||
```js
|
||||
// 查看脚手架版本号,是否安装成功
|
||||
nice - V
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
yarn serve
|
||||
```
|
||||
|
||||
### 3. 创建项目
|
||||
|
||||
```js
|
||||
nice create ${项目名称}
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Run your unit tests
|
||||
```
|
||||
yarn test:unit
|
||||
```
|
||||
|
||||
### Run your end-to-end tests
|
||||
```
|
||||
yarn test:e2e
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
|
||||
如果报错,将node版本降低到16以下
|
11
babel.config.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
presets: ["@vue/cli-plugin-babel/preset"],
|
||||
plugins: [
|
||||
[
|
||||
"import", {
|
||||
"libraryName": "@nicecode/tools",
|
||||
"camel2DashComponentName": false
|
||||
}
|
||||
]
|
||||
]
|
||||
};
|
3
cypress.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"pluginsFile": "tests/e2e/plugins/index.js"
|
||||
}
|
6
jest.config.js
Normal file
@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel",
|
||||
transform: {
|
||||
"^.+\\.vue$": "vue-jest",
|
||||
},
|
||||
};
|
52
package.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "nicecode-vue-cli",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"author": "dev <710328466@qq.com>",
|
||||
"scripts": {
|
||||
"start": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build --report",
|
||||
"test:unit": "vue-cli-service test:unit",
|
||||
"test:e2e": "vue-cli-service test:e2e",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.5",
|
||||
"register-service-worker": "^1.7.1",
|
||||
"vue": "^3.0.0",
|
||||
"element-plus": "2.1.7",
|
||||
"vue-class-component": "^8.0.0-0",
|
||||
"vue-router": "^4.0.0-0",
|
||||
"vuex": "^4.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^24.0.19",
|
||||
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
||||
"@typescript-eslint/parser": "^4.18.0",
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-e2e-cypress": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-pwa": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-plugin-typescript": "~4.4.0",
|
||||
"@vue/cli-plugin-unit-jest": "~4.5.0",
|
||||
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0",
|
||||
"@vue/eslint-config-prettier": "^6.0.0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"@vue/test-utils": "^2.0.0-0",
|
||||
"babel-plugin-import": "^1.13.3",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"eslint-plugin-vue": "^7.0.0",
|
||||
"prettier": "^2.2.1",
|
||||
"stylus": "^0.54.7",
|
||||
"stylus-loader": "^3.0.2",
|
||||
"typescript": "~4.1.5",
|
||||
"vue-jest": "^5.0.0-0",
|
||||
"vue-loader-v16": "^16.0.0-beta.5.4",
|
||||
"webpack": "^4.44.2",
|
||||
"webpack-bundle-analyzer": "^4.4.2"
|
||||
}
|
||||
}
|
BIN
public/favicon.ico
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
public/img/icons/android-chrome-192x192.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
public/img/icons/android-chrome-512x512.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
public/img/icons/android-chrome-maskable-192x192.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
public/img/icons/android-chrome-maskable-512x512.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
public/img/icons/apple-touch-icon-120x120.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
public/img/icons/apple-touch-icon-152x152.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
public/img/icons/apple-touch-icon-180x180.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
public/img/icons/apple-touch-icon-60x60.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
public/img/icons/apple-touch-icon-76x76.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
public/img/icons/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
public/img/icons/favicon-16x16.png
Normal file
After Width: | Height: | Size: 799 B |
BIN
public/img/icons/favicon-32x32.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
public/img/icons/msapplication-icon-144x144.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
public/img/icons/mstile-150x150.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
3
public/img/icons/safari-pinned-tab.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.00251 14.9297L0 1.07422H6.14651L8.00251 4.27503L9.84583 1.07422H16L8.00251 14.9297Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 215 B |
17
public/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="https://jzx-h5.oss-cn-hangzhou.aliyuncs.com/logo.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
2
public/robots.txt
Normal file
@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow:
|
17
src/App.vue
Normal file
@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<div id="nav">
|
||||
<router-link to="/">Home</router-link> |
|
||||
<router-link to="/about">About</router-link>
|
||||
</div>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<style lang="stylus">
|
||||
#app
|
||||
font-family Avenir, Helvetica, Arial, sans-serif
|
||||
-webkit-font-smoothing antialiased
|
||||
-moz-osx-font-smoothing grayscale
|
||||
text-align center
|
||||
color #2c3e50
|
||||
margin-top 60px
|
||||
</style>
|
BIN
src/assets/logo.png
Normal file
After Width: | Height: | Size: 11 KiB |
33
src/components/HelloWorld.vue
Normal file
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
{{ msg }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
@Options({
|
||||
props: {
|
||||
msg: String,
|
||||
},
|
||||
})
|
||||
export default class HelloWorld extends Vue {
|
||||
msg!: string;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped lang="stylus">
|
||||
h3
|
||||
margin 20px 0 0
|
||||
|
||||
ul
|
||||
list-style-type none
|
||||
padding 0
|
||||
|
||||
li
|
||||
display inline-block
|
||||
margin 0 10px
|
||||
|
||||
</style>
|
7
src/main.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import "./registerServiceWorker";
|
||||
import router from "./router";
|
||||
import store from "./store";
|
||||
|
||||
createApp(App).use(store).use(router).mount("#app");
|
34
src/registerServiceWorker.ts
Normal file
@ -0,0 +1,34 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import { register } from "register-service-worker";
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||
ready() {
|
||||
console.log(
|
||||
"App is being served from cache by a service worker.\n" +
|
||||
"For more details, visit https://goo.gl/AFskqB"
|
||||
);
|
||||
},
|
||||
registered() {
|
||||
console.log("Service worker has been registered.");
|
||||
},
|
||||
cached() {
|
||||
console.log("Content has been cached for offline use.");
|
||||
},
|
||||
updatefound() {
|
||||
console.log("New content is downloading.");
|
||||
},
|
||||
updated() {
|
||||
console.log("New content is available; please refresh.");
|
||||
},
|
||||
offline() {
|
||||
console.log(
|
||||
"No internet connection found. App is running in offline mode."
|
||||
);
|
||||
},
|
||||
error(error) {
|
||||
console.error("Error during service worker registration:", error);
|
||||
},
|
||||
});
|
||||
}
|
26
src/router/index.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
|
||||
import Home from "../views/Home.vue";
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: "/",
|
||||
name: "Home",
|
||||
component: Home,
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
name: "About",
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () =>
|
||||
import("../views/About.vue"),
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(process.env.BASE_URL),
|
||||
routes,
|
||||
});
|
||||
|
||||
export default router;
|
6
src/shims-vue.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/* eslint-disable */
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
8
src/store/index.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { createStore } from "vuex";
|
||||
|
||||
export default createStore({
|
||||
state: {},
|
||||
mutations: {},
|
||||
actions: {},
|
||||
modules: {},
|
||||
});
|
0
src/styles/index.scss
Normal file
5
src/views/About.vue
Normal file
@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
</template>
|
23
src/views/Home.vue
Normal file
@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<img class="pic" alt="Vue logo" src="@/assets/logo.png" />
|
||||
<HelloWorld msg=" Hi, 我是 dev" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
import HelloWorld from "@/components/HelloWorld.vue";
|
||||
|
||||
@Options({
|
||||
components: {
|
||||
HelloWorld,
|
||||
},
|
||||
})
|
||||
export default class Home extends Vue {
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
.pic
|
||||
width: 100%
|
||||
</style>
|
10
tests/e2e/.eslintrc.js
Normal file
@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
plugins: ["cypress"],
|
||||
env: {
|
||||
mocha: true,
|
||||
"cypress/globals": true,
|
||||
},
|
||||
rules: {
|
||||
strict: "off",
|
||||
},
|
||||
};
|
25
tests/e2e/plugins/index.js
Normal file
@ -0,0 +1,25 @@
|
||||
/* eslint-disable arrow-body-style */
|
||||
// https://docs.cypress.io/guides/guides/plugins-guide.html
|
||||
|
||||
// if you need a custom webpack configuration you can uncomment the following import
|
||||
// and then use the `file:preprocessor` event
|
||||
// as explained in the cypress docs
|
||||
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
|
||||
|
||||
// /* eslint-disable import/no-extraneous-dependencies, global-require */
|
||||
// const webpack = require('@cypress/webpack-preprocessor')
|
||||
|
||||
module.exports = (on, config) => {
|
||||
// on('file:preprocessor', webpack({
|
||||
// webpackOptions: require('@vue/cli-service/webpack.config'),
|
||||
// watchOptions: {}
|
||||
// }))
|
||||
|
||||
return Object.assign({}, config, {
|
||||
fixturesFolder: "tests/e2e/fixtures",
|
||||
integrationFolder: "tests/e2e/specs",
|
||||
screenshotsFolder: "tests/e2e/screenshots",
|
||||
videosFolder: "tests/e2e/videos",
|
||||
supportFile: "tests/e2e/support/index.js",
|
||||
});
|
||||
};
|
8
tests/e2e/specs/test.js
Normal file
@ -0,0 +1,8 @@
|
||||
// https://docs.cypress.io/api/introduction/api.html
|
||||
|
||||
describe("My First Test", () => {
|
||||
it("Visits the app root url", () => {
|
||||
cy.visit("/");
|
||||
cy.contains("h1", "Welcome to Your Vue.js + TypeScript App");
|
||||
});
|
||||
});
|
25
tests/e2e/support/commands.js
Normal file
@ -0,0 +1,25 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
20
tests/e2e/support/index.js
Normal file
@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import "./commands";
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
12
tests/unit/example.spec.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { shallowMount } from "@vue/test-utils";
|
||||
import HelloWorld from "@/components/HelloWorld.vue";
|
||||
|
||||
describe("HelloWorld.vue", () => {
|
||||
it("renders props.msg when passed", () => {
|
||||
const msg = "new message";
|
||||
const wrapper = shallowMount(HelloWorld, {
|
||||
props: { msg },
|
||||
});
|
||||
expect(wrapper.text()).toMatch(msg);
|
||||
});
|
||||
});
|
41
tsconfig.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"importHelpers": true,
|
||||
"moduleResolution": "node",
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
"webpack-env",
|
||||
"jest"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.vue",
|
||||
"tests/**/*.ts",
|
||||
"tests/**/*.tsx"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
7
vue.config.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
chainWebpack: config => {
|
||||
config
|
||||
.plugin('webpack-bundle-analyzer')
|
||||
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
|
||||
}
|
||||
}
|