@weig_3078/cli-demo 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/package.json +18 -4
  2. package/app/.eslintrc.cjs +0 -42
  3. package/app/.prettierrc.json +0 -8
  4. package/app/.vscode/extensions.json +0 -7
  5. package/app/README.md +0 -91
  6. package/app/cypress/e2e/example.cy.ts +0 -8
  7. package/app/cypress/e2e/tsconfig.json +0 -8
  8. package/app/cypress/fixtures/example.json +0 -5
  9. package/app/cypress/support/commands.ts +0 -39
  10. package/app/cypress/support/e2e.ts +0 -20
  11. package/app/cypress.config.ts +0 -8
  12. package/app/env.d.ts +0 -1
  13. package/app/index.html +0 -13
  14. package/app/package.json +0 -48
  15. package/app/pnpm-lock.yaml +0 -4438
  16. package/app/public/favicon.ico +0 -0
  17. package/app/public/index.html +0 -20
  18. package/app/public/vue.js +0 -11909
  19. package/app/src/App.vue +0 -63
  20. package/app/src/assets/base.css +0 -86
  21. package/app/src/assets/logo.svg +0 -1
  22. package/app/src/assets/main.css +0 -32
  23. package/app/src/components/HelloWorld.vue +0 -36
  24. package/app/src/components/Rate.vue +0 -12
  25. package/app/src/components/Rate1.vue +0 -23
  26. package/app/src/components/Rate2.vue +0 -60
  27. package/app/src/components/TheWelcome.vue +0 -88
  28. package/app/src/components/Watermark.vue +0 -74
  29. package/app/src/components/WelcomeItem.vue +0 -87
  30. package/app/src/components/__tests__/HelloWorld.spec.ts +0 -11
  31. package/app/src/components/icons/IconCommunity.vue +0 -7
  32. package/app/src/components/icons/IconDocumentation.vue +0 -7
  33. package/app/src/components/icons/IconEcosystem.vue +0 -7
  34. package/app/src/components/icons/IconSupport.vue +0 -7
  35. package/app/src/components/icons/IconTooling.vue +0 -19
  36. package/app/src/components/useWaterMarkBg.ts +0 -32
  37. package/app/src/main.ts +0 -14
  38. package/app/src/router/index.ts +0 -35
  39. package/app/src/stores/counter.ts +0 -12
  40. package/app/src/views/AboutView.vue +0 -92
  41. package/app/src/views/ChunkView.vue +0 -45
  42. package/app/src/views/HomeView.vue +0 -13
  43. package/app/src/views/RateView.vue +0 -24
  44. package/app/test/a.js +0 -16
  45. package/app/tsconfig.app.json +0 -14
  46. package/app/tsconfig.json +0 -17
  47. package/app/tsconfig.node.json +0 -19
  48. package/app/tsconfig.vitest.json +0 -11
  49. package/app/vite.config.ts +0 -16
  50. package/app/vitest.config.ts +0 -14
  51. package/app/z/346/226/207/346/241/243//345/255/246/344/271/240/347/274/226/347/250/213/346/234/254/350/264/250.md +0 -129
  52. package/app/z/346/226/207/346/241/243//346/235/203/351/231/220/346/216/247/345/210/266.md +0 -342
package/package.json CHANGED
@@ -1,12 +1,26 @@
1
1
  {
2
2
  "name": "@weig_3078/cli-demo",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "脚手架 demo",
5
5
  "private": false,
6
- "main": "index.js",
7
6
  "bin": {
8
- "mvc": "./dist/mvc.js"
7
+ "mvc": "./bin/mvc.js"
9
8
  },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "files": [
13
+ "bin/",
14
+ "lib/",
15
+ "dist/",
16
+ "ejs-demo.js",
17
+ "scripts/",
18
+ ".eslintignore",
19
+ ".eslintrc",
20
+ "package.json",
21
+ "rollup.config.cjs",
22
+ "README.md"
23
+ ],
10
24
  "scripts": {
11
25
  "build": "rollup -c rollup.config.cjs",
12
26
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -26,6 +40,7 @@
26
40
  "dependencies": {
27
41
  "chalk": "^4.1.2",
28
42
  "commander": "^7.0.0",
43
+ "deepmerge": "^4.3.1",
29
44
  "download-git-repo": "^3.0.2",
30
45
  "ejs": "^3.1.6",
31
46
  "execa": "^5.0.0",
@@ -43,7 +58,6 @@
43
58
  "@rollup/plugin-commonjs": "^29.0.2",
44
59
  "@rollup/plugin-json": "^6.1.0",
45
60
  "@rollup/plugin-node-resolve": "^16.0.3",
46
- "deepmerge": "^4.3.1",
47
61
  "eslint": "^7.20.0",
48
62
  "eslint-config-airbnb-base": "^14.2.1",
49
63
  "eslint-plugin-import": "^2.22.1",
package/app/.eslintrc.cjs DELETED
@@ -1,42 +0,0 @@
1
- /* eslint-env node */
2
- require('@rushstack/eslint-patch/modern-module-resolution')
3
-
4
- module.exports = {
5
- root: true,
6
- 'extends': [
7
- 'plugin:vue/vue3-essential',
8
- 'eslint:recommended',
9
- '@vue/eslint-config-typescript',
10
- '@vue/eslint-config-prettier/skip-formatting'
11
- ],
12
- overrides: [
13
- {
14
- files: [
15
- 'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
16
- 'cypress/support/**/*.{js,ts,jsx,tsx}'
17
- ],
18
- 'extends': [
19
- 'plugin:cypress/recommended'
20
- ]
21
- }
22
- ],
23
- parserOptions: {
24
- ecmaVersion: 'latest'
25
- },
26
- rules: {
27
- 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
28
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
29
- 'vue/html-indent': ['error', 2],
30
- 'vue/max-attributes-per-line': [
31
- 'warn',
32
- {
33
- singleline: 1,
34
- multiline: {
35
- max: 1,
36
- allowFirstLine: true
37
- }
38
- }
39
- ]
40
-
41
- }
42
- }
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/prettierrc",
3
- "semi": true,
4
- "tabWidth": 4,
5
- "singleQuote": true,
6
- "printWidth": 100,
7
- "trailingComma": "none"
8
- }
@@ -1,7 +0,0 @@
1
- {
2
- "recommendations": [
3
- "Vue.volar",
4
- "dbaeumer.vscode-eslint",
5
- "esbenp.prettier-vscode"
6
- ]
7
- }
package/app/README.md DELETED
@@ -1,91 +0,0 @@
1
- # vite-base
2
-
3
- This template should help get you started developing with Vue 3 in Vite.
4
-
5
- ## Recommended IDE Setup
6
-
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8
-
9
- ## Type Support for `.vue` Imports in TS
10
-
11
- TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
12
-
13
- ## Customize configuration
14
-
15
- See [Vite Configuration Reference](https://vitejs.dev/config/).
16
-
17
- ## Project Setup
18
-
19
- ```sh
20
- pnpm install
21
- ```
22
-
23
- ### Compile and Hot-Reload for Development
24
-
25
- ```sh
26
- pnpm dev
27
- ```
28
-
29
- ### Type-Check, Compile and Minify for Production
30
-
31
- ```sh
32
- pnpm build
33
- ```
34
-
35
- ### Run Unit Tests with [Vitest](https://vitest.dev/)
36
-
37
- ```sh
38
- pnpm test:unit
39
- ```
40
-
41
- ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
42
-
43
- ```sh
44
- pnpm test:e2e:dev
45
- ```
46
-
47
- This runs the end-to-end tests against the Vite development server.
48
- It is much faster than the production build.
49
-
50
- But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
51
-
52
- ```sh
53
- pnpm build
54
- pnpm test:e2e
55
- ```
56
-
57
- ### Lint with [ESLint](https://eslint.org/)
58
-
59
- ```sh
60
- pnpm lint
61
- ```
62
-
63
-
64
-
65
- requestAnimationFrame 主要设计用于在浏览器绘制新帧之前执行动画或视觉上的更新,
66
- 以确保页面的平滑渲染。它的回调函数通常每秒调用60次,与显示器的刷新率同步,这样可以创建流畅的动画效果,减少视觉上的卡顿和闪烁。
67
-
68
- 如果你使用 requestAnimationFrame 来进行分片计算,你必须注意以下几点:
69
-
70
- 时间敏感性:
71
-
72
- requestAnimationFrame 是为了与浏览器的绘制周期同步,如果在每个绘制周期内进行复杂的计算,可能会使得计算影响到帧的渲染时间,导致动画卡顿或延迟。
73
- 计算干扰渲染:
74
- 因为 requestAnimationFrame 通常用于绘制更新,如果你在这个回调中进行长时间的计算,它会延迟浏览器的渲染,导致用户界面更新不够及时,用户体验受到负面影响。
75
- 优先级问题:
76
- requestAnimationFrame 有助于确保渲染操作的优先级,但并不适合后台计算或优先级较低的任务。当页面需要渲染动画或响应用户输入时,你不想这些操作被计算任务所阻塞。
77
- 因此,对于需要长时间运行的计算任务,更好的选择是 requestIdleCallback,因为它允许你在浏览器闲置时执行任务,而不是在每个动画帧中。requestIdleCallback 为非紧急任务提供了一个时机,不会妨碍页面的流畅渲染和用户的交互反应。
78
-
79
- 对于运算量巨大的任务,最合适的方法是使用 Web Workers,因为它们在后台线程中执行,完全不影响主线程的渲染和交互操作。如果无法使用 Web Workers,可以采用 requestIdleCallback 来在主线程的空闲时段进行分片处理。
80
-
81
-
82
-
83
-
84
-
85
- ### 大文件的分片处理机制
86
- 当然在面试中,面试官也会常常问到白屏如何优化的问题当然在面试中,面试官也会常常问到白屏如何优化的问题
87
-
88
- https://juejin.cn/post/7249907952156721209
89
-
90
- ### 如何开发一个组件 五星评分组件
91
- https://juejin.cn/post/7389925417786802213
@@ -1,8 +0,0 @@
1
- // https://on.cypress.io/api
2
-
3
- describe('My First Test', () => {
4
- it('visits the app root url', () => {
5
- cy.visit('/')
6
- cy.contains('h1', 'You did it!')
7
- })
8
- })
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@vue/tsconfig/tsconfig.dom.json",
3
- "include": ["./**/*", "../support/**/*"],
4
- "compilerOptions": {
5
- "isolatedModules": false,
6
- "types": ["cypress"]
7
- }
8
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "Using fixtures to represent data",
3
- "email": "hello@cypress.io",
4
- "body": "Fixtures are a great way to mock data for responses to routes"
5
- }
@@ -1,39 +0,0 @@
1
- /// <reference types="cypress" />
2
- // ***********************************************
3
- // This example commands.ts shows you how to
4
- // create various custom commands and overwrite
5
- // existing commands.
6
- //
7
- // For more comprehensive examples of custom
8
- // commands please read more here:
9
- // https://on.cypress.io/custom-commands
10
- // ***********************************************
11
- //
12
- //
13
- // -- This is a parent command --
14
- // Cypress.Commands.add('login', (email, password) => { ... })
15
- //
16
- //
17
- // -- This is a child command --
18
- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19
- //
20
- //
21
- // -- This is a dual command --
22
- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23
- //
24
- //
25
- // -- This will overwrite an existing command --
26
- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27
- //
28
- // declare global {
29
- // namespace Cypress {
30
- // interface Chainable {
31
- // login(email: string, password: string): Chainable<void>
32
- // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33
- // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
- // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35
- // }
36
- // }
37
- // }
38
-
39
- export {}
@@ -1,20 +0,0 @@
1
- // ***********************************************************
2
- // This example support/index.js is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
18
-
19
- // Alternatively you can use CommonJS syntax:
20
- // require('./commands')
@@ -1,8 +0,0 @@
1
- import { defineConfig } from 'cypress'
2
-
3
- export default defineConfig({
4
- e2e: {
5
- specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
6
- baseUrl: 'http://localhost:4173'
7
- }
8
- })
package/app/env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/app/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <link rel="icon" href="/favicon.ico">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Vite App</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/main.ts"></script>
12
- </body>
13
- </html>
package/app/package.json DELETED
@@ -1,48 +0,0 @@
1
- {
2
- "name": "vite-base",
3
- "version": "0.0.0",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "vite build",
9
- "preview": "vite preview",
10
- "test:unit": "vitest",
11
- "test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
12
- "test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
13
- "build-only": "vite build",
14
- "type-check": "vue-tsc --build --force",
15
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
16
- "format": "prettier --write src/"
17
- },
18
- "dependencies": {
19
- "lodash": "^4.17.21",
20
- "lodash-es": "^4.17.21",
21
- "pinia": "^2.1.7",
22
- "vue": "^3.4.29",
23
- "vue-router": "^4.3.3"
24
- },
25
- "devDependencies": {
26
- "@rushstack/eslint-patch": "^1.8.0",
27
- "@tsconfig/node20": "^20.1.4",
28
- "@types/jsdom": "^21.1.7",
29
- "@types/node": "^20.14.5",
30
- "@vitejs/plugin-vue": "^5.0.5",
31
- "@vue/eslint-config-prettier": "^9.0.0",
32
- "@vue/eslint-config-typescript": "^13.0.0",
33
- "@vue/test-utils": "^2.4.6",
34
- "@vue/tsconfig": "^0.5.1",
35
- "cypress": "^13.12.0",
36
- "eslint": "^8.57.0",
37
- "eslint-plugin-cypress": "^3.3.0",
38
- "eslint-plugin-vue": "^9.23.0",
39
- "jsdom": "^24.1.0",
40
- "npm-run-all2": "^6.2.0",
41
- "prettier": "^3.2.5",
42
- "start-server-and-test": "^2.0.4",
43
- "typescript": "~5.4.0",
44
- "vite": "^5.3.1",
45
- "vitest": "^1.6.0",
46
- "vue-tsc": "^2.0.21"
47
- }
48
- }