Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/honest-needles-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/vite-plugin-nitro-2": minor
---

Publishing as NPM package
12 changes: 7 additions & 5 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build start
- name: Build Packages
run: |
pnpm run build
# rewrite .ts exports to .js
pnpm --filter='./packages/*' -c exec "echo \$(cat package.json | jq '.exports = .publishConfig.exports') > package.json"
pnpm rewrite-exports

- name: Release
- name: Release Packages
# remove the compat flag until all packages are available on npm
# run: |
# pnpm dlx pkg-pr-new@0.0 publish './packages/*' --template './examples/*' --compact
run: |
pnpm dlx pkg-pr-new@0.0 publish './packages/start' --template './examples/*' --compact
pnpm dlx pkg-pr-new@0.0 publish './packages/*'
4 changes: 3 additions & 1 deletion .github/workflows/dist-typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ jobs:
# build the package and all its dependencies
run: pnpm --filter ${{ matrix.package }}... build

- run: pnpm rewrite-exports

- name: Check types with @arethetypeswrong/cli
run: pnpx @arethetypeswrong/cli --pack packages/${{ matrix.package }} --profile esm-only
run: pnpm --filter ${{ matrix.package }} typecheck:dist
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"packages:build": "pnpm --filter=./packages/* build",
"packages:clean": "pnpx rimraf ./packages/*/node_modules/ ./packages/*/dist/",
"clean:test": "pnpx rimraf .tmp",
"release": "pnpm build && changeset publish"
"release": "pnpm build && changeset publish",
"rewrite-exports": "pnpm --filter='./packages/*' -c exec \"echo \\$(cat package.json | jq '.exports = .publishConfig.exports') > package.json\""
},
"devDependencies": {
"@changesets/cli": "^2.27.12",
Expand Down
38 changes: 38 additions & 0 deletions packages/start-nitro-v2-vite-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Vite-Plugin-Nitro-2

This package moves Nitro into a Vite-Plugin to consolidate the API surface between Nitro v2 and v3.

## Usage

This plugin will provide SolidStart with the needed Node.js runtime to run in the backend.

```ts
import { defineConfig } from "vite";
import { nitroV2Plugin } from "@solidjs/vite-plugin-nitro-2";
import { solidStart } from "@solidjs/start/config";

export default defineConfig({
plugins: [solidStart(), nitroV2Plugin()]
});
```

Some features that previously were re-exported by SolidStart are available directly through this plugin now.

### Example: Prerendering

```ts
import { defineConfig } from "vite";
import { nitroV2Plugin } from "@solidjs/vite-plugin-nitro-2";
import { solidStart } from "@solidjs/start/config";

export default defineConfig({
plugins: [
solidStart(),
nitroV2Plugin({
prerender: {
crawlLinks: true
}
})
]
});
```
19 changes: 16 additions & 3 deletions packages/start-nitro-v2-vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{
"name": "@solidjs/start-nitro-v2-vite-plugin",
"name": "@solidjs/vite-plugin-nitro-2",
"description": "Nitro v2 plugin for development with SolidStart 2.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"build": "tsc"
"build": "tsc",
"typecheck": "tsc --noEmit",
"typecheck:dist": "pnpm build && pnpx @arethetypeswrong/cli --pack . --profile esm-only"
},
"files": [
"dist",
"package.json",
"README.md"
],
"exports": {
".": "./src/index.ts"
},
Expand All @@ -15,7 +23,12 @@
}
},
"dependencies": {
"nitropack": "^2.11.10",
"nitropack": "^2.11.10"
},
"devDependencies": {
"vite": "^7.1.10"
},
"peerDependencies": {
"vite": "^7"
}
}
Loading
Loading