@astrojs/cloudflare 6.2.0 → 6.2.2

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 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: 
1
+ @astrojs/cloudflare:build: cache hit, replaying output 627ca52425ee75b5
2
+ @astrojs/cloudflare:build: 
3
+ @astrojs/cloudflare:build: > @astrojs/cloudflare@6.2.2 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,29 @@
1
1
  # @astrojs/cloudflare
2
2
 
3
+ ## 6.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6550](https://github.com/withastro/astro/pull/6550) [`2c829fdf6`](https://github.com/withastro/astro/commit/2c829fdf65bcb91485837c9cfb5a3b453c6fccc7) Thanks [@RichiCoder1](https://github.com/RichiCoder1)! - fix `config.base` trimming logic for cloudflare integration `_routes.json` generation
8
+
9
+ - Updated dependencies [[`04dddd783`](https://github.com/withastro/astro/commit/04dddd783da3235aa9ed523d2856adf86b792b5f), [`ea9b3dd72`](https://github.com/withastro/astro/commit/ea9b3dd72b98b3f5a542ca24a275f673faa6c7c5), [`bf024cb34`](https://github.com/withastro/astro/commit/bf024cb3429c5929d98378108230bc946a376b17), [`22955b895`](https://github.com/withastro/astro/commit/22955b895ce4343e282355db64b3a5c1415f3944), [`f413446a8`](https://github.com/withastro/astro/commit/f413446a859e497395b3612e44d1540cc6b9dad7), [`90e5f87d0`](https://github.com/withastro/astro/commit/90e5f87d03215a833bb6ac91f9548670a25ce659), [`388190102`](https://github.com/withastro/astro/commit/3881901028cbb586f5a4de1b4953e2d6730458ab), [`035c0c4df`](https://github.com/withastro/astro/commit/035c0c4df2a623bcc2f2a1cb9e490df35fa29adc), [`f112c12b1`](https://github.com/withastro/astro/commit/f112c12b15dfbb278d66699f54809674dd1bded0), [`689884251`](https://github.com/withastro/astro/commit/68988425119255382f94c983796574050006f003), [`fa132e35c`](https://github.com/withastro/astro/commit/fa132e35c23f2cfe368fd0a7239584a2bc5c4f12), [`f5fddafc2`](https://github.com/withastro/astro/commit/f5fddafc248bb1ef57b7349bfecc25539ae2b5ea), [`283734525`](https://github.com/withastro/astro/commit/28373452503bc6ca88221ffd39a5590e015e4d71), [`66858f1f2`](https://github.com/withastro/astro/commit/66858f1f238a0edf6ded2b0f693bc738785d5aa3), [`6c465e958`](https://github.com/withastro/astro/commit/6c465e958e088ff55e5b895e67c64c0dfd4277a6)]:
10
+ - astro@2.1.4
11
+
12
+ ## 6.2.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#6531](https://github.com/withastro/astro/pull/6531) [`4ddf34893`](https://github.com/withastro/astro/commit/4ddf3489384ed53f25df190a3478da44bd38600e) Thanks [@matthewp](https://github.com/matthewp)! - Remove false-positive warnings from Cloudflare's build.
17
+
18
+ Cloudflare includes warnings when it bundles the already-built output from astro.build. Those warnings are mostly due to `"sideEffects": false` packages that are included in the Vite built output because they are marked as external. Rollup will remove unused imports from these packages but will not remove the actual import, causing the false-positive warning.
19
+
20
+ - [#6473](https://github.com/withastro/astro/pull/6473) [`1c3e8f6c3`](https://github.com/withastro/astro/commit/1c3e8f6c3b839087aa51de2e2fb665cd907f2847) Thanks [@RichiCoder1](https://github.com/RichiCoder1)! - fix automatic routes generation not respecting config.base
21
+
22
+ - [#6494](https://github.com/withastro/astro/pull/6494) [`a13e9d7e3`](https://github.com/withastro/astro/commit/a13e9d7e33baccf51e7d4815f99b481ad174bc57) Thanks [@Yan-Thomas](https://github.com/Yan-Thomas)! - Consistency improvements to several package descriptions
23
+
24
+ - Updated dependencies [[`acf78c5e2`](https://github.com/withastro/astro/commit/acf78c5e271ec3d4f589782078e2a2044cc1c391), [`04e624d06`](https://github.com/withastro/astro/commit/04e624d062c6ce385f6293afba26f3942c2290c6), [`cc90d7219`](https://github.com/withastro/astro/commit/cc90d72197e1139195e9545105b9a1d339f38e1b), [`a9a6ae298`](https://github.com/withastro/astro/commit/a9a6ae29812339ea00f3b9afd3de09bd9d3733a9), [`6a7cf0712`](https://github.com/withastro/astro/commit/6a7cf0712da23e2c095f4bc4f2512e618bceb38e), [`bfd67ea74`](https://github.com/withastro/astro/commit/bfd67ea749dbc6ffa7c9a671fcc48bea6c04a075), [`f6eddffa0`](https://github.com/withastro/astro/commit/f6eddffa0414d54767e9f9e1ee5a936b8a20146b), [`c63874090`](https://github.com/withastro/astro/commit/c6387409062f1d7c2afc93319748ad57086837c5), [`d637d1ea5`](https://github.com/withastro/astro/commit/d637d1ea5b347b9c724adc895c9006c696ac8fc8), [`637f9bc72`](https://github.com/withastro/astro/commit/637f9bc728ea7d56fc82a862d761385f0dcd9528), [`77a046e88`](https://github.com/withastro/astro/commit/77a046e886c370b737208574b6934f5a1cf2b177)]:
25
+ - astro@2.1.3
26
+
3
27
  ## 6.2.0
4
28
 
5
29
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AstroAdapter, AstroIntegration } from 'astro';
2
- declare type Options = {
2
+ type Options = {
3
3
  mode: 'directory' | 'advanced';
4
4
  };
5
5
  export declare function getAdapter(isModeDirectory: boolean): AstroAdapter;
package/dist/index.js CHANGED
@@ -82,6 +82,9 @@ function createIntegration(args) {
82
82
  minify: true,
83
83
  banner: {
84
84
  js: SHIM
85
+ },
86
+ logOverride: {
87
+ "ignored-bare-import": "silent"
85
88
  }
86
89
  });
87
90
  await fs.promises.rename(buildPath, finalBuildUrl);
@@ -106,7 +109,12 @@ function createIntegration(args) {
106
109
  filesOnly: true
107
110
  })).filter((file) => cloudflareSpecialFiles.indexOf(file) < 0).map((file) => `/${file}`);
108
111
  for (let page of pages) {
109
- staticPathList.push(prependForwardSlash(page.pathname));
112
+ let pagePath = prependForwardSlash(page.pathname);
113
+ if (_config.base !== "/") {
114
+ const base = _config.base.endsWith("/") ? _config.base.slice(0, -1) : _config.base;
115
+ pagePath = `${base}${pagePath}`;
116
+ }
117
+ staticPathList.push(pagePath);
110
118
  }
111
119
  const redirectsExists = await fs.promises.stat(new URL("./_redirects", _config.outDir)).then((stat) => stat.isFile()).catch(() => false);
112
120
  if (redirectsExists) {
package/dist/runtime.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export declare type WorkerRuntime<T = unknown> = {
1
+ export type WorkerRuntime<T = unknown> = {
2
2
  name: 'cloudflare';
3
3
  env: T;
4
4
  waitUntil(promise: Promise<any>): void;
5
5
  passThroughOnException(): void;
6
6
  };
7
- export declare type PagesRuntime<T = unknown, U = unknown> = {
7
+ export type PagesRuntime<T = unknown, U = unknown> = {
8
8
  name: 'cloudflare';
9
9
  env: T;
10
10
  functionPath: string;
@@ -1,5 +1,5 @@
1
1
  import type { SSRManifest } from 'astro';
2
- declare type Env = {
2
+ type Env = {
3
3
  ASSETS: {
4
4
  fetch: (req: Request) => Promise<Response>;
5
5
  };
package/dist/util.js CHANGED
@@ -5,6 +5,7 @@ function getProcessEnvProxy() {
5
5
  {
6
6
  get: (target, prop) => {
7
7
  console.warn(
8
+ // NOTE: \0 prevents Vite replacement
8
9
  `Unable to access \`import.meta\0.env.${prop.toString()}\` on initialization as the Cloudflare platform only provides the environment variables per request. Please move the environment variable access inside a function that's only called after a request has been received.`
9
10
  );
10
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
- "description": "Deploy your site to cloudflare workers or cloudflare pages",
4
- "version": "6.2.0",
3
+ "description": "Deploy your site to Cloudflare Workers/Pages",
4
+ "version": "6.2.2",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -28,14 +28,14 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "esbuild": "^0.15.18",
31
+ "esbuild": "^0.17.12",
32
32
  "tiny-glob": "^0.2.9"
33
33
  },
34
34
  "peerDependencies": {
35
- "astro": "^2.1.0"
35
+ "astro": "^2.1.4"
36
36
  },
37
37
  "devDependencies": {
38
- "astro": "2.1.0",
38
+ "astro": "2.1.4",
39
39
  "astro-scripts": "0.0.14",
40
40
  "chai": "^4.3.6",
41
41
  "cheerio": "^1.0.0-rc.11",
package/src/index.ts CHANGED
@@ -107,6 +107,9 @@ export default function createIntegration(args?: Options): AstroIntegration {
107
107
  banner: {
108
108
  js: SHIM,
109
109
  },
110
+ logOverride: {
111
+ 'ignored-bare-import': 'silent',
112
+ },
110
113
  });
111
114
 
112
115
  // Rename to worker.js
@@ -150,7 +153,12 @@ export default function createIntegration(args?: Options): AstroIntegration {
150
153
  .map((file: string) => `/${file}`);
151
154
 
152
155
  for (let page of pages) {
153
- staticPathList.push(prependForwardSlash(page.pathname));
156
+ let pagePath = prependForwardSlash(page.pathname);
157
+ if (_config.base !== '/') {
158
+ const base = _config.base.endsWith('/') ? _config.base.slice(0, -1) : _config.base;
159
+ pagePath = `${base}${pagePath}`;
160
+ }
161
+ staticPathList.push(pagePath);
154
162
  }
155
163
 
156
164
  const redirectsExists = await fs.promises