Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
9 changes: 6 additions & 3 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ 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"
- name: Release
- name: Release Packages
# remove the compat flag until all packages are available on npm
# run: |
# pnpm dlx [email protected] publish './packages/*' --template './examples/*' --compact
run: |
pnpm dlx [email protected] publish './packages/start' --template './examples/*' --compact
pnpm dlx [email protected] publish './packages/*'
37 changes: 37 additions & 0 deletions .github/workflows/dist-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Type Check Distribution

on:
pull_request:
branches-ignore:
- 1.x
push:
branches:
- main

jobs:
typecheck-dist:
name: Check ${{ matrix.package }} distributed types
runs-on: ubuntu-latest
strategy:
matrix:
# @todo
# add Start for v2
package: ["@solidjs/vite-plugin-nitro-2"]
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- uses: pnpm/action-setup@v3

- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check types with @arethetypeswrong/cli
run: pnpm --filter ${{ matrix.package }} typecheck:dist
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
}
})
]
});
```
31 changes: 23 additions & 8 deletions packages/start-nitro-v2-vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
{
"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"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./src/index.ts"
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"publishConfig": {
"access": "public",
"exports": {
".": "./dist/index.js"
}
"access": "public"
},
"dependencies": {
"nitropack": "^2.11.10",
"nitropack": "^2.11.10"
},
"devDependencies": {
"vite": "^7.1.10"
},
"peerDependencies": {
"vite": "^7"
}
}
Loading
Loading