@astrojs/cloudflare 6.1.2 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- @astrojs/cloudflare:build: cache hit, replaying output 58c9f74829c66203
2
- @astrojs/cloudflare:build: 
3
- @astrojs/cloudflare:build: > @astrojs/cloudflare@6.1.2 build /home/runner/work/astro/astro/packages/integrations/cloudflare
4
- @astrojs/cloudflare:build: > astro-scripts build "src/**/*.ts" && tsc
5
- @astrojs/cloudflare:build: 
1
+ @astrojs/cloudflare:build: cache hit, replaying output c680bf8c85b2bd20
2
+ @astrojs/cloudflare:build: 
3
+ @astrojs/cloudflare:build: > @astrojs/cloudflare@6.2.0 build /home/runner/work/astro/astro/packages/integrations/cloudflare
4
+ @astrojs/cloudflare:build: > astro-scripts build "src/**/*.ts" && tsc
5
+ @astrojs/cloudflare:build: 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @astrojs/cloudflare
2
2
 
3
+ ## 6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#6213](https://github.com/withastro/astro/pull/6213) [`afbbc4d5b`](https://github.com/withastro/astro/commit/afbbc4d5bfafc1779bac00b41c2a1cb1c90f2808) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updated compilation settings to disable downlevelling for Node 14
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`fec583909`](https://github.com/withastro/astro/commit/fec583909ab62829dc0c1600e2387979365f2b94), [`b087b83fe`](https://github.com/withastro/astro/commit/b087b83fe266c431fe34a07d5c2293cc4ab011c6), [`694918a56`](https://github.com/withastro/astro/commit/694918a56b01104831296be0c25456135a63c784), [`a20610609`](https://github.com/withastro/astro/commit/a20610609863ae3b48afe96819b8f11ae4f414d5), [`a4a74ab70`](https://github.com/withastro/astro/commit/a4a74ab70cd2aa0d812a1f6b202c4e240a8913bf), [`75921b3cd`](https://github.com/withastro/astro/commit/75921b3cd916d439f6392c487c21532fde35ed13), [`afbbc4d5b`](https://github.com/withastro/astro/commit/afbbc4d5bfafc1779bac00b41c2a1cb1c90f2808)]:
12
+ - astro@2.1.0
13
+
14
+ ## 6.1.3
15
+
16
+ ### Patch Changes
17
+
18
+ - [#6208](https://github.com/withastro/astro/pull/6208) [`79f49acbe`](https://github.com/withastro/astro/commit/79f49acbe13673bfc27e794bcfae518f38c4a4fe) Thanks [@mfrachet](https://github.com/mfrachet)! - Fix path file that was generated outside the functions folder
19
+
20
+ - Updated dependencies [[`79783fc01`](https://github.com/withastro/astro/commit/79783fc0181153a8e379d3f023422510a7467ead), [`baa2dbb3b`](https://github.com/withastro/astro/commit/baa2dbb3b5678b2bd56fb80df99d386f32e274b7), [`8b7cb64da`](https://github.com/withastro/astro/commit/8b7cb64dadfca93c65d62df54754633d398cb2ed)]:
21
+ - astro@2.0.11
22
+
3
23
  ## 6.1.2
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -47,9 +47,9 @@ default `"advanced"`
47
47
 
48
48
  Cloudflare Pages has 2 different modes for deploying functions, `advanced` mode which picks up the `_worker.js` in `dist`, or a directory mode where pages will compile the worker out of a functions folder in the project root.
49
49
 
50
- For most projects the adaptor default of `advanced` will be sufficient; the `dist` folder will contain your compiled project. Switching to directory mode allows you to use [pages plugins](https://developers.cloudflare.com/pages/platform/functions/plugins/) such as [Sentry](https://developers.cloudflare.com/pages/platform/functions/plugins/sentry/) or write custom code to enable logging.
50
+ For most projects the adapter default of `advanced` will be sufficient; the `dist` folder will contain your compiled project. Switching to directory mode allows you to use [pages plugins](https://developers.cloudflare.com/pages/platform/functions/plugins/) such as [Sentry](https://developers.cloudflare.com/pages/platform/functions/plugins/sentry/) or write custom code to enable logging.
51
51
 
52
- In directory mode the adaptor will compile the client side part of you app the same way, but moves the worker script into a `functions` folder in the project root. The adaptor will only ever place a `[[path]].js` in that folder, allowing you to add additional plugins and pages middleware which can be checked into version control. Cloudflare documentation contains more information about [writing custom functions](https://developers.cloudflare.com/pages/platform/functions/).
52
+ In directory mode the adapter will compile the client side part of your app the same way, but moves the worker script into a `functions` folder in the project root. The adapter will only ever place a `[[path]].js` in that folder, allowing you to add additional plugins and pages middleware which can be checked into version control. Cloudflare documentation contains more information about [writing custom functions](https://developers.cloudflare.com/pages/platform/functions/).
53
53
 
54
54
  ```ts
55
55
  // directory mode
@@ -67,7 +67,7 @@ In order for preview to work you must install `wrangler`
67
67
  $ pnpm install wrangler --save-dev
68
68
  ```
69
69
 
70
- It's then possible to update the preview script in your `package.json` to `"preview": "wrangler pages dev ./dist"`. This will allow you run your entire application locally with [Wrangler](https://github.com/cloudflare/wrangler2), which supports secrets, environment variables, KV namespaces, Durable Objects and [all other supported Cloudflare bindings](https://developers.cloudflare.com/pages/platform/functions/#adding-bindings).
70
+ It's then possible to update the preview script in your `package.json` to `"preview": "wrangler pages dev ./dist"`. This will allow you to run your entire application locally with [Wrangler](https://github.com/cloudflare/wrangler2), which supports secrets, environment variables, KV namespaces, Durable Objects and [all other supported Cloudflare bindings](https://developers.cloudflare.com/pages/platform/functions/#adding-bindings).
71
71
 
72
72
  ## Access to the Cloudflare runtime
73
73
 
package/dist/index.js CHANGED
@@ -138,7 +138,7 @@ function createIntegration(args) {
138
138
  );
139
139
  }
140
140
  if (isModeDirectory) {
141
- const functionsUrl = new URL("functions", _config.root);
141
+ const functionsUrl = new URL("functions/", _config.root);
142
142
  await fs.promises.mkdir(functionsUrl, { recursive: true });
143
143
  const directoryUrl = new URL("[[path]].js", functionsUrl);
144
144
  await fs.promises.rename(finalBuildUrl, directoryUrl);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to cloudflare workers or cloudflare pages",
4
- "version": "6.1.2",
4
+ "version": "6.2.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -32,11 +32,11 @@
32
32
  "tiny-glob": "^0.2.9"
33
33
  },
34
34
  "peerDependencies": {
35
- "astro": "^2.0.7"
35
+ "astro": "^2.1.0"
36
36
  },
37
37
  "devDependencies": {
38
- "astro": "2.0.7",
39
- "astro-scripts": "0.0.10",
38
+ "astro": "2.1.0",
39
+ "astro-scripts": "0.0.14",
40
40
  "chai": "^4.3.6",
41
41
  "cheerio": "^1.0.0-rc.11",
42
42
  "mocha": "^9.2.2",
package/src/index.ts CHANGED
@@ -203,8 +203,9 @@ export default function createIntegration(args?: Options): AstroIntegration {
203
203
  }
204
204
 
205
205
  if (isModeDirectory) {
206
- const functionsUrl = new URL('functions', _config.root);
206
+ const functionsUrl = new URL('functions/', _config.root);
207
207
  await fs.promises.mkdir(functionsUrl, { recursive: true });
208
+
208
209
  const directoryUrl = new URL('[[path]].js', functionsUrl);
209
210
  await fs.promises.rename(finalBuildUrl, directoryUrl);
210
211
  }
@@ -17,5 +17,6 @@ describe('mode: "directory"', () => {
17
17
 
18
18
  it('generates functions folder inside the project root', async () => {
19
19
  expect(await fixture.pathExists('../functions')).to.be.true;
20
+ expect(await fixture.pathExists('../functions/[[path]].js')).to.be.true;
20
21
  });
21
22
  });
package/tsconfig.json CHANGED
@@ -3,8 +3,8 @@
3
3
  "include": ["src"],
4
4
  "compilerOptions": {
5
5
  "allowJs": true,
6
- "module": "ES2020",
6
+ "module": "ES2022",
7
7
  "outDir": "./dist",
8
- "target": "ES2020"
8
+ "target": "ES2021"
9
9
  }
10
10
  }