Skip to content

Commit

Permalink
Merge pull request #7 from vikejs/upgrade-deps
Browse files Browse the repository at this point in the history
Upgrade deps
  • Loading branch information
magne4000 authored Aug 13, 2024
2 parents 31618de + d72f8e4 commit b28bc0a
Show file tree
Hide file tree
Showing 20 changed files with 1,067 additions and 1,588 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

19 changes: 19 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["dist/", "package.json"]
},
"formatter": {
"indentWidth": 2,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"lineWidth": 120
}
},
"vcs": {
"enabled": true,
"clientKind": "git"
}
}
4 changes: 3 additions & 1 deletion examples/hattip-app/.test-dev.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { testRun } from "./.testRun";

testRun("pnpm run dev");
testRun("pnpm run dev", {
serverIsReadyMessage: "Development server is running",
});
10 changes: 3 additions & 7 deletions examples/hattip-app/.testRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ import { expect, fetchHtml, getServerUrl, page, run, test } from "@brillout/test

export { testRun };

let isProd: boolean;

function testRun(cmd: `pnpm run ${"dev" | "preview"}${string}`, options?: Parameters<typeof run>[1]) {
run(cmd, options);

isProd = cmd !== "pnpm run dev";

testUrl({
url: "/",
title: "My Vike App",
text: "built with https://github.com/vikejs/vike-solid",
text: "Rendered to HTML",
textHydration: "Rendered to HTML",
});

Expand Down Expand Up @@ -43,14 +39,14 @@ function testUrl({
counter?: true;
noSSR?: true;
}) {
test(url + " (HTML)", async () => {
test(`${url} (HTML)`, async () => {
const html = await fetchHtml(url);
if (!noSSR) {
expect(html).toContain(text);
}
expect(getTitle(html)).toBe(title);
});
test(url + " (Hydration)", async () => {
test(`${url} (Hydration)`, async () => {
await page.goto(getServerUrl() + url);
const body = await page.textContent("body");
expect(body).toContain(textHydration ?? text);
Expand Down
15 changes: 4 additions & 11 deletions examples/hattip-app/hattip-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@ import { vikeHandler } from "./server/vike-handler";
import type { HattipHandler } from "@hattip/core";
import { createRouter, type RouteHandler } from "@hattip/router";

interface Middleware<
Context extends Record<string | number | symbol, unknown>,
> {
(
request: Request,
context: Context,
): Response | void | Promise<Response> | Promise<void>;
}
type Middleware<Context extends Record<string | number | symbol, unknown>> = (request: Request, context: Context) => Response | void | Promise<Response> | Promise<void>

function handlerAdapter<
Context extends Record<string | number | symbol, unknown>,
>(handler: Middleware<Context>): RouteHandler<unknown, unknown> {
function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(
handler: Middleware<Context>,
): RouteHandler<unknown, unknown> {
return (context) => {
const rawContext = context as unknown as Record<string, unknown>;
rawContext.context ??= {};
Expand Down
24 changes: 12 additions & 12 deletions examples/hattip-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
"keywords": [],
"author": "",
"devDependencies": {
"@auth/core": "^0.34.1",
"@hattip/adapter-cloudflare-workers": "^0.0.46",
"@hattip/adapter-node": "^0.0.46",
"@hattip/vite": "^0.0.46",
"@auth/core": "^0.34.2",
"@hattip/adapter-cloudflare-workers": "^0.0.47",
"@hattip/adapter-node": "^0.0.47",
"@hattip/vite": "^0.0.47",
"cross-env": "^7.0.3",
"typescript": "^5.5.2",
"typescript": "^5.5.4",
"vike-cloudflare": "^0.0.6",
"wrangler": "^3.61.0"
"wrangler": "^3.71.0"
},
"dependencies": {
"@hattip/core": "^0.0.46",
"@hattip/router": "^0.0.46",
"@hattip/core": "^0.0.47",
"@hattip/router": "^0.0.47",
"cross-fetch": "^4.0.0",
"hattip": "^0.0.33",
"lowdb": "^7.0.1",
"solid-js": "^1.8.17",
"vike": "^0.4.177",
"vike-solid": "^0.6.2",
"vite": "^5.3.1"
"solid-js": "^1.8.20",
"vike": "^0.4.184",
"vike-solid": "^0.7.1",
"vite": "^5.4.0"
}
}
6 changes: 1 addition & 5 deletions examples/hattip-app/pages/todo/TodoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ export function TodoList(props: { initialTodoItems: { text: string }[] }) {
}
}}
>
<input
type="text"
onChange={(ev) => setNewTodo(ev.target.value)}
value={newTodo()}
/>{" "}
<input type="text" onChange={(ev) => setNewTodo(ev.target.value)} value={newTodo()} />{" "}
<button type="submit">Add to-do</button>
</form>
</div>
Expand Down
17 changes: 4 additions & 13 deletions examples/hattip-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,10 @@
"noEmit": true,
"moduleResolution": "Bundler",
"target": "ES2022",
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"types": [
"vite/client",
"vike-solid/client"
],
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": ["vite/client", "vike-solid/client"],
"jsx": "preserve",
"jsxImportSource": "solid-js"
},
"exclude": [
"dist"
]
}
"exclude": ["dist"]
}
6 changes: 3 additions & 3 deletions examples/hono-app/.testRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function testRun(cmd: `pnpm run ${"dev" | "preview"}${string}`, options?: Parame
testUrl({
url: "/",
title: "My Vike App",
text: "built with https://github.com/vikejs/vike-solid",
text: "Rendered to HTML",
textHydration: "Rendered to HTML",
});

Expand Down Expand Up @@ -43,14 +43,14 @@ function testUrl({
counter?: true;
noSSR?: true;
}) {
test(url + " (HTML)", async () => {
test(`${url} (HTML)`, async () => {
const html = await fetchHtml(url);
if (!noSSR) {
expect(html).toContain(text);
}
expect(getTitle(html)).toBe(title);
});
test(url + " (Hydration)", async () => {
test(`${url} (Hydration)`, async () => {
await page.goto(getServerUrl() + url);
const body = await page.textContent("body");
expect(body).toContain(textHydration ?? text);
Expand Down
4 changes: 1 addition & 3 deletions examples/hono-app/hono-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { createMiddleware } from "hono/factory";
import { createTodoHandler } from "./server/create-todo-handler.js";
import { vikeHandler } from "./server/vike-handler";

interface Middleware<Context extends Record<string | number | symbol, unknown>> {
(request: Request, context: Context): Response | void | Promise<Response> | Promise<void>;
}
type Middleware<Context extends Record<string | number | symbol, unknown>> = (request: Request, context: Context) => Response | void | Promise<Response> | Promise<void>

export function handlerAdapter<Context extends Record<string | number | symbol, unknown>>(
handler: Middleware<Context>,
Expand Down
22 changes: 11 additions & 11 deletions examples/hono-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
"keywords": [],
"author": "Joël Charles <joel.charles91@gmail.com>",
"devDependencies": {
"@auth/core": "^0.34.1",
"@hono/vite-cloudflare-pages": "^0.4.1",
"@hono/vite-dev-server": "^0.12.2",
"@auth/core": "^0.34.2",
"@hono/vite-cloudflare-pages": "^0.4.2",
"@hono/vite-dev-server": "^0.14.0",
"@types/node": "^18.19.14",
"typescript": "^5.5.2",
"typescript": "^5.5.4",
"vike-cloudflare": "^0.0.6",
"wrangler": "^3.61.0"
"wrangler": "^3.71.0"
},
"dependencies": {
"cross-fetch": "^4.0.0",
"hono": "^4.4.7",
"solid-js": "^1.8.17",
"tsx": "^4.15.7",
"vike": "^0.4.177",
"vike-solid": "^0.6.1",
"vite": "^5.3.1"
"hono": "^4.5.5",
"solid-js": "^1.8.20",
"tsx": "^4.17.0",
"vike": "^0.4.184",
"vike-solid": "^0.7.1",
"vite": "^5.4.0"
}
}
6 changes: 3 additions & 3 deletions examples/vike-app/.testRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function testRun(cmd: `pnpm run ${"dev" | "preview"}${string}`, options?: Parame
testUrl({
url: "/",
title: "My Vike App",
text: "built with https://github.com/vikejs/vike-solid",
text: "Rendered to HTML",
textHydration: "Rendered to HTML",
});

Expand Down Expand Up @@ -43,14 +43,14 @@ function testUrl({
counter?: true;
noSSR?: true;
}) {
test(url + " (HTML)", async () => {
test(`${url} (HTML)`, async () => {
const html = await fetchHtml(url);
if (!noSSR) {
expect(html).toContain(text);
}
expect(getTitle(html)).toBe(title);
});
test(url + " (Hydration)", async () => {
test(`${url} (Hydration)`, async () => {
await page.goto(getServerUrl() + url);
const body = await page.textContent("body");
expect(body).toContain(textHydration ?? text);
Expand Down
16 changes: 8 additions & 8 deletions examples/vike-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"keywords": [],
"author": "Joël Charles <joel.charles91@gmail.com>",
"devDependencies": {
"@auth/core": "^0.34.1",
"@auth/core": "^0.34.2",
"@types/node": "^18.19.14",
"typescript": "^5.5.2",
"typescript": "^5.5.4",
"vike-cloudflare": "^0.0.6",
"wrangler": "^3.61.0"
"wrangler": "^3.71.0"
},
"dependencies": {
"cross-fetch": "^4.0.0",
"solid-js": "^1.8.17",
"tsx": "^4.15.7",
"vike": "^0.4.177",
"vike-solid": "^0.6.1",
"vite": "^5.3.1"
"solid-js": "^1.8.20",
"tsx": "^4.17.0",
"vike": "^0.4.184",
"vike-solid": "^0.7.1",
"vite": "^5.4.0"
}
}
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"test:units": "pnpm --recursive --sequential --filter {packages/*} run test",
"test:types": "test-types",
"========= Formatting": "",
"format": "git ls-files | egrep '\\.(json|js|jsx|css|ts|tsx|vue|mjs|cjs)$' | grep --invert-match package.json | xargs pnpm exec prettier --write",
"lint": "eslint .",
"format": "biome format --write .",
"lint": "biome lint .",
"========= Only allow pnpm; forbid yarn & npm": "",
"preinstall": "npx only-allow pnpm"
},
Expand All @@ -24,15 +24,10 @@
}
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"eslint": "^8.57.0",
"eslint-plugin-solid": "^0.14.1",
"prettier": "^3.3.2",
"@biomejs/biome": "^1.8.3",
"@brillout/test-e2e": "^0.5.33",
"@brillout/test-types": "^0.1.15",
"playwright": "^1.42.1"
"playwright": "^1.46.0"
},
"packageManager": "pnpm@9.4.0"
}
3 changes: 1 addition & 2 deletions packages/vike-cloudflare/assets/vike.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function handleSsr(url) {
const { httpResponse } = pageContext;
if (!httpResponse) {
return new Response("Something went wrong", { status: 500 });
} else {
}
const { statusCode: status, headers } = httpResponse;

const { readable, writable } = new TransformStream();
Expand All @@ -25,7 +25,6 @@ async function handleSsr(url) {
status,
headers,
});
}
}

export default {
Expand Down
14 changes: 7 additions & 7 deletions packages/vike-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
],
"author": "Joël Charles <joel.charles91@gmail.com>",
"devDependencies": {
"@brillout/release-me": "^0.3.9",
"@brillout/release-me": "^0.4.0",
"@hattip/adapter-cloudflare-workers": "^0.0.46",
"esbuild-plugin-raw": "^0.1.8",
"hono": "^4.4.7",
"tsup": "^8.1.0",
"typescript": "^5.5.2",
"vike": "^0.4.177",
"vite": "^5.3.1"
"hono": "^4.5.5",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"vike": "^0.4.184",
"vite": "^5.4.0"
},
"peerDependencies": {
"vike": "^0.4.174",
"vite": "^5.3.0"
},
"optionalDependencies": {
"@hattip/adapter-cloudflare-workers": "^0.0.46"
"@hattip/adapter-cloudflare-workers": "^0.0.47"
},
"files": [
"dist"
Expand Down
Loading

0 comments on commit b28bc0a

Please sign in to comment.