jsii 5.8.9-dev.0 → 5.8.9-dev.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.
@@ -181,12 +181,14 @@ class DeprecatedRemover {
|
|
181
181
|
if ((0, spec_1.isClassType)(type) && type.initializer) {
|
182
182
|
result.push(...this.verifyCallable(assembly, strippedFqns, type.initializer));
|
183
183
|
}
|
184
|
-
if (type.methods)
|
184
|
+
if (type.methods) {
|
185
185
|
for (const method of type.methods)
|
186
186
|
result.push(...this.verifyCallable(assembly, strippedFqns, method));
|
187
|
-
|
187
|
+
}
|
188
|
+
if (type.properties) {
|
188
189
|
for (const property of type.properties)
|
189
190
|
result.push(...this.verifyProperty(assembly, strippedFqns, property));
|
191
|
+
}
|
190
192
|
}
|
191
193
|
return result;
|
192
194
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deprecated-remover.js","sourceRoot":"","sources":["../../src/transforms/deprecated-remover.ts"],"names":[],"mappings":";;;AAAA,yCAAwD;AACxD,qCAkBoB;AACpB,iCAAiC;AAEjC,wDAAoD;AACpD,6CAA6C;AAC7C,oCAAqC;AAErC,MAAa,iBAAiB;IAI5B,YACmB,WAA2B,EAC3B,uBAAgD;QADhD,gBAAW,GAAX,WAAW,CAAgB;QAC3B,4BAAuB,GAAvB,uBAAuB,CAAyB;QALlD,oBAAe,GAAG,IAAI,KAAK,EAAkB,CAAC;QAC9C,kBAAa,GAAG,IAAI,GAAG,EAAW,CAAC;IAKjD,CAAC;IAEJ;;;;;;OAMG;IACH,IAAW,kBAAkB;QAC3B,OAAO;YACL,iBAAiB,EAAE;gBACjB,CAAC,OAAO,EAAE,EAAE;oBACV,MAAM,WAAW,GAAG,IAAI,6BAA6B,CACnD,IAAI,CAAC,WAAW,EAChB,OAAO,EACP,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,aAAa,CACnB,CAAC;oBACF,OAAO,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,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CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACzG,CAAC;IAEO,YAAY,CAAC,IAAa;QAChC,MAAM,QAAQ,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,CACL,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAC/G,CAAC;IACJ,CAAC;;AApJD;;;;;;GAMG;AACqB,6CAAe,GAA+B,IAAI,GAAG,CAAC;IAC5E,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,mBAAmB;IACjC,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,iBAAiB;IAC/B,EAAE,CAAC,UAAU,CAAC,eAAe;IAC7B,EAAE,CAAC,UAAU,CAAC,iBAAiB;IAC/B,EAAE,CAAC,UAAU,CAAC,mBAAmB;IACjC,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,mBAAmB;CAClC,CAAC,AAVqC,CAUpC","sourcesContent":["import { basename, dirname, relative } from 'node:path';\nimport {\n Assembly,\n ClassType,\n EnumMember,\n Initializer,\n InterfaceType,\n isClassOrInterfaceType,\n isClassType,\n isCollectionTypeReference,\n isEnumType,\n isMethod,\n isNamedTypeReference,\n isPrimitiveTypeReference,\n Method,\n Parameter,\n Property,\n Stability,\n TypeReference,\n} from '@jsii/spec';\nimport * as ts from 'typescript';\n\nimport { JsiiDiagnostic } from '../jsii-diagnostic';\nimport * as bindings from '../node-bindings';\nimport { JsiiError } from '../utils';\n\nexport class DeprecatedRemover {\n private readonly transformations = new Array<Transformation>();\n private readonly nodesToRemove = new Set<ts.Node>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly allowlistedDeprecations: Set<string> | undefined,\n ) {}\n\n /**\n * Obtains the configuration for the TypeScript transform(s) that will remove\n * `@deprecated` members from the generated declarations (`.d.ts`) files. It\n * will leverage information accumulated during `#removeFrom(Assembly)` in\n * order to apply corrections to inheritance chains, ensuring a valid output\n * is produced.\n */\n public get customTransformers(): ts.CustomTransformers {\n return {\n afterDeclarations: [\n (context) => {\n const transformer = new DeprecationRemovalTransformer(\n this.typeChecker,\n context,\n this.transformations,\n this.nodesToRemove,\n );\n return transformer.transform.bind(transformer);\n },\n ],\n };\n }\n\n /**\n * Removes all `@deprecated` API elements from the provided assembly, and\n * records the operations needed in order to fix the inheritance chains that\n * mix `@deprecated` and non-`@deprecated` types.\n *\n * @param assembly the assembly to be modified.\n *\n * @returns diagnostic messages produced when validating no remaining API\n * makes use of a `@deprecated` type that was removed.\n */\n public removeFrom(assembly: Assembly): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const strippedFqns = new Set<string>();\n const replaceWithClass = new Map<string, string>();\n const replaceWithInterfaces = new Map<string, readonly string[]>();\n\n // Find all types that will be stripped out\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n if (typeInfo.docs?.stability === Stability.Deprecated) {\n if (!this.shouldFqnBeStripped(fqn)) {\n continue;\n }\n strippedFqns.add(fqn);\n\n if (isClassType(typeInfo) && typeInfo.base != null) {\n replaceWithClass.set(fqn, typeInfo.base);\n }\n if (isClassOrInterfaceType(typeInfo) && typeInfo.interfaces != null) {\n replaceWithInterfaces.set(fqn, typeInfo.interfaces);\n }\n\n this.nodesToRemove.add(bindings.getRelatedNode(typeInfo)!);\n }\n }\n\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n // Ignore `@deprecated` types\n if (strippedFqns.has(fqn)) {\n continue;\n }\n\n // Enums cannot have references to `@deprecated` types, but can have deprecated members\n if (isEnumType(typeInfo)) {\n const enumNode = bindings.getEnumRelatedNode(typeInfo)!;\n const members: EnumMember[] = [];\n for (const mem of typeInfo.members) {\n if (mem.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${mem.name}`)) {\n const matchingMemberNode = enumNode.members.find((enumMem) => enumMem.name.getText() === mem.name);\n if (matchingMemberNode) {\n this.nodesToRemove.add(matchingMemberNode);\n }\n } else {\n members.push(mem);\n }\n }\n typeInfo.members = members;\n continue;\n }\n\n // For classes, we erase `@deprecated` base classes, replacing as needed\n const additionalInterfaces = new Set<string>();\n if (isClassType(typeInfo) && typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n while (typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n const oldBase = assembly.types[typeInfo.base] as ClassType;\n if (oldBase.interfaces) for (const addFqn of oldBase.interfaces) additionalInterfaces.add(addFqn);\n typeInfo.base = replaceWithClass.get(typeInfo.base);\n }\n this.transformations.push(\n typeInfo.base != null\n ? Transformation.replaceBaseClass(\n this.typeChecker,\n bindings.getClassRelatedNode(typeInfo)!,\n typeInfo.base in assembly.types\n ? bindings.getClassRelatedNode(assembly.types[typeInfo.base] as ClassType) ?? typeInfo.base\n : typeInfo.base,\n )\n : Transformation.removeBaseClass(this.typeChecker, bindings.getClassRelatedNode(typeInfo)!),\n );\n }\n\n // Be defensive in case we add other kinds in the future\n if (!isClassOrInterfaceType(typeInfo)) {\n throw new Error(`Unhandled type encountered! ${JSON.stringify(typeInfo, null, 2)}`);\n }\n\n // Strip all `@deprecated` interfaces from the inheritance tree, replacing as needed\n if (typeInfo.interfaces?.some((addFqn) => strippedFqns.has(addFqn)) || additionalInterfaces.size > 0) {\n const originalSet = new Set(typeInfo.interfaces ?? []);\n const newSet = new Set<string>();\n\n const candidates = Array.from(new Set([...originalSet, ...additionalInterfaces]));\n while (candidates.length > 0) {\n const candidateFqn = candidates.pop()!;\n if (!strippedFqns.has(candidateFqn)) {\n newSet.add(candidateFqn);\n if (!originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.addInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n candidateFqn in assembly.types\n ? bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType) ?? candidateFqn\n : candidateFqn,\n ),\n );\n }\n continue;\n }\n if (originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.removeInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType)!,\n ),\n );\n }\n const replacement = replaceWithInterfaces.get(candidateFqn);\n if (replacement != null) {\n candidates.push(...replacement);\n }\n }\n\n typeInfo.interfaces = newSet.size > 0 ? Array.from(newSet).sort() : undefined;\n }\n\n // Drop all `@deprecated` members, and remove \"overrides\" from stripped types\n const methods: Method[] = [];\n const properties: Property[] = [];\n if (typeInfo.methods) {\n for (const meth of typeInfo.methods) {\n if (meth.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${meth.name}`)) {\n this.nodesToRemove.add(bindings.getMethodRelatedNode(meth)!);\n } else {\n methods.push(\n meth.overrides != null && strippedFqns.has(meth.overrides) ? { ...meth, overrides: undefined } : meth,\n );\n }\n }\n }\n typeInfo.methods = typeInfo.methods ? methods : undefined;\n if (typeInfo.properties) {\n for (const prop of typeInfo.properties) {\n if (prop.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${prop.name}`)) {\n this.nodesToRemove.add(bindings.getParameterRelatedNode(prop)!);\n } else {\n properties.push(\n prop.overrides != null && strippedFqns.has(prop.overrides) ? { ...prop, overrides: undefined } : prop,\n );\n }\n }\n }\n typeInfo.properties = typeInfo.properties ? properties : undefined;\n }\n\n const diagnostics = this.findLeftoverUseOfDeprecatedAPIs(assembly, strippedFqns);\n\n // Remove all `@deprecated` types, after we did everything, so we could\n // still access the related nodes from the assembly object.\n for (const fqn of strippedFqns) {\n if (this.shouldFqnBeStripped(fqn)) {\n delete assembly.types[fqn];\n }\n }\n\n return diagnostics;\n }\n\n private findLeftoverUseOfDeprecatedAPIs(assembly: Assembly, strippedFqns: Set<string>): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const result = new Array<JsiiDiagnostic>();\n\n for (const type of Object.values(assembly.types)) {\n if (isEnumType(type) || strippedFqns.has(type.fqn)) {\n continue;\n }\n if (isClassType(type) && type.initializer) {\n result.push(...this.verifyCallable(assembly, strippedFqns, type.initializer));\n }\n if (type.methods)\n for (const method of type.methods) result.push(...this.verifyCallable(assembly, strippedFqns, method));\n if (type.properties)\n for (const property of type.properties) result.push(...this.verifyProperty(assembly, strippedFqns, property));\n }\n\n return result;\n }\n\n private verifyCallable(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n method: Method | Initializer,\n ): readonly JsiiDiagnostic[] {\n const diagnostics = new Array<JsiiDiagnostic>();\n const deprecatedReturnFqn =\n isMethod(method) && method.returns && this.tryFindReference(method.returns.type, strippedFqns);\n if (deprecatedReturnFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedReturnFqn, 'Method', method, assembly));\n }\n\n if (method.parameters) {\n for (const parameter of method.parameters) {\n const deprecatedTypeFqn = this.tryFindReference(parameter.type, strippedFqns);\n if (deprecatedTypeFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedTypeFqn, 'Parameter', parameter, assembly));\n }\n }\n }\n return diagnostics;\n }\n\n private verifyProperty(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n property: Property,\n ): readonly JsiiDiagnostic[] {\n const deprecatedTypeFqn = this.tryFindReference(property.type, strippedFqns);\n if (deprecatedTypeFqn) {\n return [this.makeDiagnostic(deprecatedTypeFqn, 'Property', property, assembly)];\n }\n return [];\n }\n\n /**\n * Determines whether a `TypeReference` contains an FQN within a given set.\n *\n * @param ref the tested `TypeReference`.\n * @param fqns the set of FQNs that are being searched for.\n *\n * @returns the first FQN that was identified.\n */\n private tryFindReference(ref: TypeReference, fqns: ReadonlySet<string>): string | undefined {\n if (isNamedTypeReference(ref)) {\n return fqns.has(ref.fqn) ? ref.fqn : undefined;\n }\n if (isPrimitiveTypeReference(ref)) {\n return undefined;\n }\n if (isCollectionTypeReference(ref)) {\n return this.tryFindReference(ref.collection.elementtype, fqns);\n }\n return ref.union.types.map((type) => this.tryFindReference(type, fqns)).find((typeRef) => typeRef != null);\n }\n\n private shouldFqnBeStripped(fqn: string) {\n return this.allowlistedDeprecations?.has(fqn) ?? true;\n }\n\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method',\n context: Method | Initializer,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Parameter',\n context: Parameter,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(fqn: string, messagePrefix: 'Property', context: Property, assembly: Assembly): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method' | 'Property' | 'Parameter',\n context: Method | Initializer | Parameter | Property,\n assembly: Assembly,\n ): JsiiDiagnostic {\n const node = bindings.getRelatedNode<\n | ts.AccessorDeclaration\n | ts.MethodDeclaration\n | ts.MethodSignature\n | ts.ParameterDeclaration\n | ts.PropertyDeclaration\n | ts.PropertySignature\n >(context);\n const diagnostic = JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n node?.type ?? node!,\n `${messagePrefix} has @deprecated type ${fqn}, and it is erased by --strip-deprecated.`,\n );\n\n const typeInfo = assembly.types?.[fqn];\n const typeNode = typeInfo && bindings.getTypeRelatedNode(typeInfo);\n if (typeNode == null) {\n return diagnostic;\n }\n return diagnostic.addRelatedInformation(\n ts.getNameOfDeclaration(typeNode) ?? typeNode,\n 'The @deprecated type is declared here',\n );\n }\n}\n\nclass Transformation {\n public static addInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration) && !ts.isInterfaceDeclaration(declaration)) {\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n }\n\n const { typeExpression: newInterface, syntheticImport } = Transformation.typeReference(\n iface,\n declaration,\n typeChecker,\n );\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ImplementsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n }\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ExtendsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n\n function addInterfaceTo(\n token: ts.HeritageClause['token'],\n clauses: readonly ts.HeritageClause[] = [],\n ): ts.HeritageClause[] {\n const existingClause = clauses.find((clause) => clause.token === token);\n if (existingClause == null) {\n return [...clauses, ts.factory.createHeritageClause(token, [newInterface])];\n }\n return [\n ...clauses.filter((clause) => clause !== existingClause),\n ts.factory.updateHeritageClause(existingClause, [...existingClause.types, newInterface]),\n ];\n }\n });\n }\n\n public static replaceBaseClass(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration,\n baseClass: ts.ClassDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n const { typeExpression: newBaseClass, syntheticImport } = Transformation.typeReference(\n baseClass,\n declaration,\n typeChecker,\n );\n const existingClause = declaration.heritageClauses?.find(\n (clause) => clause.token === ts.SyntaxKind.ExtendsKeyword,\n );\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n [\n ...(declaration.heritageClauses ?? []).filter((clause) => clause !== existingClause),\n existingClause\n ? ts.factory.updateHeritageClause(existingClause, [newBaseClass])\n : ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [newBaseClass]),\n ],\n declaration.members,\n ),\n syntheticImports: syntheticImport && [syntheticImport],\n };\n });\n }\n\n public static removeBaseClass(typeChecker: ts.TypeChecker, node: ts.ClassDeclaration) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n declaration.heritageClauses?.filter((clause) => clause.token !== ts.SyntaxKind.ExtendsKeyword),\n declaration.members,\n ),\n };\n });\n }\n\n public static removeInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration,\n ) {\n const ifaceName = Transformation.fullyQualifiedName(typeChecker, iface)!;\n\n return new Transformation(typeChecker, node, (declaration) => {\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n } else if (ts.isInterfaceDeclaration(declaration)) {\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n }\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n });\n\n function removeInterfaceHeritage(\n clauses: readonly ts.HeritageClause[] | undefined,\n ): ts.HeritageClause[] | undefined {\n if (clauses == null) {\n return clauses;\n }\n return clauses\n .map((clause) => {\n const types = clause.types.filter(\n (type) => Transformation.fullyQualifiedName(typeChecker, type.expression) !== ifaceName,\n );\n if (types.length === clause.types.length) {\n // Means the interface was only transitively present...\n return clause;\n }\n if (types.length === 0) {\n return undefined;\n }\n return ts.factory.updateHeritageClause(clause, types);\n })\n .filter((clause) => clause != null) as ts.HeritageClause[];\n }\n }\n\n private static fullyQualifiedName(typeChecker: ts.TypeChecker, node: ts.Node): string | undefined {\n const symbol = typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(node as ts.Declaration) ?? node);\n // This symbol ☝️ does not contain enough information in some cases - when\n // an imported type is part of a heritage clause - to produce the fqn.\n // Round tripping this to its type and back to a symbol seems to fix this.\n const type = symbol && typeChecker.getDeclaredTypeOfSymbol(symbol);\n return type?.symbol && typeChecker.getFullyQualifiedName(type.symbol);\n }\n\n private static typeReference(\n type: ts.ClassDeclaration | ts.InterfaceDeclaration | string,\n context: ts.ClassDeclaration | ts.InterfaceDeclaration,\n typeChecker: ts.TypeChecker,\n ): {\n typeExpression: ts.ExpressionWithTypeArguments;\n syntheticImport?: ts.ImportDeclaration;\n } {\n context = ts.getOriginalNode(context) as any;\n\n const [, contextSource] = /^\"([^\"]+)\"\\..*$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(context)!)!),\n )!;\n\n let expression: ts.Expression;\n let syntheticImport: ts.ImportDeclaration | undefined;\n\n if (typeof type === 'string') {\n const [root, ...tail] = type.split('.');\n const syntheticImportName = ts.factory.createUniqueName(root);\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* decorators */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(root),\n );\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n } else {\n const [, typeSource, qualifiedName] = /^\"([^\"]+)\"\\.(.*)$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(type)!)!),\n )!;\n\n if (typeSource === contextSource) {\n const [root, ...tail] = qualifiedName.split('.');\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n ts.factory.createIdentifier(root) as ts.Expression,\n );\n } else {\n const syntheticImportName = ts.factory.createUniqueName(basename(typeSource));\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* modifiers */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(`./${relative(dirname(contextSource), typeSource)}`),\n undefined,\n );\n expression = qualifiedName\n .split('.')\n .reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n }\n }\n\n return {\n typeExpression: ts.factory.createExpressionWithTypeArguments(expression, undefined),\n syntheticImport,\n };\n }\n\n private readonly nodeName: string;\n\n private constructor(\n private readonly typeChecker: ts.TypeChecker,\n node: ts.Declaration,\n public readonly apply: (\n this: Transformation,\n node: ts.Node,\n ) => { node: ts.Node; syntheticImport?: ts.ImportDeclaration },\n ) {\n this.nodeName = Transformation.fullyQualifiedName(typeChecker, node)!;\n }\n\n public targets(node: ts.Declaration) {\n return this.nodeName === Transformation.fullyQualifiedName(this.typeChecker, node);\n }\n}\n\nclass DeprecationRemovalTransformer {\n /**\n * A list of SyntaxKinds for which it is not necessary to evaluate children,\n * since they are never of interest to this transform. This opens up a wee\n * optimization, which is particularly useful when trying to troubleshoot the\n * transform in a debugger (saves a TON of time stepping into useless nodes\n * then).\n */\n private static readonly IGNORE_CHILDREN: ReadonlySet<ts.SyntaxKind> = new Set([\n ts.SyntaxKind.Constructor,\n ts.SyntaxKind.FunctionDeclaration,\n ts.SyntaxKind.GetAccessor,\n ts.SyntaxKind.MethodDeclaration,\n ts.SyntaxKind.MethodSignature,\n ts.SyntaxKind.PropertySignature,\n ts.SyntaxKind.PropertyDeclaration,\n ts.SyntaxKind.SetAccessor,\n ts.SyntaxKind.VariableDeclaration,\n ]);\n\n private syntheticImports = new Array<ts.ImportDeclaration>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly context: ts.TransformationContext,\n private readonly transformations: readonly Transformation[],\n private readonly nodesToRemove: Set<ts.Node>,\n ) {}\n\n public transform<T extends ts.Node>(node: T): T {\n let result = this.visitEachChild(node);\n\n // If there are any synthetic imports, add them to the source file\n if (ts.isSourceFile(result) && this.syntheticImports.length > 0) {\n result = this.context.factory.updateSourceFile(\n result,\n [...this.syntheticImports, ...result.statements],\n result.isDeclarationFile,\n result.referencedFiles,\n result.typeReferenceDirectives,\n result.hasNoDefaultLib,\n result.libReferenceDirectives,\n ) as any;\n this.syntheticImports = new Array<ts.ImportDeclaration>();\n }\n\n return result;\n }\n\n private visitEachChild<T extends ts.Node>(node: T): T {\n return ts.visitEachChild(node, this.visitor.bind(this), this.context);\n }\n\n private visitor<T extends ts.Node>(node: T): ts.VisitResult<T> {\n if (this.isDeprecated(node)) {\n // Removing deprecated members by substituting \"nothing\" to them\n return [];\n }\n\n if (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) {\n for (const transformation of this.transformations) {\n // 👇 as any because the assignment below confuses type checker\n if (transformation.targets(node as any)) {\n const { node: transformedNode, syntheticImport } = transformation.apply(node);\n node = transformedNode as any;\n if (syntheticImport) {\n this.syntheticImports.push(syntheticImport);\n }\n }\n }\n }\n\n // Remove named imports of `@deprecated` members from the source...\n if (\n ts.isImportDeclaration(node) &&\n node.importClause &&\n node.importClause.namedBindings &&\n ts.isNamedImports(node.importClause.namedBindings)\n ) {\n const filteredElements = node.importClause.namedBindings.elements.filter((element) => {\n // This symbol is local (it's declaration points back to the named import)\n const symbol = this.typeChecker.getSymbolAtLocation(element.name);\n const exportedSymbol =\n // This \"resolves\" the imported type, so we can get to it's declaration(s)\n symbol && this.typeChecker.getDeclaredTypeOfSymbol(symbol)?.symbol;\n return !exportedSymbol?.declarations?.some((decl) => this.isDeprecated(decl));\n });\n if (filteredElements.length !== node.importClause.namedBindings.elements.length) {\n return this.context.factory.updateImportDeclaration(\n node,\n node.modifiers,\n node.importClause.name != null || filteredElements.length > 0\n ? this.context.factory.updateImportClause(\n node.importClause,\n node.importClause.isTypeOnly,\n node.importClause.name,\n this.context.factory.updateNamedImports(node.importClause.namedBindings, filteredElements),\n )\n : undefined,\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n\n return node;\n }\n\n // Replace \"export ... from ...\" places that no longer export anything\n // with an \"import from ...\", so side effects are preserved.\n if (ts.isExportDeclaration(node) && node.moduleSpecifier) {\n const symbol = this.typeChecker.getSymbolAtLocation(node.moduleSpecifier);\n const moduleExports =\n symbol &&\n this.typeChecker\n .getExportsOfModule(symbol)\n ?.filter((sym) => !sym.declarations?.some((decl) => this.isDeprecated(decl)));\n if ((node.exportClause == null || ts.isNamespaceExport(node.exportClause)) && moduleExports?.length === 0) {\n return this.context.factory.createImportDeclaration(\n undefined /* modifiers */,\n undefined /* importClause */,\n node.moduleSpecifier,\n ) as any;\n }\n\n if (node.exportClause != null && moduleExports) {\n const namedExports = node.exportClause as ts.NamedExports;\n const exportedNames = new Set(moduleExports.map((sym) => sym.name));\n const filteredElements = namedExports.elements?.filter((elt) => exportedNames.has(elt.name.text));\n if (filteredElements?.length !== namedExports.elements?.length) {\n return this.context.factory.updateExportDeclaration(\n node,\n node.modifiers,\n node.isTypeOnly,\n this.context.factory.updateNamedExports(namedExports, filteredElements),\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n }\n }\n\n return DeprecationRemovalTransformer.IGNORE_CHILDREN.has(node.kind) ? node : this.visitEachChild(node);\n }\n\n private isDeprecated(node: ts.Node): boolean {\n const original = ts.getOriginalNode(node);\n return (\n this.nodesToRemove.has(original) && ts.getJSDocTags(original).some((tag) => tag.tagName.text === 'deprecated')\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"deprecated-remover.js","sourceRoot":"","sources":["../../src/transforms/deprecated-remover.ts"],"names":[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,CAAC,UAAU,CAAC,iBAAiB;IAC/B,EAAE,CAAC,UAAU,CAAC,eAAe;IAC7B,EAAE,CAAC,UAAU,CAAC,iBAAiB;IAC/B,EAAE,CAAC,UAAU,CAAC,mBAAmB;IACjC,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,mBAAmB;CAClC,CAAC,AAVqC,CAUpC","sourcesContent":["import { basename, dirname, relative } from 'node:path';\nimport {\n Assembly,\n ClassType,\n EnumMember,\n Initializer,\n InterfaceType,\n isClassOrInterfaceType,\n isClassType,\n isCollectionTypeReference,\n isEnumType,\n isMethod,\n isNamedTypeReference,\n isPrimitiveTypeReference,\n Method,\n Parameter,\n Property,\n Stability,\n TypeReference,\n} from '@jsii/spec';\nimport * as ts from 'typescript';\n\nimport { JsiiDiagnostic } from '../jsii-diagnostic';\nimport * as bindings from '../node-bindings';\nimport { JsiiError } from '../utils';\n\nexport class DeprecatedRemover {\n private readonly transformations = new Array<Transformation>();\n private readonly nodesToRemove = new Set<ts.Node>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly allowlistedDeprecations: Set<string> | undefined,\n ) {}\n\n /**\n * Obtains the configuration for the TypeScript transform(s) that will remove\n * `@deprecated` members from the generated declarations (`.d.ts`) files. It\n * will leverage information accumulated during `#removeFrom(Assembly)` in\n * order to apply corrections to inheritance chains, ensuring a valid output\n * is produced.\n */\n public get customTransformers(): ts.CustomTransformers {\n return {\n afterDeclarations: [\n (context) => {\n const transformer = new DeprecationRemovalTransformer(\n this.typeChecker,\n context,\n this.transformations,\n this.nodesToRemove,\n );\n return transformer.transform.bind(transformer);\n },\n ],\n };\n }\n\n /**\n * Removes all `@deprecated` API elements from the provided assembly, and\n * records the operations needed in order to fix the inheritance chains that\n * mix `@deprecated` and non-`@deprecated` types.\n *\n * @param assembly the assembly to be modified.\n *\n * @returns diagnostic messages produced when validating no remaining API\n * makes use of a `@deprecated` type that was removed.\n */\n public removeFrom(assembly: Assembly): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const strippedFqns = new Set<string>();\n const replaceWithClass = new Map<string, string>();\n const replaceWithInterfaces = new Map<string, readonly string[]>();\n\n // Find all types that will be stripped out\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n if (typeInfo.docs?.stability === Stability.Deprecated) {\n if (!this.shouldFqnBeStripped(fqn)) {\n continue;\n }\n strippedFqns.add(fqn);\n\n if (isClassType(typeInfo) && typeInfo.base != null) {\n replaceWithClass.set(fqn, typeInfo.base);\n }\n if (isClassOrInterfaceType(typeInfo) && typeInfo.interfaces != null) {\n replaceWithInterfaces.set(fqn, typeInfo.interfaces);\n }\n\n this.nodesToRemove.add(bindings.getRelatedNode(typeInfo)!);\n }\n }\n\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n // Ignore `@deprecated` types\n if (strippedFqns.has(fqn)) {\n continue;\n }\n\n // Enums cannot have references to `@deprecated` types, but can have deprecated members\n if (isEnumType(typeInfo)) {\n const enumNode = bindings.getEnumRelatedNode(typeInfo)!;\n const members: EnumMember[] = [];\n for (const mem of typeInfo.members) {\n if (mem.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${mem.name}`)) {\n const matchingMemberNode = enumNode.members.find((enumMem) => enumMem.name.getText() === mem.name);\n if (matchingMemberNode) {\n this.nodesToRemove.add(matchingMemberNode);\n }\n } else {\n members.push(mem);\n }\n }\n typeInfo.members = members;\n continue;\n }\n\n // For classes, we erase `@deprecated` base classes, replacing as needed\n const additionalInterfaces = new Set<string>();\n if (isClassType(typeInfo) && typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n while (typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n const oldBase = assembly.types[typeInfo.base] as ClassType;\n if (oldBase.interfaces) for (const addFqn of oldBase.interfaces) additionalInterfaces.add(addFqn);\n typeInfo.base = replaceWithClass.get(typeInfo.base);\n }\n this.transformations.push(\n typeInfo.base != null\n ? Transformation.replaceBaseClass(\n this.typeChecker,\n bindings.getClassRelatedNode(typeInfo)!,\n typeInfo.base in assembly.types\n ? bindings.getClassRelatedNode(assembly.types[typeInfo.base] as ClassType) ?? typeInfo.base\n : typeInfo.base,\n )\n : Transformation.removeBaseClass(this.typeChecker, bindings.getClassRelatedNode(typeInfo)!),\n );\n }\n\n // Be defensive in case we add other kinds in the future\n if (!isClassOrInterfaceType(typeInfo)) {\n throw new Error(`Unhandled type encountered! ${JSON.stringify(typeInfo, null, 2)}`);\n }\n\n // Strip all `@deprecated` interfaces from the inheritance tree, replacing as needed\n if (typeInfo.interfaces?.some((addFqn) => strippedFqns.has(addFqn)) || additionalInterfaces.size > 0) {\n const originalSet = new Set(typeInfo.interfaces ?? []);\n const newSet = new Set<string>();\n\n const candidates = Array.from(new Set([...originalSet, ...additionalInterfaces]));\n while (candidates.length > 0) {\n const candidateFqn = candidates.pop()!;\n if (!strippedFqns.has(candidateFqn)) {\n newSet.add(candidateFqn);\n if (!originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.addInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n candidateFqn in assembly.types\n ? bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType) ?? candidateFqn\n : candidateFqn,\n ),\n );\n }\n continue;\n }\n if (originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.removeInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType)!,\n ),\n );\n }\n const replacement = replaceWithInterfaces.get(candidateFqn);\n if (replacement != null) {\n candidates.push(...replacement);\n }\n }\n\n typeInfo.interfaces = newSet.size > 0 ? Array.from(newSet).sort() : undefined;\n }\n\n // Drop all `@deprecated` members, and remove \"overrides\" from stripped types\n const methods: Method[] = [];\n const properties: Property[] = [];\n if (typeInfo.methods) {\n for (const meth of typeInfo.methods) {\n if (meth.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${meth.name}`)) {\n this.nodesToRemove.add(bindings.getMethodRelatedNode(meth)!);\n } else {\n methods.push(\n meth.overrides != null && strippedFqns.has(meth.overrides) ? { ...meth, overrides: undefined } : meth,\n );\n }\n }\n }\n typeInfo.methods = typeInfo.methods ? methods : undefined;\n if (typeInfo.properties) {\n for (const prop of typeInfo.properties) {\n if (prop.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${prop.name}`)) {\n this.nodesToRemove.add(bindings.getParameterRelatedNode(prop)!);\n } else {\n properties.push(\n prop.overrides != null && strippedFqns.has(prop.overrides) ? { ...prop, overrides: undefined } : prop,\n );\n }\n }\n }\n typeInfo.properties = typeInfo.properties ? properties : undefined;\n }\n\n const diagnostics = this.findLeftoverUseOfDeprecatedAPIs(assembly, strippedFqns);\n\n // Remove all `@deprecated` types, after we did everything, so we could\n // still access the related nodes from the assembly object.\n for (const fqn of strippedFqns) {\n if (this.shouldFqnBeStripped(fqn)) {\n delete assembly.types[fqn];\n }\n }\n\n return diagnostics;\n }\n\n private findLeftoverUseOfDeprecatedAPIs(assembly: Assembly, strippedFqns: Set<string>): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const result = new Array<JsiiDiagnostic>();\n\n for (const type of Object.values(assembly.types)) {\n if (isEnumType(type) || strippedFqns.has(type.fqn)) {\n continue;\n }\n if (isClassType(type) && type.initializer) {\n result.push(...this.verifyCallable(assembly, strippedFqns, type.initializer));\n }\n if (type.methods) {\n for (const method of type.methods) result.push(...this.verifyCallable(assembly, strippedFqns, method));\n }\n if (type.properties) {\n for (const property of type.properties) result.push(...this.verifyProperty(assembly, strippedFqns, property));\n }\n }\n\n return result;\n }\n\n private verifyCallable(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n method: Method | Initializer,\n ): readonly JsiiDiagnostic[] {\n const diagnostics = new Array<JsiiDiagnostic>();\n const deprecatedReturnFqn =\n isMethod(method) && method.returns && this.tryFindReference(method.returns.type, strippedFqns);\n if (deprecatedReturnFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedReturnFqn, 'Method', method, assembly));\n }\n\n if (method.parameters) {\n for (const parameter of method.parameters) {\n const deprecatedTypeFqn = this.tryFindReference(parameter.type, strippedFqns);\n if (deprecatedTypeFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedTypeFqn, 'Parameter', parameter, assembly));\n }\n }\n }\n return diagnostics;\n }\n\n private verifyProperty(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n property: Property,\n ): readonly JsiiDiagnostic[] {\n const deprecatedTypeFqn = this.tryFindReference(property.type, strippedFqns);\n if (deprecatedTypeFqn) {\n return [this.makeDiagnostic(deprecatedTypeFqn, 'Property', property, assembly)];\n }\n return [];\n }\n\n /**\n * Determines whether a `TypeReference` contains an FQN within a given set.\n *\n * @param ref the tested `TypeReference`.\n * @param fqns the set of FQNs that are being searched for.\n *\n * @returns the first FQN that was identified.\n */\n private tryFindReference(ref: TypeReference, fqns: ReadonlySet<string>): string | undefined {\n if (isNamedTypeReference(ref)) {\n return fqns.has(ref.fqn) ? ref.fqn : undefined;\n }\n if (isPrimitiveTypeReference(ref)) {\n return undefined;\n }\n if (isCollectionTypeReference(ref)) {\n return this.tryFindReference(ref.collection.elementtype, fqns);\n }\n return ref.union.types.map((type) => this.tryFindReference(type, fqns)).find((typeRef) => typeRef != null);\n }\n\n private shouldFqnBeStripped(fqn: string) {\n return this.allowlistedDeprecations?.has(fqn) ?? true;\n }\n\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method',\n context: Method | Initializer,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Parameter',\n context: Parameter,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(fqn: string, messagePrefix: 'Property', context: Property, assembly: Assembly): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method' | 'Property' | 'Parameter',\n context: Method | Initializer | Parameter | Property,\n assembly: Assembly,\n ): JsiiDiagnostic {\n const node = bindings.getRelatedNode<\n | ts.AccessorDeclaration\n | ts.MethodDeclaration\n | ts.MethodSignature\n | ts.ParameterDeclaration\n | ts.PropertyDeclaration\n | ts.PropertySignature\n >(context);\n const diagnostic = JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n node?.type ?? node!,\n `${messagePrefix} has @deprecated type ${fqn}, and it is erased by --strip-deprecated.`,\n );\n\n const typeInfo = assembly.types?.[fqn];\n const typeNode = typeInfo && bindings.getTypeRelatedNode(typeInfo);\n if (typeNode == null) {\n return diagnostic;\n }\n return diagnostic.addRelatedInformation(\n ts.getNameOfDeclaration(typeNode) ?? typeNode,\n 'The @deprecated type is declared here',\n );\n }\n}\n\nclass Transformation {\n public static addInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration) && !ts.isInterfaceDeclaration(declaration)) {\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n }\n\n const { typeExpression: newInterface, syntheticImport } = Transformation.typeReference(\n iface,\n declaration,\n typeChecker,\n );\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ImplementsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n }\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ExtendsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n\n function addInterfaceTo(\n token: ts.HeritageClause['token'],\n clauses: readonly ts.HeritageClause[] = [],\n ): ts.HeritageClause[] {\n const existingClause = clauses.find((clause) => clause.token === token);\n if (existingClause == null) {\n return [...clauses, ts.factory.createHeritageClause(token, [newInterface])];\n }\n return [\n ...clauses.filter((clause) => clause !== existingClause),\n ts.factory.updateHeritageClause(existingClause, [...existingClause.types, newInterface]),\n ];\n }\n });\n }\n\n public static replaceBaseClass(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration,\n baseClass: ts.ClassDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n const { typeExpression: newBaseClass, syntheticImport } = Transformation.typeReference(\n baseClass,\n declaration,\n typeChecker,\n );\n const existingClause = declaration.heritageClauses?.find(\n (clause) => clause.token === ts.SyntaxKind.ExtendsKeyword,\n );\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n [\n ...(declaration.heritageClauses ?? []).filter((clause) => clause !== existingClause),\n existingClause\n ? ts.factory.updateHeritageClause(existingClause, [newBaseClass])\n : ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [newBaseClass]),\n ],\n declaration.members,\n ),\n syntheticImports: syntheticImport && [syntheticImport],\n };\n });\n }\n\n public static removeBaseClass(typeChecker: ts.TypeChecker, node: ts.ClassDeclaration) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n declaration.heritageClauses?.filter((clause) => clause.token !== ts.SyntaxKind.ExtendsKeyword),\n declaration.members,\n ),\n };\n });\n }\n\n public static removeInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration,\n ) {\n const ifaceName = Transformation.fullyQualifiedName(typeChecker, iface)!;\n\n return new Transformation(typeChecker, node, (declaration) => {\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n } else if (ts.isInterfaceDeclaration(declaration)) {\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n }\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n });\n\n function removeInterfaceHeritage(\n clauses: readonly ts.HeritageClause[] | undefined,\n ): ts.HeritageClause[] | undefined {\n if (clauses == null) {\n return clauses;\n }\n return clauses\n .map((clause) => {\n const types = clause.types.filter(\n (type) => Transformation.fullyQualifiedName(typeChecker, type.expression) !== ifaceName,\n );\n if (types.length === clause.types.length) {\n // Means the interface was only transitively present...\n return clause;\n }\n if (types.length === 0) {\n return undefined;\n }\n return ts.factory.updateHeritageClause(clause, types);\n })\n .filter((clause) => clause != null) as ts.HeritageClause[];\n }\n }\n\n private static fullyQualifiedName(typeChecker: ts.TypeChecker, node: ts.Node): string | undefined {\n const symbol = typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(node as ts.Declaration) ?? node);\n // This symbol ☝️ does not contain enough information in some cases - when\n // an imported type is part of a heritage clause - to produce the fqn.\n // Round tripping this to its type and back to a symbol seems to fix this.\n const type = symbol && typeChecker.getDeclaredTypeOfSymbol(symbol);\n return type?.symbol && typeChecker.getFullyQualifiedName(type.symbol);\n }\n\n private static typeReference(\n type: ts.ClassDeclaration | ts.InterfaceDeclaration | string,\n context: ts.ClassDeclaration | ts.InterfaceDeclaration,\n typeChecker: ts.TypeChecker,\n ): {\n typeExpression: ts.ExpressionWithTypeArguments;\n syntheticImport?: ts.ImportDeclaration;\n } {\n context = ts.getOriginalNode(context) as any;\n\n const [, contextSource] = /^\"([^\"]+)\"\\..*$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(context)!)!),\n )!;\n\n let expression: ts.Expression;\n let syntheticImport: ts.ImportDeclaration | undefined;\n\n if (typeof type === 'string') {\n const [root, ...tail] = type.split('.');\n const syntheticImportName = ts.factory.createUniqueName(root);\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* decorators */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(root),\n );\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n } else {\n const [, typeSource, qualifiedName] = /^\"([^\"]+)\"\\.(.*)$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(type)!)!),\n )!;\n\n if (typeSource === contextSource) {\n const [root, ...tail] = qualifiedName.split('.');\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n ts.factory.createIdentifier(root) as ts.Expression,\n );\n } else {\n const syntheticImportName = ts.factory.createUniqueName(basename(typeSource));\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* modifiers */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(`./${relative(dirname(contextSource), typeSource)}`),\n undefined,\n );\n expression = qualifiedName\n .split('.')\n .reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n }\n }\n\n return {\n typeExpression: ts.factory.createExpressionWithTypeArguments(expression, undefined),\n syntheticImport,\n };\n }\n\n private readonly nodeName: string;\n\n private constructor(\n private readonly typeChecker: ts.TypeChecker,\n node: ts.Declaration,\n public readonly apply: (\n this: Transformation,\n node: ts.Node,\n ) => { node: ts.Node; syntheticImport?: ts.ImportDeclaration },\n ) {\n this.nodeName = Transformation.fullyQualifiedName(typeChecker, node)!;\n }\n\n public targets(node: ts.Declaration) {\n return this.nodeName === Transformation.fullyQualifiedName(this.typeChecker, node);\n }\n}\n\nclass DeprecationRemovalTransformer {\n /**\n * A list of SyntaxKinds for which it is not necessary to evaluate children,\n * since they are never of interest to this transform. This opens up a wee\n * optimization, which is particularly useful when trying to troubleshoot the\n * transform in a debugger (saves a TON of time stepping into useless nodes\n * then).\n */\n private static readonly IGNORE_CHILDREN: ReadonlySet<ts.SyntaxKind> = new Set([\n ts.SyntaxKind.Constructor,\n ts.SyntaxKind.FunctionDeclaration,\n ts.SyntaxKind.GetAccessor,\n ts.SyntaxKind.MethodDeclaration,\n ts.SyntaxKind.MethodSignature,\n ts.SyntaxKind.PropertySignature,\n ts.SyntaxKind.PropertyDeclaration,\n ts.SyntaxKind.SetAccessor,\n ts.SyntaxKind.VariableDeclaration,\n ]);\n\n private syntheticImports = new Array<ts.ImportDeclaration>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly context: ts.TransformationContext,\n private readonly transformations: readonly Transformation[],\n private readonly nodesToRemove: Set<ts.Node>,\n ) {}\n\n public transform<T extends ts.Node>(node: T): T {\n let result = this.visitEachChild(node);\n\n // If there are any synthetic imports, add them to the source file\n if (ts.isSourceFile(result) && this.syntheticImports.length > 0) {\n result = this.context.factory.updateSourceFile(\n result,\n [...this.syntheticImports, ...result.statements],\n result.isDeclarationFile,\n result.referencedFiles,\n result.typeReferenceDirectives,\n result.hasNoDefaultLib,\n result.libReferenceDirectives,\n ) as any;\n this.syntheticImports = new Array<ts.ImportDeclaration>();\n }\n\n return result;\n }\n\n private visitEachChild<T extends ts.Node>(node: T): T {\n return ts.visitEachChild(node, this.visitor.bind(this), this.context);\n }\n\n private visitor<T extends ts.Node>(node: T): ts.VisitResult<T> {\n if (this.isDeprecated(node)) {\n // Removing deprecated members by substituting \"nothing\" to them\n return [];\n }\n\n if (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) {\n for (const transformation of this.transformations) {\n // 👇 as any because the assignment below confuses type checker\n if (transformation.targets(node as any)) {\n const { node: transformedNode, syntheticImport } = transformation.apply(node);\n node = transformedNode as any;\n if (syntheticImport) {\n this.syntheticImports.push(syntheticImport);\n }\n }\n }\n }\n\n // Remove named imports of `@deprecated` members from the source...\n if (\n ts.isImportDeclaration(node) &&\n node.importClause &&\n node.importClause.namedBindings &&\n ts.isNamedImports(node.importClause.namedBindings)\n ) {\n const filteredElements = node.importClause.namedBindings.elements.filter((element) => {\n // This symbol is local (it's declaration points back to the named import)\n const symbol = this.typeChecker.getSymbolAtLocation(element.name);\n const exportedSymbol =\n // This \"resolves\" the imported type, so we can get to it's declaration(s)\n symbol && this.typeChecker.getDeclaredTypeOfSymbol(symbol)?.symbol;\n return !exportedSymbol?.declarations?.some((decl) => this.isDeprecated(decl));\n });\n if (filteredElements.length !== node.importClause.namedBindings.elements.length) {\n return this.context.factory.updateImportDeclaration(\n node,\n node.modifiers,\n node.importClause.name != null || filteredElements.length > 0\n ? this.context.factory.updateImportClause(\n node.importClause,\n node.importClause.isTypeOnly,\n node.importClause.name,\n this.context.factory.updateNamedImports(node.importClause.namedBindings, filteredElements),\n )\n : undefined,\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n\n return node;\n }\n\n // Replace \"export ... from ...\" places that no longer export anything\n // with an \"import from ...\", so side effects are preserved.\n if (ts.isExportDeclaration(node) && node.moduleSpecifier) {\n const symbol = this.typeChecker.getSymbolAtLocation(node.moduleSpecifier);\n const moduleExports =\n symbol &&\n this.typeChecker\n .getExportsOfModule(symbol)\n ?.filter((sym) => !sym.declarations?.some((decl) => this.isDeprecated(decl)));\n if ((node.exportClause == null || ts.isNamespaceExport(node.exportClause)) && moduleExports?.length === 0) {\n return this.context.factory.createImportDeclaration(\n undefined /* modifiers */,\n undefined /* importClause */,\n node.moduleSpecifier,\n ) as any;\n }\n\n if (node.exportClause != null && moduleExports) {\n const namedExports = node.exportClause as ts.NamedExports;\n const exportedNames = new Set(moduleExports.map((sym) => sym.name));\n const filteredElements = namedExports.elements?.filter((elt) => exportedNames.has(elt.name.text));\n if (filteredElements?.length !== namedExports.elements?.length) {\n return this.context.factory.updateExportDeclaration(\n node,\n node.modifiers,\n node.isTypeOnly,\n this.context.factory.updateNamedExports(namedExports, filteredElements),\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n }\n }\n\n return DeprecationRemovalTransformer.IGNORE_CHILDREN.has(node.kind) ? node : this.visitEachChild(node);\n }\n\n private isDeprecated(node: ts.Node): boolean {\n const original = ts.getOriginalNode(node);\n return (\n this.nodesToRemove.has(original) && ts.getJSDocTags(original).some((tag) => tag.tagName.text === 'deprecated')\n );\n }\n}\n"]}
|
package/lib/version.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */
|
2
|
-
export declare const SHORT_VERSION = "5.8.9-dev.
|
2
|
+
export declare const SHORT_VERSION = "5.8.9-dev.2";
|
3
3
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
4
|
-
export declare const VERSION = "5.8.9-dev.
|
4
|
+
export declare const VERSION = "5.8.9-dev.2 (build 6f5f72c)";
|
5
5
|
/** The release line identifier for this JSII compiler (e.g: `X.Y`) */
|
6
6
|
export declare const RELEASE_LINE = "5.8";
|
7
7
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
@@ -4,9 +4,9 @@ exports.RELEASE_LINE = exports.VERSION = exports.SHORT_VERSION = void 0;
|
|
4
4
|
const typescript_1 = require("typescript");
|
5
5
|
// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!
|
6
6
|
/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */
|
7
|
-
exports.SHORT_VERSION = '5.8.9-dev.
|
7
|
+
exports.SHORT_VERSION = '5.8.9-dev.2';
|
8
8
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
9
|
-
exports.VERSION = '5.8.9-dev.
|
9
|
+
exports.VERSION = '5.8.9-dev.2 (build 6f5f72c)';
|
10
10
|
/** The release line identifier for this JSII compiler (e.g: `X.Y`) */
|
11
11
|
exports.RELEASE_LINE = typescript_1.versionMajorMinor;
|
12
12
|
//# sourceMappingURL=version.js.map
|
package/lib/version.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,aAAa,CAAC;AAE3C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,6BAA6B,CAAC;AAErD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.8.9-dev.
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,aAAa,CAAC;AAE3C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,6BAA6B,CAAC;AAErD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.8.9-dev.2';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.8.9-dev.2 (build 6f5f72c)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
|
package/package.json
CHANGED
@@ -64,14 +64,14 @@
|
|
64
64
|
"npm": "^9.9.4",
|
65
65
|
"npm-check-updates": "^16",
|
66
66
|
"prettier": "^2.8.8",
|
67
|
-
"projen": "^0.
|
67
|
+
"projen": "^0.92.2",
|
68
68
|
"tar": "^6.2.1",
|
69
69
|
"ts-jest": "^29.3.2",
|
70
70
|
"ts-node": "^10.9.2"
|
71
71
|
},
|
72
72
|
"dependencies": {
|
73
|
-
"@jsii/check-node": "1.
|
74
|
-
"@jsii/spec": "^1.
|
73
|
+
"@jsii/check-node": "1.112.0",
|
74
|
+
"@jsii/spec": "^1.112.0",
|
75
75
|
"case": "^1.6.3",
|
76
76
|
"chalk": "^4",
|
77
77
|
"fast-deep-equal": "^3.1.3",
|
@@ -92,7 +92,7 @@
|
|
92
92
|
"publishConfig": {
|
93
93
|
"access": "public"
|
94
94
|
},
|
95
|
-
"version": "5.8.9-dev.
|
95
|
+
"version": "5.8.9-dev.2",
|
96
96
|
"types": "lib/index.d.ts",
|
97
97
|
"exports": {
|
98
98
|
".": "./lib/index.js",
|