create-bc-app 1.1.4 → 1.1.5

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 (40) hide show
  1. package/package.json +13 -13
  2. package/template-docs-vitepress/_gitignore +25 -0
  3. package/template-docs-vuepress/_gitignore +26 -0
  4. package/template-laserlib/.gitlab-ci.yml +1 -1
  5. package/template-laserlib/package.json +2 -2
  6. package/template-laserlib/tsconfig.json +3 -3
  7. package/template-laserlib/vite.config.ts +9 -4
  8. package/template-protocut/.eslintrc.cjs +203 -0
  9. package/template-protocut/.gitlab-ci.yml +41 -0
  10. package/template-protocut/README.md +17 -0
  11. package/template-protocut/_gitignore +24 -0
  12. package/template-protocut/image.png +0 -0
  13. package/template-protocut/index.html +13 -0
  14. package/template-protocut/package-lock.json +4917 -0
  15. package/template-protocut/package.json +38 -0
  16. package/template-protocut/public/vite.svg +1 -0
  17. package/template-protocut/src/App.vue +12 -0
  18. package/template-protocut/src/assets/vue.svg +1 -0
  19. package/template-protocut/src/components/Example.vue +36 -0
  20. package/template-protocut/src/style.css +5 -0
  21. package/template-protocut/src/utils/plugins/watchNodeModules.js +24 -0
  22. package/template-protocut/src/vite-env.d.ts +1 -0
  23. package/template-protocut/template/Home.handlebars +145 -0
  24. package/template-protocut/template/main.handlebars +49 -0
  25. package/template-protocut/test/App.test.ts +16 -0
  26. package/template-protocut/test/Example.test.ts +21 -0
  27. package/template-protocut/tsconfig.app.json +27 -0
  28. package/template-protocut/tsconfig.json +33 -0
  29. package/template-protocut/tsconfig.node.json +11 -0
  30. package/template-protocut/vite-env.d.ts +15 -0
  31. package/template-protocut/vite.config.ts +55 -0
  32. package/template-protocut/window.d.ts +6 -0
  33. package/template-vue-js/.gitlab-ci.yml +1 -1
  34. package/template-vue-ts/.gitlab-ci.yml +1 -1
  35. package/template-vue-ts/_gitignore +24 -0
  36. package/template-vue-ts/vite.config.ts +27 -9
  37. /package/{template-vue-ts/.gitignore → template-laserlib/_gitignore} +0 -0
  38. /package/template-laserlib/{packages → views}/main-page/index.ts +0 -0
  39. /package/template-laserlib/{packages → views}/main-page/index.vue +0 -0
  40. /package/template-vue-js/{.gitignore → _gitignore} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bc-app",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "",
5
5
  "bin": "index.js",
6
6
  "type": "module",
@@ -24,16 +24,16 @@
24
24
  "registry": "https://registry.npmjs.org"
25
25
  },
26
26
  "files": [
27
- "template-vue-js/.gitignore",
28
- "template-vue-js/",
29
- "template-vue-ts/",
30
- "template-protocut-2d/.gitignore",
31
- "template-protocut-2d/",
32
- "template-docs-vitepress/",
33
- "template-docs-vuepress/",
34
- "template-laserlib/",
35
- "template-vue-ts/.gitignore",
36
- "dist/",
37
- "index.js"
38
- ]
27
+ "template-docs-vitepress",
28
+ "template-docs-vuepress",
29
+ "template-laserlib",
30
+ "template-protocut",
31
+ "template-vue-js",
32
+ "template-vue-ts",
33
+ "index.js",
34
+ "dist"
35
+ ],
36
+ "engines": {
37
+ "node": "^18.0.0"
38
+ }
39
39
  }
@@ -0,0 +1,25 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
25
+ cache
@@ -0,0 +1,26 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
25
+ .cache
26
+ .temp
@@ -33,7 +33,7 @@ notify-fail:
33
33
  - node_modules/
34
34
  script:
35
35
  - >
36
- curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=需要找企业微信管理员或斌斌'
36
+ curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=需要找企业微信管理员'
37
37
  -H 'Content-Type: application/json'
38
38
  -d "{\"msgtype\":\"markdown\",\"markdown\":{\"content\":\"项目构建结果:<font color=\\"warning\\">失败</font>\n>本次构建由: $GITLAB_USER_NAME 触发\n>项目名称:$CI_PROJECT_NAME\n>提交号:$CI_COMMIT_SHA\n>提交日志:$CI_COMMIT_MESSAGE\n>构建分支: $CI_COMMIT_REF_NAME\n>流水线地址:[$CI_PIPELINE_URL]($CI_PIPELINE_URL)\"}}"
39
39
  when: on_failure
@@ -6,8 +6,8 @@
6
6
  "scripts": {
7
7
  "dev": "vite --mode @fsdev",
8
8
  "lib": "vue-tsc && vite build",
9
- "lib:test": "rimraf lib && vite build --mode @fsdev",
10
- "lib:prod": "rimraf lib && vite build --mode @fscut",
9
+ "lib:test": "rimraf lib && vite build --mode test",
10
+ "lib:prod": "rimraf lib && vite build --mode prod",
11
11
  "watch": "set NODE_ENV=development vue-tsc && vite build --mode development --watch --emptyOutDir",
12
12
  "watch:yalc": "nodemon --watch lib/ --verbose -x yalc publish --push",
13
13
  "preview": "vite preview",
@@ -33,9 +33,9 @@
33
33
  "data/**/*.d.ts",
34
34
  "model/**/*.ts",
35
35
  "model/**/*.d.ts",
36
- "packages/**/index.ts",
37
- "packages/**/**.vue",
38
- "packages/**/**.ts",
36
+ "views/**/index.ts",
37
+ "views/**/**.vue",
38
+ "views/**/**.ts",
39
39
  "src/index.ts",
40
40
  "vite-env.d.ts",
41
41
  "types/index.d.ts"
@@ -8,19 +8,24 @@ import { resolve } from 'path'
8
8
  const __dirname = resolve()
9
9
 
10
10
  // https://vitejs.dev/config/
11
- export default ({ mode }) => {
11
+ export default ({ mode }:{mode: string}) => {
12
+ let pkg = mode === 'test' ? '@fsdev' : '@fscut'
12
13
  return defineConfig({
13
14
  plugins: [vue(), dts({ rollupTypes: true })],
14
15
  resolve: {
15
16
  alias: {
16
17
  '@': resolve(__dirname, 'src'),
17
- 'packages': resolve(__dirname, 'packages'),
18
- '@fs': path.resolve(__dirname, `node_modules/${mode}`),
18
+ '@fs/bochui': path.resolve(__dirname, `node_modules/${pkg}/bochui`),
19
+ '@fs/utils': path.resolve(__dirname, `node_modules/${pkg}/fs-utils`),
20
+ '@fs/fscadweb': path.resolve(__dirname, `node_modules/${pkg}/fscadweb`),
21
+ '@fs/sandbox': path.resolve(__dirname, `node_modules/${pkg}/assemblysandbox`),
22
+ '@fs/sandbox/assets': path.resolve(__dirname, `node_modules/${pkg}/assemblysandbox/lib/assets`),
23
+ '@fs/webcad-platform': path.resolve(__dirname, `node_modules/${pkg}/webcad-platform`),
19
24
  }
20
25
  },
21
26
  build: {
22
27
  rollupOptions: {
23
- external: ['vue', '@fsdev/bochui', 'element-plus']
28
+ external: ['vue', '@fs/bochui', '@fs/utils', '@fs/fscadweb', '@fs/sandbox', '@fs/sandbox/assets', '@fs/webcad-platform']
24
29
  },
25
30
  outDir: 'lib',
26
31
  lib: {
@@ -0,0 +1,203 @@
1
+ /* eslint-env node */
2
+ require('@rushstack/eslint-patch/modern-module-resolution')
3
+
4
+ module.exports = {
5
+ root: true,
6
+ extends: [
7
+ 'plugin:vue/recommended',
8
+ 'plugin:vue/vue3-essential',
9
+ 'plugin:vue/vue3-strongly-recommended',
10
+ 'plugin:@typescript-eslint/recommended',
11
+ 'eslint:recommended'
12
+ ],
13
+ ignorePatterns: ['sdk/'], globals: {
14
+ 'process': true
15
+ },
16
+ parser: 'vue-eslint-parser',
17
+ parserOptions: {
18
+ ecmaVersion: 'latest',
19
+ parser: '@typescript-eslint/parser'
20
+ },
21
+ rules: {
22
+ '@typescript-eslint/no-unused-vars': 'error',
23
+ '@typescript-eslint/no-explicit-any': 'off',
24
+ '@typescript-eslint/ban-ts-comment': 'off',
25
+ 'vue/multi-word-component-names': ['off'],
26
+ 'vue/no-v-for-template-key': 'off',
27
+ 'vue/no-multiple-template-root': 'off',
28
+ 'vue/no-v-model-argument': 'off',
29
+ 'vue/max-attributes-per-line': ['error', {
30
+ 'singleline': {
31
+ 'max': 3
32
+ },
33
+ 'multiline': {
34
+ 'max': 3
35
+ }
36
+ }],
37
+ 'accessor-pairs': 2,
38
+ 'arrow-spacing': [2, {
39
+ 'before': true,
40
+ 'after': true
41
+ }],
42
+ 'block-spacing': [2, 'always'],
43
+ 'brace-style': [2, '1tbs', {
44
+ 'allowSingleLine': true
45
+ }],
46
+ 'camelcase': [2, {
47
+ 'properties': 'always'
48
+ }],
49
+ 'comma-dangle': [2, 'never'],
50
+ 'comma-spacing': [2, {
51
+ 'before': false,
52
+ 'after': true
53
+ }],
54
+ 'comma-style': [2, 'last'],
55
+ 'constructor-super': 2,
56
+ 'curly': [2, 'multi-line'],
57
+ 'dot-location': [2, 'property'],
58
+ 'eol-last': 2,
59
+ 'eqeqeq': [2, 'allow-null'],
60
+ 'generator-star-spacing': [2, {
61
+ 'before': true,
62
+ 'after': true
63
+ }],
64
+ 'handle-callback-err': [2, '^(err|error)$'],
65
+ 'indent': [1, 2, {
66
+ 'SwitchCase': 1
67
+ }],
68
+ 'jsx-quotes': [2, 'prefer-single'],
69
+ 'key-spacing': [2, {
70
+ 'beforeColon': false,
71
+ 'afterColon': true
72
+ }],
73
+ 'keyword-spacing': [2, {
74
+ 'before': true,
75
+ 'after': true
76
+ }],
77
+ 'new-cap': [2, {
78
+ 'newIsCap': true,
79
+ 'capIsNew': false
80
+ }],
81
+ 'new-parens': 2,
82
+ 'no-array-constructor': 2,
83
+ 'no-caller': 2,
84
+ 'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
85
+ 'no-class-assign': 2,
86
+ 'no-cond-assign': 2,
87
+ 'no-const-assign': 2,
88
+ 'no-control-regex': 0,
89
+ 'no-delete-var': 2,
90
+ 'no-dupe-args': 2,
91
+ 'no-dupe-class-members': 2,
92
+ 'no-dupe-keys': 2,
93
+ 'no-duplicate-case': 2,
94
+ 'no-empty-character-class': 2,
95
+ 'no-empty-pattern': 2,
96
+ 'no-eval': 2,
97
+ 'no-ex-assign': 2,
98
+ 'no-extend-native': 2,
99
+ 'no-extra-bind': 2,
100
+ 'no-extra-boolean-cast': 2,
101
+ 'no-extra-parens': [2, 'functions'],
102
+ 'no-fallthrough': 2,
103
+ 'no-floating-decimal': 2,
104
+ 'no-func-assign': 2,
105
+ 'no-implied-eval': 2,
106
+ 'no-inner-declarations': [2, 'functions'],
107
+ 'no-invalid-regexp': 2,
108
+ 'no-irregular-whitespace': 2,
109
+ 'no-iterator': 2,
110
+ 'no-label-var': 2,
111
+ 'no-labels': [2, {
112
+ 'allowLoop': false,
113
+ 'allowSwitch': false
114
+ }],
115
+ 'no-lone-blocks': 2,
116
+ 'no-mixed-spaces-and-tabs': 2,
117
+ 'no-multi-spaces': 2,
118
+ 'no-multi-str': 2,
119
+ 'no-multiple-empty-lines': [2, {
120
+ 'max': 1
121
+ }],
122
+ 'no-native-reassign': 2,
123
+ 'no-negated-in-lhs': 2,
124
+ 'no-new-object': 2,
125
+ 'no-new-require': 2,
126
+ 'no-new-symbol': 2,
127
+ 'no-new-wrappers': 2,
128
+ 'no-obj-calls': 2,
129
+ 'no-octal': 2,
130
+ 'no-octal-escape': 2,
131
+ 'no-path-concat': 2,
132
+ 'no-proto': 2,
133
+ 'no-redeclare': 2,
134
+ 'no-regex-spaces': 2,
135
+ 'no-return-assign': [2, 'except-parens'],
136
+ 'no-self-assign': 2,
137
+ 'no-self-compare': 2,
138
+ 'no-sequences': 2,
139
+ 'no-shadow-restricted-names': 2,
140
+ 'no-spaced-func': 2,
141
+ 'no-sparse-arrays': 2,
142
+ 'no-this-before-super': 2,
143
+ 'no-throw-literal': 2,
144
+ 'no-trailing-spaces': 2,
145
+ 'no-undef': 2,
146
+ 'no-undef-init': 2,
147
+ 'no-unexpected-multiline': 2,
148
+ 'no-unmodified-loop-condition': 2,
149
+ 'no-unneeded-ternary': [2, {
150
+ 'defaultAssignment': false
151
+ }],
152
+ 'no-unreachable': 2,
153
+ 'no-unsafe-finally': 2,
154
+ 'no-unused-vars': 'off',
155
+ 'no-useless-call': 2,
156
+ 'no-useless-computed-key': 2,
157
+ 'no-useless-constructor': 2,
158
+ 'no-useless-escape': 1,
159
+ 'no-whitespace-before-property': 2,
160
+ 'no-with': 2,
161
+ 'one-var': [2, {
162
+ 'initialized': 'never'
163
+ }],
164
+ 'operator-linebreak': [2, 'after', {
165
+ 'overrides': {
166
+ '?': 'before',
167
+ ':': 'before'
168
+ }
169
+ }],
170
+ 'padded-blocks': [2, 'never'],
171
+ 'quotes': [1, 'single', {
172
+ 'avoidEscape': true,
173
+ 'allowTemplateLiterals': true
174
+ }],
175
+ 'semi': [2, 'never'],
176
+ 'semi-spacing': [2, {
177
+ 'before': false,
178
+ 'after': true
179
+ }],
180
+ 'space-before-blocks': [2, 'always'],
181
+ 'space-in-parens': [2, 'never'],
182
+ 'space-infix-ops': 2,
183
+ 'space-unary-ops': [2, {
184
+ 'words': true,
185
+ 'nonwords': false
186
+ }],
187
+ 'spaced-comment': [2, 'always', {
188
+ 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
189
+ }],
190
+ 'template-curly-spacing': [2, 'never'],
191
+ 'use-isnan': 2,
192
+ 'valid-typeof': 2,
193
+ 'wrap-iife': [2, 'any'],
194
+ 'yield-star-spacing': [2, 'both'],
195
+ 'yoda': [2, 'never'],
196
+ 'prefer-const': 0,
197
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
198
+ 'object-curly-spacing': [2, 'always', {
199
+ objectsInObjects: false
200
+ }],
201
+ 'array-bracket-spacing': [2, 'never']
202
+ }
203
+ }
@@ -0,0 +1,41 @@
1
+ stages:
2
+ - install
3
+ - eslint
4
+ - notify
5
+
6
+ cache:
7
+ key: '$CI_COMMIT_REF_SLUG'
8
+
9
+ install:
10
+ stage: install
11
+ cache:
12
+ paths:
13
+ - node_modules/
14
+ script:
15
+ - cnpm install
16
+ tags:
17
+ - sonar
18
+
19
+ eslint:
20
+ stage: eslint
21
+ cache:
22
+ paths:
23
+ - node_modules/
24
+ script:
25
+ - npm run lint
26
+ tags:
27
+ - sonar
28
+
29
+ notify-fail:
30
+ stage: notify
31
+ cache:
32
+ paths:
33
+ - node_modules/
34
+ script:
35
+ - >
36
+ curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx'
37
+ -H 'Content-Type: application/json'
38
+ -d "{\"msgtype\":\"markdown\",\"markdown\":{\"content\":\"项目构建结果:<font color=\\"warning\\">失败</font>\n>本次构建由: $GITLAB_USER_NAME 触发\n>项目名称:$CI_PROJECT_NAME\n>提交号:$CI_COMMIT_SHA\n>提交日志:$CI_COMMIT_MESSAGE\n>构建分支: $CI_COMMIT_REF_NAME\n>流水线地址:[$CI_PIPELINE_URL]($CI_PIPELINE_URL)\"}}"
39
+ when: on_failure
40
+ tags:
41
+ - sonar
@@ -0,0 +1,17 @@
1
+ # 这是一个 Vue 3 + TypeScript + Vite 的示例项目
2
+ 该项目已经配置:
3
+ - eslint
4
+ - less
5
+ - bochui
6
+ - eslint gitlab 代码检查流水线
7
+ - 单元测试
8
+ - vitest 官方文档
9
+ ![alt text](image.png)
10
+
11
+
12
+ 你可能需要配置:
13
+ - vue-router
14
+ - pinia
15
+ - fs-utils
16
+ - axios
17
+ - 拉下代码,修改仓库地址 git remote set-url origin 项目远程仓库地址
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
Binary file
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>example project</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>