@chamn/engine 0.0.10 → 0.0.11

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 (204) hide show
  1. package/dist/component/CustomSchemaForm/components/Form/context.d.ts +2 -0
  2. package/dist/component/CustomSchemaForm/components/Form/index.d.ts +1 -0
  3. package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +2 -0
  4. package/dist/component/CustomSchemaForm/index.d.ts +3 -0
  5. package/dist/component/Workbench/index.d.ts +4 -0
  6. package/dist/core/pluginManager.d.ts +5 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +197 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/{index.es.js → index.mjs} +2995 -2944
  11. package/dist/index.mjs.map +1 -0
  12. package/dist/plugins/RightPanel/view.d.ts +4 -0
  13. package/package.json +12 -9
  14. package/.eslintignore +0 -1
  15. package/.eslintrc.js +0 -36
  16. package/.prettierrc.json +0 -7
  17. package/.storybook/main.js +0 -24
  18. package/.storybook/preview.js +0 -9
  19. package/CHANGELOG.md +0 -54
  20. package/__tests__/demo.test.ts +0 -3
  21. package/build.config.js +0 -88
  22. package/dist/index.cjs.js +0 -197
  23. package/dist/index.cjs.js.map +0 -1
  24. package/dist/index.es.js.map +0 -1
  25. package/index.html +0 -16
  26. package/jest.config.js +0 -196
  27. package/public/Engine.module.scss.d.ts +0 -5
  28. package/public/_dev_/render.d.ts +0 -2
  29. package/public/component/CSSEditor/style.module.scss.d.ts +0 -6
  30. package/public/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -15
  31. package/public/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -15
  32. package/public/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
  33. package/public/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
  34. package/public/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
  35. package/public/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
  36. package/public/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
  37. package/public/component/Workbench/style.module.scss.d.ts +0 -25
  38. package/public/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
  39. package/public/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
  40. package/public/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
  41. package/public/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
  42. package/public/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
  43. package/public/plugins/Designer/style.module.scss.d.ts +0 -5
  44. package/public/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
  45. package/public/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
  46. package/public/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
  47. package/public/plugins/RightPanel/style.module.scss.d.ts +0 -10
  48. package/public/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
  49. package/public/render.umd.js +0 -42
  50. package/public/render.umd.js.map +0 -1
  51. package/src/Engine.module.scss +0 -10
  52. package/src/Engine.module.scss.d.ts +0 -5
  53. package/src/_dev_/index.css +0 -22
  54. package/src/_dev_/index.tsx +0 -5
  55. package/src/_dev_/page/Editor/index.tsx +0 -198
  56. package/src/_dev_/page/Editor/indexCustom.tsx +0 -274
  57. package/src/_dev_/page/Preview/index.tsx +0 -56
  58. package/src/_dev_/render.ts +0 -3
  59. package/src/_dev_/router.tsx +0 -14
  60. package/src/assets/react.svg +0 -4
  61. package/src/assets/styles/mixin.scss +0 -15
  62. package/src/component/CSSEditor/index.tsx +0 -247
  63. package/src/component/CSSEditor/style.module.scss +0 -22
  64. package/src/component/CSSEditor/style.module.scss.d.ts +0 -6
  65. package/src/component/CSSPropertiesEditor/cssProperties.ts +0 -1062
  66. package/src/component/CSSPropertiesEditor/index.tsx +0 -389
  67. package/src/component/CSSPropertiesEditor/style.module.scss +0 -46
  68. package/src/component/CSSPropertiesEditor/style.module.scss.d.ts +0 -15
  69. package/src/component/CSSPropertiesEditor/util.ts +0 -19
  70. package/src/component/CSSPropertiesVariableBindEditor/cssProperties.ts +0 -782
  71. package/src/component/CSSPropertiesVariableBindEditor/index.tsx +0 -366
  72. package/src/component/CSSPropertiesVariableBindEditor/style.module.scss +0 -48
  73. package/src/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +0 -15
  74. package/src/component/CSSPropertiesVariableBindEditor/util.ts +0 -19
  75. package/src/component/ClassNameEditor/index.tsx +0 -91
  76. package/src/component/ClassNameEditor/style.module.scss +0 -0
  77. package/src/component/CustomSchemaForm/components/Form/Field/index.tsx +0 -81
  78. package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss +0 -32
  79. package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +0 -8
  80. package/src/component/CustomSchemaForm/components/Form/context.ts +0 -23
  81. package/src/component/CustomSchemaForm/components/Form/index.tsx +0 -71
  82. package/src/component/CustomSchemaForm/components/SetterSwitcher/index.tsx +0 -273
  83. package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss +0 -16
  84. package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +0 -7
  85. package/src/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.tsx +0 -55
  86. package/src/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.tsx +0 -160
  87. package/src/component/CustomSchemaForm/components/Setters/ArraySetter/index.tsx +0 -129
  88. package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss +0 -22
  89. package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +0 -7
  90. package/src/component/CustomSchemaForm/components/Setters/BooleanSetter/index.tsx +0 -32
  91. package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/index.tsx +0 -78
  92. package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss +0 -7
  93. package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +0 -6
  94. package/src/component/CustomSchemaForm/components/Setters/ExpressionSetter/index.tsx +0 -47
  95. package/src/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.ts +0 -28
  96. package/src/component/CustomSchemaForm/components/Setters/FunctionSetter/index.tsx +0 -93
  97. package/src/component/CustomSchemaForm/components/Setters/JSONSetter/index.tsx +0 -80
  98. package/src/component/CustomSchemaForm/components/Setters/NumberSetter/index.tsx +0 -34
  99. package/src/component/CustomSchemaForm/components/Setters/SelectSetter/index.tsx +0 -35
  100. package/src/component/CustomSchemaForm/components/Setters/ShapeSetter/index.tsx +0 -65
  101. package/src/component/CustomSchemaForm/components/Setters/StringSetter/index.tsx +0 -30
  102. package/src/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.tsx +0 -31
  103. package/src/component/CustomSchemaForm/components/Setters/index.ts +0 -26
  104. package/src/component/CustomSchemaForm/components/Setters/type.ts +0 -18
  105. package/src/component/CustomSchemaForm/context.ts +0 -20
  106. package/src/component/CustomSchemaForm/index.tsx +0 -93
  107. package/src/component/CustomSchemaForm/style.module.scss +0 -15
  108. package/src/component/CustomSchemaForm/style.module.scss.d.ts +0 -11
  109. package/src/component/CustomSchemaForm/utils.ts +0 -13
  110. package/src/component/MonacoEditor/index.tsx +0 -81
  111. package/src/component/Workbench/index.tsx +0 -329
  112. package/src/component/Workbench/style.module.scss +0 -159
  113. package/src/component/Workbench/style.module.scss.d.ts +0 -25
  114. package/src/core/pluginManager.ts +0 -151
  115. package/src/i18n/en_US/index.ts +0 -5
  116. package/src/i18n/index.ts +0 -39
  117. package/src/i18n/zh_CN/index.ts +0 -5
  118. package/src/index.tsx +0 -150
  119. package/src/material/innerMaterial.ts +0 -343
  120. package/src/plugins/AdvancePanel/index.tsx +0 -191
  121. package/src/plugins/AdvancePanel/style.module.scss +0 -8
  122. package/src/plugins/AdvancePanel/style.module.scss.d.ts +0 -7
  123. package/src/plugins/ComponentLibrary/components/DragItem/index.tsx +0 -65
  124. package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss +0 -58
  125. package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +0 -9
  126. package/src/plugins/ComponentLibrary/components/ListView/index.tsx +0 -50
  127. package/src/plugins/ComponentLibrary/components/ListView/style.module.scss +0 -27
  128. package/src/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +0 -12
  129. package/src/plugins/ComponentLibrary/index.tsx +0 -184
  130. package/src/plugins/ComponentLibrary/localize/en_US/index.ts +0 -3
  131. package/src/plugins/ComponentLibrary/localize/index.ts +0 -3
  132. package/src/plugins/ComponentLibrary/localize/zh_CN/index.ts +0 -3
  133. package/src/plugins/ComponentLibrary/style.module.scss +0 -31
  134. package/src/plugins/ComponentLibrary/style.module.scss.d.ts +0 -11
  135. package/src/plugins/ComponentLibrary/util.ts +0 -14
  136. package/src/plugins/ComponentStatePanel/index.tsx +0 -59
  137. package/src/plugins/Designer/components/DefaultSelectToolBar/index.tsx +0 -94
  138. package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss +0 -59
  139. package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +0 -11
  140. package/src/plugins/Designer/components/GhostView/index.tsx +0 -18
  141. package/src/plugins/Designer/config.ts +0 -1
  142. package/src/plugins/Designer/index.tsx +0 -61
  143. package/src/plugins/Designer/localize/en_US/index.ts +0 -3
  144. package/src/plugins/Designer/localize/index.ts +0 -3
  145. package/src/plugins/Designer/localize/zh_CN/index.ts +0 -3
  146. package/src/plugins/Designer/style.module.scss +0 -10
  147. package/src/plugins/Designer/style.module.scss.d.ts +0 -5
  148. package/src/plugins/Designer/util.ts +0 -18
  149. package/src/plugins/Designer/view.tsx +0 -225
  150. package/src/plugins/DisplaySourceSchema/index.tsx +0 -76
  151. package/src/plugins/GlobalStatePanel/index.tsx +0 -96
  152. package/src/plugins/GlobalStatePanel/localize/en_US/index.ts +0 -3
  153. package/src/plugins/GlobalStatePanel/localize/index.ts +0 -3
  154. package/src/plugins/GlobalStatePanel/localize/zh_CN/index.ts +0 -3
  155. package/src/plugins/GlobalStatePanel/style.module.scss +0 -8
  156. package/src/plugins/GlobalStatePanel/style.module.scss.d.ts +0 -5
  157. package/src/plugins/History/index.tsx +0 -110
  158. package/src/plugins/OutlineTree/components/TreeView/context.ts +0 -43
  159. package/src/plugins/OutlineTree/components/TreeView/dataStruct.ts +0 -58
  160. package/src/plugins/OutlineTree/components/TreeView/index.tsx +0 -376
  161. package/src/plugins/OutlineTree/components/TreeView/style.module.scss +0 -93
  162. package/src/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +0 -16
  163. package/src/plugins/OutlineTree/components/TreeView/treeNode.tsx +0 -271
  164. package/src/plugins/OutlineTree/index.tsx +0 -39
  165. package/src/plugins/OutlineTree/localize/en_US/index.ts +0 -3
  166. package/src/plugins/OutlineTree/localize/index.ts +0 -3
  167. package/src/plugins/OutlineTree/localize/zh_CN/index.ts +0 -3
  168. package/src/plugins/OutlineTree/util.tsx +0 -302
  169. package/src/plugins/PropertyPanel/index.tsx +0 -63
  170. package/src/plugins/PropertyPanel/style.module.scss +0 -12
  171. package/src/plugins/PropertyPanel/style.module.scss.d.ts +0 -10
  172. package/src/plugins/PropertyPanel/utils.ts +0 -13
  173. package/src/plugins/RightPanel/index.tsx +0 -30
  174. package/src/plugins/RightPanel/style.module.scss +0 -16
  175. package/src/plugins/RightPanel/style.module.scss.d.ts +0 -10
  176. package/src/plugins/RightPanel/view.tsx +0 -177
  177. package/src/plugins/VisualPanel/index.tsx +0 -185
  178. package/src/plugins/VisualPanel/style.module.scss +0 -17
  179. package/src/plugins/VisualPanelPlus/index.tsx +0 -103
  180. package/src/plugins/VisualPanelPlus/style.module.scss +0 -20
  181. package/src/plugins/VisualPanelPlus/style.module.scss.d.ts +0 -10
  182. package/src/plugins/index.tsx +0 -26
  183. package/src/stories/Button.jsx +0 -50
  184. package/src/stories/Button.stories.jsx +0 -40
  185. package/src/stories/Introduction.stories.mdx +0 -194
  186. package/src/stories/assets/code-brackets.svg +0 -1
  187. package/src/stories/assets/colors.svg +0 -1
  188. package/src/stories/assets/comments.svg +0 -1
  189. package/src/stories/assets/direction.svg +0 -1
  190. package/src/stories/assets/flow.svg +0 -1
  191. package/src/stories/assets/plugin.svg +0 -1
  192. package/src/stories/assets/repo.svg +0 -1
  193. package/src/stories/assets/stackalt.svg +0 -1
  194. package/src/stories/button.css +0 -30
  195. package/src/stories/plugins/CSSEditor.stories.tsx +0 -75
  196. package/src/stories/plugins/VisualPanelPlus.stories.tsx +0 -74
  197. package/src/style.d.ts +0 -2
  198. package/src/typing.d.ts +0 -9
  199. package/src/utils/css.ts +0 -88
  200. package/src/utils/defaultEngineConfig.tsx +0 -55
  201. package/src/utils/index.ts +0 -12
  202. package/src/utils/logger.ts +0 -4
  203. package/src/vite-env.d.ts +0 -1
  204. package/tsconfig.json +0 -32
@@ -23,6 +23,10 @@ interface RightPanelState {
23
23
  export declare class RightPanel extends React.Component<RightPanelProps, RightPanelState> {
24
24
  constructor(props: RightPanelProps);
25
25
  addPanel: (panel: CRightPanelItem) => void;
26
+ removePanel: (panelName: string) => void;
27
+ replacePanel: (panelName: string, newPanel: CRightPanelItem) => void;
28
+ choosePanel: (panelName: string) => void;
29
+ /** 更新被展示的 panel, 根据 panel 的 show 方法 */
26
30
  updatePanels: () => {
27
31
  panels: CRightPanelItem[];
28
32
  displayPanels: CRightPanelItem[];
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@chamn/engine",
3
- "version": "0.0.10",
4
- "main": "dist/index.cjs.js",
5
- "module": "dist/index.es.js",
3
+ "version": "0.0.11",
4
+ "files": [
5
+ "dist"
6
+ ],
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.mjs",
6
9
  "types": "dist/index.d.ts",
7
10
  "publishConfig": {
8
11
  "access": "public"
@@ -31,9 +34,9 @@
31
34
  },
32
35
  "dependencies": {
33
36
  "@ant-design/icons": "^4.8.0",
34
- "@chamn/layout": "0.0.10",
35
- "@chamn/model": "0.0.10",
36
- "@chamn/render": "0.0.10",
37
+ "@chamn/layout": "0.0.11",
38
+ "@chamn/model": "0.0.11",
39
+ "@chamn/render": "0.0.11",
37
40
  "@dnd-kit/core": "^6.0.7",
38
41
  "@dnd-kit/modifiers": "^6.0.1",
39
42
  "@dnd-kit/sortable": "^7.0.2",
@@ -52,8 +55,8 @@
52
55
  },
53
56
  "devDependencies": {
54
57
  "@babel/core": "^7.21.0",
55
- "@chamn/build-script": "0.0.10",
56
- "@chamn/demo-page": "0.0.10",
58
+ "@chamn/build-script": "0.0.11",
59
+ "@chamn/demo-page": "0.0.11",
57
60
  "@storybook/addon-actions": "^6.5.16",
58
61
  "@storybook/addon-essentials": "^6.5.16",
59
62
  "@storybook/addon-interactions": "^6.5.16",
@@ -75,5 +78,5 @@
75
78
  "vite-plugin-monaco-editor": "^1.1.0"
76
79
  },
77
80
  "config": {},
78
- "gitHead": "89c4cfa2d5a7a8e60970e7317616e564ddd626e1"
81
+ "gitHead": "dab187afcca315664284a4bc03d01a40a43e1cdf"
79
82
  }
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- .*
package/.eslintrc.js DELETED
@@ -1,36 +0,0 @@
1
- /* eslint-disable no-undef */
2
- module.exports = {
3
- root: true,
4
- settings: {
5
- react: {
6
- version: 'detect',
7
- },
8
- },
9
- env: {
10
- browser: true,
11
- es2021: true,
12
- },
13
- extends: [
14
- 'eslint:recommended',
15
- 'plugin:react/recommended',
16
- 'plugin:@typescript-eslint/recommended',
17
- 'plugin:react/jsx-runtime',
18
- ],
19
- parser: '@typescript-eslint/parser',
20
- parserOptions: {
21
- ecmaFeatures: {
22
- jsx: true,
23
- },
24
- ecmaVersion: 'latest',
25
- sourceType: 'module',
26
- },
27
- plugins: ['react', '@typescript-eslint', 'react-hooks'],
28
- rules: {
29
- 'no-debugger': 0,
30
- indent: ['error', 2],
31
- 'linebreak-style': ['error', 'unix'],
32
- quotes: ['error', 'single'],
33
- semi: ['error', 'always'],
34
- '@typescript-eslint/ban-types': 'warn',
35
- },
36
- };
package/.prettierrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "trailingComma": "es5",
3
- "tabWidth": 2,
4
- "semi": true,
5
- "singleQuote": true,
6
- "printWidth": 120
7
- }
@@ -1,24 +0,0 @@
1
- const { mergeConfig } = require('vite');
2
- const viteConfig = require('../build.config').vite;
3
- module.exports = {
4
- stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
5
- addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],
6
- framework: '@storybook/react',
7
- core: {
8
- builder: '@storybook/builder-vite',
9
- },
10
- async viteFinal(config) {
11
- return mergeConfig(config, {
12
- // Use the same "resolve" configuration as your app
13
- resolve: viteConfig.resolve,
14
- css: viteConfig.css,
15
- // Add dependencies to pre-optimization
16
- optimizeDeps: {
17
- include: ['storybook-dark-mode'],
18
- },
19
- define: {
20
- global: 'window',
21
- },
22
- });
23
- },
24
- };
@@ -1,9 +0,0 @@
1
- export const parameters = {
2
- actions: { argTypesRegex: "^on[A-Z].*" },
3
- controls: {
4
- matchers: {
5
- color: /(background|color)$/i,
6
- date: /Date$/,
7
- },
8
- },
9
- }
package/CHANGELOG.md DELETED
@@ -1,54 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.0.10](https://github.com/ByteCrazy/chameleon/compare/v0.0.9...v0.0.10) (2023-04-17)
7
-
8
- **Note:** Version bump only for package @chamn/engine
9
-
10
- ## [0.0.9](https://github.com/ByteCrazy/chameleon/compare/v0.0.8...v0.0.9) (2023-04-17)
11
-
12
- ### ✨ Features | 新功能
13
-
14
- * **docs-website, engine, render:** 🎸 render add collectVariable flatObject util method ([ae25160](https://github.com/ByteCrazy/chameleon/commit/ae25160b568c267041b3827e836c95f60ecaee59))
15
-
16
- ## [0.0.8](https://github.com/ByteCrazy/chameleon/compare/v0.0.7...v0.0.8) (2023-04-16)
17
-
18
- ### ✨ Features | 新功能
19
-
20
- * **build-script, engine, layout, model, render:** 🎸 optimize pack package ([78d99c5](https://github.com/ByteCrazy/chameleon/commit/78d99c507ad65ca39101f0239467737d2b445c87))
21
- * **docs-website, engine, layout:** 🎸 add defaultRender for engine, add some docs ([91f4257](https://github.com/ByteCrazy/chameleon/commit/91f4257e9f9b9391267e4b8d64e6ed811912381f))
22
- * **docs-website, engine:** 🎸 add docs ([0e6f605](https://github.com/ByteCrazy/chameleon/commit/0e6f6053fa3cd5e13b6a7a8258c27518c30470c5))
23
-
24
- ### 📝 Documentation | 文档
25
-
26
- * **docs-website, engine:** ✏️ add doc ([2fb5cf5](https://github.com/ByteCrazy/chameleon/commit/2fb5cf5fd4dcb3859ecbdc8d42adf787d9e0255d))
27
-
28
- ## [0.0.7](https://github.com/ByteCrazy/chameleon/compare/v0.0.6...v0.0.7) (2023-03-29)
29
-
30
- ### ✨ Features | 新功能
31
-
32
- * **build-script, build-script-example, demo-page, engine, layout, material, model, render:** 🎸 external monaco eitor and remove style panel ([494d898](https://github.com/ByteCrazy/chameleon/commit/494d898fd75dabe84d867ff45e84ae63f9b59c5e))
33
-
34
- ## [0.0.6](https://github.com/ByteCrazy/chameleon/compare/v0.0.5...v0.0.6) (2023-03-28)
35
-
36
- **Note:** Version bump only for package @chamn/engine
37
-
38
- ## [0.0.5](https://github.com/ByteCrazy/chameleon/compare/v0.0.4...v0.0.5) (2023-03-28)
39
-
40
- ### ✨ Features | 新功能
41
-
42
- * **build-script, engine, layout, material, model, render:** 🎸 complete package info ([86b095d](https://github.com/ByteCrazy/chameleon/commit/86b095da6c955946300591b1775f59c1a141c065))
43
-
44
- ## [0.0.4](https://github.com/ByteCrazy/chameleon/compare/v0.0.3...v0.0.4) (2023-03-27)
45
-
46
- ### 🐛 Bug Fixes | Bug 修复
47
-
48
- * **engine:** 🐛 fixed engine d.ts path not correct problem ([fb20ca6](https://github.com/ByteCrazy/chameleon/commit/fb20ca604fff4e85b0264eff6383154ecfefd437))
49
-
50
- ## [0.0.2](https://github.com/ByteCrazy/chameleon/compare/v0.0.1...v0.0.2) (2023-03-27)
51
-
52
- ### 🐛 Bug Fixes | Bug 修复
53
-
54
- * **engine:** 🐛 fix engine not incluce dist folder ([fc2c39e](https://github.com/ByteCrazy/chameleon/commit/fc2c39e88aa2eeb82ba5e3989e5bdf244d112dfb))
@@ -1,3 +0,0 @@
1
- test('adds 1 + 2 to equal 3', () => {
2
- expect(3).toBe(3);
3
- });
package/build.config.js DELETED
@@ -1,88 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- /* eslint-disable no-undef */
3
-
4
- const path = require('path');
5
- const { visualizer } = require('rollup-plugin-visualizer');
6
- const monacoEditorPlugin = require('vite-plugin-monaco-editor').default;
7
-
8
- // 开发模式默认读取 index.html 作为开发模式入口
9
- // entry 作为打包库入口
10
- const plugins = [];
11
-
12
- if (process.env.ANALYZE) {
13
- plugins.push(
14
- visualizer({
15
- open: true,
16
- emitFile: false,
17
- gzipSize: true,
18
- brotliSize: true,
19
- })
20
- );
21
- }
22
-
23
- if (process.env.BUILD_TYPE !== 'PKG') {
24
- plugins.push(
25
- monacoEditorPlugin({
26
- customDistPath: (root, buildOutDir) => {
27
- console.log(111, root, buildOutDir);
28
- return path.resolve(__dirname, './example/monacoeditorwork');
29
- },
30
- })
31
- );
32
- }
33
-
34
- const mainConfig = {
35
- libMode: process.env.BUILD_TYPE !== 'APP',
36
- entry: './src/index.tsx',
37
- // libName: 'CEngine',
38
- fileName: 'index',
39
- external:
40
- process.env.BUILD_TYPE === 'APP'
41
- ? []
42
- : ['react', 'react-dom', 'monaco-editor', 'antd', '@chamn/model', '@chamn/layout'],
43
- global: {
44
- react: 'React',
45
- 'react-dom': 'ReactDOM',
46
- },
47
- vite: {
48
- base: process.env.BUILD_TYPE === 'APP' ? '/chameleon/' : '',
49
- build: {
50
- outDir: process.env.BUILD_TYPE === 'APP' ? './example' : './dist',
51
- copyPublicDir: process.env.BUILD_TYPE === 'APP',
52
- },
53
- plugins: plugins,
54
- resolve: {
55
- alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
56
- },
57
- css: {
58
- preprocessorOptions: {
59
- scss: {
60
- additionalData: '@import "@/assets/styles/mixin.scss";',
61
- },
62
- },
63
- },
64
- },
65
- };
66
-
67
- const renderConfig = {
68
- entry: './src/_dev_/render.ts',
69
- formats: ['umd'],
70
- libName: 'CRender',
71
- fileName: 'render',
72
- external: ['react', 'react-dom'],
73
- global: {
74
- react: 'React',
75
- 'react-dom': 'ReactDOM',
76
- },
77
- // 额外的 vite 配置
78
- vite: {
79
- build: {
80
- copyPublicDir: false,
81
- outDir: './public',
82
- },
83
- define: { 'process.env': {} },
84
- },
85
- };
86
-
87
- const config = process.env.BUILD_TYPE === 'Render' ? renderConfig : mainConfig;
88
- module.exports = config;