devflare 1.0.0-next.66 → 1.0.0-next.67
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.
|
@@ -1144,7 +1144,7 @@ async function runDev(parsed, logger, options) {
|
|
|
1144
1144
|
return runDevCommand(parsed, logger, options);
|
|
1145
1145
|
}
|
|
1146
1146
|
async function runWorkspace(parsed, logger, options) {
|
|
1147
|
-
const { runWorkspaceCommand } = await import("./workspace-
|
|
1147
|
+
const { runWorkspaceCommand } = await import("./workspace-DE60No0K.js");
|
|
1148
1148
|
return runWorkspaceCommand(parsed, logger, options);
|
|
1149
1149
|
}
|
|
1150
1150
|
async function runBuild(parsed, logger, options) {
|
|
@@ -13,12 +13,17 @@ import { n as bundleWorkflowEntrypointScript } from "./r2-presign-runtime-C75FkL
|
|
|
13
13
|
import { dirname, resolve } from "pathe";
|
|
14
14
|
import { createConsola } from "consola";
|
|
15
15
|
//#region src/dev-server/workspace/merge-config.ts
|
|
16
|
+
const NAMESPACE_SEPARATOR = "-";
|
|
17
|
+
/** Join an app namespace to one of its worker names for the merged instance. */
|
|
18
|
+
function namespacedWorkerName(appName, workerName) {
|
|
19
|
+
return `${appName}${NAMESPACE_SEPARATOR}${workerName}`;
|
|
20
|
+
}
|
|
16
21
|
/**
|
|
17
22
|
* Prefix `name` with `${appName}/` — but only when it is one of this app's own
|
|
18
23
|
* worker names. External/cross-app targets are left untouched.
|
|
19
24
|
*/
|
|
20
25
|
function namespaceIfLocal(name, appName, localNames) {
|
|
21
|
-
return localNames.has(name) ?
|
|
26
|
+
return localNames.has(name) ? namespacedWorkerName(appName, name) : name;
|
|
22
27
|
}
|
|
23
28
|
/** Rewrite an intra-app worker reference on a service-binding value (object or string form). */
|
|
24
29
|
function rewriteServiceBindingTarget(value, appName, localNames) {
|
|
@@ -47,9 +52,9 @@ function namespaceAppWorkers(appName, workers, options) {
|
|
|
47
52
|
for (const value of Object.values(worker.durableObjects)) if (value && typeof value === "object" && typeof value.scriptName === "string") value.scriptName = namespaceIfLocal(value.scriptName, appName, localNames);
|
|
48
53
|
}
|
|
49
54
|
if (worker.outboundService !== void 0) worker.outboundService = rewriteServiceBindingTarget(worker.outboundService, appName, localNames);
|
|
50
|
-
worker.name =
|
|
55
|
+
worker.name = namespacedWorkerName(appName, String(worker.name));
|
|
51
56
|
}
|
|
52
|
-
const gatewayWorkerName =
|
|
57
|
+
const gatewayWorkerName = namespacedWorkerName(appName, "gateway");
|
|
53
58
|
const gatewayWorker = workers.find((worker) => worker.name === gatewayWorkerName) ?? workers[0];
|
|
54
59
|
gatewayWorker.unsafeDirectSockets = [{
|
|
55
60
|
host: options.host,
|
|
@@ -109,6 +114,12 @@ function buildMergedWorkspaceConfig(input) {
|
|
|
109
114
|
port: app.directSocketPort
|
|
110
115
|
});
|
|
111
116
|
}
|
|
117
|
+
const seenWorkerNames = /* @__PURE__ */ new Set();
|
|
118
|
+
for (const worker of mergedWorkers) {
|
|
119
|
+
const workerName = String(worker.name);
|
|
120
|
+
if (seenWorkerNames.has(workerName)) throw new Error(`Workspace produced two workers named "${workerName}" after namespacing. Rename one of the conflicting apps so their namespaced worker names stay distinct.`);
|
|
121
|
+
seenWorkerNames.add(workerName);
|
|
122
|
+
}
|
|
112
123
|
const persistPaths = resolveWorkspacePersistPaths(input.persist, input.persistDir);
|
|
113
124
|
return {
|
|
114
125
|
config: {
|
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as runCli, t as parseArgs } from "../_chunks/cli-
|
|
1
|
+
import { n as runCli, t as parseArgs } from "../_chunks/cli-DXnofibT.js";
|
|
2
2
|
export { parseArgs, runCli };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-config.d.ts","sourceRoot":"","sources":["../../../src/dev-server/workspace/merge-config.ts"],"names":[],"mappings":"AAiBA,+EAA+E;AAC/E,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"merge-config.d.ts","sourceRoot":"","sources":["../../../src/dev-server/workspace/merge-config.ts"],"names":[],"mappings":"AAiBA,+EAA+E;AAC/E,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAsB1C,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IACnC,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAA;IACf,oFAAoF;IACpF,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAA;CACxB;AAED,sFAAsF;AACtF,MAAM,WAAW,qBAAqB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAyBD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EAAE,EAC1B,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAwD3D;AAED,sFAAsF;AACtF,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GAChB,qBAAqB,GAAG,SAAS,CAcnC;AAED,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC/C,sEAAsE;IACtE,IAAI,EAAE,mBAAmB,EAAE,CAAA;IAC3B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAA;IAChB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,GAAG;IACnF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,aAAa,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAClF,CA4DA"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,6 @@ import { a as ConfigResourceResolutionError, d as configSchema, n as ConfigValid
|
|
|
5
5
|
import { n as compileConfig, s as stringifyConfig } from "./_chunks/compiler-UxXQgEPq.js";
|
|
6
6
|
import { t as workerName } from "./_chunks/workerName-kEXwmV2m.js";
|
|
7
7
|
import { n as getDurableObjectOptions, t as durableObject } from "./_chunks/decorators-eXNZ1S0N.js";
|
|
8
|
-
import { n as runCli, t as parseArgs } from "./_chunks/cli-
|
|
8
|
+
import { n as runCli, t as parseArgs } from "./_chunks/cli-DXnofibT.js";
|
|
9
9
|
import { i as vars, r as env } from "./_chunks/env-DyL6JOXI.js";
|
|
10
10
|
export { ConfigNotFoundError, ConfigResourceResolutionError, ConfigValidationError, compileConfig, configSchema, defineConfig as default, defineConfig, defineWorkspace, durableObject, env, getDurableObjectOptions, loadConfig, loadResolvedConfig, parseArgs, preview, ref, runCli, stringifyConfig, vars, workerName };
|
package/package.json
CHANGED