-
Notifications
You must be signed in to change notification settings - Fork 401
Publish @solidjs/vite-plugin-nitro-2
#2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
atilafassina
wants to merge
9
commits into
main
Choose a base branch
from
plugin/nitro-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8225e37
prep for bundling and publishing
atilafassina 4667a99
add changeset
atilafassina 9820f84
check dist typecheck
atilafassina ed055e7
add dist typecheck and export routes
atilafassina 03deadc
add task to continuous release
atilafassina e42cb94
fix readme typo
atilafassina 5d721a2
remove unused dependency
atilafassina 517a9d2
use ts exports like before
Brendonovich c6025f4
Merge branch 'main' into plugin/nitro-2
Brendonovich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@solidjs/vite-plugin-nitro-2": minor | ||
| --- | ||
|
|
||
| Publishing as NPM package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/*' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| }) | ||
| ] | ||
| }); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.