@oinone/cli 7.2.1

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 (206) hide show
  1. package/README.md +115 -0
  2. package/README_zh-CN.md +115 -0
  3. package/bin/cli.js +429 -0
  4. package/package.json +25 -0
  5. package/template-6.4.0-community/.eslintignore +5 -0
  6. package/template-6.4.0-community/.eslintrc.json +72 -0
  7. package/template-6.4.0-community/.prettierrc.json +8 -0
  8. package/template-6.4.0-community/README.md +59 -0
  9. package/template-6.4.0-community/_package.json +47 -0
  10. package/template-6.4.0-community/gitignore +58 -0
  11. package/template-6.4.0-community/lerna.json +12 -0
  12. package/template-6.4.0-community/npmrc +3 -0
  13. package/template-6.4.0-community/packages/ss-admin-widget/index.ts +1 -0
  14. package/template-6.4.0-community/packages/ss-admin-widget/package.json +25 -0
  15. package/template-6.4.0-community/packages/ss-admin-widget/rollup.config.js +73 -0
  16. package/template-6.4.0-community/packages/ss-admin-widget/scripts/postpublish.js +13 -0
  17. package/template-6.4.0-community/packages/ss-admin-widget/scripts/prepublish-only.js +24 -0
  18. package/template-6.4.0-community/packages/ss-admin-widget/src/index.ts +1 -0
  19. package/template-6.4.0-community/packages/ss-admin-widget/src/shim-translate.d.ts +10 -0
  20. package/template-6.4.0-community/packages/ss-admin-widget/src/shim-vue.d.ts +6 -0
  21. package/template-6.4.0-community/packages/ss-admin-widget/tsconfig.json +45 -0
  22. package/template-6.4.0-community/packages/ss-boot/.env +1 -0
  23. package/template-6.4.0-community/packages/ss-boot/.env.example +6 -0
  24. package/template-6.4.0-community/packages/ss-boot/package.json +53 -0
  25. package/template-6.4.0-community/packages/ss-boot/public/favicon.ico +0 -0
  26. package/template-6.4.0-community/packages/ss-boot/public/index.html +83 -0
  27. package/template-6.4.0-community/packages/ss-boot/public/manifest.js +5 -0
  28. package/template-6.4.0-community/packages/ss-boot/src/main.ts +50 -0
  29. package/template-6.4.0-community/packages/ss-boot/src/shim-translate.d.ts +10 -0
  30. package/template-6.4.0-community/packages/ss-boot/src/shim-vue.d.ts +6 -0
  31. package/template-6.4.0-community/packages/ss-boot/tsconfig.json +44 -0
  32. package/template-6.4.0-community/packages/ss-boot/vue.config.js +84 -0
  33. package/template-6.4.0-community/packages/ss-oinone/index.ts +1 -0
  34. package/template-6.4.0-community/packages/ss-oinone/package.json +29 -0
  35. package/template-6.4.0-community/packages/ss-oinone/rollup.config.js +82 -0
  36. package/template-6.4.0-community/packages/ss-oinone/scripts/postpublish.js +13 -0
  37. package/template-6.4.0-community/packages/ss-oinone/scripts/prepublish-only.js +24 -0
  38. package/template-6.4.0-community/packages/ss-oinone/src/index.ts +1 -0
  39. package/template-6.4.0-community/packages/ss-oinone/src/shim-translate.d.ts +10 -0
  40. package/template-6.4.0-community/packages/ss-oinone/src/shim-vue.d.ts +6 -0
  41. package/template-6.4.0-community/packages/ss-oinone/tsconfig.json +42 -0
  42. package/template-6.4.0-community/packages/ss-project/index.ts +1 -0
  43. package/template-6.4.0-community/packages/ss-project/package.json +30 -0
  44. package/template-6.4.0-community/packages/ss-project/rollup.config.js +83 -0
  45. package/template-6.4.0-community/packages/ss-project/scripts/postpublish.js +13 -0
  46. package/template-6.4.0-community/packages/ss-project/scripts/prepublish-only.js +24 -0
  47. package/template-6.4.0-community/packages/ss-project/src/index.ts +1 -0
  48. package/template-6.4.0-community/packages/ss-project/src/shim-translate.d.ts +10 -0
  49. package/template-6.4.0-community/packages/ss-project/src/shim-vue.d.ts +6 -0
  50. package/template-6.4.0-community/packages/ss-project/tsconfig.json +42 -0
  51. package/template-6.4.0-community/pnpm-workspace.yaml +3 -0
  52. package/template-6.4.0-community/scripts/build/inset-tsconfig.js +68 -0
  53. package/template-6.4.0-community/scripts/build/package-name.js +25 -0
  54. package/template-6.4.0-community/scripts/build/postbuild.js +42 -0
  55. package/template-6.4.0-community/scripts/build/prebuild-only.js +48 -0
  56. package/template-6.4.0-community/scripts/clean.mjs +22 -0
  57. package/template-6.4.0-enterprise/.eslintignore +5 -0
  58. package/template-6.4.0-enterprise/.eslintrc.json +72 -0
  59. package/template-6.4.0-enterprise/.prettierrc.json +8 -0
  60. package/template-6.4.0-enterprise/README.md +59 -0
  61. package/template-6.4.0-enterprise/_package.json +47 -0
  62. package/template-6.4.0-enterprise/gitignore +58 -0
  63. package/template-6.4.0-enterprise/lerna.json +12 -0
  64. package/template-6.4.0-enterprise/npmrc +3 -0
  65. package/template-6.4.0-enterprise/packages/ss-admin-widget/index.ts +1 -0
  66. package/template-6.4.0-enterprise/packages/ss-admin-widget/package.json +25 -0
  67. package/template-6.4.0-enterprise/packages/ss-admin-widget/rollup.config.js +73 -0
  68. package/template-6.4.0-enterprise/packages/ss-admin-widget/scripts/postpublish.js +13 -0
  69. package/template-6.4.0-enterprise/packages/ss-admin-widget/scripts/prepublish-only.js +24 -0
  70. package/template-6.4.0-enterprise/packages/ss-admin-widget/src/index.ts +1 -0
  71. package/template-6.4.0-enterprise/packages/ss-admin-widget/src/shim-translate.d.ts +10 -0
  72. package/template-6.4.0-enterprise/packages/ss-admin-widget/src/shim-vue.d.ts +6 -0
  73. package/template-6.4.0-enterprise/packages/ss-admin-widget/tsconfig.json +45 -0
  74. package/template-6.4.0-enterprise/packages/ss-boot/.env +1 -0
  75. package/template-6.4.0-enterprise/packages/ss-boot/.env.example +6 -0
  76. package/template-6.4.0-enterprise/packages/ss-boot/package.json +66 -0
  77. package/template-6.4.0-enterprise/packages/ss-boot/public/favicon.ico +0 -0
  78. package/template-6.4.0-enterprise/packages/ss-boot/public/index.html +83 -0
  79. package/template-6.4.0-enterprise/packages/ss-boot/public/manifest.js +5 -0
  80. package/template-6.4.0-enterprise/packages/ss-boot/src/main.ts +69 -0
  81. package/template-6.4.0-enterprise/packages/ss-boot/src/shim-translate.d.ts +10 -0
  82. package/template-6.4.0-enterprise/packages/ss-boot/src/shim-vue.d.ts +6 -0
  83. package/template-6.4.0-enterprise/packages/ss-boot/tsconfig.json +44 -0
  84. package/template-6.4.0-enterprise/packages/ss-boot/vue.config.js +84 -0
  85. package/template-6.4.0-enterprise/packages/ss-oinone/index.ts +1 -0
  86. package/template-6.4.0-enterprise/packages/ss-oinone/package.json +29 -0
  87. package/template-6.4.0-enterprise/packages/ss-oinone/rollup.config.js +82 -0
  88. package/template-6.4.0-enterprise/packages/ss-oinone/scripts/postpublish.js +13 -0
  89. package/template-6.4.0-enterprise/packages/ss-oinone/scripts/prepublish-only.js +24 -0
  90. package/template-6.4.0-enterprise/packages/ss-oinone/src/index.ts +1 -0
  91. package/template-6.4.0-enterprise/packages/ss-oinone/src/shim-translate.d.ts +10 -0
  92. package/template-6.4.0-enterprise/packages/ss-oinone/src/shim-vue.d.ts +6 -0
  93. package/template-6.4.0-enterprise/packages/ss-oinone/tsconfig.json +42 -0
  94. package/template-6.4.0-enterprise/packages/ss-project/index.ts +1 -0
  95. package/template-6.4.0-enterprise/packages/ss-project/package.json +30 -0
  96. package/template-6.4.0-enterprise/packages/ss-project/rollup.config.js +83 -0
  97. package/template-6.4.0-enterprise/packages/ss-project/scripts/postpublish.js +13 -0
  98. package/template-6.4.0-enterprise/packages/ss-project/scripts/prepublish-only.js +24 -0
  99. package/template-6.4.0-enterprise/packages/ss-project/src/index.ts +1 -0
  100. package/template-6.4.0-enterprise/packages/ss-project/src/shim-translate.d.ts +10 -0
  101. package/template-6.4.0-enterprise/packages/ss-project/src/shim-vue.d.ts +6 -0
  102. package/template-6.4.0-enterprise/packages/ss-project/tsconfig.json +42 -0
  103. package/template-6.4.0-enterprise/pnpm-workspace.yaml +3 -0
  104. package/template-6.4.0-enterprise/scripts/build/inset-tsconfig.js +68 -0
  105. package/template-6.4.0-enterprise/scripts/build/package-name.js +25 -0
  106. package/template-6.4.0-enterprise/scripts/build/postbuild.js +42 -0
  107. package/template-6.4.0-enterprise/scripts/build/prebuild-only.js +48 -0
  108. package/template-6.4.0-enterprise/scripts/clean.mjs +22 -0
  109. package/template-7.2.0-community/.prettierrc.json +8 -0
  110. package/template-7.2.0-community/README.md +59 -0
  111. package/template-7.2.0-community/_package.json +57 -0
  112. package/template-7.2.0-community/eslint.config.ts +23 -0
  113. package/template-7.2.0-community/gitignore +58 -0
  114. package/template-7.2.0-community/lerna.json +12 -0
  115. package/template-7.2.0-community/npmrc +3 -0
  116. package/template-7.2.0-community/packages/ss-admin-widget/index.ts +1 -0
  117. package/template-7.2.0-community/packages/ss-admin-widget/package.json +27 -0
  118. package/template-7.2.0-community/packages/ss-admin-widget/rollup.config.js +12 -0
  119. package/template-7.2.0-community/packages/ss-admin-widget/scripts/postpublish.js +13 -0
  120. package/template-7.2.0-community/packages/ss-admin-widget/scripts/prepublish-only.js +24 -0
  121. package/template-7.2.0-community/packages/ss-admin-widget/src/index.ts +1 -0
  122. package/template-7.2.0-community/packages/ss-admin-widget/src/shim-translate.d.ts +10 -0
  123. package/template-7.2.0-community/packages/ss-admin-widget/src/shim-vue.d.ts +6 -0
  124. package/template-7.2.0-community/packages/ss-admin-widget/tsconfig.json +14 -0
  125. package/template-7.2.0-community/packages/ss-boot/.env +1 -0
  126. package/template-7.2.0-community/packages/ss-boot/.env.example +6 -0
  127. package/template-7.2.0-community/packages/ss-boot/package.json +51 -0
  128. package/template-7.2.0-community/packages/ss-boot/public/favicon.ico +0 -0
  129. package/template-7.2.0-community/packages/ss-boot/public/index.html +83 -0
  130. package/template-7.2.0-community/packages/ss-boot/public/manifest.js +5 -0
  131. package/template-7.2.0-community/packages/ss-boot/src/main.ts +46 -0
  132. package/template-7.2.0-community/packages/ss-boot/src/shim-translate.d.ts +10 -0
  133. package/template-7.2.0-community/packages/ss-boot/src/shim-vue.d.ts +6 -0
  134. package/template-7.2.0-community/packages/ss-boot/tsconfig.json +27 -0
  135. package/template-7.2.0-community/packages/ss-boot/vue.config.js +87 -0
  136. package/template-7.2.0-community/packages/ss-oinone/index.ts +1 -0
  137. package/template-7.2.0-community/packages/ss-oinone/package.json +30 -0
  138. package/template-7.2.0-community/packages/ss-oinone/rollup.config.js +12 -0
  139. package/template-7.2.0-community/packages/ss-oinone/scripts/postpublish.js +13 -0
  140. package/template-7.2.0-community/packages/ss-oinone/scripts/prepublish-only.js +24 -0
  141. package/template-7.2.0-community/packages/ss-oinone/src/index.ts +1 -0
  142. package/template-7.2.0-community/packages/ss-oinone/src/shim-translate.d.ts +10 -0
  143. package/template-7.2.0-community/packages/ss-oinone/src/shim-vue.d.ts +6 -0
  144. package/template-7.2.0-community/packages/ss-oinone/tsconfig.json +14 -0
  145. package/template-7.2.0-community/packages/ss-project/index.ts +1 -0
  146. package/template-7.2.0-community/packages/ss-project/package.json +30 -0
  147. package/template-7.2.0-community/packages/ss-project/rollup.config.js +12 -0
  148. package/template-7.2.0-community/packages/ss-project/scripts/postpublish.js +13 -0
  149. package/template-7.2.0-community/packages/ss-project/scripts/prepublish-only.js +24 -0
  150. package/template-7.2.0-community/packages/ss-project/src/index.ts +1 -0
  151. package/template-7.2.0-community/packages/ss-project/src/shim-translate.d.ts +10 -0
  152. package/template-7.2.0-community/packages/ss-project/src/shim-vue.d.ts +6 -0
  153. package/template-7.2.0-community/packages/ss-project/tsconfig.json +14 -0
  154. package/template-7.2.0-community/pnpm-workspace.yaml +3 -0
  155. package/template-7.2.0-community/scripts/build/inset-tsconfig.js +68 -0
  156. package/template-7.2.0-community/scripts/build/package-name.js +25 -0
  157. package/template-7.2.0-community/scripts/clean.mjs +22 -0
  158. package/template-7.2.0-enterprise/.prettierrc.json +8 -0
  159. package/template-7.2.0-enterprise/README.md +59 -0
  160. package/template-7.2.0-enterprise/_package.json +57 -0
  161. package/template-7.2.0-enterprise/eslint.config.ts +23 -0
  162. package/template-7.2.0-enterprise/gitignore +58 -0
  163. package/template-7.2.0-enterprise/lerna.json +12 -0
  164. package/template-7.2.0-enterprise/npmrc +3 -0
  165. package/template-7.2.0-enterprise/packages/ss-admin-widget/index.ts +1 -0
  166. package/template-7.2.0-enterprise/packages/ss-admin-widget/package.json +27 -0
  167. package/template-7.2.0-enterprise/packages/ss-admin-widget/rollup.config.js +12 -0
  168. package/template-7.2.0-enterprise/packages/ss-admin-widget/scripts/postpublish.js +13 -0
  169. package/template-7.2.0-enterprise/packages/ss-admin-widget/scripts/prepublish-only.js +24 -0
  170. package/template-7.2.0-enterprise/packages/ss-admin-widget/src/index.ts +1 -0
  171. package/template-7.2.0-enterprise/packages/ss-admin-widget/src/shim-translate.d.ts +10 -0
  172. package/template-7.2.0-enterprise/packages/ss-admin-widget/src/shim-vue.d.ts +6 -0
  173. package/template-7.2.0-enterprise/packages/ss-admin-widget/tsconfig.json +14 -0
  174. package/template-7.2.0-enterprise/packages/ss-boot/.env +1 -0
  175. package/template-7.2.0-enterprise/packages/ss-boot/.env.example +6 -0
  176. package/template-7.2.0-enterprise/packages/ss-boot/package.json +64 -0
  177. package/template-7.2.0-enterprise/packages/ss-boot/public/favicon.ico +0 -0
  178. package/template-7.2.0-enterprise/packages/ss-boot/public/index.html +83 -0
  179. package/template-7.2.0-enterprise/packages/ss-boot/public/manifest.js +5 -0
  180. package/template-7.2.0-enterprise/packages/ss-boot/src/main.ts +66 -0
  181. package/template-7.2.0-enterprise/packages/ss-boot/src/shim-translate.d.ts +10 -0
  182. package/template-7.2.0-enterprise/packages/ss-boot/src/shim-vue.d.ts +6 -0
  183. package/template-7.2.0-enterprise/packages/ss-boot/tsconfig.json +27 -0
  184. package/template-7.2.0-enterprise/packages/ss-boot/vue.config.js +87 -0
  185. package/template-7.2.0-enterprise/packages/ss-oinone/index.ts +1 -0
  186. package/template-7.2.0-enterprise/packages/ss-oinone/package.json +30 -0
  187. package/template-7.2.0-enterprise/packages/ss-oinone/rollup.config.js +12 -0
  188. package/template-7.2.0-enterprise/packages/ss-oinone/scripts/postpublish.js +13 -0
  189. package/template-7.2.0-enterprise/packages/ss-oinone/scripts/prepublish-only.js +24 -0
  190. package/template-7.2.0-enterprise/packages/ss-oinone/src/index.ts +1 -0
  191. package/template-7.2.0-enterprise/packages/ss-oinone/src/shim-translate.d.ts +10 -0
  192. package/template-7.2.0-enterprise/packages/ss-oinone/src/shim-vue.d.ts +6 -0
  193. package/template-7.2.0-enterprise/packages/ss-oinone/tsconfig.json +14 -0
  194. package/template-7.2.0-enterprise/packages/ss-project/index.ts +1 -0
  195. package/template-7.2.0-enterprise/packages/ss-project/package.json +30 -0
  196. package/template-7.2.0-enterprise/packages/ss-project/rollup.config.js +12 -0
  197. package/template-7.2.0-enterprise/packages/ss-project/scripts/postpublish.js +13 -0
  198. package/template-7.2.0-enterprise/packages/ss-project/scripts/prepublish-only.js +24 -0
  199. package/template-7.2.0-enterprise/packages/ss-project/src/index.ts +1 -0
  200. package/template-7.2.0-enterprise/packages/ss-project/src/shim-translate.d.ts +10 -0
  201. package/template-7.2.0-enterprise/packages/ss-project/src/shim-vue.d.ts +6 -0
  202. package/template-7.2.0-enterprise/packages/ss-project/tsconfig.json +14 -0
  203. package/template-7.2.0-enterprise/pnpm-workspace.yaml +3 -0
  204. package/template-7.2.0-enterprise/scripts/build/inset-tsconfig.js +68 -0
  205. package/template-7.2.0-enterprise/scripts/build/package-name.js +25 -0
  206. package/template-7.2.0-enterprise/scripts/clean.mjs +22 -0
@@ -0,0 +1,68 @@
1
+ const fs = require('fs').promises;
2
+ const path = require('path');
3
+ const packageNames = ['@oinone/kunlun-vue-admin-base'];
4
+
5
+ const content = `{
6
+ "compilerOptions": {
7
+ "experimentalDecorators": true,
8
+ "emitDecoratorMetadata": true,
9
+ "allowJs": true,
10
+ "target": "ES6",
11
+ "module": "esnext",
12
+ "strict": true,
13
+ "importHelpers": true,
14
+ "moduleResolution": "node",
15
+ "esModuleInterop": true,
16
+ "allowSyntheticDefaultImports": true,
17
+ "sourceMap": true,
18
+ "skipLibCheck": true,
19
+ "declaration": true,
20
+ "baseUrl": ".",
21
+ "lib": [
22
+ "ES2018",
23
+ "esnext",
24
+ "dom",
25
+ "dom.iterable",
26
+ "scripthost"
27
+ ],
28
+ "types": [
29
+ "node",
30
+ "reflect-metadata",
31
+ "jest"
32
+ ],
33
+ "typeRoots": [
34
+ "node_modules/@types"
35
+ ],
36
+ "declarationDir": "dist/types",
37
+ "outDir": "dist",
38
+ "noImplicitAny": false,
39
+ "incremental": true,
40
+ "resolveJsonModule": true
41
+ },
42
+ "include": [
43
+ "packages"
44
+ ],
45
+ "exclude": [
46
+ "node_modules",
47
+ "dist"
48
+ ]
49
+ }
50
+ `;
51
+
52
+ async function insetTSConfig() {
53
+ const oinoneCwd = path.resolve(process.cwd(), '../../node_modules');
54
+
55
+ for (const packageName of packageNames) {
56
+ const dependenciesPath = path.resolve(oinoneCwd, packageName);
57
+ try {
58
+ await fs.access(dependenciesPath);
59
+ } catch (err) {
60
+ console.error(`动态插入tsconfig失败: ${dependenciesPath}`, err);
61
+ return;
62
+ }
63
+
64
+ await fs.writeFile(path.resolve(dependenciesPath, 'tsconfig.json'), content);
65
+ }
66
+ }
67
+
68
+ module.exports = { insetTSConfig };
@@ -0,0 +1,25 @@
1
+ const packageNames = [
2
+ '@oinone/kunlun-cache',
3
+ '@oinone/kunlun-dsl',
4
+ '@oinone/kunlun-environment',
5
+ '@oinone/kunlun-event',
6
+ '@oinone/kunlun-expression',
7
+ '@oinone/kunlun-meta',
8
+ '@oinone/kunlun-shared',
9
+ '@oinone/kunlun-request',
10
+ '@oinone/kunlun-router',
11
+ '@oinone/kunlun-service',
12
+ '@oinone/kunlun-spi',
13
+ '@oinone/kunlun-state',
14
+ '@oinone/kunlun-theme',
15
+ '@oinone/kunlun-engine',
16
+ '@oinone/kunlun-vue-router',
17
+ '@oinone/kunlun-vue-ui',
18
+ '@oinone/kunlun-vue-ui-antd',
19
+ '@oinone/kunlun-vue-ui-common',
20
+ '@oinone/kunlun-vue-admin-base',
21
+ '@oinone/kunlun-vue-ui-el',
22
+ '@oinone/kunlun-vue-widget'
23
+ ];
24
+
25
+ module.exports = { packageNames };
@@ -0,0 +1,42 @@
1
+ const fs = require('fs').promises;
2
+ const path = require('path');
3
+ const { packageNames } = require('./package-name');
4
+
5
+ async function revertPackageJson(packageNames) {
6
+ const oinoneCwd = path.resolve(process.cwd(), '../../node_modules');
7
+
8
+ await Promise.all(
9
+ packageNames.map(async (pkgName) => {
10
+ try {
11
+ const packageJsonPath = path.resolve(oinoneCwd, pkgName, 'package.json');
12
+
13
+ // 检查package.json是否存在
14
+ try {
15
+ await fs.access(packageJsonPath);
16
+ } catch (err) {
17
+ console.error(`${pkgName} 的 package.json 不存在`);
18
+
19
+ return;
20
+ }
21
+
22
+ // 读取并解析 package.json
23
+ const packageJsonStr = await fs.readFile(packageJsonPath, 'utf8');
24
+ const packageJson = JSON.parse(packageJsonStr);
25
+
26
+ packageJson.main = 'index.ts';
27
+ delete packageJson.module;
28
+ delete packageJson.typings;
29
+ delete packageJson.files;
30
+
31
+ // 写回文件
32
+ await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
33
+ } catch (error) {
34
+ console.error(`Error processing ${pkgName}:`, error.message);
35
+ }
36
+ })
37
+ );
38
+ }
39
+
40
+ revertPackageJson(packageNames).then(async () => {
41
+ console.log('All packages revert');
42
+ });
@@ -0,0 +1,48 @@
1
+ const fs = require('fs').promises;
2
+ const path = require('path');
3
+ const { packageNames } = require('./package-name');
4
+ const { insetTSConfig } = require('./inset-tsconfig');
5
+
6
+ async function updatePackageJson(packageNames) {
7
+ const oinoneCwd = path.resolve(process.cwd(), '../../node_modules');
8
+
9
+ await Promise.all(
10
+ packageNames.map(async (pkgName) => {
11
+ try {
12
+ const packageJsonPath = path.resolve(oinoneCwd, pkgName, 'package.json');
13
+ console.log(packageJsonPath)
14
+ // 检查package.json是否存在
15
+ try {
16
+ await fs.access(packageJsonPath);
17
+ } catch (err) {
18
+ console.error(`${pkgName} 的 package.json 不存在`);
19
+
20
+ return;
21
+ }
22
+
23
+ // 读取并解析 package.json
24
+ const packageJsonStr = await fs.readFile(packageJsonPath, 'utf8');
25
+ const packageJson = JSON.parse(packageJsonStr);
26
+
27
+ // 生成库名称
28
+ const libName = packageJson.name.replace('@', '').replace('/', '-');
29
+
30
+ // 更新字段
31
+ packageJson.main = `dist/${libName}.esm.js`;
32
+ packageJson.module = `dist/${libName}.esm.js`;
33
+ packageJson.typings = 'dist/types/index.d.ts';
34
+
35
+ packageJson.files = ['dist'];
36
+ // 写回文件
37
+ await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
38
+ } catch (error) {
39
+ console.error(`Error processing ${pkgName}:`, error.message);
40
+ }
41
+ })
42
+ );
43
+ }
44
+
45
+ updatePackageJson(packageNames).then(async () => {
46
+ await insetTSConfig();
47
+ console.log('All packages updated');
48
+ });
@@ -0,0 +1,22 @@
1
+ import { rimraf } from 'rimraf';
2
+ import { globSync } from 'glob';
3
+
4
+ // 匹配所有 node_modules 文件夹
5
+ const files = globSync('packages/**/node_modules')
6
+
7
+ // 删除所有匹配的 node_modules
8
+ files.forEach((file) => {
9
+ rimraf(file).then((deleted) => {
10
+ if (!deleted) console.error(`Error deleting ${file}:`, err);
11
+ else console.log(`Deleted ${file}`);
12
+ });
13
+ });
14
+
15
+ // 删除其他文件
16
+ const filesToDelete = ['package-lock.json', 'pnpm-lock.yaml', 'node_modules'];
17
+ filesToDelete.forEach(file => {
18
+ rimraf(file).then((deleted) => {
19
+ if (!deleted) console.error(`Error deleting ${file}:`, err);
20
+ else console.log(`Deleted ${file}`);
21
+ });
22
+ });
@@ -0,0 +1,5 @@
1
+ integration/*
2
+ templates/*
3
+ **/__test__/**/*
4
+ **/*.test.[tj]s?(x)
5
+ link-vls.js
@@ -0,0 +1,72 @@
1
+ {
2
+ "root": true,
3
+ "env": {
4
+ "node": true
5
+ },
6
+ "parser": "vue-eslint-parser",
7
+ "parserOptions": {
8
+ "parser": "@typescript-eslint/parser",
9
+ "ecmaVersion": 2020,
10
+ "sourceType": "module",
11
+ "project": [
12
+ "./tsconfig.eslint.json"
13
+ ],
14
+ "extraFileExtensions": [
15
+ ".vue",
16
+ ".widget"
17
+ ]
18
+ },
19
+ "extends": [
20
+ "airbnb-typescript/base",
21
+ "plugin:@typescript-eslint/recommended",
22
+ "plugin:vue/vue3-essential",
23
+ "@vue/typescript",
24
+ "prettier/@typescript-eslint",
25
+ "plugin:prettier/recommended",
26
+ "prettier/vue"
27
+ ],
28
+ "rules": {
29
+ "import/extensions": "off",
30
+ "import/prefer-default-export": "off",
31
+ "import/no-extraneous-dependencies": "off",
32
+ "no-underscore-dangle": "off",
33
+ "no-param-reassign": "off",
34
+ "class-methods-use-this": "off",
35
+ "no-restricted-syntax": "off",
36
+ "consistent-return": "off",
37
+ "max-classes-per-file": "off",
38
+ "no-plusplus": "off",
39
+ "curly": [
40
+ "error",
41
+ "all"
42
+ ],
43
+ "default-case": "off",
44
+ "no-continue": "off",
45
+ "no-prototype-builtins": "off",
46
+ "no-return-assign": "off",
47
+ "no-restricted-globals": "off",
48
+ "guard-for-in": "off",
49
+ "no-useless-escape": "off",
50
+ "no-bitwise": "off",
51
+ "prefer-destructuring": "warn",
52
+ "no-extra-boolean-cast": "off",
53
+ "no-console": "off",
54
+ "vue/no-dupe-keys": "off",
55
+ "vue/no-v-for-template-key-on-child": "off",
56
+ "@typescript-eslint/no-empty-function": "off",
57
+ "@typescript-eslint/naming-convention": "off",
58
+ "@typescript-eslint/no-non-null-assertion": "off",
59
+ "@typescript-eslint/explicit-module-boundary-types": "off",
60
+ "@typescript-eslint/no-use-before-define": "off",
61
+ "@typescript-eslint/ban-types": "off",
62
+ "@typescript-eslint/no-unused-expressions": "off",
63
+ "@typescript-eslint/explicit-member-accessibility": "off"
64
+ },
65
+ "settings": {
66
+ "import/resolver": {
67
+ "typescript": {
68
+ "project": "packages/*/tsconfig.json"
69
+ }
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "printWidth": 120,
4
+ "singleQuote": true,
5
+ "semi": true,
6
+ "trailingComma": "none",
7
+ "arrowParens": "always"
8
+ }
@@ -0,0 +1,59 @@
1
+ ## 快速上手
2
+
3
+ ```
4
+
5
+ # 初始化安装依赖
6
+ pnpm install
7
+
8
+ # 清理所有依赖
9
+ pnpm run clean
10
+ pnpm run clean:win
11
+
12
+ # 开发模式启动
13
+ pnpm run dev
14
+
15
+ # 构建生产sdk包
16
+
17
+ # mac 环境
18
+ pnpm run build
19
+
20
+ # windows环境
21
+ pnpm run build-win
22
+
23
+ ```
24
+
25
+ ### 工程分层说明
26
+
27
+ ```
28
+ # ss-boot
29
+ 不做业务研发,只做包的组装和依赖
30
+
31
+ # ss-oinone
32
+ 与Oinone结合层,这个工程结构可以把数式Oinone的改造收口,也是业务工程依赖的核心层
33
+
34
+ # ss-admin-widget
35
+ 与界面设计器无代码的结合工程,在这个工程结构里可以把组件放在无代码平台上使用
36
+
37
+ # ss-project
38
+ 模拟的项目工程,做某个项目的个性化开发
39
+ ```
40
+
41
+ ### 修改开发模式后端 api 地址
42
+
43
+ 修改文件 `packages/ss-boot/vue.config.js` 的 `devServer.proxy.pamirs.target` 指向需要的后端地址。
44
+
45
+ ## 前端环境
46
+
47
+ **.npmrc**
48
+
49
+ ```
50
+ registry=https://registry.npmmirror.com/
51
+ @oinone:registry=http://nexus.shushi.pro/repository/kunlun/
52
+ legacy-peer-deps=true
53
+ ```
54
+
55
+ ### 登录npm源
56
+
57
+ ```
58
+ npm login --registry "http://nexus.shushi.pro/repository/kunlun/"
59
+ ```
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "ss-front-modules",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "pnpm lerna exec --scope ss-boot -- npm run dev",
7
+ "clean": "pnpm lerna run clean --parallel && rimraf package-lock.json pnpm-lock.yaml node_modules",
8
+ "clean:win": "node ./scripts/clean.mjs",
9
+ "build": "pnpm lerna run build --parallel",
10
+ "build-win": "pnpm lerna run build-win --parallel",
11
+ "publish": "pnpm lerna publish --no-git-tag-version --no-push --exact -y"
12
+ },
13
+ "devDependencies": {
14
+ "@commitlint/cli": "9.1.2",
15
+ "@commitlint/config-conventional": "9.1.2",
16
+ "@rollup/plugin-json": "4.1.0",
17
+ "@rollup/plugin-node-resolve": "11.2.1",
18
+ "@rollup/plugin-replace": "2.4.2",
19
+ "@typescript-eslint/parser": "5.5.0",
20
+ "glob": "^11.0.0",
21
+ "husky": "4.2.5",
22
+ "jest": "26.4.2",
23
+ "lerna": "^8.1.3",
24
+ "lint-staged": "10.4.2",
25
+ "patch-package": "6.2.2",
26
+ "postcss": "8.4.5",
27
+ "postcss-import": "14.0.2",
28
+ "prettier": "2.5.0",
29
+ "rimraf": "6.0.1",
30
+ "rollup": "2.63.0",
31
+ "rollup-plugin-commonjs": "10.1.0",
32
+ "rollup-plugin-postcss": "4.0.2",
33
+ "rollup-plugin-scss": "4.0.0",
34
+ "rollup-plugin-sourcemaps": "0.6.3",
35
+ "rollup-plugin-terser": "7.0.2",
36
+ "rollup-plugin-typescript2": "0.29.0",
37
+ "rollup-plugin-visualizer": "^5.5.4",
38
+ "rollup-plugin-vue": "6.0.0",
39
+ "sass": "1.44.0",
40
+ "sass-loader": "10.1.1",
41
+ "ts-jest": "26.3.0",
42
+ "tslib": "2.3.1",
43
+ "typedoc": "0.20.37",
44
+ "typescript": "4.5.2",
45
+ "vue": "3.2.40"
46
+ }
47
+ }
@@ -0,0 +1,58 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # Build Output
7
+ dist/
8
+ dist-ssr/
9
+ build/
10
+ out/
11
+ coverage/
12
+
13
+ # Vue / React / Framework specific
14
+ .nuxt/
15
+ .next/
16
+ .output/
17
+ .vuepress/dist/
18
+ .docusaurus/
19
+
20
+ # Environment Variables
21
+ .env
22
+ .env.local
23
+ .env.development.local
24
+ .env.test.local
25
+ .env.production.local
26
+
27
+ # Logs
28
+ npm-debug.log*
29
+ yarn-debug.log*
30
+ yarn-error.log*
31
+ pnpm-debug.log*
32
+ *.log
33
+
34
+ # Editor & OS Files
35
+ .vscode/
36
+ .idea/
37
+ *.suo
38
+ *.ntvs*
39
+ *.njsproj
40
+ *.sln
41
+ *.sw?
42
+ .DS_Store
43
+ .DS_Store?
44
+ ._*
45
+ .Spotlight-V100
46
+ .Trashes
47
+ ehthumbs.db
48
+ Thumbs.db
49
+
50
+ # Lockfiles (Optional depending on project standard, usually kept in VC)
51
+ package-lock.json
52
+ yarn.lock
53
+ pnpm-lock.yaml
54
+
55
+ # Local configuration
56
+ .eslintcache
57
+ .stylelintcache
58
+ *.tsbuildinfo
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": "independent",
3
+ "npmClient": "pnpm",
4
+ "command": {
5
+ "bootstrap": {
6
+ "npmClientArgs": ["--no-package-lock"]
7
+ },
8
+ "publish": {
9
+ "ignoreChanges": ["*.md"]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ registry=https://registry.npmmirror.com/
2
+ @oinone:registry=http://nexus.shushi.pro/repository/kunlun/
3
+ legacy-peer-deps=true
@@ -0,0 +1 @@
1
+ export * from './src';
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@ss/admin-widget",
3
+ "version": "1.0.0",
4
+ "main": "index.ts",
5
+ "scripts": {
6
+ "clean": "rimraf dist package-lock.json node_modules",
7
+ "prebuild": "rimraf dist",
8
+ "build": "rollup -c && npm run build-css",
9
+ "build-css": "[ -f './dist/kunlun-module-demo.scss' ] && sass ./dist/kunlun-module-demo.scss ./dist/kunlun-module-demo.css || exit 0",
10
+ "build-win": "rollup -c && npm run build-css-win",
11
+ "build-css-win": "IF EXIST ./dist/kunlun-module-demo.scss (sass ./dist/kunlun-module-demo.scss ./dist/kunlun-module-demo.css) ELSE (exit 0)",
12
+ "prepublishOnly": "node ./scripts/prepublish-only.js",
13
+ "postpublish": "node ./scripts/postpublish.js"
14
+ },
15
+ "devDependencies": {
16
+ "@element-plus/icons-vue": "2.0.9",
17
+ "@oinone/kunlun-dependencies": "~6.4.0",
18
+ "@oinone/kunlun-vue-ui-antd": "~6.4.0",
19
+ "@oinone/kunlun-vue-ui-el": "~6.4.0",
20
+ "@types/lodash-es": "4.17.6",
21
+ "ant-design-vue": "3.2.14",
22
+ "element-plus": "2.2.17",
23
+ "vue": "3.2.40"
24
+ }
25
+ }
@@ -0,0 +1,73 @@
1
+ import json from '@rollup/plugin-json';
2
+ import { nodeResolve } from '@rollup/plugin-node-resolve';
3
+ import replace from '@rollup/plugin-replace';
4
+ import commonjs from 'rollup-plugin-commonjs';
5
+ import scss from 'rollup-plugin-scss';
6
+ import typescript from 'rollup-plugin-typescript2';
7
+ import vue from 'rollup-plugin-vue';
8
+
9
+ const libraryName = 'ss-admin-widget';
10
+
11
+ const external = [
12
+ 'vue',
13
+ 'lodash-es',
14
+ 'ant-design-vue',
15
+ '@element-plus/icons-vue',
16
+ 'element-plus',
17
+ '@oinone/kunlun-dependencies',
18
+ '@oinone/kunlun-data-designer-core',
19
+ '@oinone/kunlun-vue-ui-antd',
20
+ '@oinone/kunlun-vue-ui-el'
21
+ ];
22
+
23
+ const tsconfigOverride = {
24
+ compilerOptions: {
25
+ outDir: 'dist',
26
+ declaration: true,
27
+ declarationDir: 'dist/types'
28
+ },
29
+ include: ['index.ts', 'src/**/*.ts'],
30
+ exclude: ['tests/**/*.ts', 'tests/**/*.tsx']
31
+ };
32
+
33
+ const plugins = [
34
+ replace({
35
+ 'process.env.NODE_ENV': JSON.stringify('development'),
36
+ preventAssignment: true
37
+ }),
38
+ nodeResolve(),
39
+
40
+ typescript({ useTsconfigDeclarationDir: true, tsconfigOverride }),
41
+
42
+ vue(),
43
+
44
+ scss({
45
+ fileName: `${libraryName}.scss`,
46
+ output: `dist/${libraryName}.scss`,
47
+ sourceMap: false,
48
+ outputStyle: 'compressed'
49
+ }),
50
+
51
+ json(),
52
+ commonjs()
53
+ ];
54
+
55
+ export default {
56
+ input: `index.ts`,
57
+ output: [
58
+ {
59
+ file: `dist/${libraryName}.esm.js`,
60
+ format: 'esm',
61
+ sourcemap: false
62
+ }
63
+ ],
64
+ onwarn(warning) {
65
+ if (warning.code === 'THIS_IS_UNDEFINED' || /Circular/.test(warning.message)) {
66
+ return;
67
+ }
68
+
69
+ console.error(warning.message);
70
+ },
71
+ external,
72
+ plugins
73
+ };
@@ -0,0 +1,13 @@
1
+ /* eslint-disable import/no-dynamic-require */
2
+ /* eslint-disable @typescript-eslint/no-var-requires */
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const url = path.resolve(process.cwd(), 'package.json');
6
+ const packageJSON = require(url);
7
+
8
+ packageJSON.main = 'index.ts';
9
+ delete packageJSON.module;
10
+ delete packageJSON.typings;
11
+ delete packageJSON.files;
12
+
13
+ fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2));
@@ -0,0 +1,24 @@
1
+ /* eslint-disable import/no-dynamic-require */
2
+ /* eslint-disable @typescript-eslint/no-var-requires */
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const url = path.resolve(process.cwd(), 'package.json');
6
+ const packageJSON = require(url);
7
+
8
+ const libName = packageJSON.name.replace('@', '').replace('/', '-');
9
+
10
+ packageJSON.main = `dist/${libName}.esm.js`;
11
+ packageJSON.module = `dist/${libName}.esm.js`;
12
+ const typings = 'dist/types/index.d.ts';
13
+ packageJSON.typings = typings;
14
+
15
+ const typingsUrl = path.resolve(process.cwd(), typings);
16
+ const dir = fs.existsSync(typingsUrl);
17
+
18
+ if (!dir) {
19
+ packageJSON.typings = 'dist/index.d.ts';
20
+ }
21
+
22
+ packageJSON.files = ['dist'];
23
+
24
+ fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2));
@@ -0,0 +1,10 @@
1
+ export {};
2
+
3
+ declare module 'vue' {
4
+ interface ComponentCustomProperties {
5
+ $translate<T extends string | null | undefined = string | null | undefined>(
6
+ text: T,
7
+ context?: Record<string, unknown>
8
+ ): T;
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ declare module '*.vue' {
2
+ import { defineComponent } from 'vue';
3
+
4
+ const Component: ReturnType<typeof defineComponent>;
5
+ export default Component;
6
+ }