Skip to content

Commit

Permalink
chore: update playground
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 2, 2023
1 parent 1a7a974 commit 028b5c9
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 22 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"dev": "vitest",
"lint": "eslint --ext .ts . && prettier -c src test",
"lint:fix": "eslint --fix --ext .ts . && prettier -w src test",
"play": "jiti test/fixture/app",
"listhen": "node ./scripts/listhen.mjs",
"play": "node ./scripts/listhen.mjs -w ./playground",
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
"test": "pnpm lint && vitest run --coverage"
},
Expand All @@ -56,6 +57,7 @@
"changelogen": "^0.5.4",
"eslint": "^8.46.0",
"eslint-config-unjs": "^0.2.1",
"h3": "^1.8.0-rc.2",
"ip-regex": "^5.0.0",
"prettier": "^3.0.0",
"typescript": "^5.1.6",
Expand Down
8 changes: 8 additions & 0 deletions playground/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { createApp, eventHandler } from "h3";

export const app = createApp();

app.use(
"/",
eventHandler(() => ({ hello: "world!" })),
);
4 changes: 4 additions & 0 deletions playground/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { app } from "./app";
import { toNodeListener } from "h3";

export default toNodeListener(app);
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions scripts/listhen.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

import jiti from "jiti";

const { runMain } = jiti(import.meta.url)("../src/cli");

runMain();
3 changes: 0 additions & 3 deletions test/fixture/app.ts

This file was deleted.

9 changes: 0 additions & 9 deletions test/fixture/dev.ts

This file was deleted.

9 changes: 0 additions & 9 deletions test/fixture/start.ts

This file was deleted.

0 comments on commit 028b5c9

Please sign in to comment.