├── .gitignore
├── FPS
├── .vscode
│ └── settings.json
├── index.html
└── index.js
├── common
├── index.ts
└── package.json
├── main
├── .gitignore
├── .vscode
│ └── extensions.json
├── README.md
├── env.d.ts
├── index.html
├── package.json
├── public
│ └── favicon.ico
├── src
│ ├── App.vue
│ ├── assets
│ │ ├── base.css
│ │ ├── logo.svg
│ │ └── main.css
│ ├── components
│ │ ├── icons
│ │ │ ├── IconCommunity.vue
│ │ │ ├── IconDocumentation.vue
│ │ │ ├── IconEcosystem.vue
│ │ │ ├── IconSupport.vue
│ │ │ └── IconTooling.vue
│ │ ├── react.vue
│ │ └── vue3.vue
│ ├── main.ts
│ ├── router
│ │ └── index.ts
│ └── views
│ │ ├── AboutView.vue
│ │ └── HomeView.vue
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
├── moudle
├── host
│ ├── bootstrap.js
│ ├── index.html
│ ├── index.js
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── webpack.config.js
└── remote
│ ├── bootstrap.js
│ ├── index.html
│ ├── index.js
│ ├── list.js
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── webpack.config.js
├── package.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── web
├── react-demo
│ ├── .gitignore
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── assets
│ │ │ └── react.svg
│ │ ├── index.css
│ │ ├── main.tsx
│ │ └── vite-env.d.ts
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
└── vue-demo
│ ├── .gitignore
│ ├── .vscode
│ └── extensions.json
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── public
│ └── vite.svg
│ ├── src
│ ├── App.vue
│ ├── assets
│ │ └── vue.svg
│ ├── components
│ │ └── HelloWorld.vue
│ ├── main.ts
│ ├── style.css
│ └── vite-env.d.ts
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
└── wujie-vue-setup
├── .swcrc
├── README.md
├── esm
└── index.js
├── index.d.ts
├── lib
├── index.js
└── index.js.LICENSE.txt
├── package.json
├── pnpm-lock.yaml
├── src
├── index.ts
└── type.ts
├── tsconfig.json
└── webpack.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 |
--------------------------------------------------------------------------------
/FPS/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "liveServer.settings.port": 5501
3 | }
--------------------------------------------------------------------------------
/FPS/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/FPS/index.js:
--------------------------------------------------------------------------------
1 | //60FPS
2 | //1000 / 60 = 16.666666666666668
3 | //一帧就是16.6ms
4 | //1.处理用户的事件,就是event 例如 click,input change 等。
5 | //2.执行定时器任务
6 | //3.执行 requestAnimationFrame
7 | //4.执行dom 的回流与重绘
8 | //5.计算更新图层的绘制指令
9 | //6.绘制指令合并主线程 如果有空余时间会执行 requestidlecallback
10 |
11 | //第二种情况
12 | //第二种情况是没有任务执行浏览器会有50ms空闲时间,这个时间段也会执行 requestidlecallback
13 |
14 | //预加载相关的东西
15 | requestIdleCallback(function (deadline) {
16 | console.log(deadline.timeRemaining());
17 | })
18 |
19 | //react相关人员调研 requestIdleCallback 有机会是20ms执行的 polyfill
20 | //react16 postMessage + requestAnimationFrame
21 | //setTimeout 0 是4ms
22 | //react18 MessageChannel 实现了requestIdleCallback 的polyfill
23 | let {port1,port2} = new MessageChannel()
24 | //onmessage 隐试开启start
25 | port1.onmessage = function(e){
26 | console.log('收到了port2的消息',e)
27 | }
28 |
29 | port2.onmessage = function(e){
30 | console.log('收到了port1的消息',e)
31 | }
32 |
33 | port1.postMessage('hello')
34 | port2.postMessage('world')
--------------------------------------------------------------------------------
/common/index.ts:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 |
3 | export const a = axios.get('xxxx')
4 |
5 | export const b = axios.post('xxxx')
--------------------------------------------------------------------------------
/common/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "common",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "axios": "^1.3.4"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/main/.gitignore:
--------------------------------------------------------------------------------
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 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/main/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/main/README.md:
--------------------------------------------------------------------------------
1 | # main
2 |
3 | This template should help get you started developing with Vue 3 in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8 |
9 | ## Type Support for `.vue` Imports in TS
10 |
11 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
12 |
13 | If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
14 |
15 | 1. Disable the built-in TypeScript Extension
16 | 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17 | 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18 | 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19 |
20 | ## Customize configuration
21 |
22 | See [Vite Configuration Reference](https://vitejs.dev/config/).
23 |
24 | ## Project Setup
25 |
26 | ```sh
27 | npm install
28 | ```
29 |
30 | ### Compile and Hot-Reload for Development
31 |
32 | ```sh
33 | npm run dev
34 | ```
35 |
36 | ### Type-Check, Compile and Minify for Production
37 |
38 | ```sh
39 | npm run build
40 | ```
41 |
--------------------------------------------------------------------------------
/main/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/main/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/main/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "main",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "run-p type-check build-only",
8 | "preview": "vite preview",
9 | "build-only": "vite build",
10 | "type-check": "vue-tsc --noEmit"
11 | },
12 | "dependencies": {
13 | "common": "workspace:^1.0.0",
14 | "vue": "^3.2.47",
15 | "vue-router": "^4.1.6",
16 | "wujie": "^1.0.13",
17 | "wujie-vue-setup": "^0.0.4",
18 | "wujie-vue3": "^1.0.13"
19 | },
20 | "devDependencies": {
21 | "@types/node": "^18.14.2",
22 | "@vitejs/plugin-vue": "^4.0.0",
23 | "@vitejs/plugin-vue-jsx": "^3.0.0",
24 | "@vue/tsconfig": "^0.1.3",
25 | "npm-run-all": "^4.1.5",
26 | "typescript": "~4.8.4",
27 | "vite": "^4.1.4",
28 | "vue-tsc": "^1.2.0"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/main/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/message163/wujie-demo/af4287f306c41577755a4cc2425f4464bd6ced9f/main/public/favicon.ico
--------------------------------------------------------------------------------
/main/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
这是主应用
4 | vue3
5 | react
6 |
7 |
8 |
9 |
10 |
11 |
12 |
20 |
21 |
--------------------------------------------------------------------------------
/main/src/assets/base.css:
--------------------------------------------------------------------------------
1 | /* color palette from */
2 | :root {
3 | --vt-c-white: #ffffff;
4 | --vt-c-white-soft: #f8f8f8;
5 | --vt-c-white-mute: #f2f2f2;
6 |
7 | --vt-c-black: #181818;
8 | --vt-c-black-soft: #222222;
9 | --vt-c-black-mute: #282828;
10 |
11 | --vt-c-indigo: #2c3e50;
12 |
13 | --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
14 | --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15 | --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
16 | --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
17 |
18 | --vt-c-text-light-1: var(--vt-c-indigo);
19 | --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
20 | --vt-c-text-dark-1: var(--vt-c-white);
21 | --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22 | }
23 |
24 | /* semantic color variables for this project */
25 | :root {
26 | --color-background: var(--vt-c-white);
27 | --color-background-soft: var(--vt-c-white-soft);
28 | --color-background-mute: var(--vt-c-white-mute);
29 |
30 | --color-border: var(--vt-c-divider-light-2);
31 | --color-border-hover: var(--vt-c-divider-light-1);
32 |
33 | --color-heading: var(--vt-c-text-light-1);
34 | --color-text: var(--vt-c-text-light-1);
35 |
36 | --section-gap: 160px;
37 | }
38 |
39 | @media (prefers-color-scheme: dark) {
40 | :root {
41 | --color-background: var(--vt-c-black);
42 | --color-background-soft: var(--vt-c-black-soft);
43 | --color-background-mute: var(--vt-c-black-mute);
44 |
45 | --color-border: var(--vt-c-divider-dark-2);
46 | --color-border-hover: var(--vt-c-divider-dark-1);
47 |
48 | --color-heading: var(--vt-c-text-dark-1);
49 | --color-text: var(--vt-c-text-dark-2);
50 | }
51 | }
52 |
53 | *,
54 | *::before,
55 | *::after {
56 | box-sizing: border-box;
57 | margin: 0;
58 | position: relative;
59 | font-weight: normal;
60 | }
61 |
62 | body {
63 | min-height: 100vh;
64 | color: var(--color-text);
65 | background: var(--color-background);
66 | transition: color 0.5s, background-color 0.5s;
67 | line-height: 1.6;
68 | font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
69 | Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
70 | font-size: 15px;
71 | text-rendering: optimizeLegibility;
72 | -webkit-font-smoothing: antialiased;
73 | -moz-osx-font-smoothing: grayscale;
74 | }
75 |
--------------------------------------------------------------------------------
/main/src/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/main/src/assets/main.css:
--------------------------------------------------------------------------------
1 | @import './base.css';
2 |
3 | #app {
4 | max-width: 1280px;
5 | margin: 0 auto;
6 | padding: 2rem;
7 |
8 | font-weight: normal;
9 | }
10 |
11 | a,
12 | .green {
13 | text-decoration: none;
14 | color: hsla(160, 100%, 37%, 1);
15 | transition: 0.4s;
16 | }
17 |
18 | @media (hover: hover) {
19 | a:hover {
20 | background-color: hsla(160, 100%, 37%, 0.2);
21 | }
22 | }
23 |
24 | @media (min-width: 1024px) {
25 | body {
26 | display: flex;
27 | place-items: center;
28 | }
29 |
30 | #app {
31 | display: grid;
32 | grid-template-columns: 1fr 1fr;
33 | padding: 0 2rem;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/main/src/components/icons/IconCommunity.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/main/src/components/icons/IconDocumentation.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/main/src/components/icons/IconEcosystem.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/main/src/components/icons/IconSupport.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/main/src/components/icons/IconTooling.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/main/src/components/react.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
79 |
--------------------------------------------------------------------------------
/main/src/components/vue3.vue:
--------------------------------------------------------------------------------
1 |
27 |
28 |
29 |
38 |
39 |
40 |
43 |
--------------------------------------------------------------------------------
/main/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import App from './App.vue'
3 | import router from './router'
4 | import Wujie from 'wujie-vue3' //引入一下引入对应的框架
5 | //import Wujie from 'wujie-vue-setup'
6 | const { preloadApp } = Wujie
7 | const app = createApp(App)
8 |
9 |
10 | app.use(router).use(Wujie) //注册一下
11 |
12 | app.mount('#app')
13 |
14 | preloadApp({ name: "vue3", url: "http://127.0.0.1:5174/", exec: true })
15 | preloadApp({ name: "react", url: "http://127.0.0.1:5175/", exec: true })
--------------------------------------------------------------------------------
/main/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHistory } from 'vue-router'
2 |
3 | const router = createRouter({
4 | history: createWebHistory(import.meta.env.BASE_URL),
5 | routes: [
6 | {
7 | path: '/vue3',
8 | component: ()=> import('@/components/vue3.vue')
9 | },
10 | {
11 | path: '/react',
12 | // route level code-splitting
13 | // this generates a separate chunk (About.[hash].js) for this route
14 | // which is lazy-loaded when the route is visited.
15 | component: () => import('@/components/react.vue')
16 | }
17 | ]
18 | })
19 |
20 | export default router
21 |
--------------------------------------------------------------------------------
/main/src/views/AboutView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This is an about page
4 |
5 |
6 |
7 |
16 |
--------------------------------------------------------------------------------
/main/src/views/HomeView.vue:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/main/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.web.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4 | "compilerOptions": {
5 | "baseUrl": ".",
6 | "paths": {
7 | "@/*": ["./src/*"]
8 | }
9 | },
10 |
11 | "references": [
12 | {
13 | "path": "./tsconfig.node.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/main/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.node.json",
3 | "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
4 | "compilerOptions": {
5 | "composite": true,
6 | "types": ["node"]
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/main/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from 'node:url'
2 |
3 | import { defineConfig } from 'vite'
4 | import vue from '@vitejs/plugin-vue'
5 | import vueJsx from '@vitejs/plugin-vue-jsx'
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig({
9 | plugins: [vue(), vueJsx()],
10 | resolve: {
11 | alias: {
12 | '@': fileURLToPath(new URL('./src', import.meta.url))
13 | }
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/moudle/host/bootstrap.js:
--------------------------------------------------------------------------------
1 | import('remote/addList').then(({ addList }) => {
2 | let app = document.getElementById("app");
3 |
4 | app.innerHTML = "host
";
5 | addList()
6 | })
--------------------------------------------------------------------------------
/moudle/host/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/moudle/host/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap')
--------------------------------------------------------------------------------
/moudle/host/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "remote",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev":"webpack-dev-server",
9 | "build":"webpack"
10 | },
11 | "keywords": [],
12 | "author": "",
13 | "license": "ISC",
14 | "devDependencies": {
15 | "html-webpack-plugin": "^5.5.0",
16 | "webpack": "^5.78.0",
17 | "webpack-cli": "^5.0.1",
18 | "webpack-dev-server": "^4.13.2"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/moudle/host/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { Configuration } = require('webpack')
2 | const HtmlWebpackPlugin = require('html-webpack-plugin')
3 | const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin')
4 | /**
5 | * @type {Configuration} //配置智能提示
6 | */
7 | const config = {
8 | mode: 'none',
9 | entry: './index.js',
10 | output: {
11 | filename: 'bundle.js'
12 | },
13 | devServer:{
14 | port: 9002, //host
15 | },
16 | plugins: [
17 | new HtmlWebpackPlugin({
18 | template: './index.html'
19 | }),
20 | new ModuleFederationPlugin({
21 | name: 'host',
22 | remotes: {
23 | remote: 'remote@http://localhost:9001/remoteEntry.js'
24 | }
25 | })
26 | ]
27 | }
28 | module.exports = config
--------------------------------------------------------------------------------
/moudle/remote/bootstrap.js:
--------------------------------------------------------------------------------
1 | import { addList } from "./list";
2 | let app = document.getElementById("app");
3 |
4 | app.innerHTML = "remote
";
5 |
6 | addList()
--------------------------------------------------------------------------------
/moudle/remote/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/moudle/remote/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap')
--------------------------------------------------------------------------------
/moudle/remote/list.js:
--------------------------------------------------------------------------------
1 | //这个模块会暴露给 host 项目去使用
2 |
3 | let wrap = document.createElement("div");
4 |
5 | let list = [
6 | { name: "张三", age: 18 },
7 | { name: "李四", age: 19 },
8 | { name: "王五", age: 20 },
9 | ]
10 |
11 | list.forEach(item => {
12 | let p = document.createElement("p");
13 | p.innerHTML = `${item.name} - ${item.age}`;
14 | wrap.appendChild(p);
15 | })
16 |
17 | export const addList = () => {
18 | document.body.appendChild(wrap);
19 | }
--------------------------------------------------------------------------------
/moudle/remote/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "remote",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "dev":"webpack-dev-server",
9 | "build":"webpack"
10 | },
11 | "keywords": [],
12 | "author": "",
13 | "license": "ISC",
14 | "devDependencies": {
15 | "html-webpack-plugin": "^5.5.0",
16 | "webpack": "^5.78.0",
17 | "webpack-cli": "^5.0.1",
18 | "webpack-dev-server": "^4.13.2"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/moudle/remote/webpack.config.js:
--------------------------------------------------------------------------------
1 | const { Configuration } = require('webpack')
2 | const HtmlWebpackPlugin = require('html-webpack-plugin')
3 | const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin')
4 | /**
5 | * @type {Configuration} //配置智能提示
6 | */
7 | const config = {
8 | mode: 'none',
9 | entry: './index.js',
10 | output: {
11 | filename: 'bundle.js'
12 | },
13 | devServer:{
14 | port: 9001, //remote
15 | },
16 | plugins: [
17 | new HtmlWebpackPlugin({
18 | template: './index.html'
19 | }),
20 | new ModuleFederationPlugin({
21 | name: 'remote',
22 | filename: 'remoteEntry.js',
23 | exposes: {
24 | './addList': './list.js' //value 暴露的模块的路径
25 | }
26 | })
27 | ]
28 | }
29 | module.exports = config
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "monorepo",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC"
12 | }
13 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | # all packages in direct subdirs of packages/
3 | - 'main'
4 | # all packages in subdirs of components/
5 | - 'web/**'
6 |
7 | - 'common'
8 |
--------------------------------------------------------------------------------
/web/react-demo/.gitignore:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/web/react-demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React + TS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/web/react-demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-demo",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "tsc && vite build",
9 | "preview": "vite preview"
10 | },
11 | "dependencies": {
12 | "common": "workspace:^1.0.0",
13 | "react": "^18.2.0",
14 | "react-dom": "^18.2.0"
15 | },
16 | "devDependencies": {
17 | "@types/react": "^18.0.28",
18 | "@types/react-dom": "^18.0.11",
19 | "@vitejs/plugin-react": "^3.1.0",
20 | "typescript": "^4.9.3",
21 | "vite": "^4.2.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/web/react-demo/public/vite.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/web/react-demo/src/App.css:
--------------------------------------------------------------------------------
1 | #root {
2 | max-width: 1280px;
3 | margin: 0 auto;
4 | padding: 2rem;
5 | text-align: center;
6 | }
7 |
8 | .logo {
9 | height: 6em;
10 | padding: 1.5em;
11 | will-change: filter;
12 | transition: filter 300ms;
13 | }
14 | .logo:hover {
15 | filter: drop-shadow(0 0 2em #646cffaa);
16 | }
17 | .logo.react:hover {
18 | filter: drop-shadow(0 0 2em #61dafbaa);
19 | }
20 |
21 | @keyframes logo-spin {
22 | from {
23 | transform: rotate(0deg);
24 | }
25 | to {
26 | transform: rotate(360deg);
27 | }
28 | }
29 |
30 | @media (prefers-reduced-motion: no-preference) {
31 | a:nth-of-type(2) .logo {
32 | animation: logo-spin infinite 20s linear;
33 | }
34 | }
35 |
36 | .card {
37 | padding: 2em;
38 | }
39 |
40 | .read-the-docs {
41 | color: #888;
42 | }
43 |
--------------------------------------------------------------------------------
/web/react-demo/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'react'
2 | import reactLogo from './assets/react.svg'
3 | import viteLogo from '/vite.svg'
4 | import './App.css'
5 |
6 |
7 |
8 |
9 |
10 |
11 | function App() {
12 | const [count, setCount] = useState(0)
13 |
14 | return (
15 |
16 |
24 |
Vite + React
25 |
26 |
29 |
30 | Edit src/App.tsx
and save to test HMR
31 |
32 |
33 |
34 | Click on the Vite and React logos to learn more
35 |
36 |
37 | )
38 | }
39 |
40 | export default App
41 |
--------------------------------------------------------------------------------
/web/react-demo/src/assets/react.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/web/react-demo/src/index.css:
--------------------------------------------------------------------------------
1 | :root {
2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3 | line-height: 1.5;
4 | font-weight: 400;
5 |
6 | color-scheme: light dark;
7 | color: rgba(255, 255, 255, 0.87);
8 | background-color: #242424;
9 |
10 | font-synthesis: none;
11 | text-rendering: optimizeLegibility;
12 | -webkit-font-smoothing: antialiased;
13 | -moz-osx-font-smoothing: grayscale;
14 | -webkit-text-size-adjust: 100%;
15 | }
16 |
17 | a {
18 | font-weight: 500;
19 | color: #646cff;
20 | text-decoration: inherit;
21 | }
22 | a:hover {
23 | color: #535bf2;
24 | }
25 |
26 | body {
27 | margin: 0;
28 | display: flex;
29 | place-items: center;
30 | min-width: 320px;
31 | min-height: 100vh;
32 | }
33 |
34 | h1 {
35 | font-size: 3.2em;
36 | line-height: 1.1;
37 | }
38 |
39 | button {
40 | border-radius: 8px;
41 | border: 1px solid transparent;
42 | padding: 0.6em 1.2em;
43 | font-size: 1em;
44 | font-weight: 500;
45 | font-family: inherit;
46 | background-color: #1a1a1a;
47 | cursor: pointer;
48 | transition: border-color 0.25s;
49 | }
50 | button:hover {
51 | border-color: #646cff;
52 | }
53 | button:focus,
54 | button:focus-visible {
55 | outline: 4px auto -webkit-focus-ring-color;
56 | }
57 |
58 | @media (prefers-color-scheme: light) {
59 | :root {
60 | color: #213547;
61 | background-color: #ffffff;
62 | }
63 | a:hover {
64 | color: #747bff;
65 | }
66 | button {
67 | background-color: #f9f9f9;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/web/react-demo/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | import App from './App'
4 | import './index.css'
5 |
6 | ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
7 |
8 |
9 | ,
10 | )
11 |
--------------------------------------------------------------------------------
/web/react-demo/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/web/react-demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
6 | "allowJs": false,
7 | "skipLibCheck": true,
8 | "esModuleInterop": false,
9 | "allowSyntheticDefaultImports": true,
10 | "strict": true,
11 | "forceConsistentCasingInFileNames": true,
12 | "module": "ESNext",
13 | "moduleResolution": "Node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "noEmit": true,
17 | "jsx": "react-jsx"
18 | },
19 | "include": ["src"],
20 | "references": [{ "path": "./tsconfig.node.json" }]
21 | }
22 |
--------------------------------------------------------------------------------
/web/react-demo/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "module": "ESNext",
5 | "moduleResolution": "Node",
6 | "allowSyntheticDefaultImports": true
7 | },
8 | "include": ["vite.config.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/web/react-demo/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | })
8 |
--------------------------------------------------------------------------------
/web/vue-demo/.gitignore:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/web/vue-demo/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/web/vue-demo/README.md:
--------------------------------------------------------------------------------
1 | # Vue 3 + TypeScript + Vite
2 |
3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `
12 |