Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudflare): allow npm publish to succeed #2834

Merged
merged 5 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions .changeset/itchy-beds-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@sveltejs/adapter-cloudflare": patch
---

- Allow `npm publish` to succeed via `publishConfig.access` config
- Add instructions to README for configuring a new/existing Pages project
16 changes: 15 additions & 1 deletion packages/adapter-cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
};
```

## Options
### Options

The adapter optionally accepts all
[`esbuild.build`](https://esbuild.github.io/api/#build-api) configuration.
Expand All @@ -57,6 +57,20 @@ format: 'esm',
bundle: true,
```

## Deployment

Please follow the [Get Started Guide](https://developers.cloudflare.com/pages/get-started) for Cloudflare Pages to begin.

When configuring your project settings, you must use the following settings:

- **Framework preset** – None
- **Build command** – `npm run build` or `svelte-kit build`
- **Build output directory** – `.svelte-kit/cloudflare`
- **Environment variables**
- `NODE_VERSION`: `16` or `14`

> **Important:** You need to add a `NODE_VERSION` environment variable to both the "production" and "preview" environments. You can add this during project setup or later in the Pages project settings. SvelteKit requires Node `14.13` or later, so you should use `14` or `16` as the `NODE_VERSION` value.

## Changelog

[The Changelog for this package is available on
Expand Down
3 changes: 3 additions & 0 deletions packages/adapter-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
},
"devDependencies": {
"@sveltejs/kit": "workspace:*"
},
"publishConfig": {
"access": "public"
}
}