jsii 5.9.37-dev.0 → 5.9.37

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.
@@ -87,9 +87,6 @@ class DeprecationWarningsInjector {
87
87
  if (this.shouldRenderValidatorCache[type.fqn] !== undefined) {
88
88
  return this.shouldRenderValidatorCache[type.fqn];
89
89
  }
90
- if (type.fqn === '@scope/jsii-calc-base.TypeToContainVeryBaseProps') {
91
- debugger;
92
- }
93
90
  if (this.validatorCacheSeenSet.has(type.fqn)) {
94
91
  // To be safe we need to say this is true.
95
92
  return true;
@@ -498,7 +495,7 @@ function importedFunctionName(typeName, assembly, projectInfo) {
498
495
  if (type) {
499
496
  return moduleName !== assembly.name
500
497
  ? `require("${moduleName}/${exports.WARNINGSCODE_FILE_NAME}").${fnName(type.fqn)}`
501
- : fnName(type.fqn);
498
+ : `module.exports.${fnName(type.fqn)}`;
502
499
  }
503
500
  return undefined;
504
501
  }
@@ -526,7 +523,9 @@ function createTypeHandlerCall(functionName, parameter, collectionKind) {
526
523
  case spec.CollectionKind.Map:
527
524
  return ts.factory.createIfStatement(ts.factory.createBinaryExpression(ts.factory.createIdentifier(parameter), ts.SyntaxKind.ExclamationEqualsToken, ts.factory.createNull()), ts.factory.createForOfStatement(undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(FOR_LOOP_ITEM_NAME)], ts.NodeFlags.Const), ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('Object'), 'values'), undefined, [ts.factory.createIdentifier(parameter)]), createTypeHandlerCall(functionName, FOR_LOOP_ITEM_NAME)));
528
525
  case undefined:
529
- return ts.factory.createIfStatement(ts.factory.createPrefixUnaryExpression(ts.SyntaxKind.ExclamationToken, ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME), ts.factory.createIdentifier('has')), undefined, [ts.factory.createIdentifier(parameter)])), ts.factory.createExpressionStatement(ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('module.exports'), functionName), undefined, [ts.factory.createIdentifier(parameter)])));
526
+ return ts.factory.createIfStatement(ts.factory.createPrefixUnaryExpression(ts.SyntaxKind.ExclamationToken, ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(VISITED_OBJECTS_SET_NAME), ts.factory.createIdentifier('has')), undefined, [ts.factory.createIdentifier(parameter)])), ts.factory.createExpressionStatement(ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined, [
527
+ ts.factory.createIdentifier(parameter),
528
+ ])));
530
529
  }
531
530
  }
532
531
  // We try-then-rethrow exceptions to avoid runtimes displaying an uncanny wall of text if the place
@@ -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;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;AACxD,MAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,MAAa,2BAA2B;IAQtC,YAAoC,WAA2B,EAAmB,WAAwB;QAAtE,gBAAW,GAAX,WAAW,CAAgB;QAAmB,gBAAW,GAAX,WAAW,CAAa;QAPlG,iBAAY,GAA0B;YAC5C,MAAM,EAAE,EAAE;SACX,CAAC;QAEM,+BAA0B,GAA4B,EAAE,CAAC;QACzD,0BAAqB,GAAG,IAAI,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EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;SACtE,CAAC,CACH,EACD,SAAS,CACV;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,QAAQ,CAAC,QAAgB;IAChC,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';\nconst VALIDATORS_OBJ = 'VALIDATORS';\n\nexport class DeprecationWarningsInjector {\n private transformers: ts.CustomTransformers = {\n before: [],\n };\n\n private shouldRenderValidatorCache: Record<string, boolean> = {};\n private validatorCacheSeenSet = new Set<string>();\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 validationFunctions: ts.ObjectLiteralElementLike[] = [];\n\n const types = assembly.types ?? {};\n for (const type of Object.values(types)) {\n const fnStatements = this.generateTypeValidation(type, assembly, projectInfo, types);\n if (fnStatements.length === 0) {\n continue;\n }\n\n const paramValue = ts.factory.createParameterDeclaration(undefined, undefined, PARAMETER_NAME);\n const functionName = fnName(type.fqn);\n const functionExpr = ts.factory.createFunctionExpression(\n undefined,\n undefined,\n ts.factory.createIdentifier(functionName),\n [],\n [paramValue],\n undefined,\n createFunctionBlock(fnStatements),\n );\n validationFunctions.push(ts.factory.createPropertyAssignment(functionName, functionExpr));\n }\n\n const fileStatements: ts.Statement[] = [];\n fileStatements.push(\n ts.factory.createVariableStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [\n ts.factory.createVariableDeclaration(\n VALIDATORS_OBJ,\n undefined,\n undefined,\n ts.factory.createObjectLiteralExpression(validationFunctions),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n ),\n );\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\n generateWarningsFile(projectRoot, fileStatements);\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 /**\n * Whether the validator for the given type should be rendered\n *\n * A validator should be rendered if:\n *\n * - It contains any deprecated members (base case).\n * - It references any other types whose validators should be rendered.\n * - It inherits from other types whose validators should be rendered.\n * - It references types that reference this type (recursive types).\n * - It references types from another assembly.\n *\n * For the last one we technically return `true`, indicating that a validator\n * *should* be rendered, but when we get to rendering no statements are\n * actually produced and the validator function is never rendered. This was\n * pre-existing behavior that I didn't change because introducing calls into\n * other assemblies out of the blue introduces risk.\n */\n private shouldRenderValidator(type: spec.Type, assembly: Assembly): boolean {\n if (this.shouldRenderValidatorCache[type.fqn] !== undefined) {\n return this.shouldRenderValidatorCache[type.fqn];\n }\n\n if (type.fqn === '@scope/jsii-calc-base.TypeToContainVeryBaseProps') {\n debugger;\n }\n\n if (this.validatorCacheSeenSet.has(type.fqn)) {\n // To be safe we need to say this is true.\n return true;\n }\n if (!type.fqn.startsWith(`${assembly.name}.`)) {\n // Foreign type, always check\n return true;\n }\n this.validatorCacheSeenSet.add(type.fqn);\n\n this.shouldRenderValidatorCache[type.fqn] = calculate.call(this);\n this.validatorCacheSeenSet.delete(type.fqn);\n\n return this.shouldRenderValidatorCache[type.fqn];\n\n function calculate(this: DeprecationWarningsInjector): boolean {\n if (spec.isDeprecated(type)) {\n return true;\n }\n if (spec.isEnumType(type)) {\n return (type.members ?? []).some(spec.isDeprecated);\n }\n if (spec.isInterfaceType(type) && type.datatype) {\n for (const prop of type.properties ?? []) {\n if (spec.isDeprecated(prop)) {\n return true;\n }\n\n const typesToInspect = spec.isCollectionTypeReference(prop.type)\n ? [prop.type.collection.elementtype]\n : spec.isUnionTypeReference(prop.type)\n ? prop.type.union.types\n : [prop.type];\n\n for (const typeToInspect of typesToInspect) {\n if (!spec.isNamedTypeReference(typeToInspect)) {\n continue;\n }\n\n // Is from a different assembly?\n const typeObj = findType2(typeToInspect.fqn, assembly);\n if (typeObj === 'other-assembly') {\n return true;\n }\n if (this.shouldRenderValidator(typeObj, assembly)) {\n return true;\n }\n }\n }\n\n for (const interfaceName of type.interfaces ?? []) {\n const typeObj = findType2(interfaceName, assembly);\n if (typeObj === 'other-assembly') {\n return true;\n }\n if (this.shouldRenderValidator(typeObj, assembly)) {\n return true;\n }\n }\n }\n\n return false;\n }\n }\n\n private generateTypeValidation(\n type: spec.Type,\n assembly: Assembly,\n projectInfo: ProjectInfo,\n types: Record<string, spec.Type>,\n ): ts.Statement[] {\n if (!this.shouldRenderValidator(type, assembly)) {\n return [];\n }\n\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(createWarningFunctionCall(`${type.fqn}#${member.name}`, member.docs?.deprecated, condition));\n isEmpty = false;\n }\n } else if (spec.isInterfaceType(type) && type.datatype) {\n const { statementsByProp, excludedProps } = this.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 return isEmpty ? [] : statements;\n }\n\n private 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 if (this.shouldRenderValidator(types[prop.type.fqn], assembly)) {\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 }\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 this.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}\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, validatorStatements: ts.Statement[]) {\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\nfunction nop() {\n}\n\nmodule.exports = new Proxy({}, {\n get(target, prop, receiver) {\n if (prop === '${WARNING_FUNCTION_NAME}') return ${WARNING_FUNCTION_NAME};\n if (prop === '${GET_PROPERTY_DESCRIPTOR}') return ${GET_PROPERTY_DESCRIPTOR};\n if (prop === '${DEPRECATION_ERROR}') return ${DEPRECATION_ERROR};\n\n return ${VALIDATORS_OBJ}[prop] ?? nop;\n },\n});\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 = validatorStatements.map((st) => printer.printNode(ts.EmitHint.Unspecified, st, resultFile));\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 findType2(fqn: string, assembly: Assembly): spec.Type | 'other-assembly' {\n // Is from a different assembly?\n if (!fqn.startsWith(`${assembly.name}.`)) {\n return 'other-assembly';\n }\n\n const type = (assembly.types ?? {})[fqn];\n if (!type) {\n throw new Error(`Could not find type in same assembly: ${fqn}`);\n }\n return type;\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(\n ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('module.exports'), functionName),\n 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"]}
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;AACxD,MAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,MAAa,2BAA2B;IAQtC,YAAoC,WAA2B,EAAmB,WAAwB;QAAtE,gBAAW,GAAX,WAAW,CAAgB;QAAmB,gBAAW,GAAX,WAAW,CAAa;QAPlG,iBAAY,GAA0B;YAC5C,MAAM,EAAE,EAAE;SACX,CAAC;QAEM,+BAA0B,GAA4B,EAAE,CAAC;QACzD,0BAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;IAE2D,CAAC;IAEvG,OAAO,CAAC,QAAkB,EAAE,WAAwB;QACzD,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC5C,MAAM,mBAAmB,GAAkC,EAAE,CAAC;QAE9D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,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AAC,UAAU,CAAC,4BAA4B,EAC1C,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,CACpC,EACD,EAAE,CAAC,UAAU,CAAC,uBAAuB,EACrC,EAAE,CAAC,OAAO,CAAC,sBAAsB,CAC/B,EAAE,CAAC,OAAO,CAAC,8BAA8B,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EACvF,EAAE,CAAC,UAAU,CAAC,uBAAuB,EACrC,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAClD,CACF,EACD,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;gBACrB,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAClC,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAC7B,EAAE,CAAC,OAAO,CAAC,8BAA8B,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC,EACpG,SAAS,EACT,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAC/C,CACF;aACF,CAAC,CACH;YACD,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;SACtE,CAAC,CACH,EACD,SAAS,CACV;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,QAAQ,CAAC,QAAgB;IAChC,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';\nconst VALIDATORS_OBJ = 'VALIDATORS';\n\nexport class DeprecationWarningsInjector {\n private transformers: ts.CustomTransformers = {\n before: [],\n };\n\n private shouldRenderValidatorCache: Record<string, boolean> = {};\n private validatorCacheSeenSet = new Set<string>();\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 validationFunctions: ts.ObjectLiteralElementLike[] = [];\n\n const types = assembly.types ?? {};\n for (const type of Object.values(types)) {\n const fnStatements = this.generateTypeValidation(type, assembly, projectInfo, types);\n if (fnStatements.length === 0) {\n continue;\n }\n\n const paramValue = ts.factory.createParameterDeclaration(undefined, undefined, PARAMETER_NAME);\n const functionName = fnName(type.fqn);\n const functionExpr = ts.factory.createFunctionExpression(\n undefined,\n undefined,\n ts.factory.createIdentifier(functionName),\n [],\n [paramValue],\n undefined,\n createFunctionBlock(fnStatements),\n );\n validationFunctions.push(ts.factory.createPropertyAssignment(functionName, functionExpr));\n }\n\n const fileStatements: ts.Statement[] = [];\n fileStatements.push(\n ts.factory.createVariableStatement(\n undefined,\n ts.factory.createVariableDeclarationList(\n [\n ts.factory.createVariableDeclaration(\n VALIDATORS_OBJ,\n undefined,\n undefined,\n ts.factory.createObjectLiteralExpression(validationFunctions),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n ),\n );\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\n generateWarningsFile(projectRoot, fileStatements);\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 /**\n * Whether the validator for the given type should be rendered\n *\n * A validator should be rendered if:\n *\n * - It contains any deprecated members (base case).\n * - It references any other types whose validators should be rendered.\n * - It inherits from other types whose validators should be rendered.\n * - It references types that reference this type (recursive types).\n * - It references types from another assembly.\n *\n * For the last one we technically return `true`, indicating that a validator\n * *should* be rendered, but when we get to rendering no statements are\n * actually produced and the validator function is never rendered. This was\n * pre-existing behavior that I didn't change because introducing calls into\n * other assemblies out of the blue introduces risk.\n */\n private shouldRenderValidator(type: spec.Type, assembly: Assembly): boolean {\n if (this.shouldRenderValidatorCache[type.fqn] !== undefined) {\n return this.shouldRenderValidatorCache[type.fqn];\n }\n\n if (this.validatorCacheSeenSet.has(type.fqn)) {\n // To be safe we need to say this is true.\n return true;\n }\n if (!type.fqn.startsWith(`${assembly.name}.`)) {\n // Foreign type, always check\n return true;\n }\n this.validatorCacheSeenSet.add(type.fqn);\n\n this.shouldRenderValidatorCache[type.fqn] = calculate.call(this);\n this.validatorCacheSeenSet.delete(type.fqn);\n\n return this.shouldRenderValidatorCache[type.fqn];\n\n function calculate(this: DeprecationWarningsInjector): boolean {\n if (spec.isDeprecated(type)) {\n return true;\n }\n if (spec.isEnumType(type)) {\n return (type.members ?? []).some(spec.isDeprecated);\n }\n if (spec.isInterfaceType(type) && type.datatype) {\n for (const prop of type.properties ?? []) {\n if (spec.isDeprecated(prop)) {\n return true;\n }\n\n const typesToInspect = spec.isCollectionTypeReference(prop.type)\n ? [prop.type.collection.elementtype]\n : spec.isUnionTypeReference(prop.type)\n ? prop.type.union.types\n : [prop.type];\n\n for (const typeToInspect of typesToInspect) {\n if (!spec.isNamedTypeReference(typeToInspect)) {\n continue;\n }\n\n // Is from a different assembly?\n const typeObj = findType2(typeToInspect.fqn, assembly);\n if (typeObj === 'other-assembly') {\n return true;\n }\n if (this.shouldRenderValidator(typeObj, assembly)) {\n return true;\n }\n }\n }\n\n for (const interfaceName of type.interfaces ?? []) {\n const typeObj = findType2(interfaceName, assembly);\n if (typeObj === 'other-assembly') {\n return true;\n }\n if (this.shouldRenderValidator(typeObj, assembly)) {\n return true;\n }\n }\n }\n\n return false;\n }\n }\n\n private generateTypeValidation(\n type: spec.Type,\n assembly: Assembly,\n projectInfo: ProjectInfo,\n types: Record<string, spec.Type>,\n ): ts.Statement[] {\n if (!this.shouldRenderValidator(type, assembly)) {\n return [];\n }\n\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(createWarningFunctionCall(`${type.fqn}#${member.name}`, member.docs?.deprecated, condition));\n isEmpty = false;\n }\n } else if (spec.isInterfaceType(type) && type.datatype) {\n const { statementsByProp, excludedProps } = this.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 return isEmpty ? [] : statements;\n }\n\n private 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 if (this.shouldRenderValidator(types[prop.type.fqn], assembly)) {\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 }\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 this.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}\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, validatorStatements: ts.Statement[]) {\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\nfunction nop() {\n}\n\nmodule.exports = new Proxy({}, {\n get(target, prop, receiver) {\n if (prop === '${WARNING_FUNCTION_NAME}') return ${WARNING_FUNCTION_NAME};\n if (prop === '${GET_PROPERTY_DESCRIPTOR}') return ${GET_PROPERTY_DESCRIPTOR};\n if (prop === '${DEPRECATION_ERROR}') return ${DEPRECATION_ERROR};\n\n return ${VALIDATORS_OBJ}[prop] ?? nop;\n },\n});\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 = validatorStatements.map((st) => printer.printNode(ts.EmitHint.Unspecified, st, resultFile));\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 findType2(fqn: string, assembly: Assembly): spec.Type | 'other-assembly' {\n // Is from a different assembly?\n if (!fqn.startsWith(`${assembly.name}.`)) {\n return 'other-assembly';\n }\n\n const type = (assembly.types ?? {})[fqn];\n if (!type) {\n throw new Error(`Could not find type in same assembly: ${fqn}`);\n }\n return type;\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 : `module.exports.${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"]}
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.37-dev.0";
2
+ export declare const SHORT_VERSION = "5.9.37";
3
3
  /** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
4
- export declare const VERSION = "5.9.37-dev.0 (build 4886180)";
4
+ export declare const VERSION = "5.9.37 (build 5176c0d)";
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.37-dev.0';
7
+ exports.SHORT_VERSION = '5.9.37';
8
8
  /** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
9
- exports.VERSION = '5.9.37-dev.0 (build 4886180)';
9
+ exports.VERSION = '5.9.37 (build 5176c0d)';
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
@@ -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.37-dev.0';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.9.37-dev.0 (build 4886180)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
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,QAAQ,CAAC;AAEtC,yFAAyF;AAC5E,QAAA,OAAO,GAAG,wBAAwB,CAAC;AAEhD,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.37';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.9.37 (build 5176c0d)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
package/package.json CHANGED
@@ -92,7 +92,7 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "version": "5.9.37-dev.0",
95
+ "version": "5.9.37",
96
96
  "types": "lib/index.d.ts",
97
97
  "exports": {
98
98
  ".": "./lib/index.js",