@lace-cloud/proto 0.28.0 → 0.30.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/index.cjs +37 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +37 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -169,9 +169,10 @@ type RenderOutput = {
|
|
|
169
169
|
type NodeConfig = {
|
|
170
170
|
instance_id: string;
|
|
171
171
|
module_key?: string;
|
|
172
|
+
source?: string;
|
|
172
173
|
inputs: RenderInput[];
|
|
173
174
|
outputs: RenderOutput[];
|
|
174
|
-
|
|
175
|
+
dependency_options: string[];
|
|
175
176
|
depends_on: string[];
|
|
176
177
|
providers: Record<string, string>;
|
|
177
178
|
count: string;
|
|
@@ -271,7 +272,6 @@ type Diagnostic = {
|
|
|
271
272
|
line?: number;
|
|
272
273
|
column?: number;
|
|
273
274
|
};
|
|
274
|
-
type GeneratePhase = 'generating' | 'formatting' | 'validating';
|
|
275
275
|
type ViewportIntent = {
|
|
276
276
|
kind: 'fit-all';
|
|
277
277
|
padding?: number;
|
|
@@ -1028,4 +1028,4 @@ declare class EngineProtocolMismatchError extends Error {
|
|
|
1028
1028
|
*/
|
|
1029
1029
|
declare function checkEngineProtocol(engineVersion: string, engineProtocol: string): void;
|
|
1030
1030
|
|
|
1031
|
-
export { BRIDGE_METHODS, type BlockConfig, type BridgeMethod, type BridgeRequest, type BridgeResponse, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, type CanvasArrangement, type CanvasView$1 as CanvasView, CanvasViewProto, type Conflict, type DeepPartial$1 as DeepPartial, type Diagnostic, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, type EngineMethod, EngineProtocolMismatchError, type EngineStreamMethod, GROUP_HEADER_HEIGHT, GROUP_PADDING,
|
|
1031
|
+
export { BRIDGE_METHODS, type BlockConfig, type BridgeMethod, type BridgeRequest, type BridgeResponse, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, type CanvasArrangement, type CanvasView$1 as CanvasView, CanvasViewProto, type Conflict, type DeepPartial$1 as DeepPartial, type Diagnostic, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, type EngineMethod, EngineProtocolMismatchError, type EngineStreamMethod, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, type HostOnlyMethod, type InstanceAddress, type InstanceChild, type KeepKey, type LayoutEdge, type LayoutItem, type MessageBridge, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, type NodeConfig, type NodePin$1 as NodePin, type ParsedModuleKey, type ProjectionMeta, type ProtoDiagnosticLike, type Rect, type RenderEdge$1 as RenderEdge, type RenderGroup$1 as RenderGroup, type RenderInput, type RenderNode$1 as RenderNode, type RenderOutput, type ResourceConfig, type ScopedInstance, type SettingsConfig, type Size, type ViewportIntent, type XY, apiFields, boxAt, callText, checkEngineProtocol, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
|
package/dist/index.d.ts
CHANGED
|
@@ -169,9 +169,10 @@ type RenderOutput = {
|
|
|
169
169
|
type NodeConfig = {
|
|
170
170
|
instance_id: string;
|
|
171
171
|
module_key?: string;
|
|
172
|
+
source?: string;
|
|
172
173
|
inputs: RenderInput[];
|
|
173
174
|
outputs: RenderOutput[];
|
|
174
|
-
|
|
175
|
+
dependency_options: string[];
|
|
175
176
|
depends_on: string[];
|
|
176
177
|
providers: Record<string, string>;
|
|
177
178
|
count: string;
|
|
@@ -271,7 +272,6 @@ type Diagnostic = {
|
|
|
271
272
|
line?: number;
|
|
272
273
|
column?: number;
|
|
273
274
|
};
|
|
274
|
-
type GeneratePhase = 'generating' | 'formatting' | 'validating';
|
|
275
275
|
type ViewportIntent = {
|
|
276
276
|
kind: 'fit-all';
|
|
277
277
|
padding?: number;
|
|
@@ -1028,4 +1028,4 @@ declare class EngineProtocolMismatchError extends Error {
|
|
|
1028
1028
|
*/
|
|
1029
1029
|
declare function checkEngineProtocol(engineVersion: string, engineProtocol: string): void;
|
|
1030
1030
|
|
|
1031
|
-
export { BRIDGE_METHODS, type BlockConfig, type BridgeMethod, type BridgeRequest, type BridgeResponse, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, type CanvasArrangement, type CanvasView$1 as CanvasView, CanvasViewProto, type Conflict, type DeepPartial$1 as DeepPartial, type Diagnostic, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, type EngineMethod, EngineProtocolMismatchError, type EngineStreamMethod, GROUP_HEADER_HEIGHT, GROUP_PADDING,
|
|
1031
|
+
export { BRIDGE_METHODS, type BlockConfig, type BridgeMethod, type BridgeRequest, type BridgeResponse, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, type CanvasArrangement, type CanvasView$1 as CanvasView, CanvasViewProto, type Conflict, type DeepPartial$1 as DeepPartial, type Diagnostic, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, type EngineMethod, EngineProtocolMismatchError, type EngineStreamMethod, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, type HostOnlyMethod, type InstanceAddress, type InstanceChild, type KeepKey, type LayoutEdge, type LayoutItem, type MessageBridge, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, type NodeConfig, type NodePin$1 as NodePin, type ParsedModuleKey, type ProjectionMeta, type ProtoDiagnosticLike, type Rect, type RenderEdge$1 as RenderEdge, type RenderGroup$1 as RenderGroup, type RenderInput, type RenderNode$1 as RenderNode, type RenderOutput, type ResourceConfig, type ScopedInstance, type SettingsConfig, type Size, type ViewportIntent, type XY, apiFields, boxAt, callText, checkEngineProtocol, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
|
package/dist/index.mjs
CHANGED
|
@@ -3501,10 +3501,10 @@ function deriveNodeConfig(bundle, instanceId) {
|
|
|
3501
3501
|
description: def.description || void 0,
|
|
3502
3502
|
sensitive: def.sensitive || void 0
|
|
3503
3503
|
}));
|
|
3504
|
-
const
|
|
3504
|
+
const dependencyOptions = [
|
|
3505
3505
|
...(scope.modules ?? []).map((u) => u.id),
|
|
3506
3506
|
...(scope.resources ?? []).map((r) => r.id)
|
|
3507
|
-
].filter((id) => id !== child.id);
|
|
3507
|
+
].filter((id) => id !== child.id).map(childReference);
|
|
3508
3508
|
const dependsOn = child.use?.depends_on ?? child.resource?.depends_on ?? [];
|
|
3509
3509
|
const providers = child.use?.providers ?? {};
|
|
3510
3510
|
const meta = child.use ?? child.resource;
|
|
@@ -3515,9 +3515,10 @@ function deriveNodeConfig(bundle, instanceId) {
|
|
|
3515
3515
|
return {
|
|
3516
3516
|
instance_id: instanceId,
|
|
3517
3517
|
module_key: child.use?.module,
|
|
3518
|
+
source: child.use ? callSource(bundle, resolved.scopeKey, child.use.module) : void 0,
|
|
3518
3519
|
inputs,
|
|
3519
3520
|
outputs,
|
|
3520
|
-
|
|
3521
|
+
dependency_options: dependencyOptions,
|
|
3521
3522
|
depends_on: dependsOn,
|
|
3522
3523
|
providers,
|
|
3523
3524
|
count: bindingText(meta?.count),
|
|
@@ -3525,6 +3526,38 @@ function deriveNodeConfig(bundle, instanceId) {
|
|
|
3525
3526
|
available_variables: availableVariables
|
|
3526
3527
|
};
|
|
3527
3528
|
}
|
|
3529
|
+
function callSource(bundle, scopeKey, moduleKey) {
|
|
3530
|
+
const from = dirOf(bundle, scopeKey);
|
|
3531
|
+
const to = sourceDir(bundle, moduleKey);
|
|
3532
|
+
if (from !== void 0 && to !== void 0) return memberSourcePath(from, to);
|
|
3533
|
+
const source = bundle.modules[moduleKey]?.source;
|
|
3534
|
+
return source ? sourceText(source) : "";
|
|
3535
|
+
}
|
|
3536
|
+
function isMemberDir(id) {
|
|
3537
|
+
return id !== "" && id !== "." && id !== ".." && !id.startsWith("./") && !id.startsWith("../") && !id.startsWith("/");
|
|
3538
|
+
}
|
|
3539
|
+
function dirOf(bundle, key) {
|
|
3540
|
+
if (key === bundle.entry) return "";
|
|
3541
|
+
const mod = bundle.modules[key];
|
|
3542
|
+
if (!mod || mod.source || !isMemberDir(mod.id)) return void 0;
|
|
3543
|
+
return mod.id;
|
|
3544
|
+
}
|
|
3545
|
+
function sourceDir(bundle, key) {
|
|
3546
|
+
const dir = dirOf(bundle, key);
|
|
3547
|
+
if (dir !== void 0) return dir;
|
|
3548
|
+
const mod = bundle.modules[key];
|
|
3549
|
+
return mod?.source?.kind === "local" && isMemberDir(mod.id) ? mod.id : void 0;
|
|
3550
|
+
}
|
|
3551
|
+
function memberSourcePath(from, to) {
|
|
3552
|
+
const base = from === "" ? [] : from.split("/");
|
|
3553
|
+
const target = to.split("/");
|
|
3554
|
+
let shared = 0;
|
|
3555
|
+
while (shared < base.length && shared < target.length && base[shared] === target[shared]) {
|
|
3556
|
+
shared++;
|
|
3557
|
+
}
|
|
3558
|
+
const rel = [...base.slice(shared).map(() => ".."), ...target.slice(shared)].join("/") || ".";
|
|
3559
|
+
return rel.startsWith("../") ? rel : `./${rel}`;
|
|
3560
|
+
}
|
|
3528
3561
|
function sourceText(source) {
|
|
3529
3562
|
if (source.kind === "git") {
|
|
3530
3563
|
const subdir = source.subdir ? `//${source.subdir}` : "";
|
|
@@ -4999,7 +5032,7 @@ function isSet3(value) {
|
|
|
4999
5032
|
var CanvasViewProto = CanvasView;
|
|
5000
5033
|
|
|
5001
5034
|
// src/protocol-version.ts
|
|
5002
|
-
var ENGINE_PROTOCOL_VERSION = String(
|
|
5035
|
+
var ENGINE_PROTOCOL_VERSION = String(7 /* PROTOCOL_VERSION_CURRENT */);
|
|
5003
5036
|
var EngineProtocolMismatchError = class extends Error {
|
|
5004
5037
|
constructor(engineVersion, engineProtocol, requiredProtocol) {
|
|
5005
5038
|
super(
|