Skip to content

Commit 1bd288f

Browse files
committed
Add initial project structure for pnpm workspace with apps and packages
- Created .gitignore files for apps and packages to exclude unnecessary files. - Added package.json and rescript.json for each app and package, defining dependencies and build scripts. - Established pnpm workspace configuration to manage multiple packages efficiently. - Implemented basic React components for the seller and web apps, including navigation functionality.
1 parent 6aa70d8 commit 1bd288f

File tree

21 files changed

+867
-189
lines changed

21 files changed

+867
-189
lines changed

test/pnpm_workspace/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib
2+
node_modules
3+
.DS_Store
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib
2+
node_modules
3+
.DS_Store
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "seller",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"res:build": "rescript",
8+
"res:clean": "rescript clean",
9+
"res:watch": "rescript -w"
10+
},
11+
"dependencies": {
12+
"@greenlabs/bindings": "workspace:*",
13+
"@rescript/core": "^1.6.1",
14+
"@rescript/react": "^0.13.1",
15+
"react": "^18.2.0",
16+
"react-dom": "^18.2.0",
17+
"react-router": "^7.3.0",
18+
"react-router-dom": "^7.3.0"
19+
},
20+
"devDependencies": {
21+
"rescript": "12.0.0-alpha.6"
22+
}
23+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "seller",
3+
"jsx": {
4+
"version": 4,
5+
"mode": "automatic"
6+
},
7+
"sources": [
8+
{
9+
"dir": "src",
10+
"subdirs": true
11+
}
12+
],
13+
"package-specs": [
14+
{
15+
"module": "esmodule",
16+
"in-source": true
17+
}
18+
],
19+
"suffix": ".bs.js",
20+
"bs-dependencies": [
21+
"@greenlabs/bindings",
22+
"@rescript/core",
23+
"@rescript/react"
24+
],
25+
"bsc-flags": [
26+
"-open RescriptCore"
27+
],
28+
"ppx-flags": [],
29+
"warnings": {
30+
"error": false,
31+
"number": "-48"
32+
}
33+
}

test/pnpm_workspace/apps/seller/src/App.bs.js

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@react.component
2+
let make = () => {
3+
let navigate = ReactRouter.Dom.useNavigate()
4+
5+
<div>
6+
<h1> {"Seller"->React.string} </h1>
7+
<button onClick={_ => navigate("/about")}> {"About"->React.string} </button>
8+
</div>
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib
2+
node_modules
3+
.DS_Store
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "web",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"res:build": "rescript",
7+
"res:clean": "rescript clean",
8+
"res:watch": "rescript -w"
9+
},
10+
"dependencies": {
11+
"@greenlabs/bindings": "workspace:*",
12+
"@rescript/core": "^1.6.1",
13+
"@rescript/react": "^0.13.1",
14+
"react": "^18.2.0",
15+
"react-dom": "^18.2.0",
16+
"react-router": "^7.3.0",
17+
"react-router-dom": "^7.3.0"
18+
},
19+
"devDependencies": {
20+
"rescript": "12.0.0-alpha.6"
21+
}
22+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "web",
3+
"version": "0.1.0",
4+
"jsx": {
5+
"version": 4,
6+
"mode": "automatic"
7+
},
8+
"sources": [
9+
{
10+
"dir": "src",
11+
"subdirs": true
12+
}
13+
],
14+
"package-specs": [
15+
{
16+
"module": "esmodule",
17+
"in-source": true
18+
}
19+
],
20+
"suffix": ".mjs",
21+
"namespace": false,
22+
"pinned-dependencies": [],
23+
"bs-dependencies": [
24+
"@greenlabs/bindings",
25+
"@rescript/core",
26+
"@rescript/react"
27+
],
28+
"bs-dev-dependencies": [],
29+
"ppx-flags": [],
30+
"warnings": {
31+
"error": true,
32+
"number": "-48"
33+
},
34+
"bsc-flags": [
35+
"-open RescriptCore"
36+
]
37+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Generated by ReScript, PLEASE EDIT WITH CARE
2+
3+
import * as ReactRouterDom from "react-router-dom";
4+
import * as JsxRuntime from "react/jsx-runtime";
5+
6+
function App(props) {
7+
let navigate = ReactRouterDom.useNavigate();
8+
return JsxRuntime.jsxs("div", {
9+
children: [
10+
JsxRuntime.jsx("h1", {
11+
children: "Web"
12+
}),
13+
JsxRuntime.jsx("button", {
14+
children: "About",
15+
onClick: param => navigate("/about", undefined)
16+
})
17+
]
18+
});
19+
}
20+
21+
let make = App;
22+
23+
export {
24+
make,
25+
}
26+
/* react-router-dom Not a pure module */

0 commit comments

Comments
 (0)