Skip to content

Commit

Permalink
update repo
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 5, 2024
1 parent 7591ef3 commit efe940d
Show file tree
Hide file tree
Showing 28 changed files with 825 additions and 1,660 deletions.
2 changes: 1 addition & 1 deletion .github/disabled/azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: pnpm
- run: pnpm install
- run: pnpm build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml → .github/disabled/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm
- run: pnpm install
- run: pnpm test:deployment
Expand Down
2 changes: 1 addition & 1 deletion .github/disabled/firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: pnpm
- run: pnpm install
- run: pnpm build
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
push:
branches: ["main"]

permissions:
contents: read

jobs:
autofix:
runs-on: ubuntu-latest
Expand All @@ -16,11 +13,11 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: "pnpm"
- run: pnpm install
- name: Fix lint issues
run: npm run lint:fix
- run: pnpm automd
- run: pnpm lint:fix
- uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84
with:
commit-message: "chore: apply automated lint fixes"
commit-message: "chore: apply automated updates"
2 changes: 1 addition & 1 deletion .github/workflows/cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm
- run: pnpm install
- run: pnpm build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm
- run: pnpm install
- run: pnpm build
Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

Learn more about Nitro deployment: https://nitro.unjs.io/deploy

<!-- DEPLOYMENTS:START -->
<!-- automd:deployments -->

- **Azure Functions**: ~~Deployment~~ | [Docs](https://nitro.unjs.io/deploy/providers/azure)
- **Azure Static**: [Deployment](https://icy-pond-008be3f03.1.azurestaticapps.net/) | [Docs](https://nitro.unjs.io/deploy/providers/azure)
- **Cloudflare Workers**: [Deployment](https://nitro-deployment.pi0.workers.dev/) | [Docs](https://nitro.unjs.io/deploy/providers/cloudflare)
- **DigitalOcean**: ~~Deployment~~ | [Docs](https://nitro.unjs.io/deploy/providers/digitalocean)
- **Firebase Hosting**: [Deployment](https://nitro-web-app.web.app/) | [Docs](https://nitro.unjs.io/deploy/providers/firebase)
- **Github Pages**: [Deployment](https://unjs.github.io/nitro-deploys/) | [Docs](https://nitro.unjs.io/deploy/providers/github-pages)
- **Heroku**: ~~Deployment~~ | [Docs](https://nitro.unjs.io/deploy/providers/heroku)
- **Netflify Edge**: [Deployment](https://nitro-deployment-edge.netlify.app/) | [Docs](https://nitro.unjs.io/deploy/providers/netlify#netlify-edge-functions)
- **Netlify Functions**: [Deployment](https://nitro-deployment.netlify.app/) | [Docs](https://nitro.unjs.io/deploy/providers/netlify)
- **Render.com**: ~~Deployment~~ | [Docs](https://nitro.unjs.io/deploy/providers/render)
- **Stormkit**: [Deployment](https://scourgebrick-ppmy24.stormkit.dev/) | [Docs](https://nitro.unjs.io/deploy/providers/stormkit)
- **Vercel**: [Deployment](https://nitro-app.vercel.app) | [Docs](https://nitro.unjs.io/deploy/providers/vercel)
- **Vercel Edge**: [Deployment](https://nitro-app-edge.vercel.app) | [Docs](https://nitro.unjs.io/deploy/providers/vercel#vercel-edge-functions)
<!-- DEPLOYMENTS:END -->
| Deployment | index html | /api/hello |
| ------------------ | ---------- | ---------- |
| Azure Static |||
| Cloudflare Workers |||
| Github Pages |||
| Netflify Edge |||
| Netlify Functions |||
| Stormkit |||
| Vercel |||
| Vercel Edge |||

<!-- /automd -->
19 changes: 19 additions & 0 deletions automd.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default {
input: ["README.md"],
generators: {
deployments: {
async generate() {
const { results } = await import("./test/tests.ts");
const mdTable = `
| Deployment | ${results[0][1].map(([name]) => name).join(" | ")} |
| --- | ${results[0][1].map(() => "---").join(" | ")} |
${results.map(([name, tests]) => `| ${name} | ${tests.map(([, fail]) => (fail ? `❌` : "✅")).join(" | ")} |`).join("\n")}
`;

return {
contents: mdTable,
};
},
},
},
};
182 changes: 93 additions & 89 deletions deployments.ts
Original file line number Diff line number Diff line change
@@ -1,89 +1,93 @@
export const deployments = [
process.env.NODE_ENV === "development" && {
name: "Development",
enabled: true,
url: "http://localhost:3000",
docs: "https://nitro.unjs.io/",
},
{
name: "Azure Functions",
enabled: false,
url: "https://nitro-deployment.azurewebsites.net/",
docs: "https://nitro.unjs.io/deploy/providers/azure",
},
{
name: "Azure Static",
enabled: true,
url: "https://icy-pond-008be3f03.1.azurestaticapps.net/",
docs: "https://nitro.unjs.io/deploy/providers/azure",
},
{
name: "Cloudflare Workers",
enabled: true,
url: "https://nitro-deployment.pi0.workers.dev/",
docs: "https://nitro.unjs.io/deploy/providers/cloudflare",
},
{
name: "DigitalOcean",
enabled: false,
url: "https://nitro-app-nom5n.ondigitalocean.app/",
docs: "https://nitro.unjs.io/deploy/providers/digitalocean",
},
{
name: "Firebase Hosting",
enabled: false,
url: "https://nitro-web-app.web.app/",
docs: "https://nitro.unjs.io/deploy/providers/firebase",
},
{
name: "Github Pages",
enabled: true,
test: false,
url: "https://unjs.github.io/nitro-deploys/",
docs: "https://nitro.unjs.io/deploy/workers",
},
{
name: "Heroku",
enabled: false,
url: "https://nitro-app.herokuapp.com/",
docs: "https://nitro.unjs.io/deploy/providers/heroku",
},
{
name: "Netlify Functions",
enabled: true,
url: "https://nitro-deployment.netlify.app/",
docs: "https://nitro.unjs.io/deploy/providers/netlify",
},
{
name: "Netflify Edge",
enabled: true,
url: "https://nitro-deployment-edge.netlify.app/",
docs: "https://nitro.unjs.io/deploy/providers/netlify#netlify-edge-functions",
},
{
name: "Render.com",
enabled: false,
url: "https://nitro-app.onrender.com/",
docs: "https://nitro.unjs.io/deploy/providers/render",
},
{
name: "Stormkit",
enabled: true,
url: "https://scourgebrick-ppmy24.stormkit.dev/",
docs: "https://nitro.unjs.io/deploy/providers/stormkit",
},
{
name: "Vercel",
enabled: true,
url: "https://nitro-app.vercel.app",
docs: "https://nitro.unjs.io/deploy/providers/vercel",
},
{
name: "Vercel Edge",
enabled: true,
url: "https://nitro-app-edge.vercel.app",
docs: "https://nitro.unjs.io/deploy/providers/vercel#vercel-edge-functions",
},
]
.filter(Boolean)
.sort((a, b) => a.name.localeCompare(b.name));
export const deployments =
process.env.NODE_ENV === "development"
? [
{
name: "Development",
enabled: true,
url: "http://localhost:3000/",
docs: "https://nitro.unjs.io/",
},
]
: [
{
name: "Azure Functions",
enabled: false,
url: "https://nitro-deployment.azurewebsites.net/",
docs: "https://nitro.unjs.io/deploy/providers/azure",
},
{
name: "Azure Static",
enabled: true,
url: "https://icy-pond-008be3f03.1.azurestaticapps.net/",
docs: "https://nitro.unjs.io/deploy/providers/azure",
},
{
name: "Cloudflare Workers",
enabled: true,
url: "https://nitro-deployment.pi0.workers.dev/",
docs: "https://nitro.unjs.io/deploy/providers/cloudflare",
},
{
name: "DigitalOcean",
enabled: false,
url: "https://nitro-app-nom5n.ondigitalocean.app/",
docs: "https://nitro.unjs.io/deploy/providers/digitalocean",
},
{
name: "Firebase Hosting",
enabled: false,
url: "https://nitro-web-app.web.app/",
docs: "https://nitro.unjs.io/deploy/providers/firebase",
},
{
name: "Github Pages",
enabled: true,
test: false,
url: "https://unjs.github.io/nitro-deploys/",
docs: "https://nitro.unjs.io/deploy/workers",
},
{
name: "Heroku",
enabled: false,
url: "https://nitro-app.herokuapp.com/",
docs: "https://nitro.unjs.io/deploy/providers/heroku",
},
{
name: "Netlify Functions",
enabled: true,
url: "https://nitro-deployment.netlify.app/",
docs: "https://nitro.unjs.io/deploy/providers/netlify",
},
{
name: "Netflify Edge",
enabled: true,
url: "https://nitro-deployment-edge.netlify.app/",
docs: "https://nitro.unjs.io/deploy/providers/netlify#netlify-edge-functions",
},
{
name: "Render.com",
enabled: false,
url: "https://nitro-app.onrender.com/",
docs: "https://nitro.unjs.io/deploy/providers/render",
},
{
name: "Stormkit",
enabled: true,
url: "https://scourgebrick-ppmy24.stormkit.dev/",
docs: "https://nitro.unjs.io/deploy/providers/stormkit",
},
{
name: "Vercel",
enabled: true,
url: "https://nitro-app.vercel.app/",
docs: "https://nitro.unjs.io/deploy/providers/vercel",
},
{
name: "Vercel Edge",
enabled: true,
url: "https://nitro-app-edge.vercel.app/",
docs: "https://nitro.unjs.io/deploy/providers/vercel#vercel-edge-functions",
},
]
.filter(Boolean)
.sort((a, b) => a.name.localeCompare(b.name));
9 changes: 8 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import unjs from "eslint-config-unjs";

// https://github.com/unjs/eslint-config
export default unjs({
ignores: [".nitro", ".output", "public", "dist", "_dist", ".vercel"],
ignores: [
"**/.nitro",
"**/.output",
"**/public",
"**/dist",
"**/_dist",
"**/.vercel",
],
rules: {},
});
11 changes: 3 additions & 8 deletions nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { createRequire } from "node:module";
import { defineNitroConfig } from "nitropack/config";

const require = createRequire(import.meta.url);
const nitroPkg = require("nitropack/package.json");
const nitroPkg = createRequire(import.meta.url)("nitropack/package.json");

export default defineNitroConfig({
renderer: "./renderer",
compatibilityDate: "2024-09-05",
srcDir: "./server",
runtimeConfig: {
nitroVersion: nitroPkg.version,
},
vercel: {
functions: {
supportsResponseStreaming: true,
},
},
publicAssets: [
{
baseURL: "/_dist",
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
"lint": "eslint . && prettier -c .",
"lint:fix": "eslint --fix . && prettier -w -c .",
"prepare": "nitro prepare",
"readme": "jiti scripts/update-readme.ts",
"start": "node .output/server/index.mjs",
"test": "pnpm lint",
"test:deployment": "jiti ./scripts/test-deployments.ts"
"readme": "automd && pnpm lint:fix",
"test": "pnpm lint && test:deployments",
"test:deployments": "jiti ./test/tests.ts",
"test:dev": "NODE_ENV=development jiti ./test/tests.ts"
},
"resolutions": {
"jiti": "2.0.0-beta.3"
},
"devDependencies": {
"@actions/core": "^1.10.1",
"esbuild": "^0.23.1",
"eslint-config-unjs": "^0.2.1",
"h3": "^1.12.0",
"jiti": "^1.21.6",
"automd": "^0.3.8",
"eslint-config-unjs": "^0.3.2",
"jiti": "2.0.0-beta.3",
"nitropack": "npm:nitropack-nightly@latest",
"ofetch": "^1.3.4",
"prettier": "^3.3.3",
"ufo": "^1.5.4"
"prettier": "^3.3.3"
},
"packageManager": "pnpm@9.0.5",
"packageManager": "pnpm@9.9.0",
"engines": {
"node": ">=20"
}
Expand Down
Loading

0 comments on commit efe940d

Please sign in to comment.