@opennextjs/cloudflare 1.6.0 → 1.6.1

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.
@@ -74,10 +74,14 @@ async function populateR2IncrementalCache(options, config, populateCacheOptions)
74
74
  "r2 object put",
75
75
  quoteShellMeta(normalizePath(path.join(bucket, cacheKey))),
76
76
  `--file ${quoteShellMeta(fullPath)}`,
77
- ],
78
- // NOTE: R2 does not support the environment flag and results in the following error:
79
- // Incorrect type for the 'cacheExpiry' field on 'HttpMetadata': the provided value is not of type 'date'.
80
- { target: populateCacheOptions.target, logging: "error" });
77
+ ], {
78
+ target: populateCacheOptions.target,
79
+ configPath: populateCacheOptions.configPath,
80
+ // R2 does not support the environment flag and results in the following error:
81
+ // Incorrect type for the 'cacheExpiry' field on 'HttpMetadata': the provided value is not of type 'date'.
82
+ environment: undefined,
83
+ logging: "error",
84
+ });
81
85
  }
82
86
  logger.info(`Successfully populated cache with ${assets.length} assets`);
83
87
  }
@@ -107,7 +111,9 @@ async function populateKVIncrementalCache(options, config, populateCacheOptions)
107
111
  }));
108
112
  writeFileSync(chunkPath, JSON.stringify(kvMapping));
109
113
  runWrangler(options, ["kv bulk put", quoteShellMeta(chunkPath), `--binding ${KV_CACHE_BINDING_NAME}`], {
110
- ...populateCacheOptions,
114
+ target: populateCacheOptions.target,
115
+ environment: populateCacheOptions.environment,
116
+ configPath: populateCacheOptions.configPath,
111
117
  logging: "error",
112
118
  });
113
119
  rmSync(chunkPath);
@@ -124,7 +130,12 @@ function populateD1TagCache(options, config, populateCacheOptions) {
124
130
  "d1 execute",
125
131
  D1_TAG_BINDING_NAME,
126
132
  `--command "CREATE TABLE IF NOT EXISTS revalidations (tag TEXT NOT NULL, revalidatedAt INTEGER NOT NULL, UNIQUE(tag) ON CONFLICT REPLACE);"`,
127
- ], { ...populateCacheOptions, logging: "error" });
133
+ ], {
134
+ target: populateCacheOptions.target,
135
+ environment: populateCacheOptions.environment,
136
+ configPath: populateCacheOptions.configPath,
137
+ logging: "error",
138
+ });
128
139
  logger.info("\nSuccessfully created D1 table");
129
140
  }
130
141
  function populateStaticAssetsIncrementalCache(options) {
@@ -3,6 +3,7 @@ export type WranglerTarget = "local" | "remote";
3
3
  type WranglerOptions = {
4
4
  target?: WranglerTarget;
5
5
  environment?: string;
6
+ configPath?: string;
6
7
  logging?: "all" | "error";
7
8
  };
8
9
  export declare function runWrangler(options: BuildOptions, args: string[], wranglerOpts?: WranglerOptions): void;
@@ -43,6 +43,7 @@ export function runWrangler(options, args, wranglerOpts = {}) {
43
43
  ...injectPassthroughFlagForArgs(options, [
44
44
  ...args,
45
45
  wranglerOpts.environment && `--env ${wranglerOpts.environment}`,
46
+ wranglerOpts.configPath && `--config ${wranglerOpts.configPath}`,
46
47
  wranglerOpts.target === "remote" && "--remote",
47
48
  wranglerOpts.target === "local" && "--local",
48
49
  ].filter((v) => !!v)),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opennextjs/cloudflare",
3
3
  "description": "Cloudflare builder for next apps",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "opennextjs-cloudflare": "dist/cli/index.js"