Skip to content

Commit

Permalink
clarify yarn and pnpm compatibility with v2 build image (#393)
Browse files Browse the repository at this point in the history
* add note in readme about yarn and pnpm compatibility with v2 build image
* remove build error thrown when building with yarn pnp
  • Loading branch information
dario-piotrowicz authored Jul 24, 2023
1 parent 1588974 commit 9734795
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-pianos-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudflare/next-on-pages': minor
---

allow next-on-pages applications to be built using `yarn pnp`
13 changes: 0 additions & 13 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions packages/next-on-pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Next, in the [Cloudflare Dashboard](https://dash.cloudflare.com/?to=/:account/pa

> If you don't want to set up a Git repository, you can build your application (as indicated in [Local Development](#local-development)) and publish it manually via the [`wrangler pages publish` command](https://developers.cloudflare.com/workers/wrangler/commands/#publish-1) instead (you'll still need to set the **`nodejs_compat`** flag for your project in the Cloudflare dashboard).
> **Note**:
> When deploying via the Git integration, for better compatibility with tools such as `yarn` and `pnpm` we recommend using the Build system version 2 (that is the default so no action is required).
## Local development

To run the CLI locally, simply run:
Expand Down
2 changes: 0 additions & 2 deletions packages/next-on-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"chokidar": "^3.5.3",
"cookie": "^0.5.0",
"esbuild": "^0.15.3",
"js-yaml": "^4.1.0",
"pcre-to-regexp": "^1.1.0",
"semver": "^7.5.2",
"zod": "^3.21.4",
Expand All @@ -53,7 +52,6 @@
"@cloudflare/workers-types": "^4.20230404.0",
"@tsconfig/strictest": "^2.0.0",
"@types/cookie": "^0.5.1",
"@types/js-yaml": "^4.0.5",
"@types/mock-fs": "^4.13.1",
"@types/node": "^20.1.4",
"dedent-tabs": "^0.10.3",
Expand Down
13 changes: 0 additions & 13 deletions packages/next-on-pages/src/buildApplication/packageManagerUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import YAML from 'js-yaml';
import { execFileSync, spawn } from 'child_process';
import { readFile } from 'fs/promises';
import { cliError } from '../cli';
import { validateFile } from '../utils';

Expand Down Expand Up @@ -30,17 +28,6 @@ export async function getCurrentPackageManager(): Promise<PackageManager> {
});
});
if (!yarnV.startsWith('1.')) {
const yarnrc = await readFile('.yarnrc.yml', 'utf-8');
const { nodeLinker } = YAML.load(yarnrc) as {
nodeLinker: string;
};
if (nodeLinker !== 'node-modules')
throw new Error(`
@cloudflare/next-on-pages doesn't support Plug'n'Play features from yarn berry.
If you want to use @cloudflare/next-on-pages with yarn berry,
please add "nodeLinker: node-modules" to your .yarnrc.yml
`);
return 'yarn (berry)';
} else {
return 'yarn (classic)';
Expand Down

0 comments on commit 9734795

Please sign in to comment.