Skip to content

Commit

Permalink
chore: handle repo and package rename
Browse files Browse the repository at this point in the history
repo: netlify/next-runtime → opennextjs/opennextjs-netlify
npm package: @netlify/plugin-nextjs → @opennextjs/netlify
  • Loading branch information
serhalp committed Oct 23, 2024
1 parent eba1610 commit 631d155
Show file tree
Hide file tree
Showing 23 changed files with 49 additions and 68 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
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Next.js Runtime

<p align="center">
<a aria-label="npm version" href="https://www.npmjs.com/package/@netlify/plugin-nextjs">
<img alt="" src="https://img.shields.io/npm/v/@netlify/plugin-nextjs">
<a aria-label="npm version" href="https://www.npmjs.com/package/@opennextjs/netlify">
<img alt="" src="https://img.shields.io/npm/v/@opennextjs/netlify">
</a>
<a aria-label="MIT License" href="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
<img alt="" src="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
<a aria-label="MIT License" href="https://img.shields.io/npm/l/@opennextjs/netlify">
<img alt="" src="https://img.shields.io/npm/l/@opennextjs/netlify">
</a>
</p>

Expand Down Expand Up @@ -37,21 +37,21 @@ manually in the following ways:

### From the UI (Recommended)

You can go to the [UI](https://app.netlify.com/plugins/@netlify/plugin-nextjs/install) and choose
the site to install the Next.js Runtime on. This method is recommended because you will benefit from
You can go to the [UI](https://app.netlify.com/plugins/@opennextjs/netlify/install) and choose the
site to install the Next.js Runtime on. This method is recommended because you will benefit from
auto-upgrades to important fixes and feature updates.

### From `npm`

```shell
npm install -D @netlify/plugin-nextjs
npm install -D @opennextjs/netlify
```

...then add the following to your `netlify.toml` file:

```toml
[[plugins]]
package = "@netlify/plugin-nextjs"
package = "@opennextjs/netlify"
```

This method is recommended if you wish to pin the Next.js Runtime to a specific version.
Expand All @@ -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.
3 changes: 0 additions & 3 deletions e2e-report/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
base = "e2e-report/"
command = "next build"
publish = ".next"

[[plugins]]
package = "@netlify/plugin-nextjs"
10 changes: 0 additions & 10 deletions e2e-report/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion e2e-report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"lint": "next lint"
},
"dependencies": {
"@netlify/plugin-nextjs": "^5.8.1",
"next": "^14.2.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
name: '@netlify/plugin-nextjs'
name: '@opennextjs/netlify'
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@netlify/plugin-nextjs",
"name": "@opennextjs/netlify",
"version": "5.8.1",
"description": "Run Next.js seamlessly on Netlify",
"main": "./dist/index.js",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
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

6 changes: 3 additions & 3 deletions src/build/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function verifyPublishDir(ctx: PluginContext) {
!satisfies(ctx.nextVersion, SUPPORTED_NEXT_VERSIONS, { includePrerelease: true })
) {
ctx.failBuild(
`@netlify/plugin-nextjs@5 requires Next.js version ${SUPPORTED_NEXT_VERSIONS}, but found ${ctx.nextVersion}. Please upgrade your project's Next.js version.`,
`@opennextjs/netlify@5 requires Next.js version ${SUPPORTED_NEXT_VERSIONS}, but found ${ctx.nextVersion}. Please upgrade your project's Next.js version.`,
)
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function verifyAdvancedAPIRoutes(ctx: PluginContext) {

if (unsupportedAPIRoutes.length !== 0) {
ctx.failBuild(
`@netlify/plugin-nextjs@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:\n${unsupportedAPIRoutes.map((apiRouteConfig) => ` - ${apiRouteConfig.apiRoute} (type: "${apiRouteConfig.config.type}")`).join('\n')}\n\nRefer to https://ntl.fyi/next-scheduled-bg-function-migration as migration example.`,
`@opennextjs/netlify@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:\n${unsupportedAPIRoutes.map((apiRouteConfig) => ` - ${apiRouteConfig.apiRoute} (type: "${apiRouteConfig.config.type}")`).join('\n')}\n\nRefer to https://ntl.fyi/next-scheduled-bg-function-migration as migration example.`,
)
}
}
Expand Down Expand Up @@ -119,7 +119,7 @@ export function verifyNetlifyForms(ctx: PluginContext, html: string) {
formDetectionRegex.test(html)
) {
ctx.failBuild(
'@netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
'@opennextjs/netlify@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
)
}
}
2 changes: 1 addition & 1 deletion tests/integration/advanced-api-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ it<FixtureTestContext>('test', async (ctx) => {
const runPluginPromise = runPlugin(ctx)

await expect(runPluginPromise).rejects.toThrow(
'@netlify/plugin-nextjs@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:',
'@opennextjs/netlify@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:',
)

// list API routes to migrate
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/netlify-forms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ it<FixtureTestContext>('should fail build when netlify forms are used', async (c
const runPluginPromise = runPlugin(ctx)

await expect(runPluginPromise).rejects.toThrow(
'@netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
'@opennextjs/netlify@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
)
})

Expand Down
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
6 changes: 3 additions & 3 deletions tests/smoke/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('version check', () => {
async () => {
await expect(selfCleaningFixtureFactories.next12_1_0()).rejects.toThrow(
new RegExp(
`@netlify/plugin-nextjs@5 requires Next.js version >=13.5.0, but found 12.1.0. Please upgrade your project's Next.js version.`,
`@opennextjs/netlify@5 requires Next.js version >=13.5.0, but found 12.1.0. Please upgrade your project's Next.js version.`,
),
)
},
Expand All @@ -83,7 +83,7 @@ describe('version check', () => {
selfCleaningFixtureFactories.yarnMonorepoMultipleNextVersionsSiteIncompatible(),
).rejects.toThrow(
new RegExp(
`@netlify/plugin-nextjs@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
`@opennextjs/netlify@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
),
)
},
Expand All @@ -101,7 +101,7 @@ describe('version check', () => {
fixtureFactories.npmNestedSiteMultipleNextVersionsIncompatible(),
).rejects.toThrow(
new RegExp(
`@netlify/plugin-nextjs@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
`@opennextjs/netlify@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
),
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
base = ""
command = "npm run build"
publish = "apps/site/.next"

[[plugins]]
package = "@netlify/plugin-nextjs"
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[build]
command = "node setup-site.mjs && npm install && npm run build -w apps/site"
publish = "./apps/site/.next"

[[plugins]]
package = "@netlify/plugin-nextjs"
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 631d155

Please sign in to comment.