Skip to content

Commit

Permalink
feat!: remove CommonJS builds (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyco130 authored Sep 15, 2024
1 parent 50f9f6b commit 038960c
Show file tree
Hide file tree
Showing 67 changed files with 1,258 additions and 775 deletions.
4 changes: 2 additions & 2 deletions ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"kill-port": "^2.0.1",
"ps-tree": "^1.2.0",
"puppeteer": "^23.3.0",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
"typescript": "^5.6.2",
"vitest": "^2.1.1"
},
"devDependencies": {
"@types/ps-tree": "^1.1.6"
Expand Down
3 changes: 2 additions & 1 deletion ci/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
6 changes: 3 additions & 3 deletions examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"devDependencies": {
"@types/express": "^4.17.21",
"@types/node": "^18.19.50",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"express": "^4.19.2"
"express": "^4.21.0"
}
}
5 changes: 0 additions & 5 deletions examples/express/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/express
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/express/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
4 changes: 2 additions & 2 deletions examples/fastify-vike/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vike": "^0.4.195",
"vite": "^5.4.3"
"vite": "^5.4.5"
}
}
5 changes: 0 additions & 5 deletions examples/fastify-vike/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/fastify-vike
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
1 change: 1 addition & 0 deletions examples/fastify-vike/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"strict": true,
"module": "ES2020",
"moduleResolution": "Bundler",
"customConditions": ["import"],
"target": "ES2017",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"jsx": "react-jsx",
Expand Down
4 changes: 2 additions & 2 deletions examples/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
],
"devDependencies": {
"@types/node": "^18.19.50",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"fastify": "^4.28.1"
Expand Down
5 changes: 0 additions & 5 deletions examples/fastify/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/fastify
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/fastify/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
4 changes: 2 additions & 2 deletions examples/hapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
],
"devDependencies": {
"@types/node": "^18.19.50",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"@hapi/hapi": "^21.3.10"
Expand Down
5 changes: 0 additions & 5 deletions examples/hapi/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/hapi
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/hapi/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
6 changes: 3 additions & 3 deletions examples/koa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"@types/koa": "^2.15.0",
"@types/koa__router": "^12.0.4",
"@types/node": "^18.19.50",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"@koa/router": "^13.0.0",
"@koa/router": "^13.0.1",
"koa": "^2.15.3"
}
}
5 changes: 0 additions & 5 deletions examples/koa/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/koa
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/koa/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
6 changes: 3 additions & 3 deletions examples/nestjs-vike/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
"dist"
],
"devDependencies": {
"@swc/core": "^1.7.24",
"@swc/core": "^1.7.26",
"@types/express": "^4.17.21",
"@types/node": "^18.19.50",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"cross-env": "^7.0.3",
"rollup-plugin-swc3": "^0.11.2",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3",
"vite": "^5.4.5",
"vite-tsconfig-paths": "^5.0.1"
},
"dependencies": {
Expand Down
5 changes: 0 additions & 5 deletions examples/nestjs-vike/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/nestjs-vike
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
1 change: 1 addition & 0 deletions examples/nestjs-vike/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler",
"customConditions": ["import"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"jsx": "react-jsx",
Expand Down
6 changes: 3 additions & 3 deletions examples/nestjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"dist"
],
"devDependencies": {
"@swc/core": "^1.7.24",
"@swc/core": "^1.7.26",
"@types/express": "^4.17.21",
"@types/node": "^18.19.50",
"rollup-plugin-swc3": "^0.11.2",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"@nestjs/common": "^10.4.1",
Expand Down
5 changes: 0 additions & 5 deletions examples/nestjs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/nestjs
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
1 change: 1 addition & 0 deletions examples/nestjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler",
"customConditions": ["import"],
"experimentalDecorators": true,
"types": ["vite/client"]
}
Expand Down
5 changes: 0 additions & 5 deletions examples/readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Examples

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
- [simple-standalone](simple-standalone): Simple standalone example ([Stackblitz](https://stackblitz.com/github/cyco130/vavite/tree/main/examples/simple-standalone))
- [express](express): Integrating with Express ([Stackblitz](https://stackblitz.com/github/cyco130/vavite/tree/main/examples/express))
- [koa](koa): Integrating with Koa ([Stackblitz](https://stackblitz.com/github/cyco130/vavite/tree/main/examples/koa))
Expand Down
4 changes: 2 additions & 2 deletions examples/simple-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"devDependencies": {
"@types/node": "^18.19.50",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
}
}
5 changes: 0 additions & 5 deletions examples/simple-standalone/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/simple-standalone
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/simple-standalone/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
6 changes: 3 additions & 3 deletions examples/socket-io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"devDependencies": {
"@types/express": "^4.17.21",
"@types/node": "^18.19.50",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"express": "^4.19.2",
"express": "^4.21.0",
"socket.io": "^4.7.5"
}
}
5 changes: 0 additions & 5 deletions examples/socket-io/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/socket-io
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/socket-io/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
6 changes: 3 additions & 3 deletions examples/ssr-react-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"express": "^4.19.2",
"express": "^4.21.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
5 changes: 0 additions & 5 deletions examples/ssr-react-express/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/ssr-react-express
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
1 change: 1 addition & 0 deletions examples/ssr-react-express/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler",
"customConditions": ["import"],
"jsx": "react-jsx"
}
}
8 changes: 4 additions & 4 deletions examples/ssr-vue-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"@types/express": "^4.17.21",
"@types/node": "^18.19.50",
"@vitejs/plugin-vue": "^5.1.3",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vavite": "4.1.3",
"vite": "^5.4.3"
"vite": "^5.4.5"
},
"dependencies": {
"express": "^4.19.2",
"vue": "^3.5.3"
"express": "^4.21.0",
"vue": "^3.5.5"
}
}
5 changes: 0 additions & 5 deletions examples/ssr-vue-express/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ Clone with:
```bash
npx degit cyco130/vavite/examples/ssr-vue-express
```

> All examples have `"type": "module"` in their `package.json`.
>
> - For Vite v2, remove it to use CommonJS (CJS).
> - If you want to use CommonJS with Vite v3+, add `legacy.buildSsrCjsExternalHeuristics: true` to your Vite config.
3 changes: 2 additions & 1 deletion examples/ssr-vue-express/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler"
"moduleResolution": "Bundler",
"customConditions": ["import"]
}
}
Loading

0 comments on commit 038960c

Please sign in to comment.