@astrojs/cloudflare 9.1.0 → 9.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.
- package/dist/entrypoints/server.advanced.d.ts +1 -1
- package/dist/entrypoints/server.directory.d.ts +1 -1
- package/dist/index.d.ts +16 -10
- package/dist/index.js +2 -2
- package/dist/utils/local-runtime.js +2 -2
- package/dist/utils/parser.js +1 -0
- package/dist/utils/rewriteWasmImportPath.d.ts +1 -1
- package/dist/utils/rewriteWasmImportPath.js +0 -1
- package/dist/utils/sharpBundlePatch.d.ts +1 -1
- package/dist/utils/sharpBundlePatch.js +0 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Request as CFRequest, CacheStorage, ExecutionContext } from '@cloudflare/workers-types';
|
|
2
2
|
import type { SSRManifest } from 'astro';
|
|
3
3
|
type Env = {
|
|
4
4
|
ASSETS: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Request as CFRequest, CacheStorage, EventContext } from '@cloudflare/workers-types';
|
|
2
2
|
import type { SSRManifest } from 'astro';
|
|
3
3
|
export interface DirectoryRuntime<T extends object = object> {
|
|
4
4
|
runtime: {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,25 +3,31 @@ import type { RUNTIME } from './utils/local-runtime.js';
|
|
|
3
3
|
export type { AdvancedRuntime } from './entrypoints/server.advanced.js';
|
|
4
4
|
export type { DirectoryRuntime } from './entrypoints/server.directory.js';
|
|
5
5
|
export type Options = {
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Removed in v10. The 'directory' mode was discontinued because it redundantly bundles code, slowing down your site. Prefer using Astro API Endpoints over `/functions`. The new default mode is 'advanced'.
|
|
8
|
+
*/
|
|
6
9
|
mode?: 'directory' | 'advanced';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Removed in v10. This setting is obsolete as Cloudflare handles all functions in a single execution context, negating the need for multiple functions per project.
|
|
12
|
+
*/
|
|
7
13
|
functionPerRoute?: boolean;
|
|
8
14
|
imageService?: 'passthrough' | 'cloudflare' | 'compile';
|
|
9
|
-
/** Configure automatic `routes.json` generation */
|
|
10
15
|
routes?: {
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
* - `exclude`: One `"/*"` entry in the `include` array will be generated. For each page that is prerendered, an entry in the `exclude` array will be generated.
|
|
15
|
-
* */
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Removed in v10. You will have two options going forward, using auto generated `_route.json` file or provide your own one in `public/_routes.json`. The previous method caused confusion and inconsistencies.
|
|
18
|
+
*/
|
|
16
19
|
strategy?: 'auto' | 'include' | 'exclude';
|
|
17
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Removed in v10. Use `routes.extend.include` instead.
|
|
22
|
+
*/
|
|
18
23
|
include?: string[];
|
|
19
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Removed in v10. Use `routes.extend.exclude` instead.
|
|
26
|
+
*/
|
|
20
27
|
exclude?: string[];
|
|
21
28
|
};
|
|
22
29
|
/**
|
|
23
|
-
*
|
|
24
|
-
* { mode: 'local', ... }: adds cf request object, locals bindings, env vars/secrets which are defined by the user to `astro.dev` with `Astro.locals.runtime` / `context.locals.runtime`
|
|
30
|
+
* @deprecated Removed in v10. Configure bindings in `wrangler.toml`. Leveraging Cloudflare's API simplifies setup and ensures full compatibility with Wrangler configurations. Use `platformProxy` instead.
|
|
25
31
|
*/
|
|
26
32
|
runtime?: {
|
|
27
33
|
mode: 'off';
|
package/dist/index.js
CHANGED
|
@@ -434,10 +434,10 @@ export default function createIntegration(args) {
|
|
|
434
434
|
{
|
|
435
435
|
const includeStrategyLength = includeStrategy
|
|
436
436
|
? includeStrategy.include.length + includeStrategy.exclude.length
|
|
437
|
-
:
|
|
437
|
+
: Number.POSITIVE_INFINITY;
|
|
438
438
|
const excludeStrategyLength = excludeStrategy
|
|
439
439
|
? excludeStrategy.include.length + excludeStrategy.exclude.length
|
|
440
|
-
:
|
|
440
|
+
: Number.POSITIVE_INFINITY;
|
|
441
441
|
const winningStrategy = notFoundIsSSR
|
|
442
442
|
? excludeStrategy
|
|
443
443
|
: includeStrategyLength <= excludeStrategyLength
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'fs';
|
|
2
1
|
import assert from 'node:assert';
|
|
3
|
-
import {
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import TOML from '@iarna/toml';
|
|
5
5
|
import { AstroError } from 'astro/errors';
|
|
6
6
|
import dotenv from 'dotenv';
|
package/dist/utils/parser.js
CHANGED
|
@@ -89,6 +89,7 @@ function getVarsForDev(config, configPath) {
|
|
|
89
89
|
function parseConfig() {
|
|
90
90
|
if (_wrangler)
|
|
91
91
|
return _wrangler;
|
|
92
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: correct usage
|
|
92
93
|
let rawConfig;
|
|
93
94
|
const configPath = findWranglerToml(process.cwd(), false); // false = args.experimentalJsonConfig
|
|
94
95
|
if (!configPath) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import esbuild from 'esbuild';
|
|
1
|
+
import type esbuild from 'esbuild';
|
|
2
2
|
export declare function patchSharpBundle(): esbuild.Plugin;
|
package/package.json
CHANGED