diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb7c9a2..08554b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,4 +22,4 @@ jobs: - run: npm install - run: npx playwright install --with-deps - run: npm run build - - run: npm run test:e2e + - run: npm run test diff --git a/example/.gitignore b/examples/cloudflare-pages/.gitignore similarity index 100% rename from example/.gitignore rename to examples/cloudflare-pages/.gitignore diff --git a/example/app/entry.client.tsx b/examples/cloudflare-pages/app/entry.client.tsx similarity index 100% rename from example/app/entry.client.tsx rename to examples/cloudflare-pages/app/entry.client.tsx diff --git a/example/app/entry.server.tsx b/examples/cloudflare-pages/app/entry.server.tsx similarity index 100% rename from example/app/entry.server.tsx rename to examples/cloudflare-pages/app/entry.server.tsx diff --git a/example/app/root.tsx b/examples/cloudflare-pages/app/root.tsx similarity index 100% rename from example/app/root.tsx rename to examples/cloudflare-pages/app/root.tsx diff --git a/example/app/routes/_index.tsx b/examples/cloudflare-pages/app/routes/_index.tsx similarity index 100% rename from example/app/routes/_index.tsx rename to examples/cloudflare-pages/app/routes/_index.tsx diff --git a/example/e2e.test.ts b/examples/cloudflare-pages/e2e.test.ts similarity index 100% rename from example/e2e.test.ts rename to examples/cloudflare-pages/e2e.test.ts diff --git a/example/functions/[[path]].ts b/examples/cloudflare-pages/functions/[[path]].ts similarity index 100% rename from example/functions/[[path]].ts rename to examples/cloudflare-pages/functions/[[path]].ts diff --git a/example/load-context.ts b/examples/cloudflare-pages/load-context.ts similarity index 100% rename from example/load-context.ts rename to examples/cloudflare-pages/load-context.ts diff --git a/example/package.json b/examples/cloudflare-pages/package.json similarity index 96% rename from example/package.json rename to examples/cloudflare-pages/package.json index 157b4c4..af3330c 100644 --- a/example/package.json +++ b/examples/cloudflare-pages/package.json @@ -1,5 +1,5 @@ { - "name": "example", + "name": "example-cloudflare-pages", "private": true, "sideEffects": false, "type": "module", @@ -37,4 +37,4 @@ "engines": { "node": ">=20.0.0" } -} +} \ No newline at end of file diff --git a/example/playwright.config.ts b/examples/cloudflare-pages/playwright.config.ts similarity index 100% rename from example/playwright.config.ts rename to examples/cloudflare-pages/playwright.config.ts diff --git a/example/server/index.ts b/examples/cloudflare-pages/server/index.ts similarity index 100% rename from example/server/index.ts rename to examples/cloudflare-pages/server/index.ts diff --git a/example/tsconfig.json b/examples/cloudflare-pages/tsconfig.json similarity index 100% rename from example/tsconfig.json rename to examples/cloudflare-pages/tsconfig.json diff --git a/example/vite.config.ts b/examples/cloudflare-pages/vite.config.ts similarity index 100% rename from example/vite.config.ts rename to examples/cloudflare-pages/vite.config.ts diff --git a/example/wrangler.toml b/examples/cloudflare-pages/wrangler.toml similarity index 100% rename from example/wrangler.toml rename to examples/cloudflare-pages/wrangler.toml diff --git a/package-lock.json b/package-lock.json index e2980cb..1662147 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "workspaces": [ "/", - "./example" + "./examples/cloudflare-pages" ], "dependencies": { "@hono/vite-dev-server": "^0.16.0", @@ -37,6 +37,7 @@ } }, "example": { + "extraneous": true, "dependencies": { "@remix-run/cloudflare": "^2.11.1", "@remix-run/cloudflare-pages": "^2.11.1", @@ -63,7 +64,35 @@ "node": ">=20.0.0" } }, - "example/node_modules/@cloudflare/kv-asset-handler": { + "examples/cloudflare-pages": { + "name": "example-cloudflare-pages", + "dependencies": { + "@remix-run/cloudflare": "^2.11.1", + "@remix-run/cloudflare-pages": "^2.11.1", + "@remix-run/react": "^2.11.1", + "hono": "^4.5.11", + "isbot": "^4.1.0", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@cloudflare/workers-types": "^4.20240903.0", + "@hono/vite-dev-server": "^0.16.0", + "@playwright/test": "^1.47.0", + "@remix-run/dev": "^2.11.1", + "@types/react": "^18.2.20", + "@types/react-dom": "^18.2.7", + "playwright": "^1.47.0", + "typescript": "^5.1.6", + "vite": "^5.1.0", + "vite-tsconfig-paths": "^4.2.1", + "wrangler": "3.57.1" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "examples/cloudflare-pages/node_modules/@cloudflare/kv-asset-handler": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.2.tgz", "integrity": "sha512-EeEjMobfuJrwoctj7FA1y1KEbM0+Q1xSjobIEyie9k4haVEBB7vkDvsasw1pM3rO39mL2akxIAzLMUAtrMHZhA==", @@ -76,7 +105,7 @@ "node": ">=16.13" } }, - "example/node_modules/@cloudflare/workerd-darwin-64": { + "examples/cloudflare-pages/node_modules/@cloudflare/workerd-darwin-64": { "version": "1.20240512.0", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20240512.0.tgz", "integrity": "sha512-VMp+CsSHFALQiBzPdQ5dDI4T1qwLu0mQ0aeKVNDosXjueN0f3zj/lf+mFil5/9jBbG3t4mG0y+6MMnalP9Lobw==", @@ -93,7 +122,7 @@ "node": ">=16" } }, - "example/node_modules/@cloudflare/workerd-darwin-arm64": { + "examples/cloudflare-pages/node_modules/@cloudflare/workerd-darwin-arm64": { "version": "1.20240512.0", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20240512.0.tgz", "integrity": "sha512-lZktXGmzMrB5rJqY9+PmnNfv1HKlj/YLZwMjPfF0WVKHUFdvQbAHsi7NlKv6mW9uIvlZnS+K4sIkWc0MDXcRnA==", @@ -110,7 +139,7 @@ "node": ">=16" } }, - "example/node_modules/@cloudflare/workerd-linux-64": { + "examples/cloudflare-pages/node_modules/@cloudflare/workerd-linux-64": { "version": "1.20240512.0", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20240512.0.tgz", "integrity": "sha512-wrHvqCZZqXz6Y3MUTn/9pQNsvaoNjbJpuA6vcXsXu8iCzJi911iVW2WUEBX+MpUWD+mBIP0oXni5tTlhkokOPw==", @@ -127,7 +156,7 @@ "node": ">=16" } }, - "example/node_modules/@cloudflare/workerd-linux-arm64": { + "examples/cloudflare-pages/node_modules/@cloudflare/workerd-linux-arm64": { "version": "1.20240512.0", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20240512.0.tgz", "integrity": "sha512-YPezHMySL9J9tFdzxz390eBswQ//QJNYcZolz9Dgvb3FEfdpK345cE/bsWbMOqw5ws2f82l388epoenghtYvAg==", @@ -144,7 +173,7 @@ "node": ">=16" } }, - "example/node_modules/@cloudflare/workerd-windows-64": { + "examples/cloudflare-pages/node_modules/@cloudflare/workerd-windows-64": { "version": "1.20240512.0", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20240512.0.tgz", "integrity": "sha512-SxKapDrIYSscMR7lGIp/av0l6vokjH4xQ9ACxHgXh+OdOus9azppSmjaPyw4/ePvg7yqpkaNjf9o258IxWtvKQ==", @@ -161,7 +190,7 @@ "node": ">=16" } }, - "example/node_modules/mime": { + "examples/cloudflare-pages/node_modules/mime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", @@ -174,7 +203,7 @@ "node": ">=10.0.0" } }, - "example/node_modules/miniflare": { + "examples/cloudflare-pages/node_modules/miniflare": { "version": "3.20240512.0", "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20240512.0.tgz", "integrity": "sha512-X0PlKR0AROKpxFoJNmRtCMIuJxj+ngEcyTOlEokj2rAQ0TBwUhB4/1uiPvdI6ofW5NugPOD1uomAv+gLjwsLDQ==", @@ -201,7 +230,7 @@ "node": ">=16.13" } }, - "example/node_modules/source-map": { + "examples/cloudflare-pages/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", @@ -211,27 +240,7 @@ "node": ">=0.10.0" } }, - "example/node_modules/vite-tsconfig-paths": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", - "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.1.1", - "globrex": "^0.1.2", - "tsconfck": "^3.0.3" - }, - "peerDependencies": { - "vite": "*" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, - "example/node_modules/workerd": { + "examples/cloudflare-pages/node_modules/workerd": { "version": "1.20240512.0", "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20240512.0.tgz", "integrity": "sha512-VUBmR1PscAPHEE0OF/G2K7/H1gnr9aDWWZzdkIgWfNKkv8dKFCT75H+GJtUHjfwqz3rYCzaNZmatSXOpLGpF8A==", @@ -252,7 +261,7 @@ "@cloudflare/workerd-windows-64": "1.20240512.0" } }, - "example/node_modules/wrangler": { + "examples/cloudflare-pages/node_modules/wrangler": { "version": "3.57.1", "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.57.1.tgz", "integrity": "sha512-M8YnWUwdrb8AFiRePtVnzlDn02OX4osWvdl8oVh6eyZqqkqXYg7lwlYBr14Qj92pMN4JvMBmDZoukkYHvwpJRg==", @@ -6623,8 +6632,8 @@ "node": ">=6" } }, - "node_modules/example": { - "resolved": "example", + "node_modules/example-cloudflare-pages": { + "resolved": "examples/cloudflare-pages", "link": true }, "node_modules/execa": { @@ -15646,6 +15655,26 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/vite-tsconfig-paths": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", + "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "globrex": "^0.1.2", + "tsconfck": "^3.0.3" + }, + "peerDependencies": { + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, "node_modules/vite/node_modules/@esbuild/android-arm": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", diff --git a/package.json b/package.json index de5eef6..8c55380 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.3.0", "type": "module", "scripts": { - "test": "npm run test:e2e", - "test:e2e": "npm run test:e2e -w example", + "test": "npm run test:e2e:cloudflare-pages", + "test:e2e:cloudflare-pages": "npm run test:e2e -w example-cloudflare-pages", "build": "tsup", "watch": "tsup --watch", "lint": "eslint src example/app example/server", @@ -18,7 +18,7 @@ ], "workspaces": [ "/", - "./example" + "./examples/cloudflare-pages" ], "exports": { "./vite": {