mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-02-17 17:40:31 +08:00
build(chakra): split chakra widgets and lib
This commit is contained in:
parent
8ac96a88f9
commit
bf73eebbfb
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,4 +15,6 @@ tsconfig.tsbuildinfo
|
||||
typings
|
||||
|
||||
# jest test coverage
|
||||
coverage
|
||||
coverage
|
||||
|
||||
stats.html
|
||||
|
@ -10,13 +10,12 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/smartxworks/sunmao-ui-arco-lib.git"
|
||||
},
|
||||
"main": "dist/index.cjs",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"lib"
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
@ -14,7 +14,6 @@
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": false,
|
||||
"emitDeclarationOnly": true,
|
||||
"jsx": "react-jsx",
|
||||
"outDir": "./lib",
|
||||
"baseUrl": "./",
|
||||
|
@ -13,20 +13,18 @@
|
||||
"url": "git+https://github.com/smartxworks/sunmao-ui.git"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"unpkg": "dist/iife/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"module": "dist/index.mjs",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"lib"
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"test": "jest",
|
||||
"build": "tsup src/index.ts src/widgets/index.ts --format cjs,esm,iife --legacy-output --inject ./react-import.js --clean --no-splitting --sourcemap",
|
||||
"typings": "tsc --emitDeclarationOnly",
|
||||
"build": "tsup",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"prepublish": "npm run build && npm run typings"
|
||||
"prepublish": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/icons": "^1.0.15",
|
||||
@ -49,7 +47,7 @@
|
||||
"@vitejs/plugin-react": "^1.0.1",
|
||||
"babel-jest": "^27.1.0",
|
||||
"jest": "^27.1.0",
|
||||
"tsup": "^5.5.0",
|
||||
"tsup": "^5.11.11",
|
||||
"typescript": "^4.5.0",
|
||||
"vite": "^2.6.13"
|
||||
},
|
||||
|
@ -1,64 +1,2 @@
|
||||
import { SunmaoLib } from '@sunmao-ui/runtime';
|
||||
import ChakraUIRoot from './components/Root';
|
||||
import ChakraUIButton from './components/Button';
|
||||
import ChakraUITabs from './components/Tabs';
|
||||
import ChakraUITable from './components/Table';
|
||||
import ChakraUIInput from './components/Input';
|
||||
import ChakraUIBox from './components/Box';
|
||||
import ChakraUIDivider from './components/Divider';
|
||||
import ChakraUIFormControl from './components/Form/FormControl';
|
||||
import ChakraUIForm from './components/Form/Form';
|
||||
import ChakraUIKbd from './components/Kbd';
|
||||
import ChakraUIList from './components/List';
|
||||
import ChakraUILink from './components/Link';
|
||||
import ChakraUINumberInput from './components/NumberInput';
|
||||
import ChakraUIMultiSelect from './components/MultiSelect';
|
||||
import ChakraUICheckboxGroup from './components/CheckboxGroup';
|
||||
import ChakraUICheckbox from './components/Checkbox';
|
||||
import ChakraUIStack from './components/Stack';
|
||||
import ChakraUISwitch from './components/Switch';
|
||||
import ChakraUITooltip from './components/Tooltip';
|
||||
import ChakraUIHStack from './components/HStack';
|
||||
import ChakraUIVStack from './components/VStack';
|
||||
import ChakraUIImage from './components/Image';
|
||||
import ChakraUIDialog from './components/Dialog';
|
||||
import ChakraUISelect from './components/Select';
|
||||
import ChakraUIRadioGroup from './components/RadioGroup';
|
||||
import ChakraUIRadio from './components/Radio';
|
||||
import ChakraUIToastUtilMethodFactory from './components/Types/Toast';
|
||||
|
||||
export const sunmaoChakraUILib: SunmaoLib = {
|
||||
components: [
|
||||
ChakraUIRoot,
|
||||
ChakraUIButton,
|
||||
ChakraUITabs,
|
||||
ChakraUITable,
|
||||
ChakraUIInput,
|
||||
ChakraUIBox,
|
||||
ChakraUIDivider,
|
||||
ChakraUIFormControl,
|
||||
ChakraUIForm,
|
||||
ChakraUIKbd,
|
||||
ChakraUIList,
|
||||
ChakraUILink,
|
||||
ChakraUIMultiSelect,
|
||||
ChakraUINumberInput,
|
||||
ChakraUICheckbox,
|
||||
ChakraUICheckboxGroup,
|
||||
ChakraUIStack,
|
||||
ChakraUISwitch,
|
||||
ChakraUITooltip,
|
||||
ChakraUIHStack,
|
||||
ChakraUIVStack,
|
||||
ChakraUIImage,
|
||||
ChakraUIDialog,
|
||||
ChakraUISelect,
|
||||
ChakraUIRadioGroup,
|
||||
ChakraUIRadio,
|
||||
],
|
||||
traits: [],
|
||||
modules: [],
|
||||
utilMethods: [ChakraUIToastUtilMethodFactory],
|
||||
};
|
||||
|
||||
export { sunmaoChakraUILib } from './lib';
|
||||
export { widgets } from './widgets';
|
||||
|
62
packages/chakra-ui-lib/src/lib.ts
Normal file
62
packages/chakra-ui-lib/src/lib.ts
Normal file
@ -0,0 +1,62 @@
|
||||
import { SunmaoLib } from '@sunmao-ui/runtime';
|
||||
import ChakraUIRoot from './components/Root';
|
||||
import ChakraUIButton from './components/Button';
|
||||
import ChakraUITabs from './components/Tabs';
|
||||
import ChakraUITable from './components/Table';
|
||||
import ChakraUIInput from './components/Input';
|
||||
import ChakraUIBox from './components/Box';
|
||||
import ChakraUIDivider from './components/Divider';
|
||||
import ChakraUIFormControl from './components/Form/FormControl';
|
||||
import ChakraUIForm from './components/Form/Form';
|
||||
import ChakraUIKbd from './components/Kbd';
|
||||
import ChakraUIList from './components/List';
|
||||
import ChakraUILink from './components/Link';
|
||||
import ChakraUINumberInput from './components/NumberInput';
|
||||
import ChakraUIMultiSelect from './components/MultiSelect';
|
||||
import ChakraUICheckboxGroup from './components/CheckboxGroup';
|
||||
import ChakraUICheckbox from './components/Checkbox';
|
||||
import ChakraUIStack from './components/Stack';
|
||||
import ChakraUISwitch from './components/Switch';
|
||||
import ChakraUITooltip from './components/Tooltip';
|
||||
import ChakraUIHStack from './components/HStack';
|
||||
import ChakraUIVStack from './components/VStack';
|
||||
import ChakraUIImage from './components/Image';
|
||||
import ChakraUIDialog from './components/Dialog';
|
||||
import ChakraUISelect from './components/Select';
|
||||
import ChakraUIRadioGroup from './components/RadioGroup';
|
||||
import ChakraUIRadio from './components/Radio';
|
||||
import ChakraUIToastUtilMethodFactory from './components/Types/Toast';
|
||||
|
||||
export const sunmaoChakraUILib: SunmaoLib = {
|
||||
components: [
|
||||
ChakraUIRoot,
|
||||
ChakraUIButton,
|
||||
ChakraUITabs,
|
||||
ChakraUITable,
|
||||
ChakraUIInput,
|
||||
ChakraUIBox,
|
||||
ChakraUIDivider,
|
||||
ChakraUIFormControl,
|
||||
ChakraUIForm,
|
||||
ChakraUIKbd,
|
||||
ChakraUIList,
|
||||
ChakraUILink,
|
||||
ChakraUIMultiSelect,
|
||||
ChakraUINumberInput,
|
||||
ChakraUICheckbox,
|
||||
ChakraUICheckboxGroup,
|
||||
ChakraUIStack,
|
||||
ChakraUISwitch,
|
||||
ChakraUITooltip,
|
||||
ChakraUIHStack,
|
||||
ChakraUIVStack,
|
||||
ChakraUIImage,
|
||||
ChakraUIDialog,
|
||||
ChakraUISelect,
|
||||
ChakraUIRadioGroup,
|
||||
ChakraUIRadio,
|
||||
],
|
||||
traits: [],
|
||||
modules: [],
|
||||
utilMethods: [ChakraUIToastUtilMethodFactory],
|
||||
};
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"extends": "../../config/tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ES6",
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"outDir": "./lib",
|
||||
|
11
packages/chakra-ui-lib/tsup.config.ts
Normal file
11
packages/chakra-ui-lib/tsup.config.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { defineConfig } from 'tsup';
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['src/lib.ts', 'src/index.ts', 'src/widgets/index.ts'],
|
||||
format: ['cjs', 'esm', 'iife'],
|
||||
inject: ['./react-import.js'],
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
dts: true,
|
||||
});
|
@ -8,3 +8,4 @@ export * from './version';
|
||||
export * from './slot';
|
||||
export * from './utilMethod';
|
||||
export * from './schema';
|
||||
export * from './metadata';
|
||||
|
@ -17,7 +17,7 @@ import { CORE_VERSION, CoreComponentName } from '@sunmao-ui/shared';
|
||||
import { isEqual } from 'lodash';
|
||||
import { resolveApplicationComponents } from '../utils/resolveApplicationComponents';
|
||||
import { AppModelManager } from '../operations/AppModelManager';
|
||||
import type { Metadata } from '@sunmao-ui/core/lib/metadata';
|
||||
import type { Metadata } from '@sunmao-ui/core';
|
||||
|
||||
type EditingTarget = {
|
||||
kind: 'app' | 'module';
|
||||
|
@ -14,7 +14,7 @@
|
||||
import { initSunmaoUI } from './src';
|
||||
import { ChakraProvider } from '@chakra-ui/react';
|
||||
import { sunmaoChakraUILib } from '@sunmao-ui/chakra-ui-lib';
|
||||
import { ArcoDesignLib } from '@sunmao-ui/arco-lib';
|
||||
import { ArcoDesignLib } from '@sunmao-ui/arco-lib/lib';
|
||||
import examples from '@example.json';
|
||||
import '@arco-design/web-react/dist/css/arco.css';
|
||||
|
||||
|
37
yarn.lock
37
yarn.lock
@ -4220,6 +4220,13 @@
|
||||
use-debounce "^6.0.1"
|
||||
web-vitals "^0.2.2"
|
||||
|
||||
"@originjs/vite-plugin-commonjs@^1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@originjs/vite-plugin-commonjs/-/vite-plugin-commonjs-1.0.3.tgz#2e3fb11ec78847da9422b79c103953f94d667f09"
|
||||
integrity sha512-KuEXeGPptM2lyxdIEJ4R11+5ztipHoE7hy8ClZt3PYaOVQ/pyngd2alaSrPnwyFeOW1UagRBaQ752aA1dTMdOQ==
|
||||
dependencies:
|
||||
esbuild "^0.14.14"
|
||||
|
||||
"@popperjs/core@2.4.4":
|
||||
version "2.4.4"
|
||||
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.4.4.tgz#11d5db19bd178936ec89cd84519c4de439574398"
|
||||
@ -5571,11 +5578,6 @@ cac@^6.7.12:
|
||||
resolved "https://registry.npmjs.org/cac/-/cac-6.7.12.tgz"
|
||||
integrity sha512-rM7E2ygtMkJqD9c7WnFU6fruFcN3xe4FM5yUmgxhZzIKJk4uHl9U/fhwdajGFQbQuv43FAUo1Fe8gX/oIKDeSA==
|
||||
|
||||
cac@^6.7.2:
|
||||
version "6.7.11"
|
||||
resolved "https://registry.npmjs.org/cac/-/cac-6.7.11.tgz"
|
||||
integrity sha512-m4xrA2MKfid6uDV2j2+0mXrtPGxlvAW0y+7Gnn2P8WVMSG+4e4tcoYX++94ZPblPfpBccJ5e7HvKdghlX5yiDA==
|
||||
|
||||
cacache@^15.0.5, cacache@^15.2.0:
|
||||
version "15.3.0"
|
||||
resolved "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz"
|
||||
@ -7112,7 +7114,7 @@ esbuild-windows-arm64@0.14.7:
|
||||
resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.7.tgz#ecfd9ac289606f26760c4f737caaeeadfff3cfe3"
|
||||
integrity sha512-eOs1eSivOqN7cFiRIukEruWhaCf75V0N8P0zP7dh44LIhLl8y6/z++vv9qQVbkBm5/D7M7LfCfCTmt1f1wHOCw==
|
||||
|
||||
esbuild@^0.13.2, esbuild@^0.13.4:
|
||||
esbuild@^0.13.2:
|
||||
version "0.13.12"
|
||||
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.13.12.tgz"
|
||||
integrity sha512-vTKKUt+yoz61U/BbrnmlG9XIjwpdIxmHB8DlPR0AAW6OdS+nBQBci6LUHU2q9WbBobMEIQxxDpKbkmOGYvxsow==
|
||||
@ -11792,7 +11794,7 @@ rollup@^2.42.3:
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
rollup@^2.56.1, rollup@^2.57.0:
|
||||
rollup@^2.57.0:
|
||||
version "2.59.0"
|
||||
resolved "https://registry.npmjs.org/rollup/-/rollup-2.59.0.tgz"
|
||||
integrity sha512-l7s90JQhCQ6JyZjKgo7Lq1dKh2RxatOM+Jr6a9F7WbS9WgKbocyUSeLmZl8evAse7y96Ae98L2k1cBOwWD8nHw==
|
||||
@ -12369,7 +12371,7 @@ stylis@^4.0.10:
|
||||
resolved "https://registry.npmjs.org/stylis/-/stylis-4.0.10.tgz"
|
||||
integrity sha512-m3k+dk7QeJw660eIKRRn3xPF6uuvHs/FFzjX3HQ5ove0qYsiygoAhwn5a3IYKaZPo5LrYD0rfVmtv1gNY1uYwg==
|
||||
|
||||
sucrase@^3.20.1, sucrase@^3.20.3:
|
||||
sucrase@^3.20.3:
|
||||
version "3.20.3"
|
||||
resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.20.3.tgz"
|
||||
integrity sha512-azqwq0/Bs6RzLAdb4dXxsCgMtAaD2hzmUr4UhSfsxO46JFPAwMnnb441B/qsudZiS6Ylea3JXZe3Q497lsgXzQ==
|
||||
@ -12742,25 +12744,6 @@ tsup@^5.11.11:
|
||||
sucrase "^3.20.3"
|
||||
tree-kill "^1.2.2"
|
||||
|
||||
tsup@^5.5.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.npmjs.org/tsup/-/tsup-5.5.0.tgz"
|
||||
integrity sha512-khx/80b15RxK00UWqWlaizvrwO8kDZFBM0AbORKfjwKxxmzLuu35ceubzLg3wJgZ21E0BCLrCainh4zzJYImoA==
|
||||
dependencies:
|
||||
cac "^6.7.2"
|
||||
chalk "^4.1.0"
|
||||
chokidar "^3.5.1"
|
||||
debug "^4.3.1"
|
||||
esbuild "^0.13.4"
|
||||
execa "^5.0.0"
|
||||
globby "^11.0.3"
|
||||
joycon "^3.0.1"
|
||||
postcss-load-config "^3.0.1"
|
||||
resolve-from "^5.0.0"
|
||||
rollup "^2.56.1"
|
||||
sucrase "^3.20.1"
|
||||
tree-kill "^1.2.2"
|
||||
|
||||
tsutils@^3.21.0:
|
||||
version "3.21.0"
|
||||
resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz"
|
||||
|
Loading…
Reference in New Issue
Block a user