@neocompose/cli 0.52.0 → 0.52.2
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/neo.mjs
CHANGED
|
@@ -26424,7 +26424,7 @@ function validateClassMemberModifiers(ref, environment, diagnostics) {
|
|
|
26424
26424
|
`Read-only field '${member.name}' cannot be static.`
|
|
26425
26425
|
);
|
|
26426
26426
|
}
|
|
26427
|
-
if (member.initializer === void 0 && !modifiers.has("abstract")) {
|
|
26427
|
+
if (member.initializer === void 0 && !modifiers.has("abstract") && !modifiers.has("override")) {
|
|
26428
26428
|
diagnose(
|
|
26429
26429
|
diagnostics,
|
|
26430
26430
|
ref.uri,
|
|
@@ -27744,14 +27744,14 @@ function validateSystemAnnotationAuthoring(documents, diagnostics) {
|
|
|
27744
27744
|
for (const [uri, document] of documents) {
|
|
27745
27745
|
for (const declaration of document.declarations) {
|
|
27746
27746
|
const declarationAnnotation = systemAnnotation(declaration.annotations);
|
|
27747
|
-
const
|
|
27748
|
-
if (declarationAnnotation !== void 0 && !isSystemReservedRecordId(
|
|
27747
|
+
const declarationId = declaredIdValue(declaration.annotations);
|
|
27748
|
+
if (declarationAnnotation !== void 0 && !isSystemReservedRecordId(declarationId)) {
|
|
27749
27749
|
diagnostics.push(
|
|
27750
27750
|
authoredSystemDiagnostic(
|
|
27751
27751
|
uri,
|
|
27752
27752
|
declarationAnnotation,
|
|
27753
27753
|
declaration.name,
|
|
27754
|
-
|
|
27754
|
+
declarationId
|
|
27755
27755
|
)
|
|
27756
27756
|
);
|
|
27757
27757
|
}
|
|
@@ -42044,7 +42044,7 @@ function assertMemberInvariants(member, path) {
|
|
|
42044
42044
|
);
|
|
42045
42045
|
if (member.storage !== "immutable" && (member.storage !== null || member.overrideOf === null))
|
|
42046
42046
|
fail2("storage", "must be immutable when isReadOnly is true.");
|
|
42047
|
-
if (member.defaultValue === null && !abstract)
|
|
42047
|
+
if (member.defaultValue === null && !abstract && member.overrideOf === null)
|
|
42048
42048
|
fail2("defaultValue", "is required when isReadOnly is true.");
|
|
42049
42049
|
}
|
|
42050
42050
|
if (member.kind === "string" && member.isReadOnly && member.searchKey)
|
|
@@ -45427,7 +45427,7 @@ var init_neoscript_compiler_revision = __esm({
|
|
|
45427
45427
|
"use strict";
|
|
45428
45428
|
init_src();
|
|
45429
45429
|
ACTIVE_NEOSCRIPT_COMPILER_REVISION_ROLLOUT = // <neoscript-compiler-revision-rollout>
|
|
45430
|
-
|
|
45430
|
+
null;
|
|
45431
45431
|
}
|
|
45432
45432
|
});
|
|
45433
45433
|
|
|
@@ -48895,7 +48895,7 @@ var init_dist_node = __esm({
|
|
|
48895
48895
|
});
|
|
48896
48896
|
|
|
48897
48897
|
// ../src/models/classes/world-system-classes.generated.ts
|
|
48898
|
-
var
|
|
48898
|
+
var WORLD_GRID_CHILDREN_MEMBER_ID, WORLD_GRID_CHILDREN_ENTRY_MEMBER_ID, WORLD_OBJECT_CHILDREN_MEMBER_ID, WORLD_OBJECT_CHILDREN_ENTRY_MEMBER_ID, WORLD_OBJECT_PLACEMENT_TILES_MEMBER_ID, WORLD_OBJECT_PLACEMENT_TILES_ENTRY_MEMBER_ID, WORLD_PLACEMENT_TILE_CELL_MEMBER_ID, WORLD_TILE_CELL_MEMBER_ID, WORLD_TILE_LAYER_LINK_TILES_MEMBER_ID, WORLD_TILE_LAYER_LINK_TILE_ENTRY_MEMBER_ID, WORLD_OBJECT_LAYER_LINK_OBJECTS_MEMBER_ID, WORLD_OBJECT_LAYER_LINK_OBJECT_ENTRY_MEMBER_ID, WORLD_ANIMATION_CLIP_TARGET_PARAM_ID, WORLD_ANIMATION_CHILD_OVERRIDE_ENTRY_PARAM_ID, WORLD_ANIMATION_CLIP_FPS_MEMBER_ID, WORLD_ANIMATION_CLIP_DURATION_MEMBER_ID, WORLD_ANIMATION_CLIP_FRAMES_MEMBER_ID, WORLD_ANIMATION_CLIP_TRACKS_MEMBER_ID, WORLD_ANIMATION_FRAME_BASE_INDEX_MEMBER_ID, WORLD_ANIMATION_FRAME_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_FRAME_CHILD_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_FRAME_CHILD_OVERRIDES_ENTRY_MEMBER_ID, WORLD_ANIMATION_FRAME_ACTIONS_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_SELECTOR_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_REFRESH_MEMBER_ID, WORLD_ANIMATION_CHILD_OVERRIDE_OVERRIDES_MEMBER_ID, WORLD_ANIMATION_TRACK_SELECTOR_MEMBER_ID, WORLD_ANIMATION_TRACK_REFRESH_MEMBER_ID, WORLD_ANIMATION_TRACK_START_FRAME_MEMBER_ID, WORLD_ANIMATION_TRACK_DIRECTION_MEMBER_ID, WORLD_ANIMATION_TRACK_OFFSET_START_INDEX_MEMBER_ID, WORLD_ANIMATION_TRACK_OFFSET_END_INDEX_MEMBER_ID, WORLD_ANIMATION_CHILD_TRACK_CLIP_KEY_MEMBER_ID, WORLD_ANIMATION_SEGMENT_DURATION_MEMBER_ID, WORLD_ANIMATION_SEGMENT_FRAMES_MEMBER_ID, WORLD_ANIMATION_SEGMENT_TRACK_CHILD_PARAM_ID, WORLD_ANIMATION_SEGMENT_TRACK_VALUE_PARAM_ID, WORLD_SELECTOR_REFRESH_ON_LOAD_OPTION_ID, WORLD_SELECTOR_REFRESH_PER_FRAME_OPTION_ID, WORLD_PLAY_DIRECTION_FORWARD_OPTION_ID, WORLD_PLAY_DIRECTION_REVERSE_OPTION_ID, WORLD_SYSTEM_CLASS_DEFINITIONS;
|
|
48899
48899
|
var init_world_system_classes_generated = __esm({
|
|
48900
48900
|
"../src/models/classes/world-system-classes.generated.ts"() {
|
|
48901
48901
|
"use strict";
|
|
@@ -48903,7 +48903,6 @@ var init_world_system_classes_generated = __esm({
|
|
|
48903
48903
|
init_member_subtree_distribution();
|
|
48904
48904
|
init_classes();
|
|
48905
48905
|
init_member_kinds();
|
|
48906
|
-
WORLD_LAYER_SORTING_LAYER_MEMBER_ID = "system_89dbb12e-1d7c-42ad-b872-63fc7fe8bd5b";
|
|
48907
48906
|
WORLD_GRID_CHILDREN_MEMBER_ID = "system_98578ba3-a70e-4397-9283-996a898d44c8";
|
|
48908
48907
|
WORLD_GRID_CHILDREN_ENTRY_MEMBER_ID = "system_c86da069-7ef9-5693-a54b-5c331755fde9";
|
|
48909
48908
|
WORLD_OBJECT_CHILDREN_MEMBER_ID = "system_bb5d2cf1-a0dd-4eba-a62e-0e1bf0177071";
|
|
@@ -50950,62 +50949,6 @@ function worldAnimationChildOverrideBindingMember(projectId, classId) {
|
|
|
50950
50949
|
updatedAt: 0
|
|
50951
50950
|
};
|
|
50952
50951
|
}
|
|
50953
|
-
function buildWorldSystemMetadata(worldKind) {
|
|
50954
|
-
return {
|
|
50955
|
-
kind: SystemProtectionKind.WorldAuthoring,
|
|
50956
|
-
worldKind
|
|
50957
|
-
};
|
|
50958
|
-
}
|
|
50959
|
-
function buildWorldSystemFieldMetadata() {
|
|
50960
|
-
return {
|
|
50961
|
-
kind: SystemProtectionKind.WorldAuthoring
|
|
50962
|
-
};
|
|
50963
|
-
}
|
|
50964
|
-
function buildWorldSystemNeoSchemaClassBase(definition2, classIdsByWorldKind) {
|
|
50965
|
-
const schemaFields = definition2.schemaFields ?? [];
|
|
50966
|
-
const genericParams = definition2.genericParams?.map((param) => {
|
|
50967
|
-
const constraintWorldKind = param.constraintClassWorldKind;
|
|
50968
|
-
if (constraintWorldKind === void 0) {
|
|
50969
|
-
return { id: param.id, name: param.name };
|
|
50970
|
-
}
|
|
50971
|
-
const constraintClassId = classIdsByWorldKind?.get(constraintWorldKind);
|
|
50972
|
-
if (classIdsByWorldKind !== void 0 && constraintClassId === void 0) {
|
|
50973
|
-
throw new Error(
|
|
50974
|
-
`Cannot create world system class "${definition2.worldKind}" before generic constraint class "${constraintWorldKind}".`
|
|
50975
|
-
);
|
|
50976
|
-
}
|
|
50977
|
-
return {
|
|
50978
|
-
id: param.id,
|
|
50979
|
-
name: param.name,
|
|
50980
|
-
...constraintClassId === void 0 ? {} : {
|
|
50981
|
-
constraint: {
|
|
50982
|
-
kind: 0 /* Class */,
|
|
50983
|
-
classId: constraintClassId
|
|
50984
|
-
}
|
|
50985
|
-
}
|
|
50986
|
-
};
|
|
50987
|
-
});
|
|
50988
|
-
return {
|
|
50989
|
-
name: definition2.name,
|
|
50990
|
-
...definition2.docsText === void 0 ? {} : { docsText: definition2.docsText },
|
|
50991
|
-
schema: Object.fromEntries(
|
|
50992
|
-
schemaFields.map((field) => [field.schemaKey, field.memberId])
|
|
50993
|
-
),
|
|
50994
|
-
...definition2.uiVisibility === void 0 ? {} : { uiVisibility: definition2.uiVisibility },
|
|
50995
|
-
...definition2.modifier === void 0 ? {} : { modifier: definition2.modifier },
|
|
50996
|
-
system: buildWorldSystemMetadata(definition2.worldKind),
|
|
50997
|
-
...definition2.allowedStorage === void 0 ? {} : { allowedStorage: definition2.allowedStorage },
|
|
50998
|
-
...genericParams === void 0 ? {} : { genericParams },
|
|
50999
|
-
...definition2.extendsGenericBindings === void 0 ? {} : {
|
|
51000
|
-
extendsGenericBindings: deepClonePlainData(
|
|
51001
|
-
definition2.extendsGenericBindings
|
|
51002
|
-
)
|
|
51003
|
-
},
|
|
51004
|
-
...definition2.targetMemberId === void 0 ? {} : { targetMemberId: definition2.targetMemberId },
|
|
51005
|
-
...definition2.constructorIds === void 0 || definition2.constructorIds.length === 0 ? {} : { constructorIds: [...definition2.constructorIds] },
|
|
51006
|
-
...definition2.requiredConstructorId === void 0 ? {} : { requiredConstructorId: definition2.requiredConstructorId }
|
|
51007
|
-
};
|
|
51008
|
-
}
|
|
51009
50952
|
function animationFamilyClassKinds(classes) {
|
|
51010
50953
|
const classesById = new Map(classes.map((entry) => [entry.id, entry]));
|
|
51011
50954
|
const resolved = /* @__PURE__ */ new Map();
|
|
@@ -51031,331 +50974,6 @@ function animationFamilyClassKinds(classes) {
|
|
|
51031
50974
|
}
|
|
51032
50975
|
return family;
|
|
51033
50976
|
}
|
|
51034
|
-
function requireWorldSystemClassDefinition(worldKind) {
|
|
51035
|
-
const definition2 = WORLD_SYSTEM_CLASS_DEFINITION_BY_KIND.get(worldKind);
|
|
51036
|
-
if (definition2 === void 0) {
|
|
51037
|
-
throw new Error(
|
|
51038
|
-
`World system kind "${worldKind}" has no class definition in the generated table.`
|
|
51039
|
-
);
|
|
51040
|
-
}
|
|
51041
|
-
return definition2;
|
|
51042
|
-
}
|
|
51043
|
-
function buildWorldSystemSeedRecords(args) {
|
|
51044
|
-
const definitions = WORLD_SYSTEM_CLASS_DEFINITIONS.filter(
|
|
51045
|
-
(definition2) => args.worldKinds.has(definition2.worldKind)
|
|
51046
|
-
);
|
|
51047
|
-
assertCanonicalWorldSystemClassIds(args.classIdsByWorldKind);
|
|
51048
|
-
const classes = definitions.map((definition2) => {
|
|
51049
|
-
const id2 = args.classIdsByWorldKind.get(definition2.worldKind);
|
|
51050
|
-
if (id2 === void 0) {
|
|
51051
|
-
throw new Error(
|
|
51052
|
-
`World system seed is missing a class id for "${definition2.worldKind}".`
|
|
51053
|
-
);
|
|
51054
|
-
}
|
|
51055
|
-
return {
|
|
51056
|
-
id: id2,
|
|
51057
|
-
projectId: args.projectId,
|
|
51058
|
-
...buildWorldSystemNeoSchemaClassBase(
|
|
51059
|
-
definition2,
|
|
51060
|
-
args.classIdsByWorldKind
|
|
51061
|
-
),
|
|
51062
|
-
...worldSystemSeedExtendsClassId(definition2, args.classIdsByWorldKind),
|
|
51063
|
-
createdAt: args.now,
|
|
51064
|
-
updatedAt: args.now
|
|
51065
|
-
};
|
|
51066
|
-
});
|
|
51067
|
-
const fields = definitions.flatMap((definition2) => [
|
|
51068
|
-
...definition2.schemaFields ?? [],
|
|
51069
|
-
...definition2.supportingFields ?? []
|
|
51070
|
-
]).filter(
|
|
51071
|
-
(field) => args.memberIds === void 0 || args.memberIds.has(field.memberId)
|
|
51072
|
-
);
|
|
51073
|
-
const uniqueFields = new Map(fields.map((field) => [field.memberId, field]));
|
|
51074
|
-
const members = [...uniqueFields.values()].map(
|
|
51075
|
-
(field) => buildWorldSystemSeedMember({ ...args, field })
|
|
51076
|
-
);
|
|
51077
|
-
const constructors = definitions.flatMap((definition2) => {
|
|
51078
|
-
const classId = args.classIdsByWorldKind.get(definition2.worldKind);
|
|
51079
|
-
if (classId === void 0) {
|
|
51080
|
-
throw new Error(
|
|
51081
|
-
`World system seed is missing a constructor owner id for "${definition2.worldKind}".`
|
|
51082
|
-
);
|
|
51083
|
-
}
|
|
51084
|
-
return (definition2.constructors ?? []).map((constructor2) => ({
|
|
51085
|
-
id: constructor2.constructorId,
|
|
51086
|
-
projectId: args.projectId,
|
|
51087
|
-
classId,
|
|
51088
|
-
...constructor2.docsText === void 0 ? {} : { docsText: constructor2.docsText },
|
|
51089
|
-
argumentTypes: constructor2.argumentTypes.map(
|
|
51090
|
-
(argument2) => deepClonePlainData(argument2)
|
|
51091
|
-
),
|
|
51092
|
-
code: constructor2.code,
|
|
51093
|
-
...constructor2.baseArguments === void 0 ? {} : {
|
|
51094
|
-
baseArguments: constructor2.baseArguments?.map((argument2) => ({ ...argument2 })) ?? null
|
|
51095
|
-
},
|
|
51096
|
-
...constructor2.baseInitializerFields === void 0 ? {} : {
|
|
51097
|
-
baseInitializerFields: constructor2.baseInitializerFields?.map((field) => ({
|
|
51098
|
-
...field
|
|
51099
|
-
})) ?? null
|
|
51100
|
-
},
|
|
51101
|
-
createdAt: args.now,
|
|
51102
|
-
updatedAt: args.now
|
|
51103
|
-
}));
|
|
51104
|
-
});
|
|
51105
|
-
return { classes, constructors, members };
|
|
51106
|
-
}
|
|
51107
|
-
function assertCanonicalWorldSystemClassIds(classIdsByWorldKind) {
|
|
51108
|
-
for (const [worldKind, classId] of classIdsByWorldKind) {
|
|
51109
|
-
const canonicalClassId = requireWorldSystemClassDefinition(worldKind).classId;
|
|
51110
|
-
if (classId === canonicalClassId) continue;
|
|
51111
|
-
throw new Error(
|
|
51112
|
-
`World system class "${worldKind}" must use canonical id "${canonicalClassId}", received "${classId}".`
|
|
51113
|
-
);
|
|
51114
|
-
}
|
|
51115
|
-
}
|
|
51116
|
-
function buildWorldSystemSeedMember(args) {
|
|
51117
|
-
const { field } = args;
|
|
51118
|
-
return {
|
|
51119
|
-
id: field.memberId,
|
|
51120
|
-
projectId: args.projectId,
|
|
51121
|
-
name: field.schemaKey,
|
|
51122
|
-
kind: worldSystemSeedMemberKind(field),
|
|
51123
|
-
...field.requirement === void 0 ? {} : { requirement: field.requirement },
|
|
51124
|
-
...field.access === void 0 ? {} : { access: field.access },
|
|
51125
|
-
...field.modifier === void 0 ? {} : { modifier: field.modifier },
|
|
51126
|
-
...field.mutability === void 0 ? {} : { mutability: field.mutability },
|
|
51127
|
-
...field.storage === void 0 ? {} : { storage: field.storage },
|
|
51128
|
-
...field.extendsMemberId === void 0 ? {} : { extendsMemberId: field.extendsMemberId },
|
|
51129
|
-
...worldSystemSeedDefaultValue(field, args.sortingLayerSeed),
|
|
51130
|
-
...field.docsText === void 0 ? {} : { docsText: field.docsText },
|
|
51131
|
-
...field.storageKey === void 0 ? {} : { storageKey: field.storageKey },
|
|
51132
|
-
...field.distribution === void 0 ? {} : { distribution: field.distribution },
|
|
51133
|
-
system: buildWorldSystemFieldMetadata(),
|
|
51134
|
-
createdAt: args.now,
|
|
51135
|
-
updatedAt: args.now,
|
|
51136
|
-
...worldSystemSeedMemberSpecificFields(
|
|
51137
|
-
field,
|
|
51138
|
-
args.classIdsByWorldKind,
|
|
51139
|
-
args.sortingLayerSeed
|
|
51140
|
-
)
|
|
51141
|
-
};
|
|
51142
|
-
}
|
|
51143
|
-
function worldSystemSeedExtendsClassId(definition2, classIdsByWorldKind) {
|
|
51144
|
-
const parentKind = definition2.extendsWorldKind;
|
|
51145
|
-
if (parentKind === void 0) return {};
|
|
51146
|
-
const parentClassId = classIdsByWorldKind.get(parentKind);
|
|
51147
|
-
if (parentClassId === void 0) {
|
|
51148
|
-
throw new Error(
|
|
51149
|
-
`Cannot create world system class "${definition2.worldKind}" before parent "${parentKind}".`
|
|
51150
|
-
);
|
|
51151
|
-
}
|
|
51152
|
-
return { extendsClassId: parentClassId };
|
|
51153
|
-
}
|
|
51154
|
-
function worldSystemSeedDefaultValue(field, sortingLayerSeed) {
|
|
51155
|
-
if (field.memberId === WORLD_LAYER_SORTING_LAYER_MEMBER_ID) {
|
|
51156
|
-
return {
|
|
51157
|
-
defaultValue: {
|
|
51158
|
-
value: [
|
|
51159
|
-
requireSortingLayerSeed(
|
|
51160
|
-
sortingLayerSeed,
|
|
51161
|
-
"Cannot seed the layer SortingLayer default before sorting layers are seeded."
|
|
51162
|
-
).defaultSortingLayerValueId
|
|
51163
|
-
]
|
|
51164
|
-
}
|
|
51165
|
-
};
|
|
51166
|
-
}
|
|
51167
|
-
if (field.defaultInitializerCode !== void 0) {
|
|
51168
|
-
return {
|
|
51169
|
-
defaultValue: { init: { code: field.defaultInitializerCode } }
|
|
51170
|
-
};
|
|
51171
|
-
}
|
|
51172
|
-
if (field.defaultValue === void 0) return {};
|
|
51173
|
-
return {
|
|
51174
|
-
defaultValue: { value: deepClonePlainData(field.defaultValue) }
|
|
51175
|
-
};
|
|
51176
|
-
}
|
|
51177
|
-
function requireSortingLayerSeed(seed, message) {
|
|
51178
|
-
if (seed === void 0) {
|
|
51179
|
-
throw new Error(message);
|
|
51180
|
-
}
|
|
51181
|
-
return seed;
|
|
51182
|
-
}
|
|
51183
|
-
function worldSystemSeedMemberKind(field) {
|
|
51184
|
-
switch (field.memberKind) {
|
|
51185
|
-
case "bool":
|
|
51186
|
-
return 1 /* Bool */;
|
|
51187
|
-
case "class":
|
|
51188
|
-
return 7 /* Class */;
|
|
51189
|
-
case "computed":
|
|
51190
|
-
return 10 /* NSProperty */;
|
|
51191
|
-
// No `"action"` tag: no platform system class declares an NSAction member
|
|
51192
|
-
// yet, and a seed tag with no seed behind it is dead code. Add the tag —
|
|
51193
|
-
// with the first seed that needs one; the field tag is a string union, so
|
|
51194
|
-
// nothing here fails to compile in the meantime.
|
|
51195
|
-
case "delegate":
|
|
51196
|
-
return 25 /* NSDelegate */;
|
|
51197
|
-
case "enum":
|
|
51198
|
-
return 8 /* Enum */;
|
|
51199
|
-
case "float":
|
|
51200
|
-
return 4 /* Float */;
|
|
51201
|
-
case "function":
|
|
51202
|
-
return 13 /* Function */;
|
|
51203
|
-
case "functionRef":
|
|
51204
|
-
return 24 /* FunctionRef */;
|
|
51205
|
-
case "generic":
|
|
51206
|
-
return 21 /* Generic */;
|
|
51207
|
-
case "int":
|
|
51208
|
-
return 2 /* Int */;
|
|
51209
|
-
case "list":
|
|
51210
|
-
return 6 /* List */;
|
|
51211
|
-
case "lookup":
|
|
51212
|
-
return 9 /* Lookup */;
|
|
51213
|
-
case "sprite":
|
|
51214
|
-
return 11 /* Sprite */;
|
|
51215
|
-
case "string":
|
|
51216
|
-
return 3 /* String */;
|
|
51217
|
-
case "vector2":
|
|
51218
|
-
return 14 /* Vector2 */;
|
|
51219
|
-
case "vector2Int":
|
|
51220
|
-
return 15 /* Vector2Int */;
|
|
51221
|
-
case "vector3":
|
|
51222
|
-
return 16 /* Vector3 */;
|
|
51223
|
-
}
|
|
51224
|
-
}
|
|
51225
|
-
function worldSystemSeedMemberSpecificFields(field, classIdsByWorldKind, sortingLayerSeed) {
|
|
51226
|
-
switch (field.memberKind) {
|
|
51227
|
-
case "class": {
|
|
51228
|
-
const worldKind = field.schemaClassWorldKind;
|
|
51229
|
-
if (worldKind === void 0) {
|
|
51230
|
-
throw new Error(
|
|
51231
|
-
`World system seed field "${field.schemaKey}" is missing schemaClassWorldKind.`
|
|
51232
|
-
);
|
|
51233
|
-
}
|
|
51234
|
-
const classId = classIdsByWorldKind.get(worldKind);
|
|
51235
|
-
if (classId === void 0) {
|
|
51236
|
-
throw new Error(
|
|
51237
|
-
`World system seed field "${field.schemaKey}" cannot find the class for "${worldKind}".`
|
|
51238
|
-
);
|
|
51239
|
-
}
|
|
51240
|
-
return {
|
|
51241
|
-
classId,
|
|
51242
|
-
...field.classArguments === void 0 ? {} : {
|
|
51243
|
-
classArguments: deepClonePlainData(field.classArguments)
|
|
51244
|
-
},
|
|
51245
|
-
...field.payload === void 0 ? {} : { payload: field.payload }
|
|
51246
|
-
};
|
|
51247
|
-
}
|
|
51248
|
-
case "computed": {
|
|
51249
|
-
if (field.returnTypeInfo === void 0) {
|
|
51250
|
-
throw new Error(
|
|
51251
|
-
`World system seed field "${field.schemaKey}" is missing returnTypeInfo.`
|
|
51252
|
-
);
|
|
51253
|
-
}
|
|
51254
|
-
if (field.returnTypeInfo.type === NS_TYPE_VOID) {
|
|
51255
|
-
throw new Error(
|
|
51256
|
-
`World system seed field "${field.schemaKey}" is a computed member returning void, which has no value to read.`
|
|
51257
|
-
);
|
|
51258
|
-
}
|
|
51259
|
-
return {
|
|
51260
|
-
returnTypeInfo: deepClonePlainData(field.returnTypeInfo),
|
|
51261
|
-
...field.code === void 0 ? {} : { code: field.code }
|
|
51262
|
-
};
|
|
51263
|
-
}
|
|
51264
|
-
case "function":
|
|
51265
|
-
case "delegate": {
|
|
51266
|
-
const returnTypeInfo = field.returnTypeInfo;
|
|
51267
|
-
if (returnTypeInfo === void 0) {
|
|
51268
|
-
throw new Error(
|
|
51269
|
-
`World system seed field "${field.schemaKey}" is missing ${field.memberKind} returnTypeInfo.`
|
|
51270
|
-
);
|
|
51271
|
-
}
|
|
51272
|
-
if (field.argumentTypes === void 0) {
|
|
51273
|
-
throw new Error(
|
|
51274
|
-
`World system seed field "${field.schemaKey}" is missing ${field.memberKind} argumentTypes.`
|
|
51275
|
-
);
|
|
51276
|
-
}
|
|
51277
|
-
return {
|
|
51278
|
-
...field.memberKind === "function" ? { dispatch: field.dispatch ?? 0 /* Synchronous */ } : {},
|
|
51279
|
-
returnTypeInfo: deepClonePlainData(returnTypeInfo),
|
|
51280
|
-
argumentTypes: field.argumentTypes.map(
|
|
51281
|
-
(argument2) => deepClonePlainData(argument2)
|
|
51282
|
-
)
|
|
51283
|
-
};
|
|
51284
|
-
}
|
|
51285
|
-
case "generic":
|
|
51286
|
-
if (field.genericParamId === void 0) {
|
|
51287
|
-
throw new Error(
|
|
51288
|
-
`World system seed field "${field.schemaKey}" is missing genericParamId.`
|
|
51289
|
-
);
|
|
51290
|
-
}
|
|
51291
|
-
return {
|
|
51292
|
-
genericParamId: field.genericParamId,
|
|
51293
|
-
...field.payload === void 0 ? {} : { payload: field.payload }
|
|
51294
|
-
};
|
|
51295
|
-
case "int":
|
|
51296
|
-
case "float":
|
|
51297
|
-
return {
|
|
51298
|
-
...field.minValue === void 0 ? {} : { minValue: field.minValue },
|
|
51299
|
-
...field.maxValue === void 0 ? {} : { maxValue: field.maxValue }
|
|
51300
|
-
};
|
|
51301
|
-
case "list":
|
|
51302
|
-
if (field.entryMemberId === void 0) {
|
|
51303
|
-
throw new Error(
|
|
51304
|
-
`World system seed field "${field.schemaKey}" is missing entryMemberId.`
|
|
51305
|
-
);
|
|
51306
|
-
}
|
|
51307
|
-
return {
|
|
51308
|
-
entryMemberId: field.entryMemberId,
|
|
51309
|
-
...field.listKind === void 0 ? {} : { listKind: field.listKind }
|
|
51310
|
-
};
|
|
51311
|
-
case "lookup":
|
|
51312
|
-
if (field.collectionMemberId === void 0) {
|
|
51313
|
-
throw new Error(
|
|
51314
|
-
`World system seed field "${field.schemaKey}" is missing collectionMemberId.`
|
|
51315
|
-
);
|
|
51316
|
-
}
|
|
51317
|
-
return {
|
|
51318
|
-
collectionMemberId: field.collectionMemberId,
|
|
51319
|
-
collectionValueId: worldSystemSeedCollectionValueId(
|
|
51320
|
-
field,
|
|
51321
|
-
sortingLayerSeed
|
|
51322
|
-
),
|
|
51323
|
-
...field.selection === void 0 ? {} : { selection: field.selection },
|
|
51324
|
-
...field.declaredTypeInfo === void 0 ? {} : {
|
|
51325
|
-
declaredTypeInfo: deepClonePlainData(field.declaredTypeInfo)
|
|
51326
|
-
}
|
|
51327
|
-
};
|
|
51328
|
-
case "string":
|
|
51329
|
-
return field.format === void 0 ? {} : { format: field.format };
|
|
51330
|
-
case "enum":
|
|
51331
|
-
if (field.enumId === void 0) {
|
|
51332
|
-
throw new Error(
|
|
51333
|
-
`World system seed field "${field.schemaKey}" is missing enumId.`
|
|
51334
|
-
);
|
|
51335
|
-
}
|
|
51336
|
-
return {
|
|
51337
|
-
enumId: field.enumId,
|
|
51338
|
-
...field.selection === void 0 ? {} : { selection: field.selection }
|
|
51339
|
-
};
|
|
51340
|
-
case "sprite":
|
|
51341
|
-
return {};
|
|
51342
|
-
case "bool":
|
|
51343
|
-
case "functionRef":
|
|
51344
|
-
case "vector2":
|
|
51345
|
-
case "vector2Int":
|
|
51346
|
-
case "vector3":
|
|
51347
|
-
return {};
|
|
51348
|
-
}
|
|
51349
|
-
}
|
|
51350
|
-
function worldSystemSeedCollectionValueId(field, sortingLayerSeed) {
|
|
51351
|
-
if (field.memberId === WORLD_LAYER_SORTING_LAYER_MEMBER_ID) {
|
|
51352
|
-
return requireSortingLayerSeed(
|
|
51353
|
-
sortingLayerSeed,
|
|
51354
|
-
"Cannot seed the layer SortingLayer lookup before sorting layers are seeded."
|
|
51355
|
-
).sortingLayersValueId;
|
|
51356
|
-
}
|
|
51357
|
-
return field.collectionValueId;
|
|
51358
|
-
}
|
|
51359
50977
|
var WORLD_ANIMATION_CHILD_OVERRIDE_BINDING_MEMBER_NAME, WORLD_ANIMATION_CHILD_OVERRIDE_BINDING_MEMBER_NAMESPACE, WORLD_SYSTEM_CLASS_DEFINITION_BY_KIND, WORLD_SYSTEM_ANIMATION_KIND_MARKER, WORLD_SYSTEM_ANIMATION_KINDS, GENERIC_WORLD_SYSTEM_CLASS_KINDS, WORLD_SYSTEM_ALL_KINDS, WORLD_SYSTEM_SCHEMA_FIELD_SITES_BY_MEMBER_ID;
|
|
51360
50978
|
var init_world_system_classes = __esm({
|
|
51361
50979
|
"../src/models/classes/world-system-classes.ts"() {
|
|
@@ -87793,35 +87411,35 @@ function memberLocalizedTextId(args) {
|
|
|
87793
87411
|
);
|
|
87794
87412
|
}
|
|
87795
87413
|
function memberLocalizationDeclarationId(memberId, memberRows) {
|
|
87796
|
-
let
|
|
87414
|
+
let declarationId = memberId;
|
|
87797
87415
|
const members = projectSchemaIndexFor({
|
|
87798
87416
|
classes: NO_CLASSES2,
|
|
87799
87417
|
members: memberRows
|
|
87800
87418
|
}).membersById;
|
|
87801
87419
|
const visited = /* @__PURE__ */ new Set();
|
|
87802
87420
|
while (true) {
|
|
87803
|
-
if (visited.has(
|
|
87421
|
+
if (visited.has(declarationId))
|
|
87804
87422
|
throw new Error(
|
|
87805
|
-
`Localized member inheritance cycles at "${
|
|
87423
|
+
`Localized member inheritance cycles at "${declarationId}".`
|
|
87806
87424
|
);
|
|
87807
|
-
visited.add(
|
|
87808
|
-
const member = members.get(
|
|
87425
|
+
visited.add(declarationId);
|
|
87426
|
+
const member = members.get(declarationId);
|
|
87809
87427
|
if (member === void 0)
|
|
87810
87428
|
throw new Error(
|
|
87811
|
-
`Localized member declaration "${
|
|
87429
|
+
`Localized member declaration "${declarationId}" was not found.`
|
|
87812
87430
|
);
|
|
87813
87431
|
const parent = getOptionalString(member, "extendsMemberId");
|
|
87814
87432
|
if (parent === void 0) break;
|
|
87815
|
-
|
|
87433
|
+
declarationId = parent;
|
|
87816
87434
|
}
|
|
87817
|
-
return
|
|
87435
|
+
return declarationId;
|
|
87818
87436
|
}
|
|
87819
|
-
function declaredMemberLocalizedTextId(
|
|
87437
|
+
function declaredMemberLocalizedTextId(declarationId, mainLocale, value) {
|
|
87820
87438
|
return value === "" ? "" : inSystemRecordNamespaceOf(
|
|
87821
|
-
|
|
87439
|
+
declarationId,
|
|
87822
87440
|
v5_default(
|
|
87823
87441
|
JSON.stringify([
|
|
87824
|
-
withoutSystemRecordIdPrefix(
|
|
87442
|
+
withoutSystemRecordIdPrefix(declarationId),
|
|
87825
87443
|
mainLocale,
|
|
87826
87444
|
value
|
|
87827
87445
|
]),
|
|
@@ -87932,11 +87550,11 @@ function retargetPrimaryLocalizedTextWrites(before, post, changes) {
|
|
|
87932
87550
|
throw new Error(
|
|
87933
87551
|
`Selected source for localized text "${old.id}" has no member declaration.`
|
|
87934
87552
|
);
|
|
87935
|
-
const
|
|
87553
|
+
const declarationId = memberLocalizationDeclarationId(
|
|
87936
87554
|
memberId,
|
|
87937
87555
|
post.members
|
|
87938
87556
|
);
|
|
87939
|
-
if (old.memberSource !== void 0 && old.memberSource.memberId !==
|
|
87557
|
+
if (old.memberSource !== void 0 && old.memberSource.memberId !== declarationId)
|
|
87940
87558
|
throw new Error(
|
|
87941
87559
|
`Selected assignment for localized text "${old.id}" belongs to a different member declaration.`
|
|
87942
87560
|
);
|
|
@@ -87957,7 +87575,7 @@ function retargetPrimaryLocalizedTextWrites(before, post, changes) {
|
|
|
87957
87575
|
config: post.localizationConfig,
|
|
87958
87576
|
now: next.updatedAt,
|
|
87959
87577
|
memberSource: {
|
|
87960
|
-
memberId:
|
|
87578
|
+
memberId: declarationId,
|
|
87961
87579
|
locale: primary
|
|
87962
87580
|
}
|
|
87963
87581
|
});
|
|
@@ -109998,19 +109616,19 @@ function lowerExtendsBindings(context, declaration, baseClassId, argumentsValue)
|
|
|
109998
109616
|
...context.genericParametersByClass.get(baseClassId)?.entries() ?? []
|
|
109999
109617
|
];
|
|
110000
109618
|
const result = {};
|
|
110001
|
-
const
|
|
110002
|
-
const baseBindings = context.baseClasses.get(
|
|
109619
|
+
const declarationId = materializedId(declaration, "class", declaration.name);
|
|
109620
|
+
const baseBindings = context.baseClasses.get(declarationId)?.extendsGenericBindings ?? {};
|
|
110003
109621
|
for (const [[parameterName, parameterId], argumentType] of zip(
|
|
110004
109622
|
parameters,
|
|
110005
109623
|
argumentsValue
|
|
110006
109624
|
)) {
|
|
110007
|
-
const local = context.genericParametersByClass.get(
|
|
109625
|
+
const local = context.genericParametersByClass.get(declarationId)?.get(argumentType.name);
|
|
110008
109626
|
if (local) {
|
|
110009
109627
|
result[parameterId] = { kind: "generic", genericParamId: local };
|
|
110010
109628
|
continue;
|
|
110011
109629
|
}
|
|
110012
109630
|
const baseBinding = baseBindings[parameterId];
|
|
110013
|
-
const memberId = baseBinding?.kind === "member" ? baseBinding.memberId : derivedGenericArgumentMemberId(
|
|
109631
|
+
const memberId = baseBinding?.kind === "member" ? baseBinding.memberId : derivedGenericArgumentMemberId(declarationId, parameterId);
|
|
110014
109632
|
result[parameterId] = { kind: "member", memberId };
|
|
110015
109633
|
lowerGenericArgument(
|
|
110016
109634
|
context,
|
|
@@ -113565,12 +113183,13 @@ function storedValueRowsByIdV4(records2) {
|
|
|
113565
113183
|
logical.set(valueId, row);
|
|
113566
113184
|
continue;
|
|
113567
113185
|
}
|
|
113568
|
-
|
|
113186
|
+
const authoredRow = stripClientDerivedBodies("value", row);
|
|
113187
|
+
if (!isMemberValue(authoredRow)) {
|
|
113569
113188
|
throw new PackedValueEncodingError(
|
|
113570
113189
|
`Stored value row "${valueId}" packs a child but is not a well-formed value row, so its packed payload cannot be expanded.`
|
|
113571
113190
|
);
|
|
113572
113191
|
}
|
|
113573
|
-
const decoded = decodePackedValueRow(
|
|
113192
|
+
const decoded = decodePackedValueRow(authoredRow);
|
|
113574
113193
|
logical.set(valueId, { ...decoded.row });
|
|
113575
113194
|
for (const child of decoded.children) {
|
|
113576
113195
|
logical.set(child.id, { ...child });
|
|
@@ -113761,6 +113380,7 @@ var init_stored_value_placements = __esm({
|
|
|
113761
113380
|
init_constructors2();
|
|
113762
113381
|
init_constructor_parameter_settlement();
|
|
113763
113382
|
init_members();
|
|
113383
|
+
init_neo_script_derived_bodies();
|
|
113764
113384
|
init_projection();
|
|
113765
113385
|
}
|
|
113766
113386
|
});
|
|
@@ -114214,12 +113834,13 @@ function logicalValueBaseRecordsV4(records2) {
|
|
|
114214
113834
|
if (record6.recordKind !== "value") continue;
|
|
114215
113835
|
if (!isObjectRecord2(record6.data)) continue;
|
|
114216
113836
|
if (!rowCarriesPackedValueContent(record6.data)) continue;
|
|
114217
|
-
|
|
113837
|
+
const authoredData = stripClientDerivedBodies("value", record6.data);
|
|
113838
|
+
if (!isMemberValue(authoredData)) {
|
|
114218
113839
|
throw new PackedValueEncodingError(
|
|
114219
113840
|
`Workspace base row "${key}" packs a child but is not a well-formed value row, so its packed payload cannot be expanded.`
|
|
114220
113841
|
);
|
|
114221
113842
|
}
|
|
114222
|
-
const decoded = decodePackedValueRow(
|
|
113843
|
+
const decoded = decodePackedValueRow(authoredData);
|
|
114223
113844
|
expanded ??= { ...records2 };
|
|
114224
113845
|
expanded[key] = { ...record6, data: decoded.row };
|
|
114225
113846
|
for (const child of decoded.children) {
|
|
@@ -114268,7 +113889,16 @@ function foldCandidateValueRowsV4(args) {
|
|
|
114268
113889
|
`Packed fold produced a physical row for "${row.id}", which is not a candidate value row of this push.`
|
|
114269
113890
|
);
|
|
114270
113891
|
}
|
|
114271
|
-
|
|
113892
|
+
const folded = storedContentApplied(candidate, row);
|
|
113893
|
+
const physical = args.physicalBase?.[`value:${row.id}`]?.data;
|
|
113894
|
+
const authoredPhysical = stripClientDerivedBodies("value", physical);
|
|
113895
|
+
bodyByValueId.set(
|
|
113896
|
+
row.id,
|
|
113897
|
+
isObjectRecord2(physical) && isObjectRecord2(authoredPhysical) && canonicallyEqual(
|
|
113898
|
+
stripClientDerivedBodies("value", folded),
|
|
113899
|
+
authoredPhysical
|
|
113900
|
+
) ? physical : folded
|
|
113901
|
+
);
|
|
114272
113902
|
}
|
|
114273
113903
|
return { bodyByValueId, foldedValueIds };
|
|
114274
113904
|
}
|
|
@@ -114309,6 +113939,7 @@ var init_packed_value_parity = __esm({
|
|
|
114309
113939
|
init_core();
|
|
114310
113940
|
init_members();
|
|
114311
113941
|
init_packed_value_write_fold();
|
|
113942
|
+
init_neo_script_derived_bodies();
|
|
114312
113943
|
init_projection();
|
|
114313
113944
|
EMPTY_FOLD = {
|
|
114314
113945
|
bodyByValueId: /* @__PURE__ */ new Map(),
|
|
@@ -116504,6 +116135,7 @@ function applyPackedValueFoldV4(args) {
|
|
|
116504
116135
|
const fold = foldCandidateValueRowsV4({
|
|
116505
116136
|
candidates,
|
|
116506
116137
|
base: args.loweringRecords,
|
|
116138
|
+
physicalBase: args.workspace.state.records,
|
|
116507
116139
|
touchedValueIds,
|
|
116508
116140
|
projectId: args.workspace.config.projectId,
|
|
116509
116141
|
schema: args.schema
|
|
@@ -129097,978 +128729,6 @@ var init_compiler_metadata = __esm({
|
|
|
129097
128729
|
}
|
|
129098
128730
|
});
|
|
129099
128731
|
|
|
129100
|
-
// ../src/database/raw-tile-migration-class-reader.ts
|
|
129101
|
-
function rawTileMigrationReadableClass(value) {
|
|
129102
|
-
if (typeof value !== "object" || value === null) return value;
|
|
129103
|
-
if (!("id" in value)) return value;
|
|
129104
|
-
if (!("system" in value)) return value;
|
|
129105
|
-
const system = value.system;
|
|
129106
|
-
if (typeof system !== "object" || system === null) return value;
|
|
129107
|
-
if (!("kind" in system) || system.kind !== "worldAuthoring") return value;
|
|
129108
|
-
if (!("worldKind" in system)) return value;
|
|
129109
|
-
const retiredTile = value.id === RETIRED_TILE_INSTANCE_CLASS_ID && system.worldKind === "tileInstance";
|
|
129110
|
-
const renamedFootprint = value.id === PLACEMENT_TILE_CLASS_ID && system.worldKind === "objectPlacementTile";
|
|
129111
|
-
if (!retiredTile && !renamedFootprint) return value;
|
|
129112
|
-
const projectedSystem = { ...system };
|
|
129113
|
-
Reflect.deleteProperty(projectedSystem, "worldKind");
|
|
129114
|
-
return { ...value, system: projectedSystem };
|
|
129115
|
-
}
|
|
129116
|
-
var RETIRED_TILE_INSTANCE_CLASS_ID, PLACEMENT_TILE_CLASS_ID;
|
|
129117
|
-
var init_raw_tile_migration_class_reader = __esm({
|
|
129118
|
-
"../src/database/raw-tile-migration-class-reader.ts"() {
|
|
129119
|
-
"use strict";
|
|
129120
|
-
RETIRED_TILE_INSTANCE_CLASS_ID = "system_4689bc94-de98-46cd-b220-efe118f4106c";
|
|
129121
|
-
PLACEMENT_TILE_CLASS_ID = "system_ccc3330c-2db5-44dc-9c8e-5ebfe430dec9";
|
|
129122
|
-
}
|
|
129123
|
-
});
|
|
129124
|
-
|
|
129125
|
-
// ../src/database/raw-tile-render-members.ts
|
|
129126
|
-
function rawTileRenderMemberIds(members) {
|
|
129127
|
-
const byId = new Map(members.map((member) => [member.id, member]));
|
|
129128
|
-
const cache = /* @__PURE__ */ new Map();
|
|
129129
|
-
function resolve5(id2, visiting) {
|
|
129130
|
-
if (RAW_TILE_RENDER_MEMBER_IDS.has(id2)) return true;
|
|
129131
|
-
const cached = cache.get(id2);
|
|
129132
|
-
if (cached !== void 0) return cached;
|
|
129133
|
-
const member = byId.get(id2);
|
|
129134
|
-
if (member === void 0 || visiting.has(id2))
|
|
129135
|
-
throw new Error(
|
|
129136
|
-
`Raw tile render member ancestry is unresolved at "${id2}".`
|
|
129137
|
-
);
|
|
129138
|
-
visiting.add(id2);
|
|
129139
|
-
try {
|
|
129140
|
-
const result2 = typeof member.extendsMemberId === "string" ? resolve5(member.extendsMemberId, visiting) : false;
|
|
129141
|
-
cache.set(id2, result2);
|
|
129142
|
-
return result2;
|
|
129143
|
-
} finally {
|
|
129144
|
-
visiting.delete(id2);
|
|
129145
|
-
}
|
|
129146
|
-
}
|
|
129147
|
-
const result = /* @__PURE__ */ new Set();
|
|
129148
|
-
for (const member of members) {
|
|
129149
|
-
if (resolve5(member.id, /* @__PURE__ */ new Set())) result.add(member.id);
|
|
129150
|
-
}
|
|
129151
|
-
return result;
|
|
129152
|
-
}
|
|
129153
|
-
var RAW_TILE_RENDER_MEMBER_IDS;
|
|
129154
|
-
var init_raw_tile_render_members = __esm({
|
|
129155
|
-
"../src/database/raw-tile-render-members.ts"() {
|
|
129156
|
-
"use strict";
|
|
129157
|
-
RAW_TILE_RENDER_MEMBER_IDS = /* @__PURE__ */ new Set([
|
|
129158
|
-
"system_3b02422f-1ef2-4a50-8386-155d5001082b",
|
|
129159
|
-
"system_cbd6db9a-f473-44b5-b913-7cdc06452f35",
|
|
129160
|
-
"system_96cda8f5-3100-45b5-adcb-0552d21504dd"
|
|
129161
|
-
]);
|
|
129162
|
-
}
|
|
129163
|
-
});
|
|
129164
|
-
|
|
129165
|
-
// ../src/database/raw-tile-source-rewrite.ts
|
|
129166
|
-
function rewriteRawTileSource(code) {
|
|
129167
|
-
if (!code.includes("NeoTileInstance") && !code.includes("NeoObjectPlacementTile"))
|
|
129168
|
-
return code;
|
|
129169
|
-
let ast;
|
|
129170
|
-
try {
|
|
129171
|
-
ast = parseExpression(code);
|
|
129172
|
-
} catch {
|
|
129173
|
-
ast = parseFunctionBody(code);
|
|
129174
|
-
}
|
|
129175
|
-
const lexical = lex(code);
|
|
129176
|
-
const tokens = lexical.tokens.filter((token) => token.kind !== "comment");
|
|
129177
|
-
const indexByStart = new Map(
|
|
129178
|
-
tokens.map((token, index) => [token.start, index])
|
|
129179
|
-
);
|
|
129180
|
-
const replacements = /* @__PURE__ */ new Map();
|
|
129181
|
-
const visit = (value) => {
|
|
129182
|
-
if (Array.isArray(value)) {
|
|
129183
|
-
for (const child of value) visit(child);
|
|
129184
|
-
return;
|
|
129185
|
-
}
|
|
129186
|
-
if (!isRecord9(value)) return;
|
|
129187
|
-
const name = value.kind === "named" ? value.name : value.className;
|
|
129188
|
-
if (value.kind === "named" || value.kind === "new") {
|
|
129189
|
-
if (name === "NeoTileInstance" || name === "NeoObjectPlacementTile") {
|
|
129190
|
-
if (value.kind === "new" && name === "NeoTileInstance") {
|
|
129191
|
-
throw new Error(
|
|
129192
|
-
"Raw tile migration cannot infer the concrete tile class of an authored NeoTileInstance constructor."
|
|
129193
|
-
);
|
|
129194
|
-
}
|
|
129195
|
-
const pos = value.pos;
|
|
129196
|
-
if (!isRecord9(pos) || typeof pos.line !== "number" || typeof pos.column !== "number") {
|
|
129197
|
-
throw new Error(
|
|
129198
|
-
`Raw tile migration cannot locate type "${name}" in its source.`
|
|
129199
|
-
);
|
|
129200
|
-
}
|
|
129201
|
-
const start = lexical.source.offsetAt({
|
|
129202
|
-
line: pos.line - 1,
|
|
129203
|
-
character: pos.column - 1
|
|
129204
|
-
});
|
|
129205
|
-
const index = indexByStart.get(start);
|
|
129206
|
-
const offset = value.kind === "new" ? 1 : 0;
|
|
129207
|
-
const token = index === void 0 ? void 0 : tokens[index + offset];
|
|
129208
|
-
if (token?.text !== name) {
|
|
129209
|
-
throw new Error(
|
|
129210
|
-
`Raw tile migration found inconsistent source coordinates for type "${name}".`
|
|
129211
|
-
);
|
|
129212
|
-
}
|
|
129213
|
-
replacements.set(token.start, {
|
|
129214
|
-
end: token.end,
|
|
129215
|
-
text: name === "NeoTileInstance" ? "NeoTile" : "NeoPlacementTile"
|
|
129216
|
-
});
|
|
129217
|
-
}
|
|
129218
|
-
}
|
|
129219
|
-
for (const child of Object.values(value)) visit(child);
|
|
129220
|
-
};
|
|
129221
|
-
visit(ast);
|
|
129222
|
-
if (replacements.size === 0) return code;
|
|
129223
|
-
let next = "";
|
|
129224
|
-
let cursor = 0;
|
|
129225
|
-
for (const [start, replacement] of [...replacements].sort(
|
|
129226
|
-
([a], [b]) => a - b
|
|
129227
|
-
)) {
|
|
129228
|
-
next += code.slice(cursor, start) + replacement.text;
|
|
129229
|
-
cursor = replacement.end;
|
|
129230
|
-
}
|
|
129231
|
-
return next + code.slice(cursor);
|
|
129232
|
-
}
|
|
129233
|
-
function isRecord9(value) {
|
|
129234
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
129235
|
-
}
|
|
129236
|
-
var init_raw_tile_source_rewrite = __esm({
|
|
129237
|
-
"../src/database/raw-tile-source-rewrite.ts"() {
|
|
129238
|
-
"use strict";
|
|
129239
|
-
init_src();
|
|
129240
|
-
}
|
|
129241
|
-
});
|
|
129242
|
-
|
|
129243
|
-
// ../src/database/raw-tile-placement-migration.ts
|
|
129244
|
-
function rawTileCanonicalRecords(projectId, now) {
|
|
129245
|
-
const definitions = WORLD_SYSTEM_CLASS_DEFINITIONS.filter(
|
|
129246
|
-
(definition2) => DECLARATION_OWNER_IDS.has(definition2.classId)
|
|
129247
|
-
);
|
|
129248
|
-
const seed = buildWorldSystemSeedRecords({
|
|
129249
|
-
projectId,
|
|
129250
|
-
now,
|
|
129251
|
-
worldKinds: new Set(definitions.map((definition2) => definition2.worldKind)),
|
|
129252
|
-
classIdsByWorldKind: new Map(
|
|
129253
|
-
WORLD_SYSTEM_CLASS_DEFINITIONS.map((definition2) => [
|
|
129254
|
-
definition2.worldKind,
|
|
129255
|
-
definition2.classId
|
|
129256
|
-
])
|
|
129257
|
-
),
|
|
129258
|
-
memberIds: CHANGED_MEMBER_IDS
|
|
129259
|
-
});
|
|
129260
|
-
return {
|
|
129261
|
-
...seed,
|
|
129262
|
-
classes: seed.classes.filter((record6) => CHANGED_CLASS_IDS.has(record6.id))
|
|
129263
|
-
};
|
|
129264
|
-
}
|
|
129265
|
-
function migrateRawTileRetainedRecord(args) {
|
|
129266
|
-
if (RAW_TILE_RETIRED_RECORD_KEYS.some(
|
|
129267
|
-
(key) => key.recordKind === args.recordKind && key.recordId === args.recordId
|
|
129268
|
-
))
|
|
129269
|
-
return { kind: "retire" };
|
|
129270
|
-
if (args.deleted) return { kind: "unchanged" };
|
|
129271
|
-
if (args.recordKind === "value") {
|
|
129272
|
-
if (!isMemberValue(args.data)) {
|
|
129273
|
-
throw new Error(
|
|
129274
|
-
`Raw tile migration cannot read value "${args.recordId}".`
|
|
129275
|
-
);
|
|
129276
|
-
}
|
|
129277
|
-
const next2 = migrateRawTilePlacementValue(
|
|
129278
|
-
args.data,
|
|
129279
|
-
void 0,
|
|
129280
|
-
args.footprintValueIds
|
|
129281
|
-
);
|
|
129282
|
-
return next2 === args.data ? { kind: "unchanged" } : { kind: "rewrite", data: next2 };
|
|
129283
|
-
}
|
|
129284
|
-
if (args.recordKind !== "class" && args.recordKind !== "member") {
|
|
129285
|
-
return DECLARATION_KINDS.has(args.recordKind) ? declarationRewrite(args.data) : { kind: "unchanged" };
|
|
129286
|
-
}
|
|
129287
|
-
const changedIds = args.recordKind === "class" ? CHANGED_CLASS_IDS : CHANGED_MEMBER_IDS;
|
|
129288
|
-
if (!changedIds.has(args.recordId)) {
|
|
129289
|
-
const rewritten = declarationRewrite(args.data);
|
|
129290
|
-
const data2 = rewritten.kind === "rewrite" ? rewritten.data : args.data;
|
|
129291
|
-
if (args.recordKind !== "member" || !args.renderMemberIds?.has(args.recordId))
|
|
129292
|
-
return rewritten;
|
|
129293
|
-
if (!isRecord10(data2) || typeof data2.kind !== "number")
|
|
129294
|
-
throw new Error(
|
|
129295
|
-
`Raw tile render member "${args.recordId}" lacks a declared kind.`
|
|
129296
|
-
);
|
|
129297
|
-
if (data2.kind !== 21 /* Generic */ && !memberKindOwnsStoredValue(data2.kind))
|
|
129298
|
-
return rewritten;
|
|
129299
|
-
const next2 = {
|
|
129300
|
-
...data2,
|
|
129301
|
-
mutability: 1 /* ReadOnly */,
|
|
129302
|
-
storage: 1 /* Immutable */
|
|
129303
|
-
};
|
|
129304
|
-
return canonicalJsonStringify(next2) === canonicalJsonStringify(args.data) ? { kind: "unchanged" } : { kind: "rewrite", data: next2 };
|
|
129305
|
-
}
|
|
129306
|
-
if (!isRecord10(args.data)) {
|
|
129307
|
-
throw new Error(
|
|
129308
|
-
`Raw tile migration cannot read ${args.recordKind} "${args.recordId}".`
|
|
129309
|
-
);
|
|
129310
|
-
}
|
|
129311
|
-
const data = args.data;
|
|
129312
|
-
if (typeof data.projectId !== "string") {
|
|
129313
|
-
throw new Error(
|
|
129314
|
-
`Raw tile migration ${args.recordKind} "${args.recordId}" lacks a project ID.`
|
|
129315
|
-
);
|
|
129316
|
-
}
|
|
129317
|
-
const canonical = rawTileCanonicalRecords(data.projectId, 0);
|
|
129318
|
-
const candidates = args.recordKind === "class" ? canonical.classes : canonical.members;
|
|
129319
|
-
const replacement = candidates.find((record6) => record6.id === args.recordId);
|
|
129320
|
-
if (replacement === void 0) return { kind: "unchanged" };
|
|
129321
|
-
const next = {
|
|
129322
|
-
...replacement,
|
|
129323
|
-
createdAt: data.createdAt,
|
|
129324
|
-
updatedAt: data.updatedAt
|
|
129325
|
-
};
|
|
129326
|
-
return canonicalJsonStringify(next) === canonicalJsonStringify(data) ? { kind: "unchanged" } : { kind: "rewrite", data: next };
|
|
129327
|
-
}
|
|
129328
|
-
function declarationRewrite(data) {
|
|
129329
|
-
const next = rewriteDeclarationNode(data);
|
|
129330
|
-
return next === data ? { kind: "unchanged" } : { kind: "rewrite", data: next };
|
|
129331
|
-
}
|
|
129332
|
-
function rewriteDeclarationNode(data) {
|
|
129333
|
-
if (Array.isArray(data)) {
|
|
129334
|
-
let changed = false;
|
|
129335
|
-
const next2 = data.map((item) => {
|
|
129336
|
-
const rewritten = rewriteDeclarationNode(item);
|
|
129337
|
-
if (rewritten !== item) changed = true;
|
|
129338
|
-
return rewritten;
|
|
129339
|
-
});
|
|
129340
|
-
return changed ? next2 : data;
|
|
129341
|
-
}
|
|
129342
|
-
if (!isRecord10(data)) return data;
|
|
129343
|
-
let next;
|
|
129344
|
-
for (const [key, value] of Object.entries(data)) {
|
|
129345
|
-
if (key === "value" && !isNSDelegateClosureValueDraft(value) && !isNSDelegateClosureValue(value))
|
|
129346
|
-
continue;
|
|
129347
|
-
let rewritten;
|
|
129348
|
-
if (CLASS_REFERENCE_KEYS.has(key) && value === RETIRED_TILE_INSTANCE_CLASS_ID) {
|
|
129349
|
-
rewritten = RAW_TILE_CLASS_ID;
|
|
129350
|
-
} else if ((key === "code" || key === "setterCode") && typeof value === "string") {
|
|
129351
|
-
rewritten = rewriteRawTileSource(value);
|
|
129352
|
-
} else {
|
|
129353
|
-
rewritten = rewriteDeclarationNode(value);
|
|
129354
|
-
}
|
|
129355
|
-
if (rewritten === value) continue;
|
|
129356
|
-
next ??= { ...data };
|
|
129357
|
-
next[key] = rewritten;
|
|
129358
|
-
}
|
|
129359
|
-
return next ?? data;
|
|
129360
|
-
}
|
|
129361
|
-
function isRecord10(value) {
|
|
129362
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
129363
|
-
}
|
|
129364
|
-
function rewriteValueSources(row) {
|
|
129365
|
-
if (isInitValueContent(row)) {
|
|
129366
|
-
const code = rewriteRawTileSource(row.init.code);
|
|
129367
|
-
return code === row.init.code ? row : { ...row, init: { ...row.init, code } };
|
|
129368
|
-
}
|
|
129369
|
-
let next = row;
|
|
129370
|
-
if (isNSDelegateClosureValueDraft(row.value) || isNSDelegateClosureValue(row.value)) {
|
|
129371
|
-
const code = row.value.code;
|
|
129372
|
-
if (typeof code === "string") {
|
|
129373
|
-
const rewritten = rewriteRawTileSource(code);
|
|
129374
|
-
if (rewritten !== code)
|
|
129375
|
-
next = { ...row, value: { ...row.value, code: rewritten } };
|
|
129376
|
-
}
|
|
129377
|
-
}
|
|
129378
|
-
if (row.constructorArgs !== void 0 && row.constructorArgs !== null) {
|
|
129379
|
-
let args;
|
|
129380
|
-
for (const [key, value] of Object.entries(row.constructorArgs)) {
|
|
129381
|
-
if (!isNSDelegateClosureValueDraft(value) && !isNSDelegateClosureValue(value))
|
|
129382
|
-
continue;
|
|
129383
|
-
if (typeof value.code !== "string") continue;
|
|
129384
|
-
const code = rewriteRawTileSource(value.code);
|
|
129385
|
-
if (code === value.code) continue;
|
|
129386
|
-
args ??= { ...row.constructorArgs };
|
|
129387
|
-
args[key] = { ...value, code };
|
|
129388
|
-
}
|
|
129389
|
-
if (args !== void 0) next = { ...next, constructorArgs: args };
|
|
129390
|
-
}
|
|
129391
|
-
return next;
|
|
129392
|
-
}
|
|
129393
|
-
function migrateRawTilePlacementValue(physical, concreteTileClassIds, footprintValueIds) {
|
|
129394
|
-
const decoded = decodePackedValueRow(physical);
|
|
129395
|
-
const needsRewrite = (row) => row.classId === RETIRED_TILE_INSTANCE_CLASS_ID || row.classId == null && footprintValueIds?.has(row.id) === true;
|
|
129396
|
-
let changed = false;
|
|
129397
|
-
const sourcedRows = [decoded.row, ...decoded.children].map((row) => {
|
|
129398
|
-
const next = rewriteValueSources(row);
|
|
129399
|
-
if (next !== row) changed = true;
|
|
129400
|
-
return next;
|
|
129401
|
-
});
|
|
129402
|
-
if (!changed && !sourcedRows.some(needsRewrite)) return physical;
|
|
129403
|
-
const rows = new Map(sourcedRows.map((row) => [row.id, row]));
|
|
129404
|
-
const packedChildren = new Map(decoded.packedChildIdsByParentId);
|
|
129405
|
-
for (const storedRow of rows.values()) {
|
|
129406
|
-
let row = storedRow;
|
|
129407
|
-
if (!isLiteralValueContent(row)) continue;
|
|
129408
|
-
if (row.classId == null && footprintValueIds?.has(row.id) === true) {
|
|
129409
|
-
row = { ...row, classId: PLACEMENT_TILE_CLASS_ID };
|
|
129410
|
-
rows.set(row.id, row);
|
|
129411
|
-
changed = true;
|
|
129412
|
-
}
|
|
129413
|
-
if (row.classId !== RETIRED_TILE_INSTANCE_CLASS_ID) continue;
|
|
129414
|
-
const label = `Tile placement "${row.id}"`;
|
|
129415
|
-
if (typeof row.value !== "object" || row.value === null) {
|
|
129416
|
-
throw new Error(`${label} has no stored placement fields.`);
|
|
129417
|
-
}
|
|
129418
|
-
if (Array.isArray(row.value)) {
|
|
129419
|
-
throw new Error(`${label} stores an array instead of placement fields.`);
|
|
129420
|
-
}
|
|
129421
|
-
const body = row.value;
|
|
129422
|
-
for (const key of Object.keys(body)) {
|
|
129423
|
-
if (key !== "Cell" && key !== "assetClassId") {
|
|
129424
|
-
throw new Error(`${label} has unsupported placement field "${key}".`);
|
|
129425
|
-
}
|
|
129426
|
-
}
|
|
129427
|
-
if (typeof body.assetClassId !== "string") {
|
|
129428
|
-
throw new Error(`${label} has no tile class in assetClassId.`);
|
|
129429
|
-
}
|
|
129430
|
-
if (body.assetClassId.length === 0) {
|
|
129431
|
-
throw new Error(`${label} has an empty tile class in assetClassId.`);
|
|
129432
|
-
}
|
|
129433
|
-
if (concreteTileClassIds !== void 0 && !concreteTileClassIds.has(body.assetClassId)) {
|
|
129434
|
-
throw new Error(
|
|
129435
|
-
`${label} names non-concrete or missing tile class "${body.assetClassId}".`
|
|
129436
|
-
);
|
|
129437
|
-
}
|
|
129438
|
-
if (typeof row.instanceConstructorId === "string") {
|
|
129439
|
-
throw new Error(`${label} carries an explicit wrapper constructor.`);
|
|
129440
|
-
}
|
|
129441
|
-
if (row.instanceVariantId != null) {
|
|
129442
|
-
throw new Error(`${label} carries a wrapper variant.`);
|
|
129443
|
-
}
|
|
129444
|
-
if (row.instanceVariantRowValueId != null) {
|
|
129445
|
-
throw new Error(`${label} carries a bound wrapper variant row.`);
|
|
129446
|
-
}
|
|
129447
|
-
if (Object.keys(row.constructorArgs ?? {}).length > 0) {
|
|
129448
|
-
throw new Error(`${label} carries wrapper constructor arguments.`);
|
|
129449
|
-
}
|
|
129450
|
-
if (Object.keys(row.genericBindings ?? {}).length > 0) {
|
|
129451
|
-
throw new Error(`${label} carries wrapper generic bindings.`);
|
|
129452
|
-
}
|
|
129453
|
-
let cellId = body.Cell;
|
|
129454
|
-
if (cellId === void 0) {
|
|
129455
|
-
const defaultCellId = virtualValueId(
|
|
129456
|
-
row.id,
|
|
129457
|
-
"raw-tile-placement-migration:Cell"
|
|
129458
|
-
);
|
|
129459
|
-
if (rows.has(defaultCellId)) {
|
|
129460
|
-
throw new Error(`${label} collides with its migrated Cell identity.`);
|
|
129461
|
-
}
|
|
129462
|
-
rows.set(defaultCellId, {
|
|
129463
|
-
id: defaultCellId,
|
|
129464
|
-
projectId: row.projectId,
|
|
129465
|
-
createdAt: row.createdAt,
|
|
129466
|
-
updatedAt: row.updatedAt,
|
|
129467
|
-
...row.mapKey === void 0 ? {} : { mapKey: row.mapKey },
|
|
129468
|
-
value: { x: 0, y: 0 }
|
|
129469
|
-
});
|
|
129470
|
-
packedChildren.set(row.id, [
|
|
129471
|
-
...packedChildren.get(row.id) ?? [],
|
|
129472
|
-
defaultCellId
|
|
129473
|
-
]);
|
|
129474
|
-
cellId = defaultCellId;
|
|
129475
|
-
}
|
|
129476
|
-
if (typeof cellId !== "string") {
|
|
129477
|
-
throw new Error(`${label} has a non-reference Cell.`);
|
|
129478
|
-
}
|
|
129479
|
-
rows.set(row.id, {
|
|
129480
|
-
...replaceLiteralValueClass(row, body.assetClassId),
|
|
129481
|
-
value: { Cell: cellId }
|
|
129482
|
-
});
|
|
129483
|
-
changed = true;
|
|
129484
|
-
}
|
|
129485
|
-
if (!changed) return physical;
|
|
129486
|
-
const parent = rows.get(physical.id);
|
|
129487
|
-
if (parent === void 0) {
|
|
129488
|
-
throw new Error(`Tile migration lost physical value "${physical.id}".`);
|
|
129489
|
-
}
|
|
129490
|
-
return encodePackedValueRow({
|
|
129491
|
-
parent,
|
|
129492
|
-
rowsById: rows,
|
|
129493
|
-
packedChildIdsByParentId: packedChildren
|
|
129494
|
-
});
|
|
129495
|
-
}
|
|
129496
|
-
var RAW_TILE_PLACEMENT_MIGRATION_ID, RAW_TILE_CLASS_ID, RAW_TILE_RETIRED_RECORD_KEYS, CHANGED_CLASS_IDS, DECLARATION_OWNER_IDS, CHANGED_MEMBER_IDS, CLASS_REFERENCE_KEYS, DECLARATION_KINDS;
|
|
129497
|
-
var init_raw_tile_placement_migration = __esm({
|
|
129498
|
-
"../src/database/raw-tile-placement-migration.ts"() {
|
|
129499
|
-
"use strict";
|
|
129500
|
-
init_raw_tile_migration_class_reader();
|
|
129501
|
-
init_raw_tile_migration_class_reader();
|
|
129502
|
-
init_member_kinds();
|
|
129503
|
-
init_member_storage();
|
|
129504
|
-
init_member_kind_taxonomy();
|
|
129505
|
-
init_members();
|
|
129506
|
-
init_packed_value_encoding();
|
|
129507
|
-
init_member_value_id();
|
|
129508
|
-
init_instance_provenance();
|
|
129509
|
-
init_world_system_classes();
|
|
129510
|
-
init_canonical_json();
|
|
129511
|
-
init_raw_tile_source_rewrite();
|
|
129512
|
-
RAW_TILE_PLACEMENT_MIGRATION_ID = "raw-tile-placements-v2";
|
|
129513
|
-
RAW_TILE_CLASS_ID = "system_d7fa161b-b269-4bf1-9ec9-3aebec67e6e0";
|
|
129514
|
-
RAW_TILE_RETIRED_RECORD_KEYS = [
|
|
129515
|
-
{ recordKind: "class", recordId: RETIRED_TILE_INSTANCE_CLASS_ID }
|
|
129516
|
-
];
|
|
129517
|
-
CHANGED_CLASS_IDS = /* @__PURE__ */ new Set([RAW_TILE_CLASS_ID, PLACEMENT_TILE_CLASS_ID]);
|
|
129518
|
-
DECLARATION_OWNER_IDS = /* @__PURE__ */ new Set([
|
|
129519
|
-
...CHANGED_CLASS_IDS,
|
|
129520
|
-
"system_c45e7270-954c-4eb5-8cf1-709e877d4d59",
|
|
129521
|
-
// NeoTileLayerLink
|
|
129522
|
-
"system_f671535d-0eb6-4139-9caf-5c5276febd31"
|
|
129523
|
-
// NeoObject
|
|
129524
|
-
]);
|
|
129525
|
-
CHANGED_MEMBER_IDS = /* @__PURE__ */ new Set([
|
|
129526
|
-
"system_3b02422f-1ef2-4a50-8386-155d5001082b",
|
|
129527
|
-
// NeoTile.Name
|
|
129528
|
-
"system_cbd6db9a-f473-44b5-b913-7cdc06452f35",
|
|
129529
|
-
// NeoTile.Sprite
|
|
129530
|
-
"system_96cda8f5-3100-45b5-adcb-0552d21504dd",
|
|
129531
|
-
// NeoTile.SmartTile
|
|
129532
|
-
"system_f4be2707-74f5-4833-9784-e81bb2474330",
|
|
129533
|
-
// NeoTile.Cell
|
|
129534
|
-
"system_b0b3c45c-a87d-4218-b056-7418ef46aac5",
|
|
129535
|
-
// NeoPlacementTile.Cell
|
|
129536
|
-
"system_54ecc5a7-874d-54ed-92f4-38100a4b7465",
|
|
129537
|
-
// NeoTile.TryConvert
|
|
129538
|
-
"system_5a9ca1f5-a21b-4d4e-8c55-00341af594b4",
|
|
129539
|
-
// NeoObject.PlacementTiles
|
|
129540
|
-
"system_96c7650a-1805-5b27-ae99-d1e49d3cb207",
|
|
129541
|
-
// PlacementTiles entry
|
|
129542
|
-
"system_98655d2b-ad0b-45e2-a901-62600b4d3a22",
|
|
129543
|
-
// NeoTileLayerLink.Tiles
|
|
129544
|
-
"system_843c77b2-9db6-5fe7-94e0-c3edf436b7b1"
|
|
129545
|
-
// Tiles entry
|
|
129546
|
-
]);
|
|
129547
|
-
CLASS_REFERENCE_KEYS = /* @__PURE__ */ new Set([
|
|
129548
|
-
"classId",
|
|
129549
|
-
"extendsClassId",
|
|
129550
|
-
"ownerClassId",
|
|
129551
|
-
"targetClassId"
|
|
129552
|
-
]);
|
|
129553
|
-
DECLARATION_KINDS = /* @__PURE__ */ new Set([
|
|
129554
|
-
"constructor",
|
|
129555
|
-
"interface",
|
|
129556
|
-
"migration",
|
|
129557
|
-
"dialogue-node",
|
|
129558
|
-
"dialogue-group",
|
|
129559
|
-
"variant"
|
|
129560
|
-
]);
|
|
129561
|
-
}
|
|
129562
|
-
});
|
|
129563
|
-
|
|
129564
|
-
// ../src/database/raw-tile-placement-ownership.ts
|
|
129565
|
-
function rawTileFootprintValueIds(document) {
|
|
129566
|
-
const values = [...expandPackedValueRows(document.values)];
|
|
129567
|
-
const candidates = new Set(
|
|
129568
|
-
values.filter(
|
|
129569
|
-
(row) => row.classId == null && typeof row.value === "object" && row.value !== null && !Array.isArray(row.value)
|
|
129570
|
-
).map((row) => row.id)
|
|
129571
|
-
);
|
|
129572
|
-
const owners = resolveSemanticOwnerMembersForValues(
|
|
129573
|
-
{ ...document, values },
|
|
129574
|
-
candidates
|
|
129575
|
-
);
|
|
129576
|
-
const result = /* @__PURE__ */ new Set();
|
|
129577
|
-
for (const [id2, owner] of owners) {
|
|
129578
|
-
if (getField(owner, "id") === RAW_TILE_FOOTPRINT_ENTRY_MEMBER_ID || getField(owner, "classId") === PLACEMENT_TILE_CLASS_ID)
|
|
129579
|
-
result.add(id2);
|
|
129580
|
-
}
|
|
129581
|
-
return result;
|
|
129582
|
-
}
|
|
129583
|
-
var RAW_TILE_FOOTPRINT_ENTRY_MEMBER_ID;
|
|
129584
|
-
var init_raw_tile_placement_ownership = __esm({
|
|
129585
|
-
"../src/database/raw-tile-placement-ownership.ts"() {
|
|
129586
|
-
"use strict";
|
|
129587
|
-
init_raw_tile_placement_migration();
|
|
129588
|
-
init_core();
|
|
129589
|
-
init_packed_value_encoding();
|
|
129590
|
-
init_constructor_argument_ownership();
|
|
129591
|
-
RAW_TILE_FOOTPRINT_ENTRY_MEMBER_ID = "system_96c7650a-1805-5b27-ae99-d1e49d3cb207";
|
|
129592
|
-
}
|
|
129593
|
-
});
|
|
129594
|
-
|
|
129595
|
-
// ../src/database/neoscript-compiler-revision-recompile.ts
|
|
129596
|
-
function* readRawProjectRecords(rawDocument) {
|
|
129597
|
-
for (const recordKind of PROJECT_RECORD_KINDS2) {
|
|
129598
|
-
const bucket = rawDocument[PROJECT_RECORD_BUCKETS[recordKind]];
|
|
129599
|
-
if (bucket === void 0 || bucket === null) continue;
|
|
129600
|
-
if (Array.isArray(bucket)) {
|
|
129601
|
-
for (const record6 of bucket) yield rawRecord(recordKind, record6);
|
|
129602
|
-
continue;
|
|
129603
|
-
}
|
|
129604
|
-
yield rawRecord(recordKind, bucket);
|
|
129605
|
-
}
|
|
129606
|
-
}
|
|
129607
|
-
function rawRecord(recordKind, value) {
|
|
129608
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
129609
|
-
throw new Error(
|
|
129610
|
-
`Project document bucket "${PROJECT_RECORD_BUCKETS[recordKind]}" holds a non-object ${recordKind} record.`
|
|
129611
|
-
);
|
|
129612
|
-
}
|
|
129613
|
-
const record6 = value;
|
|
129614
|
-
if (typeof record6.id !== "string") {
|
|
129615
|
-
throw new Error(
|
|
129616
|
-
`Project document bucket "${PROJECT_RECORD_BUCKETS[recordKind]}" holds a ${recordKind} record without a string id.`
|
|
129617
|
-
);
|
|
129618
|
-
}
|
|
129619
|
-
return { recordKind, recordId: record6.id, record: record6 };
|
|
129620
|
-
}
|
|
129621
|
-
var NEOSCRIPT_COMPILER_REVISION_RECOMPILE_MAX_BYTES, PROJECT_RECORD_KINDS2;
|
|
129622
|
-
var init_neoscript_compiler_revision_recompile = __esm({
|
|
129623
|
-
"../src/database/neoscript-compiler-revision-recompile.ts"() {
|
|
129624
|
-
"use strict";
|
|
129625
|
-
init_projectRecordBuckets();
|
|
129626
|
-
init_neoscript_compiler_revision();
|
|
129627
|
-
init_project_version_intents();
|
|
129628
|
-
init_neo_script_derived_bodies();
|
|
129629
|
-
NEOSCRIPT_COMPILER_REVISION_RECOMPILE_MAX_BYTES = 1024 * 1024;
|
|
129630
|
-
PROJECT_RECORD_KINDS2 = Object.keys(
|
|
129631
|
-
PROJECT_RECORD_BUCKETS
|
|
129632
|
-
).filter(isProjectRecordKind2);
|
|
129633
|
-
}
|
|
129634
|
-
});
|
|
129635
|
-
|
|
129636
|
-
// ../src/database/raw-tile-placement-migration-prepare.ts
|
|
129637
|
-
function readRawTileMigrationDocument(rawDocument) {
|
|
129638
|
-
return withStoredValueBase(
|
|
129639
|
-
readProjectDocument({
|
|
129640
|
-
...rawDocument,
|
|
129641
|
-
values: rawDocument.physicalValues ?? rawDocument.values,
|
|
129642
|
-
classes: Array.isArray(rawDocument.classes) ? rawDocument.classes.map(rawTileMigrationReadableClass) : rawDocument.classes
|
|
129643
|
-
})
|
|
129644
|
-
);
|
|
129645
|
-
}
|
|
129646
|
-
function buildRawTilePlacementMigrationChanges(args) {
|
|
129647
|
-
const { document } = args;
|
|
129648
|
-
const footprintValueIds = rawTileFootprintValueIds(document);
|
|
129649
|
-
const renderMemberIds = rawTileRenderMemberIds(document.members);
|
|
129650
|
-
const changes = [];
|
|
129651
|
-
const existing = /* @__PURE__ */ new Set();
|
|
129652
|
-
for (const { recordKind, recordId, record: record6 } of readRawProjectRecords({
|
|
129653
|
-
...args.rawDocument,
|
|
129654
|
-
values: document.physicalValues ?? document.values
|
|
129655
|
-
})) {
|
|
129656
|
-
existing.add(`${recordKind}:${recordId}`);
|
|
129657
|
-
const rewrite = migrateRawTileRetainedRecord({
|
|
129658
|
-
recordKind,
|
|
129659
|
-
recordId,
|
|
129660
|
-
deleted: false,
|
|
129661
|
-
data: record6,
|
|
129662
|
-
footprintValueIds,
|
|
129663
|
-
renderMemberIds
|
|
129664
|
-
});
|
|
129665
|
-
if (rewrite.kind === "unchanged") continue;
|
|
129666
|
-
const operation = rewrite.kind === "retire" ? "delete" : "update";
|
|
129667
|
-
changes.push({
|
|
129668
|
-
recordKind,
|
|
129669
|
-
recordId,
|
|
129670
|
-
operation,
|
|
129671
|
-
...rewrite.kind === "rewrite" ? { nextData: rewrite.data } : { deleted: true },
|
|
129672
|
-
intent: intent(recordKind, operation)
|
|
129673
|
-
});
|
|
129674
|
-
}
|
|
129675
|
-
const canonical = rawTileCanonicalRecords(document.project.id, args.now);
|
|
129676
|
-
for (const member of canonical.members) {
|
|
129677
|
-
if (existing.has(`member:${member.id}`)) continue;
|
|
129678
|
-
changes.push({
|
|
129679
|
-
recordKind: "member",
|
|
129680
|
-
recordId: member.id,
|
|
129681
|
-
operation: "create",
|
|
129682
|
-
nextData: member,
|
|
129683
|
-
intent: intent("member", "create")
|
|
129684
|
-
});
|
|
129685
|
-
}
|
|
129686
|
-
return changes;
|
|
129687
|
-
}
|
|
129688
|
-
function intent(recordKind, operation) {
|
|
129689
|
-
const type = `${recordKind}.${operation}`;
|
|
129690
|
-
if (!isKnownProjectVersionIntentType(type)) {
|
|
129691
|
-
throw new Error(`Raw tile migration cannot publish ${type}.`);
|
|
129692
|
-
}
|
|
129693
|
-
return createProjectVersionIntent(type, {
|
|
129694
|
-
source: RAW_TILE_PLACEMENT_MIGRATION_ID
|
|
129695
|
-
});
|
|
129696
|
-
}
|
|
129697
|
-
var init_raw_tile_placement_migration_prepare = __esm({
|
|
129698
|
-
"../src/database/raw-tile-placement-migration-prepare.ts"() {
|
|
129699
|
-
"use strict";
|
|
129700
|
-
init_raw_tile_migration_class_reader();
|
|
129701
|
-
init_raw_tile_render_members();
|
|
129702
|
-
init_raw_tile_placement_ownership();
|
|
129703
|
-
init_project_document_read();
|
|
129704
|
-
init_neoscript_compiler_revision_recompile();
|
|
129705
|
-
init_raw_tile_placement_migration();
|
|
129706
|
-
init_project_version_intents();
|
|
129707
|
-
init_project_version_schema_commit();
|
|
129708
|
-
init_project_version_whole_graph_validation();
|
|
129709
|
-
}
|
|
129710
|
-
});
|
|
129711
|
-
|
|
129712
|
-
// src/project-sync/raw-tile-pull-upgrade.ts
|
|
129713
|
-
import { readFileSync as readFileSync10 } from "node:fs";
|
|
129714
|
-
import { relative as relative6, sep as sep6 } from "node:path";
|
|
129715
|
-
function prepareRawTilePullUpgrade(workspace) {
|
|
129716
|
-
if (workspace.state.records[`class:${RETIRED_TILE_INSTANCE_CLASS_ID}`] === void 0)
|
|
129717
|
-
return null;
|
|
129718
|
-
const conflict2 = Object.values(workspace.state.records).find(
|
|
129719
|
-
(record6) => record6.conflictServerHash !== void 0
|
|
129720
|
-
);
|
|
129721
|
-
if (conflict2 !== void 0)
|
|
129722
|
-
throw new Error(
|
|
129723
|
-
`Resolve the existing pull conflict for ${conflict2.file ?? conflict2.recordId} before upgrading tile sources. Your files and state have not been changed.`
|
|
129724
|
-
);
|
|
129725
|
-
const rawDocument = pulledProjectDocumentRaw(workspace);
|
|
129726
|
-
const changes = buildRawTilePlacementMigrationChanges({
|
|
129727
|
-
rawDocument,
|
|
129728
|
-
document: readRawTileMigrationDocument(rawDocument),
|
|
129729
|
-
now: 0
|
|
129730
|
-
});
|
|
129731
|
-
const records2 = { ...workspace.state.records };
|
|
129732
|
-
const retiredPaths = /* @__PURE__ */ new Set();
|
|
129733
|
-
for (const change of changes) {
|
|
129734
|
-
const key = `${change.recordKind}:${change.recordId}`;
|
|
129735
|
-
if (change.operation === "delete") {
|
|
129736
|
-
const path = records2[key]?.file;
|
|
129737
|
-
if (path !== void 0) retiredPaths.add(path);
|
|
129738
|
-
delete records2[key];
|
|
129739
|
-
continue;
|
|
129740
|
-
}
|
|
129741
|
-
records2[key] = {
|
|
129742
|
-
...records2[key],
|
|
129743
|
-
recordKind: change.recordKind,
|
|
129744
|
-
recordId: change.recordId,
|
|
129745
|
-
contentHash: records2[key]?.contentHash ?? "",
|
|
129746
|
-
data: change.nextData
|
|
129747
|
-
};
|
|
129748
|
-
}
|
|
129749
|
-
const migrated = { ...workspace, state: { ...workspace.state, records: records2 } };
|
|
129750
|
-
const emission = emitProjectDocumentFilesV4(
|
|
129751
|
-
new Map(
|
|
129752
|
-
Object.entries(records2).map(([key, record6]) => {
|
|
129753
|
-
if (!isProjectRecordKind(record6.recordKind))
|
|
129754
|
-
throw new Error(
|
|
129755
|
-
`Cannot upgrade unknown record kind ${record6.recordKind}.`
|
|
129756
|
-
);
|
|
129757
|
-
return [
|
|
129758
|
-
key,
|
|
129759
|
-
{ ...record6, recordKind: record6.recordKind, deleted: false }
|
|
129760
|
-
];
|
|
129761
|
-
})
|
|
129762
|
-
),
|
|
129763
|
-
{
|
|
129764
|
-
recordFiles: readWorkspaceRecordFilesV4(workspace),
|
|
129765
|
-
localValues: workspace.state.localValues,
|
|
129766
|
-
binaryPaths: workspaceBinaryPathsV4(workspace)
|
|
129767
|
-
}
|
|
129768
|
-
);
|
|
129769
|
-
const changedIds = new Set(changes.map((change) => change.recordId));
|
|
129770
|
-
const readonlyMemberIds = /* @__PURE__ */ new Set();
|
|
129771
|
-
for (const change of changes) {
|
|
129772
|
-
if (change.recordKind === "member" && isRecord11(change.nextData) && change.nextData.mutability === 1 /* ReadOnly */ && change.nextData.storage === 1 /* Immutable */)
|
|
129773
|
-
readonlyMemberIds.add(change.recordId);
|
|
129774
|
-
}
|
|
129775
|
-
const managedClassIds = /* @__PURE__ */ new Set();
|
|
129776
|
-
for (const record6 of Object.values(workspace.state.records)) {
|
|
129777
|
-
if (record6.recordKind !== "class" || !record6.recordId.startsWith("system_") || !isRecord11(record6.data))
|
|
129778
|
-
continue;
|
|
129779
|
-
const schema = record6.data.schema;
|
|
129780
|
-
if (changedIds.has(record6.recordId) || isRecord11(schema) && Object.values(schema).some(
|
|
129781
|
-
(id2) => typeof id2 === "string" && changedIds.has(id2)
|
|
129782
|
-
))
|
|
129783
|
-
managedClassIds.add(record6.recordId);
|
|
129784
|
-
}
|
|
129785
|
-
const baseDeclarations = pulledSystemDeclarations(workspace, managedClassIds);
|
|
129786
|
-
const declarations = /* @__PURE__ */ new Map();
|
|
129787
|
-
for (const file of emission.files) {
|
|
129788
|
-
if (requiredProjectSourceKindV4(file.path, file.content) !== "definition")
|
|
129789
|
-
continue;
|
|
129790
|
-
const document = parseNeoProjectSource(
|
|
129791
|
-
file.content,
|
|
129792
|
-
"definition",
|
|
129793
|
-
file.path
|
|
129794
|
-
);
|
|
129795
|
-
const text = lex(file.content).source;
|
|
129796
|
-
const slice = (range2) => file.content.slice(text.offsetAt(range2.start), text.offsetAt(range2.end));
|
|
129797
|
-
for (const declaration of document.declarations) {
|
|
129798
|
-
const id2 = declarationId(declaration);
|
|
129799
|
-
if (id2 !== void 0 && managedClassIds.has(id2))
|
|
129800
|
-
declarations.set(id2, slice(declaration.range));
|
|
129801
|
-
}
|
|
129802
|
-
}
|
|
129803
|
-
const changedPaths = /* @__PURE__ */ new Set();
|
|
129804
|
-
const sources = listProjectSourceFilesV4(workspace.root).map((absolute) => {
|
|
129805
|
-
const path = relative6(workspace.root, absolute).split(sep6).join("/");
|
|
129806
|
-
const content = readFileSync10(absolute, "utf8");
|
|
129807
|
-
const rewritten = rewriteRawTileProjectSource(
|
|
129808
|
-
content,
|
|
129809
|
-
path,
|
|
129810
|
-
declarations,
|
|
129811
|
-
baseDeclarations,
|
|
129812
|
-
readonlyMemberIds
|
|
129813
|
-
);
|
|
129814
|
-
if (rewritten !== content) changedPaths.add(path);
|
|
129815
|
-
return { path, content: rewritten };
|
|
129816
|
-
});
|
|
129817
|
-
return { workspace: migrated, sources, changedPaths, retiredPaths };
|
|
129818
|
-
}
|
|
129819
|
-
function declarationId(value) {
|
|
129820
|
-
const text = value.annotations.find((annotation2) => annotation2.name === "id")?.arguments[0]?.text;
|
|
129821
|
-
if (text === void 0) return void 0;
|
|
129822
|
-
const token = lex(text).tokens[0];
|
|
129823
|
-
return typeof token?.value === "string" ? token.value : void 0;
|
|
129824
|
-
}
|
|
129825
|
-
function rewriteRawTileProjectSource(source, path, declarations = /* @__PURE__ */ new Map(), baseDeclarations = /* @__PURE__ */ new Map(), readonlyMemberIds = /* @__PURE__ */ new Set()) {
|
|
129826
|
-
const document = parseNeoProjectSource(
|
|
129827
|
-
source,
|
|
129828
|
-
requiredProjectSourceKindV4(path, source),
|
|
129829
|
-
path
|
|
129830
|
-
);
|
|
129831
|
-
if (document.diagnostics.length > 0)
|
|
129832
|
-
throw new Error(
|
|
129833
|
-
`Cannot upgrade ${path}: ${document.diagnostics[0]?.message}`
|
|
129834
|
-
);
|
|
129835
|
-
const lexical = lex(source);
|
|
129836
|
-
const replacements = [];
|
|
129837
|
-
const replace = (range2, text) => replacements.push({
|
|
129838
|
-
start: lexical.source.offsetAt(range2.start),
|
|
129839
|
-
end: lexical.source.offsetAt(range2.end),
|
|
129840
|
-
text
|
|
129841
|
-
});
|
|
129842
|
-
const visit = (node) => {
|
|
129843
|
-
if (Array.isArray(node)) {
|
|
129844
|
-
for (const child of node) visit(child);
|
|
129845
|
-
return;
|
|
129846
|
-
}
|
|
129847
|
-
if (!isRecord11(node)) return;
|
|
129848
|
-
if (typeof node.text === "string" && isRange(node.range)) {
|
|
129849
|
-
const text = rewriteRawTileSource(rewriteTileConstructors(node.text));
|
|
129850
|
-
if (text !== node.text) replace(node.range, text);
|
|
129851
|
-
return;
|
|
129852
|
-
}
|
|
129853
|
-
if (Array.isArray(node.typeArguments) && isRange(node.nameRange)) {
|
|
129854
|
-
if (node.name === "NeoTileInstance") replace(node.nameRange, "NeoTile");
|
|
129855
|
-
if (node.name === "NeoObjectPlacementTile")
|
|
129856
|
-
replace(node.nameRange, "NeoPlacementTile");
|
|
129857
|
-
}
|
|
129858
|
-
for (const [key, child] of Object.entries(node)) {
|
|
129859
|
-
if (key !== "syntax" && key !== "range" && key !== "sourceText")
|
|
129860
|
-
visit(child);
|
|
129861
|
-
}
|
|
129862
|
-
};
|
|
129863
|
-
for (const declaration of document.declarations) {
|
|
129864
|
-
const id2 = declarationId(declaration);
|
|
129865
|
-
const baseDeclaration = id2 === void 0 ? void 0 : baseDeclarations.get(id2);
|
|
129866
|
-
if (baseDeclaration !== void 0) {
|
|
129867
|
-
const local = source.slice(
|
|
129868
|
-
lexical.source.offsetAt(declaration.range.start),
|
|
129869
|
-
lexical.source.offsetAt(declaration.range.end)
|
|
129870
|
-
);
|
|
129871
|
-
const tokens = (text) => lex(text).tokens.map((token) => token.raw).join("\0");
|
|
129872
|
-
if (tokens(local) !== tokens(baseDeclaration))
|
|
129873
|
-
throw new Error(
|
|
129874
|
-
`Cannot upgrade modified system declaration ${declaration.name} in ${path}. Preserve your edits and restore that declaration to its pulled base before retrying.`
|
|
129875
|
-
);
|
|
129876
|
-
}
|
|
129877
|
-
if (id2 === RETIRED_TILE_INSTANCE_CLASS_ID) {
|
|
129878
|
-
replace(declaration.range, "");
|
|
129879
|
-
continue;
|
|
129880
|
-
}
|
|
129881
|
-
const replacement = id2 === void 0 ? void 0 : declarations.get(id2);
|
|
129882
|
-
if (replacement !== void 0) {
|
|
129883
|
-
replace(declaration.range, replacement);
|
|
129884
|
-
continue;
|
|
129885
|
-
}
|
|
129886
|
-
if (declaration.kind === "class") {
|
|
129887
|
-
for (const member of declaration.members) {
|
|
129888
|
-
const memberId = declarationId(member);
|
|
129889
|
-
if (member.kind === "field" && memberId !== void 0 && readonlyMemberIds.has(memberId)) {
|
|
129890
|
-
if (!member.modifiers.includes("readonly"))
|
|
129891
|
-
replace(
|
|
129892
|
-
{ start: member.type.range.start, end: member.type.range.start },
|
|
129893
|
-
"readonly "
|
|
129894
|
-
);
|
|
129895
|
-
const storage = member.annotations.find(
|
|
129896
|
-
(annotation2) => annotation2.name === "storage"
|
|
129897
|
-
);
|
|
129898
|
-
const allowed = storage?.arguments.find(
|
|
129899
|
-
(argument2) => argument2.name === "allowed"
|
|
129900
|
-
);
|
|
129901
|
-
if (allowed !== void 0) {
|
|
129902
|
-
if (!/^\.(Immutable|Save|Session)$/.test(allowed.text))
|
|
129903
|
-
throw new Error(
|
|
129904
|
-
`Cannot upgrade storage on ${member.name} in ${path}: expected a storage enum value.`
|
|
129905
|
-
);
|
|
129906
|
-
const start = lexical.source.offsetAt(allowed.range.start);
|
|
129907
|
-
const end = lexical.source.offsetAt(allowed.range.end);
|
|
129908
|
-
const token = lex(source.slice(start, end)).tokens.findLast(
|
|
129909
|
-
(token2) => token2.kind === "identifier"
|
|
129910
|
-
);
|
|
129911
|
-
if (token === void 0)
|
|
129912
|
-
throw new Error(
|
|
129913
|
-
`Cannot locate storage value on ${member.name} in ${path}.`
|
|
129914
|
-
);
|
|
129915
|
-
replacements.push({
|
|
129916
|
-
start: start + token.start,
|
|
129917
|
-
end: start + token.end,
|
|
129918
|
-
text: "Immutable"
|
|
129919
|
-
});
|
|
129920
|
-
} else if (storage !== void 0) {
|
|
129921
|
-
const start = lexical.source.offsetAt(storage.range.start);
|
|
129922
|
-
const end = lexical.source.offsetAt(storage.range.end);
|
|
129923
|
-
const open = lex(source.slice(start, end)).tokens.find(
|
|
129924
|
-
(token) => token.text === "("
|
|
129925
|
-
);
|
|
129926
|
-
if (open === void 0)
|
|
129927
|
-
replacements.push({
|
|
129928
|
-
start: end,
|
|
129929
|
-
end,
|
|
129930
|
-
text: "(allowed: .Immutable)"
|
|
129931
|
-
});
|
|
129932
|
-
else
|
|
129933
|
-
replacements.push({
|
|
129934
|
-
start: start + open.end,
|
|
129935
|
-
end: start + open.end,
|
|
129936
|
-
text: `allowed: .Immutable${storage.arguments.length === 0 ? "" : ", "}`
|
|
129937
|
-
});
|
|
129938
|
-
} else {
|
|
129939
|
-
replace(
|
|
129940
|
-
{ start: member.range.start, end: member.range.start },
|
|
129941
|
-
"@storage(allowed: .Immutable) "
|
|
129942
|
-
);
|
|
129943
|
-
}
|
|
129944
|
-
}
|
|
129945
|
-
}
|
|
129946
|
-
}
|
|
129947
|
-
visit(declaration);
|
|
129948
|
-
}
|
|
129949
|
-
let result = "";
|
|
129950
|
-
let cursor = 0;
|
|
129951
|
-
for (const replacement of replacements.sort(
|
|
129952
|
-
(a, b) => a.start - b.start || b.end - a.end
|
|
129953
|
-
)) {
|
|
129954
|
-
if (replacement.start < cursor) continue;
|
|
129955
|
-
result += source.slice(cursor, replacement.start) + replacement.text;
|
|
129956
|
-
cursor = replacement.end;
|
|
129957
|
-
}
|
|
129958
|
-
return result + source.slice(cursor);
|
|
129959
|
-
}
|
|
129960
|
-
function rewriteTileConstructors(source) {
|
|
129961
|
-
if (!source.includes("@tile")) return source;
|
|
129962
|
-
const tokens = lex(source).tokens.filter((token) => token.kind !== "comment");
|
|
129963
|
-
const replacements = [];
|
|
129964
|
-
for (let index = 0; index < tokens.length; index++) {
|
|
129965
|
-
if (tokens[index]?.text !== "@" || tokens[index + 1]?.text !== "tile")
|
|
129966
|
-
continue;
|
|
129967
|
-
const named = tokens[index + 3]?.text === "asset" && tokens[index + 4]?.text === ":";
|
|
129968
|
-
const targetIndex = index + (named ? 5 : 3);
|
|
129969
|
-
const target = tokens[targetIndex];
|
|
129970
|
-
const close = tokens[targetIndex + 1];
|
|
129971
|
-
const constructor2 = tokens[targetIndex + 3];
|
|
129972
|
-
if (tokens[index + 2]?.text !== "(") {
|
|
129973
|
-
throw new Error("Cannot upgrade @tile without an argument list.");
|
|
129974
|
-
}
|
|
129975
|
-
if (target?.kind !== "identifier" || close?.text !== ")") {
|
|
129976
|
-
throw new Error("Cannot upgrade @tile without one concrete tile class.");
|
|
129977
|
-
}
|
|
129978
|
-
if (tokens[targetIndex + 2]?.text !== "new" || constructor2?.text !== "NeoTileInstance") {
|
|
129979
|
-
throw new Error(
|
|
129980
|
-
"Cannot upgrade @tile unless it directly annotates a NeoTileInstance constructor."
|
|
129981
|
-
);
|
|
129982
|
-
}
|
|
129983
|
-
replacements.push({
|
|
129984
|
-
start: tokens[index].start,
|
|
129985
|
-
end: close.end,
|
|
129986
|
-
text: ""
|
|
129987
|
-
});
|
|
129988
|
-
replacements.push({
|
|
129989
|
-
start: constructor2.start,
|
|
129990
|
-
end: constructor2.end,
|
|
129991
|
-
text: target.text
|
|
129992
|
-
});
|
|
129993
|
-
}
|
|
129994
|
-
let result = "";
|
|
129995
|
-
let cursor = 0;
|
|
129996
|
-
for (const replacement of replacements) {
|
|
129997
|
-
result += source.slice(cursor, replacement.start) + replacement.text;
|
|
129998
|
-
cursor = replacement.end;
|
|
129999
|
-
}
|
|
130000
|
-
return result + source.slice(cursor);
|
|
130001
|
-
}
|
|
130002
|
-
function isRecord11(value) {
|
|
130003
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
130004
|
-
}
|
|
130005
|
-
function isRange(value) {
|
|
130006
|
-
if (!isRecord11(value)) return false;
|
|
130007
|
-
const position = (entry) => isRecord11(entry) && typeof entry.line === "number" && typeof entry.character === "number";
|
|
130008
|
-
return position(value.start) && position(value.end);
|
|
130009
|
-
}
|
|
130010
|
-
function pulledSystemDeclarations(workspace, selected) {
|
|
130011
|
-
const documents = [];
|
|
130012
|
-
const retiredWorldKinds = /* @__PURE__ */ new Map();
|
|
130013
|
-
for (const record6 of Object.values(workspace.state.records)) {
|
|
130014
|
-
if (!isSchemaRecordKindV4(record6.recordKind)) continue;
|
|
130015
|
-
let data = record6.data;
|
|
130016
|
-
if (record6.recordKind === "class" && isRecord11(data) && isRecord11(data.system)) {
|
|
130017
|
-
const world = data.system.worldKind;
|
|
130018
|
-
if (world === "tileInstance" || world === "objectPlacementTile") {
|
|
130019
|
-
retiredWorldKinds.set(
|
|
130020
|
-
record6.recordId,
|
|
130021
|
-
world === "tileInstance" ? "TileInstance" : "ObjectPlacementTile"
|
|
130022
|
-
);
|
|
130023
|
-
data = { ...data, system: { kind: data.system.kind } };
|
|
130024
|
-
}
|
|
130025
|
-
}
|
|
130026
|
-
if (!isRecord11(data))
|
|
130027
|
-
throw new Error(
|
|
130028
|
-
`Cannot upgrade invalid schema record ${record6.recordId}.`
|
|
130029
|
-
);
|
|
130030
|
-
documents.push({
|
|
130031
|
-
recordKind: record6.recordKind,
|
|
130032
|
-
recordId: record6.recordId,
|
|
130033
|
-
data
|
|
130034
|
-
});
|
|
130035
|
-
}
|
|
130036
|
-
const result = /* @__PURE__ */ new Map();
|
|
130037
|
-
for (const file of emitProjectSourcesV4(
|
|
130038
|
-
documentsToProjectSchemaManifest(documents)
|
|
130039
|
-
).files) {
|
|
130040
|
-
const id2 = file.recordKeys.find((key) => key.startsWith("class:"))?.slice(6);
|
|
130041
|
-
if (id2 === void 0 || !selected.has(id2)) continue;
|
|
130042
|
-
const world = retiredWorldKinds.get(id2);
|
|
130043
|
-
result.set(
|
|
130044
|
-
id2,
|
|
130045
|
-
world === void 0 ? file.content : file.content.replace(
|
|
130046
|
-
"@system(kind: .WorldAuthoring)",
|
|
130047
|
-
`@system(kind: .WorldAuthoring, worldKind: .${world})`
|
|
130048
|
-
)
|
|
130049
|
-
);
|
|
130050
|
-
}
|
|
130051
|
-
return result;
|
|
130052
|
-
}
|
|
130053
|
-
var init_raw_tile_pull_upgrade = __esm({
|
|
130054
|
-
"src/project-sync/raw-tile-pull-upgrade.ts"() {
|
|
130055
|
-
"use strict";
|
|
130056
|
-
init_src();
|
|
130057
|
-
init_project2();
|
|
130058
|
-
init_member_kinds();
|
|
130059
|
-
init_member_storage();
|
|
130060
|
-
init_raw_tile_placement_migration_prepare();
|
|
130061
|
-
init_raw_tile_placement_migration();
|
|
130062
|
-
init_raw_tile_source_rewrite();
|
|
130063
|
-
init_server_preparation_preflight();
|
|
130064
|
-
init_workspace_status();
|
|
130065
|
-
init_project_documents();
|
|
130066
|
-
init_project_manifest();
|
|
130067
|
-
init_emitter();
|
|
130068
|
-
init_source_layout();
|
|
130069
|
-
}
|
|
130070
|
-
});
|
|
130071
|
-
|
|
130072
128732
|
// src/commands/pull.ts
|
|
130073
128733
|
var pull_exports = {};
|
|
130074
128734
|
__export(pull_exports, {
|
|
@@ -130080,7 +128740,7 @@ import {
|
|
|
130080
128740
|
writeFileSync as writeFileSync8,
|
|
130081
128741
|
rmSync as rmSync5,
|
|
130082
128742
|
existsSync as existsSync8,
|
|
130083
|
-
readFileSync as
|
|
128743
|
+
readFileSync as readFileSync10
|
|
130084
128744
|
} from "node:fs";
|
|
130085
128745
|
import { dirname as dirname8 } from "node:path";
|
|
130086
128746
|
async function runPull(workspace, options, progress = spinner("Checking local workspace\u2026")) {
|
|
@@ -130089,20 +128749,13 @@ async function runPull(workspace, options, progress = spinner("Checking local wo
|
|
|
130089
128749
|
return;
|
|
130090
128750
|
}
|
|
130091
128751
|
try {
|
|
130092
|
-
|
|
130093
|
-
await runNormalPull(
|
|
130094
|
-
upgrade?.workspace ?? workspace,
|
|
130095
|
-
options,
|
|
130096
|
-
progress,
|
|
130097
|
-
upgrade
|
|
130098
|
-
);
|
|
130099
|
-
if (upgrade !== null) workspace.state = upgrade.workspace.state;
|
|
128752
|
+
await runNormalPull(workspace, options, progress);
|
|
130100
128753
|
} catch (error) {
|
|
130101
128754
|
progress.fail("Pull failed.");
|
|
130102
128755
|
throw error;
|
|
130103
128756
|
}
|
|
130104
128757
|
}
|
|
130105
|
-
async function runNormalPull(workspace, options, progress
|
|
128758
|
+
async function runNormalPull(workspace, options, progress) {
|
|
130106
128759
|
const destructive = options.force;
|
|
130107
128760
|
const hasBaseline = Object.keys(workspace.state.records).length > 0;
|
|
130108
128761
|
if (!destructive && !hasBaseline && listProjectSourceFilesV4(workspace.root).length > 0) {
|
|
@@ -130114,7 +128767,7 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
|
|
|
130114
128767
|
const hadConflicts = Object.values(workspace.state.records).some(
|
|
130115
128768
|
(record6) => record6.conflictServerHash !== void 0 || record6.conflictFiles !== void 0 || record6.projectBinary?.conflict !== void 0
|
|
130116
128769
|
);
|
|
130117
|
-
if (
|
|
128770
|
+
if (acceptSourceEquivalentConflictBases(workspace, mainLocale) > 0) {
|
|
130118
128771
|
writeWorkspaceState(workspace.root, workspace.state);
|
|
130119
128772
|
}
|
|
130120
128773
|
let changedRecordKeys = null;
|
|
@@ -130122,7 +128775,7 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
|
|
|
130122
128775
|
let observedHeadTransactionHash;
|
|
130123
128776
|
let observedDerivedEdgeVersion;
|
|
130124
128777
|
let document = null;
|
|
130125
|
-
if (!destructive && hasBaseline
|
|
128778
|
+
if (!destructive && hasBaseline) {
|
|
130126
128779
|
progress.update("Checking remote changes\u2026");
|
|
130127
128780
|
const cursor = workspace.state.documentRevisionCursor;
|
|
130128
128781
|
if (cursor !== void 0) {
|
|
@@ -130171,12 +128824,7 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
|
|
|
130171
128824
|
document = await fetchProjectDocument(workspace);
|
|
130172
128825
|
nextCursor = document.revision === void 0 ? null : cursorFromRevision(document.revision);
|
|
130173
128826
|
}
|
|
130174
|
-
|
|
130175
|
-
throw new Error(
|
|
130176
|
-
"The server still uses wrapped tiles. Complete the raw tile migration before pulling with this CLI."
|
|
130177
|
-
);
|
|
130178
|
-
}
|
|
130179
|
-
const compilerRefreshKeys = upgrade === null && !destructive && hasBaseline && !hadConflicts && !options.regenerateSourceNames ? compilerMetadataChangedKeys(
|
|
128827
|
+
const compilerRefreshKeys = !destructive && hasBaseline && !hadConflicts && !options.regenerateSourceNames ? compilerMetadataChangedKeys(
|
|
130180
128828
|
workspace.state.records,
|
|
130181
128829
|
document,
|
|
130182
128830
|
changedRecordKeys
|
|
@@ -130202,7 +128850,6 @@ async function runNormalPull(workspace, options, progress, upgrade = null) {
|
|
|
130202
128850
|
let localStatus = null;
|
|
130203
128851
|
if (hasBaseline && !destructive) {
|
|
130204
128852
|
const status = computeWorkspaceStatus2(workspace, {
|
|
130205
|
-
...upgrade === null ? {} : { virtualSourceFiles: upgrade.sources },
|
|
130206
128853
|
onPhase: (label) => progress.update(label)
|
|
130207
128854
|
});
|
|
130208
128855
|
localStatus = status;
|
|
@@ -130353,9 +129000,6 @@ ${blockingErrors.map((error) => ` ${error.message}`).join("\n")}`
|
|
|
130353
129000
|
localStatus,
|
|
130354
129001
|
destructive,
|
|
130355
129002
|
regenerateSourceNames: destructive || options.regenerateSourceNames,
|
|
130356
|
-
upgradedSourcePaths: upgrade?.changedPaths,
|
|
130357
|
-
upgradedSources: upgrade?.sources,
|
|
130358
|
-
retiredSourcePaths: upgrade?.retiredPaths,
|
|
130359
129003
|
changedRecordKeys,
|
|
130360
129004
|
nextCursor,
|
|
130361
129005
|
observedHeadTransactionHash,
|
|
@@ -130548,12 +129192,6 @@ async function finishFormat4Pull(args) {
|
|
|
130548
129192
|
emittedPaths,
|
|
130549
129193
|
mainLocale: workspaceMainLocale(workspace.state.records)
|
|
130550
129194
|
});
|
|
130551
|
-
const upgradedText = /* @__PURE__ */ new Map();
|
|
130552
|
-
for (const source of args.upgradedSources ?? []) {
|
|
130553
|
-
if (args.upgradedSourcePaths?.has(source.path) && !rewritePaths.has(source.path))
|
|
130554
|
-
upgradedText.set(source.path, source.content);
|
|
130555
|
-
}
|
|
130556
|
-
for (const path of args.upgradedSourcePaths ?? []) rewritePaths.add(path);
|
|
130557
129195
|
for (const key of regeneratedRecordKeys) {
|
|
130558
129196
|
for (const path of localRecordFiles.get(key) ?? []) rewritePaths.add(path);
|
|
130559
129197
|
}
|
|
@@ -130561,7 +129199,7 @@ async function finishFormat4Pull(args) {
|
|
|
130561
129199
|
let written = 0;
|
|
130562
129200
|
for (const path of emittedPaths) {
|
|
130563
129201
|
const absolute = resolveSourcePath(path);
|
|
130564
|
-
const existing = existsSync8(absolute) ?
|
|
129202
|
+
const existing = existsSync8(absolute) ? readFileSync10(absolute, "utf8") : null;
|
|
130565
129203
|
const unprojectedConflictKeys = authoredLocalConflictKeysByPath.get(path) ?? [];
|
|
130566
129204
|
if (unprojectedConflictKeys.length > 0 && existing === null) {
|
|
130567
129205
|
throw new Error(
|
|
@@ -130570,7 +129208,7 @@ async function finishFormat4Pull(args) {
|
|
|
130570
129208
|
)}: its prior source file ${JSON.stringify(path)} no longer exists.`
|
|
130571
129209
|
);
|
|
130572
129210
|
}
|
|
130573
|
-
const local = unprojectedConflictKeys.length > 0 ? existing ?? void 0 :
|
|
129211
|
+
const local = unprojectedConflictKeys.length > 0 ? existing ?? void 0 : localByPath.get(path)?.content;
|
|
130574
129212
|
const server = serverByPath.get(path)?.content;
|
|
130575
129213
|
const content = conflictPaths.has(path) ? renderConflictFileV4({
|
|
130576
129214
|
localContent: local,
|
|
@@ -130588,10 +129226,7 @@ async function finishFormat4Pull(args) {
|
|
|
130588
129226
|
}
|
|
130589
129227
|
}
|
|
130590
129228
|
let removed = 0;
|
|
130591
|
-
const previousPaths =
|
|
130592
|
-
...recordFiles.values(),
|
|
130593
|
-
...args.retiredSourcePaths ?? []
|
|
130594
|
-
]);
|
|
129229
|
+
const previousPaths = new Set(recordFiles.values());
|
|
130595
129230
|
for (const state of Object.values(workspace.state.records)) {
|
|
130596
129231
|
if (state.file !== void 0) previousPaths.add(state.file);
|
|
130597
129232
|
}
|
|
@@ -131010,7 +129645,6 @@ var init_pull = __esm({
|
|
|
131010
129645
|
init_static_member_ownership_recovery();
|
|
131011
129646
|
init_value_base_desync();
|
|
131012
129647
|
init_compiler_metadata();
|
|
131013
|
-
init_raw_tile_pull_upgrade();
|
|
131014
129648
|
}
|
|
131015
129649
|
});
|
|
131016
129650
|
|
|
@@ -131019,7 +129653,7 @@ var init_exports = {};
|
|
|
131019
129653
|
__export(init_exports, {
|
|
131020
129654
|
runInit: () => runInit
|
|
131021
129655
|
});
|
|
131022
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as
|
|
129656
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync11, writeFileSync as writeFileSync9 } from "node:fs";
|
|
131023
129657
|
import { join as join10, resolve as resolve3 } from "node:path";
|
|
131024
129658
|
async function runInit(options) {
|
|
131025
129659
|
let projectId = options.projectId;
|
|
@@ -131144,7 +129778,7 @@ async function runInit(options) {
|
|
|
131144
129778
|
}
|
|
131145
129779
|
function ensurePrivateStateIgnored(root) {
|
|
131146
129780
|
const path = join10(root, ".gitignore");
|
|
131147
|
-
const existing = existsSync9(path) ?
|
|
129781
|
+
const existing = existsSync9(path) ? readFileSync11(path, "utf8") : "";
|
|
131148
129782
|
if (existing.split(/\r?\n/u).some((line) => line.trim() === ".neo/" || line.trim() === ".neo")) {
|
|
131149
129783
|
return;
|
|
131150
129784
|
}
|
|
@@ -132547,7 +131181,7 @@ var init_save_overlay_resolution = __esm({
|
|
|
132547
131181
|
});
|
|
132548
131182
|
|
|
132549
131183
|
// src/commands/push-body-diagnostics.ts
|
|
132550
|
-
import { existsSync as existsSync10, readFileSync as
|
|
131184
|
+
import { existsSync as existsSync10, readFileSync as readFileSync12 } from "node:fs";
|
|
132551
131185
|
import { join as join11 } from "node:path";
|
|
132552
131186
|
function createNeoScriptBodySourceLocator(workspace, status) {
|
|
132553
131187
|
const textByFile = /* @__PURE__ */ new Map();
|
|
@@ -132571,7 +131205,7 @@ function createNeoScriptBodySourceLocator(workspace, status) {
|
|
|
132571
131205
|
const cached = textByFile.get(file);
|
|
132572
131206
|
if (cached !== void 0) return cached;
|
|
132573
131207
|
const path = join11(workspace.root, file);
|
|
132574
|
-
const text = existsSync10(path) ?
|
|
131208
|
+
const text = existsSync10(path) ? readFileSync12(path, "utf8") : null;
|
|
132575
131209
|
textByFile.set(file, text);
|
|
132576
131210
|
return text;
|
|
132577
131211
|
}
|
|
@@ -132716,7 +131350,7 @@ __export(script_exports, {
|
|
|
132716
131350
|
readDocumentArrays: () => readDocumentArrays,
|
|
132717
131351
|
runScript: () => runScript
|
|
132718
131352
|
});
|
|
132719
|
-
import { readFileSync as
|
|
131353
|
+
import { readFileSync as readFileSync13 } from "node:fs";
|
|
132720
131354
|
function readDocumentArrays(raw) {
|
|
132721
131355
|
const arrayOf2 = (field) => {
|
|
132722
131356
|
const value = raw[field];
|
|
@@ -133236,9 +131870,9 @@ function buildRootValue(document, lookups) {
|
|
|
133236
131870
|
}
|
|
133237
131871
|
function readSource(options, fallback) {
|
|
133238
131872
|
if (options.source !== null) return options.source;
|
|
133239
|
-
if (options.file !== null) return
|
|
131873
|
+
if (options.file !== null) return readFileSync13(options.file, "utf8");
|
|
133240
131874
|
if (fallback !== void 0) return fallback;
|
|
133241
|
-
const stdin =
|
|
131875
|
+
const stdin = readFileSync13(0, "utf8");
|
|
133242
131876
|
if (stdin.trim().length === 0) {
|
|
133243
131877
|
throw new Error(
|
|
133244
131878
|
"Provide NeoScript source as an argument, --file, or stdin."
|
|
@@ -134311,7 +132945,7 @@ function decodeProjectVersionTransactionResultPage(page) {
|
|
|
134311
132945
|
chunk.assignmentsJson,
|
|
134312
132946
|
`Project transaction "${page.transactionId}" result chunk ${chunk.chunkIndex} assignments`
|
|
134313
132947
|
);
|
|
134314
|
-
if (!
|
|
132948
|
+
if (!isRecord9(chunkAssignments)) {
|
|
134315
132949
|
throw new Error(
|
|
134316
132950
|
`Project transaction "${page.transactionId}" result chunk ${chunk.chunkIndex} assignments are not an object.`
|
|
134317
132951
|
);
|
|
@@ -134343,7 +132977,7 @@ function decodeProjectVersionTransactionResultPage(page) {
|
|
|
134343
132977
|
isDone: page.isDone
|
|
134344
132978
|
};
|
|
134345
132979
|
}
|
|
134346
|
-
function
|
|
132980
|
+
function isRecord9(value) {
|
|
134347
132981
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
134348
132982
|
}
|
|
134349
132983
|
var init_project_version_transaction_result = __esm({
|
|
@@ -134505,8 +133139,8 @@ var init_project_source_identity = __esm({
|
|
|
134505
133139
|
// src/push-hook.ts
|
|
134506
133140
|
import { spawn } from "node:child_process";
|
|
134507
133141
|
import { createHash as createHash9 } from "node:crypto";
|
|
134508
|
-
import { existsSync as existsSync11, readFileSync as
|
|
134509
|
-
import { join as join12, relative as
|
|
133142
|
+
import { existsSync as existsSync11, readFileSync as readFileSync14, readdirSync as readdirSync3 } from "node:fs";
|
|
133143
|
+
import { join as join12, relative as relative6, sep as sep6 } from "node:path";
|
|
134510
133144
|
function fingerprintPushInputs(workspace, options = {}) {
|
|
134511
133145
|
const paths = /* @__PURE__ */ new Set([
|
|
134512
133146
|
join12(workspace.root, "neo.json"),
|
|
@@ -134527,11 +133161,11 @@ function fingerprintPushInputs(workspace, options = {}) {
|
|
|
134527
133161
|
visitManaged(join12(workspace.root, "Files", "AudioClips"));
|
|
134528
133162
|
const hash = createHash9("sha256");
|
|
134529
133163
|
for (const path of [...paths].sort()) {
|
|
134530
|
-
const name =
|
|
133164
|
+
const name = relative6(workspace.root, path).split(sep6).join("/");
|
|
134531
133165
|
hash.update(name);
|
|
134532
133166
|
hash.update("\0");
|
|
134533
133167
|
try {
|
|
134534
|
-
hash.update(
|
|
133168
|
+
hash.update(readFileSync14(path));
|
|
134535
133169
|
} catch (error) {
|
|
134536
133170
|
if (isRecordWithCode(error) && (error.code === "ENOENT" || error.code === "ENOTDIR")) {
|
|
134537
133171
|
hash.update("<missing>");
|
|
@@ -134670,7 +133304,7 @@ var init_push_hook = __esm({
|
|
|
134670
133304
|
|
|
134671
133305
|
// src/project-source/project-file-push.ts
|
|
134672
133306
|
import { basename as basename2, join as join13 } from "node:path";
|
|
134673
|
-
import { readFileSync as
|
|
133307
|
+
import { readFileSync as readFileSync15 } from "node:fs";
|
|
134674
133308
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
134675
133309
|
async function cleanupRejectedProjectFilePushesV4(args) {
|
|
134676
133310
|
if (args.stagedUploadSessionId === null) return;
|
|
@@ -134727,7 +133361,7 @@ function prepareProjectFilePushesV4(args) {
|
|
|
134727
133361
|
);
|
|
134728
133362
|
}
|
|
134729
133363
|
const absolute = join13(args.workspace.root, binary.path);
|
|
134730
|
-
const bytes = new Uint8Array(
|
|
133364
|
+
const bytes = new Uint8Array(readFileSync15(absolute));
|
|
134731
133365
|
const digest = sha256Bytes(bytes);
|
|
134732
133366
|
if (binary.localSha256 !== null && digest !== binary.localSha256) {
|
|
134733
133367
|
throw new Error(
|
|
@@ -135385,10 +134019,10 @@ import {
|
|
|
135385
134019
|
writeFileSync as writeFileSync10,
|
|
135386
134020
|
rmSync as rmSync6,
|
|
135387
134021
|
existsSync as existsSync12,
|
|
135388
|
-
readFileSync as
|
|
134022
|
+
readFileSync as readFileSync16,
|
|
135389
134023
|
statSync
|
|
135390
134024
|
} from "node:fs";
|
|
135391
|
-
import { dirname as dirname9, join as join14, relative as
|
|
134025
|
+
import { dirname as dirname9, join as join14, relative as relative7, sep as sep7 } from "node:path";
|
|
135392
134026
|
function assignPendingIds(changes, authoredValueSeeds, reconstructed3, localInitializerMaterialization) {
|
|
135393
134027
|
const assigned = /* @__PURE__ */ new Map();
|
|
135394
134028
|
const assign = (pendingId2) => {
|
|
@@ -137453,9 +136087,9 @@ function statusForPushResult(workspace, submitted) {
|
|
|
137453
136087
|
for (let index = 0; index < paths.length; index += 1) {
|
|
137454
136088
|
const path = paths[index];
|
|
137455
136089
|
const input = snapshot.inputs[index];
|
|
137456
|
-
if (input?.uri !==
|
|
136090
|
+
if (input?.uri !== relative7(workspace.root, path).split(sep7).join("/"))
|
|
137457
136091
|
return computeWorkspaceStatus2(workspace);
|
|
137458
|
-
if (input.text !==
|
|
136092
|
+
if (input.text !== readFileSync16(path, "utf8"))
|
|
137459
136093
|
return computeWorkspaceStatus2(workspace);
|
|
137460
136094
|
}
|
|
137461
136095
|
const binaries = inspectProjectBinaryStatusV4(
|
|
@@ -137679,7 +136313,7 @@ function authoredMemberFormsByFile(root, alternates) {
|
|
|
137679
136313
|
let existing = contents.get(alternate.path);
|
|
137680
136314
|
if (existing === void 0) {
|
|
137681
136315
|
const absolute = join14(root, alternate.path);
|
|
137682
|
-
existing = existsSync12(absolute) ?
|
|
136316
|
+
existing = existsSync12(absolute) ? readFileSync16(absolute, "utf8") : null;
|
|
137683
136317
|
contents.set(alternate.path, existing);
|
|
137684
136318
|
}
|
|
137685
136319
|
if (existing === null || !existing.includes(alternate.block)) continue;
|
|
@@ -137793,7 +136427,7 @@ function rewriteFilesFromState(workspace, records2 = new Map(
|
|
|
137793
136427
|
for (const file of files) {
|
|
137794
136428
|
const absolute = resolveSourcePath(file.path);
|
|
137795
136429
|
mkdirSync10(dirname9(absolute), { recursive: true });
|
|
137796
|
-
const existing = existsSync12(absolute) ?
|
|
136430
|
+
const existing = existsSync12(absolute) ? readFileSync16(absolute, "utf8") : null;
|
|
137797
136431
|
if (existing !== file.content)
|
|
137798
136432
|
writeFileSync10(absolute, file.content, "utf8");
|
|
137799
136433
|
}
|
|
@@ -137837,8 +136471,8 @@ function materializeAssignedSchemaIdsInAuthoredSource(workspace, replacements, p
|
|
|
137837
136471
|
}
|
|
137838
136472
|
if (pendingIdsByUri.size === 0) return /* @__PURE__ */ new Map();
|
|
137839
136473
|
const inputs = options.sourceSnapshot?.inputs ?? listProjectSourceFilesV4(workspace.root).map((absolutePath) => {
|
|
137840
|
-
const uri =
|
|
137841
|
-
const text =
|
|
136474
|
+
const uri = relative7(workspace.root, absolutePath).split(sep7).join("/");
|
|
136475
|
+
const text = readFileSync16(absolutePath, "utf8");
|
|
137842
136476
|
const kind = neoProjectSourceKind(uri, text);
|
|
137843
136477
|
if (kind === null || !isNeoProjectProductionSourceKind(kind)) {
|
|
137844
136478
|
throw new Error(
|
|
@@ -138662,7 +137296,7 @@ var init_registry2 = __esm({
|
|
|
138662
137296
|
"schema-contract/registry.mjs"() {
|
|
138663
137297
|
"use strict";
|
|
138664
137298
|
PROJECT_SCHEMA_CONTRACT = Object.freeze({
|
|
138665
|
-
cliVersion: "0.52.
|
|
137299
|
+
cliVersion: "0.52.2",
|
|
138666
137300
|
projectFileUploadBatchSize: 32,
|
|
138667
137301
|
documentRecords: {
|
|
138668
137302
|
member: {
|
|
@@ -140090,7 +138724,7 @@ import {
|
|
|
140090
138724
|
existsSync as existsSync13,
|
|
140091
138725
|
mkdirSync as mkdirSync11,
|
|
140092
138726
|
readdirSync as readdirSync4,
|
|
140093
|
-
readFileSync as
|
|
138727
|
+
readFileSync as readFileSync17,
|
|
140094
138728
|
realpathSync as realpathSync2,
|
|
140095
138729
|
renameSync as renameSync5,
|
|
140096
138730
|
rmSync as rmSync7,
|
|
@@ -140102,12 +138736,12 @@ import {
|
|
|
140102
138736
|
dirname as dirname10,
|
|
140103
138737
|
isAbsolute as isAbsolute3,
|
|
140104
138738
|
join as join15,
|
|
140105
|
-
relative as
|
|
138739
|
+
relative as relative8,
|
|
140106
138740
|
resolve as resolve4,
|
|
140107
|
-
sep as
|
|
138741
|
+
sep as sep8
|
|
140108
138742
|
} from "node:path";
|
|
140109
138743
|
import { isDeepStrictEqual } from "node:util";
|
|
140110
|
-
function
|
|
138744
|
+
function isRecord10(value) {
|
|
140111
138745
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
140112
138746
|
}
|
|
140113
138747
|
function expectation(actual, negated = false) {
|
|
@@ -140118,13 +138752,13 @@ function expectation(actual, negated = false) {
|
|
|
140118
138752
|
return value;
|
|
140119
138753
|
}
|
|
140120
138754
|
function readExpectation(value) {
|
|
140121
|
-
if (!
|
|
138755
|
+
if (!isRecord10(value) || value.__neoExpectation !== true) {
|
|
140122
138756
|
throw new NeoTestAssertionError("Matcher receiver is not an expectation.");
|
|
140123
138757
|
}
|
|
140124
138758
|
return value;
|
|
140125
138759
|
}
|
|
140126
138760
|
function readMockHandle(value) {
|
|
140127
|
-
if (!
|
|
138761
|
+
if (!isRecord10(value) || value.__neoMockHandle !== true || typeof value.mockId !== "number") {
|
|
140128
138762
|
throw new NeoTestAssertionError(
|
|
140129
138763
|
"Mock configuration receiver is not a mock handle."
|
|
140130
138764
|
);
|
|
@@ -140235,13 +138869,13 @@ function errorMessage2(error) {
|
|
|
140235
138869
|
return error instanceof Error ? error.message : String(error);
|
|
140236
138870
|
}
|
|
140237
138871
|
function findDelegateTargetMemberId(value) {
|
|
140238
|
-
return
|
|
138872
|
+
return isRecord10(value) && typeof value.memberId === "string" ? value.memberId : null;
|
|
140239
138873
|
}
|
|
140240
138874
|
function sharedEvaluatorBase(rawDocument) {
|
|
140241
138875
|
const cached = SHARED_EVALUATOR_BASES.get(rawDocument);
|
|
140242
138876
|
if (cached !== void 0) return cached;
|
|
140243
138877
|
const document = readDocumentArrays(rawDocument);
|
|
140244
|
-
const constructors = Array.isArray(rawDocument.constructors) ? rawDocument.constructors.filter(
|
|
138878
|
+
const constructors = Array.isArray(rawDocument.constructors) ? rawDocument.constructors.filter(isRecord10) : [];
|
|
140245
138879
|
const runtime = cliEvaluatorRuntime(
|
|
140246
138880
|
{ ...document, constructors },
|
|
140247
138881
|
{ includeValueGraphIndexes: true }
|
|
@@ -140297,21 +138931,21 @@ function preparedHookCandidate(workspace) {
|
|
|
140297
138931
|
".neo",
|
|
140298
138932
|
"test-build"
|
|
140299
138933
|
);
|
|
140300
|
-
const pathFromRoot =
|
|
138934
|
+
const pathFromRoot = relative8(cacheRoot, directory);
|
|
140301
138935
|
if (isAbsolute3(pathFromRoot)) {
|
|
140302
138936
|
throw new NeoTestPreparedCandidateError(
|
|
140303
138937
|
"NEO_PREPARED_BUILD_DIR must not resolve to an absolute path outside this workspace's .neo/test-build directory."
|
|
140304
138938
|
);
|
|
140305
138939
|
}
|
|
140306
|
-
if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${
|
|
138940
|
+
if (pathFromRoot === ".." || pathFromRoot.startsWith(`..${sep8}`)) {
|
|
140307
138941
|
throw new NeoTestPreparedCandidateError(
|
|
140308
138942
|
"NEO_PREPARED_BUILD_DIR must resolve inside this workspace's .neo/test-build directory."
|
|
140309
138943
|
);
|
|
140310
138944
|
}
|
|
140311
138945
|
const parsed = JSON.parse(
|
|
140312
|
-
|
|
138946
|
+
readFileSync17(join15(directory, "candidate.json"), "utf8")
|
|
140313
138947
|
);
|
|
140314
|
-
if (!
|
|
138948
|
+
if (!isRecord10(parsed)) {
|
|
140315
138949
|
throw new NeoTestPreparedCandidateError(
|
|
140316
138950
|
"Configured push hook candidate manifest must be a JSON object."
|
|
140317
138951
|
);
|
|
@@ -140331,7 +138965,7 @@ function preparedHookCandidate(workspace) {
|
|
|
140331
138965
|
"Configured push hook candidate inputs no longer match the workspace."
|
|
140332
138966
|
);
|
|
140333
138967
|
}
|
|
140334
|
-
if (!
|
|
138968
|
+
if (!isRecord10(parsed.document)) {
|
|
140335
138969
|
throw new NeoTestPreparedCandidateError(
|
|
140336
138970
|
"Configured push hook candidate is missing its project document."
|
|
140337
138971
|
);
|
|
@@ -140379,8 +139013,8 @@ function testCandidateCachePath(workspace, inputFingerprint) {
|
|
|
140379
139013
|
function cachedTestCandidate(workspace, inputFingerprint) {
|
|
140380
139014
|
try {
|
|
140381
139015
|
const candidatePath = testCandidateCachePath(workspace, inputFingerprint);
|
|
140382
|
-
const parsed = JSON.parse(
|
|
140383
|
-
if (!
|
|
139016
|
+
const parsed = JSON.parse(readFileSync17(candidatePath, "utf8"));
|
|
139017
|
+
if (!isRecord10(parsed)) return null;
|
|
140384
139018
|
if (parsed.version !== 1) return null;
|
|
140385
139019
|
if (parsed.candidateRevision !== TEST_CANDIDATE_CACHE_REVISION) return null;
|
|
140386
139020
|
if (parsed.cliVersion !== PROJECT_SCHEMA_CONTRACT.cliVersion) return null;
|
|
@@ -140390,7 +139024,7 @@ function cachedTestCandidate(workspace, inputFingerprint) {
|
|
|
140390
139024
|
return null;
|
|
140391
139025
|
}
|
|
140392
139026
|
if (typeof parsed.documentSha256 !== "string") return null;
|
|
140393
|
-
const documentJson =
|
|
139027
|
+
const documentJson = readFileSync17(
|
|
140394
139028
|
join15(dirname10(candidatePath), "document.json"),
|
|
140395
139029
|
"utf8"
|
|
140396
139030
|
);
|
|
@@ -140398,7 +139032,7 @@ function cachedTestCandidate(workspace, inputFingerprint) {
|
|
|
140398
139032
|
return null;
|
|
140399
139033
|
}
|
|
140400
139034
|
const document = JSON.parse(documentJson);
|
|
140401
|
-
if (!
|
|
139035
|
+
if (!isRecord10(document)) return null;
|
|
140402
139036
|
return {
|
|
140403
139037
|
document,
|
|
140404
139038
|
sourceHash: parsed.sourceHash,
|
|
@@ -140429,8 +139063,8 @@ function cacheTestCandidate(workspace, inputFingerprint, candidate) {
|
|
|
140429
139063
|
}
|
|
140430
139064
|
function compileSpec(workspace, document, absolutePath, projectCompilationHash2) {
|
|
140431
139065
|
const scriptDocument = readDocumentArrays(document);
|
|
140432
|
-
const path =
|
|
140433
|
-
const source =
|
|
139066
|
+
const path = relative8(workspace.root, absolutePath).split(sep8).join("/");
|
|
139067
|
+
const source = readFileSync17(absolutePath, "utf8");
|
|
140434
139068
|
const sourceHash = createHash11("sha256").update(source).digest("hex");
|
|
140435
139069
|
const artifactPath = join15(
|
|
140436
139070
|
workspace.root,
|
|
@@ -140441,8 +139075,8 @@ function compileSpec(workspace, document, absolutePath, projectCompilationHash2)
|
|
|
140441
139075
|
`${sourceHash}.json`
|
|
140442
139076
|
);
|
|
140443
139077
|
try {
|
|
140444
|
-
const cached = JSON.parse(
|
|
140445
|
-
if (
|
|
139078
|
+
const cached = JSON.parse(readFileSync17(artifactPath, "utf8"));
|
|
139079
|
+
if (isRecord10(cached) && cached.version === 1 && cached.compilerRevision === NEOSCRIPT_COMPILER_REVISION && cached.projectCompilationHash === projectCompilationHash2 && cached.sourceHash === sourceHash && isRecord10(cached.action) && typeof cached.artifactSha256 === "string" && createHash11("sha256").update(JSON.stringify(cached.action)).digest("hex") === cached.artifactSha256 && cached.action.compilerRevision === NEOSCRIPT_COMPILER_REVISION && Array.isArray(cached.action.parameters) && Array.isArray(cached.action.instructions) && isRecord10(cached.action.typeInfo)) {
|
|
140446
139080
|
return {
|
|
140447
139081
|
path,
|
|
140448
139082
|
source,
|
|
@@ -140490,7 +139124,7 @@ function selectedSpecPaths(workspace, selectors) {
|
|
|
140490
139124
|
const relativePaths = new Map(
|
|
140491
139125
|
all.map((absolutePath) => [
|
|
140492
139126
|
absolutePath,
|
|
140493
|
-
|
|
139127
|
+
relative8(workspace.root, absolutePath).split(sep8).join("/")
|
|
140494
139128
|
])
|
|
140495
139129
|
);
|
|
140496
139130
|
const normalizedSelectors = selectors.map(
|
|
@@ -140504,16 +139138,16 @@ function selectedSpecPaths(workspace, selectors) {
|
|
|
140504
139138
|
);
|
|
140505
139139
|
}
|
|
140506
139140
|
const absolute = resolve4(workspace.root, selector);
|
|
140507
|
-
const workspaceRelative =
|
|
140508
|
-
if (workspaceRelative === ".." || workspaceRelative.startsWith(`..${
|
|
139141
|
+
const workspaceRelative = relative8(workspace.root, absolute);
|
|
139142
|
+
if (workspaceRelative === ".." || workspaceRelative.startsWith(`..${sep8}`)) {
|
|
140509
139143
|
throw new Error(
|
|
140510
139144
|
`Spec selector ${JSON.stringify(selector)} is outside the workspace.`
|
|
140511
139145
|
);
|
|
140512
139146
|
}
|
|
140513
139147
|
if (!existsSync13(absolute)) continue;
|
|
140514
139148
|
const real = realpathSync2(absolute);
|
|
140515
|
-
const realRelative =
|
|
140516
|
-
if (realRelative === ".." || realRelative.startsWith(`..${
|
|
139149
|
+
const realRelative = relative8(workspace.root, real);
|
|
139150
|
+
if (realRelative === ".." || realRelative.startsWith(`..${sep8}`)) {
|
|
140517
139151
|
throw new Error(
|
|
140518
139152
|
`Spec selector ${JSON.stringify(selector)} resolves outside the workspace through a symlink.`
|
|
140519
139153
|
);
|
|
@@ -140523,7 +139157,7 @@ function selectedSpecPaths(workspace, selectors) {
|
|
|
140523
139157
|
`Spec selector ${JSON.stringify(selector)} is ignored, private, symlinked, or is not a .spec.neo file.`
|
|
140524
139158
|
);
|
|
140525
139159
|
}
|
|
140526
|
-
if (statSync2(absolute).isDirectory() && !all.some((path) => path.startsWith(`${absolute}${
|
|
139160
|
+
if (statSync2(absolute).isDirectory() && !all.some((path) => path.startsWith(`${absolute}${sep8}`))) {
|
|
140527
139161
|
throw new Error(
|
|
140528
139162
|
`Spec selector ${JSON.stringify(selector)} is ignored, private, or contains no eligible .spec.neo files.`
|
|
140529
139163
|
);
|
|
@@ -140606,7 +139240,7 @@ function portableDelegate(value) {
|
|
|
140606
139240
|
}
|
|
140607
139241
|
}
|
|
140608
139242
|
function callMemberId(value) {
|
|
140609
|
-
if (!
|
|
139243
|
+
if (!isRecord10(value) || value.type !== "callFunction") return null;
|
|
140610
139244
|
return typeof value.memberId === "string" ? value.memberId : null;
|
|
140611
139245
|
}
|
|
140612
139246
|
function assertNoNestedRegistration(value) {
|
|
@@ -140614,7 +139248,7 @@ function assertNoNestedRegistration(value) {
|
|
|
140614
139248
|
for (const entry of value) assertNoNestedRegistration(entry);
|
|
140615
139249
|
return;
|
|
140616
139250
|
}
|
|
140617
|
-
if (!
|
|
139251
|
+
if (!isRecord10(value)) return;
|
|
140618
139252
|
const memberId = callMemberId(value);
|
|
140619
139253
|
if (memberId !== null && REGISTRATION_IDS.has(memberId)) {
|
|
140620
139254
|
throw new NeoTestRegistrationError(
|
|
@@ -140630,8 +139264,8 @@ function compiledDelegateActions(value) {
|
|
|
140630
139264
|
for (const child of entry) visit(child);
|
|
140631
139265
|
return;
|
|
140632
139266
|
}
|
|
140633
|
-
if (!
|
|
140634
|
-
if (
|
|
139267
|
+
if (!isRecord10(entry)) return;
|
|
139268
|
+
if (isRecord10(entry.action) && Array.isArray(entry.action.instructions) && Array.isArray(entry.action.parameters) && isRecord10(entry.action.typeInfo)) {
|
|
140635
139269
|
actions.push(entry.action);
|
|
140636
139270
|
return;
|
|
140637
139271
|
}
|
|
@@ -140642,7 +139276,7 @@ function compiledDelegateActions(value) {
|
|
|
140642
139276
|
}
|
|
140643
139277
|
function validateRegistrationAction(action, allowRegistration) {
|
|
140644
139278
|
for (const instruction of action.instructions) {
|
|
140645
|
-
const record6 =
|
|
139279
|
+
const record6 = isRecord10(instruction) ? instruction : null;
|
|
140646
139280
|
const call = record6?.type === "functionCall" ? record6.call : null;
|
|
140647
139281
|
const memberId = callMemberId(call);
|
|
140648
139282
|
if (memberId !== null && REGISTRATION_IDS.has(memberId)) {
|
|
@@ -140775,8 +139409,8 @@ function mockResponse(environment, mock, selected, call) {
|
|
|
140775
139409
|
};
|
|
140776
139410
|
}
|
|
140777
139411
|
function partialObjectMatch(actual, expected) {
|
|
140778
|
-
if (!
|
|
140779
|
-
if (!
|
|
139412
|
+
if (!isRecord10(expected)) return isDeepStrictEqual(actual, expected);
|
|
139413
|
+
if (!isRecord10(actual)) return false;
|
|
140780
139414
|
return Object.entries(expected).every(
|
|
140781
139415
|
([key, value]) => partialObjectMatch(actual[key], value)
|
|
140782
139416
|
);
|
|
@@ -140968,7 +139602,7 @@ function interceptTestCallCore(environment, call) {
|
|
|
140968
139602
|
const contains2 = typeof actual === "string" ? actual.includes(String(call.args[0])) : Array.isArray(actual) && actual.some((entry) => isDeepStrictEqual(entry, call.args[0]));
|
|
140969
139603
|
assertMatcher(contains2, expectationValue, "toContain", call.args[0]);
|
|
140970
139604
|
} else if (call.memberId === NEO_TEST_IDS.toHaveLength) {
|
|
140971
|
-
const length = typeof actual === "string" || Array.isArray(actual) ? actual.length :
|
|
139605
|
+
const length = typeof actual === "string" || Array.isArray(actual) ? actual.length : isRecord10(actual) ? Object.keys(actual).length : -1;
|
|
140972
139606
|
assertMatcher(
|
|
140973
139607
|
length === call.args[0],
|
|
140974
139608
|
expectationValue,
|
|
@@ -141059,11 +139693,11 @@ function snapshotEnvironmentDocument(environment) {
|
|
|
141059
139693
|
const values = [...baseValues];
|
|
141060
139694
|
const byId = /* @__PURE__ */ new Map();
|
|
141061
139695
|
values.forEach((value, index) => {
|
|
141062
|
-
if (
|
|
139696
|
+
if (isRecord10(value) && typeof value.id === "string")
|
|
141063
139697
|
byId.set(value.id, index);
|
|
141064
139698
|
});
|
|
141065
139699
|
const mergeRow = (row) => {
|
|
141066
|
-
if (!
|
|
139700
|
+
if (!isRecord10(row) || typeof row.id !== "string") return;
|
|
141067
139701
|
const cloned = structuredClone(row);
|
|
141068
139702
|
const index = byId.get(row.id);
|
|
141069
139703
|
if (index === void 0) {
|
|
@@ -141079,7 +139713,7 @@ function snapshotEnvironmentDocument(environment) {
|
|
|
141079
139713
|
if (bindings.size > 0) {
|
|
141080
139714
|
const baseMembers = Array.isArray(snapshot.members) ? snapshot.members : [];
|
|
141081
139715
|
snapshot.members = baseMembers.map((member) => {
|
|
141082
|
-
if (!
|
|
139716
|
+
if (!isRecord10(member) || typeof member.id !== "string" || !bindings.has(member.id)) {
|
|
141083
139717
|
return member;
|
|
141084
139718
|
}
|
|
141085
139719
|
return { ...member, valueId: bindings.get(member.id) ?? null };
|
|
@@ -141282,13 +139916,13 @@ function maintainNeoTestBuildCache(root, maxBytes = TEST_BUILD_CACHE_LIMIT_BYTES
|
|
|
141282
139916
|
const resolvedRoot = resolve4(root);
|
|
141283
139917
|
const resolvedProtected = protectedDirectory === void 0 ? null : resolve4(protectedDirectory);
|
|
141284
139918
|
const protectedInsideRoot = resolvedProtected !== null && (() => {
|
|
141285
|
-
const fromRoot =
|
|
141286
|
-
return fromRoot === "" || !fromRoot.startsWith(`..${
|
|
139919
|
+
const fromRoot = relative8(resolvedRoot, resolvedProtected);
|
|
139920
|
+
return fromRoot === "" || !fromRoot.startsWith(`..${sep8}`) && fromRoot !== ".." && !isAbsolute3(fromRoot);
|
|
141287
139921
|
})();
|
|
141288
139922
|
const isProtected = (path) => {
|
|
141289
139923
|
if (!protectedInsideRoot || resolvedProtected === null) return false;
|
|
141290
|
-
const fromProtected =
|
|
141291
|
-
return fromProtected === "" || !fromProtected.startsWith(`..${
|
|
139924
|
+
const fromProtected = relative8(resolvedProtected, resolve4(path));
|
|
139925
|
+
return fromProtected === "" || !fromProtected.startsWith(`..${sep8}`) && fromProtected !== ".." && !isAbsolute3(fromProtected);
|
|
141292
139926
|
};
|
|
141293
139927
|
for (const file of testBuildFiles(root)) {
|
|
141294
139928
|
if (!isProtected(file.path) && basename3(file.path).includes(".tmp-") && now - file.modifiedMs >= ABANDONED_TEMP_MAX_AGE_MS) {
|
|
@@ -141432,7 +140066,7 @@ async function runTest(workspace, options, dependencies = {}) {
|
|
|
141432
140066
|
throw new NeoTestUsageError(errorMessage2(error));
|
|
141433
140067
|
}
|
|
141434
140068
|
selectedFiles = selectedPaths.map(
|
|
141435
|
-
(path) =>
|
|
140069
|
+
(path) => relative8(workspace.root, path).split(sep8).join("/")
|
|
141436
140070
|
);
|
|
141437
140071
|
if (selectedPaths.length === 0 && options.passWithNoTests !== true) {
|
|
141438
140072
|
throw new NeoTestNoTestsError(
|
|
@@ -141680,7 +140314,7 @@ async function inspectNeoTestCompilation(workspace, dependencies = {}) {
|
|
|
141680
140314
|
if (candidate.document === null) {
|
|
141681
140315
|
return {
|
|
141682
140316
|
files: selectedPaths.map(
|
|
141683
|
-
(path) =>
|
|
140317
|
+
(path) => relative8(workspace.root, path).split(sep8).join("/")
|
|
141684
140318
|
),
|
|
141685
140319
|
errors: [
|
|
141686
140320
|
{
|
|
@@ -141701,14 +140335,14 @@ async function inspectNeoTestCompilation(workspace, dependencies = {}) {
|
|
|
141701
140335
|
compileSpec(workspace, document, path, compilationHash);
|
|
141702
140336
|
} catch (error) {
|
|
141703
140337
|
errors.push({
|
|
141704
|
-
file:
|
|
140338
|
+
file: relative8(workspace.root, path).split(sep8).join("/"),
|
|
141705
140339
|
message: errorMessage2(error)
|
|
141706
140340
|
});
|
|
141707
140341
|
}
|
|
141708
140342
|
}
|
|
141709
140343
|
return {
|
|
141710
140344
|
files: selectedPaths.map(
|
|
141711
|
-
(path) =>
|
|
140345
|
+
(path) => relative8(workspace.root, path).split(sep8).join("/")
|
|
141712
140346
|
),
|
|
141713
140347
|
errors
|
|
141714
140348
|
};
|
|
@@ -141804,9 +140438,9 @@ import {
|
|
|
141804
140438
|
constants as fsConstants,
|
|
141805
140439
|
accessSync,
|
|
141806
140440
|
existsSync as existsSync14,
|
|
141807
|
-
readFileSync as
|
|
140441
|
+
readFileSync as readFileSync18
|
|
141808
140442
|
} from "node:fs";
|
|
141809
|
-
import { extname as extname2, isAbsolute as isAbsolute4, join as join16, relative as
|
|
140443
|
+
import { extname as extname2, isAbsolute as isAbsolute4, join as join16, relative as relative9, sep as sep9 } from "node:path";
|
|
141810
140444
|
function inspectNeoDoctor(workspace) {
|
|
141811
140445
|
const formatCompatible = workspace.config.formatVersion === CURRENT_FORMAT_VERSION;
|
|
141812
140446
|
const compiler = inspectCompilerContract();
|
|
@@ -141889,7 +140523,7 @@ function inspectSourceContract(workspace) {
|
|
|
141889
140523
|
);
|
|
141890
140524
|
try {
|
|
141891
140525
|
const inputs = files.map((file, index) => {
|
|
141892
|
-
const text =
|
|
140526
|
+
const text = readFileSync18(file, "utf8");
|
|
141893
140527
|
return {
|
|
141894
140528
|
uri: relativeFiles[index],
|
|
141895
140529
|
kind: requiredProjectSourceKindV4(relativeFiles[index], text),
|
|
@@ -141937,7 +140571,7 @@ function inspectExtensionContract(root) {
|
|
|
141937
140571
|
};
|
|
141938
140572
|
}
|
|
141939
140573
|
try {
|
|
141940
|
-
const value = JSON.parse(
|
|
140574
|
+
const value = JSON.parse(readFileSync18(cachePath, "utf8"));
|
|
141941
140575
|
assertProjectSourceAnalysisV4(value);
|
|
141942
140576
|
return {
|
|
141943
140577
|
id: NEO_VSCODE_EXTENSION_ID,
|
|
@@ -142028,7 +140662,7 @@ function canAccess(path, mode) {
|
|
|
142028
140662
|
}
|
|
142029
140663
|
}
|
|
142030
140664
|
function workspacePath(root, path) {
|
|
142031
|
-
return
|
|
140665
|
+
return relative9(root, path).split(sep9).join("/");
|
|
142032
140666
|
}
|
|
142033
140667
|
function errorMessage3(error) {
|
|
142034
140668
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -142335,8 +140969,8 @@ __export(migrate_exports, {
|
|
|
142335
140969
|
runMigrate: () => runMigrate
|
|
142336
140970
|
});
|
|
142337
140971
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
142338
|
-
import { existsSync as existsSync15, mkdirSync as mkdirSync12, readFileSync as
|
|
142339
|
-
import { join as join17, relative as
|
|
140972
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync12, readFileSync as readFileSync19, writeFileSync as writeFileSync12 } from "node:fs";
|
|
140973
|
+
import { join as join17, relative as relative10 } from "node:path";
|
|
142340
140974
|
async function runMigrate(workspace, subcommand, positional, targetRef, json, dependencies = {}) {
|
|
142341
140975
|
if (subcommand === "new") {
|
|
142342
140976
|
const name = positional[0];
|
|
@@ -142349,11 +140983,11 @@ async function runMigrate(workspace, subcommand, positional, targetRef, json, de
|
|
|
142349
140983
|
mkdirSync12(migrationsDir, { recursive: true });
|
|
142350
140984
|
let nextOrder = 1;
|
|
142351
140985
|
for (const path of listProjectSourceFilesV4(workspace.root)) {
|
|
142352
|
-
const source =
|
|
140986
|
+
const source = readFileSync19(path, "utf8");
|
|
142353
140987
|
if (neoProjectSourceKind(path, source) !== "migration") continue;
|
|
142354
140988
|
const migration = parseMigrationFile(
|
|
142355
140989
|
source,
|
|
142356
|
-
|
|
140990
|
+
relative10(workspace.root, path),
|
|
142357
140991
|
/* @__PURE__ */ new Map()
|
|
142358
140992
|
);
|
|
142359
140993
|
nextOrder = Math.max(nextOrder, Number(migration.fileFields.order) + 1);
|
|
@@ -144534,7 +143168,7 @@ __export(content_exports, {
|
|
|
144534
143168
|
makeContentContext: () => makeContentContext,
|
|
144535
143169
|
runLoc: () => runLoc
|
|
144536
143170
|
});
|
|
144537
|
-
import { readFileSync as
|
|
143171
|
+
import { readFileSync as readFileSync20 } from "node:fs";
|
|
144538
143172
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
144539
143173
|
function versionPath2(workspace, suffix) {
|
|
144540
143174
|
return `/api/projects/${workspace.config.projectId}/versions/${workspace.config.versionId}/${suffix}`;
|
|
@@ -144542,9 +143176,9 @@ function versionPath2(workspace, suffix) {
|
|
|
144542
143176
|
function readBatch(file) {
|
|
144543
143177
|
let raw = null;
|
|
144544
143178
|
if (file !== null) {
|
|
144545
|
-
raw =
|
|
143179
|
+
raw = readFileSync20(file, "utf8");
|
|
144546
143180
|
} else if (!process.stdin.isTTY) {
|
|
144547
|
-
raw =
|
|
143181
|
+
raw = readFileSync20(0, "utf8");
|
|
144548
143182
|
if (raw.trim().length === 0) raw = null;
|
|
144549
143183
|
}
|
|
144550
143184
|
if (raw === null) return null;
|
|
@@ -145792,7 +144426,7 @@ import { createHash as createHash12 } from "node:crypto";
|
|
|
145792
144426
|
import {
|
|
145793
144427
|
existsSync as existsSync16,
|
|
145794
144428
|
mkdirSync as mkdirSync13,
|
|
145795
|
-
readFileSync as
|
|
144429
|
+
readFileSync as readFileSync21,
|
|
145796
144430
|
unlinkSync,
|
|
145797
144431
|
writeFileSync as writeFileSync13
|
|
145798
144432
|
} from "node:fs";
|
|
@@ -145805,7 +144439,7 @@ function validatePath(path) {
|
|
|
145805
144439
|
}
|
|
145806
144440
|
function readManifest(path) {
|
|
145807
144441
|
if (!existsSync16(path)) return null;
|
|
145808
|
-
const data = JSON.parse(
|
|
144442
|
+
const data = JSON.parse(readFileSync21(path, "utf8"));
|
|
145809
144443
|
if (data === null || typeof data !== "object" || !("schemaVersion" in data) || data.schemaVersion !== 1)
|
|
145810
144444
|
throw new Error(`Invalid generated-file manifest version: ${path}`);
|
|
145811
144445
|
if (!("files" in data) || !Array.isArray(data.files) || data.files.length === 0)
|
|
@@ -145885,7 +144519,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
|
|
|
145885
144519
|
const meta = join18(directory, old.path + ".meta");
|
|
145886
144520
|
operations.push([
|
|
145887
144521
|
path + ".meta",
|
|
145888
|
-
existsSync16(meta) ?
|
|
144522
|
+
existsSync16(meta) ? readFileSync21(meta, "utf8") : null
|
|
145889
144523
|
]);
|
|
145890
144524
|
}
|
|
145891
144525
|
operations.push([path, file.content]);
|
|
@@ -145912,7 +144546,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
|
|
|
145912
144546
|
if (!previous.has(key))
|
|
145913
144547
|
previous.set(key, {
|
|
145914
144548
|
path,
|
|
145915
|
-
content: existsSync16(path) ?
|
|
144549
|
+
content: existsSync16(path) ? readFileSync21(path, "utf8") : null
|
|
145916
144550
|
});
|
|
145917
144551
|
}
|
|
145918
144552
|
const write = (path, content) => {
|
|
@@ -145926,7 +144560,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
|
|
|
145926
144560
|
const changed = [];
|
|
145927
144561
|
try {
|
|
145928
144562
|
for (const [path, content] of operations) {
|
|
145929
|
-
const current = existsSync16(path) ?
|
|
144563
|
+
const current = existsSync16(path) ? readFileSync21(path, "utf8") : null;
|
|
145930
144564
|
if (current === content) continue;
|
|
145931
144565
|
changed.push(path);
|
|
145932
144566
|
write(path, content);
|
|
@@ -145939,7 +144573,7 @@ function writeUnityGeneratedFiles(directory, projectId, files) {
|
|
|
145939
144573
|
restored.add(key);
|
|
145940
144574
|
const original = previous.get(key);
|
|
145941
144575
|
if (original.path !== path && existsSync16(path)) unlinkSync(path);
|
|
145942
|
-
const current = existsSync16(original.path) ?
|
|
144576
|
+
const current = existsSync16(original.path) ? readFileSync21(original.path, "utf8") : null;
|
|
145943
144577
|
if (current !== original.content) write(original.path, original.content);
|
|
145944
144578
|
}
|
|
145945
144579
|
throw error;
|
|
@@ -146180,8 +144814,8 @@ __export(resolve_exports, {
|
|
|
146180
144814
|
resolveMarkers: () => resolveMarkers,
|
|
146181
144815
|
runResolve: () => runResolve
|
|
146182
144816
|
});
|
|
146183
|
-
import { readFileSync as
|
|
146184
|
-
import { join as join21, relative as
|
|
144817
|
+
import { readFileSync as readFileSync22, rmSync as rmSync8, writeFileSync as writeFileSync15 } from "node:fs";
|
|
144818
|
+
import { join as join21, relative as relative11 } from "node:path";
|
|
146185
144819
|
function runResolve(workspace, side) {
|
|
146186
144820
|
const marked = readMarkedProjectSourcesV4(workspace.root);
|
|
146187
144821
|
assertRecordConflictsResolveTogetherV4(
|
|
@@ -146204,7 +144838,7 @@ function runResolve(workspace, side) {
|
|
|
146204
144838
|
if (conflict2.remoteSha256 !== null && conflict2.artifactPath !== void 0) {
|
|
146205
144839
|
writeVerifiedBinaryDownloadV4(
|
|
146206
144840
|
destination,
|
|
146207
|
-
|
|
144841
|
+
readFileSync22(join21(workspace.root, conflict2.artifactPath)),
|
|
146208
144842
|
conflict2.remoteSha256
|
|
146209
144843
|
);
|
|
146210
144844
|
binary.sha256 = conflict2.remoteSha256;
|
|
@@ -146233,10 +144867,10 @@ function runResolve(workspace, side) {
|
|
|
146233
144867
|
function readMarkedProjectSourcesV4(root) {
|
|
146234
144868
|
const files = [];
|
|
146235
144869
|
for (const absolutePath of listProjectSourceFilesV4(root)) {
|
|
146236
|
-
const source =
|
|
144870
|
+
const source = readFileSync22(absolutePath, "utf8");
|
|
146237
144871
|
if (detectConflictMarkers(source) === null) continue;
|
|
146238
144872
|
files.push({
|
|
146239
|
-
path: normalizeWorkspaceSourcePath(
|
|
144873
|
+
path: normalizeWorkspaceSourcePath(relative11(root, absolutePath)),
|
|
146240
144874
|
absolutePath,
|
|
146241
144875
|
source
|
|
146242
144876
|
});
|
|
@@ -146533,7 +145167,7 @@ There is no --keep-current: preserving current semantic state defines flatten.
|
|
|
146533
145167
|
async function main() {
|
|
146534
145168
|
const args = parseArgs(process.argv.slice(2));
|
|
146535
145169
|
if (args.command === "--version") {
|
|
146536
|
-
console.log("0.52.
|
|
145170
|
+
console.log("0.52.2");
|
|
146537
145171
|
return;
|
|
146538
145172
|
}
|
|
146539
145173
|
if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {
|