Skip to content

Commit

Permalink
chore: handle repo rename
Browse files Browse the repository at this point in the history
  • Loading branch information
serhalp authored and pieh committed Oct 23, 2024
1 parent eba1610 commit d31748c
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Before opening a pull request, ensure you've read our contributing guidelines, https://github.com/netlify/next-runtime/blob/main/CONTRIBUTING.md. -->
<!-- Before opening a pull request, ensure you've read our contributing guidelines, https://github.com/opennextjs/opennextjs-netlify/blob/main/CONTRIBUTING.md. -->

## Description

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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-
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -96,7 +96,7 @@ given prefix, run `npm run pretest -- <prefix>`.
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
Expand Down Expand Up @@ -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:

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion run-local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions tests/netlify-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/create-e2e-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
6 changes: 3 additions & 3 deletions tests/utils/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -156,7 +156,7 @@ export const createFixture = async (fixture: string, ctx: FixtureTestContext) =>
}

export const createFsFixture = async (fixture: Record<string, string>, 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 () => {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion tools/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
})
Expand Down

0 comments on commit d31748c

Please sign in to comment.