Skip to content

Commit eb210da

Browse files
authored
Feat/monorepo (#122)
* wip: move files * wip: npm test * wip: compile * wip: examples:dev * wip: website:dev * wip: website:prd * wip: codesandbox * rm lock file * node 18 * publish dir * Revert "publish dir" This reverts commit 7e71f06. * update workflow yaml * fix a workflow file * simplify scripts * fix postinstall * simplify pnpm link * use workspace protocol
1 parent 4aedd5d commit eb210da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+581
-552
lines changed

.codesandbox/ci.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2+
"packages": ["packages/waku"],
23
"buildCommand": "compile",
34
"sandboxes": ["vanilla", "vanilla-typescript-vanilla-ts", "new", "react-typescript-react-ts"],
4-
"node": "14"
5+
"node": "18"
56
}

.github/workflows/cd.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
cache: 'pnpm'
2121
cache-dependency-path: '**/pnpm-lock.yaml'
2222
- run: pnpm install --frozen-lockfile
23-
- run: npm test
24-
- run: npm run compile
25-
- run: npm publish
23+
- run: pnpm test
24+
- run: pnpm run compile
25+
- run: pnpm -r --filter='./packages/*' publish
2626
env:
2727
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
cache: 'pnpm'
1919
cache-dependency-path: '**/pnpm-lock.yaml'
2020
- run: pnpm install --frozen-lockfile
21-
- run: pnpm run test
21+
- run: pnpm test
2222

2323
e2e:
2424
runs-on: ubuntu-latest
@@ -34,7 +34,6 @@ jobs:
3434
cache-dependency-path: '**/pnpm-lock.yaml'
3535
- run: pnpm install --frozen-lockfile
3636
- run: pnpm run compile
37-
- run: pnpm link .
3837
- name: Get installed Playwright version
3938
id: playwright-version
4039
run: |

contrib/create-waku/package.json

-5
This file was deleted.

examples/postcss.config.js

-1
This file was deleted.

package.json

+32-111
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,43 @@
11
{
2-
"name": "waku",
3-
"description": "Minimalistic React Framework",
4-
"version": "0.14.0",
2+
"name": "waku-monorepo",
3+
"version": "0.1.0",
54
"type": "module",
6-
"author": "Daishi Kato",
7-
"repository": {
8-
"type": "git",
9-
"url": "https://github.com/dai-shi/waku.git"
10-
},
11-
"exports": {
12-
"./package.json": "./package.json",
13-
".": {
14-
"types": "./dist/main.d.ts",
15-
"require": "./dist/cjs/main.js",
16-
"default": "./dist/main.js"
17-
},
18-
"./node-loader": {
19-
"types": "./dist/node-loader.d.ts",
20-
"require": "./dist/cjs/node-loader.js",
21-
"default": "./dist/node-loader.js"
22-
},
23-
"./config": {
24-
"types": "./dist/config.d.ts",
25-
"require": "./dist/cjs/config.js",
26-
"default": "./dist/config.js"
27-
},
28-
"./client": {
29-
"types": "./dist/client.d.ts",
30-
"require": "./dist/cjs/client.js",
31-
"default": "./dist/client.js"
32-
},
33-
"./server": {
34-
"types": "./dist/server.d.ts",
35-
"require": "./dist/cjs/server.js",
36-
"default": "./dist/server.js"
37-
},
38-
"./router/client": {
39-
"types": "./dist/router/client.d.ts",
40-
"require": "./dist/cjs/router/client.js",
41-
"default": "./dist/router/client.js"
42-
},
43-
"./router/server": {
44-
"types": "./dist/router/server.d.ts",
45-
"require": "./dist/cjs/router/server.js",
46-
"default": "./dist/router/server.js"
47-
}
48-
},
49-
"bin": {
50-
"waku": "./dist/cli.js"
51-
},
52-
"files": [
53-
"src",
54-
"dist"
55-
],
5+
"private": true,
566
"scripts": {
57-
"dev": "swc src -d dist -w",
58-
"compile": "rm -rf dist && npm run compile:code && npm run compile:types",
59-
"compile:code": "swc src -d dist && swc src -d dist/cjs -C module.type=commonjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
60-
"compile:types": "tsc --project tsconfig.build.json",
7+
"dev": "pnpm -r --filter='./packages/*' run dev",
8+
"compile": "pnpm -r --filter='./packages/*' run compile",
9+
"postinstall": "test -d ./packages/waku/dist || (pnpm -r --filter='./packages/waku' run compile && pnpm install)",
6110
"test": "prettier -c . && eslint . && tsc --project . --noEmit",
6211
"e2e": "playwright test",
63-
"examples:dev": "npm run compile:code && (cd ./examples/${NAME} && npm run dev)",
64-
"examples:dev:01_counter": "NAME=01_counter npm run examples:dev",
65-
"examples:dev:02_async": "NAME=02_async npm run examples:dev",
66-
"examples:dev:03_promise": "NAME=03_promise npm run examples:dev",
67-
"examples:dev:04_callserver": "NAME=04_callserver npm run examples:dev",
68-
"examples:dev:05_mutation": "NAME=05_mutation npm run examples:dev",
69-
"examples:dev:06_nesting": "NAME=06_nesting npm run examples:dev",
70-
"examples:dev:07_router": "NAME=07_router npm run examples:dev",
71-
"examples:dev:08_cookies": "NAME=08_cookies npm run examples:dev",
72-
"examples:dev:09_cssmodules": "NAME=09_cssmodules npm run examples:dev",
73-
"examples:build": "npm run compile:code && (cd ./examples/${NAME} && npm run build)",
74-
"examples:prd": "npm run examples:build && (cd ./examples/${NAME} && npm start)",
75-
"examples:prd:01_counter": "NAME=01_counter npm run examples:prd",
76-
"examples:prd:02_async": "NAME=02_async npm run examples:prd",
77-
"examples:prd:03_promise": "NAME=03_promise npm run examples:prd",
78-
"examples:prd:04_callserver": "NAME=04_callserver npm run examples:prd",
79-
"examples:prd:05_mutation": "NAME=05_mutation npm run examples:prd",
80-
"examples:prd:06_nesting": "NAME=06_nesting npm run examples:prd",
81-
"examples:prd:07_router": "NAME=07_router npm run examples:prd",
82-
"examples:prd:08_cookies": "NAME=08_cookies npm run examples:prd",
83-
"examples:prd:09_cssmodules": "NAME=09_cssmodules npm run examples:prd",
84-
"website:dev": "npm run compile:code && ./dist/cli.js dev --config ./website/vite.config.ts",
85-
"website:build": "npm run compile:code && ./dist/cli.js build --config ./website/vite.config.ts",
86-
"website:vercel": "npm run website:build && cp -Lr ./website/dist/.vercel/output ./.vercel/",
87-
"website:prd": "npm run website:build && ./dist/cli.js start --config ./website/vite.config.ts"
88-
},
89-
"license": "MIT",
90-
"engines": {
91-
"node": ">=18.0.0"
12+
"examples:dev": "(cd ./examples/${NAME} && pnpm run dev)",
13+
"examples:dev:01_counter": "NAME=01_counter pnpm run examples:dev",
14+
"examples:dev:02_async": "NAME=02_async pnpm run examples:dev",
15+
"examples:dev:03_promise": "NAME=03_promise pnpm run examples:dev",
16+
"examples:dev:04_callserver": "NAME=04_callserver pnpm run examples:dev",
17+
"examples:dev:05_mutation": "NAME=05_mutation pnpm run examples:dev",
18+
"examples:dev:06_nesting": "NAME=06_nesting pnpm run examples:dev",
19+
"examples:dev:07_router": "NAME=07_router pnpm run examples:dev",
20+
"examples:dev:08_cookies": "NAME=08_cookies pnpm run examples:dev",
21+
"examples:dev:09_cssmodules": "NAME=09_cssmodules pnpm run examples:dev",
22+
"examples:build": "(cd ./examples/${NAME} && pnpm run build)",
23+
"examples:prd": "pnpm run examples:build && (cd ./examples/${NAME} && pnpm start)",
24+
"examples:prd:01_counter": "NAME=01_counter pnpm run examples:prd",
25+
"examples:prd:02_async": "NAME=02_async pnpm run examples:prd",
26+
"examples:prd:03_promise": "NAME=03_promise pnpm run examples:prd",
27+
"examples:prd:04_callserver": "NAME=04_callserver pnpm run examples:prd",
28+
"examples:prd:05_mutation": "NAME=05_mutation pnpm run examples:prd",
29+
"examples:prd:06_nesting": "NAME=06_nesting pnpm run examples:prd",
30+
"examples:prd:07_router": "NAME=07_router pnpm run examples:prd",
31+
"examples:prd:08_cookies": "NAME=08_cookies pnpm run examples:prd",
32+
"examples:prd:09_cssmodules": "NAME=09_cssmodules pnpm run examples:prd",
33+
"website:dev": "(cd packages/website && pnpm run dev)",
34+
"website:build": "(cd packages/website && pnpm run build)",
35+
"website:vercel": "pnpm run website:build && cp -Lr ./packages/website/dist/.vercel/output ./.vercel/",
36+
"website:prd": "pnpm run website:build && (cd packages/website && pnpm start)"
9237
},
9338
"prettier": {},
94-
"dependencies": {
95-
"@swc/core": "1.3.71",
96-
"@vitejs/plugin-react": "^4.0.3",
97-
"busboy": "^1.6.0",
98-
"vite": "^4.4.7"
99-
},
10039
"devDependencies": {
10140
"@playwright/test": "^1.36.2",
102-
"@swc/cli": "^0.1.62",
10341
"@types/babel__core": "^7.20.1",
10442
"@types/busboy": "^1.5.0",
10543
"@types/express": "^4.17.17",
@@ -108,33 +46,16 @@
10846
"@types/react-dom": "^18.2.7",
10947
"@typescript-eslint/eslint-plugin": "^6.2.0",
11048
"@typescript-eslint/parser": "^6.2.0",
111-
"autoprefixer": "^10.4.14",
112-
"bright": "^0.8.4",
113-
"cookie-parser": "^1.4.6",
11449
"eslint": "^8.45.0",
11550
"eslint-config-prettier": "^8.9.0",
11651
"eslint-import-resolver-typescript": "^3.5.5",
11752
"eslint-plugin-import": "^2.28.0",
11853
"eslint-plugin-react": "^7.33.0",
119-
"express": "^4.18.2",
120-
"glob": "^10.3.3",
12154
"prettier": "^3.0.0",
12255
"react": "18.3.0-canary-7118f5dd7-20230705",
12356
"react-dom": "18.3.0-canary-7118f5dd7-20230705",
12457
"react-server-dom-webpack": "18.3.0-canary-7118f5dd7-20230705",
125-
"rollup": "^3.26.3",
126-
"tailwindcss": "^3.3.3",
12758
"typescript": "^5.1.6",
128-
"waku": "link:."
129-
},
130-
"peerDependencies": {
131-
"express": "^4.18.2",
132-
"react": "18.3.0-canary-7118f5dd7-20230705",
133-
"react-server-dom-webpack": "18.3.0-canary-7118f5dd7-20230705"
134-
},
135-
"peerDependenciesMeta": {
136-
"express": {
137-
"optional": true
138-
}
59+
"waku": "workspace:*"
13960
}
14061
}

contrib/create-waku/cli.js packages/create-waku/cli.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env node
22

3+
// FIXME the following is temporarily and will remove it soon
4+
/* eslint-disable */
5+
36
const path = require("node:path");
47
const fs = require("node:fs");
58
const https = require("node:https");

packages/create-waku/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "create-waku",
3+
"version": "0.4.10",
4+
"author": "Daishi Kato",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/dai-shi/waku.git"
8+
},
9+
"bin": "./cli.js"
10+
}

packages/waku/package.json

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"name": "waku",
3+
"description": "Minimalistic React Framework",
4+
"version": "0.14.0",
5+
"type": "module",
6+
"author": "Daishi Kato",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/dai-shi/waku.git"
10+
},
11+
"exports": {
12+
"./package.json": "./package.json",
13+
".": {
14+
"types": "./dist/main.d.ts",
15+
"require": "./dist/cjs/main.js",
16+
"default": "./dist/main.js"
17+
},
18+
"./node-loader": {
19+
"types": "./dist/node-loader.d.ts",
20+
"require": "./dist/cjs/node-loader.js",
21+
"default": "./dist/node-loader.js"
22+
},
23+
"./config": {
24+
"types": "./dist/config.d.ts",
25+
"require": "./dist/cjs/config.js",
26+
"default": "./dist/config.js"
27+
},
28+
"./client": {
29+
"types": "./dist/client.d.ts",
30+
"require": "./dist/cjs/client.js",
31+
"default": "./dist/client.js"
32+
},
33+
"./server": {
34+
"types": "./dist/server.d.ts",
35+
"require": "./dist/cjs/server.js",
36+
"default": "./dist/server.js"
37+
},
38+
"./router/client": {
39+
"types": "./dist/router/client.d.ts",
40+
"require": "./dist/cjs/router/client.js",
41+
"default": "./dist/router/client.js"
42+
},
43+
"./router/server": {
44+
"types": "./dist/router/server.d.ts",
45+
"require": "./dist/cjs/router/server.js",
46+
"default": "./dist/router/server.js"
47+
}
48+
},
49+
"bin": {
50+
"waku": "./dist/cli.js"
51+
},
52+
"files": [
53+
"src",
54+
"dist"
55+
],
56+
"scripts": {
57+
"dev": "swc src -d dist -w",
58+
"compile": "rm -rf dist && pnpm run compile:code && pnpm run compile:types",
59+
"compile:code": "swc src -d dist && swc src -d dist/cjs -C module.type=commonjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
60+
"compile:types": "tsc --project tsconfig.build.json"
61+
},
62+
"license": "MIT",
63+
"engines": {
64+
"node": ">=18.0.0"
65+
},
66+
"dependencies": {
67+
"@swc/core": "1.3.71",
68+
"@vitejs/plugin-react": "^4.0.3",
69+
"busboy": "^1.6.0",
70+
"vite": "^4.4.7"
71+
},
72+
"devDependencies": {
73+
"@swc/cli": "^0.1.62",
74+
"express": "^4.18.2",
75+
"rollup": "^3.26.3"
76+
},
77+
"peerDependencies": {
78+
"express": "^4.18.2",
79+
"react": "18.3.0-canary-7118f5dd7-20230705",
80+
"react-server-dom-webpack": "18.3.0-canary-7118f5dd7-20230705"
81+
},
82+
"peerDependenciesMeta": {
83+
"express": {
84+
"optional": true
85+
}
86+
}
87+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tsconfig.build.json packages/waku/tsconfig.build.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"declaration": true,
55
"emitDeclarationOnly": true,

packages/website/package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "waku-website",
3+
"version": "0.1.0",
4+
"type": "module",
5+
"private": true,
6+
"scripts": {
7+
"dev": "waku dev --with-ssr",
8+
"build": "waku build",
9+
"start": "waku start --with-ssr"
10+
},
11+
"dependencies": {
12+
"autoprefixer": "^10.4.14",
13+
"bright": "^0.8.4",
14+
"express": "^4.18.2",
15+
"glob": "^10.2.6",
16+
"react": "18.3.0-canary-7118f5dd7-20230705",
17+
"react-dom": "18.3.0-canary-7118f5dd7-20230705",
18+
"react-server-dom-webpack": "18.3.0-canary-7118f5dd7-20230705",
19+
"tailwindcss": "^3.3.3",
20+
"waku": "workspace:*"
21+
}
22+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tailwind.config.js packages/website/tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('tailwindcss').Config} */
22
export default {
3-
content: ["./website/index.html", "./website/{src,routes}/**/*.{ts,tsx}"],
3+
content: ["./index.html", "./{src,routes}/**/*.{ts,tsx}"],
44
theme: {
55
colors: {
66
cCarmine: "#B0452D",
File renamed without changes.

0 commit comments

Comments
 (0)