From 9751b4a0457eba2428115f0e2f4f67ffbac9c4bd Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Wed, 23 Oct 2024 18:25:58 +0200 Subject: [PATCH] chore: handle repo rename --- .github/pull_request_template.md | 2 +- .github/workflows/e2e-report.yml | 2 +- .github/workflows/test-e2e.yml | 12 ++++++------ CONTRIBUTING.md | 12 ++++++------ README.md | 5 +++-- package.json | 6 +++--- run-local-test.sh | 2 +- tests/netlify-deploy.ts | 4 ++-- tests/utils/create-e2e-fixture.ts | 2 +- tests/utils/fixture.ts | 6 +++--- tests/utils/helpers.ts | 2 +- tools/build.js | 2 +- 12 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c785cb9821..7d60388b42 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,4 @@ - + ## Description diff --git a/.github/workflows/e2e-report.yml b/.github/workflows/e2e-report.yml index 09b079f7a7..61239180e5 100644 --- a/.github/workflows/e2e-report.yml +++ b/.github/workflows/e2e-report.yml @@ -43,7 +43,7 @@ jobs: version=${version:-latest} OUTPUT_DIR="e2e-report/data" OUTPUT_FILENAME="test-results.json" - echo "Downloading ${version} test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}" + echo "Downloading ${version} test results from run https://github.com/opennextjs/opennextjs-netlify/actions/runs/${{ steps.get-run-id.outputs.runId }}" rm "${OUTPUT_DIR}/${OUTPUT_FILENAME}" artifact_name="${version}-test-results.json" # NOTE: The artifact name is not necessarily the artifact *file* name. The file name here diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index e515bb3afb..33f9e02663 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -39,7 +39,7 @@ env: NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395 NEXT_TEST_CONTINUE_ON_ERROR: 1 next-path: next.js - runtime-path: next-runtime + runtime-path: opennextjs-netlify GH_TOKEN: ${{ github.token }} jobs: setup: @@ -136,7 +136,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.npm-cache.outputs.PATH }} - key: node-cache-${{ hashFiles('next-runtime/package-lock.json') }} + key: node-cache-${{ hashFiles('opennextjs-netlify/package-lock.json') }} restore-keys: | node-cache- @@ -186,11 +186,11 @@ jobs: run: | # This is when the manifest version was changed if [ `npx semver -p -r ">=14.0.4-canary.26" ${{ matrix.version_spec.version }}` ]; then - echo "filters=../next-runtime/tests/netlify-e2e.cjs" >> $GITHUB_OUTPUT - echo "skip-retry=../next-runtime/tests/e2e-skip-retry.json" >> $GITHUB_OUTPUT + echo "filters=../opennextjs-netlify/tests/netlify-e2e.cjs" >> $GITHUB_OUTPUT + echo "skip-retry=../opennextjs-netlify/tests/e2e-skip-retry.json" >> $GITHUB_OUTPUT else - echo "filters=../next-runtime/tests/netlify-e2e-legacy.json" >> $GITHUB_OUTPUT - echo "skip-retry=../next-runtime/tests/e2e-skip-retry-legacy.json" >> $GITHUB_OUTPUT + echo "filters=../opennextjs-netlify/tests/netlify-e2e-legacy.json" >> $GITHUB_OUTPUT + echo "skip-retry=../opennextjs-netlify/tests/e2e-skip-retry-legacy.json" >> $GITHUB_OUTPUT fi - name: run tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aed7aa9949..e1e5e84440 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ 🎉 Thanks for considering contributing to this project! 🎉 When contributing to this repository, please first discuss the change you wish to make via an -[issue](https://github.com/netlify/next-runtime/issues/new/choose). Please use the issue templates. -They are there to help you and to help the maintainers gather information. +[issue](https://github.com/opennextjs/opennextjs-netlify/issues/new/choose). Please use the issue +templates. They are there to help you and to help the maintainers gather information. Before working on an issue, ask to be assigned to it. This makes it clear to other potential contributors that someone is working on the issue. @@ -31,7 +31,7 @@ Make sure everything is correctly setup with: npm test ``` -## Lambda Folder structure: +## Lambda Folder structure For a simple next.js app @@ -96,7 +96,7 @@ given prefix, run `npm run pretest -- `. The e2e tests can be invoked with `npm run e2e` and perform a full e2e test. This means they do the following: -1. Building the next-runtime (just running `npm run build` in the repository) +1. Building the adapter (just running `npm run build` in the repository) 2. Creating a temp directory and copying the provided fixture over to the directory. 3. Packing the runtime with `npm pack` to the temp directory. 4. Installing the runtime from the created zip artifact of `npm pack` (this is like installing a @@ -147,8 +147,8 @@ Most common commit message prefixes are: ## How to make a minimal reproduction A reproducible test case is a small Next.js site built to demonstrate a problem - often this problem -is caused by a bug in Next.js, next-runtime or user code. Your reproducible test case should contain -the bare minimum features needed to clearly demonstrate the bug. +is caused by a bug in Next.js, @opennextjs/netlify or user code. Your reproducible test case should +contain the bare minimum features needed to clearly demonstrate the bug. Steps to create a reproducible test case: diff --git a/README.md b/README.md index 8001a14420..952bf74a44 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,8 @@ To upgrade from v4 to v5, please visit ## Feedback If you think you have found a bug in Next.js on Netlify, -[please open an issue](https://github.com/netlify/next-runtime/issues). If you have comments or -feature requests, [see the discussion board](https://github.com/netlify/next-runtime/discussions) +[please open an issue](https://github.com/opennextjs/opennextjs-netlify/issues). If you have +comments or feature requests, +[see the discussion board](https://github.com/opennextjs/opennextjs-netlify/discussions) Please note that v4 will only receive security fixes and critical bug fixes. diff --git a/package.json b/package.json index fb82d84bda..f490872995 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/netlify/next-runtime.git" + "url": "git+https://github.com/opennextjs/opennextjs-netlify.git" }, "keywords": [ "nextjs", @@ -44,9 +44,9 @@ ], "license": "MIT", "bugs": { - "url": "https://github.com/netlify/next-runtime/issues" + "url": "https://github.com/opennextjs/opennextjs-netlify/issues" }, - "homepage": "https://github.com/netlify/next-runtime#readme", + "homepage": "https://opennext.js.org/netlify", "devDependencies": { "@fastly/http-compute-js": "1.1.4", "@netlify/blobs": "^8.1.0", diff --git a/run-local-test.sh b/run-local-test.sh index 4cfa139e8c..f3b8251f1e 100755 --- a/run-local-test.sh +++ b/run-local-test.sh @@ -15,7 +15,7 @@ export NEXT_TEST_MODE=deploy export RUNTIME_DIR=$(pwd) cp tests/netlify-deploy.ts ../next.js/test/lib/next-modes/netlify-deploy.ts cd ../next.js/ -git apply ../next-runtime/tests/e2e-utils.patch || git apply ../next-runtime/tests/e2e-utils-v2.patch +git apply ../opennextjs-netlify/tests/e2e-utils.patch || git apply ../opennextjs-netlify/tests/e2e-utils-v2.patch node run-tests.js --type e2e --debug --test-pattern $1 git checkout -- test/lib/e2e-utils.ts diff --git a/tests/netlify-deploy.ts b/tests/netlify-deploy.ts index 7a33f26dab..f68e525834 100644 --- a/tests/netlify-deploy.ts +++ b/tests/netlify-deploy.ts @@ -16,12 +16,12 @@ type NetlifyDeployResponse = { } async function packNextRuntimeImpl() { - const runtimePackDir = await fs.mkdtemp(path.join(tmpdir(), 'next-runtime-pack')) + const runtimePackDir = await fs.mkdtemp(path.join(tmpdir(), 'opennextjs-netlify-pack')) const { stdout } = await execa( 'npm', ['pack', '--json', '--ignore-scripts', `--pack-destination=${runtimePackDir}`], - { cwd: process.env.RUNTIME_DIR || `${process.cwd()}/../next-runtime` }, + { cwd: process.env.RUNTIME_DIR || `${process.cwd()}/../opennextjs-netlify` }, ) const [{ filename, name }] = JSON.parse(stdout) diff --git a/tests/utils/create-e2e-fixture.ts b/tests/utils/create-e2e-fixture.ts index 7d728acef7..c8697d47ff 100644 --- a/tests/utils/create-e2e-fixture.ts +++ b/tests/utils/create-e2e-fixture.ts @@ -51,7 +51,7 @@ interface E2EConfig { * @param fixture name of the folder inside the fixtures folder */ export const createE2EFixture = async (fixture: string, config: E2EConfig = {}) => { - const isolatedFixtureRoot = await mkdtemp(join(tmpdir(), 'netlify-next-runtime-')) + const isolatedFixtureRoot = await mkdtemp(join(tmpdir(), 'opennextjs-netlify-')) let deployID: string let logs: string const _cleanup = (failure: boolean = false) => { diff --git a/tests/utils/fixture.ts b/tests/utils/fixture.ts index db86b9ea32..61a08c9080 100644 --- a/tests/utils/fixture.ts +++ b/tests/utils/fixture.ts @@ -95,7 +95,7 @@ export const createFixture = async (fixture: string, ctx: FixtureTestContext) => delete globalThis[Symbol.for('next-patch')] } - ctx.cwd = await mkdtemp(join(tmpdir(), 'netlify-next-runtime-')) + ctx.cwd = await mkdtemp(join(tmpdir(), 'opennextjs-netlify-')) vi.spyOn(process, 'cwd').mockReturnValue(ctx.cwd) ctx.cleanup = [] @@ -156,7 +156,7 @@ export const createFixture = async (fixture: string, ctx: FixtureTestContext) => } export const createFsFixture = async (fixture: Record, ctx: FixtureTestContext) => { - ctx.cwd = await mkdtemp(join(tmpdir(), 'netlify-next-runtime-')) + ctx.cwd = await mkdtemp(join(tmpdir(), 'opennextjs-netlify-')) vi.spyOn(process, 'cwd').mockReturnValue(ctx.cwd) ctx.cleanup = [ async () => { @@ -261,7 +261,7 @@ export async function runPlugin( } // create zip location in a new temp folder to avoid leaking node_modules through nodes resolve algorithm // that always looks up a parent directory for node_modules - ctx.functionDist = await mkdtemp(join(tmpdir(), 'netlify-next-runtime-dist')) + ctx.functionDist = await mkdtemp(join(tmpdir(), 'opennextjs-netlify-dist')) // bundle the function to get the bootstrap layer and all the important parts await zipFunctions([internalSrcFolder], ctx.functionDist, { basePath: ctx.cwd, diff --git a/tests/utils/helpers.ts b/tests/utils/helpers.ts index db6961734b..34d9545dfd 100644 --- a/tests/utils/helpers.ts +++ b/tests/utils/helpers.ts @@ -48,7 +48,7 @@ export const startMockBlobStore = async (ctx: FixtureTestContext) => { ctx.blobServer = new BlobsServer({ port, token: BLOB_TOKEN, - directory: await mkdtemp(join(tmpdir(), 'netlify-next-runtime-blob-')), + directory: await mkdtemp(join(tmpdir(), 'opennextjs-netlify-blob-')), }) await ctx.blobServer.start() ctx.blobServerGetSpy = vi.spyOn(ctx.blobServer, 'get') diff --git a/tools/build.js b/tools/build.js index 5c8a5d6274..5db351d152 100644 --- a/tools/build.js +++ b/tools/build.js @@ -36,7 +36,7 @@ async function bundle(entryPoints, format, watch) { name: 'mark-runtime-modules-as-external', setup(pluginBuild) { pluginBuild.onResolve({ filter: /^\..*\.c?js$/ }, (args) => { - if (args.importer.includes(join('next-runtime', 'src'))) { + if (args.importer.includes(join('opennextjs-netlify', 'src'))) { return { path: args.path, external: true } } })