@teambit/semantics.entities.semantic-schema 0.0.100 → 0.0.101

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.
Files changed (41) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +42 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/schema-diff-members.d.ts +3 -0
  5. package/dist/schema-diff-members.js +171 -0
  6. package/dist/schema-diff-members.js.map +1 -0
  7. package/dist/schema-diff.d.ts +13 -0
  8. package/dist/schema-diff.js +138 -0
  9. package/dist/schema-diff.js.map +1 -0
  10. package/dist/schema-node.d.ts +7 -0
  11. package/dist/schema-node.js +49 -0
  12. package/dist/schema-node.js.map +1 -1
  13. package/dist/schemas/class.d.ts +2 -0
  14. package/dist/schemas/class.js +11 -0
  15. package/dist/schemas/class.js.map +1 -1
  16. package/dist/schemas/enum.d.ts +2 -0
  17. package/dist/schemas/enum.js +55 -0
  18. package/dist/schemas/enum.js.map +1 -1
  19. package/dist/schemas/function-like.d.ts +9 -0
  20. package/dist/schemas/function-like.js +300 -0
  21. package/dist/schemas/function-like.js.map +1 -1
  22. package/dist/schemas/interface.d.ts +2 -0
  23. package/dist/schemas/interface.js +11 -0
  24. package/dist/schemas/interface.js.map +1 -1
  25. package/dist/schemas/type.d.ts +2 -0
  26. package/dist/schemas/type.js +25 -0
  27. package/dist/schemas/type.js.map +1 -1
  28. package/dist/schemas/variable-like.d.ts +2 -0
  29. package/dist/schemas/variable-like.js +60 -0
  30. package/dist/schemas/variable-like.js.map +1 -1
  31. package/index.ts +2 -0
  32. package/package.json +2 -2
  33. package/schema-diff-members.ts +164 -0
  34. package/schema-diff.ts +168 -0
  35. package/schema-node.ts +34 -0
  36. package/schemas/class.ts +7 -0
  37. package/schemas/enum.ts +46 -0
  38. package/schemas/function-like.ts +277 -0
  39. package/schemas/interface.ts +7 -0
  40. package/schemas/type.ts +18 -0
  41. package/schemas/variable-like.ts +54 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_docs","_expressionWithArguments","_schemaRegistry","e","__esModule","default","ClassSchema","SchemaNode","constructor","name","members","location","signature","doc","typeParams","extendsNodes","implementNodes","decorators","getNodes","toString","options","boldUnderline","color","chalk","bold","underline","str","membersStr","map","m","join","decoratorsStr","decorator","toFullSignature","result","showDocs","classDeclaration","length","extendsStr","node","implementsStr","member","memberStr","split","line","toObject","fromObject","obj","SchemaRegistry","DocSchema","undefined","ExpressionWithTypeArgumentsSchema","fromSchema","memberTransformer","_node","exports"],"sources":["class.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { SchemaLocation } from '../schema-node';\nimport { SchemaNode } from '../schema-node';\nimport { DocSchema } from './docs';\nimport { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport class ClassSchema extends SchemaNode {\n readonly members: SchemaNode[];\n readonly doc?: DocSchema;\n\n constructor(\n readonly name: string,\n members: SchemaNode[],\n readonly location: SchemaLocation,\n readonly signature: string,\n doc?: DocSchema,\n readonly typeParams?: string[],\n readonly extendsNodes?: ExpressionWithTypeArgumentsSchema[],\n readonly implementNodes?: ExpressionWithTypeArgumentsSchema[],\n readonly decorators?: SchemaNode[]\n ) {\n super();\n this.members = members;\n this.doc = doc;\n }\n\n getNodes() {\n return this.members;\n }\n\n toString(options?: { color?: boolean }): string {\n const boldUnderline = options?.color ? chalk.bold.underline : (str: string) => str;\n const membersStr = this.members.map((m) => `* ${m.toString(options)}`).join('\\n');\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toString(options)).join('\\n');\n return `${this.decorators ? `${decoratorsStr}\\n` : ''}${boldUnderline(this.name)}\\n${membersStr}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toFullSignature(options)).join('\\n');\n if (decoratorsStr) {\n result += `${decoratorsStr}\\n`;\n }\n\n let classDeclaration = `class ${this.name}`;\n\n if (this.typeParams && this.typeParams.length > 0) {\n classDeclaration += `<${this.typeParams.join(', ')}>`;\n }\n\n if (this.extendsNodes && this.extendsNodes.length > 0) {\n const extendsStr = this.extendsNodes.map((node) => node.toFullSignature(options)).join(', ');\n classDeclaration += ` extends ${extendsStr}`;\n }\n\n if (this.implementNodes && this.implementNodes.length > 0) {\n const implementsStr = this.implementNodes.map((node) => node.toFullSignature(options)).join(', ');\n classDeclaration += ` implements ${implementsStr}`;\n }\n\n result += `${classDeclaration} {\\n`;\n\n const membersStr = this.members\n .map((member) => {\n const memberStr = member.toFullSignature(options);\n return memberStr\n .split('\\n')\n .map((line) => ` ${line}`)\n .join('\\n');\n })\n .join('\\n');\n\n result += `${membersStr}\\n`;\n\n result += `}`;\n\n return result;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n members: this.members.map((member) => member.toObject()),\n doc: this.doc?.toObject(),\n signature: this.signature,\n typeParams: this.typeParams,\n extendsNodes: this.extendsNodes?.map((node) => node.toObject()),\n implementNodes: this.implementNodes?.map((node) => node.toObject()),\n decorators: this.decorators?.map((decorator) => decorator.toObject()),\n };\n }\n\n static fromObject(obj: Record<string, any>): ClassSchema {\n const name = obj.name;\n const members = obj.members.map((member: any) => SchemaRegistry.fromObject(member));\n const location = obj.location;\n const signature = obj.signature;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n const typeParams = obj.typeParams;\n const extendsNodes = obj.extendsNodes?.map((node: any) => ExpressionWithTypeArgumentsSchema.fromObject(node));\n const implementNodes = obj.implementNodes?.map((node: any) => ExpressionWithTypeArgumentsSchema.fromObject(node));\n const decorators = obj.decorators?.map((decorator: any) => SchemaRegistry.fromObject(decorator));\n return new ClassSchema(\n name,\n members,\n location,\n signature,\n doc,\n typeParams,\n extendsNodes,\n implementNodes,\n decorators\n );\n }\n\n static fromSchema(node: ClassSchema, memberTransformer: (_node: SchemaNode) => SchemaNode = (_node) => _node) {\n return new ClassSchema(\n node.name,\n node.members.map(memberTransformer),\n node.location,\n node.signature,\n node.doc,\n node.typeParams,\n node.extendsNodes,\n node.implementNodes,\n node.decorators\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,yBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,wBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoD,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7C,MAAMG,WAAW,SAASC,wBAAU,CAAC;EAI1CC,WAAWA,CACAC,IAAY,EACrBC,OAAqB,EACZC,QAAwB,EACxBC,SAAiB,EAC1BC,GAAe,EACNC,UAAqB,EACrBC,YAAkD,EAClDC,cAAoD,EACpDC,UAAyB,EAClC;IACA,KAAK,CAAC,CAAC;IAAC,KAVCR,IAAY,GAAZA,IAAY;IAAA,KAEZE,QAAwB,GAAxBA,QAAwB;IAAA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AS,CAACH,UAAU,CAACC,GAAG,CAAClC,GAAG,CAAC,GAAGqC,SAAS;IAC/D,MAAMpC,UAAU,GAAGiC,GAAG,CAACjC,UAAU;IACjC,MAAMC,YAAY,GAAGgC,GAAG,CAAChC,YAAY,EAAEa,GAAG,CAAEW,IAAS,IAAKY,4DAAiC,CAACL,UAAU,CAACP,IAAI,CAAC,CAAC;IAC7G,MAAMvB,cAAc,GAAG+B,GAAG,CAAC/B,cAAc,EAAEY,GAAG,CAAEW,IAAS,IAAKY,4DAAiC,CAACL,UAAU,CAACP,IAAI,CAAC,CAAC;IACjH,MAAMtB,UAAU,GAAG8B,GAAG,CAAC9B,UAAU,EAAEW,GAAG,CAAEI,SAAc,IAAKgB,gCAAc,CAACF,UAAU,CAACd,SAAS,CAAC,CAAC;IAChG,OAAO,IAAI1B,WAAW,CACpBG,IAAI,EACJC,OAAO,EACPC,QAAQ,EACRC,SAAS,EACTC,GAAG,EACHC,UAAU,EACVC,YAAY,EACZC,cAAc,EACdC,UACF,CAAC;EACH;EAEA,OAAOmC,UAAUA,CAACb,IAAiB,EAAEc,iBAAoD,GAAIC,KAAK,IAAKA,KAAK,EAAE;IAC5G,OAAO,IAAIhD,WAAW,CACpBiC,IAAI,CAAC9B,IAAI,EACT8B,IAAI,CAAC7B,OAAO,CAACkB,GAAG,CAACyB,iBAAiB,CAAC,EACnCd,IAAI,CAAC5B,QAAQ,EACb4B,IAAI,CAAC3B,SAAS,EACd2B,IAAI,CAAC1B,GAAG,EACR0B,IAAI,CAACzB,UAAU,EACfyB,IAAI,CAACxB,YAAY,EACjBwB,IAAI,CAACvB,cAAc,EACnBuB,IAAI,CAACtB,UACP,CAAC;EACH;AACF;AAACsC,OAAA,CAAAjD,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_schemaDiffMembers","_docs","_expressionWithArguments","_schemaRegistry","e","__esModule","default","ClassSchema","SchemaNode","constructor","name","members","location","signature","doc","typeParams","extendsNodes","implementNodes","decorators","getNodes","toString","options","boldUnderline","color","chalk","bold","underline","str","membersStr","map","m","join","decoratorsStr","decorator","toFullSignature","result","showDocs","classDeclaration","length","extendsStr","node","implementsStr","member","memberStr","split","line","toObject","fromObject","obj","SchemaRegistry","DocSchema","undefined","ExpressionWithTypeArgumentsSchema","diff","other","diffMembers","fromSchema","memberTransformer","_node","exports"],"sources":["class.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { SchemaLocation } from '../schema-node';\nimport { SchemaNode } from '../schema-node';\nimport type { SchemaChangeFact } from '../schema-diff';\nimport { diffMembers } from '../schema-diff-members';\nimport { DocSchema } from './docs';\nimport { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport class ClassSchema extends SchemaNode {\n readonly members: SchemaNode[];\n readonly doc?: DocSchema;\n\n constructor(\n readonly name: string,\n members: SchemaNode[],\n readonly location: SchemaLocation,\n readonly signature: string,\n doc?: DocSchema,\n readonly typeParams?: string[],\n readonly extendsNodes?: ExpressionWithTypeArgumentsSchema[],\n readonly implementNodes?: ExpressionWithTypeArgumentsSchema[],\n readonly decorators?: SchemaNode[]\n ) {\n super();\n this.members = members;\n this.doc = doc;\n }\n\n getNodes() {\n return this.members;\n }\n\n toString(options?: { color?: boolean }): string {\n const boldUnderline = options?.color ? chalk.bold.underline : (str: string) => str;\n const membersStr = this.members.map((m) => `* ${m.toString(options)}`).join('\\n');\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toString(options)).join('\\n');\n return `${this.decorators ? `${decoratorsStr}\\n` : ''}${boldUnderline(this.name)}\\n${membersStr}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toFullSignature(options)).join('\\n');\n if (decoratorsStr) {\n result += `${decoratorsStr}\\n`;\n }\n\n let classDeclaration = `class ${this.name}`;\n\n if (this.typeParams && this.typeParams.length > 0) {\n classDeclaration += `<${this.typeParams.join(', ')}>`;\n }\n\n if (this.extendsNodes && this.extendsNodes.length > 0) {\n const extendsStr = this.extendsNodes.map((node) => node.toFullSignature(options)).join(', ');\n classDeclaration += ` extends ${extendsStr}`;\n }\n\n if (this.implementNodes && this.implementNodes.length > 0) {\n const implementsStr = this.implementNodes.map((node) => node.toFullSignature(options)).join(', ');\n classDeclaration += ` implements ${implementsStr}`;\n }\n\n result += `${classDeclaration} {\\n`;\n\n const membersStr = this.members\n .map((member) => {\n const memberStr = member.toFullSignature(options);\n return memberStr\n .split('\\n')\n .map((line) => ` ${line}`)\n .join('\\n');\n })\n .join('\\n');\n\n result += `${membersStr}\\n`;\n\n result += `}`;\n\n return result;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n members: this.members.map((member) => member.toObject()),\n doc: this.doc?.toObject(),\n signature: this.signature,\n typeParams: this.typeParams,\n extendsNodes: this.extendsNodes?.map((node) => node.toObject()),\n implementNodes: this.implementNodes?.map((node) => node.toObject()),\n decorators: this.decorators?.map((decorator) => decorator.toObject()),\n };\n }\n\n static fromObject(obj: Record<string, any>): ClassSchema {\n const name = obj.name;\n const members = obj.members.map((member: any) => SchemaRegistry.fromObject(member));\n const location = obj.location;\n const signature = obj.signature;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n const typeParams = obj.typeParams;\n const extendsNodes = obj.extendsNodes?.map((node: any) => ExpressionWithTypeArgumentsSchema.fromObject(node));\n const implementNodes = obj.implementNodes?.map((node: any) => ExpressionWithTypeArgumentsSchema.fromObject(node));\n const decorators = obj.decorators?.map((decorator: any) => SchemaRegistry.fromObject(decorator));\n return new ClassSchema(\n name,\n members,\n location,\n signature,\n doc,\n typeParams,\n extendsNodes,\n implementNodes,\n decorators\n );\n }\n\n diff(other: SchemaNode): SchemaChangeFact[] {\n if (!(other instanceof ClassSchema)) return super.diff(other);\n return diffMembers(this.toObject(), other.toObject(), this, other);\n }\n\n static fromSchema(node: ClassSchema, memberTransformer: (_node: SchemaNode) => SchemaNode = (_node) => _node) {\n return new ClassSchema(\n node.name,\n node.members.map(memberTransformer),\n node.location,\n node.signature,\n node.doc,\n node.typeParams,\n node.extendsNodes,\n node.implementNodes,\n node.decorators\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,yBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,wBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,gBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,eAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoD,SAAAC,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7C,MAAMG,WAAW,SAASC,wBAAU,CAAC;EAI1CC,WAAWA,CACAC,IAAY,EACrBC,OAAqB,EACZC,QAAwB,EAC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B,IAAI,EACT8B,IAAI,CAAC7B,OAAO,CAACkB,GAAG,CAAC4B,iBAAiB,CAAC,EACnCjB,IAAI,CAAC5B,QAAQ,EACb4B,IAAI,CAAC3B,SAAS,EACd2B,IAAI,CAAC1B,GAAG,EACR0B,IAAI,CAACzB,UAAU,EACfyB,IAAI,CAACxB,YAAY,EACjBwB,IAAI,CAACvB,cAAc,EACnBuB,IAAI,CAACtB,UACP,CAAC;EACH;AACF;AAACyC,OAAA,CAAApD,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import type { SchemaLocation } from '../schema-node';
2
2
  import { SchemaNode } from '../schema-node';
3
+ import type { SchemaChangeFact } from '../schema-diff';
3
4
  import { DocSchema } from './docs';
4
5
  export declare class EnumSchema extends SchemaNode {
5
6
  readonly location: SchemaLocation;
@@ -34,5 +35,6 @@ export declare class EnumSchema extends SchemaNode {
34
35
  } | undefined;
35
36
  signature: string;
36
37
  };
38
+ diff(other: SchemaNode): SchemaChangeFact[];
37
39
  static fromObject(obj: Record<string, any>): EnumSchema;
38
40
  }
@@ -18,6 +18,13 @@ function _schemaNode() {
18
18
  };
19
19
  return data;
20
20
  }
21
+ function _schemaDiff() {
22
+ const data = require("../schema-diff");
23
+ _schemaDiff = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
21
28
  function _docs() {
22
29
  const data = require("./docs");
23
30
  _docs = function () {
@@ -73,6 +80,54 @@ class EnumSchema extends _schemaNode().SchemaNode {
73
80
  signature: this.signature
74
81
  };
75
82
  }
83
+ diff(other) {
84
+ if (!(other instanceof EnumSchema)) return super.diff(other);
85
+ const facts = [];
86
+ const baseMembers = this.toObject().members || [];
87
+ const compareMembers = other.toObject().members || [];
88
+ const baseMap = new Map(baseMembers.map(m => [m.name || '', m]));
89
+ const compareMap = new Map(compareMembers.map(m => [m.name || '', m]));
90
+ for (const [name, member] of compareMap) {
91
+ if (!baseMap.has(name)) {
92
+ facts.push({
93
+ changeKind: 'enum-member-added',
94
+ description: `enum member '${name}' added`,
95
+ context: {
96
+ memberName: name
97
+ },
98
+ to: member.signature || name
99
+ });
100
+ }
101
+ }
102
+ for (const [name, member] of baseMap) {
103
+ if (!compareMap.has(name)) {
104
+ facts.push({
105
+ changeKind: 'enum-member-removed',
106
+ description: `enum member '${name}' removed`,
107
+ context: {
108
+ memberName: name
109
+ },
110
+ from: member.signature || name
111
+ });
112
+ }
113
+ }
114
+ for (const [name, bm] of baseMap) {
115
+ const cm = compareMap.get(name);
116
+ if (cm && !(0, _schemaDiff().deepEqualNoLocation)(bm, cm)) {
117
+ facts.push({
118
+ changeKind: 'enum-member-value-changed',
119
+ description: `enum member '${name}' value changed`,
120
+ context: {
121
+ memberName: name
122
+ },
123
+ from: bm.signature || name,
124
+ to: cm.signature || name
125
+ });
126
+ }
127
+ }
128
+ facts.push(...(0, _schemaDiff().diffDoc)(this.doc?.toObject(), other.doc?.toObject()));
129
+ return facts;
130
+ }
76
131
  static fromObject(obj) {
77
132
  const location = obj.location;
78
133
  const name = obj.name;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_docs","_","e","__esModule","default","EnumSchema","SchemaNode","constructor","location","name","members","signature","doc","getNodes","toString","options","boldUnderline","color","chalk","bold","underline","str","membersStr","map","m","join","toFullSignature","result","showDocs","member","memberStr","toObject","fromObject","obj","SchemaRegistry","DocSchema","undefined","exports"],"sources":["enum.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { SchemaLocation } from '../schema-node';\nimport { SchemaNode } from '../schema-node';\nimport { DocSchema } from './docs';\nimport { SchemaRegistry } from '..';\n\nexport class EnumSchema extends SchemaNode {\n readonly doc?: DocSchema;\n readonly members: SchemaNode[];\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n members: SchemaNode[],\n readonly signature: string,\n doc?: DocSchema\n ) {\n super();\n this.doc = doc;\n this.members = members;\n }\n\n getNodes() {\n return this.members;\n }\n\n toString(options) {\n const boldUnderline = options?.color ? chalk.bold.underline : (str: string) => str;\n const membersStr = this.members.map((m) => `* ${m.toString(options)}`).join('\\n');\n return `${boldUnderline(this.name)}\\n${membersStr}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n\n result += `enum ${this.name} {\\n`;\n\n const membersStr = this.members\n .map((member) => {\n const memberStr = member.toFullSignature(options);\n return ` ${memberStr}`;\n })\n .join(',\\n');\n\n result += `${membersStr}\\n`;\n\n result += `}`;\n\n return result;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n members: this.members.map((member) => member.toObject()),\n doc: this.doc?.toObject(),\n signature: this.signature,\n };\n }\n\n static fromObject(obj: Record<string, any>): EnumSchema {\n const location = obj.location;\n const name = obj.name;\n const members = obj.members.map((member: any) => SchemaRegistry.fromObject(member));\n const signature = obj.signature;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n return new EnumSchema(location, name, members, signature, doc);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,EAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,CAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoC,SAAAC,uBAAAK,CAAA,WA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AAM,CAACH,eAAe,CAACX,OAAO,CAAC;MACjD,OAAO,KAAKe,SAAS,EAAE;IACzB,CAAC,CAAC,CACDL,IAAI,CAAC,KAAK,CAAC;IAEdE,MAAM,IAAI,GAAGL,UAAU,IAAI;IAE3BK,MAAM,IAAI,GAAG;IAEb,OAAOA,MAAM;EACf;EAEAI,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBtB,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACa,GAAG,CAAEM,MAAM,IAAKA,MAAM,CAACE,QAAQ,CAAC,CAAC,CAAC;MACxDnB,GAAG,EAAE,IAAI,CAACA,GAAG,EAAEmB,QAAQ,CAAC,CAAC;MACzBpB,SAAS,EAAE,IAAI,CAACA;IAClB,CAAC;EACH;EAEA,OAAOqB,UAAUA,CAACC,GAAwB,EAAc;IACtD,MAAMzB,QAAQ,GAAGyB,GAAG,CAACzB,QAAQ;IAC7B,MAAMC,IAAI,GAAGwB,GAAG,CAACxB,IAAI;IACrB,MAAMC,OAAO,GAAGuB,GAAG,CAACvB,OAAO,CAACa,GAAG,CAAEM,MAAW,IAAKK,kBAAc,CAACF,UAAU,CAACH,MAAM,CAAC,CAAC;IACnF,MAAMlB,SAAS,GAAGsB,GAAG,CAACtB,SAAS;IAC/B,MAAMC,GAAG,GAAGqB,GAAG,CAACrB,GAAG,GAAGuB,iBAAS,CAACH,UAAU,CAACC,GAAG,CAACrB,GAAG,CAAC,GAAGwB,SAAS;IAC/D,OAAO,IAAI/B,UAAU,CAACG,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,GAAG,CAAC;EAChE;AACF;AAACyB,OAAA,CAAAhC,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_schemaDiff","_docs","_","e","__esModule","default","EnumSchema","SchemaNode","constructor","location","name","members","signature","doc","getNodes","toString","options","boldUnderline","color","chalk","bold","underline","str","membersStr","map","m","join","toFullSignature","result","showDocs","member","memberStr","toObject","diff","other","facts","baseMembers","compareMembers","baseMap","Map","compareMap","has","push","changeKind","description","context","memberName","to","from","bm","cm","get","deepEqualNoLocation","diffDoc","fromObject","obj","SchemaRegistry","DocSchema","undefined","exports"],"sources":["enum.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { SchemaLocation } from '../schema-node';\nimport { SchemaNode } from '../schema-node';\nimport type { SchemaChangeFact } from '../schema-diff';\nimport { deepEqualNoLocation, diffDoc } from '../schema-diff';\nimport { DocSchema } from './docs';\nimport { SchemaRegistry } from '..';\n\nexport class EnumSchema extends SchemaNode {\n readonly doc?: DocSchema;\n readonly members: SchemaNode[];\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n members: SchemaNode[],\n readonly signature: string,\n doc?: DocSchema\n ) {\n super();\n this.doc = doc;\n this.members = members;\n }\n\n getNodes() {\n return this.members;\n }\n\n toString(options) {\n const boldUnderline = options?.color ? chalk.bold.underline : (str: string) => str;\n const membersStr = this.members.map((m) => `* ${m.toString(options)}`).join('\\n');\n return `${boldUnderline(this.name)}\\n${membersStr}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n\n result += `enum ${this.name} {\\n`;\n\n const membersStr = this.members\n .map((member) => {\n const memberStr = member.toFullSignature(options);\n return ` ${memberStr}`;\n })\n .join(',\\n');\n\n result += `${membersStr}\\n`;\n\n result += `}`;\n\n return result;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n members: this.members.map((member) => member.toObject()),\n doc: this.doc?.toObject(),\n signature: this.signature,\n };\n }\n\n diff(other: SchemaNode): SchemaChangeFact[] {\n if (!(other instanceof EnumSchema)) return super.diff(other);\n const facts: SchemaChangeFact[] = [];\n const baseMembers: Record<string, any>[] = this.toObject().members || [];\n const compareMembers: Record<string, any>[] = other.toObject().members || [];\n const baseMap = new Map(baseMembers.map((m) => [m.name || '', m]));\n const compareMap = new Map(compareMembers.map((m) => [m.name || '', m]));\n\n for (const [name, member] of compareMap) {\n if (!baseMap.has(name)) {\n facts.push({\n changeKind: 'enum-member-added',\n description: `enum member '${name}' added`,\n context: { memberName: name },\n to: member.signature || name,\n });\n }\n }\n for (const [name, member] of baseMap) {\n if (!compareMap.has(name)) {\n facts.push({\n changeKind: 'enum-member-removed',\n description: `enum member '${name}' removed`,\n context: { memberName: name },\n from: member.signature || name,\n });\n }\n }\n for (const [name, bm] of baseMap) {\n const cm = compareMap.get(name);\n if (cm && !deepEqualNoLocation(bm, cm)) {\n facts.push({\n changeKind: 'enum-member-value-changed',\n description: `enum member '${name}' value changed`,\n context: { memberName: name },\n from: bm.signature || name,\n to: cm.signature || name,\n });\n }\n }\n facts.push(...diffDoc(this.doc?.toObject(), other.doc?.toObject()));\n return facts;\n }\n\n static fromObject(obj: Record<string, any>): EnumSchema {\n const location = obj.location;\n const name = obj.name;\n const members = obj.members.map((member: any) => SchemaRegistry.fromObject(member));\n const signature = obj.signature;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n return new EnumSchema(location, name, members, signature, doc);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,M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B;UACvCC,WAAW,EAAE,gBAAgBlC,IAAI,iBAAiB;UAClDmC,OAAO,EAAE;YAAEC,UAAU,EAAEpC;UAAK,CAAC;UAC7BsC,IAAI,EAAEC,EAAE,CAACrC,SAAS,IAAIF,IAAI;UAC1BqC,EAAE,EAAEG,EAAE,CAACtC,SAAS,IAAIF;QACtB,CAAC,CAAC;MACJ;IACF;IACAyB,KAAK,CAACO,IAAI,CAAC,GAAG,IAAAW,qBAAO,EAAC,IAAI,CAACxC,GAAG,EAAEmB,QAAQ,CAAC,CAAC,EAAEE,KAAK,CAACrB,GAAG,EAAEmB,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnE,OAAOG,KAAK;EACd;EAEA,OAAOmB,UAAUA,CAACC,GAAwB,EAAc;IACtD,MAAM9C,QAAQ,GAAG8C,GAAG,CAAC9C,QAAQ;IAC7B,MAAMC,IAAI,GAAG6C,GAAG,CAAC7C,IAAI;IACrB,MAAMC,OAAO,GAAG4C,GAAG,CAAC5C,OAAO,CAACa,GAAG,CAAEM,MAAW,IAAK0B,kBAAc,CAACF,UAAU,CAACxB,MAAM,CAAC,CAAC;IACnF,MAAMlB,SAAS,GAAG2C,GAAG,CAAC3C,SAAS;IAC/B,MAAMC,GAAG,GAAG0C,GAAG,CAAC1C,GAAG,GAAG4C,iBAAS,CAACH,UAAU,CAACC,GAAG,CAAC1C,GAAG,CAAC,GAAG6C,SAAS;IAC/D,OAAO,IAAIpD,UAAU,CAACG,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,GAAG,CAAC;EAChE;AACF;AAAC8C,OAAA,CAAArD,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import type { SchemaLocation } from '../schema-node';
2
2
  import { SchemaNode } from '../schema-node';
3
+ import type { SchemaChangeFact } from '../schema-diff';
3
4
  import { ParameterSchema } from './parameter';
4
5
  import { DocSchema } from './docs';
5
6
  export type Modifier = 'static' | 'public' | 'private' | 'protected' | 'readonly' | 'abstract' | 'async' | 'override' | 'export';
@@ -63,5 +64,13 @@ export declare class FunctionLikeSchema extends SchemaNode {
63
64
  decorators: Record<string, any>[] | undefined;
64
65
  };
65
66
  static fromObject(obj: Record<string, any>): FunctionLikeSchema;
67
+ diff(other: SchemaNode): SchemaChangeFact[];
68
+ private static diffModifiers;
69
+ private static diffParams;
70
+ private static diffOverlappingParam;
71
+ private static diffParamOptionality;
72
+ private static diffParamDefault;
73
+ private static diffDestructuredParam;
74
+ private static diffBindingDefault;
66
75
  private modifiersToString;
67
76
  }
@@ -18,6 +18,13 @@ function _schemaNode() {
18
18
  };
19
19
  return data;
20
20
  }
21
+ function _schemaDiff() {
22
+ const data = require("../schema-diff");
23
+ _schemaDiff = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
21
28
  function _parameter() {
22
29
  const data = require("./parameter");
23
30
  _parameter = function () {
@@ -137,6 +144,299 @@ class FunctionLikeSchema extends _schemaNode().SchemaNode {
137
144
  static fromObject(obj) {
138
145
  return new FunctionLikeSchema(obj.location, obj.name, obj.params.map(param => _parameter().ParameterSchema.fromObject(param)), _schemaRegistry().SchemaRegistry.fromObject(obj.returnType), obj.signature, obj.modifiers, obj.doc ? _docs().DocSchema.fromObject(obj.doc) : undefined, obj.typeParams, obj.decorators?.map(decorator => _schemaRegistry().SchemaRegistry.fromObject(decorator)));
139
146
  }
147
+ diff(other) {
148
+ if (!(other instanceof FunctionLikeSchema)) return super.diff(other);
149
+ const facts = [];
150
+ const baseObj = this.toObject();
151
+ const compareObj = other.toObject();
152
+ FunctionLikeSchema.diffParams(baseObj.params || [], compareObj.params || [], facts);
153
+ if (!(0, _schemaDiff().typesAreSemanticallyEqual)(baseObj.returnType, compareObj.returnType)) {
154
+ const fromType = (0, _schemaDiff().typeStr)(baseObj.returnType);
155
+ const toType = (0, _schemaDiff().typeStr)(compareObj.returnType);
156
+ facts.push({
157
+ changeKind: 'return-type-changed',
158
+ description: `return type changed: ${fromType} → ${toType}`,
159
+ context: {
160
+ fromType,
161
+ toType,
162
+ position: 'return-type'
163
+ },
164
+ from: fromType,
165
+ to: toType
166
+ });
167
+ }
168
+ if (!(0, _schemaDiff().deepEqualNoLocation)(baseObj.typeParams, compareObj.typeParams)) {
169
+ facts.push({
170
+ changeKind: 'type-parameters-changed',
171
+ description: `type parameters changed: <${(baseObj.typeParams || []).join(', ') || 'none'}> → <${(compareObj.typeParams || []).join(', ') || 'none'}>`,
172
+ context: {
173
+ from: (baseObj.typeParams || []).join(', '),
174
+ to: (compareObj.typeParams || []).join(', ')
175
+ },
176
+ from: (baseObj.typeParams || []).join(', '),
177
+ to: (compareObj.typeParams || []).join(', ')
178
+ });
179
+ }
180
+ FunctionLikeSchema.diffModifiers(this.modifiers || [], other.modifiers || [], facts);
181
+ facts.push(...(0, _schemaDiff().diffDoc)(baseObj.doc, compareObj.doc));
182
+ return facts;
183
+ }
184
+ static diffModifiers(baseMods, compareMods, facts) {
185
+ const base = baseMods.filter(m => m !== 'export');
186
+ const compare = compareMods.filter(m => m !== 'export');
187
+ if ((0, _schemaDiff().deepEqualNoLocation)(base, compare)) return;
188
+ const added = compare.filter(m => !base.includes(m));
189
+ const removed = base.filter(m => !compare.includes(m));
190
+ const parts = [];
191
+ if (added.length) parts.push(`added: ${added.join(', ')}`);
192
+ if (removed.length) parts.push(`removed: ${removed.join(', ')}`);
193
+ const accessNarrowed = removed.includes('public') || added.includes('private') || added.includes('protected');
194
+ facts.push({
195
+ changeKind: accessNarrowed ? 'access-narrowed' : 'modifiers-changed',
196
+ description: `modifiers changed (${parts.join('; ')})`,
197
+ context: {
198
+ added,
199
+ removed,
200
+ accessNarrowed
201
+ },
202
+ from: base.join(', ') || 'none',
203
+ to: compare.join(', ') || 'none'
204
+ });
205
+ }
206
+ static diffParams(baseParams, compareParams, facts) {
207
+ for (const p of compareParams.slice(baseParams.length)) {
208
+ const isOpt = p.isOptional || p.defaultValue !== undefined;
209
+ facts.push({
210
+ changeKind: 'parameter-added',
211
+ description: `parameter '${p.name}: ${(0, _schemaDiff().typeStr)(p.type)}' added${isOpt ? ' (optional)' : ' (required)'}`,
212
+ context: {
213
+ paramName: p.name,
214
+ isOptional: !!p.isOptional,
215
+ hasDefault: p.defaultValue !== undefined,
216
+ paramType: (0, _schemaDiff().typeStr)(p.type)
217
+ },
218
+ to: `${p.name}${p.isOptional ? '?' : ''}: ${(0, _schemaDiff().typeStr)(p.type)}`
219
+ });
220
+ }
221
+ for (const p of baseParams.slice(compareParams.length)) {
222
+ facts.push({
223
+ changeKind: 'parameter-removed',
224
+ description: `parameter '${p.name}: ${(0, _schemaDiff().typeStr)(p.type)}' removed`,
225
+ context: {
226
+ paramName: p.name,
227
+ isOptional: !!p.isOptional,
228
+ paramType: (0, _schemaDiff().typeStr)(p.type)
229
+ },
230
+ from: `${p.name}${p.isOptional ? '?' : ''}: ${(0, _schemaDiff().typeStr)(p.type)}`
231
+ });
232
+ }
233
+ const minLen = Math.min(baseParams.length, compareParams.length);
234
+ for (let i = 0; i < minLen; i++) {
235
+ FunctionLikeSchema.diffOverlappingParam(baseParams[i], compareParams[i], i, facts);
236
+ }
237
+ }
238
+ static diffOverlappingParam(bp, cp, index, facts) {
239
+ if (bp.objectBindingNodes || cp.objectBindingNodes) {
240
+ FunctionLikeSchema.diffDestructuredParam(bp, cp, facts);
241
+ if (!(0, _schemaDiff().typesAreSemanticallyEqual)(bp.type, cp.type)) {
242
+ const paramName = cp.name || bp.name;
243
+ facts.push({
244
+ changeKind: 'parameter-type-changed',
245
+ description: `parameter at position ${index} type changed: ${(0, _schemaDiff().typeStr)(bp.type)} → ${(0, _schemaDiff().typeStr)(cp.type)}`,
246
+ context: {
247
+ paramName,
248
+ fromType: (0, _schemaDiff().typeStr)(bp.type),
249
+ toType: (0, _schemaDiff().typeStr)(cp.type),
250
+ position: 'parameter'
251
+ },
252
+ from: (0, _schemaDiff().typeStr)(bp.type),
253
+ to: (0, _schemaDiff().typeStr)(cp.type)
254
+ });
255
+ }
256
+ return;
257
+ }
258
+ const nameEqual = bp.name === cp.name;
259
+ const typeEqual = (0, _schemaDiff().typesAreSemanticallyEqual)(bp.type, cp.type);
260
+ if (nameEqual && typeEqual && bp.isOptional === cp.isOptional && bp.defaultValue === cp.defaultValue) return;
261
+ const paramName = cp.name || bp.name;
262
+ if (!nameEqual) {
263
+ facts.push({
264
+ changeKind: 'parameter-renamed',
265
+ description: `parameter at position ${index} renamed: '${bp.name}' → '${cp.name}'`,
266
+ context: {
267
+ fromName: bp.name,
268
+ toName: cp.name,
269
+ position: index
270
+ },
271
+ from: bp.name,
272
+ to: cp.name
273
+ });
274
+ }
275
+ if (!typeEqual) {
276
+ facts.push({
277
+ changeKind: 'parameter-type-changed',
278
+ description: `parameter '${paramName}' type changed: ${(0, _schemaDiff().typeStr)(bp.type)} → ${(0, _schemaDiff().typeStr)(cp.type)}`,
279
+ context: {
280
+ paramName,
281
+ fromType: (0, _schemaDiff().typeStr)(bp.type),
282
+ toType: (0, _schemaDiff().typeStr)(cp.type),
283
+ position: 'parameter'
284
+ },
285
+ from: (0, _schemaDiff().typeStr)(bp.type),
286
+ to: (0, _schemaDiff().typeStr)(cp.type)
287
+ });
288
+ }
289
+ FunctionLikeSchema.diffParamOptionality(bp, cp, paramName, facts);
290
+ FunctionLikeSchema.diffParamDefault(bp, cp, paramName, facts);
291
+ }
292
+ static diffParamOptionality(bp, cp, paramName, facts) {
293
+ if (bp.isOptional && !cp.isOptional) {
294
+ facts.push({
295
+ changeKind: 'became-required',
296
+ description: `parameter '${paramName}' became required (was optional)`,
297
+ context: {
298
+ paramName,
299
+ position: 'parameter'
300
+ },
301
+ from: 'optional',
302
+ to: 'required'
303
+ });
304
+ } else if (!bp.isOptional && cp.isOptional) {
305
+ facts.push({
306
+ changeKind: 'became-optional',
307
+ description: `parameter '${paramName}' became optional (was required)`,
308
+ context: {
309
+ paramName,
310
+ position: 'parameter'
311
+ },
312
+ from: 'required',
313
+ to: 'optional'
314
+ });
315
+ }
316
+ }
317
+ static diffParamDefault(bp, cp, paramName, facts) {
318
+ if (bp.defaultValue === cp.defaultValue) return;
319
+ if (bp.defaultValue !== undefined && cp.defaultValue === undefined) {
320
+ facts.push({
321
+ changeKind: 'parameter-default-removed',
322
+ description: `parameter '${paramName}' default value removed (was: ${bp.defaultValue})`,
323
+ context: {
324
+ paramName,
325
+ isOptional: !!bp.isOptional,
326
+ previousDefault: String(bp.defaultValue)
327
+ },
328
+ from: String(bp.defaultValue)
329
+ });
330
+ } else if (bp.defaultValue === undefined && cp.defaultValue !== undefined) {
331
+ facts.push({
332
+ changeKind: 'parameter-default-added',
333
+ description: `parameter '${paramName}' default value added: ${cp.defaultValue}`,
334
+ context: {
335
+ paramName,
336
+ newDefault: String(cp.defaultValue)
337
+ },
338
+ to: String(cp.defaultValue)
339
+ });
340
+ } else {
341
+ facts.push({
342
+ changeKind: 'parameter-default-changed',
343
+ description: `parameter '${paramName}' default value changed: ${bp.defaultValue} → ${cp.defaultValue}`,
344
+ context: {
345
+ paramName,
346
+ previousDefault: String(bp.defaultValue),
347
+ newDefault: String(cp.defaultValue)
348
+ },
349
+ from: String(bp.defaultValue),
350
+ to: String(cp.defaultValue)
351
+ });
352
+ }
353
+ }
354
+ static diffDestructuredParam(base, compare, facts) {
355
+ const baseBindings = base.objectBindingNodes || [];
356
+ const compareBindings = compare.objectBindingNodes || [];
357
+ const baseMap = new Map(baseBindings.map(b => [b.name || '', b]));
358
+ const compareMap = new Map(compareBindings.map(b => [b.name || '', b]));
359
+ for (const [name] of compareMap) {
360
+ if (!baseMap.has(name)) {
361
+ facts.push({
362
+ changeKind: 'destructured-property-added',
363
+ description: `destructured property '${name}' added`,
364
+ context: {
365
+ propertyName: name
366
+ },
367
+ to: name
368
+ });
369
+ }
370
+ }
371
+ for (const [name] of baseMap) {
372
+ if (!compareMap.has(name)) {
373
+ facts.push({
374
+ changeKind: 'destructured-property-removed',
375
+ description: `destructured property '${name}' removed`,
376
+ context: {
377
+ propertyName: name
378
+ },
379
+ from: name
380
+ });
381
+ }
382
+ }
383
+ for (const [name, bb] of baseMap) {
384
+ const cb = compareMap.get(name);
385
+ if (!cb) continue;
386
+ FunctionLikeSchema.diffBindingDefault(name, bb, cb, !!base.isOptional, facts);
387
+ if (bb.type && cb.type && !(0, _schemaDiff().typesAreSemanticallyEqual)(bb.type, cb.type)) {
388
+ facts.push({
389
+ changeKind: 'destructured-property-type-changed',
390
+ description: `destructured property '${name}' type changed: ${(0, _schemaDiff().typeStr)(bb.type)} → ${(0, _schemaDiff().typeStr)(cb.type)}`,
391
+ context: {
392
+ propertyName: name,
393
+ fromType: (0, _schemaDiff().typeStr)(bb.type),
394
+ toType: (0, _schemaDiff().typeStr)(cb.type),
395
+ position: 'parameter'
396
+ },
397
+ from: (0, _schemaDiff().typeStr)(bb.type),
398
+ to: (0, _schemaDiff().typeStr)(cb.type)
399
+ });
400
+ }
401
+ }
402
+ }
403
+ static diffBindingDefault(name, bb, cb, parentIsOptional, facts) {
404
+ if (bb.defaultValue === cb.defaultValue) return;
405
+ if (bb.defaultValue !== undefined && cb.defaultValue === undefined) {
406
+ facts.push({
407
+ changeKind: 'destructured-property-default-removed',
408
+ description: `destructured property '${name}' default value removed (was: ${bb.defaultValue})`,
409
+ context: {
410
+ propertyName: name,
411
+ isOptional: parentIsOptional,
412
+ previousDefault: String(bb.defaultValue)
413
+ },
414
+ from: String(bb.defaultValue)
415
+ });
416
+ } else if (bb.defaultValue === undefined && cb.defaultValue !== undefined) {
417
+ facts.push({
418
+ changeKind: 'destructured-property-default-added',
419
+ description: `destructured property '${name}' default value added: ${cb.defaultValue}`,
420
+ context: {
421
+ propertyName: name,
422
+ newDefault: String(cb.defaultValue)
423
+ },
424
+ to: String(cb.defaultValue)
425
+ });
426
+ } else {
427
+ facts.push({
428
+ changeKind: 'destructured-property-default-changed',
429
+ description: `destructured property '${name}' default value changed: ${bb.defaultValue} → ${cb.defaultValue}`,
430
+ context: {
431
+ propertyName: name,
432
+ previousDefault: String(bb.defaultValue),
433
+ newDefault: String(cb.defaultValue)
434
+ },
435
+ from: String(bb.defaultValue),
436
+ to: String(cb.defaultValue)
437
+ });
438
+ }
439
+ }
140
440
  modifiersToString() {
141
441
  const modifiersToPrint = this.modifiers.filter(modifier => modifier !== 'export');
142
442
  return modifiersToPrint.length ? `${modifiersToPrint.join(' ')} ` : '';
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_parameter","_docs","_tag","_schemaRegistry","e","__esModule","default","FunctionLikeSchema","SchemaNode","displaySchemaName","constructor","location","name","params","returnType","signature","modifiers","doc","typeParams","decorators","createSignature","getNodes","toString","options","bold","color","chalk","text","paramsStr","map","param","join","typeParamsStr","decoratorsStr","decorator","modifiersToString","toFullSignature","result","showDocs","modifiersStr","paramStr","isSpread","isOptional","type","defaultValue","undefined","isDeprecated","Boolean","hasTag","TagName","deprecated","isPrivate","find","m","private","generateSignature","toObject","fromObject","obj","ParameterSchema","SchemaRegistry","DocSchema","modifiersToPrint","filter","modifier","length","exports"],"sources":["function-like.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { SchemaLocation } from '../schema-node';\nimport { SchemaNode } from '../schema-node';\nimport { ParameterSchema } from './parameter';\nimport { DocSchema } from './docs';\nimport { TagName } from './docs/tag';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport type Modifier =\n | 'static'\n | 'public'\n | 'private'\n | 'protected'\n | 'readonly'\n | 'abstract'\n | 'async'\n | 'override'\n | 'export';\n\n/**\n * function-like can be a function, method, arrow-function, variable-function, etc.\n */\nexport class FunctionLikeSchema extends SchemaNode {\n readonly returnType: SchemaNode;\n readonly params: ParameterSchema[];\n readonly doc?: DocSchema;\n readonly signature?: string | undefined;\n readonly displaySchemaName = 'Functions';\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n params: ParameterSchema[],\n returnType: SchemaNode,\n signature: string,\n readonly modifiers: Modifier[] = [],\n doc?: DocSchema,\n readonly typeParams?: string[],\n readonly decorators?: SchemaNode[]\n ) {\n super();\n this.params = params;\n this.returnType = returnType;\n this.doc = doc;\n this.signature = signature || FunctionLikeSchema.createSignature(this.name, this.params, this.returnType);\n }\n\n getNodes() {\n return [...this.params, this.returnType, ...(this.decorators || [])];\n }\n\n toString(options?: { color?: boolean }) {\n const bold = options?.color ? chalk.bold : (text: string) => text;\n const paramsStr = this.params.map((param) => param.toString()).join(', ');\n const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toString(options)).join('\\n');\n return `${this.decorators ? `${decoratorsStr}\\n` : ''}${this.modifiersToString()}${typeParamsStr}${bold(\n this.name\n )}(${paramsStr}): ${this.returnType.toString(options)}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toString()).join('\\n');\n if (decoratorsStr) {\n result += `${decoratorsStr}\\n`;\n }\n const modifiersStr = this.modifiersToString();\n const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';\n const paramsStr = this.params\n .map((param) => {\n let paramStr = '';\n if (param.isSpread) {\n paramStr += '...';\n }\n paramStr += param.name;\n if (param.isOptional) {\n paramStr += '?';\n }\n paramStr += `: ${param.type.toString()}`;\n if (param.defaultValue !== undefined) {\n paramStr += ` = ${param.defaultValue}`;\n }\n return paramStr;\n })\n .join(', ');\n result += `${modifiersStr}${this.name}${typeParamsStr}(${paramsStr}): ${this.returnType.toString()}`;\n return result;\n }\n\n isDeprecated(): boolean {\n return Boolean(this.doc?.hasTag(TagName.deprecated));\n }\n\n isPrivate(): boolean {\n return Boolean(this.modifiers.find((m) => m === 'private') || this.doc?.hasTag(TagName.private));\n }\n\n generateSignature(): string {\n return FunctionLikeSchema.createSignature(this.name, this.params, this.returnType, this.decorators);\n }\n\n static createSignature(\n name: string,\n params: ParameterSchema[],\n returnType: SchemaNode,\n decorators?: SchemaNode[]\n ): string {\n const paramsStr = params\n .map((param) => {\n let type = param.type.toString();\n if (param.isSpread) type = `...${type}`;\n return `${param.name}${param.isOptional ? '?' : ''}: ${type}`;\n })\n .join(', ');\n const decoratorsStr = decorators?.map((decorator) => decorator.toString()).join('\\n');\n return `${decorators ? `${decoratorsStr}\\n` : ''}${name}(${paramsStr}): ${returnType.toString()}`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n params: this.params.map((param) => param.toObject()),\n returnType: this.returnType.toObject(),\n signature: this.signature,\n modifiers: this.modifiers,\n doc: this.doc?.toObject(),\n typeParams: this.typeParams,\n decorators: this.decorators?.map((decorator) => decorator.toObject()),\n };\n }\n\n static fromObject(obj: Record<string, any>) {\n return new FunctionLikeSchema(\n obj.location,\n obj.name,\n obj.params.map((param: Record<string, any>) => ParameterSchema.fromObject(param)),\n SchemaRegistry.fromObject(obj.returnType),\n obj.signature,\n obj.modifiers,\n obj.doc ? DocSchema.fromObject(obj.doc) : undefined,\n obj.typeParams,\n obj.decorators?.map((decorator) => SchemaRegistry.fromObject(decorator))\n );\n }\n\n private modifiersToString() {\n const modifiersToPrint = this.modifiers.filter((modifier) => modifier !== 'export');\n return modifiersToPrint.length ? `${modifiersToPrint.join(' ')} ` : '';\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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ACF;AAACmC,OAAA,CAAA3D,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_schemaDiff","_parameter","_docs","_tag","_schemaRegistry","e","__esModule","default","FunctionLikeSchema","SchemaNode","displaySchemaName","constructor","location","name","params","returnType","signature","modifiers","doc","typeParams","decorators","createSignature","getNodes","toString","options","bold","color","chalk","text","paramsStr","map","param","join","typeParamsStr","decoratorsStr","decorator","modifiersToString","toFullSignature","result","showDocs","modifiersStr","paramStr","isSpread","isOptional","type","defaultValue","undefined","isDeprecated","Boolean","hasTag","TagName","deprecated","isPrivate","find","m","private","generateSignature","toObject","fromObject","obj","ParameterSchema","SchemaRegistry","DocSchema","diff","other","facts","baseObj","compareObj","diffParams","typesAreSemanticallyEqual","fromType","typeStr","toType","push","changeKind","description","context","position","from","to","deepEqualNoLocation","diffModifiers","diffDoc","baseMods","compareMods","base","filter","compare","added","includes","removed","parts","length","accessNarrowed","baseParams","compareParams","p","slice","isOpt","paramName","hasDefault","paramType","minLen","Math","min","i","diffOverlappingParam","bp","cp","index","objectBindingNodes","diffDestructuredParam","nameEqual","typeEqual","fromName","toName","diffParamOptionality","diffParamDefault","previousDefault","String","newDefault","baseBindings","compareBindings","baseMap","Map","b","compareMap","has","propertyName","bb","cb","get","diffBindingDefault","parentIsOptional","modifiersToPrint","modifier","exports"],"sources":["function-like.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { SchemaLocation } from '../schema-node';\nimport { SchemaNode } from '../schema-node';\nimport type { SchemaChangeFact } from '../schema-diff';\nimport { typesAreSemanticallyEqual, typeStr, deepEqualNoLocation, diffDoc } from '../schema-diff';\nimport { ParameterSchema } from './parameter';\nimport { DocSchema } from './docs';\nimport { TagName } from './docs/tag';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport type Modifier =\n | 'static'\n | 'public'\n | 'private'\n | 'protected'\n | 'readonly'\n | 'abstract'\n | 'async'\n | 'override'\n | 'export';\n\n/**\n * function-like can be a function, method, arrow-function, variable-function, etc.\n */\nexport class FunctionLikeSchema extends SchemaNode {\n readonly returnType: SchemaNode;\n readonly params: ParameterSchema[];\n readonly doc?: DocSchema;\n readonly signature?: string | undefined;\n readonly displaySchemaName = 'Functions';\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n params: ParameterSchema[],\n returnType: SchemaNode,\n signature: string,\n readonly modifiers: Modifier[] = [],\n doc?: DocSchema,\n readonly typeParams?: string[],\n readonly decorators?: SchemaNode[]\n ) {\n super();\n this.params = params;\n this.returnType = returnType;\n this.doc = doc;\n this.signature = signature || FunctionLikeSchema.createSignature(this.name, this.params, this.returnType);\n }\n\n getNodes() {\n return [...this.params, this.returnType, ...(this.decorators || [])];\n }\n\n toString(options?: { color?: boolean }) {\n const bold = options?.color ? chalk.bold : (text: string) => text;\n const paramsStr = this.params.map((param) => param.toString()).join(', ');\n const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toString(options)).join('\\n');\n return `${this.decorators ? `${decoratorsStr}\\n` : ''}${this.modifiersToString()}${typeParamsStr}${bold(\n this.name\n )}(${paramsStr}): ${this.returnType.toString(options)}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n const decoratorsStr = this.decorators?.map((decorator) => decorator.toString()).join('\\n');\n if (decoratorsStr) {\n result += `${decoratorsStr}\\n`;\n }\n const modifiersStr = this.modifiersToString();\n const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';\n const paramsStr = this.params\n .map((param) => {\n let paramStr = '';\n if (param.isSpread) {\n paramStr += '...';\n }\n paramStr += param.name;\n if (param.isOptional) {\n paramStr += '?';\n }\n paramStr += `: ${param.type.toString()}`;\n if (param.defaultValue !== undefined) {\n paramStr += ` = ${param.defaultValue}`;\n }\n return paramStr;\n })\n .join(', ');\n result += `${modifiersStr}${this.name}${typeParamsStr}(${paramsStr}): ${this.returnType.toString()}`;\n return result;\n }\n\n isDeprecated(): boolean {\n return Boolean(this.doc?.hasTag(TagName.deprecated));\n }\n\n isPrivate(): boolean {\n return Boolean(this.modifiers.find((m) => m === 'private') || this.doc?.hasTag(TagName.private));\n }\n\n generateSignature(): string {\n return FunctionLikeSchema.createSignature(this.name, this.params, this.returnType, this.decorators);\n }\n\n static createSignature(\n name: string,\n params: ParameterSchema[],\n returnType: SchemaNode,\n decorators?: SchemaNode[]\n ): string {\n const paramsStr = params\n .map((param) => {\n let type = param.type.toString();\n if (param.isSpread) type = `...${type}`;\n return `${param.name}${param.isOptional ? '?' : ''}: ${type}`;\n })\n .join(', ');\n const decoratorsStr = decorators?.map((decorator) => decorator.toString()).join('\\n');\n return `${decorators ? `${decoratorsStr}\\n` : ''}${name}(${paramsStr}): ${returnType.toString()}`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n params: this.params.map((param) => param.toObject()),\n returnType: this.returnType.toObject(),\n signature: this.signature,\n modifiers: this.modifiers,\n doc: this.doc?.toObject(),\n typeParams: this.typeParams,\n decorators: this.decorators?.map((decorator) => decorator.toObject()),\n };\n }\n\n static fromObject(obj: Record<string, any>) {\n return new FunctionLikeSchema(\n obj.location,\n obj.name,\n obj.params.map((param: Record<string, any>) => ParameterSchema.fromObject(param)),\n SchemaRegistry.fromObject(obj.returnType),\n obj.signature,\n obj.modifiers,\n obj.doc ? DocSchema.fromObject(obj.doc) : undefined,\n obj.typeParams,\n obj.decorators?.map((decorator) => SchemaRegistry.fromObject(decorator))\n );\n }\n\n diff(other: SchemaNode): SchemaChangeFact[] {\n if (!(other instanceof FunctionLikeSchema)) return super.diff(other);\n const facts: SchemaChangeFact[] = [];\n const baseObj = this.toObject();\n const compareObj = other.toObject();\n\n FunctionLikeSchema.diffParams(baseObj.params || [], compareObj.params || [], facts);\n\n if (!typesAreSemanticallyEqual(baseObj.returnType, compareObj.returnType)) {\n const fromType = typeStr(baseObj.returnType);\n const toType = typeStr(compareObj.returnType);\n facts.push({\n changeKind: 'return-type-changed',\n description: `return type changed: ${fromType} → ${toType}`,\n context: { fromType, toType, position: 'return-type' },\n from: fromType,\n to: toType,\n });\n }\n\n if (!deepEqualNoLocation(baseObj.typeParams, compareObj.typeParams)) {\n facts.push({\n changeKind: 'type-parameters-changed',\n description: `type parameters changed: <${(baseObj.typeParams || []).join(', ') || 'none'}> → <${(compareObj.typeParams || []).join(', ') || 'none'}>`,\n context: { from: (baseObj.typeParams || []).join(', '), to: (compareObj.typeParams || []).join(', ') },\n from: (baseObj.typeParams || []).join(', '),\n to: (compareObj.typeParams || []).join(', '),\n });\n }\n\n FunctionLikeSchema.diffModifiers(this.modifiers || [], other.modifiers || [], facts);\n facts.push(...diffDoc(baseObj.doc, compareObj.doc));\n return facts;\n }\n\n private static diffModifiers(baseMods: string[], compareMods: string[], facts: SchemaChangeFact[]): void {\n const base = baseMods.filter((m) => m !== 'export');\n const compare = compareMods.filter((m) => m !== 'export');\n if (deepEqualNoLocation(base, compare)) return;\n\n const added = compare.filter((m) => !base.includes(m));\n const removed = base.filter((m) => !compare.includes(m));\n const parts: string[] = [];\n if (added.length) parts.push(`added: ${added.join(', ')}`);\n if (removed.length) parts.push(`removed: ${removed.join(', ')}`);\n const accessNarrowed = removed.includes('public') || added.includes('private') || added.includes('protected');\n\n facts.push({\n changeKind: accessNarrowed ? 'access-narrowed' : 'modifiers-changed',\n description: `modifiers changed (${parts.join('; ')})`,\n context: { added, removed, accessNarrowed },\n from: base.join(', ') || 'none',\n to: compare.join(', ') || 'none',\n });\n }\n\n private static diffParams(\n baseParams: Record<string, any>[],\n compareParams: Record<string, any>[],\n facts: SchemaChangeFact[]\n ): void {\n for (const p of compareParams.slice(baseParams.length)) {\n const isOpt = p.isOptional || p.defaultValue !== undefined;\n facts.push({\n changeKind: 'parameter-added',\n description: `parameter '${p.name}: ${typeStr(p.type)}' added${isOpt ? ' (optional)' : ' (required)'}`,\n context: {\n paramName: p.name,\n isOptional: !!p.isOptional,\n hasDefault: p.defaultValue !== undefined,\n paramType: typeStr(p.type),\n },\n to: `${p.name}${p.isOptional ? '?' : ''}: ${typeStr(p.type)}`,\n });\n }\n\n for (const p of baseParams.slice(compareParams.length)) {\n facts.push({\n changeKind: 'parameter-removed',\n description: `parameter '${p.name}: ${typeStr(p.type)}' removed`,\n context: { paramName: p.name, isOptional: !!p.isOptional, paramType: typeStr(p.type) },\n from: `${p.name}${p.isOptional ? '?' : ''}: ${typeStr(p.type)}`,\n });\n }\n\n const minLen = Math.min(baseParams.length, compareParams.length);\n for (let i = 0; i < minLen; i++) {\n FunctionLikeSchema.diffOverlappingParam(baseParams[i], compareParams[i], i, facts);\n }\n }\n\n private static diffOverlappingParam(\n bp: Record<string, any>,\n cp: Record<string, any>,\n index: number,\n facts: SchemaChangeFact[]\n ): void {\n if (bp.objectBindingNodes || cp.objectBindingNodes) {\n FunctionLikeSchema.diffDestructuredParam(bp, cp, facts);\n if (!typesAreSemanticallyEqual(bp.type, cp.type)) {\n const paramName = cp.name || bp.name;\n facts.push({\n changeKind: 'parameter-type-changed',\n description: `parameter at position ${index} type changed: ${typeStr(bp.type)} → ${typeStr(cp.type)}`,\n context: { paramName, fromType: typeStr(bp.type), toType: typeStr(cp.type), position: 'parameter' },\n from: typeStr(bp.type),\n to: typeStr(cp.type),\n });\n }\n return;\n }\n\n const nameEqual = bp.name === cp.name;\n const typeEqual = typesAreSemanticallyEqual(bp.type, cp.type);\n if (nameEqual && typeEqual && bp.isOptional === cp.isOptional && bp.defaultValue === cp.defaultValue) return;\n\n const paramName = cp.name || bp.name;\n if (!nameEqual) {\n facts.push({\n changeKind: 'parameter-renamed',\n description: `parameter at position ${index} renamed: '${bp.name}' → '${cp.name}'`,\n context: { fromName: bp.name, toName: cp.name, position: index },\n from: bp.name,\n to: cp.name,\n });\n }\n if (!typeEqual) {\n facts.push({\n changeKind: 'parameter-type-changed',\n description: `parameter '${paramName}' type changed: ${typeStr(bp.type)} → ${typeStr(cp.type)}`,\n context: { paramName, fromType: typeStr(bp.type), toType: typeStr(cp.type), position: 'parameter' },\n from: typeStr(bp.type),\n to: typeStr(cp.type),\n });\n }\n FunctionLikeSchema.diffParamOptionality(bp, cp, paramName, facts);\n FunctionLikeSchema.diffParamDefault(bp, cp, paramName, facts);\n }\n\n private static diffParamOptionality(\n bp: Record<string, any>,\n cp: Record<string, any>,\n paramName: string,\n facts: SchemaChangeFact[]\n ): void {\n if (bp.isOptional && !cp.isOptional) {\n facts.push({\n changeKind: 'became-required',\n description: `parameter '${paramName}' became required (was optional)`,\n context: { paramName, position: 'parameter' },\n from: 'optional',\n to: 'required',\n });\n } else if (!bp.isOptional && cp.isOptional) {\n facts.push({\n changeKind: 'became-optional',\n description: `parameter '${paramName}' became optional (was required)`,\n context: { paramName, position: 'parameter' },\n from: 'required',\n to: 'optional',\n });\n }\n }\n\n private static diffParamDefault(\n bp: Record<string, any>,\n cp: Record<string, any>,\n paramName: string,\n facts: SchemaChangeFact[]\n ): void {\n if (bp.defaultValue === cp.defaultValue) return;\n if (bp.defaultValue !== undefined && cp.defaultValue === undefined) {\n facts.push({\n changeKind: 'parameter-default-removed',\n description: `parameter '${paramName}' default value removed (was: ${bp.defaultValue})`,\n context: { paramName, isOptional: !!bp.isOptional, previousDefault: String(bp.defaultValue) },\n from: String(bp.defaultValue),\n });\n } else if (bp.defaultValue === undefined && cp.defaultValue !== undefined) {\n facts.push({\n changeKind: 'parameter-default-added',\n description: `parameter '${paramName}' default value added: ${cp.defaultValue}`,\n context: { paramName, newDefault: String(cp.defaultValue) },\n to: String(cp.defaultValue),\n });\n } else {\n facts.push({\n changeKind: 'parameter-default-changed',\n description: `parameter '${paramName}' default value changed: ${bp.defaultValue} → ${cp.defaultValue}`,\n context: { paramName, previousDefault: String(bp.defaultValue), newDefault: String(cp.defaultValue) },\n from: String(bp.defaultValue),\n to: String(cp.defaultValue),\n });\n }\n }\n\n private static diffDestructuredParam(\n base: Record<string, any>,\n compare: Record<string, any>,\n facts: SchemaChangeFact[]\n ): void {\n const baseBindings: Record<string, any>[] = base.objectBindingNodes || [];\n const compareBindings: Record<string, any>[] = compare.objectBindingNodes || [];\n const baseMap = new Map(baseBindings.map((b) => [b.name || '', b]));\n const compareMap = new Map(compareBindings.map((b) => [b.name || '', b]));\n\n for (const [name] of compareMap) {\n if (!baseMap.has(name)) {\n facts.push({\n changeKind: 'destructured-property-added',\n description: `destructured property '${name}' added`,\n context: { propertyName: name },\n to: name,\n });\n }\n }\n for (const [name] of baseMap) {\n if (!compareMap.has(name)) {\n facts.push({\n changeKind: 'destructured-property-removed',\n description: `destructured property '${name}' removed`,\n context: { propertyName: name },\n from: name,\n });\n }\n }\n for (const [name, bb] of baseMap) {\n const cb = compareMap.get(name);\n if (!cb) continue;\n FunctionLikeSchema.diffBindingDefault(name, bb, cb, !!base.isOptional, facts);\n if (bb.type && cb.type && !typesAreSemanticallyEqual(bb.type, cb.type)) {\n facts.push({\n changeKind: 'destructured-property-type-changed',\n description: `destructured property '${name}' type changed: ${typeStr(bb.type)} → ${typeStr(cb.type)}`,\n context: { propertyName: name, fromType: typeStr(bb.type), toType: typeStr(cb.type), position: 'parameter' },\n from: typeStr(bb.type),\n to: typeStr(cb.type),\n });\n }\n }\n }\n\n private static diffBindingDefault(\n name: string,\n bb: Record<string, any>,\n cb: Record<string, any>,\n parentIsOptional: boolean,\n facts: SchemaChangeFact[]\n ): void {\n if (bb.defaultValue === cb.defaultValue) return;\n if (bb.defaultValue !== undefined && cb.defaultValue === undefined) {\n facts.push({\n changeKind: 'destructured-property-default-removed',\n description: `destructured property '${name}' default value removed (was: ${bb.defaultValue})`,\n context: { propertyName: name, isOptional: parentIsOptional, previousDefault: String(bb.defaultValue) },\n from: String(bb.defaultValue),\n });\n } else if (bb.defaultValue === undefined && cb.defaultValue !== undefined) {\n facts.push({\n changeKind: 'destructured-property-default-added',\n description: `destructured property '${name}' default value added: ${cb.defaultValue}`,\n context: { propertyName: name, newDefault: String(cb.defaultValue) },\n to: String(cb.defaultValue),\n });\n } else {\n facts.push({\n changeKind: 'destructured-property-default-changed',\n description: `destructured property '${name}' default value changed: ${bb.defaultValue} → ${cb.defaultValue}`,\n context: { propertyName: name, previousDefault: String(bb.defaultValue), newDefault: String(cb.defaultValue) },\n from: String(bb.defaultValue),\n to: String(cb.defaultValue),\n });\n }\n }\n\n private modifiersToString() {\n const modifiersToPrint = this.modifiers.filter((modifier) => modifier !== 'export');\n return modifiersToPrint.length ? `${modifiersToPrint.join(' ')} ` : '';\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,KAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,gBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,eAA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AA,kBAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import type { SchemaLocation } from '../schema-node';
2
2
  import { SchemaNode } from '../schema-node';
3
+ import type { SchemaChangeFact } from '../schema-diff';
3
4
  import { DocSchema } from './docs';
4
5
  import { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
5
6
  export declare class InterfaceSchema extends SchemaNode {
@@ -46,5 +47,6 @@ export declare class InterfaceSchema extends SchemaNode {
46
47
  }[];
47
48
  typeParams: string[] | undefined;
48
49
  };
50
+ diff(other: SchemaNode): SchemaChangeFact[];
49
51
  static fromObject(obj: Record<string, any>): InterfaceSchema;
50
52
  }