@neocompose/cli 0.82.4 → 0.82.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.82.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 7d9a013: Preserve generic arguments in Unity animation clip target types and reference lookup factories. Generate clip getters with the declared target type so clips targeting a base class compile correctly. Report incompatible owner/target generic bindings during export instead of emitting C# that cannot compile. Run `neo export` after updating to regenerate the corrected C#.
8
+
3
9
  ## 0.82.4
4
10
 
5
11
  ### Patch Changes
@@ -15508,7 +15508,7 @@ var init_registry = __esm({
15508
15508
  "../packages/manifest/schema-contract/registry.mjs"() {
15509
15509
  "use strict";
15510
15510
  PROJECT_SCHEMA_CONTRACT = Object.freeze({
15511
- cliVersion: "0.82.4",
15511
+ cliVersion: "0.82.5",
15512
15512
  projectFileUploadBatchSize: 32,
15513
15513
  documentRecords: {
15514
15514
  member: {
@@ -24459,7 +24459,7 @@ function csharpPropertyValueType(ctx, member, saved = false, env, genericBinding
24459
24459
  }
24460
24460
  return csharpValueType(ctx, member, saved, env, genericBindingSaved);
24461
24461
  }
24462
- function animationClipTargetType(ctx, member, env) {
24462
+ function animationClipTargetType(ctx, member, env, ownerClassId) {
24463
24463
  const clipClass = resolveInheritanceChain(member.classId, ctx.classes).find(
24464
24464
  (candidate) => candidate.system?.worldKind === NeoWorldSystemClassKind.AnimationClip
24465
24465
  );
@@ -24540,7 +24540,47 @@ function animationClipTargetType(ctx, member, env) {
24540
24540
  });
24541
24541
  return null;
24542
24542
  }
24543
- return targetType;
24543
+ const suffix = constructedTypeArgumentsSuffix(ctx, bindingMember, true, env);
24544
+ if (suffix === null) return null;
24545
+ const constructedTarget = `${targetType}${suffix}`;
24546
+ if (ownerClassId !== void 0) {
24547
+ const ownerName = ctx.typeNames.get(ownerClassId) ?? ownerClassId;
24548
+ if (!resolveInheritanceChain(ownerClassId, ctx.classes).some(
24549
+ (ancestor) => ancestor.id === bindingMember.classId
24550
+ )) {
24551
+ ctx.diagnostics.push({
24552
+ severity: "error",
24553
+ message: `Animation clip "${member.name}" targets ${constructedTarget}, which is not its owner ${ownerName} or a base of it.`,
24554
+ path: memberPath3
24555
+ });
24556
+ return null;
24557
+ }
24558
+ const ownerArguments = [];
24559
+ for (const { param } of resolveGenericScopeForEmission(
24560
+ ctx,
24561
+ bindingMember.classId
24562
+ )) {
24563
+ const argument2 = csharpGenericParamType(
24564
+ ctx,
24565
+ param.id,
24566
+ true,
24567
+ env,
24568
+ memberPath3
24569
+ );
24570
+ if (argument2 === null) return null;
24571
+ ownerArguments.push(argument2);
24572
+ }
24573
+ const ownerTarget = `${targetType}${ownerArguments.length === 0 ? "" : `<${ownerArguments.join(", ")}>`}`;
24574
+ if (ownerTarget !== constructedTarget) {
24575
+ ctx.diagnostics.push({
24576
+ severity: "error",
24577
+ message: `Animation clip "${member.name}" targets ${constructedTarget}, but owner ${ownerName} has target type ${ownerTarget}. A clip must target its owner or a constructed base of it.`,
24578
+ path: memberPath3
24579
+ });
24580
+ return null;
24581
+ }
24582
+ }
24583
+ return constructedTarget;
24544
24584
  }
24545
24585
  function csharpTypeInfoValueType(ctx, typeInfo, saved, genericEnv, genericBindingSaved = saved) {
24546
24586
  const optional2 = !typeInfo.required;
@@ -181324,7 +181364,12 @@ function generateMember(ctx, schemaKey, memberId, saved, modifier, emitBody, own
181324
181364
  );
181325
181365
  }
181326
181366
  if (isMemberClassBase(member) && (ctx.worldKinds.get(member.classId) ?? null) === NeoWorldSystemClassKind.AnimationClip) {
181327
- const targetType = animationClipTargetType(ctx, member, genericEnv);
181367
+ const targetType = animationClipTargetType(
181368
+ ctx,
181369
+ member,
181370
+ genericEnv,
181371
+ ownerClassId
181372
+ );
181328
181373
  if (targetType === null) {
181329
181374
  return [`// Skipped invalid animation clip member: ${memberName}`];
181330
181375
  }
@@ -181343,7 +181388,7 @@ function generateMember(ctx, schemaKey, memberId, saved, modifier, emitBody, own
181343
181388
  "get",
181344
181389
  "{",
181345
181390
  ...indent([
181346
- `return client.GetOrCreateAnimationClip(this, "${escapeCSharpString(schemaKey)}");`
181391
+ `return client.GetOrCreateAnimationClip<${targetType}>(this, "${escapeCSharpString(schemaKey)}");`
181347
181392
  ]),
181348
181393
  "}"
181349
181394
  ]),
@@ -183380,7 +183425,7 @@ function lookupSelectionFactory(ctx, member, selection2, saved, writeGuardMember
183380
183425
  const targetClass = lookupTargetClassProjection(ctx, member, genericEnv);
183381
183426
  if (targetClass === null) return null;
183382
183427
  const typeName = ctx.typeNames.get(targetClass.classId) ?? "NeoNode";
183383
- const savedTypeRef = qualifyGeneratedType(ctx, savedTypeName(typeName));
183428
+ const savedTypeRef = `${qualifyGeneratedType(ctx, savedTypeName(typeName))}${targetClass.constructedSuffix}`;
183384
183429
  const writable = `writable${selection2[0].toUpperCase()}${selection2.slice(1)}`;
183385
183430
  if (lookupHasRuntimeOwnership(member) && schemaClassHasWritableFamily(ctx, targetClass.classId))
183386
183431
  return `${selection2} is NeoMemberClassWritable ${writable} ? ${savedTypeRef}.CreateWritable(client, ${writable}) : ${savedTypeRef}.Create(client, (NeoMemberClass)${selection2})`;
@@ -187093,7 +187138,7 @@ var UNITY_CODEGEN_REVISION;
187093
187138
  var init_unity_codegen_revision = __esm({
187094
187139
  "../src/models/exports/unity-codegen-revision.ts"() {
187095
187140
  "use strict";
187096
- UNITY_CODEGEN_REVISION = "4eae63e39962f0ceb684c43fe8932b031b420c82ad6319670c46608bd9cd1470";
187141
+ UNITY_CODEGEN_REVISION = "2734215e6a19e5f077e5f76093f84e82b0ee6fe9e3bc92a4f44c43c2448c63ba";
187097
187142
  }
187098
187143
  });
187099
187144
 
@@ -208072,7 +208117,7 @@ var releaseWorkspaceLock = () => void 0;
208072
208117
  async function main() {
208073
208118
  const args = parseArgs(process.argv.slice(2));
208074
208119
  if (args.command === "--version") {
208075
- console.log("0.82.4");
208120
+ console.log("0.82.5");
208076
208121
  return;
208077
208122
  }
208078
208123
  if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {
@@ -60511,7 +60511,7 @@ function csharpPropertyValueType(ctx, member, saved = false, env, genericBinding
60511
60511
  }
60512
60512
  return csharpValueType(ctx, member, saved, env, genericBindingSaved);
60513
60513
  }
60514
- function animationClipTargetType(ctx, member, env) {
60514
+ function animationClipTargetType(ctx, member, env, ownerClassId) {
60515
60515
  const clipClass = resolveInheritanceChain(member.classId, ctx.classes).find(
60516
60516
  (candidate) => candidate.system?.worldKind === NeoWorldSystemClassKind.AnimationClip
60517
60517
  );
@@ -60592,7 +60592,47 @@ function animationClipTargetType(ctx, member, env) {
60592
60592
  });
60593
60593
  return null;
60594
60594
  }
60595
- return targetType;
60595
+ const suffix = constructedTypeArgumentsSuffix(ctx, bindingMember, true, env);
60596
+ if (suffix === null) return null;
60597
+ const constructedTarget = `${targetType}${suffix}`;
60598
+ if (ownerClassId !== void 0) {
60599
+ const ownerName = ctx.typeNames.get(ownerClassId) ?? ownerClassId;
60600
+ if (!resolveInheritanceChain(ownerClassId, ctx.classes).some(
60601
+ (ancestor) => ancestor.id === bindingMember.classId
60602
+ )) {
60603
+ ctx.diagnostics.push({
60604
+ severity: "error",
60605
+ message: `Animation clip "${member.name}" targets ${constructedTarget}, which is not its owner ${ownerName} or a base of it.`,
60606
+ path: memberPath
60607
+ });
60608
+ return null;
60609
+ }
60610
+ const ownerArguments = [];
60611
+ for (const { param } of resolveGenericScopeForEmission(
60612
+ ctx,
60613
+ bindingMember.classId
60614
+ )) {
60615
+ const argument2 = csharpGenericParamType(
60616
+ ctx,
60617
+ param.id,
60618
+ true,
60619
+ env,
60620
+ memberPath
60621
+ );
60622
+ if (argument2 === null) return null;
60623
+ ownerArguments.push(argument2);
60624
+ }
60625
+ const ownerTarget = `${targetType}${ownerArguments.length === 0 ? "" : `<${ownerArguments.join(", ")}>`}`;
60626
+ if (ownerTarget !== constructedTarget) {
60627
+ ctx.diagnostics.push({
60628
+ severity: "error",
60629
+ message: `Animation clip "${member.name}" targets ${constructedTarget}, but owner ${ownerName} has target type ${ownerTarget}. A clip must target its owner or a constructed base of it.`,
60630
+ path: memberPath
60631
+ });
60632
+ return null;
60633
+ }
60634
+ }
60635
+ return constructedTarget;
60596
60636
  }
60597
60637
  function csharpTypeInfoValueType(ctx, typeInfo, saved, genericEnv, genericBindingSaved = saved) {
60598
60638
  const optional2 = !typeInfo.required;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.82.4",
3
+ "version": "0.82.5",
4
4
  "description": "Neo Compose native project-source CLI with bidirectional sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,7 +9,7 @@ description: >-
9
9
  `@neocompose/cli` or `node cli/bin/neo.mjs` in the neo-compose repository.
10
10
  ---
11
11
 
12
- <!-- reviewed-through-cli: 0.82.4 -->
12
+ <!-- reviewed-through-cli: 0.82.5 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -129,7 +129,7 @@ wrappers.
129
129
  The marker near the top of `SKILL.md` must exactly match the package version:
130
130
 
131
131
  ```html
132
- <!-- reviewed-through-cli: 0.82.4 -->
132
+ <!-- reviewed-through-cli: 0.82.5 -->
133
133
  ```
134
134
 
135
135
  The quoted version above is checked too, so this instruction cannot go stale
@@ -331,6 +331,10 @@ to earlier content reuses that result after verifying output bytes; changed or
331
331
  missing outputs are regenerated. Edited content is validated
332
332
  even when C# generation is skipped. After a CLI code-generation fix, run
333
333
  `neo export` again; generator revision changes invalidate cached C# output.
334
+ Generated animation clip targets and reference lookup factories retain constructed
335
+ generic arguments, including supported forwarded bindings. Clip getters use the
336
+ declared target type when the owner is a derived class. Export reports an error
337
+ when a clip target does not match the owner or one of its constructed base types.
334
338
  New instances that reuse existing member-localized text retain its shared ID
335
339
  and translations in the export.
336
340