Skip to content

Commit

Permalink
fix(cloudflare): allow npm publish to succeed (#2834)
Browse files Browse the repository at this point in the history
* fix(cloudflare): add "publishConfig.access" key

* chore(cloudflare): add Pages project settings info

* changeset

* linter

* this is ridiculous
  • Loading branch information
lukeed authored Nov 18, 2021
1 parent e9d7afa commit 467362c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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"
}
}

0 comments on commit 467362c

Please sign in to comment.