mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-06 21:40:23 +08:00
editor init
This commit is contained in:
parent
35f33e0073
commit
c3429e19bb
11
packages/editor/README.md
Normal file
11
packages/editor/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# `editor`
|
||||
|
||||
> TODO: description
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
const editor = require('editor');
|
||||
|
||||
// TODO: DEMONSTRATE API
|
||||
```
|
7
packages/editor/__tests__/editor.test.js
Normal file
7
packages/editor/__tests__/editor.test.js
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const editor = require('..');
|
||||
|
||||
describe('editor', () => {
|
||||
it('needs tests');
|
||||
});
|
7
packages/editor/babel.config.js
Normal file
7
packages/editor/babel.config.js
Normal file
@ -0,0 +1,7 @@
|
||||
// only for jest
|
||||
module.exports = {
|
||||
presets: [
|
||||
['@babel/preset-env', { targets: { node: 'current' } }],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
};
|
3
packages/editor/jest.config.js
Normal file
3
packages/editor/jest.config.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
...require("../../config/jest.config"),
|
||||
};
|
51
packages/editor/package.json
Normal file
51
packages/editor/package.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "editor",
|
||||
"version": "0.0.0",
|
||||
"description": "meta-ui editor",
|
||||
"author": "Bowen Tan <bowen.tan@smartx.com>",
|
||||
"homepage": "https://github.com/webzard-io/meta-ui#readme",
|
||||
"license": "MIT",
|
||||
"main": "src/main.tsx",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"test": "jest"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "http://192.168.26.29:7001"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/webzard-io/meta-ui.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webzard-io/meta-ui/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/react": "^1.6.8",
|
||||
"@emotion/react": "^11.4.1",
|
||||
"@emotion/styled": "^11.3.0",
|
||||
"lodash": "^4.17.21",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react-refresh": "^1.3.6",
|
||||
"typescript": "^4.4.3",
|
||||
"vite": "^2.5.10",
|
||||
"vite-tsconfig-paths": "^3.3.14",
|
||||
"babel-jest": "^27.2.1",
|
||||
"jest": "^27.2.1"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx,html}": [
|
||||
"prettier --write",
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
13
packages/editor/src/main.tsx
Normal file
13
packages/editor/src/main.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
export default function renderApp() {
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<div>Hello, editor</div>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
}
|
||||
|
||||
renderApp();
|
1
packages/editor/src/vite-env.d.ts
vendored
Normal file
1
packages/editor/src/vite-env.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
29
packages/editor/tsconfig.json
Normal file
29
packages/editor/tsconfig.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": false,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react",
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"types": ["@emotion/react/types/css-prop"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@components/*": ["src/components/*"],
|
||||
"@traits/*": ["src/traits/*"],
|
||||
"@types/*": ["src/types/*"],
|
||||
"@utils/*": ["src/utils/*"],
|
||||
},
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
17
packages/editor/vite.config.ts
Normal file
17
packages/editor/vite.config.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import reactRefresh from '@vitejs/plugin-react-refresh';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [reactRefresh(), tsconfigPaths()],
|
||||
define: {
|
||||
// https://github.com/satya164/react-simple-code-editor/issues/86
|
||||
global: 'globalThis',
|
||||
},
|
||||
esbuild: {
|
||||
// https://dev.to/ajitsinghkamal/using-emotionjs-with-vite-2ndj
|
||||
jsxFactory: 'jsx',
|
||||
jsxInject: 'import { jsx } from "@emotion/react"',
|
||||
},
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user