File tree Expand file tree Collapse file tree 9 files changed +254
-200
lines changed
packages/start-nitro-v2-vite-plugin Expand file tree Collapse file tree 9 files changed +254
-200
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @solidjs/vite-plugin-nitro-2 " : minor
3+ ---
4+
5+ Publishing as NPM package
Original file line number Diff line number Diff line change @@ -32,12 +32,14 @@ jobs:
3232 - name : Install dependencies
3333 run : pnpm install --frozen-lockfile
3434
35- - name : Build start
35+ - name : Build Packages
3636 run : |
3737 pnpm run build
38- # rewrite .ts exports to .js
39- pnpm --filter='./packages/*' -c exec "echo \$(cat package.json | jq '.exports = .publishConfig.exports') > package.json"
38+ pnpm rewrite-exports
4039
41- - name : Release
40+ - name : Release Packages
41+ # remove the compat flag until all packages are available on npm
42+ # run: |
43+ # pnpm dlx pkg-pr-new@0.0 publish './packages/*' --template './examples/*' --compact
4244 run : |
43- pnpm dlx pkg-pr-new@0.0 publish './packages/start' --template './examples/*' --compact
45+ pnpm dlx pkg-pr-new@0.0 publish './packages/*'
Original file line number Diff line number Diff line change 3434 # build the package and all its dependencies
3535 run : pnpm --filter ${{ matrix.package }}... build
3636
37+ - run : pnpm rewrite-exports
38+
3739 - name : Check types with @arethetypeswrong/cli
38- run : pnpx @arethetypeswrong/cli --pack packages/ ${{ matrix.package }} --profile esm-only
40+ run : pnpm --filter ${{ matrix.package }} typecheck:dist
Original file line number Diff line number Diff line change 2424 "packages:build" : " pnpm --filter=./packages/* build" ,
2525 "packages:clean" : " pnpx rimraf ./packages/*/node_modules/ ./packages/*/dist/" ,
2626 "clean:test" : " pnpx rimraf .tmp" ,
27- "release" : " pnpm build && changeset publish"
27+ "release" : " pnpm build && changeset publish" ,
28+ "rewrite-exports" : " pnpm --filter='./packages/*' -c exec \" echo \\ $(cat package.json | jq '.exports = .publishConfig.exports') > package.json\" "
2829 },
2930 "devDependencies" : {
3031 "@changesets/cli" : " ^2.27.12" ,
Original file line number Diff line number Diff line change 1+ # Vite-Plugin-Nitro-2
2+
3+ This package moves Nitro into a Vite-Plugin to consolidate the API surface between Nitro v2 and v3.
4+
5+ ## Usage
6+
7+ This plugin will provide SolidStart with the needed Node.js runtime to run in the backend.
8+
9+ ``` ts
10+ import { defineConfig } from " vite" ;
11+ import { nitroV2Plugin } from " @solidjs/vite-plugin-nitro-2" ;
12+ import { solidStart } from " @solidjs/start/config" ;
13+
14+ export default defineConfig ({
15+ plugins: [solidStart (), nitroV2Plugin ()]
16+ });
17+ ```
18+
19+ Some features that previously were re-exported by SolidStart are available directly through this plugin now.
20+
21+ ### Example: Prerendering
22+
23+ ``` ts
24+ import { defineConfig } from " vite" ;
25+ import { nitroV2Plugin } from " @solidjs/vite-plugin-nitro-2" ;
26+ import { solidStart } from " @solidjs/start/config" ;
27+
28+ export default defineConfig ({
29+ plugins: [
30+ solidStart (),
31+ nitroV2Plugin ({
32+ prerender: {
33+ crawlLinks: true
34+ }
35+ })
36+ ]
37+ });
38+ ```
Original file line number Diff line number Diff line change 11{
2- "name" : " @solidjs/start-nitro-v2-vite-plugin" ,
2+ "name" : " @solidjs/vite-plugin-nitro-2" ,
3+ "description" : " Nitro v2 plugin for development with SolidStart 2.0" ,
34 "version" : " 0.0.1" ,
45 "type" : " module" ,
56 "scripts" : {
6- "build" : " tsc"
7+ "build" : " tsc" ,
8+ "typecheck" : " tsc --noEmit" ,
9+ "typecheck:dist" : " pnpm build && pnpx @arethetypeswrong/cli --pack . --profile esm-only"
710 },
11+ "files" : [
12+ " dist" ,
13+ " package.json" ,
14+ " README.md"
15+ ],
816 "exports" : {
917 "." : " ./src/index.ts"
1018 },
1523 }
1624 },
1725 "dependencies" : {
18- "nitropack" : " ^2.11.10" ,
26+ "nitropack" : " ^2.11.10"
27+ },
28+ "devDependencies" : {
1929 "vite" : " ^7.1.10"
30+ },
31+ "peerDependencies" : {
32+ "vite" : " ^7"
2033 }
2134}
You can’t perform that action at this time.
0 commit comments