Skip to content

Commit

Permalink
Merge branch 'main' into chore/add-jsx-rollup-resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Apr 29, 2024
2 parents 69e5ede + 1e506ac commit f244162
Show file tree
Hide file tree
Showing 27 changed files with 798 additions and 69 deletions.
23 changes: 23 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json",
"formatter": {
"indentStyle": "space"
},
"linter": {
"enabled": false
},
"organizeImports": {
"enabled": false
},
"javascript": {
"formatter": {
"trailingComma": "es5",
"arrowParentheses": "always"
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
29 changes: 11 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import unjs from 'eslint-config-unjs';
import unjs from "eslint-config-unjs";

export default unjs(
{
ignores: [
"**/.output",
"**/.nitro",
"**/.netlify",
"**/.nuxt"
],
rules: {
"unicorn/no-null": 0,
"no-undef": 0,
"@typescript-eslint/no-unused-vars": 0,
"unicorn/filename-case": 0,
"unicorn/consistent-function-scoping": 0,
},
}
);
export default unjs({
ignores: ["**/.output", "**/.nitro", "**/.netlify", "**/.nuxt"],
rules: {
"unicorn/no-null": 0,
"no-undef": 0,
"@typescript-eslint/no-unused-vars": 0,
"unicorn/filename-case": 0,
"unicorn/consistent-function-scoping": 0,
},
});
2 changes: 1 addition & 1 deletion examples/auto-imports/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default defineEventHandler(() => `<h1>${makeGreeting('Nitro')}</h1>`);
export default defineEventHandler(() => `<h1>${makeGreeting("Nitro")}</h1>`);
15 changes: 9 additions & 6 deletions examples/cached-handler/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export default defineCachedEventHandler(async () => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return `Response generated at ${new Date().toISOString()} (took 1 second)`;
}, {
shouldBypassCache: (e) => e.node.req.url.includes("preview")
});
export default defineCachedEventHandler(
async () => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return `Response generated at ${new Date().toISOString()} (took 1 second)`;
},
{
shouldBypassCache: (e) => e.node.req.url.includes("preview"),
}
);
4 changes: 3 additions & 1 deletion examples/custom-error-handler/error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { NitroErrorHandler } from "nitropack";

export default <NitroErrorHandler>function (error, event) {
const errorHandler: NitroErrorHandler = function (error, event) {
event.res.end("[custom error handler] " + error.stack);
};

export default errorHandler;
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"dev": "pnpm nitro dev playground",
"dev:build": "pnpm nitro build playground",
"dev:start": "node playground/.output/server/index.mjs",
"lint": "eslint --cache . && prettier -c src test",
"lint:fix": "eslint --cache --fix . && prettier --write -c src test",
"lint": "eslint --cache . && biome format .",
"lint:fix": "eslint --cache --fix . && biome format . --write",
"nitro": "JITI_ESM_RESOLVE=1 NODE_OPTIONS=\"--enable-source-maps\" jiti ./src/cli/index.ts",
"prepack": "pnpm build",
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
Expand Down Expand Up @@ -136,6 +136,7 @@
"devDependencies": {
"@azure/functions": "^3.5.1",
"@azure/static-web-apps-cli": "^1.1.7",
"@biomejs/biome": "1.7.1",
"@cloudflare/workers-types": "^4.20240423.0",
"@deno/types": "^0.0.1",
"@scalar/api-reference": "^1.22.14",
Expand All @@ -152,6 +153,7 @@
"@vitest/coverage-v8": "^1.5.2",
"automd": "^0.3.7",
"better-sqlite3": "^9.6.0",
"biome": "^0.3.3",
"changelogen": "^0.5.5",
"edge-runtime": "^2.5.9",
"eslint": "^9.1.1",
Expand Down
1 change: 0 additions & 1 deletion playground/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export default eventHandler(async (event) => {
return {};
});
Loading

0 comments on commit f244162

Please sign in to comment.