Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ Any contributions you make will be via [Pull Requests](https://docs.github.com/e

```sh
> git remote -v
origin https://github.com/<your-github-username>/opennextjs-cloudflare (fetch)
origin https://github.com/<your-github-username>/opennextjs-cloudflare (push)
origin https://github.com/<your-github-username>/opennextjs-cloudflare (fetch)
origin https://github.com/<your-github-username>/opennextjs-cloudflare (push)
```

- Add `opennextjs/opennextjs-cloudflare` as the `upstream` remote repository.

```sh
> git remote add upstream https://github.com/opennextjs/opennextjs-cloudflare
> git remote -v
origin https://github.com/<your-github-username>/opennextjs-cloudflare (fetch)
origin https://github.com/<your-github-username>/opennextjs-cloudflare (push)
upstream https://github.com/opennextjs/opennextjs-cloudflare (fetch)
upstream https://github.com/opennextjs/opennextjs-cloudflare (push)
origin https://github.com/<your-github-username>/opennextjs-cloudflare (fetch)
origin https://github.com/<your-github-username>/opennextjs-cloudflare (push)
upstream https://github.com/opennextjs/opennextjs-cloudflare (fetch)
upstream https://github.com/opennextjs/opennextjs-cloudflare (push)
```

- You should regularly pull from the `main` branch of the `upstream` repository to keep up to date with the latest changes to the project.
Expand Down Expand Up @@ -82,13 +82,13 @@ pnpm --filter cloudflare build:watch
Build and preview a Next.js sample application. For example, the `api` application:

```sh
pnpm --filter api preview:worker
pnpm --filter api preview
```

You can skip building the Next.js app when it has not been modified, and only run the Cloudflare adaptor tool:

```sh
SKIP_NEXT_APP_BUILD=true pnpm --filter api preview:worker
SKIP_NEXT_APP_BUILD=true pnpm --filter api preview
```

## Checking the code
Expand All @@ -102,7 +102,7 @@ pnpm run code:checks
Attempt to auto-fix any issues with the format, lint and type checks:

```sh
pnpm run code:fixes
pnpm run fix
```

## Testing the code
Expand All @@ -117,6 +117,7 @@ Run all the e2e tests, via Playwright:

```sh
pnpm run e2e
pnpm run e2e:dev
```

## Changesets
Expand All @@ -127,15 +128,15 @@ We use the [`changesets`](https://github.com/changesets/changesets/blob/main/REA
- Create a changeset for the current change.

```sh
> pnpm changeset
pnpm changeset
```

- Select which workspaces are affected by the change and whether the version requires a major, minor or patch release.
- Update the generated changeset with a description of the change.
- Include the generate changeset in the current commit.

```sh
> git add ./changeset/*.md
git add ./changeset/*.md
```

### Changeset message format
Expand Down
56 changes: 2 additions & 54 deletions examples/api/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
import { defineConfig, devices } from "@playwright/test";
import type nodeProcess from "node:process";
import { configurePlaywright } from "../../common/config-e2e";

declare const process: typeof nodeProcess;

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:8770",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm preview:worker",
url: "http://localhost:8770",
reuseExistingServer: !process.env.CI,
timeout: 500_000,
},
});
export default configurePlaywright("api", { isCI: !!process.env.CI });
58 changes: 5 additions & 53 deletions examples/api/e2e/playwright.dev.config.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,7 @@
import { defineConfig, devices } from "@playwright/test";
import type nodeProcess from "node:process";
import { configurePlaywright } from "../../common/config-e2e";

declare const process: typeof nodeProcess;

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./",
testIgnore: "cloudflare.spec.ts",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3333",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm dev --port 3333",
url: "http://localhost:3333",
reuseExistingServer: !process.env.CI,
},
export default configurePlaywright("api", {
isCI: !!process.env.CI,
isWorker: false,
multipleBrowsers: false,
});
3 changes: 1 addition & 2 deletions examples/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"start": "next start",
"lint": "next lint",
"build:worker": "pnpm opennextjs-cloudflare",
"dev:worker": "wrangler dev --port 8770 --inspector-port 9330",
"preview:worker": "pnpm build:worker && pnpm dev:worker",
"preview": "pnpm build:worker && pnpm wrangler dev",
"e2e": "playwright test -c e2e/playwright.config.ts",
"e2e:dev": "playwright test -c e2e/playwright.dev.config.ts",
"cf-typegen": "wrangler types --env-interface CloudflareEnv"
Expand Down
46 changes: 2 additions & 44 deletions examples/bugs/gh-119/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
import { defineConfig, devices } from "@playwright/test";
import type nodeProcess from "node:process";
import { configurePlaywright } from "../../../common/config-e2e";

declare const process: typeof nodeProcess;

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:8750",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm preview",
url: "http://localhost:8750",
reuseExistingServer: !process.env.CI,
timeout: 500_000,
},
});
export default configurePlaywright("gh-119", { isCI: !!process.env.CI, multipleBrowsers: false });
3 changes: 1 addition & 2 deletions examples/bugs/gh-119/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"start": "next start",
"lint": "next lint",
"build:worker": "pnpm opennextjs-cloudflare",
"dev:worker": "wrangler dev --port 8750 --inspector-port 9370",
"preview": "pnpm build:worker && pnpm dev:worker",
"preview": "pnpm build:worker && pnpm wrangler dev",
"e2e": "playwright test -c e2e/playwright.config.ts",
"cf-typegen": "wrangler types --env-interface CloudflareEnv"
},
Expand Down
46 changes: 2 additions & 44 deletions examples/bugs/gh-219/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
import { defineConfig, devices } from "@playwright/test";
import type nodeProcess from "node:process";
import { configurePlaywright } from "../../../common/config-e2e";

declare const process: typeof nodeProcess;

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:8751",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm preview",
url: "http://localhost:8751",
reuseExistingServer: !process.env.CI,
timeout: 500_000,
},
});
export default configurePlaywright("gh-219", { isCI: !!process.env.CI, multipleBrowsers: false });
3 changes: 1 addition & 2 deletions examples/bugs/gh-219/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"start": "next start",
"lint": "next lint",
"build:worker": "opennextjs-cloudflare",
"dev:worker": "wrangler dev --port 8751 --inspector-port 9371",
"preview": "npm run build:worker && npm run dev:worker",
"preview": "npm run build:worker && npx wrangler dev",
"e2e": "playwright test -c e2e/playwright.config.ts",
"deploy:worker": "npm run build:worker && wrangler deploy"
},
Expand Down
46 changes: 2 additions & 44 deletions examples/bugs/gh-223/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
import { defineConfig, devices } from "@playwright/test";
import type nodeProcess from "node:process";
import { configurePlaywright } from "../../../common/config-e2e";

declare const process: typeof nodeProcess;

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:8752",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm preview",
url: "http://localhost:8752",
reuseExistingServer: !process.env.CI,
timeout: 500_000,
},
});
export default configurePlaywright("gh-223", { isCI: !!process.env.CI, multipleBrowsers: false });
3 changes: 1 addition & 2 deletions examples/bugs/gh-223/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"start": "next start",
"lint": "next lint",
"build:worker": "opennextjs-cloudflare",
"dev:worker": "wrangler dev --port 8752 --inspector-port 9372",
"preview": "npm run build:worker && npm run dev:worker",
"preview": "npm run build:worker && npx wrangler dev",
"e2e": "playwright test -c e2e/playwright.config.ts",
"deploy:worker": "npm run build:worker && wrangler deploy"
},
Expand Down
Loading