jsii 5.9.36-dev.0 → 5.9.36-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assembler.d.ts +1 -0
- package/lib/assembler.js +9 -1
- package/lib/assembler.js.map +1 -1
- package/lib/jsii-diagnostic.d.ts +1 -0
- package/lib/jsii-diagnostic.js +5 -0
- package/lib/jsii-diagnostic.js.map +1 -1
- package/lib/transforms/deprecation-warnings.d.ts +3 -1
- package/lib/transforms/deprecation-warnings.js +29 -32
- package/lib/transforms/deprecation-warnings.js.map +1 -1
- package/lib/type-tracker.d.ts +13 -0
- package/lib/type-tracker.js +36 -0
- package/lib/type-tracker.js.map +1 -0
- package/lib/version.d.ts +2 -2
- package/lib/version.js +2 -2
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecation-warnings.js","sourceRoot":"","sources":["../../src/transforms/deprecation-warnings.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,kCAAkC;AAClC,mCAAmC;AAEnC,iCAAiC;AAEjC,mDAAuD;AAG1C,QAAA,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,qBAAqB,GAAG,OAAO,CAAC;AACtC,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,SAAS,GAAG,yBAAyB,CAAC;AAC5C,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAClD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAC7C,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAExD,MAAa,2BAA2B;IAKtC,YAAoC,WAA2B;QAA3B,gBAAW,GAAX,WAAW,CAAgB;QAJvD,iBAAY,GAA0B;YAC5C,MAAM,EAAE,EAAE;SACX,CAAC;IAEgE,CAAC;IAE5D,OAAO,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port * as spec from '@jsii/spec';\nimport { Assembly } from '@jsii/spec';\nimport * as ts from 'typescript';\n\nimport { symbolIdentifier } from '../common/symbol-id';\nimport { ProjectInfo } from '../project-info';\n\nexport const WARNINGSCODE_FILE_NAME = '.warnings.jsii.js';\nconst WARNING_FUNCTION_NAME = 'print';\nconst PARAMETER_NAME = 'p';\nconst FOR_LOOP_ITEM_NAME = 'o';\nconst NAMESPACE = 'jsiiDeprecationWarnings';\nconst LOCAL_ENUM_NAMESPACE = 'ns';\nconst VISITED_OBJECTS_SET_NAME = 'visitedObjects';\nconst DEPRECATION_ERROR = 'DeprecationError';\nconst GET_PROPERTY_DESCRIPTOR = 'getPropertyDescriptor';\n\nexport class DeprecationWarningsInjector {\n private transformers: ts.CustomTransformers = {\n before: [],\n };\n\n public constructor(private readonly typeChecker: ts.TypeChecker) {}\n\n public process(assembly: Assembly, projectInfo: ProjectInfo) {\n const projectRoot = projectInfo.projectRoot;\n const functionDeclarations: ts.FunctionDeclaration[] = [];\n\n const types = assembly.types ?? {};\n for (const type of Object.values(types)) {\n const statements: ts.Statement[] = [];\n let isEmpty = true;\n\n // This will add the parameter to the set of visited objects, to prevent infinite recursion\n statements.push(\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME), 'add'),\n undefined,\n [ts.factory.createIdentifier(PARAMETER_NAME)],\n ),\n ),\n );\n\n const tryStatements = [];\n if (spec.isDeprecated(type) && spec.isEnumType(type)) {\n // The type is deprecated\n tryStatements.push(createWarningFunctionCall(type.fqn, type.docs?.deprecated));\n isEmpty = false;\n }\n\n if (spec.isEnumType(type) && type.locationInModule?.filename) {\n tryStatements.push(createEnumRequireStatement(type.locationInModule?.filename));\n tryStatements.push(createDuplicateEnumValuesCheck(type));\n\n for (const member of Object.values(type.members ?? [])) {\n if (spec.isDeprecated(member)) {\n // The enum member is deprecated\n const condition = ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(PARAMETER_NAME),\n ts.SyntaxKind.EqualsEqualsEqualsToken,\n ts.factory.createPropertyAccessExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(LOCAL_ENUM_NAMESPACE), type.name),\n member.name,\n ),\n );\n tryStatements.push(\n createWarningFunctionCall(`${type.fqn}#${member.name}`, member.docs?.deprecated, condition),\n );\n isEmpty = false;\n }\n }\n } else if (spec.isInterfaceType(type) && type.datatype) {\n const { statementsByProp, excludedProps } = processInterfaceType(\n type,\n types,\n assembly,\n projectInfo,\n undefined,\n undefined,\n );\n\n for (const [name, statement] of statementsByProp.entries()) {\n if (!excludedProps.has(name)) {\n tryStatements.push(statement);\n isEmpty = false;\n }\n }\n }\n\n statements.push(\n ts.factory.createTryStatement(\n ts.factory.createBlock(tryStatements),\n undefined,\n ts.factory.createBlock([\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME),\n 'delete',\n ),\n undefined,\n [ts.factory.createIdentifier(PARAMETER_NAME)],\n ),\n ),\n ]),\n ),\n );\n\n const paramValue = ts.factory.createParameterDeclaration(undefined, undefined, PARAMETER_NAME);\n const functionName = fnName(type.fqn);\n const functionDeclaration = ts.factory.createFunctionDeclaration(\n undefined,\n undefined,\n ts.factory.createIdentifier(functionName),\n [],\n [paramValue],\n undefined,\n createFunctionBlock(isEmpty ? [] : statements),\n );\n functionDeclarations.push(functionDeclaration);\n }\n this.transformers = {\n before: [\n (context) => {\n const transformer = new Transformer(\n this.typeChecker,\n context,\n projectRoot,\n this.buildTypeIndex(assembly),\n assembly,\n );\n return transformer.transform.bind(transformer);\n },\n ],\n };\n generateWarningsFile(projectRoot, functionDeclarations);\n }\n\n public get customTransformers(): ts.CustomTransformers {\n return this.transformers;\n }\n\n private buildTypeIndex(assembly: Assembly): Map<string, spec.Type> {\n const result = new Map<string, spec.Type>();\n\n for (const type of Object.values(assembly.types ?? {})) {\n const symbolId = type.symbolId;\n if (symbolId) {\n result.set(symbolId, type);\n }\n }\n\n return result;\n }\n}\n\nfunction processInterfaceType(\n type: spec.InterfaceType,\n types: { [p: string]: spec.Type },\n assembly: Assembly,\n projectInfo: ProjectInfo,\n statementsByProp: Map<string, ts.Statement> = new Map<string, ts.Statement>(),\n excludedProps: Set<string> = new Set<string>(),\n) {\n for (const prop of Object.values(type.properties ?? {})) {\n const fqn = `${type.fqn}#${prop.name}`;\n if (spec.isDeprecated(prop) || spec.isDeprecated(type)) {\n // If the property individually is deprecated, or the entire type is deprecated\n const deprecatedDocs = prop.docs?.deprecated ?? type.docs?.deprecated;\n const statement = createWarningFunctionCall(\n fqn,\n deprecatedDocs,\n ts.factory.createBinaryExpression(\n ts.factory.createStringLiteral(prop.name),\n ts.SyntaxKind.InKeyword,\n ts.factory.createIdentifier(PARAMETER_NAME),\n ),\n undefined,\n );\n statementsByProp.set(prop.name, statement);\n } else {\n /* If a prop is not deprecated, we don't want to generate a warning for it,\n even if another property with the same name is deprecated in another\n super-interface. */\n excludedProps.add(prop.name);\n }\n\n if (spec.isNamedTypeReference(prop.type) && Object.keys(types).includes(prop.type.fqn)) {\n const functionName = importedFunctionName(prop.type.fqn, assembly, projectInfo);\n if (functionName) {\n const statement = createTypeHandlerCall(functionName, `${PARAMETER_NAME}.${prop.name}`);\n statementsByProp.set(`${prop.name}_`, statement);\n }\n } else if (\n spec.isCollectionTypeReference(prop.type) &&\n spec.isNamedTypeReference(prop.type.collection.elementtype)\n ) {\n const functionName = importedFunctionName(prop.type.collection.elementtype.fqn, assembly, projectInfo);\n if (functionName) {\n const statement = createTypeHandlerCall(\n functionName,\n `${PARAMETER_NAME}.${prop.name}`,\n prop.type.collection.kind,\n );\n statementsByProp.set(`${prop.name}_`, statement);\n }\n } else if (\n spec.isUnionTypeReference(prop.type) &&\n spec.isNamedTypeReference(prop.type.union.types[0]) &&\n Object.keys(types).includes(prop.type.union.types[0].fqn)\n ) {\n const functionName = importedFunctionName(prop.type.union.types[0].fqn, assembly, projectInfo);\n if (functionName) {\n const statement = createTypeHandlerCall(functionName, `${PARAMETER_NAME}.${prop.name}`);\n statementsByProp.set(`${prop.name}_`, statement);\n }\n }\n }\n\n // We also generate calls to all the supertypes\n for (const interfaceName of type.interfaces ?? []) {\n const assemblies = projectInfo.dependencyClosure.concat(assembly);\n const superType = findType(interfaceName, assemblies);\n if (superType.type) {\n processInterfaceType(\n superType.type as spec.InterfaceType,\n types,\n assembly,\n projectInfo,\n statementsByProp,\n excludedProps,\n );\n }\n }\n return { statementsByProp, excludedProps };\n}\n\nfunction fnName(fqn: string): string {\n return fqn.replace(/[^\\w\\d]/g, '_');\n}\n\nfunction createFunctionBlock(statements: ts.Statement[]): ts.Block {\n if (statements.length > 0) {\n const validation = ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(PARAMETER_NAME),\n ts.SyntaxKind.EqualsEqualsToken,\n ts.factory.createNull(),\n ),\n ts.factory.createReturnStatement(),\n );\n return ts.factory.createBlock([validation, ...statements], true);\n }\n return ts.factory.createBlock([], true);\n}\n\nfunction createWarningFunctionCall(\n fqn: string,\n message = '',\n condition?: ts.Expression,\n includeNamespace = false,\n): ts.Statement {\n const functionName = includeNamespace ? `${NAMESPACE}.${WARNING_FUNCTION_NAME}` : WARNING_FUNCTION_NAME;\n\n const mainStatement = ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [\n ts.factory.createStringLiteral(fqn),\n ts.factory.createStringLiteral(message),\n ]),\n );\n\n return condition ? ts.factory.createIfStatement(condition, mainStatement) : mainStatement;\n}\n\nfunction generateWarningsFile(projectRoot: string, functionDeclarations: ts.FunctionDeclaration[]) {\n const names = [...functionDeclarations].map((d) => d.name?.text).filter(Boolean);\n const exportedSymbols = [WARNING_FUNCTION_NAME, GET_PROPERTY_DESCRIPTOR, DEPRECATION_ERROR, ...names].join(',');\n\n const functionText = `function ${WARNING_FUNCTION_NAME}(name, deprecationMessage) {\n const deprecated = process.env.JSII_DEPRECATED;\n const deprecationMode = ['warn', 'fail', 'quiet'].includes(deprecated) ? deprecated : 'warn';\n const message = \\`\\${name} is deprecated.\\\\n \\${deprecationMessage.trim()}\\\\n This API will be removed in the next major release.\\`;\n switch (deprecationMode) {\n case \"fail\":\n throw new ${DEPRECATION_ERROR}(message);\n case \"warn\":\n console.warn(\"[WARNING]\", message);\n break;\n }\n}\n\nfunction ${GET_PROPERTY_DESCRIPTOR}(obj, prop) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (descriptor) {\n return descriptor;\n }\n const proto = Object.getPrototypeOf(obj);\n const prototypeDescriptor = proto && getPropertyDescriptor(proto, prop);\n if (prototypeDescriptor) {\n return prototypeDescriptor;\n }\n return {};\n}\n\nconst ${VISITED_OBJECTS_SET_NAME} = new Set();\n\nclass ${DEPRECATION_ERROR} extends Error {\n constructor(...args) {\n super(...args);\n Object.defineProperty(this, 'name', {\n configurable: false,\n enumerable: true,\n value: '${DEPRECATION_ERROR}',\n writable: false,\n });\n }\n}\n\nmodule.exports = {${exportedSymbols}}\n`;\n\n const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });\n const resultFile = ts.createSourceFile(\n path.join(projectRoot, WARNINGSCODE_FILE_NAME),\n functionText,\n ts.ScriptTarget.Latest,\n false,\n ts.ScriptKind.JS,\n );\n\n const declarations = functionDeclarations.map((declaration) =>\n printer.printNode(ts.EmitHint.Unspecified, declaration, resultFile),\n );\n\n const content = declarations.concat(printer.printFile(resultFile)).join('\\n');\n\n fs.writeFileSync(path.join(projectRoot, WARNINGSCODE_FILE_NAME), content);\n}\n\nclass Transformer {\n private warningCallsWereInjected = false;\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly context: ts.TransformationContext,\n private readonly projectRoot: string,\n private readonly typeIndex: Map<string, spec.Type>,\n private readonly assembly: Assembly,\n ) {}\n\n public transform<T extends ts.Node>(node: T): T {\n this.warningCallsWereInjected = false;\n\n const result = this.visitEachChild(node);\n\n if (ts.isSourceFile(result) && this.warningCallsWereInjected) {\n const importDir = path.relative(path.dirname(result.fileName), this.projectRoot);\n const importPath = importDir.startsWith('..')\n ? unixPath(path.join(importDir, WARNINGSCODE_FILE_NAME))\n : `./${WARNINGSCODE_FILE_NAME}`;\n\n return ts.factory.updateSourceFile(result, [\n createRequireStatement(NAMESPACE, importPath),\n ...result.statements,\n ]) as any;\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 (ts.isMethodDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateMethodDeclaration(\n node,\n node.modifiers,\n node.asteriskToken,\n node.name,\n node.questionToken,\n node.typeParameters,\n node.parameters,\n node.type,\n ts.factory.updateBlock(node.body, [\n ...wrapWithRethrow(\n statements,\n ts.factory.createPropertyAccessExpression(ts.factory.createThis(), node.name.getText(node.getSourceFile())),\n ),\n ...node.body.statements,\n ]),\n ) as any;\n } else if (ts.isGetAccessorDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateGetAccessorDeclaration(\n node,\n node.modifiers,\n node.name,\n node.parameters,\n node.type,\n ts.factory.updateBlock(node.body, [\n ...wrapWithRethrow(\n statements,\n ts.factory.createPropertyAccessExpression(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(NAMESPACE),\n GET_PROPERTY_DESCRIPTOR,\n ),\n undefined,\n [ts.factory.createThis(), ts.factory.createStringLiteral(node.name.getText(node.getSourceFile()))],\n ),\n 'get',\n ),\n ),\n ...node.body.statements,\n ]),\n ) as any;\n } else if (ts.isSetAccessorDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateSetAccessorDeclaration(\n node,\n node.modifiers,\n node.name,\n node.parameters,\n ts.factory.updateBlock(node.body, [\n ...wrapWithRethrow(\n statements,\n ts.factory.createPropertyAccessExpression(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(NAMESPACE),\n GET_PROPERTY_DESCRIPTOR,\n ),\n undefined,\n [ts.factory.createThis(), ts.factory.createStringLiteral(node.name.getText(node.getSourceFile()))],\n ),\n 'set',\n ),\n ),\n ...node.body.statements,\n ]),\n ) as any;\n } else if (ts.isConstructorDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateConstructorDeclaration(\n node,\n node.modifiers,\n node.parameters,\n ts.factory.updateBlock(node.body, insertStatements(node.body, wrapWithRethrow(statements, node.parent.name!))),\n ) as any;\n }\n\n return this.visitEachChild(node);\n }\n\n /**\n * @param getOrSet for property accessors, determines which of the getter or\n * setter should be used to get the caller function value.\n */\n private getStatementsForDeclaration(\n node: ts.MethodDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.ConstructorDeclaration,\n ): ts.Statement[] {\n const klass = node.parent;\n const classSymbolId = symbolIdentifier(this.typeChecker, this.typeChecker.getTypeAtLocation(klass).symbol);\n if (classSymbolId && this.typeIndex.has(classSymbolId)) {\n const classType = this.typeIndex.get(classSymbolId)! as spec.ClassType;\n\n if (ts.isConstructorDeclaration(node)) {\n const initializer = classType?.initializer;\n if (initializer) {\n return this.getStatements(classType, initializer);\n }\n }\n\n const methods = classType?.methods ?? [];\n const method = methods.find((m) => m.name === node.name?.getText());\n if (method) {\n return this.getStatements(classType, method);\n }\n\n const properties = classType?.properties ?? [];\n const property = properties.find((p) => p.name === node.name?.getText());\n if (property) {\n return createWarningStatementForElement(property, classType);\n }\n }\n return [];\n }\n\n private getStatements(classType: spec.ClassType, method: spec.Method | spec.Initializer) {\n const statements = createWarningStatementForElement(method, classType);\n for (const parameter of Object.values(method.parameters ?? {})) {\n const parameterType =\n this.assembly.types && spec.isNamedTypeReference(parameter.type)\n ? this.assembly.types[parameter.type.fqn]\n : undefined;\n\n if (parameterType) {\n const functionName = `${NAMESPACE}.${fnName(parameterType.fqn)}`;\n statements.push(\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [\n ts.factory.createIdentifier(parameter.name),\n ]),\n ),\n );\n }\n }\n\n return statements;\n }\n}\n\nfunction createWarningStatementForElement(\n element: spec.Callable | spec.Property,\n classType: spec.ClassType,\n): ts.Statement[] {\n if (spec.isDeprecated(element)) {\n const elementName = (element as spec.Method | spec.Property).name;\n const fqn = elementName ? `${classType.fqn}#${elementName}` : classType.fqn;\n const message = element.docs?.deprecated ?? classType.docs?.deprecated;\n return [createWarningFunctionCall(fqn, message, undefined, true)];\n }\n return [];\n}\n\n/**\n * Inserts a list of statements in the correct position inside a block of statements.\n * If there is a `super` call, It inserts the statements just after it. Otherwise,\n * insert the statements right at the beginning of the block.\n */\nfunction insertStatements(block: ts.Block, newStatements: ts.Statement[]) {\n function splicePoint(statement: ts.Statement | undefined) {\n if (statement == null) {\n return 0;\n }\n let isSuper = false;\n statement.forEachChild((node) => {\n if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.SuperKeyword) {\n isSuper = true;\n }\n });\n return isSuper ? 1 : 0;\n }\n\n const result = [...block.statements];\n result.splice(splicePoint(block.statements[0]), 0, ...newStatements);\n return ts.factory.createNodeArray(result);\n}\n\nfunction createEnumRequireStatement(typeLocation: string): ts.Statement {\n const { ext } = path.parse(typeLocation);\n const jsFileName = typeLocation.replace(ext, '.js');\n\n return createRequireStatement(LOCAL_ENUM_NAMESPACE, `./${jsFileName}`);\n}\n\nfunction createRequireStatement(name: string, importPath: string): ts.Statement {\n return ts.factory.createVariableStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [\n ts.factory.createVariableDeclaration(\n name,\n undefined,\n undefined,\n ts.factory.createCallExpression(ts.factory.createIdentifier('require'), undefined, [\n ts.factory.createStringLiteral(importPath),\n ]),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n );\n}\n\n/**\n * Returns a ready-to-used function name (including a `require`, if necessary)\n */\nfunction importedFunctionName(typeName: string, assembly: Assembly, projectInfo: ProjectInfo) {\n const assemblies = projectInfo.dependencyClosure.concat(assembly);\n const { type, moduleName } = findType(typeName, assemblies);\n if (type) {\n return moduleName !== assembly.name\n ? `require(\"${moduleName}/${WARNINGSCODE_FILE_NAME}\").${fnName(type.fqn)}`\n : fnName(type.fqn);\n }\n return undefined;\n}\n\n/**\n * Find the type and module name in an array of assemblies\n * matching a given type name\n */\nfunction findType(typeName: string, assemblies: Assembly[]) {\n for (const asm of assemblies) {\n if (asm.metadata?.jsii?.compiledWithDeprecationWarnings) {\n const types = asm.types ?? {};\n for (const name of Object.keys(types)) {\n if (typeName === name) {\n return { type: types[name], moduleName: asm.name };\n }\n }\n }\n }\n return {};\n}\n\nfunction createTypeHandlerCall(\n functionName: string,\n parameter: string,\n collectionKind?: spec.CollectionKind,\n): ts.Statement {\n switch (collectionKind) {\n case spec.CollectionKind.Array:\n return ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(parameter),\n ts.SyntaxKind.ExclamationEqualsToken,\n ts.factory.createNull(),\n ),\n ts.factory.createForOfStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [ts.factory.createVariableDeclaration(FOR_LOOP_ITEM_NAME)],\n ts.NodeFlags.Const,\n ),\n ts.factory.createIdentifier(parameter),\n createTypeHandlerCall(functionName, FOR_LOOP_ITEM_NAME),\n ),\n );\n case spec.CollectionKind.Map:\n return ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(parameter),\n ts.SyntaxKind.ExclamationEqualsToken,\n ts.factory.createNull(),\n ),\n ts.factory.createForOfStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [ts.factory.createVariableDeclaration(FOR_LOOP_ITEM_NAME)],\n ts.NodeFlags.Const,\n ),\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('Object'), 'values'),\n undefined,\n [ts.factory.createIdentifier(parameter)],\n ),\n createTypeHandlerCall(functionName, FOR_LOOP_ITEM_NAME),\n ),\n );\n case undefined:\n return ts.factory.createIfStatement(\n ts.factory.createPrefixUnaryExpression(\n ts.SyntaxKind.ExclamationToken,\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME),\n ts.factory.createIdentifier('has'),\n ),\n undefined,\n [ts.factory.createIdentifier(parameter)],\n ),\n ),\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [\n ts.factory.createIdentifier(parameter),\n ]),\n ),\n );\n }\n}\n\n/**\n * There is a chance an enum contains duplicates values with distinct keys,\n * with one of those keys being deprecated. This is a potential pattern to \"rename\" an enum.\n * In this case, we can't concretely determine if the deprecated member was used or not,\n * so in those cases we skip the warnings altogether, rather than erroneously warning for valid usage.\n * This create a statement to check if the enum value is a duplicate:\n *\n * if (Object.values(Foo).filter(x => x === p).length > 1) { return; }\n *\n * Note that we can't just check the assembly for these duplicates, due to:\n * https://github.com/aws/jsii/issues/2782\n */\nfunction createDuplicateEnumValuesCheck(type: spec.TypeBase & spec.EnumType): ts.Statement {\n return ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('Object'), 'values'),\n undefined,\n [ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(LOCAL_ENUM_NAMESPACE), type.name)],\n ),\n ts.factory.createIdentifier('filter'),\n ),\n undefined,\n [\n ts.factory.createArrowFunction(\n undefined,\n undefined,\n [ts.factory.createParameterDeclaration(undefined, undefined, 'x')],\n undefined,\n ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier('x'),\n ts.factory.createToken(ts.SyntaxKind.EqualsEqualsEqualsToken),\n ts.factory.createIdentifier(PARAMETER_NAME),\n ),\n ),\n ],\n ),\n ts.factory.createIdentifier('length'),\n ),\n ts.factory.createToken(ts.SyntaxKind.GreaterThanToken),\n ts.factory.createNumericLiteral('1'),\n ),\n ts.factory.createReturnStatement(),\n );\n}\n\n// We try-then-rethrow exceptions to avoid runtimes displaying an uncanny wall of text if the place\n// where the error was thrown is webpacked. For example, jest somehow manages to capture the throw\n// location and renders the source line (which may be the whole file) when bundled.\nfunction wrapWithRethrow(statements: ts.Statement[], caller: ts.Expression): ts.Statement[] {\n if (statements.length === 0) {\n return statements;\n }\n return [\n ts.factory.createTryStatement(\n ts.factory.createBlock(statements),\n ts.factory.createCatchClause(\n ts.factory.createVariableDeclaration('error'),\n ts.factory.createBlock([\n // If this is a DeprecationError, trim its stack trace to surface level before re-throwing,\n // so we don't carry out possibly confusing frames from injected code. That can be toggled\n // off by setting JSII_DEBUG=1, so we can also diagnose in-injected code faults.\n ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createBinaryExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('process'), 'env'),\n 'JSII_DEBUG',\n ),\n ts.SyntaxKind.ExclamationEqualsEqualsToken,\n ts.factory.createStringLiteral('1'),\n ),\n ts.SyntaxKind.AmpersandAmpersandToken,\n ts.factory.createBinaryExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('error'), 'name'),\n ts.SyntaxKind.EqualsEqualsEqualsToken,\n ts.factory.createStringLiteral(DEPRECATION_ERROR),\n ),\n ),\n ts.factory.createBlock([\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('Error'), 'captureStackTrace'),\n undefined,\n [ts.factory.createIdentifier('error'), caller],\n ),\n ),\n ]),\n ),\n ts.factory.createThrowStatement(ts.factory.createIdentifier('error')),\n ]),\n ),\n undefined,\n ),\n ];\n}\n\n/**\n * Force a path to be UNIXy (use `/` as a separator)\n *\n * `path.join()` etc. will use the system-dependent path separator (either `/` or `\\`\n * depending on your platform).\n *\n * However, if we actually emit the path-dependent separator to the `.js` files, then\n * files compiled with jsii on Windows cannot be used on any other platform. That seems\n * like an unnecessary restriction, especially since a `/` will work fine on Windows,\n * so make sure to always emit `/`.\n *\n * TSC itself always strictly emits `/` (or at least, emits the same what you put in).\n */\nfunction unixPath(filePath: string) {\n if (path.sep === '\\\\') {\n return filePath.replace(/\\\\/g, '/');\n }\n return filePath;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deprecation-warnings.js","sourceRoot":"","sources":["../../src/transforms/deprecation-warnings.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,kCAAkC;AAClC,mCAAmC;AAEnC,iCAAiC;AAEjC,mDAAuD;AAI1C,QAAA,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,qBAAqB,GAAG,OAAO,CAAC;AACtC,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,SAAS,GAAG,yBAAyB,CAAC;AAC5C,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAClD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAC7C,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AAExD,MAAa,2BAA2B;IAKtC,YAAoC,WAA2B,EAAmB,WAAwB;QAAtE,gBAAW,GAAX,WAAW,CAAgB;QAAmB,gBAAW,GAAX,WAAW,CAAa;QAJlG,iBAAY,GAA0B;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,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as spec from '@jsii/spec';\nimport { Assembly } from '@jsii/spec';\nimport * as ts from 'typescript';\n\nimport { symbolIdentifier } from '../common/symbol-id';\nimport { ProjectInfo } from '../project-info';\nimport { TypeTracker } from '../type-tracker';\n\nexport const WARNINGSCODE_FILE_NAME = '.warnings.jsii.js';\nconst WARNING_FUNCTION_NAME = 'print';\nconst PARAMETER_NAME = 'p';\nconst FOR_LOOP_ITEM_NAME = 'o';\nconst NAMESPACE = 'jsiiDeprecationWarnings';\nconst VISITED_OBJECTS_SET_NAME = 'visitedObjects';\nconst DEPRECATION_ERROR = 'DeprecationError';\nconst GET_PROPERTY_DESCRIPTOR = 'getPropertyDescriptor';\n\nexport class DeprecationWarningsInjector {\n private transformers: ts.CustomTransformers = {\n before: [],\n };\n\n public constructor(private readonly typeChecker: ts.TypeChecker, private readonly typeTracker: TypeTracker) {}\n\n public process(assembly: Assembly, projectInfo: ProjectInfo) {\n const projectRoot = projectInfo.projectRoot;\n const functionDeclarations: ts.FunctionDeclaration[] = [];\n\n const types = assembly.types ?? {};\n for (const type of Object.values(types)) {\n const statements: ts.Statement[] = [];\n let isEmpty = true;\n\n // This will add the parameter to the set of visited objects, to prevent infinite recursion\n statements.push(\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME), 'add'),\n undefined,\n [ts.factory.createIdentifier(PARAMETER_NAME)],\n ),\n ),\n );\n\n const tryStatements = [];\n if (spec.isDeprecated(type) && spec.isEnumType(type)) {\n // The type is deprecated\n tryStatements.push(createWarningFunctionCall(type.fqn, type.docs?.deprecated));\n isEmpty = false;\n }\n\n if (spec.isEnumType(type) && type.locationInModule?.filename) {\n // Check for deprecated enum members\n //\n // We need to compare to the value of the deprecated enum. We can do that in one of 2 ways:\n //\n // - Compare against `require('./actual-file').EnumType.SOME_ENUM_MEMBER`\n // - Look up the enum member value and compare against `'some-enum-member'`.\n //\n // The first one introduces a circular dependency between this file and `actual-file.js`, so we\n // will go with the second.\n //\n // One complication: two enum members can have the same value (shouldn't, but can!) where\n // one symbolic name is deprecated but the other isn't. In that case we don't treat it as deprecated.\n const memDecls = this.typeTracker.getEnumMembers(type.fqn);\n\n const nonDeprecatedValues = new Set(\n (type.members ?? [])\n .filter((m) => !spec.isDeprecated(m))\n .map((m) => this.typeChecker.getConstantValue(memDecls[m.name])!),\n );\n const deprecatedMembers = (type.members ?? []).filter(spec.isDeprecated);\n\n for (const member of deprecatedMembers) {\n const constantValue = this.typeChecker.getConstantValue(memDecls[member.name])!;\n if (nonDeprecatedValues.has(constantValue)) {\n // Collission with non-deprecated enum member\n continue;\n }\n\n const condition = ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(PARAMETER_NAME),\n ts.SyntaxKind.EqualsEqualsEqualsToken,\n typeof constantValue === 'string'\n ? ts.factory.createStringLiteral(constantValue)\n : ts.factory.createNumericLiteral(constantValue),\n );\n tryStatements.push(\n createWarningFunctionCall(`${type.fqn}#${member.name}`, member.docs?.deprecated, condition),\n );\n isEmpty = false;\n }\n } else if (spec.isInterfaceType(type) && type.datatype) {\n const { statementsByProp, excludedProps } = processInterfaceType(\n type,\n types,\n assembly,\n projectInfo,\n undefined,\n undefined,\n );\n\n for (const [name, statement] of statementsByProp.entries()) {\n if (!excludedProps.has(name)) {\n tryStatements.push(statement);\n isEmpty = false;\n }\n }\n }\n\n statements.push(\n ts.factory.createTryStatement(\n ts.factory.createBlock(tryStatements),\n undefined,\n ts.factory.createBlock([\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME),\n 'delete',\n ),\n undefined,\n [ts.factory.createIdentifier(PARAMETER_NAME)],\n ),\n ),\n ]),\n ),\n );\n\n const paramValue = ts.factory.createParameterDeclaration(undefined, undefined, PARAMETER_NAME);\n const functionName = fnName(type.fqn);\n const functionDeclaration = ts.factory.createFunctionDeclaration(\n undefined,\n undefined,\n ts.factory.createIdentifier(functionName),\n [],\n [paramValue],\n undefined,\n createFunctionBlock(isEmpty ? [] : statements),\n );\n functionDeclarations.push(functionDeclaration);\n }\n this.transformers = {\n before: [\n (context) => {\n const transformer = new Transformer(\n this.typeChecker,\n context,\n projectRoot,\n this.buildTypeIndex(assembly),\n assembly,\n );\n return transformer.transform.bind(transformer);\n },\n ],\n };\n generateWarningsFile(projectRoot, functionDeclarations);\n }\n\n public get customTransformers(): ts.CustomTransformers {\n return this.transformers;\n }\n\n private buildTypeIndex(assembly: Assembly): Map<string, spec.Type> {\n const result = new Map<string, spec.Type>();\n\n for (const type of Object.values(assembly.types ?? {})) {\n const symbolId = type.symbolId;\n if (symbolId) {\n result.set(symbolId, type);\n }\n }\n\n return result;\n }\n}\n\nfunction processInterfaceType(\n type: spec.InterfaceType,\n types: { [p: string]: spec.Type },\n assembly: Assembly,\n projectInfo: ProjectInfo,\n statementsByProp: Map<string, ts.Statement> = new Map<string, ts.Statement>(),\n excludedProps: Set<string> = new Set<string>(),\n) {\n for (const prop of Object.values(type.properties ?? {})) {\n const fqn = `${type.fqn}#${prop.name}`;\n if (spec.isDeprecated(prop) || spec.isDeprecated(type)) {\n // If the property individually is deprecated, or the entire type is deprecated\n const deprecatedDocs = prop.docs?.deprecated ?? type.docs?.deprecated;\n const statement = createWarningFunctionCall(\n fqn,\n deprecatedDocs,\n ts.factory.createBinaryExpression(\n ts.factory.createStringLiteral(prop.name),\n ts.SyntaxKind.InKeyword,\n ts.factory.createIdentifier(PARAMETER_NAME),\n ),\n undefined,\n );\n statementsByProp.set(prop.name, statement);\n } else {\n /* If a prop is not deprecated, we don't want to generate a warning for it,\n even if another property with the same name is deprecated in another\n super-interface. */\n excludedProps.add(prop.name);\n }\n\n if (spec.isNamedTypeReference(prop.type) && Object.keys(types).includes(prop.type.fqn)) {\n const functionName = importedFunctionName(prop.type.fqn, assembly, projectInfo);\n if (functionName) {\n const statement = createTypeHandlerCall(functionName, `${PARAMETER_NAME}.${prop.name}`);\n statementsByProp.set(`${prop.name}_`, statement);\n }\n } else if (\n spec.isCollectionTypeReference(prop.type) &&\n spec.isNamedTypeReference(prop.type.collection.elementtype)\n ) {\n const functionName = importedFunctionName(prop.type.collection.elementtype.fqn, assembly, projectInfo);\n if (functionName) {\n const statement = createTypeHandlerCall(\n functionName,\n `${PARAMETER_NAME}.${prop.name}`,\n prop.type.collection.kind,\n );\n statementsByProp.set(`${prop.name}_`, statement);\n }\n } else if (\n spec.isUnionTypeReference(prop.type) &&\n spec.isNamedTypeReference(prop.type.union.types[0]) &&\n Object.keys(types).includes(prop.type.union.types[0].fqn)\n ) {\n const functionName = importedFunctionName(prop.type.union.types[0].fqn, assembly, projectInfo);\n if (functionName) {\n const statement = createTypeHandlerCall(functionName, `${PARAMETER_NAME}.${prop.name}`);\n statementsByProp.set(`${prop.name}_`, statement);\n }\n }\n }\n\n // We also generate calls to all the supertypes\n for (const interfaceName of type.interfaces ?? []) {\n const assemblies = projectInfo.dependencyClosure.concat(assembly);\n const superType = findType(interfaceName, assemblies);\n if (superType.type) {\n processInterfaceType(\n superType.type as spec.InterfaceType,\n types,\n assembly,\n projectInfo,\n statementsByProp,\n excludedProps,\n );\n }\n }\n return { statementsByProp, excludedProps };\n}\n\nfunction fnName(fqn: string): string {\n return fqn.replace(/[^\\w\\d]/g, '_');\n}\n\nfunction createFunctionBlock(statements: ts.Statement[]): ts.Block {\n if (statements.length > 0) {\n const validation = ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(PARAMETER_NAME),\n ts.SyntaxKind.EqualsEqualsToken,\n ts.factory.createNull(),\n ),\n ts.factory.createReturnStatement(),\n );\n return ts.factory.createBlock([validation, ...statements], true);\n }\n return ts.factory.createBlock([], true);\n}\n\nfunction createWarningFunctionCall(\n fqn: string,\n message = '',\n condition?: ts.Expression,\n includeNamespace = false,\n): ts.Statement {\n const functionName = includeNamespace ? `${NAMESPACE}.${WARNING_FUNCTION_NAME}` : WARNING_FUNCTION_NAME;\n\n const mainStatement = ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [\n ts.factory.createStringLiteral(fqn),\n ts.factory.createStringLiteral(message),\n ]),\n );\n\n return condition ? ts.factory.createIfStatement(condition, mainStatement) : mainStatement;\n}\n\nfunction generateWarningsFile(projectRoot: string, functionDeclarations: ts.FunctionDeclaration[]) {\n const names = [...functionDeclarations].map((d) => d.name?.text).filter(Boolean);\n const exportedSymbols = [WARNING_FUNCTION_NAME, GET_PROPERTY_DESCRIPTOR, DEPRECATION_ERROR, ...names].join(',');\n\n const functionText = `function ${WARNING_FUNCTION_NAME}(name, deprecationMessage) {\n const deprecated = process.env.JSII_DEPRECATED;\n const deprecationMode = ['warn', 'fail', 'quiet'].includes(deprecated) ? deprecated : 'warn';\n const message = \\`\\${name} is deprecated.\\\\n \\${deprecationMessage.trim()}\\\\n This API will be removed in the next major release.\\`;\n switch (deprecationMode) {\n case \"fail\":\n throw new ${DEPRECATION_ERROR}(message);\n case \"warn\":\n console.warn(\"[WARNING]\", message);\n break;\n }\n}\n\nfunction ${GET_PROPERTY_DESCRIPTOR}(obj, prop) {\n const descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n if (descriptor) {\n return descriptor;\n }\n const proto = Object.getPrototypeOf(obj);\n const prototypeDescriptor = proto && getPropertyDescriptor(proto, prop);\n if (prototypeDescriptor) {\n return prototypeDescriptor;\n }\n return {};\n}\n\nconst ${VISITED_OBJECTS_SET_NAME} = new Set();\n\nclass ${DEPRECATION_ERROR} extends Error {\n constructor(...args) {\n super(...args);\n Object.defineProperty(this, 'name', {\n configurable: false,\n enumerable: true,\n value: '${DEPRECATION_ERROR}',\n writable: false,\n });\n }\n}\n\nmodule.exports = {${exportedSymbols}}\n`;\n\n const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });\n const resultFile = ts.createSourceFile(\n path.join(projectRoot, WARNINGSCODE_FILE_NAME),\n functionText,\n ts.ScriptTarget.Latest,\n false,\n ts.ScriptKind.JS,\n );\n\n const declarations = functionDeclarations.map((declaration) =>\n printer.printNode(ts.EmitHint.Unspecified, declaration, resultFile),\n );\n\n const content = declarations.concat(printer.printFile(resultFile)).join('\\n');\n\n fs.writeFileSync(path.join(projectRoot, WARNINGSCODE_FILE_NAME), content);\n}\n\nclass Transformer {\n private warningCallsWereInjected = false;\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly context: ts.TransformationContext,\n private readonly projectRoot: string,\n private readonly typeIndex: Map<string, spec.Type>,\n private readonly assembly: Assembly,\n ) {}\n\n public transform<T extends ts.Node>(node: T): T {\n this.warningCallsWereInjected = false;\n\n const result = this.visitEachChild(node);\n\n if (ts.isSourceFile(result) && this.warningCallsWereInjected) {\n const importDir = path.relative(path.dirname(result.fileName), this.projectRoot);\n const importPath = importDir.startsWith('..')\n ? unixPath(path.join(importDir, WARNINGSCODE_FILE_NAME))\n : `./${WARNINGSCODE_FILE_NAME}`;\n\n return ts.factory.updateSourceFile(result, [\n createRequireStatement(NAMESPACE, importPath),\n ...result.statements,\n ]) as any;\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 (ts.isMethodDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateMethodDeclaration(\n node,\n node.modifiers,\n node.asteriskToken,\n node.name,\n node.questionToken,\n node.typeParameters,\n node.parameters,\n node.type,\n ts.factory.updateBlock(node.body, [\n ...wrapWithRethrow(\n statements,\n ts.factory.createPropertyAccessExpression(ts.factory.createThis(), node.name.getText(node.getSourceFile())),\n ),\n ...node.body.statements,\n ]),\n ) as any;\n } else if (ts.isGetAccessorDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateGetAccessorDeclaration(\n node,\n node.modifiers,\n node.name,\n node.parameters,\n node.type,\n ts.factory.updateBlock(node.body, [\n ...wrapWithRethrow(\n statements,\n ts.factory.createPropertyAccessExpression(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(NAMESPACE),\n GET_PROPERTY_DESCRIPTOR,\n ),\n undefined,\n [ts.factory.createThis(), ts.factory.createStringLiteral(node.name.getText(node.getSourceFile()))],\n ),\n 'get',\n ),\n ),\n ...node.body.statements,\n ]),\n ) as any;\n } else if (ts.isSetAccessorDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateSetAccessorDeclaration(\n node,\n node.modifiers,\n node.name,\n node.parameters,\n ts.factory.updateBlock(node.body, [\n ...wrapWithRethrow(\n statements,\n ts.factory.createPropertyAccessExpression(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(NAMESPACE),\n GET_PROPERTY_DESCRIPTOR,\n ),\n undefined,\n [ts.factory.createThis(), ts.factory.createStringLiteral(node.name.getText(node.getSourceFile()))],\n ),\n 'set',\n ),\n ),\n ...node.body.statements,\n ]),\n ) as any;\n } else if (ts.isConstructorDeclaration(node) && node.body != null) {\n const statements = this.getStatementsForDeclaration(node);\n this.warningCallsWereInjected = this.warningCallsWereInjected || statements.length > 0;\n return ts.factory.updateConstructorDeclaration(\n node,\n node.modifiers,\n node.parameters,\n ts.factory.updateBlock(node.body, insertStatements(node.body, wrapWithRethrow(statements, node.parent.name!))),\n ) as any;\n }\n\n return this.visitEachChild(node);\n }\n\n /**\n * @param getOrSet for property accessors, determines which of the getter or\n * setter should be used to get the caller function value.\n */\n private getStatementsForDeclaration(\n node: ts.MethodDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.ConstructorDeclaration,\n ): ts.Statement[] {\n const klass = node.parent;\n const classSymbolId = symbolIdentifier(this.typeChecker, this.typeChecker.getTypeAtLocation(klass).symbol);\n if (classSymbolId && this.typeIndex.has(classSymbolId)) {\n const classType = this.typeIndex.get(classSymbolId)! as spec.ClassType;\n\n if (ts.isConstructorDeclaration(node)) {\n const initializer = classType?.initializer;\n if (initializer) {\n return this.getStatements(classType, initializer);\n }\n }\n\n const methods = classType?.methods ?? [];\n const method = methods.find((m) => m.name === node.name?.getText());\n if (method) {\n return this.getStatements(classType, method);\n }\n\n const properties = classType?.properties ?? [];\n const property = properties.find((p) => p.name === node.name?.getText());\n if (property) {\n return createWarningStatementForElement(property, classType);\n }\n }\n return [];\n }\n\n private getStatements(classType: spec.ClassType, method: spec.Method | spec.Initializer) {\n const statements = createWarningStatementForElement(method, classType);\n for (const parameter of Object.values(method.parameters ?? {})) {\n const parameterType =\n this.assembly.types && spec.isNamedTypeReference(parameter.type)\n ? this.assembly.types[parameter.type.fqn]\n : undefined;\n\n if (parameterType) {\n const functionName = `${NAMESPACE}.${fnName(parameterType.fqn)}`;\n statements.push(\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [\n ts.factory.createIdentifier(parameter.name),\n ]),\n ),\n );\n }\n }\n\n return statements;\n }\n}\n\nfunction createWarningStatementForElement(\n element: spec.Callable | spec.Property,\n classType: spec.ClassType,\n): ts.Statement[] {\n if (spec.isDeprecated(element)) {\n const elementName = (element as spec.Method | spec.Property).name;\n const fqn = elementName ? `${classType.fqn}#${elementName}` : classType.fqn;\n const message = element.docs?.deprecated ?? classType.docs?.deprecated;\n return [createWarningFunctionCall(fqn, message, undefined, true)];\n }\n return [];\n}\n\n/**\n * Inserts a list of statements in the correct position inside a block of statements.\n * If there is a `super` call, It inserts the statements just after it. Otherwise,\n * insert the statements right at the beginning of the block.\n */\nfunction insertStatements(block: ts.Block, newStatements: ts.Statement[]) {\n function splicePoint(statement: ts.Statement | undefined) {\n if (statement == null) {\n return 0;\n }\n let isSuper = false;\n statement.forEachChild((node) => {\n if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.SuperKeyword) {\n isSuper = true;\n }\n });\n return isSuper ? 1 : 0;\n }\n\n const result = [...block.statements];\n result.splice(splicePoint(block.statements[0]), 0, ...newStatements);\n return ts.factory.createNodeArray(result);\n}\n\nfunction createRequireStatement(name: string, importPath: string): ts.Statement {\n return ts.factory.createVariableStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [\n ts.factory.createVariableDeclaration(\n name,\n undefined,\n undefined,\n ts.factory.createCallExpression(ts.factory.createIdentifier('require'), undefined, [\n ts.factory.createStringLiteral(importPath),\n ]),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n );\n}\n\n/**\n * Returns a ready-to-used function name (including a `require`, if necessary)\n */\nfunction importedFunctionName(typeName: string, assembly: Assembly, projectInfo: ProjectInfo) {\n const assemblies = projectInfo.dependencyClosure.concat(assembly);\n const { type, moduleName } = findType(typeName, assemblies);\n if (type) {\n return moduleName !== assembly.name\n ? `require(\"${moduleName}/${WARNINGSCODE_FILE_NAME}\").${fnName(type.fqn)}`\n : fnName(type.fqn);\n }\n return undefined;\n}\n\n/**\n * Find the type and module name in an array of assemblies\n * matching a given type name\n */\nfunction findType(typeName: string, assemblies: Assembly[]) {\n for (const asm of assemblies) {\n if (asm.metadata?.jsii?.compiledWithDeprecationWarnings) {\n const types = asm.types ?? {};\n for (const name of Object.keys(types)) {\n if (typeName === name) {\n return { type: types[name], moduleName: asm.name };\n }\n }\n }\n }\n return {};\n}\n\nfunction createTypeHandlerCall(\n functionName: string,\n parameter: string,\n collectionKind?: spec.CollectionKind,\n): ts.Statement {\n switch (collectionKind) {\n case spec.CollectionKind.Array:\n return ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(parameter),\n ts.SyntaxKind.ExclamationEqualsToken,\n ts.factory.createNull(),\n ),\n ts.factory.createForOfStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [ts.factory.createVariableDeclaration(FOR_LOOP_ITEM_NAME)],\n ts.NodeFlags.Const,\n ),\n ts.factory.createIdentifier(parameter),\n createTypeHandlerCall(functionName, FOR_LOOP_ITEM_NAME),\n ),\n );\n case spec.CollectionKind.Map:\n return ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createIdentifier(parameter),\n ts.SyntaxKind.ExclamationEqualsToken,\n ts.factory.createNull(),\n ),\n ts.factory.createForOfStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [ts.factory.createVariableDeclaration(FOR_LOOP_ITEM_NAME)],\n ts.NodeFlags.Const,\n ),\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('Object'), 'values'),\n undefined,\n [ts.factory.createIdentifier(parameter)],\n ),\n createTypeHandlerCall(functionName, FOR_LOOP_ITEM_NAME),\n ),\n );\n case undefined:\n return ts.factory.createIfStatement(\n ts.factory.createPrefixUnaryExpression(\n ts.SyntaxKind.ExclamationToken,\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME),\n ts.factory.createIdentifier('has'),\n ),\n undefined,\n [ts.factory.createIdentifier(parameter)],\n ),\n ),\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [\n ts.factory.createIdentifier(parameter),\n ]),\n ),\n );\n }\n}\n\n// We try-then-rethrow exceptions to avoid runtimes displaying an uncanny wall of text if the place\n// where the error was thrown is webpacked. For example, jest somehow manages to capture the throw\n// location and renders the source line (which may be the whole file) when bundled.\nfunction wrapWithRethrow(statements: ts.Statement[], caller: ts.Expression): ts.Statement[] {\n if (statements.length === 0) {\n return statements;\n }\n return [\n ts.factory.createTryStatement(\n ts.factory.createBlock(statements),\n ts.factory.createCatchClause(\n ts.factory.createVariableDeclaration('error'),\n ts.factory.createBlock([\n // If this is a DeprecationError, trim its stack trace to surface level before re-throwing,\n // so we don't carry out possibly confusing frames from injected code. That can be toggled\n // off by setting JSII_DEBUG=1, so we can also diagnose in-injected code faults.\n ts.factory.createIfStatement(\n ts.factory.createBinaryExpression(\n ts.factory.createBinaryExpression(\n ts.factory.createPropertyAccessExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('process'), 'env'),\n 'JSII_DEBUG',\n ),\n ts.SyntaxKind.ExclamationEqualsEqualsToken,\n ts.factory.createStringLiteral('1'),\n ),\n ts.SyntaxKind.AmpersandAmpersandToken,\n ts.factory.createBinaryExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('error'), 'name'),\n ts.SyntaxKind.EqualsEqualsEqualsToken,\n ts.factory.createStringLiteral(DEPRECATION_ERROR),\n ),\n ),\n ts.factory.createBlock([\n ts.factory.createExpressionStatement(\n ts.factory.createCallExpression(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('Error'), 'captureStackTrace'),\n undefined,\n [ts.factory.createIdentifier('error'), caller],\n ),\n ),\n ]),\n ),\n ts.factory.createThrowStatement(ts.factory.createIdentifier('error')),\n ]),\n ),\n undefined,\n ),\n ];\n}\n\n/**\n * Force a path to be UNIXy (use `/` as a separator)\n *\n * `path.join()` etc. will use the system-dependent path separator (either `/` or `\\`\n * depending on your platform).\n *\n * However, if we actually emit the path-dependent separator to the `.js` files, then\n * files compiled with jsii on Windows cannot be used on any other platform. That seems\n * like an unnecessary restriction, especially since a `/` will work fine on Windows,\n * so make sure to always emit `/`.\n *\n * TSC itself always strictly emits `/` (or at least, emits the same what you put in).\n */\nfunction unixPath(filePath: string) {\n if (path.sep === '\\\\') {\n return filePath.replace(/\\\\/g, '/');\n }\n return filePath;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
/**
|
|
3
|
+
* A class that tracks the TypeScript source AST nodes for certain jsii types
|
|
4
|
+
*
|
|
5
|
+
* This is useful if we need to get additional information that is not currently tracked.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TypeTracker {
|
|
8
|
+
private readonly enums;
|
|
9
|
+
registerEnum(fqn: string, decl: ts.EnumDeclaration): void;
|
|
10
|
+
getEnum(fqn: string): ts.EnumDeclaration;
|
|
11
|
+
getEnumMembers(fqn: string): Record<string, ts.EnumMember>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=type-tracker.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeTracker = void 0;
|
|
4
|
+
const ts = require("typescript");
|
|
5
|
+
/**
|
|
6
|
+
* A class that tracks the TypeScript source AST nodes for certain jsii types
|
|
7
|
+
*
|
|
8
|
+
* This is useful if we need to get additional information that is not currently tracked.
|
|
9
|
+
*/
|
|
10
|
+
class TypeTracker {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.enums = {};
|
|
13
|
+
}
|
|
14
|
+
registerEnum(fqn, decl) {
|
|
15
|
+
this.enums[fqn] = decl;
|
|
16
|
+
}
|
|
17
|
+
getEnum(fqn) {
|
|
18
|
+
const ret = this.enums[fqn];
|
|
19
|
+
if (!ret) {
|
|
20
|
+
throw new Error(`No declaration was registered for enum ${fqn}`);
|
|
21
|
+
}
|
|
22
|
+
return ret;
|
|
23
|
+
}
|
|
24
|
+
getEnumMembers(fqn) {
|
|
25
|
+
const enumDecl = this.getEnum(fqn);
|
|
26
|
+
return Object.fromEntries(enumDecl.members.filter(ts.isEnumMember).map((mem) => [asIdentifier(mem.name).text, mem]));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.TypeTracker = TypeTracker;
|
|
30
|
+
function asIdentifier(x) {
|
|
31
|
+
if (ts.isIdentifier(x)) {
|
|
32
|
+
return x;
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`Expected identifier, got ${JSON.stringify(x)}`);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=type-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-tracker.js","sourceRoot":"","sources":["../src/type-tracker.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC;;;;GAIG;AACH,MAAa,WAAW;IAAxB;QACmB,UAAK,GAAuC,EAAE,CAAC;IAqBlE,CAAC;IAnBQ,YAAY,CAAC,GAAW,EAAE,IAAwB;QACvD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACzB,CAAC;IAEM,OAAO,CAAC,GAAW;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,cAAc,CAAC,GAAW;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAEnC,OAAO,MAAM,CAAC,WAAW,CACvB,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAC1F,CAAC;IACJ,CAAC;CACF;AAtBD,kCAsBC;AAED,SAAS,YAAY,CAAC,CAAU;IAC9B,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import * as ts from 'typescript';\n\n/**\n * A class that tracks the TypeScript source AST nodes for certain jsii types\n *\n * This is useful if we need to get additional information that is not currently tracked.\n */\nexport class TypeTracker {\n private readonly enums: Record<string, ts.EnumDeclaration> = {};\n\n public registerEnum(fqn: string, decl: ts.EnumDeclaration) {\n this.enums[fqn] = decl;\n }\n\n public getEnum(fqn: string): ts.EnumDeclaration {\n const ret = this.enums[fqn];\n if (!ret) {\n throw new Error(`No declaration was registered for enum ${fqn}`);\n }\n return ret;\n }\n\n public getEnumMembers(fqn: string): Record<string, ts.EnumMember> {\n const enumDecl = this.getEnum(fqn);\n\n return Object.fromEntries(\n enumDecl.members.filter(ts.isEnumMember).map((mem) => [asIdentifier(mem.name).text, mem]),\n );\n }\n}\n\nfunction asIdentifier(x: ts.Node): ts.Identifier {\n if (ts.isIdentifier(x)) {\n return x;\n }\n throw new Error(`Expected identifier, got ${JSON.stringify(x)}`);\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.9.36-dev.
|
|
2
|
+
export declare const SHORT_VERSION = "5.9.36-dev.1";
|
|
3
3
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
|
4
|
-
export declare const VERSION = "5.9.36-dev.
|
|
4
|
+
export declare const VERSION = "5.9.36-dev.1 (build 79ee037)";
|
|
5
5
|
/** The release line identifier for this JSII compiler (e.g: `X.Y`) */
|
|
6
6
|
export declare const RELEASE_LINE = "5.9";
|
|
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.9.36-dev.
|
|
7
|
+
exports.SHORT_VERSION = '5.9.36-dev.1';
|
|
8
8
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
|
9
|
-
exports.VERSION = '5.9.36-dev.
|
|
9
|
+
exports.VERSION = '5.9.36-dev.1 (build 79ee037)';
|
|
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,cAAc,CAAC;AAE5C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,8BAA8B,CAAC;AAEtD,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.9.36-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,cAAc,CAAC;AAE5C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,8BAA8B,CAAC;AAEtD,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.9.36-dev.1';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.9.36-dev.1 (build 79ee037)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
|