@depup/cloudflare__vite-plugin 1.45.1-depup.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/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @depup/cloudflare__vite-plugin
2
+
3
+ > Dependency-bumped version of [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/cloudflare__vite-plugin
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.45.1 |
17
+ | Processed | 2026-07-21 |
18
+ | Smoke test | failed |
19
+ | Deps updated | 2 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | workerd | 1.20260714.1 | ^1.20260721.1 |
26
+ | ws | 8.21.0 | ^8.21.1 |
27
+
28
+ ---
29
+
30
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@cloudflare/vite-plugin
31
+
32
+ License inherited from the original package.
package/bin/cf-vite ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import("../dist/cf-vite.mjs");
package/changes.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "bumped": {
3
+ "workerd": {
4
+ "from": "1.20260714.1",
5
+ "to": "^1.20260721.1"
6
+ },
7
+ "ws": {
8
+ "from": "8.21.0",
9
+ "to": "^8.21.1"
10
+ }
11
+ },
12
+ "timestamp": "2026-07-21T16:03:22.081Z",
13
+ "totalUpdated": 2
14
+ }
@@ -0,0 +1,165 @@
1
+ import { parseArgs } from "node:util";
2
+ import { createBuilder, createServer } from "vite";
3
+
4
+ //#region src/build-output-env.ts
5
+ /**
6
+ * Shared definition of the internal env var that the `cf-vite build`
7
+ * delegate uses to force the experimental Build Output API on by default.
8
+ */
9
+ const FORCE_BUILD_OUTPUT_ENV_VAR = "CLOUDFLARE_VITE_FORCE_BUILD_OUTPUT";
10
+
11
+ //#endregion
12
+ //#region src/cf-vite.ts
13
+ /**
14
+ * `cf-vite` delegate binary entry point for `@cloudflare/vite-plugin`.
15
+ *
16
+ * EXPERIMENTAL / internal: spawned by Cloudflare's "cf-dev" parent
17
+ * process, not invoked directly by end users. Contract may change.
18
+ *
19
+ * Usage: `<pkgRoot>/bin/cf-vite <verb> [flags...]`. `dev` and `build`
20
+ * are the verbs today; future verbs follow the same shape.
21
+ * Unknown/missing verbs exit 2 (also the parent's version-detection
22
+ * signal).
23
+ *
24
+ * Every verb forces the experimental Build Output API on by default by
25
+ * setting `CLOUDFLARE_VITE_FORCE_BUILD_OUTPUT` in `main()` before Vite
26
+ * loads the user's config; the plugin reads it during config resolution
27
+ * to enable `experimental.newConfig` + `experimental.newConfig.cfBuildOutput`.
28
+ *
29
+ * Spawn contract for `dev`: parent uses `stdio: "inherit"` and forwards
30
+ * SIGINT/SIGTERM. Accepted flags mirror the sibling `cf-wrangler`
31
+ * delegate (`--mode`, `--port`, `--host`, `--local`) so the parent can
32
+ * drive either impl interchangeably; everything else lives in the user's
33
+ * `vite.config.ts` / `wrangler.jsonc` (including the wrangler config
34
+ * file, which is discovered by `cloudflare()` itself). `cf-vite` boots
35
+ * Vite via `createServer()` against the user's own config (expected to
36
+ * include `cloudflare()`); flags are bridged to it as documented inline.
37
+ *
38
+ * `build` runs Vite's full multi-environment app build via
39
+ * `createBuilder().buildApp()` (NOT the legacy single-environment
40
+ * `build()` helper, which would skip the plugin's worker builds). It
41
+ * accepts only `--mode` (the other shared flags don't apply to a build).
42
+ *
43
+ * Exit codes: 0 graceful, 2 unknown verb / parse error, 130 SIGINT,
44
+ * 143 SIGTERM.
45
+ */
46
+ var ArgParseError = class extends Error {
47
+ constructor(message) {
48
+ super(message);
49
+ this.name = "ArgParseError";
50
+ }
51
+ };
52
+ /** Strict argv parser; mirrors `cf-wrangler`'s flags (unknown → throw). */
53
+ function parseDevArgs(argv) {
54
+ let parsed;
55
+ try {
56
+ parsed = parseArgs({
57
+ args: argv,
58
+ options: {
59
+ mode: { type: "string" },
60
+ host: { type: "string" },
61
+ port: { type: "string" },
62
+ local: { type: "boolean" }
63
+ },
64
+ strict: true,
65
+ allowPositionals: false
66
+ });
67
+ } catch (err) {
68
+ throw new ArgParseError(err instanceof Error ? err.message : String(err));
69
+ }
70
+ const out = {};
71
+ if (parsed.values.mode !== void 0) out.mode = parsed.values.mode;
72
+ if (parsed.values.host !== void 0) out.host = parsed.values.host;
73
+ if (parsed.values.port !== void 0) {
74
+ const raw = parsed.values.port;
75
+ const n = Number(raw);
76
+ if (!Number.isInteger(n) || n < 0 || n > 65535) throw new ArgParseError(`--port expects an integer between 0 and 65535, got "${raw}"`);
77
+ out.port = n;
78
+ }
79
+ if (parsed.values.local !== void 0) out.local = parsed.values.local;
80
+ return out;
81
+ }
82
+ function parseBuildArgs(argv) {
83
+ let parsed;
84
+ try {
85
+ parsed = parseArgs({
86
+ args: argv,
87
+ options: { mode: { type: "string" } },
88
+ strict: true,
89
+ allowPositionals: false
90
+ });
91
+ } catch (err) {
92
+ throw new ArgParseError(err instanceof Error ? err.message : String(err));
93
+ }
94
+ const out = {};
95
+ if (parsed.values.mode !== void 0) out.mode = parsed.values.mode;
96
+ return out;
97
+ }
98
+ async function main() {
99
+ const verb = process.argv[2];
100
+ const userArgv = process.argv.slice(3);
101
+ process.env[FORCE_BUILD_OUTPUT_ENV_VAR] = "true";
102
+ if (verb === "dev") return runDev(userArgv);
103
+ if (verb === "build") return runBuild(userArgv);
104
+ process.stderr.write(`Error: unknown subcommand "${verb ?? ""}".\nUsage: cf-vite <dev|build> [args]\n`);
105
+ return 2;
106
+ }
107
+ async function runDev(userArgv) {
108
+ let args;
109
+ try {
110
+ args = parseDevArgs(userArgv);
111
+ } catch (err) {
112
+ if (err instanceof ArgParseError) {
113
+ process.stderr.write(`Error: ${err.message}\n`);
114
+ return 2;
115
+ }
116
+ throw err;
117
+ }
118
+ if (args.local) process.env.CLOUDFLARE_VITE_FORCE_LOCAL = "true";
119
+ const serverOptions = {};
120
+ if (args.port !== void 0) serverOptions.port = args.port;
121
+ if (args.host !== void 0) serverOptions.host = args.host;
122
+ const inlineConfig = { server: serverOptions };
123
+ if (args.mode !== void 0) inlineConfig.mode = args.mode;
124
+ const server = await createServer(inlineConfig);
125
+ await server.listen();
126
+ server.printUrls();
127
+ server.bindCLIShortcuts({ print: true });
128
+ let closing = false;
129
+ const shutdown = (signal) => {
130
+ if (closing) return;
131
+ closing = true;
132
+ (async () => {
133
+ try {
134
+ await server.close();
135
+ process.exit(0);
136
+ } catch {
137
+ process.exit(signal === "SIGINT" ? 130 : 143);
138
+ }
139
+ })();
140
+ };
141
+ process.on("SIGINT", () => shutdown("SIGINT"));
142
+ process.on("SIGTERM", () => shutdown("SIGTERM"));
143
+ return new Promise(() => {});
144
+ }
145
+ async function runBuild(userArgv) {
146
+ let args;
147
+ try {
148
+ args = parseBuildArgs(userArgv);
149
+ } catch (err) {
150
+ if (err instanceof ArgParseError) {
151
+ process.stderr.write(`Error: ${err.message}\n`);
152
+ return 2;
153
+ }
154
+ throw err;
155
+ }
156
+ const inlineConfig = {};
157
+ if (args.mode !== void 0) inlineConfig.mode = args.mode;
158
+ await (await createBuilder(inlineConfig)).buildApp();
159
+ return 0;
160
+ }
161
+ const exitCode = await main();
162
+ process.exit(exitCode);
163
+
164
+ //#endregion
165
+ export { };
@@ -0,0 +1,70 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __create$1 = Object.create;
5
+ var __defProp$1 = Object.defineProperty;
6
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
8
+ var __getProtoOf$1 = Object.getPrototypeOf;
9
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
10
+ var __commonJS$1 = (cb, mod) => function() {
11
+ return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps$1 = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
28
+
29
+ //#endregion
30
+ //#region ../workers-utils/dist/chunk-Q72B4Q5Z.mjs
31
+ var __create = Object.create;
32
+ var __defProp = Object.defineProperty;
33
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
34
+ var __getOwnPropNames = Object.getOwnPropertyNames;
35
+ var __getProtoOf = Object.getPrototypeOf;
36
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
37
+ var __name = (target, value) => __defProp(target, "name", {
38
+ value,
39
+ configurable: true
40
+ });
41
+ var __require = /* @__PURE__ */ ((x) => typeof __require$1 !== "undefined" ? __require$1 : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof __require$1 !== "undefined" ? __require$1 : a)[b] }) : x)(function(x) {
42
+ if (typeof __require$1 !== "undefined") return __require$1.apply(this, arguments);
43
+ throw Error("Dynamic require of \"" + x + "\" is not supported");
44
+ });
45
+ var __commonJS = (cb, mod) => function __require2() {
46
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
47
+ };
48
+ var __export = (target, all) => {
49
+ for (var name in all) __defProp(target, name, {
50
+ get: all[name],
51
+ enumerable: true
52
+ });
53
+ };
54
+ var __copyProps = (to, from, except, desc) => {
55
+ if (from && typeof from === "object" || typeof from === "function") {
56
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
57
+ get: () => from[key],
58
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
59
+ });
60
+ }
61
+ return to;
62
+ };
63
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
64
+ value: mod,
65
+ enumerable: true
66
+ }) : target, mod));
67
+
68
+ //#endregion
69
+ export { __toESM as a, __toESM$1 as c, __require as i, __export as n, __commonJS$1 as o, __name as r, __require$1 as s, __commonJS as t };
70
+ //# sourceMappingURL=chunk-Q72B4Q5Z-izl5Qmnx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Q72B4Q5Z-izl5Qmnx.mjs","names":[],"sources":["../../workers-utils/dist/chunk-Q72B4Q5Z.mjs"],"sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __export, __name, __require, __toESM };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,UAAU,QAAQ,UAAU,UAAU,QAAQ,QAAQ;CAAE;CAAO,cAAc;CAAM,CAAC;AACxF,IAAI,YAA4B,kBAAE,MAAM,uBAAmB,4BAAwB,OAAO,UAAU,cAAc,IAAI,MAAM,GAAG,EAC7H,MAAM,GAAG,OAAO,uBAAmB,4BAAwB,GAAG,IAC/D,CAAC,GAAG,GAAG,SAAS,GAAG;AAClB,KAAI,uBAAmB,YAAa,oBAAe,MAAM,MAAM,UAAU;AACzE,OAAM,MAAM,0BAAyB,IAAI,sBAAqB;EAC9D;AACF,IAAI,cAAc,IAAI,QAAQ,SAAS,aAAa;AAClD,QAAO,QAAQ,GAAG,GAAG,kBAAkB,GAAG,CAAC,MAAM,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,IAAI,EAAE,IAAI;;AAE7F,IAAI,YAAY,QAAQ,QAAQ;AAC9B,MAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;EAAM,CAAC;;AAEjE,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,KAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YACtD;OAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,KAAI,CAAC,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;GAAY,CAAC;;AAExH,QAAO;;AAET,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;CAAM,CAAC,GAAG,QACzG,IACD"}