Skip to content

Commit 22b63bb

Browse files
committed
improve typescript configuration
1 parent 59b1630 commit 22b63bb

File tree

13 files changed

+88
-74
lines changed

13 files changed

+88
-74
lines changed

src/client/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tsconfig.tsbuildinfo

src/client/package-lock.json

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

src/client/package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
{
2-
"devDependencies": {
3-
"vite": "^3.1.8"
4-
},
52
"license": "MIT",
6-
"repository": {
7-
"type": "git",
8-
"url": "https://github.com/reactive-python/reactpy"
9-
},
103
"scripts": {
11-
"build": "vite build",
124
"publish": "npm --workspaces publish",
135
"test": "npm --workspaces test",
6+
"build": "npm --workspaces run build",
147
"format": "npm --workspaces run format",
158
"check:format": "npm --workspaces run check:format",
169
"check:tests": "npm --workspaces run check:tests",
1710
"check:types": "npm --workspaces run check:types"
1811
},
19-
"version": "1.0.0",
2012
"workspaces": [
2113
"./packages/*"
2214
]

src/client/index.html renamed to src/client/packages/app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
@@ -8,7 +8,7 @@
88
<body>
99
<div id="app"></div>
1010
<script type="module">
11-
import { mount } from "@reactpy/app";
11+
import { mount } from "./src/index";
1212
mount(document.getElementById("app"));
1313
</script>
1414
</body>
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
{
22
"author": "Ryan Morshead",
3+
"license": "MIT",
4+
"main": "src/dist/index.js",
5+
"types": "src/dist/index.d.ts",
6+
"name": "@reactpy/app",
7+
"description": "A client application for ReactPy implemented in React",
38
"dependencies": {
4-
"@reactpy/client": "file:packages/client",
9+
"@reactpy/client": "^0.1.0",
510
"preact": "^10.7.0"
611
},
7-
"description": "A client application for ReactPy implemented in React",
812
"devDependencies": {
913
"prettier": "^3.0.0-alpha.6",
1014
"typescript": "^4.9.5",
11-
"@types/react-dom": "^18.0.11"
15+
"@types/react-dom": "^18.0.11",
16+
"vite": "^3.1.8"
1217
},
13-
"license": "MIT",
14-
"main": "src/index.tsx",
15-
"name": "@reactpy/app",
1618
"repository": {
1719
"type": "git",
1820
"url": "https://github.com/reactive-python/reactpy"
1921
},
2022
"scripts": {
23+
"build": "vite build",
2124
"format": "prettier --write ./src",
2225
"test": "npm run check:tests",
2326
"check:format": "prettier --check ./src",
2427
"check:tests": "echo 'no tests'",
25-
"check:types": "tsc"
26-
},
27-
"version": "0.45.0"
28+
"check:types": "tsc --noEmit"
29+
}
2830
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"include": ["src"]
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"rootDir": "src",
6+
"composite": true
7+
},
8+
"include": ["src"],
9+
"references": [
10+
{
11+
"path": "../client"
12+
}
13+
]
414
}

src/client/vite.config.js renamed to src/client/packages/app/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite";
22

33
export default defineConfig({
4-
build: { outDir: "../reactpy/_client", emptyOutDir: true },
4+
build: { outDir: "../../../reactpy/_client", emptyOutDir: true },
55
resolve: {
66
alias: {
77
react: "preact/compat",
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
{
22
"author": "Ryan Morshead",
3+
"main": "dist/index.js",
4+
"types": "dist/index.d.ts",
5+
"description": "A client for ReactPy implemented in React",
6+
"license": "MIT",
7+
"name": "@reactpy/client",
8+
"type": "module",
9+
"version": "0.1.0",
310
"dependencies": {
4-
"event-to-object": "file:packages/event-to-object",
11+
"event-to-object": "^0.1.0",
512
"json-pointer": "^0.6.2"
613
},
7-
"main": "src/index.ts",
8-
"description": "A client for ReactPy implemented in React",
914
"devDependencies": {
1015
"@types/json-pointer": "^1.0.31",
1116
"@types/react": "^18.0.28",
1217
"@types/react-dom": "^18.0.11",
1318
"prettier": "^3.0.0-alpha.6",
1419
"typescript": "^4.9.5"
1520
},
16-
"license": "MIT",
17-
"name": "@reactpy/client",
1821
"peerDependencies": {
1922
"react": ">=16",
2023
"react-dom": ">=16"
@@ -24,12 +27,11 @@
2427
"url": "https://github.com/reactive-python/reactpy"
2528
},
2629
"scripts": {
30+
"build": "tsc -b",
2731
"format": "prettier --write ./src",
2832
"test": "npm run check:tests",
2933
"check:format": "prettier --check ./src",
3034
"check:tests": "echo 'no tests'",
31-
"check:types": "tsc"
32-
},
33-
"type": "module",
34-
"version": "0.1.0"
35+
"check:types": "tsc --noEmit"
36+
}
3537
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"include": ["src"]
3+
"compilerOptions": {
4+
"outDir": "dist",
5+
"rootDir": "src",
6+
"composite": true
7+
},
8+
"include": ["src"],
9+
"references": [
10+
{
11+
"path": "../event-to-object"
12+
}
13+
]
414
}

0 commit comments

Comments
 (0)