@astrojs/cloudflare 6.2.1 → 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 88389c7f62c63a35
2
- @astrojs/cloudflare:build: 
3
- @astrojs/cloudflare:build: > @astrojs/cloudflare@6.2.1 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,14 @@
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
+
3
12
  ## 6.2.1
4
13
 
5
14
  ### Patch 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
@@ -111,7 +111,7 @@ function createIntegration(args) {
111
111
  for (let page of pages) {
112
112
  let pagePath = prependForwardSlash(page.pathname);
113
113
  if (_config.base !== "/") {
114
- const base = _config.base.endsWith("/") ? _config.base.substring(0, -1) : _config.base;
114
+ const base = _config.base.endsWith("/") ? _config.base.slice(0, -1) : _config.base;
115
115
  pagePath = `${base}${pagePath}`;
116
116
  }
117
117
  staticPathList.push(pagePath);
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
3
  "description": "Deploy your site to Cloudflare Workers/Pages",
4
- "version": "6.2.1",
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.3"
35
+ "astro": "^2.1.4"
36
36
  },
37
37
  "devDependencies": {
38
- "astro": "2.1.3",
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
@@ -155,9 +155,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
155
155
  for (let page of pages) {
156
156
  let pagePath = prependForwardSlash(page.pathname);
157
157
  if (_config.base !== '/') {
158
- const base = _config.base.endsWith('/')
159
- ? _config.base.substring(0, -1)
160
- : _config.base;
158
+ const base = _config.base.endsWith('/') ? _config.base.slice(0, -1) : _config.base;
161
159
  pagePath = `${base}${pagePath}`;
162
160
  }
163
161
  staticPathList.push(pagePath);