@astrojs/cloudflare 6.2.1 → 6.2.3

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,4 @@
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
+
2
+ > @astrojs/cloudflare@6.2.3 build /home/runner/work/astro/astro/packages/integrations/cloudflare
3
+ > astro-scripts build "src/**/*.ts" && tsc
4
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @astrojs/cloudflare
2
2
 
3
+ ## 6.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6222](https://github.com/withastro/astro/pull/6222) [`081b2402c`](https://github.com/withastro/astro/commit/081b2402cfb48b5eb8dbd02664d8af2f7c798edf) Thanks [@AirBorne04](https://github.com/AirBorne04)! - add option to compile unminified code
8
+
9
+ - Updated dependencies [[`b89042553`](https://github.com/withastro/astro/commit/b89042553ec45d5f6bc71747e0f3470ba969e679)]:
10
+ - astro@2.3.2
11
+
12
+ ## 6.2.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [#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
17
+
18
+ - 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)]:
19
+ - astro@2.1.4
20
+
3
21
  ## 6.2.1
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -108,10 +108,28 @@ By default, `@astrojs/cloudflare` will generate a `_routes.json` file that lists
108
108
 
109
109
  ## Troubleshooting
110
110
 
111
+
111
112
  For help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help!
112
113
 
113
114
  You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.
114
115
 
116
+ ### Meaningful error messages
117
+
118
+ Currently, errors during running your application in Wrangler are not very useful, due to the minification of your code. For better debugging, you can add `vite.build.minify = false` setting to your `astro.config.js`
119
+
120
+ ```
121
+ export default defineConfig({
122
+ adapter: cloudflare(),
123
+ output: 'server',
124
+
125
+ vite: {
126
+ build: {
127
+ minify: false
128
+ }
129
+ }
130
+ });
131
+ ```
132
+
115
133
  ## Contributing
116
134
 
117
135
  This package is maintained by Astro's Core team. You're welcome to submit an issue or PR!
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
@@ -67,6 +67,7 @@ function createIntegration(args) {
67
67
  }
68
68
  },
69
69
  "astro:build:done": async ({ pages }) => {
70
+ var _a, _b;
70
71
  const entryPath = fileURLToPath(new URL(_buildConfig.serverEntry, _buildConfig.server));
71
72
  const entryUrl = new URL(_buildConfig.serverEntry, _config.outDir);
72
73
  const buildPath = fileURLToPath(entryUrl);
@@ -79,7 +80,7 @@ function createIntegration(args) {
79
80
  allowOverwrite: true,
80
81
  format: "esm",
81
82
  bundle: true,
82
- minify: true,
83
+ minify: ((_b = (_a = _config.vite) == null ? void 0 : _a.build) == null ? void 0 : _b.minify) !== false,
83
84
  banner: {
84
85
  js: SHIM
85
86
  },
@@ -111,7 +112,7 @@ function createIntegration(args) {
111
112
  for (let page of pages) {
112
113
  let pagePath = prependForwardSlash(page.pathname);
113
114
  if (_config.base !== "/") {
114
- const base = _config.base.endsWith("/") ? _config.base.substring(0, -1) : _config.base;
115
+ const base = _config.base.endsWith("/") ? _config.base.slice(0, -1) : _config.base;
115
116
  pagePath = `${base}${pagePath}`;
116
117
  }
117
118
  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.3",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -28,19 +28,19 @@
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.3.2"
36
36
  },
37
37
  "devDependencies": {
38
- "astro": "2.1.3",
39
- "astro-scripts": "0.0.14",
40
38
  "chai": "^4.3.6",
41
39
  "cheerio": "^1.0.0-rc.11",
42
40
  "mocha": "^9.2.2",
43
- "wrangler": "^2.0.23"
41
+ "wrangler": "^2.0.23",
42
+ "astro": "2.3.2",
43
+ "astro-scripts": "0.0.14"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "astro-scripts build \"src/**/*.ts\" && tsc",
package/src/index.ts CHANGED
@@ -103,7 +103,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
103
103
  allowOverwrite: true,
104
104
  format: 'esm',
105
105
  bundle: true,
106
- minify: true,
106
+ minify: _config.vite?.build?.minify !== false,
107
107
  banner: {
108
108
  js: SHIM,
109
109
  },
@@ -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);
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="$NODE_PATH:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
11
+ export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="$NODE_PATH:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
11
+ export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="$NODE_PATH:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules"
11
+ export NODE_PATH="/home/runner/work/astro/astro/packages/astro/node_modules:/home/runner/work/astro/astro/packages/node_modules:/home/runner/work/astro/astro/node_modules:/home/runner/work/astro/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/astro/astro/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../../../../../../../astro/astro.js" "$@"