Skip to content

Commit 2a3316e

Browse files
committed
feat: 基础结构
1 parent e6d6fcf commit 2a3316e

File tree

15 files changed

+330
-14
lines changed

15 files changed

+330
-14
lines changed

examples/helloWorld/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Hello World Big-React</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script src="../"></script>
12+
</body>
13+
</html>

examples/helloWorld/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
4+
const jsx = <div>hello world</div>;
5+
6+
const container = document.querySelector('#root');
7+
const root = ReactDOM.createRoot(container);
8+
root.render(jsx);

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
{
22
"name": "big-react",
3-
"private": true,
43
"version": "0.0.0",
54
"repository": "git@github.com:BetaSu/big-react.git",
65
"author": "kasong <313439271@qq.com>",
76
"license": "MIT",
8-
"scripts": {},
9-
"devDependencies": {
10-
"typescript": "^4.5.4",
11-
"rollup": "^2.75.6"
12-
},
13-
"dependencies": {
14-
7+
"scripts": {
8+
"build": "rollup --config scripts/rollup/packages.config.js",
9+
"preview": "rollup --config scripts/rollup/examples.config.js"
1510
},
16-
"script": {
17-
"build": "rollup --config rollup.config.js"
11+
"devDependencies": {
12+
"rollup": "^2.75.6",
13+
"rollup-plugin-typescript2": "^0.32.1",
14+
"tslib": "^2.4.0",
15+
"typescript": "^4.7.3"
1816
}
1917
}

packages/react-dom/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {};

packages/react-dom/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "react-dom",
3+
"version": "1.0.0",
4+
"description": "",
5+
"module": "index.ts",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC"
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "react-reconciler",
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+
}

packages/react/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const num: number = 1;
2+
3+
4+
export default num;
5+

packages/react/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "react",
3+
"version": "1.0.0",
4+
"description": "",
5+
"module": "index.ts",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC"
12+
}

pnpm-lock.yaml

Lines changed: 213 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- 'packages/*'

0 commit comments

Comments
 (0)