jsii 5.9.5-dev.3 → 5.9.5-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/jsii-diagnostic.js +3 -3
- package/lib/jsii-diagnostic.js.map +1 -1
- package/lib/transforms/deprecated-remover.js +11 -1
- package/lib/transforms/deprecated-remover.js.map +1 -1
- package/lib/validator.js +33 -54
- package/lib/validator.js.map +1 -1
- package/lib/version.d.ts +2 -2
- package/lib/version.js +2 -2
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
package/lib/jsii-diagnostic.js
CHANGED
@@ -450,12 +450,12 @@ JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY = Code.error({
|
|
450
450
|
name: 'language-compatibility/override-changes-visibility',
|
451
451
|
});
|
452
452
|
JsiiDiagnostic.JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE = Code.error({
|
453
|
-
code: 5003,
|
453
|
+
code: 5003,
|
454
454
|
formatter: (newElement, action, newValue, oldValue) => `"${newElement}" changes the return type to "${newValue}" when ${action}. Change it to "${oldValue}"`,
|
455
455
|
name: 'language-compatibility/override-changes-return-type',
|
456
456
|
});
|
457
457
|
JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE = Code.error({
|
458
|
-
code: 5004,
|
458
|
+
code: 5004,
|
459
459
|
formatter: (newElement, action, newType, oldType) => `"${newElement}" changes the property type to "${spec.describeTypeReference(newType)}" when ${action}. Change it to "${spec.describeTypeReference(oldType)}"`,
|
460
460
|
name: 'language-compatibility/override-changes-property-type',
|
461
461
|
});
|
@@ -465,7 +465,7 @@ JsiiDiagnostic.JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT = Code.error({
|
|
465
465
|
name: 'language-compatibility/override-changes-param-count',
|
466
466
|
});
|
467
467
|
JsiiDiagnostic.JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE = Code.error({
|
468
|
-
code: 5006,
|
468
|
+
code: 5006,
|
469
469
|
formatter: (newElement, action, newParam, oldParam) => `"${newElement}" changes the type of parameter "${newParam.name}" to ${spec.describeTypeReference(newParam.type)} when ${action}. Change it to ${spec.describeTypeReference(oldParam.type)}`,
|
470
470
|
name: 'language-compatibility/override-changes-param-type',
|
471
471
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jsii-diagnostic.js","sourceRoot":"","sources":["../src/jsii-diagnostic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAw4BA,kDAQC;AAh5BD,mCAAmC;AACnC,+BAA+C;AAC/C,iCAAiC;AAGjC,4EAA2E;AAE3E,mCAAmE;AAEnE;;;;;GAKG;AACH,MAAa,IAAI;IACf;;OAEG;IACI,MAAM,CAAC,OAAO,CAAuC,EAC1D,IAAI,EACJ,IAAI,EACJ,SAAS,GAKV;QACC,OAAO,IAAI,IAAI,CAAI,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,UAAU,CAAuC,EAC7D,IAAI,EACJ,IAAI,EACJ,SAAS,GAKV;QACC,OAAO,IAAI,IAAI,CAAI,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAAO,CAAuC,EAC1D,IAAI,EACJ,IAAI,EACJ,SAAS,GAKV;QACC,OAAO,IAAI,IAAI,CAAI,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAuC,EACxD,IAAI,EACJ,IAAI,EACJ,SAAS,GAKV;QACC,OAAO,IAAI,IAAI,CAAI,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,SAAS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AAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,EAAE,EAAE,CAAC;YACP,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,qDAAqD,CAAC,CAAC;IACvG,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as spec from '@jsii/spec';\nimport { camel, constant, pascal } from 'case';\nimport * as ts from 'typescript';\n\nimport { TypeSystemHints } from './docs';\nimport { WARNINGSCODE_FILE_NAME } from './transforms/deprecation-warnings';\nimport { Violation } from './tsconfig/validator';\nimport { JSII_DIAGNOSTICS_CODE, _formatDiagnostic } from './utils';\n\n/**\n * Descriptors for all valid jsii diagnostic codes.\n *\n * The `category` or non-error codes can be updated, for example to treat\n * warnings as errors, or to suppress certain undesirable warnings.\n */\nexport class Code<T extends DiagnosticMessageFormatter = DiagnosticMessageFormatter> {\n /**\n * @internal\n */\n public static message<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Message, formatter);\n }\n\n /**\n * @internal\n */\n public static suggestion<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Suggestion, formatter);\n }\n\n /**\n * @internal\n */\n public static warning<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Warning, formatter);\n }\n\n /**\n * @internal\n */\n public static error<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Error, formatter);\n }\n\n /**\n * Get a diagnostic code by code or name.\n *\n * @param codeOrName the looked up diagnostic code or name.\n *\n * @returns the JsiiDiagnosticCode instande, if one exists, or `undefined`\n *\n * @experimental this module is under active development and the error codes\n * and names may change in the future.\n */\n public static lookup(codeOrName: string | number): Code | undefined {\n if (typeof codeOrName === 'number') {\n return this.byCode.get(codeOrName);\n }\n return this.byName.get(codeOrName);\n }\n\n private static readonly byCode: Map<number, Code> = new Map();\n private static readonly byName: Map<string, Code> = new Map();\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n readonly #defaultCategory: ts.DiagnosticCategory;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n #category?: ts.DiagnosticCategory;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n #formatter: T;\n\n /**\n * Registers a new diagnostic code.\n *\n * @param code the numeric code for the diagnostic\n * @param name the symbolic name for the diagnostic\n * @param defaultCategory the default category this diagnostic ranks in\n * @param formatter a message formatter for easy creation of diagnostics\n */\n private constructor(\n public readonly code: number,\n public readonly name: string,\n defaultCategory: ts.DiagnosticCategory,\n formatter: T,\n ) {\n this.#defaultCategory = defaultCategory;\n this.#formatter = formatter;\n\n if (code in Code.byCode) {\n throw new Error(`Attempted to create two instances of ${this.constructor.name} with code ${code}`);\n }\n if (name in Code.byName) {\n throw new Error(`Attempted to create two instances of ${this.constructor.name} with name ${name}`);\n }\n Code.byCode.set(code, this);\n Code.byName.set(name, this);\n }\n\n /**\n * Determines whether this diagnostic is a compilation error. Diagnostics\n * where this is `true` cannot have their `category` overridden to a lower\n * category.\n */\n public get isError(): boolean {\n return this.#defaultCategory === ts.DiagnosticCategory.Error;\n }\n\n /**\n * The diagnostic category this particular code is filed as.\n */\n public get category(): ts.DiagnosticCategory {\n return this.#category ?? this.#defaultCategory;\n }\n\n /**\n * Update the diagnostic category for this particular code. If `isError` is\n * `true`, attempting to set anything other than `ts.DiagnosticCategory.Error`\n * will result in an error being throw.\n *\n * @param newValue the new diagnostic category to be used.\n */\n public set category(newValue: ts.DiagnosticCategory) {\n if (this.isError && newValue !== ts.DiagnosticCategory.Error) {\n throw new Error(\n `Illegal attempt to override category of error ${this.code} to ${ts.DiagnosticCategory[newValue]}`,\n );\n }\n this.#category = newValue;\n }\n\n /**\n * Creates a new `JsiiDiagnostic` message without any source code location\n * data.\n *\n * @param args the arguments to the message formatter.\n *\n * @deprecated It is preferred to specify a source code location for problem\n * markers. Prefer the use of `create` while providing a value\n * for the `location` parameter whenever possible.\n */\n public createDetached(...args: Parameters<T>): JsiiDiagnostic {\n return new JsiiDiagnostic(this, this.#formatter(...args));\n }\n\n /**\n * Creates a new `JsiiDiagnostic` message with source code location denoted\n * by the provided `location` node.\n *\n * @param location the source code location attachment of the message.\n * @param args the arguments to the message formatter.\n */\n public create(location: ts.Node | undefined, ...args: Parameters<T>): JsiiDiagnostic {\n return new JsiiDiagnostic(this, this.#formatter(...args), location);\n }\n}\n\n/**\n * A jsii-specific diagnostic entry.\n */\nexport class JsiiDiagnostic implements ts.Diagnostic {\n //////////////////////////////////////////////////////////////////////////////\n // 0001 => 0999 -- PACKAGE METADATA PROBLEMS\n\n public static readonly JSII_0001_PKG_MISSING_DESCRIPTION = Code.suggestion({\n code: 1,\n formatter: () => 'A \"description\" field should be specified in \"package.json\"',\n name: 'metadata/package-json-missing-description',\n });\n\n public static readonly JSII_0002_PKG_MISSING_HOMEPAGE = Code.suggestion({\n code: 2,\n formatter: () => 'A \"homepage\" field should be specified in \"package.json\"',\n name: 'metadata/package-json-missing-homepage',\n });\n\n public static readonly JSII_0003_MISSING_README = Code.warning({\n code: 3,\n formatter: () => 'There is no \"README.md\" file. It is required in order to generate valid PyPI (Python) packages.',\n name: 'metadata/missing-readme',\n });\n\n public static readonly JSII_0004_COULD_NOT_FIND_ENTRYPOINT = Code.error({\n code: 4,\n formatter: (mainFile: string) => `Could not find \"main\" file: ${mainFile}`,\n name: 'metadata/could-not-find-entrypoint',\n });\n\n public static readonly JSII_0005_MISSING_PEER_DEPENDENCY = Code.warning({\n code: 5,\n formatter: (assm: string, reference: string) =>\n `The type \"${reference}\" is exposed in the public API of this module. ` +\n `Therefore, the module \"${assm}\" must also be defined under \"peerDependencies\". ` +\n 'This will be auto-corrected unless --no-fix-peer-dependencies was specified.',\n name: 'metadata/missing-peer-dependency',\n });\n\n // NOTE: currently not possible to change the severity of this code,\n // as it's being emitted before the overrides have been loaded\n public static readonly JSII_0006_MISSING_DEV_DEPENDENCY = Code.warning({\n code: 6,\n formatter: (dependencyName: string, peerRange: string, minVersion: string, actual: string) =>\n `A \"peerDependency\" on \"${dependencyName}\" at \"${peerRange}\" means you ` +\n `should take a \"devDependency\" on \"${dependencyName}\" at \"${minVersion}\" ` +\n `(found ${JSON.stringify(actual)})`,\n name: 'metadata/missing-dev-dependency',\n });\n\n public static readonly JSII_0007_MISSING_WARNINGS_EXPORT = Code.error({\n code: 7,\n formatter: () =>\n 'If you are compiling with --add-deprecation-warnings and your package.json ' +\n `declares subpath exports, you must include { \"./${WARNINGSCODE_FILE_NAME}\": \"./${WARNINGSCODE_FILE_NAME}\" } ` +\n 'in the set of exports.',\n name: 'metadata/missing-warnings-export',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 1000 => 1999 -- TYPESCRIPT LANGUAGE RESTRICTIONS\n\n public static readonly JSII_1000_NO_CONST_ENUM = Code.error({\n code: 1000,\n formatter: () => 'Exported \"const enum\" declarations are not allowed',\n name: 'typescript-restrictions/no-const-enum',\n });\n\n public static readonly JSII_1001_TYPE_HAS_NO_SYMBOL = Code.error({\n code: 1001,\n formatter: () => 'Non-primitive types without a symbol cannot be processed.',\n name: 'typescript-restrictions/type-has-no-symbol',\n });\n\n public static readonly JSII_1002_UNSPECIFIED_PROMISE = Code.error({\n code: 1002,\n formatter: () => 'Un-specified promise type. Specify it using \"Promise<T>\"',\n name: 'typescript-restrictions/unspecified-promise',\n });\n\n public static readonly JSII_1003_UNSUPPORTED_TYPE = Code.error({\n code: 1003,\n formatter: (messageText) => messageText,\n name: 'typescript-restrictions/unsupported-type',\n });\n\n public static readonly JSII_1004_DUPLICATE_ENUM_VALUE = Code.error({\n code: 1004,\n formatter: (enumValue: string, enumMemberNames: string[]) =>\n `Value ${enumValue} is used for multiple enum values: ${enumMemberNames.join(', ')}`,\n name: 'typescript-restrictions/duplicate-enum-value',\n });\n\n public static readonly JSII_1005_SEPARATE_WRITE_TYPE = Code.error({\n code: 1005,\n formatter: () => 'Visible property signatures cannot use a separate write type. Use the same type as the getter.',\n name: 'typescript-restrictions/separate-write-type',\n });\n\n public static readonly JSII_1006_GENERIC_TYPE = Code.error({\n code: 1006,\n formatter: () => 'Generic types are not supported because semantics are not uniform in target languages.',\n name: 'typescript-restriction/generic-type',\n });\n\n public static readonly JSII_1999_UNSUPPORTED = Code.error({\n code: 1999,\n formatter: ({\n what,\n alternative,\n suggestInternal,\n }: {\n what: string;\n alternative?: string;\n suggestInternal?: boolean;\n }) =>\n `${what} are not supported in jsii APIs.${alternative ? ` Consider using ${alternative} instead.` : ''}${\n suggestInternal\n ? ` This declaration must${alternative ? ' otherwise' : ''} be marked \"@internal\" or \"@jsii ignore\".`\n : ''\n }`,\n name: 'typescript-restrictions/unsupported',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 2000 => 2999 -- INCORRECT USE OF THE @jsii DIRECTIVE\n public static readonly JSII_2000_MISSING_DIRECTIVE_ARGUMENT = Code.warning({\n code: 2000,\n formatter: () =>\n 'Missing argument to @jsii directive. Refer to the jsii compiler documentation for more information.',\n name: 'jsii-directive/missing-argument',\n });\n\n public static readonly JSII_2100_STRUCT_ON_NON_INTERFACE = Code.warning({\n code: 2100,\n formatter: () => 'The \"@jsii struct\" directive is only applicable to interface declarations.',\n name: 'jsii-directive/struct-on-non-interface',\n });\n\n public static readonly JSII_2999_UNKNOWN_DIRECTIVE = Code.warning({\n code: 2999,\n formatter: (text: string) =>\n `Unknown @jsii directive: ${JSON.stringify(\n text,\n )}. Refer to the jsii compiler documentation for more information.`,\n name: 'jsii-directive/unknown',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 3000 => 3999 -- TYPE MODEL COHERENCE\n\n public static readonly JSII_3000_EXPORTED_API_USES_HIDDEN_TYPE = Code.error({\n code: 3000,\n formatter: (badFqn) => `Exported APIs cannot use un-exported type \"${badFqn}\"`,\n name: 'type-model/exported-api-cannot-use-unexported-type',\n });\n\n public static readonly JSII_3001_EXPOSED_INTERNAL_TYPE = Code.error({\n code: 3001,\n formatter: (symbol: ts.Symbol, isThisType: boolean, typeUse: string) =>\n `Type ${\n isThisType ? `\"this\" (aka: \"${symbol.name}\")` : `\"${symbol.name}\"`\n } cannot be used as the ${typeUse} because it is private or @internal`,\n name: 'type-model/use-of-internal-type',\n });\n\n public static readonly JSII_3002_USE_OF_UNEXPORTED_FOREIGN_TYPE = Code.error({\n code: 3002,\n formatter: (fqn: string, typeUse: string, pkg: { readonly name: string }) =>\n `Type \"${fqn}\" cannot be used as a ${typeUse} because it is not exported from ${pkg.name}`,\n name: 'type-model/unexported-foreign-type',\n });\n\n public static readonly JSII_3003_SYMBOL_IS_EXPORTED_TWICE = Code.error({\n code: 3003,\n formatter: (ns1: string, ns2: string) => `Symbol is exported under two distinct submodules: ${ns1} and ${ns2}`,\n name: 'type-model/symbol-is-exported-twice',\n });\n\n public static readonly JSII_3004_INVALID_SUPERTYPE = Code.error({\n code: 3004,\n formatter: (clause: ts.HeritageClause, badDeclaration: ts.Declaration) => {\n return `Illegal ${clauseType(clause.token)} clause for an exported API: ${ts.SyntaxKind[badDeclaration.kind]}`;\n\n function clauseType(token: ts.SyntaxKind): string {\n switch (token) {\n case ts.SyntaxKind.ExtendsKeyword:\n return 'extends';\n case ts.SyntaxKind.ImplementsKeyword:\n return 'implements';\n default:\n return ts.SyntaxKind[token];\n }\n }\n },\n name: 'type-model/invalid-supertype',\n });\n\n public static readonly JSII_3005_TYPE_USED_AS_INTERFACE = Code.error({\n code: 3005,\n formatter: (badType: spec.TypeReference) =>\n `Type \"${spec.describeTypeReference(badType)}\" cannot be used as an interface`,\n name: 'type-model/type-used-as-interface',\n });\n\n public static readonly JSII_3006_TYPE_USED_AS_CLASS = Code.error({\n code: 3006,\n formatter: (badType: spec.TypeReference) =>\n `Type \"${spec.describeTypeReference(badType)}\" cannot be used as a class`,\n name: 'type-model/type-used-as-class',\n });\n\n public static readonly JSII_3007_ILLEGAL_STRUCT_EXTENSION = Code.error({\n code: 3007,\n formatter: (offender: spec.Type, struct: spec.InterfaceType) =>\n `Attempt to extend or implement struct \"${struct.fqn}\" from \"${offender.fqn}\"`,\n name: 'type-model/illegal-struct-extension',\n });\n\n public static readonly JSII_3008_STRUCT_PROPS_MUST_BE_READONLY = Code.error({\n code: 3008,\n formatter: (propName: string, struct: spec.InterfaceType) =>\n `The \"${propName}\" property of struct \"${struct.fqn}\" must be \"readonly\". Rename \"${struct.fqn}\" to \"I${struct.name}\" if it is meant to be a behavioral interface.`,\n name: 'type-model/struct-props-must-be-readonly',\n });\n\n public static readonly JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED = Code.error({\n code: 3009,\n formatter: (param: spec.Parameter, nextParam: spec.Parameter) =>\n `Parameter \"${param.name}\" cannot be optional, as it precedes required parameter \"${nextParam.name}\"`,\n name: 'type-model/optional-parameter-before-required',\n });\n\n public static readonly JSII_3999_INCOHERENT_TYPE_MODEL = Code.error({\n code: 3999,\n formatter: (messageText) => messageText,\n name: 'type-model/incoherent-type-model',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 4000 => 4999 -- TYPESCRIPT & JSII CONFIG ERRORS\n\n public static readonly JSII_4000_FAILED_TSCONFIG_VALIDATION = Code.error({\n code: 4000,\n formatter: (config: string, ruleSet: string, violations: Array<Violation>) => {\n return `Typescript compiler options in \"${config}\" are not passing validation against rule set \"${ruleSet}\", found the following rule violations:\\n${violations\n .map((v) => ` - ${v.field}: ${v.message}`)\n .join('\\n')}`;\n },\n name: 'typescript-config/invalid-tsconfig',\n });\n\n public static readonly JSII_4009_DISABLED_TSCONFIG_VALIDATION = Code.warning({\n code: 4009,\n formatter: (config: string) =>\n `Validation of typescript config \"${config}\" is disabled. This is intended for experimental setups only. Compilation might fail or produce incompatible artifacts.`,\n name: 'typescript-config/disabled-tsconfig-validation',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 5000 => 5999 -- LANGUAGE COMPATIBILITY ERRORS\n\n public static readonly JSII_5000_JAVA_GETTERS = Code.error({\n code: 5000,\n formatter: (badName: string, typeName: string) =>\n `Methods and properties cannot have names like \"getXxx\": those conflict with Java property getters. Rename \"${typeName}.${badName}\"`,\n name: 'language-compatibility/potential-java-getter-conflict',\n });\n\n public static readonly JSII_5001_JAVA_SETTERS = Code.error({\n code: 5001,\n formatter: (badName: string, typeName: string) =>\n `Methods and properties cannot have names like \"setXxx\": those conflict with Java property setters. Rename \"${typeName}.${badName}\"`,\n name: 'language-compatibility/potential-java-setter-conflict',\n });\n\n public static readonly JSII_5002_OVERRIDE_CHANGES_VISIBILITY = Code.error({\n code: 5002,\n formatter: (\n newElement: string,\n action: string,\n newValue: 'protected' | 'public',\n oldValue: 'protected' | 'public',\n ) => `\"${newElement}\" changes visibility to ${newValue} when ${action}. Change it to ${oldValue}`,\n name: 'language-compatibility/override-changes-visibility',\n });\n\n public static readonly JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE = Code.error({\n code: 5003, // allowed\n formatter: (newElement: string, action: string, newValue: string, oldValue: string) =>\n `\"${newElement}\" changes the return type to \"${newValue}\" when ${action}. Change it to \"${oldValue}\"`,\n name: 'language-compatibility/override-changes-return-type',\n });\n\n public static readonly JSII_5004_OVERRIDE_CHANGES_PROP_TYPE = Code.error({\n code: 5004, // allowed\n formatter: (newElement: string, action: string, newType: spec.TypeReference, oldType: spec.TypeReference) =>\n `\"${newElement}\" changes the property type to \"${spec.describeTypeReference(\n newType,\n )}\" when ${action}. Change it to \"${spec.describeTypeReference(oldType)}\"`,\n name: 'language-compatibility/override-changes-property-type',\n });\n\n public static readonly JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT = Code.error({\n code: 5005,\n formatter: (newElement: string, action: string, newCount: number, oldCount: number) =>\n `\"${newElement}\" has ${newCount} parameters when ${action}. It should accept ${oldCount} parameters`,\n name: 'language-compatibility/override-changes-param-count',\n });\n\n public static readonly JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE = Code.error({\n code: 5006, // tbd\n formatter: (newElement: string, action: string, newParam: spec.Parameter, oldParam: spec.Parameter) =>\n `\"${newElement}\" changes the type of parameter \"${newParam.name}\" to ${spec.describeTypeReference(\n newParam.type,\n )} when ${action}. Change it to ${spec.describeTypeReference(oldParam.type)}`,\n name: 'language-compatibility/override-changes-param-type',\n });\n\n public static readonly JSII_5007_OVERRIDE_CHANGES_VARIADIC = Code.error({\n code: 5007,\n formatter: (newElement: string, action: string, newVariadic = false, oldVariadic = false) =>\n `\"${newElement}\" turns ${newVariadic ? 'variadic' : 'non variadic'} when ${action}. Make it ${\n oldVariadic ? 'variadic' : 'non-variadic'\n }`,\n name: 'language-compatibility/override-changes-variadic',\n });\n\n public static readonly JSII_5008_OVERRIDE_CHANGES_PARAM_OPTIONAL = Code.error({\n code: 5008,\n formatter: (newElement: string, action: string, newParam: spec.Parameter, oldParam: spec.Parameter) =>\n `\"${newElement}\" turns parameter \"${newParam.name}\" ${\n newParam.optional ? 'optional' : 'required'\n } when ${action}. Make it ${oldParam.optional ? 'optional' : 'required'}`,\n name: 'language-compatibility/override-changes-param-optional',\n });\n\n public static readonly JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL = Code.error({\n code: 5009,\n formatter: (newElement: string, action: string, newOptional = false, oldOptional = false) =>\n `\"${newElement}\" turns ${newOptional ? 'optional' : 'required'} when ${action}. Make it ${\n oldOptional ? 'optional' : 'required'\n }`,\n name: 'language-compatibility/override-changes-prop-optional',\n });\n\n public static readonly JSII_5010_OVERRIDE_CHANGES_MUTABILITY = Code.error({\n code: 5010,\n formatter: (newElement: string, action: string, newReadonly = false, oldReadonly = false) =>\n `\"${newElement}\" turns ${newReadonly ? 'readonly' : 'mutable'} when ${action}. Make it ${\n oldReadonly ? 'readonly' : 'mutable'\n }`,\n name: 'language-compatibility/override-changes-mutability',\n });\n\n public static readonly JSII_5011_SUBMODULE_NAME_CONFLICT = Code.error({\n code: 5011,\n formatter: (submoduleName: string, typeName: string, reserved: readonly string[]) =>\n `Submodule \"${submoduleName}\" conflicts with \"${typeName}, as different languages could represent it as: ${reserved\n .map((x) => `\"${x}\"`)\n .join(', ')}\"`,\n name: 'language-compatibility/submodule-name-conflicts',\n });\n\n public static readonly JSII_5012_NAMESPACE_IN_TYPE = Code.error({\n code: 5012,\n formatter: (typeName: string, namespaceName: string) =>\n `All entities nested under a type (e.g: \"${typeName}\") must be concrete types, but \"${namespaceName}\" is a namespace. This structure cannot be supported in all languages (e.g: Java)`,\n name: 'language-compatibility/namespace-in-type',\n });\n\n public static readonly JSII_5013_STATIC_INSTANCE_CONFLICT = Code.error({\n code: 5013,\n formatter: (member: string, type: spec.ClassType) =>\n `Member \"${member}\" of class \"${type.fqn}\" has both a static and an instance delcaration`,\n name: 'language-compatibility/static-instance-conflict',\n });\n\n public static readonly JSII_5014_INHERITED_STATIC_CONFLICT = Code.error({\n code: 5014,\n formatter: (\n member: spec.Method | spec.Property,\n type: spec.ClassType,\n baseMember: spec.Method | spec.Property,\n baseType: spec.ClassType,\n ) =>\n `${member.static ? 'Static' : 'Instance'} member \"${member.name}\" of class \"${type.fqn}\" conflicts with ${\n baseMember.static ? 'static' : 'instance'\n } member in ancestor \"${baseType.fqn}\"`,\n name: 'language-compatibility/inherited-static-conflict',\n });\n\n public static readonly JSII_5015_REDECLARED_INTERFACE_MEMBER = Code.error({\n code: 5015,\n formatter: (memberName: string, iface: spec.InterfaceType) =>\n `Interface \"${iface.fqn}\" re-declares member \"${memberName}\". This is not supported as it results in invalid C#.`,\n name: 'language-compatibility/redeclared-interface-member',\n });\n\n public static readonly JSII_5016_PROHIBITED_MEMBER_NAME = Code.error({\n code: 5016,\n formatter: (badName: string) =>\n `Members cannot be named \"${badName}\" as it conflicts with synthetic declarations in some languages.`,\n name: 'language-compatibility/prohibited-member-name',\n });\n\n public static readonly JSII_5017_POSITIONAL_KEYWORD_CONFLICT = Code.error({\n code: 5017,\n formatter: (badName: string) =>\n `Parameter name \"${badName}\" is also the name of a property in a struct parameter. Rename the positional parameter.`,\n name: 'language-compatibility/positional-keyword-conflict',\n });\n\n public static readonly JSII_5018_RESERVED_WORD = Code.warning({\n code: 5018,\n formatter: (badName: string, languages: readonly string[]) =>\n `\"${badName}\" is a reserved word in ${languages.join(\n ', ',\n )}. Using this name may cause problems when generating language bindings. Consider a different name.`,\n name: 'language-compatibility/reserved-word',\n });\n\n public static readonly JSII_5019_MEMBER_TYPE_NAME_CONFLICT = Code.warning({\n code: 5019,\n formatter: (memberKind: 'method' | 'property', memberSymbol: ts.Symbol, declaringType: spec.Type) =>\n `The ${memberKind} name \"${memberSymbol.name}\" conflicts with the declaring ${declaringType.kind} \"${declaringType.name}\". This will result in renaming the ${declaringType.kind} to \"_${declaringType.name}\" in C#. Consider renaming \"${memberSymbol.name}\".`,\n name: 'language-compatibility/member-name-conflicts-with-type-name',\n });\n\n public static readonly JSII_5020_STATIC_MEMBER_CONFLICTS_WITH_NESTED_TYPE = Code.error({\n code: 5020,\n formatter: (\n nestingType: spec.Type,\n staticMember: spec.Property | spec.Method | spec.EnumMember,\n nestedType: spec.Type,\n ) =>\n `The static member \"${nestingType.name}.${staticMember.name}\" has the same PascalCased representation as nested type \"${nestingType.name}.${nestedType.name}\". This would result in invalid code in Go.`,\n name: 'language-compatibility/static-member-name-conflicts-with-nested-type',\n });\n\n public static readonly JSII_5021_ABSTRACT_CLASS_MISSING_PROP_IMPL = Code.error({\n code: 5021,\n formatter: (intf: spec.InterfaceType, cls: spec.ClassType, prop: string) =>\n `A declaration of \"${intf.name}.${prop}\" is missing on class \"${cls.name}\". Declare the property as \"public abstract\" if you want to defer it to subclasses.`,\n name: 'language-compatibility/abstract-class-missing-prop-impl',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 6000 => 6999 -- RESERVED\n\n //////////////////////////////////////////////////////////////////////////////\n // 7000 => 7999 -- DOCUMENTATION ERRORS\n\n public static readonly JSII_7000_NON_EXISTENT_PARAMETER = Code.warning({\n code: 7000,\n formatter: (method: spec.Method, param: string) =>\n `Documentation for method \"${method.name}\" refers to non-existent @param \"${param}\"`,\n name: 'documentation/non-existent-parameter',\n });\n\n public static readonly JSII_7001_ILLEGAL_HINT = Code.error({\n code: 7001,\n formatter: (hint: keyof TypeSystemHints, ...valid: readonly string[]) =>\n `Illegal use of \"@${hint}\" hint. It is only valid on ${valid.join(', ')}.`,\n name: 'documentation/illegal-hint',\n });\n\n public static readonly JSII_7999_DOCUMENTATION_ERROR = Code.error({\n code: 7999,\n formatter: (messageText) => messageText,\n name: 'documentation/documentation-error',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 8000 => 8999 -- JSII STYLE ENFORCEMENT\n\n public static readonly JSII_8000_PASCAL_CASED_TYPE_NAMES = Code.error({\n code: 8000,\n formatter: (badName: string, expectedName: string = pascal(badName)) =>\n `Type names must be PascalCased. Rename \"${badName}\" to \"${expectedName}\"`,\n name: 'code-style/type-names-must-use-pascal-case',\n });\n\n public static readonly JSII_8001_ALL_CAPS_ENUM_MEMBERS = Code.error({\n code: 8001,\n formatter: (badName: string, typeName: string) =>\n `Enum members must be ALL_CAPS. Rename \"${typeName}.${badName}\" to \"${constant(badName)}\"`,\n name: 'code-style/enum-members-must-use-all-caps',\n });\n\n public static readonly JSII_8002_CAMEL_CASED_MEMBERS = Code.error({\n code: 8002,\n formatter: (badName: string, typeName: string) =>\n `Method and property (unless they are static readonly) names must use camelCase. Rename \"${typeName}.${badName}\" to \"${camel(\n badName,\n )}\"`,\n name: 'code-style/member-names-must-use-camel-case',\n });\n\n public static readonly JSII_8003_STATIC_CONST_CASING = Code.error({\n code: 8003,\n formatter: (badName: string, typeName: string) =>\n `Static constant names must use ALL_CAPS, PascalCase, or camelCase. Rename \"${typeName}.${badName}\" to \"${constant(\n badName,\n )}\"`,\n name: 'code-style/static-readonly-property-casing',\n });\n\n public static readonly JSII_8004_SUBMOULE_NAME_CASING = Code.error({\n code: 8004,\n formatter: (badName: string) =>\n `Submodule namespaces must be camelCased or snake_cased. Rename \"${badName}\" to ${camel(badName)}`,\n name: 'code-style/submodule-name-casing',\n });\n\n public static readonly JSII_8005_INTERNAL_UNDERSCORE = Code.error({\n code: 8005,\n formatter: (badName: string) =>\n `Members marked with @internal must have a name starting with \"_\". Rename \"${badName}\" to \"_${badName}\"`,\n name: 'code-style/internal-members-underscore-prefix',\n });\n\n public static readonly JSII_8006_UNDERSCORE_INTERNAL = Code.error({\n code: 8006,\n formatter: (badName: string) =>\n `Members with a name starting with \"_\" (e.g: \"${badName}\") must be marked @internal`,\n name: 'code-style/underscored-members-must-be-internal',\n });\n\n public static readonly JSII_8007_BEHAVIORAL_INTERFACE_NAME = Code.error({\n code: 8007,\n formatter: (badName: string) => `Interface contains behavior. Rename \"${badName}\" to \"I${badName}\"`,\n name: 'code-style/behavioral-interface-name',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 9000 => 9999 -- SURPRISING ERRORS & INFORMATIONAL MESSAGES\n\n public static readonly JSII_9000_UNKNOWN_MODULE = Code.error({\n code: 9000,\n formatter: (moduleName) =>\n `Encountered use of module that is not declared in \"dependencies\" or \"peerDependencies\": \"${moduleName}\"`,\n name: 'miscellaneous/unknown-module',\n });\n\n public static readonly JSII_9001_TYPE_NOT_FOUND = Code.error({\n code: 9001,\n formatter: (typeRef: spec.NamedTypeReference) => `Type not found in the corresponding assembly: \"${typeRef.fqn}\"`,\n name: 'miscellaneous/type-not-found',\n });\n\n public static readonly JSII_9002_UNRESOLVEABLE_TYPE = Code.error({\n code: 9002,\n formatter: (reference: string) =>\n `Type \"${reference}\" is part of the public API but not exported (@internal or not exported from the package.json \"main\" file). Either export it or add @internal explicitly if you want this to be a hidden base class.`,\n name: 'miscellaneous/unresolveable-type',\n });\n\n public static readonly JSII_9003_UNRESOLVEABLE_MODULE = Code.error({\n code: 9003,\n formatter: (location: string) => `Unable to resolve module location \"${location}\"`,\n name: 'miscellaneous/unresolveable-module',\n });\n\n public static readonly JSII_9004_UNABLE_TO_COMPUTE_SIGNATURE = Code.error({\n code: 9004,\n formatter: (methodName: string, type: spec.Type) =>\n `Unable to compute signature for method \"${methodName}\" of \"${type.fqn}\"`,\n name: 'miscellaneous/unable-to-compute-signature',\n });\n\n public static readonly JSII_9996_UNNECESSARY_TOKEN = Code.message({\n code: 9996,\n formatter: () => 'Unnecessary token, consider removing it',\n name: 'miscellaneous/unnecessary-token',\n });\n\n public static readonly JSII_9997_UNKNOWN_ERROR = Code.error({\n code: 9997,\n formatter: (error: Error) => `Unknown error: ${error.message} -- ${error.stack}`,\n name: 'miscellaneous/unknown-error',\n });\n\n public static readonly JSII_9998_UNSUPPORTED_NODE = Code.message({\n code: 9998,\n formatter: (kindOrMessage: ts.SyntaxKind | string) =>\n typeof kindOrMessage === 'string'\n ? kindOrMessage\n : `Unsupported ${ts.SyntaxKind[kindOrMessage]} node. This declaration will not be accessible from other languages.`,\n name: 'miscellaneous/unsupported-node',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n\n /**\n * Determines whether a `Diagnostic` instance is a `JsiiDiagnostic` or not.\n * @param diag\n */\n public static isJsiiDiagnostic(diag: ts.Diagnostic): diag is JsiiDiagnostic {\n return (diag as unknown as JsiiDiagnostic).domain === JsiiDiagnostic.DOMAIN;\n }\n\n //////////////////////////////////////////////////////////////////////////////\n\n private static readonly JSII_9999_RELATED_INFO = Code.suggestion({\n code: 9999,\n formatter: (messageText) => messageText,\n name: 'miscellaneous/related-info',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n\n /**\n * This symbol unequivocally identifies the `JsiiDiagnostic` domain.\n */\n private static readonly DOMAIN = Symbol('jsii');\n\n private readonly domain = JsiiDiagnostic.DOMAIN;\n\n public readonly category: ts.DiagnosticCategory;\n public readonly code: number = JSII_DIAGNOSTICS_CODE;\n public readonly jsiiCode: number;\n public readonly messageText: string | ts.DiagnosticMessageChain;\n\n public readonly file: ts.SourceFile | undefined;\n public readonly start: number | undefined;\n public readonly length: number | undefined;\n\n public readonly relatedInformation = new Array<ts.DiagnosticRelatedInformation>();\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n #formatted?: string;\n\n /**\n * Creates a new `JsiiDiagnostic` with the provided properties.\n *\n * @internal\n */\n public constructor(code: Code, messageText: string | ts.DiagnosticMessageChain, location?: ts.Node) {\n this.category = code.category;\n this.jsiiCode = code.code;\n this.messageText = messageText;\n\n if (location != null) {\n this.file = location.getSourceFile();\n this.start = location.getStart(this.file);\n this.length = location.getEnd() - this.start;\n }\n }\n\n public addRelatedInformation(node: ts.Node, message: JsiiDiagnostic['messageText']): this {\n // Don't relate info into the TypeScript standard library\n if (!/[\\\\/]typescript[\\\\/]lib[\\\\/]lib\\..+\\.d\\.ts$/.test(node.getSourceFile().fileName)) {\n this.relatedInformation.push(JsiiDiagnostic.JSII_9999_RELATED_INFO.create(node, message));\n }\n // Clearing out #formatted, as this would no longer be the correct string.\n this.#formatted = undefined;\n return this;\n }\n\n /**\n * Links the provided `node` with the specified `message` as related to the\n * current diagnostic, unless `node` is undefined.\n *\n * @param node the node where the message should be attached, if any.\n * @param message the message to be attached to the diagnostic entry.\n *\n * @returns `this`\n */\n public addRelatedInformationIf(node: ts.Node | undefined, message: JsiiDiagnostic['messageText']): this {\n if (node != null) {\n return this.addRelatedInformation(node, message);\n } else {\n return this;\n }\n }\n\n /**\n * Adds related information to this `JsiiDiagnostic` instance if the provided\n * `node` is defined.\n *\n * @param node the node to bind as related information, or `undefined`.\n * @param message the message to attach to the related information.\n *\n * @returns `this`\n */\n public maybeAddRelatedInformation(node: ts.Node | undefined, message: JsiiDiagnostic['messageText']): this {\n if (node == null) {\n return this;\n }\n this.relatedInformation.push(JsiiDiagnostic.JSII_9999_RELATED_INFO.create(node, message));\n // Clearing out #formatted, as this would no longer be the correct string.\n this.#formatted = undefined;\n return this;\n }\n\n /**\n * Formats this diagnostic with color and context if possible, and returns it.\n * The formatted diagnostic is cached, so that it can be re-used. This is\n * useful for diagnostic messages involving trivia -- as the trivia may have\n * been obliterated from the `SourceFile` by the `TsCommentReplacer`, which\n * makes the error messages really confusing.\n */\n public format(projectRoot: string): string {\n if (this.#formatted == null) {\n this.#formatted = _formatDiagnostic(this, projectRoot);\n }\n return this.#formatted;\n }\n}\n\nexport type DiagnosticMessageFormatter = (...args: any[]) => JsiiDiagnostic['messageText'];\n\nexport function configureCategories(records: { [code: string]: ts.DiagnosticCategory }) {\n for (const [code, category] of Object.entries(records)) {\n const diagCode = Code.lookup(diagnosticCode(code));\n if (!diagCode) {\n throw new Error(`Unrecognized diagnostic code '${code}'`);\n }\n diagCode.category = category;\n }\n}\n\nfunction diagnosticCode(str: string): string | number {\n if (str.toLowerCase().startsWith('jsii')) {\n const re = /^JSII(\\d+)$/i.exec(str);\n if (re) {\n return parseInt(re[1], 10);\n }\n throw new Error(`Invalid diagnostic code ${str}. A number must follow code that starts with 'JSII'`);\n }\n return str;\n}\n"]}
|
1
|
+
{"version":3,"file":"jsii-diagnostic.js","sourceRoot":"","sources":["../src/jsii-diagnostic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAw4BA,kDAQC;AAh5BD,mCAAmC;AACnC,+BAA+C;AAC/C,iCAAiC;AAGjC,4EAA2E;AAE3E,mCAAmE;AAEnE;;;;;GAKG;AACH,MAAa,IAAI;IACf;;OAEG;IACI,MAAM,CAAC,OAAO,CAAuC,EAC1D,IAAI,EACJ,IAAI,EACJ,SAAS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vH,IAAI,EAAE,gCAAgC;CACvC,CAAC,AAP+C,CAO9C;AAYH,8EAA8E;AAEtD,qCAAsB,GAAG,IAAI,CAAC,UAAU,CAAC;IAC/D,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW;IACvC,IAAI,EAAE,4BAA4B;CACnC,CAAC,AAJ4C,CAI3C;AAEH,8EAA8E;AAE9E;;GAEG;AACqB,qBAAM,GAAG,MAAM,CAAC,MAAM,CAAC,AAAjB,CAAkB;AAkGlD,SAAgB,mBAAmB,CAAC,OAAkD;IACpF,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,GAAG,CAAC,CAAC;QAC5D,CAAC;QACD,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,EAAE,EAAE,CAAC;YACP,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,qDAAqD,CAAC,CAAC;IACvG,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as spec from '@jsii/spec';\nimport { camel, constant, pascal } from 'case';\nimport * as ts from 'typescript';\n\nimport { TypeSystemHints } from './docs';\nimport { WARNINGSCODE_FILE_NAME } from './transforms/deprecation-warnings';\nimport { Violation } from './tsconfig/validator';\nimport { JSII_DIAGNOSTICS_CODE, _formatDiagnostic } from './utils';\n\n/**\n * Descriptors for all valid jsii diagnostic codes.\n *\n * The `category` or non-error codes can be updated, for example to treat\n * warnings as errors, or to suppress certain undesirable warnings.\n */\nexport class Code<T extends DiagnosticMessageFormatter = DiagnosticMessageFormatter> {\n /**\n * @internal\n */\n public static message<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Message, formatter);\n }\n\n /**\n * @internal\n */\n public static suggestion<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Suggestion, formatter);\n }\n\n /**\n * @internal\n */\n public static warning<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Warning, formatter);\n }\n\n /**\n * @internal\n */\n public static error<T extends DiagnosticMessageFormatter>({\n code,\n name,\n formatter,\n }: {\n code: number;\n formatter: T;\n name: string;\n }) {\n return new Code<T>(code, name, ts.DiagnosticCategory.Error, formatter);\n }\n\n /**\n * Get a diagnostic code by code or name.\n *\n * @param codeOrName the looked up diagnostic code or name.\n *\n * @returns the JsiiDiagnosticCode instande, if one exists, or `undefined`\n *\n * @experimental this module is under active development and the error codes\n * and names may change in the future.\n */\n public static lookup(codeOrName: string | number): Code | undefined {\n if (typeof codeOrName === 'number') {\n return this.byCode.get(codeOrName);\n }\n return this.byName.get(codeOrName);\n }\n\n private static readonly byCode: Map<number, Code> = new Map();\n private static readonly byName: Map<string, Code> = new Map();\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n readonly #defaultCategory: ts.DiagnosticCategory;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n #category?: ts.DiagnosticCategory;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n #formatter: T;\n\n /**\n * Registers a new diagnostic code.\n *\n * @param code the numeric code for the diagnostic\n * @param name the symbolic name for the diagnostic\n * @param defaultCategory the default category this diagnostic ranks in\n * @param formatter a message formatter for easy creation of diagnostics\n */\n private constructor(\n public readonly code: number,\n public readonly name: string,\n defaultCategory: ts.DiagnosticCategory,\n formatter: T,\n ) {\n this.#defaultCategory = defaultCategory;\n this.#formatter = formatter;\n\n if (code in Code.byCode) {\n throw new Error(`Attempted to create two instances of ${this.constructor.name} with code ${code}`);\n }\n if (name in Code.byName) {\n throw new Error(`Attempted to create two instances of ${this.constructor.name} with name ${name}`);\n }\n Code.byCode.set(code, this);\n Code.byName.set(name, this);\n }\n\n /**\n * Determines whether this diagnostic is a compilation error. Diagnostics\n * where this is `true` cannot have their `category` overridden to a lower\n * category.\n */\n public get isError(): boolean {\n return this.#defaultCategory === ts.DiagnosticCategory.Error;\n }\n\n /**\n * The diagnostic category this particular code is filed as.\n */\n public get category(): ts.DiagnosticCategory {\n return this.#category ?? this.#defaultCategory;\n }\n\n /**\n * Update the diagnostic category for this particular code. If `isError` is\n * `true`, attempting to set anything other than `ts.DiagnosticCategory.Error`\n * will result in an error being throw.\n *\n * @param newValue the new diagnostic category to be used.\n */\n public set category(newValue: ts.DiagnosticCategory) {\n if (this.isError && newValue !== ts.DiagnosticCategory.Error) {\n throw new Error(\n `Illegal attempt to override category of error ${this.code} to ${ts.DiagnosticCategory[newValue]}`,\n );\n }\n this.#category = newValue;\n }\n\n /**\n * Creates a new `JsiiDiagnostic` message without any source code location\n * data.\n *\n * @param args the arguments to the message formatter.\n *\n * @deprecated It is preferred to specify a source code location for problem\n * markers. Prefer the use of `create` while providing a value\n * for the `location` parameter whenever possible.\n */\n public createDetached(...args: Parameters<T>): JsiiDiagnostic {\n return new JsiiDiagnostic(this, this.#formatter(...args));\n }\n\n /**\n * Creates a new `JsiiDiagnostic` message with source code location denoted\n * by the provided `location` node.\n *\n * @param location the source code location attachment of the message.\n * @param args the arguments to the message formatter.\n */\n public create(location: ts.Node | undefined, ...args: Parameters<T>): JsiiDiagnostic {\n return new JsiiDiagnostic(this, this.#formatter(...args), location);\n }\n}\n\n/**\n * A jsii-specific diagnostic entry.\n */\nexport class JsiiDiagnostic implements ts.Diagnostic {\n //////////////////////////////////////////////////////////////////////////////\n // 0001 => 0999 -- PACKAGE METADATA PROBLEMS\n\n public static readonly JSII_0001_PKG_MISSING_DESCRIPTION = Code.suggestion({\n code: 1,\n formatter: () => 'A \"description\" field should be specified in \"package.json\"',\n name: 'metadata/package-json-missing-description',\n });\n\n public static readonly JSII_0002_PKG_MISSING_HOMEPAGE = Code.suggestion({\n code: 2,\n formatter: () => 'A \"homepage\" field should be specified in \"package.json\"',\n name: 'metadata/package-json-missing-homepage',\n });\n\n public static readonly JSII_0003_MISSING_README = Code.warning({\n code: 3,\n formatter: () => 'There is no \"README.md\" file. It is required in order to generate valid PyPI (Python) packages.',\n name: 'metadata/missing-readme',\n });\n\n public static readonly JSII_0004_COULD_NOT_FIND_ENTRYPOINT = Code.error({\n code: 4,\n formatter: (mainFile: string) => `Could not find \"main\" file: ${mainFile}`,\n name: 'metadata/could-not-find-entrypoint',\n });\n\n public static readonly JSII_0005_MISSING_PEER_DEPENDENCY = Code.warning({\n code: 5,\n formatter: (assm: string, reference: string) =>\n `The type \"${reference}\" is exposed in the public API of this module. ` +\n `Therefore, the module \"${assm}\" must also be defined under \"peerDependencies\". ` +\n 'This will be auto-corrected unless --no-fix-peer-dependencies was specified.',\n name: 'metadata/missing-peer-dependency',\n });\n\n // NOTE: currently not possible to change the severity of this code,\n // as it's being emitted before the overrides have been loaded\n public static readonly JSII_0006_MISSING_DEV_DEPENDENCY = Code.warning({\n code: 6,\n formatter: (dependencyName: string, peerRange: string, minVersion: string, actual: string) =>\n `A \"peerDependency\" on \"${dependencyName}\" at \"${peerRange}\" means you ` +\n `should take a \"devDependency\" on \"${dependencyName}\" at \"${minVersion}\" ` +\n `(found ${JSON.stringify(actual)})`,\n name: 'metadata/missing-dev-dependency',\n });\n\n public static readonly JSII_0007_MISSING_WARNINGS_EXPORT = Code.error({\n code: 7,\n formatter: () =>\n 'If you are compiling with --add-deprecation-warnings and your package.json ' +\n `declares subpath exports, you must include { \"./${WARNINGSCODE_FILE_NAME}\": \"./${WARNINGSCODE_FILE_NAME}\" } ` +\n 'in the set of exports.',\n name: 'metadata/missing-warnings-export',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 1000 => 1999 -- TYPESCRIPT LANGUAGE RESTRICTIONS\n\n public static readonly JSII_1000_NO_CONST_ENUM = Code.error({\n code: 1000,\n formatter: () => 'Exported \"const enum\" declarations are not allowed',\n name: 'typescript-restrictions/no-const-enum',\n });\n\n public static readonly JSII_1001_TYPE_HAS_NO_SYMBOL = Code.error({\n code: 1001,\n formatter: () => 'Non-primitive types without a symbol cannot be processed.',\n name: 'typescript-restrictions/type-has-no-symbol',\n });\n\n public static readonly JSII_1002_UNSPECIFIED_PROMISE = Code.error({\n code: 1002,\n formatter: () => 'Un-specified promise type. Specify it using \"Promise<T>\"',\n name: 'typescript-restrictions/unspecified-promise',\n });\n\n public static readonly JSII_1003_UNSUPPORTED_TYPE = Code.error({\n code: 1003,\n formatter: (messageText) => messageText,\n name: 'typescript-restrictions/unsupported-type',\n });\n\n public static readonly JSII_1004_DUPLICATE_ENUM_VALUE = Code.error({\n code: 1004,\n formatter: (enumValue: string, enumMemberNames: string[]) =>\n `Value ${enumValue} is used for multiple enum values: ${enumMemberNames.join(', ')}`,\n name: 'typescript-restrictions/duplicate-enum-value',\n });\n\n public static readonly JSII_1005_SEPARATE_WRITE_TYPE = Code.error({\n code: 1005,\n formatter: () => 'Visible property signatures cannot use a separate write type. Use the same type as the getter.',\n name: 'typescript-restrictions/separate-write-type',\n });\n\n public static readonly JSII_1006_GENERIC_TYPE = Code.error({\n code: 1006,\n formatter: () => 'Generic types are not supported because semantics are not uniform in target languages.',\n name: 'typescript-restriction/generic-type',\n });\n\n public static readonly JSII_1999_UNSUPPORTED = Code.error({\n code: 1999,\n formatter: ({\n what,\n alternative,\n suggestInternal,\n }: {\n what: string;\n alternative?: string;\n suggestInternal?: boolean;\n }) =>\n `${what} are not supported in jsii APIs.${alternative ? ` Consider using ${alternative} instead.` : ''}${\n suggestInternal\n ? ` This declaration must${alternative ? ' otherwise' : ''} be marked \"@internal\" or \"@jsii ignore\".`\n : ''\n }`,\n name: 'typescript-restrictions/unsupported',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 2000 => 2999 -- INCORRECT USE OF THE @jsii DIRECTIVE\n public static readonly JSII_2000_MISSING_DIRECTIVE_ARGUMENT = Code.warning({\n code: 2000,\n formatter: () =>\n 'Missing argument to @jsii directive. Refer to the jsii compiler documentation for more information.',\n name: 'jsii-directive/missing-argument',\n });\n\n public static readonly JSII_2100_STRUCT_ON_NON_INTERFACE = Code.warning({\n code: 2100,\n formatter: () => 'The \"@jsii struct\" directive is only applicable to interface declarations.',\n name: 'jsii-directive/struct-on-non-interface',\n });\n\n public static readonly JSII_2999_UNKNOWN_DIRECTIVE = Code.warning({\n code: 2999,\n formatter: (text: string) =>\n `Unknown @jsii directive: ${JSON.stringify(\n text,\n )}. Refer to the jsii compiler documentation for more information.`,\n name: 'jsii-directive/unknown',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 3000 => 3999 -- TYPE MODEL COHERENCE\n\n public static readonly JSII_3000_EXPORTED_API_USES_HIDDEN_TYPE = Code.error({\n code: 3000,\n formatter: (badFqn) => `Exported APIs cannot use un-exported type \"${badFqn}\"`,\n name: 'type-model/exported-api-cannot-use-unexported-type',\n });\n\n public static readonly JSII_3001_EXPOSED_INTERNAL_TYPE = Code.error({\n code: 3001,\n formatter: (symbol: ts.Symbol, isThisType: boolean, typeUse: string) =>\n `Type ${\n isThisType ? `\"this\" (aka: \"${symbol.name}\")` : `\"${symbol.name}\"`\n } cannot be used as the ${typeUse} because it is private or @internal`,\n name: 'type-model/use-of-internal-type',\n });\n\n public static readonly JSII_3002_USE_OF_UNEXPORTED_FOREIGN_TYPE = Code.error({\n code: 3002,\n formatter: (fqn: string, typeUse: string, pkg: { readonly name: string }) =>\n `Type \"${fqn}\" cannot be used as a ${typeUse} because it is not exported from ${pkg.name}`,\n name: 'type-model/unexported-foreign-type',\n });\n\n public static readonly JSII_3003_SYMBOL_IS_EXPORTED_TWICE = Code.error({\n code: 3003,\n formatter: (ns1: string, ns2: string) => `Symbol is exported under two distinct submodules: ${ns1} and ${ns2}`,\n name: 'type-model/symbol-is-exported-twice',\n });\n\n public static readonly JSII_3004_INVALID_SUPERTYPE = Code.error({\n code: 3004,\n formatter: (clause: ts.HeritageClause, badDeclaration: ts.Declaration) => {\n return `Illegal ${clauseType(clause.token)} clause for an exported API: ${ts.SyntaxKind[badDeclaration.kind]}`;\n\n function clauseType(token: ts.SyntaxKind): string {\n switch (token) {\n case ts.SyntaxKind.ExtendsKeyword:\n return 'extends';\n case ts.SyntaxKind.ImplementsKeyword:\n return 'implements';\n default:\n return ts.SyntaxKind[token];\n }\n }\n },\n name: 'type-model/invalid-supertype',\n });\n\n public static readonly JSII_3005_TYPE_USED_AS_INTERFACE = Code.error({\n code: 3005,\n formatter: (badType: spec.TypeReference) =>\n `Type \"${spec.describeTypeReference(badType)}\" cannot be used as an interface`,\n name: 'type-model/type-used-as-interface',\n });\n\n public static readonly JSII_3006_TYPE_USED_AS_CLASS = Code.error({\n code: 3006,\n formatter: (badType: spec.TypeReference) =>\n `Type \"${spec.describeTypeReference(badType)}\" cannot be used as a class`,\n name: 'type-model/type-used-as-class',\n });\n\n public static readonly JSII_3007_ILLEGAL_STRUCT_EXTENSION = Code.error({\n code: 3007,\n formatter: (offender: spec.Type, struct: spec.InterfaceType) =>\n `Attempt to extend or implement struct \"${struct.fqn}\" from \"${offender.fqn}\"`,\n name: 'type-model/illegal-struct-extension',\n });\n\n public static readonly JSII_3008_STRUCT_PROPS_MUST_BE_READONLY = Code.error({\n code: 3008,\n formatter: (propName: string, struct: spec.InterfaceType) =>\n `The \"${propName}\" property of struct \"${struct.fqn}\" must be \"readonly\". Rename \"${struct.fqn}\" to \"I${struct.name}\" if it is meant to be a behavioral interface.`,\n name: 'type-model/struct-props-must-be-readonly',\n });\n\n public static readonly JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED = Code.error({\n code: 3009,\n formatter: (param: spec.Parameter, nextParam: spec.Parameter) =>\n `Parameter \"${param.name}\" cannot be optional, as it precedes required parameter \"${nextParam.name}\"`,\n name: 'type-model/optional-parameter-before-required',\n });\n\n public static readonly JSII_3999_INCOHERENT_TYPE_MODEL = Code.error({\n code: 3999,\n formatter: (messageText) => messageText,\n name: 'type-model/incoherent-type-model',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 4000 => 4999 -- TYPESCRIPT & JSII CONFIG ERRORS\n\n public static readonly JSII_4000_FAILED_TSCONFIG_VALIDATION = Code.error({\n code: 4000,\n formatter: (config: string, ruleSet: string, violations: Array<Violation>) => {\n return `Typescript compiler options in \"${config}\" are not passing validation against rule set \"${ruleSet}\", found the following rule violations:\\n${violations\n .map((v) => ` - ${v.field}: ${v.message}`)\n .join('\\n')}`;\n },\n name: 'typescript-config/invalid-tsconfig',\n });\n\n public static readonly JSII_4009_DISABLED_TSCONFIG_VALIDATION = Code.warning({\n code: 4009,\n formatter: (config: string) =>\n `Validation of typescript config \"${config}\" is disabled. This is intended for experimental setups only. Compilation might fail or produce incompatible artifacts.`,\n name: 'typescript-config/disabled-tsconfig-validation',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 5000 => 5999 -- LANGUAGE COMPATIBILITY ERRORS\n\n public static readonly JSII_5000_JAVA_GETTERS = Code.error({\n code: 5000,\n formatter: (badName: string, typeName: string) =>\n `Methods and properties cannot have names like \"getXxx\": those conflict with Java property getters. Rename \"${typeName}.${badName}\"`,\n name: 'language-compatibility/potential-java-getter-conflict',\n });\n\n public static readonly JSII_5001_JAVA_SETTERS = Code.error({\n code: 5001,\n formatter: (badName: string, typeName: string) =>\n `Methods and properties cannot have names like \"setXxx\": those conflict with Java property setters. Rename \"${typeName}.${badName}\"`,\n name: 'language-compatibility/potential-java-setter-conflict',\n });\n\n public static readonly JSII_5002_OVERRIDE_CHANGES_VISIBILITY = Code.error({\n code: 5002,\n formatter: (\n newElement: string,\n action: string,\n newValue: 'protected' | 'public',\n oldValue: 'protected' | 'public',\n ) => `\"${newElement}\" changes visibility to ${newValue} when ${action}. Change it to ${oldValue}`,\n name: 'language-compatibility/override-changes-visibility',\n });\n\n public static readonly JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE = Code.error({\n code: 5003,\n formatter: (newElement: string, action: string, newValue: string, oldValue: string) =>\n `\"${newElement}\" changes the return type to \"${newValue}\" when ${action}. Change it to \"${oldValue}\"`,\n name: 'language-compatibility/override-changes-return-type',\n });\n\n public static readonly JSII_5004_OVERRIDE_CHANGES_PROP_TYPE = Code.error({\n code: 5004,\n formatter: (newElement: string, action: string, newType: spec.TypeReference, oldType: spec.TypeReference) =>\n `\"${newElement}\" changes the property type to \"${spec.describeTypeReference(\n newType,\n )}\" when ${action}. Change it to \"${spec.describeTypeReference(oldType)}\"`,\n name: 'language-compatibility/override-changes-property-type',\n });\n\n public static readonly JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT = Code.error({\n code: 5005,\n formatter: (newElement: string, action: string, newCount: number, oldCount: number) =>\n `\"${newElement}\" has ${newCount} parameters when ${action}. It should accept ${oldCount} parameters`,\n name: 'language-compatibility/override-changes-param-count',\n });\n\n public static readonly JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE = Code.error({\n code: 5006,\n formatter: (newElement: string, action: string, newParam: spec.Parameter, oldParam: spec.Parameter) =>\n `\"${newElement}\" changes the type of parameter \"${newParam.name}\" to ${spec.describeTypeReference(\n newParam.type,\n )} when ${action}. Change it to ${spec.describeTypeReference(oldParam.type)}`,\n name: 'language-compatibility/override-changes-param-type',\n });\n\n public static readonly JSII_5007_OVERRIDE_CHANGES_VARIADIC = Code.error({\n code: 5007,\n formatter: (newElement: string, action: string, newVariadic = false, oldVariadic = false) =>\n `\"${newElement}\" turns ${newVariadic ? 'variadic' : 'non variadic'} when ${action}. Make it ${\n oldVariadic ? 'variadic' : 'non-variadic'\n }`,\n name: 'language-compatibility/override-changes-variadic',\n });\n\n public static readonly JSII_5008_OVERRIDE_CHANGES_PARAM_OPTIONAL = Code.error({\n code: 5008,\n formatter: (newElement: string, action: string, newParam: spec.Parameter, oldParam: spec.Parameter) =>\n `\"${newElement}\" turns parameter \"${newParam.name}\" ${\n newParam.optional ? 'optional' : 'required'\n } when ${action}. Make it ${oldParam.optional ? 'optional' : 'required'}`,\n name: 'language-compatibility/override-changes-param-optional',\n });\n\n public static readonly JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL = Code.error({\n code: 5009,\n formatter: (newElement: string, action: string, newOptional = false, oldOptional = false) =>\n `\"${newElement}\" turns ${newOptional ? 'optional' : 'required'} when ${action}. Make it ${\n oldOptional ? 'optional' : 'required'\n }`,\n name: 'language-compatibility/override-changes-prop-optional',\n });\n\n public static readonly JSII_5010_OVERRIDE_CHANGES_MUTABILITY = Code.error({\n code: 5010,\n formatter: (newElement: string, action: string, newReadonly = false, oldReadonly = false) =>\n `\"${newElement}\" turns ${newReadonly ? 'readonly' : 'mutable'} when ${action}. Make it ${\n oldReadonly ? 'readonly' : 'mutable'\n }`,\n name: 'language-compatibility/override-changes-mutability',\n });\n\n public static readonly JSII_5011_SUBMODULE_NAME_CONFLICT = Code.error({\n code: 5011,\n formatter: (submoduleName: string, typeName: string, reserved: readonly string[]) =>\n `Submodule \"${submoduleName}\" conflicts with \"${typeName}, as different languages could represent it as: ${reserved\n .map((x) => `\"${x}\"`)\n .join(', ')}\"`,\n name: 'language-compatibility/submodule-name-conflicts',\n });\n\n public static readonly JSII_5012_NAMESPACE_IN_TYPE = Code.error({\n code: 5012,\n formatter: (typeName: string, namespaceName: string) =>\n `All entities nested under a type (e.g: \"${typeName}\") must be concrete types, but \"${namespaceName}\" is a namespace. This structure cannot be supported in all languages (e.g: Java)`,\n name: 'language-compatibility/namespace-in-type',\n });\n\n public static readonly JSII_5013_STATIC_INSTANCE_CONFLICT = Code.error({\n code: 5013,\n formatter: (member: string, type: spec.ClassType) =>\n `Member \"${member}\" of class \"${type.fqn}\" has both a static and an instance delcaration`,\n name: 'language-compatibility/static-instance-conflict',\n });\n\n public static readonly JSII_5014_INHERITED_STATIC_CONFLICT = Code.error({\n code: 5014,\n formatter: (\n member: spec.Method | spec.Property,\n type: spec.ClassType,\n baseMember: spec.Method | spec.Property,\n baseType: spec.ClassType,\n ) =>\n `${member.static ? 'Static' : 'Instance'} member \"${member.name}\" of class \"${type.fqn}\" conflicts with ${\n baseMember.static ? 'static' : 'instance'\n } member in ancestor \"${baseType.fqn}\"`,\n name: 'language-compatibility/inherited-static-conflict',\n });\n\n public static readonly JSII_5015_REDECLARED_INTERFACE_MEMBER = Code.error({\n code: 5015,\n formatter: (memberName: string, iface: spec.InterfaceType) =>\n `Interface \"${iface.fqn}\" re-declares member \"${memberName}\". This is not supported as it results in invalid C#.`,\n name: 'language-compatibility/redeclared-interface-member',\n });\n\n public static readonly JSII_5016_PROHIBITED_MEMBER_NAME = Code.error({\n code: 5016,\n formatter: (badName: string) =>\n `Members cannot be named \"${badName}\" as it conflicts with synthetic declarations in some languages.`,\n name: 'language-compatibility/prohibited-member-name',\n });\n\n public static readonly JSII_5017_POSITIONAL_KEYWORD_CONFLICT = Code.error({\n code: 5017,\n formatter: (badName: string) =>\n `Parameter name \"${badName}\" is also the name of a property in a struct parameter. Rename the positional parameter.`,\n name: 'language-compatibility/positional-keyword-conflict',\n });\n\n public static readonly JSII_5018_RESERVED_WORD = Code.warning({\n code: 5018,\n formatter: (badName: string, languages: readonly string[]) =>\n `\"${badName}\" is a reserved word in ${languages.join(\n ', ',\n )}. Using this name may cause problems when generating language bindings. Consider a different name.`,\n name: 'language-compatibility/reserved-word',\n });\n\n public static readonly JSII_5019_MEMBER_TYPE_NAME_CONFLICT = Code.warning({\n code: 5019,\n formatter: (memberKind: 'method' | 'property', memberSymbol: ts.Symbol, declaringType: spec.Type) =>\n `The ${memberKind} name \"${memberSymbol.name}\" conflicts with the declaring ${declaringType.kind} \"${declaringType.name}\". This will result in renaming the ${declaringType.kind} to \"_${declaringType.name}\" in C#. Consider renaming \"${memberSymbol.name}\".`,\n name: 'language-compatibility/member-name-conflicts-with-type-name',\n });\n\n public static readonly JSII_5020_STATIC_MEMBER_CONFLICTS_WITH_NESTED_TYPE = Code.error({\n code: 5020,\n formatter: (\n nestingType: spec.Type,\n staticMember: spec.Property | spec.Method | spec.EnumMember,\n nestedType: spec.Type,\n ) =>\n `The static member \"${nestingType.name}.${staticMember.name}\" has the same PascalCased representation as nested type \"${nestingType.name}.${nestedType.name}\". This would result in invalid code in Go.`,\n name: 'language-compatibility/static-member-name-conflicts-with-nested-type',\n });\n\n public static readonly JSII_5021_ABSTRACT_CLASS_MISSING_PROP_IMPL = Code.error({\n code: 5021,\n formatter: (intf: spec.InterfaceType, cls: spec.ClassType, prop: string) =>\n `A declaration of \"${intf.name}.${prop}\" is missing on class \"${cls.name}\". Declare the property as \"public abstract\" if you want to defer it to subclasses.`,\n name: 'language-compatibility/abstract-class-missing-prop-impl',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 6000 => 6999 -- RESERVED\n\n //////////////////////////////////////////////////////////////////////////////\n // 7000 => 7999 -- DOCUMENTATION ERRORS\n\n public static readonly JSII_7000_NON_EXISTENT_PARAMETER = Code.warning({\n code: 7000,\n formatter: (method: spec.Method, param: string) =>\n `Documentation for method \"${method.name}\" refers to non-existent @param \"${param}\"`,\n name: 'documentation/non-existent-parameter',\n });\n\n public static readonly JSII_7001_ILLEGAL_HINT = Code.error({\n code: 7001,\n formatter: (hint: keyof TypeSystemHints, ...valid: readonly string[]) =>\n `Illegal use of \"@${hint}\" hint. It is only valid on ${valid.join(', ')}.`,\n name: 'documentation/illegal-hint',\n });\n\n public static readonly JSII_7999_DOCUMENTATION_ERROR = Code.error({\n code: 7999,\n formatter: (messageText) => messageText,\n name: 'documentation/documentation-error',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 8000 => 8999 -- JSII STYLE ENFORCEMENT\n\n public static readonly JSII_8000_PASCAL_CASED_TYPE_NAMES = Code.error({\n code: 8000,\n formatter: (badName: string, expectedName: string = pascal(badName)) =>\n `Type names must be PascalCased. Rename \"${badName}\" to \"${expectedName}\"`,\n name: 'code-style/type-names-must-use-pascal-case',\n });\n\n public static readonly JSII_8001_ALL_CAPS_ENUM_MEMBERS = Code.error({\n code: 8001,\n formatter: (badName: string, typeName: string) =>\n `Enum members must be ALL_CAPS. Rename \"${typeName}.${badName}\" to \"${constant(badName)}\"`,\n name: 'code-style/enum-members-must-use-all-caps',\n });\n\n public static readonly JSII_8002_CAMEL_CASED_MEMBERS = Code.error({\n code: 8002,\n formatter: (badName: string, typeName: string) =>\n `Method and property (unless they are static readonly) names must use camelCase. Rename \"${typeName}.${badName}\" to \"${camel(\n badName,\n )}\"`,\n name: 'code-style/member-names-must-use-camel-case',\n });\n\n public static readonly JSII_8003_STATIC_CONST_CASING = Code.error({\n code: 8003,\n formatter: (badName: string, typeName: string) =>\n `Static constant names must use ALL_CAPS, PascalCase, or camelCase. Rename \"${typeName}.${badName}\" to \"${constant(\n badName,\n )}\"`,\n name: 'code-style/static-readonly-property-casing',\n });\n\n public static readonly JSII_8004_SUBMOULE_NAME_CASING = Code.error({\n code: 8004,\n formatter: (badName: string) =>\n `Submodule namespaces must be camelCased or snake_cased. Rename \"${badName}\" to ${camel(badName)}`,\n name: 'code-style/submodule-name-casing',\n });\n\n public static readonly JSII_8005_INTERNAL_UNDERSCORE = Code.error({\n code: 8005,\n formatter: (badName: string) =>\n `Members marked with @internal must have a name starting with \"_\". Rename \"${badName}\" to \"_${badName}\"`,\n name: 'code-style/internal-members-underscore-prefix',\n });\n\n public static readonly JSII_8006_UNDERSCORE_INTERNAL = Code.error({\n code: 8006,\n formatter: (badName: string) =>\n `Members with a name starting with \"_\" (e.g: \"${badName}\") must be marked @internal`,\n name: 'code-style/underscored-members-must-be-internal',\n });\n\n public static readonly JSII_8007_BEHAVIORAL_INTERFACE_NAME = Code.error({\n code: 8007,\n formatter: (badName: string) => `Interface contains behavior. Rename \"${badName}\" to \"I${badName}\"`,\n name: 'code-style/behavioral-interface-name',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n // 9000 => 9999 -- SURPRISING ERRORS & INFORMATIONAL MESSAGES\n\n public static readonly JSII_9000_UNKNOWN_MODULE = Code.error({\n code: 9000,\n formatter: (moduleName) =>\n `Encountered use of module that is not declared in \"dependencies\" or \"peerDependencies\": \"${moduleName}\"`,\n name: 'miscellaneous/unknown-module',\n });\n\n public static readonly JSII_9001_TYPE_NOT_FOUND = Code.error({\n code: 9001,\n formatter: (typeRef: spec.NamedTypeReference) => `Type not found in the corresponding assembly: \"${typeRef.fqn}\"`,\n name: 'miscellaneous/type-not-found',\n });\n\n public static readonly JSII_9002_UNRESOLVEABLE_TYPE = Code.error({\n code: 9002,\n formatter: (reference: string) =>\n `Type \"${reference}\" is part of the public API but not exported (@internal or not exported from the package.json \"main\" file). Either export it or add @internal explicitly if you want this to be a hidden base class.`,\n name: 'miscellaneous/unresolveable-type',\n });\n\n public static readonly JSII_9003_UNRESOLVEABLE_MODULE = Code.error({\n code: 9003,\n formatter: (location: string) => `Unable to resolve module location \"${location}\"`,\n name: 'miscellaneous/unresolveable-module',\n });\n\n public static readonly JSII_9004_UNABLE_TO_COMPUTE_SIGNATURE = Code.error({\n code: 9004,\n formatter: (methodName: string, type: spec.Type) =>\n `Unable to compute signature for method \"${methodName}\" of \"${type.fqn}\"`,\n name: 'miscellaneous/unable-to-compute-signature',\n });\n\n public static readonly JSII_9996_UNNECESSARY_TOKEN = Code.message({\n code: 9996,\n formatter: () => 'Unnecessary token, consider removing it',\n name: 'miscellaneous/unnecessary-token',\n });\n\n public static readonly JSII_9997_UNKNOWN_ERROR = Code.error({\n code: 9997,\n formatter: (error: Error) => `Unknown error: ${error.message} -- ${error.stack}`,\n name: 'miscellaneous/unknown-error',\n });\n\n public static readonly JSII_9998_UNSUPPORTED_NODE = Code.message({\n code: 9998,\n formatter: (kindOrMessage: ts.SyntaxKind | string) =>\n typeof kindOrMessage === 'string'\n ? kindOrMessage\n : `Unsupported ${ts.SyntaxKind[kindOrMessage]} node. This declaration will not be accessible from other languages.`,\n name: 'miscellaneous/unsupported-node',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n\n /**\n * Determines whether a `Diagnostic` instance is a `JsiiDiagnostic` or not.\n * @param diag\n */\n public static isJsiiDiagnostic(diag: ts.Diagnostic): diag is JsiiDiagnostic {\n return (diag as unknown as JsiiDiagnostic).domain === JsiiDiagnostic.DOMAIN;\n }\n\n //////////////////////////////////////////////////////////////////////////////\n\n private static readonly JSII_9999_RELATED_INFO = Code.suggestion({\n code: 9999,\n formatter: (messageText) => messageText,\n name: 'miscellaneous/related-info',\n });\n\n //////////////////////////////////////////////////////////////////////////////\n\n /**\n * This symbol unequivocally identifies the `JsiiDiagnostic` domain.\n */\n private static readonly DOMAIN = Symbol('jsii');\n\n private readonly domain = JsiiDiagnostic.DOMAIN;\n\n public readonly category: ts.DiagnosticCategory;\n public readonly code: number = JSII_DIAGNOSTICS_CODE;\n public readonly jsiiCode: number;\n public readonly messageText: string | ts.DiagnosticMessageChain;\n\n public readonly file: ts.SourceFile | undefined;\n public readonly start: number | undefined;\n public readonly length: number | undefined;\n\n public readonly relatedInformation = new Array<ts.DiagnosticRelatedInformation>();\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n #formatted?: string;\n\n /**\n * Creates a new `JsiiDiagnostic` with the provided properties.\n *\n * @internal\n */\n public constructor(code: Code, messageText: string | ts.DiagnosticMessageChain, location?: ts.Node) {\n this.category = code.category;\n this.jsiiCode = code.code;\n this.messageText = messageText;\n\n if (location != null) {\n this.file = location.getSourceFile();\n this.start = location.getStart(this.file);\n this.length = location.getEnd() - this.start;\n }\n }\n\n public addRelatedInformation(node: ts.Node, message: JsiiDiagnostic['messageText']): this {\n // Don't relate info into the TypeScript standard library\n if (!/[\\\\/]typescript[\\\\/]lib[\\\\/]lib\\..+\\.d\\.ts$/.test(node.getSourceFile().fileName)) {\n this.relatedInformation.push(JsiiDiagnostic.JSII_9999_RELATED_INFO.create(node, message));\n }\n // Clearing out #formatted, as this would no longer be the correct string.\n this.#formatted = undefined;\n return this;\n }\n\n /**\n * Links the provided `node` with the specified `message` as related to the\n * current diagnostic, unless `node` is undefined.\n *\n * @param node the node where the message should be attached, if any.\n * @param message the message to be attached to the diagnostic entry.\n *\n * @returns `this`\n */\n public addRelatedInformationIf(node: ts.Node | undefined, message: JsiiDiagnostic['messageText']): this {\n if (node != null) {\n return this.addRelatedInformation(node, message);\n } else {\n return this;\n }\n }\n\n /**\n * Adds related information to this `JsiiDiagnostic` instance if the provided\n * `node` is defined.\n *\n * @param node the node to bind as related information, or `undefined`.\n * @param message the message to attach to the related information.\n *\n * @returns `this`\n */\n public maybeAddRelatedInformation(node: ts.Node | undefined, message: JsiiDiagnostic['messageText']): this {\n if (node == null) {\n return this;\n }\n this.relatedInformation.push(JsiiDiagnostic.JSII_9999_RELATED_INFO.create(node, message));\n // Clearing out #formatted, as this would no longer be the correct string.\n this.#formatted = undefined;\n return this;\n }\n\n /**\n * Formats this diagnostic with color and context if possible, and returns it.\n * The formatted diagnostic is cached, so that it can be re-used. This is\n * useful for diagnostic messages involving trivia -- as the trivia may have\n * been obliterated from the `SourceFile` by the `TsCommentReplacer`, which\n * makes the error messages really confusing.\n */\n public format(projectRoot: string): string {\n if (this.#formatted == null) {\n this.#formatted = _formatDiagnostic(this, projectRoot);\n }\n return this.#formatted;\n }\n}\n\nexport type DiagnosticMessageFormatter = (...args: any[]) => JsiiDiagnostic['messageText'];\n\nexport function configureCategories(records: { [code: string]: ts.DiagnosticCategory }) {\n for (const [code, category] of Object.entries(records)) {\n const diagCode = Code.lookup(diagnosticCode(code));\n if (!diagCode) {\n throw new Error(`Unrecognized diagnostic code '${code}'`);\n }\n diagCode.category = category;\n }\n}\n\nfunction diagnosticCode(str: string): string | number {\n if (str.toLowerCase().startsWith('jsii')) {\n const re = /^JSII(\\d+)$/i.exec(str);\n if (re) {\n return parseInt(re[1], 10);\n }\n throw new Error(`Invalid diagnostic code ${str}. A number must follow code that starts with 'JSII'`);\n }\n return str;\n}\n"]}
|
@@ -233,7 +233,9 @@ class DeprecatedRemover {
|
|
233
233
|
if ((0, spec_1.isCollectionTypeReference)(ref)) {
|
234
234
|
return this.tryFindReference(ref.collection.elementtype, fqns);
|
235
235
|
}
|
236
|
-
return ref
|
236
|
+
return setTypeMembers(ref)
|
237
|
+
.map((type) => this.tryFindReference(type, fqns))
|
238
|
+
.find((typeRef) => typeRef != null);
|
237
239
|
}
|
238
240
|
shouldFqnBeStripped(fqn) {
|
239
241
|
return this.allowlistedDeprecations?.has(fqn) ?? true;
|
@@ -490,4 +492,12 @@ DeprecationRemovalTransformer.IGNORE_CHILDREN = new Set([
|
|
490
492
|
ts.SyntaxKind.SetAccessor,
|
491
493
|
ts.SyntaxKind.VariableDeclaration,
|
492
494
|
]);
|
495
|
+
function setTypeMembers(x) {
|
496
|
+
if ((0, spec_1.isUnionTypeReference)(x)) {
|
497
|
+
return x.union.types;
|
498
|
+
}
|
499
|
+
else {
|
500
|
+
return x.intersection.types;
|
501
|
+
}
|
502
|
+
}
|
493
503
|
//# sourceMappingURL=deprecated-remover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deprecated-remover.js","sourceRoot":"","sources":["../../src/transforms/deprecated-remover.ts"],"names":[],"mappings":";;;AAAA,yCAAwD;AACxD,qCAkBoB;AACpB,iCAAiC;AAEjC,wDAAoD;AACpD,6CAA6C;AAC7C,oCAAqC;AAErC,M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/B,EAAE,CAAC,UAAU,CAAC,mBAAmB;IACjC,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,mBAAmB;CAClC,CAAC,AAVqC,CAUpC","sourcesContent":["import { basename, dirname, relative } from 'node:path';\nimport {\n Assembly,\n ClassType,\n EnumMember,\n Initializer,\n InterfaceType,\n isClassOrInterfaceType,\n isClassType,\n isCollectionTypeReference,\n isEnumType,\n isMethod,\n isNamedTypeReference,\n isPrimitiveTypeReference,\n Method,\n Parameter,\n Property,\n Stability,\n TypeReference,\n} from '@jsii/spec';\nimport * as ts from 'typescript';\n\nimport { JsiiDiagnostic } from '../jsii-diagnostic';\nimport * as bindings from '../node-bindings';\nimport { JsiiError } from '../utils';\n\nexport class DeprecatedRemover {\n private readonly transformations = new Array<Transformation>();\n private readonly nodesToRemove = new Set<ts.Node>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly allowlistedDeprecations: Set<string> | undefined,\n ) {}\n\n /**\n * Obtains the configuration for the TypeScript transform(s) that will remove\n * `@deprecated` members from the generated declarations (`.d.ts`) files. It\n * will leverage information accumulated during `#removeFrom(Assembly)` in\n * order to apply corrections to inheritance chains, ensuring a valid output\n * is produced.\n */\n public get customTransformers(): ts.CustomTransformers {\n return {\n afterDeclarations: [\n (context) => {\n const transformer = new DeprecationRemovalTransformer(\n this.typeChecker,\n context,\n this.transformations,\n this.nodesToRemove,\n );\n return transformer.transform.bind(transformer);\n },\n ],\n };\n }\n\n /**\n * Removes all `@deprecated` API elements from the provided assembly, and\n * records the operations needed in order to fix the inheritance chains that\n * mix `@deprecated` and non-`@deprecated` types.\n *\n * @param assembly the assembly to be modified.\n *\n * @returns diagnostic messages produced when validating no remaining API\n * makes use of a `@deprecated` type that was removed.\n */\n public removeFrom(assembly: Assembly): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const strippedFqns = new Set<string>();\n const replaceWithClass = new Map<string, string>();\n const replaceWithInterfaces = new Map<string, readonly string[]>();\n\n // Find all types that will be stripped out\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n if (typeInfo.docs?.stability === Stability.Deprecated) {\n if (!this.shouldFqnBeStripped(fqn)) {\n continue;\n }\n strippedFqns.add(fqn);\n\n if (isClassType(typeInfo) && typeInfo.base != null) {\n replaceWithClass.set(fqn, typeInfo.base);\n }\n if (isClassOrInterfaceType(typeInfo) && typeInfo.interfaces != null) {\n replaceWithInterfaces.set(fqn, typeInfo.interfaces);\n }\n\n this.nodesToRemove.add(bindings.getRelatedNode(typeInfo)!);\n }\n }\n\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n // Ignore `@deprecated` types\n if (strippedFqns.has(fqn)) {\n continue;\n }\n\n // Enums cannot have references to `@deprecated` types, but can have deprecated members\n if (isEnumType(typeInfo)) {\n const enumNode = bindings.getEnumRelatedNode(typeInfo)!;\n const members: EnumMember[] = [];\n for (const mem of typeInfo.members) {\n if (mem.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${mem.name}`)) {\n const matchingMemberNode = enumNode.members.find((enumMem) => enumMem.name.getText() === mem.name);\n if (matchingMemberNode) {\n this.nodesToRemove.add(matchingMemberNode);\n }\n } else {\n members.push(mem);\n }\n }\n typeInfo.members = members;\n continue;\n }\n\n // For classes, we erase `@deprecated` base classes, replacing as needed\n const additionalInterfaces = new Set<string>();\n if (isClassType(typeInfo) && typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n while (typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n const oldBase = assembly.types[typeInfo.base] as ClassType;\n if (oldBase.interfaces) for (const addFqn of oldBase.interfaces) additionalInterfaces.add(addFqn);\n typeInfo.base = replaceWithClass.get(typeInfo.base);\n }\n this.transformations.push(\n typeInfo.base != null\n ? Transformation.replaceBaseClass(\n this.typeChecker,\n bindings.getClassRelatedNode(typeInfo)!,\n typeInfo.base in assembly.types\n ? bindings.getClassRelatedNode(assembly.types[typeInfo.base] as ClassType) ?? typeInfo.base\n : typeInfo.base,\n )\n : Transformation.removeBaseClass(this.typeChecker, bindings.getClassRelatedNode(typeInfo)!),\n );\n }\n\n // Be defensive in case we add other kinds in the future\n if (!isClassOrInterfaceType(typeInfo)) {\n throw new Error(`Unhandled type encountered! ${JSON.stringify(typeInfo, null, 2)}`);\n }\n\n // Strip all `@deprecated` interfaces from the inheritance tree, replacing as needed\n if (typeInfo.interfaces?.some((addFqn) => strippedFqns.has(addFqn)) || additionalInterfaces.size > 0) {\n const originalSet = new Set(typeInfo.interfaces ?? []);\n const newSet = new Set<string>();\n\n const candidates = Array.from(new Set([...originalSet, ...additionalInterfaces]));\n while (candidates.length > 0) {\n const candidateFqn = candidates.pop()!;\n if (!strippedFqns.has(candidateFqn)) {\n newSet.add(candidateFqn);\n if (!originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.addInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n candidateFqn in assembly.types\n ? bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType) ?? candidateFqn\n : candidateFqn,\n ),\n );\n }\n continue;\n }\n if (originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.removeInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType)!,\n ),\n );\n }\n const replacement = replaceWithInterfaces.get(candidateFqn);\n if (replacement != null) {\n candidates.push(...replacement);\n }\n }\n\n typeInfo.interfaces = newSet.size > 0 ? Array.from(newSet).sort() : undefined;\n }\n\n // Drop all `@deprecated` members, and remove \"overrides\" from stripped types\n const methods: Method[] = [];\n const properties: Property[] = [];\n if (typeInfo.methods) {\n for (const meth of typeInfo.methods) {\n if (meth.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${meth.name}`)) {\n this.nodesToRemove.add(bindings.getMethodRelatedNode(meth)!);\n } else {\n methods.push(\n meth.overrides != null && strippedFqns.has(meth.overrides) ? { ...meth, overrides: undefined } : meth,\n );\n }\n }\n }\n typeInfo.methods = typeInfo.methods ? methods : undefined;\n if (typeInfo.properties) {\n for (const prop of typeInfo.properties) {\n if (prop.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${prop.name}`)) {\n this.nodesToRemove.add(bindings.getParameterRelatedNode(prop)!);\n } else {\n properties.push(\n prop.overrides != null && strippedFqns.has(prop.overrides) ? { ...prop, overrides: undefined } : prop,\n );\n }\n }\n }\n typeInfo.properties = typeInfo.properties ? properties : undefined;\n }\n\n const diagnostics = this.findLeftoverUseOfDeprecatedAPIs(assembly, strippedFqns);\n\n // Remove all `@deprecated` types, after we did everything, so we could\n // still access the related nodes from the assembly object.\n for (const fqn of strippedFqns) {\n if (this.shouldFqnBeStripped(fqn)) {\n delete assembly.types[fqn];\n }\n }\n\n return diagnostics;\n }\n\n private findLeftoverUseOfDeprecatedAPIs(assembly: Assembly, strippedFqns: Set<string>): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const result = new Array<JsiiDiagnostic>();\n\n for (const type of Object.values(assembly.types)) {\n if (isEnumType(type) || strippedFqns.has(type.fqn)) {\n continue;\n }\n if (isClassType(type) && type.initializer) {\n result.push(...this.verifyCallable(assembly, strippedFqns, type.initializer));\n }\n if (type.methods) {\n for (const method of type.methods) result.push(...this.verifyCallable(assembly, strippedFqns, method));\n }\n if (type.properties) {\n for (const property of type.properties) result.push(...this.verifyProperty(assembly, strippedFqns, property));\n }\n }\n\n return result;\n }\n\n private verifyCallable(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n method: Method | Initializer,\n ): readonly JsiiDiagnostic[] {\n const diagnostics = new Array<JsiiDiagnostic>();\n const deprecatedReturnFqn =\n isMethod(method) && method.returns && this.tryFindReference(method.returns.type, strippedFqns);\n if (deprecatedReturnFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedReturnFqn, 'Method', method, assembly));\n }\n\n if (method.parameters) {\n for (const parameter of method.parameters) {\n const deprecatedTypeFqn = this.tryFindReference(parameter.type, strippedFqns);\n if (deprecatedTypeFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedTypeFqn, 'Parameter', parameter, assembly));\n }\n }\n }\n return diagnostics;\n }\n\n private verifyProperty(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n property: Property,\n ): readonly JsiiDiagnostic[] {\n const deprecatedTypeFqn = this.tryFindReference(property.type, strippedFqns);\n if (deprecatedTypeFqn) {\n return [this.makeDiagnostic(deprecatedTypeFqn, 'Property', property, assembly)];\n }\n return [];\n }\n\n /**\n * Determines whether a `TypeReference` contains an FQN within a given set.\n *\n * @param ref the tested `TypeReference`.\n * @param fqns the set of FQNs that are being searched for.\n *\n * @returns the first FQN that was identified.\n */\n private tryFindReference(ref: TypeReference, fqns: ReadonlySet<string>): string | undefined {\n if (isNamedTypeReference(ref)) {\n return fqns.has(ref.fqn) ? ref.fqn : undefined;\n }\n if (isPrimitiveTypeReference(ref)) {\n return undefined;\n }\n if (isCollectionTypeReference(ref)) {\n return this.tryFindReference(ref.collection.elementtype, fqns);\n }\n return ref.union.types.map((type) => this.tryFindReference(type, fqns)).find((typeRef) => typeRef != null);\n }\n\n private shouldFqnBeStripped(fqn: string) {\n return this.allowlistedDeprecations?.has(fqn) ?? true;\n }\n\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method',\n context: Method | Initializer,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Parameter',\n context: Parameter,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(fqn: string, messagePrefix: 'Property', context: Property, assembly: Assembly): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method' | 'Property' | 'Parameter',\n context: Method | Initializer | Parameter | Property,\n assembly: Assembly,\n ): JsiiDiagnostic {\n const node = bindings.getRelatedNode<\n | ts.AccessorDeclaration\n | ts.MethodDeclaration\n | ts.MethodSignature\n | ts.ParameterDeclaration\n | ts.PropertyDeclaration\n | ts.PropertySignature\n >(context);\n const diagnostic = JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n node?.type ?? node!,\n `${messagePrefix} has @deprecated type ${fqn}, and it is erased by --strip-deprecated.`,\n );\n\n const typeInfo = assembly.types?.[fqn];\n const typeNode = typeInfo && bindings.getTypeRelatedNode(typeInfo);\n if (typeNode == null) {\n return diagnostic;\n }\n return diagnostic.addRelatedInformation(\n ts.getNameOfDeclaration(typeNode) ?? typeNode,\n 'The @deprecated type is declared here',\n );\n }\n}\n\nclass Transformation {\n public static addInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration) && !ts.isInterfaceDeclaration(declaration)) {\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n }\n\n const { typeExpression: newInterface, syntheticImport } = Transformation.typeReference(\n iface,\n declaration,\n typeChecker,\n );\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ImplementsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n }\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ExtendsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n\n function addInterfaceTo(\n token: ts.HeritageClause['token'],\n clauses: readonly ts.HeritageClause[] = [],\n ): ts.HeritageClause[] {\n const existingClause = clauses.find((clause) => clause.token === token);\n if (existingClause == null) {\n return [...clauses, ts.factory.createHeritageClause(token, [newInterface])];\n }\n return [\n ...clauses.filter((clause) => clause !== existingClause),\n ts.factory.updateHeritageClause(existingClause, [...existingClause.types, newInterface]),\n ];\n }\n });\n }\n\n public static replaceBaseClass(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration,\n baseClass: ts.ClassDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n const { typeExpression: newBaseClass, syntheticImport } = Transformation.typeReference(\n baseClass,\n declaration,\n typeChecker,\n );\n const existingClause = declaration.heritageClauses?.find(\n (clause) => clause.token === ts.SyntaxKind.ExtendsKeyword,\n );\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n [\n ...(declaration.heritageClauses ?? []).filter((clause) => clause !== existingClause),\n existingClause\n ? ts.factory.updateHeritageClause(existingClause, [newBaseClass])\n : ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [newBaseClass]),\n ],\n declaration.members,\n ),\n syntheticImports: syntheticImport && [syntheticImport],\n };\n });\n }\n\n public static removeBaseClass(typeChecker: ts.TypeChecker, node: ts.ClassDeclaration) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n declaration.heritageClauses?.filter((clause) => clause.token !== ts.SyntaxKind.ExtendsKeyword),\n declaration.members,\n ),\n };\n });\n }\n\n public static removeInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration,\n ) {\n const ifaceName = Transformation.fullyQualifiedName(typeChecker, iface)!;\n\n return new Transformation(typeChecker, node, (declaration) => {\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n } else if (ts.isInterfaceDeclaration(declaration)) {\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n }\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n });\n\n function removeInterfaceHeritage(\n clauses: readonly ts.HeritageClause[] | undefined,\n ): ts.HeritageClause[] | undefined {\n if (clauses == null) {\n return clauses;\n }\n return clauses\n .map((clause) => {\n const types = clause.types.filter(\n (type) => Transformation.fullyQualifiedName(typeChecker, type.expression) !== ifaceName,\n );\n if (types.length === clause.types.length) {\n // Means the interface was only transitively present...\n return clause;\n }\n if (types.length === 0) {\n return undefined;\n }\n return ts.factory.updateHeritageClause(clause, types);\n })\n .filter((clause) => clause != null) as ts.HeritageClause[];\n }\n }\n\n private static fullyQualifiedName(typeChecker: ts.TypeChecker, node: ts.Node): string | undefined {\n const symbol = typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(node as ts.Declaration) ?? node);\n // This symbol ☝️ does not contain enough information in some cases - when\n // an imported type is part of a heritage clause - to produce the fqn.\n // Round tripping this to its type and back to a symbol seems to fix this.\n const type = symbol && typeChecker.getDeclaredTypeOfSymbol(symbol);\n return type?.symbol && typeChecker.getFullyQualifiedName(type.symbol);\n }\n\n private static typeReference(\n type: ts.ClassDeclaration | ts.InterfaceDeclaration | string,\n context: ts.ClassDeclaration | ts.InterfaceDeclaration,\n typeChecker: ts.TypeChecker,\n ): {\n typeExpression: ts.ExpressionWithTypeArguments;\n syntheticImport?: ts.ImportDeclaration;\n } {\n context = ts.getOriginalNode(context) as any;\n\n const [, contextSource] = /^\"([^\"]+)\"\\..*$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(context)!)!),\n )!;\n\n let expression: ts.Expression;\n let syntheticImport: ts.ImportDeclaration | undefined;\n\n if (typeof type === 'string') {\n const [root, ...tail] = type.split('.');\n const syntheticImportName = ts.factory.createUniqueName(root);\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* decorators */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(root),\n );\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n } else {\n const [, typeSource, qualifiedName] = /^\"([^\"]+)\"\\.(.*)$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(type)!)!),\n )!;\n\n if (typeSource === contextSource) {\n const [root, ...tail] = qualifiedName.split('.');\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n ts.factory.createIdentifier(root) as ts.Expression,\n );\n } else {\n const syntheticImportName = ts.factory.createUniqueName(basename(typeSource));\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* modifiers */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(`./${relative(dirname(contextSource), typeSource)}`),\n undefined,\n );\n expression = qualifiedName\n .split('.')\n .reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n }\n }\n\n return {\n typeExpression: ts.factory.createExpressionWithTypeArguments(expression, undefined),\n syntheticImport,\n };\n }\n\n private readonly nodeName: string;\n\n private constructor(\n private readonly typeChecker: ts.TypeChecker,\n node: ts.Declaration,\n public readonly apply: (\n this: Transformation,\n node: ts.Node,\n ) => { node: ts.Node; syntheticImport?: ts.ImportDeclaration },\n ) {\n this.nodeName = Transformation.fullyQualifiedName(typeChecker, node)!;\n }\n\n public targets(node: ts.Declaration) {\n return this.nodeName === Transformation.fullyQualifiedName(this.typeChecker, node);\n }\n}\n\nclass DeprecationRemovalTransformer {\n /**\n * A list of SyntaxKinds for which it is not necessary to evaluate children,\n * since they are never of interest to this transform. This opens up a wee\n * optimization, which is particularly useful when trying to troubleshoot the\n * transform in a debugger (saves a TON of time stepping into useless nodes\n * then).\n */\n private static readonly IGNORE_CHILDREN: ReadonlySet<ts.SyntaxKind> = new Set([\n ts.SyntaxKind.Constructor,\n ts.SyntaxKind.FunctionDeclaration,\n ts.SyntaxKind.GetAccessor,\n ts.SyntaxKind.MethodDeclaration,\n ts.SyntaxKind.MethodSignature,\n ts.SyntaxKind.PropertySignature,\n ts.SyntaxKind.PropertyDeclaration,\n ts.SyntaxKind.SetAccessor,\n ts.SyntaxKind.VariableDeclaration,\n ]);\n\n private syntheticImports = new Array<ts.ImportDeclaration>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly context: ts.TransformationContext,\n private readonly transformations: readonly Transformation[],\n private readonly nodesToRemove: Set<ts.Node>,\n ) {}\n\n public transform<T extends ts.Node>(node: T): T {\n let result = this.visitEachChild(node);\n\n // If there are any synthetic imports, add them to the source file\n if (ts.isSourceFile(result) && this.syntheticImports.length > 0) {\n result = this.context.factory.updateSourceFile(\n result,\n [...this.syntheticImports, ...result.statements],\n result.isDeclarationFile,\n result.referencedFiles,\n result.typeReferenceDirectives,\n result.hasNoDefaultLib,\n result.libReferenceDirectives,\n ) as any;\n this.syntheticImports = new Array<ts.ImportDeclaration>();\n }\n\n return result;\n }\n\n private visitEachChild<T extends ts.Node>(node: T): T {\n return ts.visitEachChild(node, this.visitor.bind(this), this.context);\n }\n\n private visitor<T extends ts.Node>(node: T): ts.VisitResult<T> {\n if (this.isDeprecated(node)) {\n // Removing deprecated members by substituting \"nothing\" to them\n return [];\n }\n\n if (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) {\n for (const transformation of this.transformations) {\n // 👇 as any because the assignment below confuses type checker\n if (transformation.targets(node as any)) {\n const { node: transformedNode, syntheticImport } = transformation.apply(node);\n node = transformedNode as any;\n if (syntheticImport) {\n this.syntheticImports.push(syntheticImport);\n }\n }\n }\n }\n\n // Remove named imports of `@deprecated` members from the source...\n if (\n ts.isImportDeclaration(node) &&\n node.importClause &&\n node.importClause.namedBindings &&\n ts.isNamedImports(node.importClause.namedBindings)\n ) {\n const filteredElements = node.importClause.namedBindings.elements.filter((element) => {\n // This symbol is local (it's declaration points back to the named import)\n const symbol = this.typeChecker.getSymbolAtLocation(element.name);\n const exportedSymbol =\n // This \"resolves\" the imported type, so we can get to it's declaration(s)\n symbol && this.typeChecker.getDeclaredTypeOfSymbol(symbol)?.symbol;\n return !exportedSymbol?.declarations?.some((decl) => this.isDeprecated(decl));\n });\n if (filteredElements.length !== node.importClause.namedBindings.elements.length) {\n return this.context.factory.updateImportDeclaration(\n node,\n node.modifiers,\n node.importClause.name != null || filteredElements.length > 0\n ? this.context.factory.updateImportClause(\n node.importClause,\n node.importClause.isTypeOnly,\n node.importClause.name,\n this.context.factory.updateNamedImports(node.importClause.namedBindings, filteredElements),\n )\n : undefined,\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n\n return node;\n }\n\n // Replace \"export ... from ...\" places that no longer export anything\n // with an \"import from ...\", so side effects are preserved.\n if (ts.isExportDeclaration(node) && node.moduleSpecifier) {\n const symbol = this.typeChecker.getSymbolAtLocation(node.moduleSpecifier);\n const moduleExports =\n symbol &&\n this.typeChecker\n .getExportsOfModule(symbol)\n ?.filter((sym) => !sym.declarations?.some((decl) => this.isDeprecated(decl)));\n if ((node.exportClause == null || ts.isNamespaceExport(node.exportClause)) && moduleExports?.length === 0) {\n return this.context.factory.createImportDeclaration(\n undefined /* modifiers */,\n undefined /* importClause */,\n node.moduleSpecifier,\n ) as any;\n }\n\n if (node.exportClause != null && moduleExports) {\n const namedExports = node.exportClause as ts.NamedExports;\n const exportedNames = new Set(moduleExports.map((sym) => sym.name));\n const filteredElements = namedExports.elements?.filter((elt) => exportedNames.has(elt.name.text));\n if (filteredElements?.length !== namedExports.elements?.length) {\n return this.context.factory.updateExportDeclaration(\n node,\n node.modifiers,\n node.isTypeOnly,\n this.context.factory.updateNamedExports(namedExports, filteredElements),\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n }\n }\n\n return DeprecationRemovalTransformer.IGNORE_CHILDREN.has(node.kind) ? node : this.visitEachChild(node);\n }\n\n private isDeprecated(node: ts.Node): boolean {\n const original = ts.getOriginalNode(node);\n return (\n this.nodesToRemove.has(original) && ts.getJSDocTags(original).some((tag) => tag.tagName.text === 'deprecated')\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"deprecated-remover.js","sourceRoot":"","sources":["../../src/transforms/deprecated-remover.ts"],"names":[],"mappings":";;;AAAA,yCAAwD;AACxD,qCAqBoB;AACpB,iCAAiC;AAEjC,wDAAoD;AACpD,6CAA6C;AAC7C,oCAAqC;AAErC,MAAa,iBAAiB;IAI5B,YACmB,WAA2B,EAC3B,uBAAgD;QADhD,gBAAW,GAAX,WAAW,CAAgB;QAC3B,4BAAuB,GAAvB,uBAAuB,CAAyB;QALlD,oBAAe,GAAG,IAAI,KAAK,EAAkB,CAAC;QAC9C,kBAAa,GAAG,IAAI,GAAG,EAAW,CAAC;IAKjD,CAAC;IAEJ;;;;;;OAMG;IACH,IAAW,kBAAkB;QAC3B,OAAO;YACL,iBAAiB,EAAE;gBACjB,CAAC,OAAO,EAAE,EAAE;oBACV,MAAM,WAAW,GAAG,IAAI,6BAA6B,CACnD,IAAI,CAAC,WAAW,EAChB,OAAO,EACP,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,aAAa,CACnB,CAAC;oBACF,OAAO,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjD,CAAC;aACF;SACF,CAAC;IACJ,C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AI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACzG,CAAC;IAEO,YAAY,CAAC,IAAa;QAChC,MAAM,QAAQ,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,CACL,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAC/G,CAAC;IACJ,CAAC;;AApJD;;;;;;GAMG;AACqB,6CAAe,GAA+B,IAAI,GAAG,CAAC;IAC5E,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,mBAAmB;IACjC,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,iBAAiB;IAC/B,EAAE,CAAC,UAAU,CAAC,eAAe;IAC7B,EAAE,CAAC,UAAU,CAAC,iBAAiB;IAC/B,EAAE,CAAC,UAAU,CAAC,mBAAmB;IACjC,EAAE,CAAC,UAAU,CAAC,WAAW;IACzB,EAAE,CAAC,UAAU,CAAC,mBAAmB;CAClC,CAAC,AAVqC,CAUpC;AAsIL,SAAS,cAAc,CAAC,CAAiD;IACvE,IAAI,IAAA,2BAAoB,EAAC,CAAC,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC;IAC9B,CAAC;AACH,CAAC","sourcesContent":["import { basename, dirname, relative } from 'node:path';\nimport {\n Assembly,\n ClassType,\n EnumMember,\n Initializer,\n InterfaceType,\n IntersectionTypeReference,\n isClassOrInterfaceType,\n isClassType,\n isCollectionTypeReference,\n isEnumType,\n isMethod,\n isNamedTypeReference,\n isPrimitiveTypeReference,\n isUnionTypeReference,\n Method,\n Parameter,\n Property,\n Stability,\n TypeReference,\n UnionTypeReference,\n} from '@jsii/spec';\nimport * as ts from 'typescript';\n\nimport { JsiiDiagnostic } from '../jsii-diagnostic';\nimport * as bindings from '../node-bindings';\nimport { JsiiError } from '../utils';\n\nexport class DeprecatedRemover {\n private readonly transformations = new Array<Transformation>();\n private readonly nodesToRemove = new Set<ts.Node>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly allowlistedDeprecations: Set<string> | undefined,\n ) {}\n\n /**\n * Obtains the configuration for the TypeScript transform(s) that will remove\n * `@deprecated` members from the generated declarations (`.d.ts`) files. It\n * will leverage information accumulated during `#removeFrom(Assembly)` in\n * order to apply corrections to inheritance chains, ensuring a valid output\n * is produced.\n */\n public get customTransformers(): ts.CustomTransformers {\n return {\n afterDeclarations: [\n (context) => {\n const transformer = new DeprecationRemovalTransformer(\n this.typeChecker,\n context,\n this.transformations,\n this.nodesToRemove,\n );\n return transformer.transform.bind(transformer);\n },\n ],\n };\n }\n\n /**\n * Removes all `@deprecated` API elements from the provided assembly, and\n * records the operations needed in order to fix the inheritance chains that\n * mix `@deprecated` and non-`@deprecated` types.\n *\n * @param assembly the assembly to be modified.\n *\n * @returns diagnostic messages produced when validating no remaining API\n * makes use of a `@deprecated` type that was removed.\n */\n public removeFrom(assembly: Assembly): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const strippedFqns = new Set<string>();\n const replaceWithClass = new Map<string, string>();\n const replaceWithInterfaces = new Map<string, readonly string[]>();\n\n // Find all types that will be stripped out\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n if (typeInfo.docs?.stability === Stability.Deprecated) {\n if (!this.shouldFqnBeStripped(fqn)) {\n continue;\n }\n strippedFqns.add(fqn);\n\n if (isClassType(typeInfo) && typeInfo.base != null) {\n replaceWithClass.set(fqn, typeInfo.base);\n }\n if (isClassOrInterfaceType(typeInfo) && typeInfo.interfaces != null) {\n replaceWithInterfaces.set(fqn, typeInfo.interfaces);\n }\n\n this.nodesToRemove.add(bindings.getRelatedNode(typeInfo)!);\n }\n }\n\n for (const [fqn, typeInfo] of Object.entries(assembly.types)) {\n // Ignore `@deprecated` types\n if (strippedFqns.has(fqn)) {\n continue;\n }\n\n // Enums cannot have references to `@deprecated` types, but can have deprecated members\n if (isEnumType(typeInfo)) {\n const enumNode = bindings.getEnumRelatedNode(typeInfo)!;\n const members: EnumMember[] = [];\n for (const mem of typeInfo.members) {\n if (mem.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${mem.name}`)) {\n const matchingMemberNode = enumNode.members.find((enumMem) => enumMem.name.getText() === mem.name);\n if (matchingMemberNode) {\n this.nodesToRemove.add(matchingMemberNode);\n }\n } else {\n members.push(mem);\n }\n }\n typeInfo.members = members;\n continue;\n }\n\n // For classes, we erase `@deprecated` base classes, replacing as needed\n const additionalInterfaces = new Set<string>();\n if (isClassType(typeInfo) && typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n while (typeInfo.base != null && strippedFqns.has(typeInfo.base)) {\n const oldBase = assembly.types[typeInfo.base] as ClassType;\n if (oldBase.interfaces) for (const addFqn of oldBase.interfaces) additionalInterfaces.add(addFqn);\n typeInfo.base = replaceWithClass.get(typeInfo.base);\n }\n this.transformations.push(\n typeInfo.base != null\n ? Transformation.replaceBaseClass(\n this.typeChecker,\n bindings.getClassRelatedNode(typeInfo)!,\n typeInfo.base in assembly.types\n ? bindings.getClassRelatedNode(assembly.types[typeInfo.base] as ClassType) ?? typeInfo.base\n : typeInfo.base,\n )\n : Transformation.removeBaseClass(this.typeChecker, bindings.getClassRelatedNode(typeInfo)!),\n );\n }\n\n // Be defensive in case we add other kinds in the future\n if (!isClassOrInterfaceType(typeInfo)) {\n throw new Error(`Unhandled type encountered! ${JSON.stringify(typeInfo, null, 2)}`);\n }\n\n // Strip all `@deprecated` interfaces from the inheritance tree, replacing as needed\n if (typeInfo.interfaces?.some((addFqn) => strippedFqns.has(addFqn)) || additionalInterfaces.size > 0) {\n const originalSet = new Set(typeInfo.interfaces ?? []);\n const newSet = new Set<string>();\n\n const candidates = Array.from(new Set([...originalSet, ...additionalInterfaces]));\n while (candidates.length > 0) {\n const candidateFqn = candidates.pop()!;\n if (!strippedFqns.has(candidateFqn)) {\n newSet.add(candidateFqn);\n if (!originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.addInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n candidateFqn in assembly.types\n ? bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType) ?? candidateFqn\n : candidateFqn,\n ),\n );\n }\n continue;\n }\n if (originalSet.has(candidateFqn)) {\n this.transformations.push(\n Transformation.removeInterface(\n this.typeChecker,\n bindings.getClassOrInterfaceRelatedNode(typeInfo)!,\n bindings.getInterfaceRelatedNode(assembly.types[candidateFqn] as InterfaceType)!,\n ),\n );\n }\n const replacement = replaceWithInterfaces.get(candidateFqn);\n if (replacement != null) {\n candidates.push(...replacement);\n }\n }\n\n typeInfo.interfaces = newSet.size > 0 ? Array.from(newSet).sort() : undefined;\n }\n\n // Drop all `@deprecated` members, and remove \"overrides\" from stripped types\n const methods: Method[] = [];\n const properties: Property[] = [];\n if (typeInfo.methods) {\n for (const meth of typeInfo.methods) {\n if (meth.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${meth.name}`)) {\n this.nodesToRemove.add(bindings.getMethodRelatedNode(meth)!);\n } else {\n methods.push(\n meth.overrides != null && strippedFqns.has(meth.overrides) ? { ...meth, overrides: undefined } : meth,\n );\n }\n }\n }\n typeInfo.methods = typeInfo.methods ? methods : undefined;\n if (typeInfo.properties) {\n for (const prop of typeInfo.properties) {\n if (prop.docs?.stability === Stability.Deprecated && this.shouldFqnBeStripped(`${fqn}#${prop.name}`)) {\n this.nodesToRemove.add(bindings.getParameterRelatedNode(prop)!);\n } else {\n properties.push(\n prop.overrides != null && strippedFqns.has(prop.overrides) ? { ...prop, overrides: undefined } : prop,\n );\n }\n }\n }\n typeInfo.properties = typeInfo.properties ? properties : undefined;\n }\n\n const diagnostics = this.findLeftoverUseOfDeprecatedAPIs(assembly, strippedFqns);\n\n // Remove all `@deprecated` types, after we did everything, so we could\n // still access the related nodes from the assembly object.\n for (const fqn of strippedFqns) {\n if (this.shouldFqnBeStripped(fqn)) {\n delete assembly.types[fqn];\n }\n }\n\n return diagnostics;\n }\n\n private findLeftoverUseOfDeprecatedAPIs(assembly: Assembly, strippedFqns: Set<string>): readonly JsiiDiagnostic[] {\n if (assembly.types == null) {\n return [];\n }\n\n const result = new Array<JsiiDiagnostic>();\n\n for (const type of Object.values(assembly.types)) {\n if (isEnumType(type) || strippedFqns.has(type.fqn)) {\n continue;\n }\n if (isClassType(type) && type.initializer) {\n result.push(...this.verifyCallable(assembly, strippedFqns, type.initializer));\n }\n if (type.methods) {\n for (const method of type.methods) result.push(...this.verifyCallable(assembly, strippedFqns, method));\n }\n if (type.properties) {\n for (const property of type.properties) result.push(...this.verifyProperty(assembly, strippedFqns, property));\n }\n }\n\n return result;\n }\n\n private verifyCallable(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n method: Method | Initializer,\n ): readonly JsiiDiagnostic[] {\n const diagnostics = new Array<JsiiDiagnostic>();\n const deprecatedReturnFqn =\n isMethod(method) && method.returns && this.tryFindReference(method.returns.type, strippedFqns);\n if (deprecatedReturnFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedReturnFqn, 'Method', method, assembly));\n }\n\n if (method.parameters) {\n for (const parameter of method.parameters) {\n const deprecatedTypeFqn = this.tryFindReference(parameter.type, strippedFqns);\n if (deprecatedTypeFqn) {\n diagnostics.push(this.makeDiagnostic(deprecatedTypeFqn, 'Parameter', parameter, assembly));\n }\n }\n }\n return diagnostics;\n }\n\n private verifyProperty(\n assembly: Assembly,\n strippedFqns: ReadonlySet<string>,\n property: Property,\n ): readonly JsiiDiagnostic[] {\n const deprecatedTypeFqn = this.tryFindReference(property.type, strippedFqns);\n if (deprecatedTypeFqn) {\n return [this.makeDiagnostic(deprecatedTypeFqn, 'Property', property, assembly)];\n }\n return [];\n }\n\n /**\n * Determines whether a `TypeReference` contains an FQN within a given set.\n *\n * @param ref the tested `TypeReference`.\n * @param fqns the set of FQNs that are being searched for.\n *\n * @returns the first FQN that was identified.\n */\n private tryFindReference(ref: TypeReference, fqns: ReadonlySet<string>): string | undefined {\n if (isNamedTypeReference(ref)) {\n return fqns.has(ref.fqn) ? ref.fqn : undefined;\n }\n if (isPrimitiveTypeReference(ref)) {\n return undefined;\n }\n if (isCollectionTypeReference(ref)) {\n return this.tryFindReference(ref.collection.elementtype, fqns);\n }\n\n return setTypeMembers(ref)\n .map((type) => this.tryFindReference(type, fqns))\n .find((typeRef) => typeRef != null);\n }\n\n private shouldFqnBeStripped(fqn: string) {\n return this.allowlistedDeprecations?.has(fqn) ?? true;\n }\n\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method',\n context: Method | Initializer,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Parameter',\n context: Parameter,\n assembly: Assembly,\n ): JsiiDiagnostic;\n private makeDiagnostic(fqn: string, messagePrefix: 'Property', context: Property, assembly: Assembly): JsiiDiagnostic;\n private makeDiagnostic(\n fqn: string,\n messagePrefix: 'Method' | 'Property' | 'Parameter',\n context: Method | Initializer | Parameter | Property,\n assembly: Assembly,\n ): JsiiDiagnostic {\n const node = bindings.getRelatedNode<\n | ts.AccessorDeclaration\n | ts.MethodDeclaration\n | ts.MethodSignature\n | ts.ParameterDeclaration\n | ts.PropertyDeclaration\n | ts.PropertySignature\n >(context);\n const diagnostic = JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n node?.type ?? node!,\n `${messagePrefix} has @deprecated type ${fqn}, and it is erased by --strip-deprecated.`,\n );\n\n const typeInfo = assembly.types?.[fqn];\n const typeNode = typeInfo && bindings.getTypeRelatedNode(typeInfo);\n if (typeNode == null) {\n return diagnostic;\n }\n return diagnostic.addRelatedInformation(\n ts.getNameOfDeclaration(typeNode) ?? typeNode,\n 'The @deprecated type is declared here',\n );\n }\n}\n\nclass Transformation {\n public static addInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration) && !ts.isInterfaceDeclaration(declaration)) {\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n }\n\n const { typeExpression: newInterface, syntheticImport } = Transformation.typeReference(\n iface,\n declaration,\n typeChecker,\n );\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ImplementsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n }\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n addInterfaceTo(ts.SyntaxKind.ExtendsKeyword, declaration.heritageClauses),\n declaration.members,\n ),\n syntheticImport,\n };\n\n function addInterfaceTo(\n token: ts.HeritageClause['token'],\n clauses: readonly ts.HeritageClause[] = [],\n ): ts.HeritageClause[] {\n const existingClause = clauses.find((clause) => clause.token === token);\n if (existingClause == null) {\n return [...clauses, ts.factory.createHeritageClause(token, [newInterface])];\n }\n return [\n ...clauses.filter((clause) => clause !== existingClause),\n ts.factory.updateHeritageClause(existingClause, [...existingClause.types, newInterface]),\n ];\n }\n });\n }\n\n public static replaceBaseClass(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration,\n baseClass: ts.ClassDeclaration | string,\n ) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n const { typeExpression: newBaseClass, syntheticImport } = Transformation.typeReference(\n baseClass,\n declaration,\n typeChecker,\n );\n const existingClause = declaration.heritageClauses?.find(\n (clause) => clause.token === ts.SyntaxKind.ExtendsKeyword,\n );\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n [\n ...(declaration.heritageClauses ?? []).filter((clause) => clause !== existingClause),\n existingClause\n ? ts.factory.updateHeritageClause(existingClause, [newBaseClass])\n : ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [newBaseClass]),\n ],\n declaration.members,\n ),\n syntheticImports: syntheticImport && [syntheticImport],\n };\n });\n }\n\n public static removeBaseClass(typeChecker: ts.TypeChecker, node: ts.ClassDeclaration) {\n return new Transformation(typeChecker, node, (declaration) => {\n if (!ts.isClassDeclaration(declaration)) {\n throw new JsiiError(`Expected a ClassDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`);\n }\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n declaration.heritageClauses?.filter((clause) => clause.token !== ts.SyntaxKind.ExtendsKeyword),\n declaration.members,\n ),\n };\n });\n }\n\n public static removeInterface(\n typeChecker: ts.TypeChecker,\n node: ts.ClassDeclaration | ts.InterfaceDeclaration,\n iface: ts.InterfaceDeclaration,\n ) {\n const ifaceName = Transformation.fullyQualifiedName(typeChecker, iface)!;\n\n return new Transformation(typeChecker, node, (declaration) => {\n if (ts.isClassDeclaration(declaration)) {\n return {\n node: ts.factory.updateClassDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n } else if (ts.isInterfaceDeclaration(declaration)) {\n return {\n node: ts.factory.updateInterfaceDeclaration(\n declaration,\n declaration.modifiers,\n declaration.name,\n declaration.typeParameters,\n removeInterfaceHeritage(declaration.heritageClauses),\n declaration.members,\n ),\n };\n }\n throw new JsiiError(\n `Expected a ClassDeclaration or InterfaceDeclaration, found a ${ts.SyntaxKind[declaration.kind]}`,\n );\n });\n\n function removeInterfaceHeritage(\n clauses: readonly ts.HeritageClause[] | undefined,\n ): ts.HeritageClause[] | undefined {\n if (clauses == null) {\n return clauses;\n }\n return clauses\n .map((clause) => {\n const types = clause.types.filter(\n (type) => Transformation.fullyQualifiedName(typeChecker, type.expression) !== ifaceName,\n );\n if (types.length === clause.types.length) {\n // Means the interface was only transitively present...\n return clause;\n }\n if (types.length === 0) {\n return undefined;\n }\n return ts.factory.updateHeritageClause(clause, types);\n })\n .filter((clause) => clause != null) as ts.HeritageClause[];\n }\n }\n\n private static fullyQualifiedName(typeChecker: ts.TypeChecker, node: ts.Node): string | undefined {\n const symbol = typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(node as ts.Declaration) ?? node);\n // This symbol ☝️ does not contain enough information in some cases - when\n // an imported type is part of a heritage clause - to produce the fqn.\n // Round tripping this to its type and back to a symbol seems to fix this.\n const type = symbol && typeChecker.getDeclaredTypeOfSymbol(symbol);\n return type?.symbol && typeChecker.getFullyQualifiedName(type.symbol);\n }\n\n private static typeReference(\n type: ts.ClassDeclaration | ts.InterfaceDeclaration | string,\n context: ts.ClassDeclaration | ts.InterfaceDeclaration,\n typeChecker: ts.TypeChecker,\n ): {\n typeExpression: ts.ExpressionWithTypeArguments;\n syntheticImport?: ts.ImportDeclaration;\n } {\n context = ts.getOriginalNode(context) as any;\n\n const [, contextSource] = /^\"([^\"]+)\"\\..*$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(context)!)!),\n )!;\n\n let expression: ts.Expression;\n let syntheticImport: ts.ImportDeclaration | undefined;\n\n if (typeof type === 'string') {\n const [root, ...tail] = type.split('.');\n const syntheticImportName = ts.factory.createUniqueName(root);\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* decorators */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(root),\n );\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n } else {\n const [, typeSource, qualifiedName] = /^\"([^\"]+)\"\\.(.*)$/.exec(\n typeChecker.getFullyQualifiedName(typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(type)!)!),\n )!;\n\n if (typeSource === contextSource) {\n const [root, ...tail] = qualifiedName.split('.');\n expression = tail.reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n ts.factory.createIdentifier(root) as ts.Expression,\n );\n } else {\n const syntheticImportName = ts.factory.createUniqueName(basename(typeSource));\n syntheticImport = ts.factory.createImportDeclaration(\n undefined /* modifiers */,\n ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(syntheticImportName)),\n ts.factory.createStringLiteral(`./${relative(dirname(contextSource), typeSource)}`),\n undefined,\n );\n expression = qualifiedName\n .split('.')\n .reduce(\n (curr, elt) => ts.factory.createPropertyAccessExpression(curr, elt),\n syntheticImportName as ts.Expression,\n );\n }\n }\n\n return {\n typeExpression: ts.factory.createExpressionWithTypeArguments(expression, undefined),\n syntheticImport,\n };\n }\n\n private readonly nodeName: string;\n\n private constructor(\n private readonly typeChecker: ts.TypeChecker,\n node: ts.Declaration,\n public readonly apply: (\n this: Transformation,\n node: ts.Node,\n ) => { node: ts.Node; syntheticImport?: ts.ImportDeclaration },\n ) {\n this.nodeName = Transformation.fullyQualifiedName(typeChecker, node)!;\n }\n\n public targets(node: ts.Declaration) {\n return this.nodeName === Transformation.fullyQualifiedName(this.typeChecker, node);\n }\n}\n\nclass DeprecationRemovalTransformer {\n /**\n * A list of SyntaxKinds for which it is not necessary to evaluate children,\n * since they are never of interest to this transform. This opens up a wee\n * optimization, which is particularly useful when trying to troubleshoot the\n * transform in a debugger (saves a TON of time stepping into useless nodes\n * then).\n */\n private static readonly IGNORE_CHILDREN: ReadonlySet<ts.SyntaxKind> = new Set([\n ts.SyntaxKind.Constructor,\n ts.SyntaxKind.FunctionDeclaration,\n ts.SyntaxKind.GetAccessor,\n ts.SyntaxKind.MethodDeclaration,\n ts.SyntaxKind.MethodSignature,\n ts.SyntaxKind.PropertySignature,\n ts.SyntaxKind.PropertyDeclaration,\n ts.SyntaxKind.SetAccessor,\n ts.SyntaxKind.VariableDeclaration,\n ]);\n\n private syntheticImports = new Array<ts.ImportDeclaration>();\n\n public constructor(\n private readonly typeChecker: ts.TypeChecker,\n private readonly context: ts.TransformationContext,\n private readonly transformations: readonly Transformation[],\n private readonly nodesToRemove: Set<ts.Node>,\n ) {}\n\n public transform<T extends ts.Node>(node: T): T {\n let result = this.visitEachChild(node);\n\n // If there are any synthetic imports, add them to the source file\n if (ts.isSourceFile(result) && this.syntheticImports.length > 0) {\n result = this.context.factory.updateSourceFile(\n result,\n [...this.syntheticImports, ...result.statements],\n result.isDeclarationFile,\n result.referencedFiles,\n result.typeReferenceDirectives,\n result.hasNoDefaultLib,\n result.libReferenceDirectives,\n ) as any;\n this.syntheticImports = new Array<ts.ImportDeclaration>();\n }\n\n return result;\n }\n\n private visitEachChild<T extends ts.Node>(node: T): T {\n return ts.visitEachChild(node, this.visitor.bind(this), this.context);\n }\n\n private visitor<T extends ts.Node>(node: T): ts.VisitResult<T> {\n if (this.isDeprecated(node)) {\n // Removing deprecated members by substituting \"nothing\" to them\n return [];\n }\n\n if (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) {\n for (const transformation of this.transformations) {\n // 👇 as any because the assignment below confuses type checker\n if (transformation.targets(node as any)) {\n const { node: transformedNode, syntheticImport } = transformation.apply(node);\n node = transformedNode as any;\n if (syntheticImport) {\n this.syntheticImports.push(syntheticImport);\n }\n }\n }\n }\n\n // Remove named imports of `@deprecated` members from the source...\n if (\n ts.isImportDeclaration(node) &&\n node.importClause &&\n node.importClause.namedBindings &&\n ts.isNamedImports(node.importClause.namedBindings)\n ) {\n const filteredElements = node.importClause.namedBindings.elements.filter((element) => {\n // This symbol is local (it's declaration points back to the named import)\n const symbol = this.typeChecker.getSymbolAtLocation(element.name);\n const exportedSymbol =\n // This \"resolves\" the imported type, so we can get to it's declaration(s)\n symbol && this.typeChecker.getDeclaredTypeOfSymbol(symbol)?.symbol;\n return !exportedSymbol?.declarations?.some((decl) => this.isDeprecated(decl));\n });\n if (filteredElements.length !== node.importClause.namedBindings.elements.length) {\n return this.context.factory.updateImportDeclaration(\n node,\n node.modifiers,\n node.importClause.name != null || filteredElements.length > 0\n ? this.context.factory.updateImportClause(\n node.importClause,\n node.importClause.isTypeOnly,\n node.importClause.name,\n this.context.factory.updateNamedImports(node.importClause.namedBindings, filteredElements),\n )\n : undefined,\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n\n return node;\n }\n\n // Replace \"export ... from ...\" places that no longer export anything\n // with an \"import from ...\", so side effects are preserved.\n if (ts.isExportDeclaration(node) && node.moduleSpecifier) {\n const symbol = this.typeChecker.getSymbolAtLocation(node.moduleSpecifier);\n const moduleExports =\n symbol &&\n this.typeChecker\n .getExportsOfModule(symbol)\n ?.filter((sym) => !sym.declarations?.some((decl) => this.isDeprecated(decl)));\n if ((node.exportClause == null || ts.isNamespaceExport(node.exportClause)) && moduleExports?.length === 0) {\n return this.context.factory.createImportDeclaration(\n undefined /* modifiers */,\n undefined /* importClause */,\n node.moduleSpecifier,\n ) as any;\n }\n\n if (node.exportClause != null && moduleExports) {\n const namedExports = node.exportClause as ts.NamedExports;\n const exportedNames = new Set(moduleExports.map((sym) => sym.name));\n const filteredElements = namedExports.elements?.filter((elt) => exportedNames.has(elt.name.text));\n if (filteredElements?.length !== namedExports.elements?.length) {\n return this.context.factory.updateExportDeclaration(\n node,\n node.modifiers,\n node.isTypeOnly,\n this.context.factory.updateNamedExports(namedExports, filteredElements),\n node.moduleSpecifier,\n node.assertClause,\n ) as any;\n }\n }\n }\n\n return DeprecationRemovalTransformer.IGNORE_CHILDREN.has(node.kind) ? node : this.visitEachChild(node);\n }\n\n private isDeprecated(node: ts.Node): boolean {\n const original = ts.getOriginalNode(node);\n return (\n this.nodesToRemove.has(original) && ts.getJSDocTags(original).some((tag) => tag.tagName.text === 'deprecated')\n );\n }\n}\n\nfunction setTypeMembers(x: UnionTypeReference | IntersectionTypeReference) {\n if (isUnionTypeReference(x)) {\n return x.union.types;\n } else {\n return x.intersection.types;\n }\n}\n"]}
|
package/lib/validator.js
CHANGED
@@ -111,14 +111,10 @@ function _defaultValidations() {
|
|
111
111
|
for (const type of _allTypes(assembly)) {
|
112
112
|
if (spec.isClassType(type)) {
|
113
113
|
for (const method of type.methods ?? []) {
|
114
|
-
|
115
|
-
_validateMethodOverride(method, type);
|
116
|
-
}
|
114
|
+
_validateMethodOverride(method, type);
|
117
115
|
}
|
118
116
|
for (const property of type.properties ?? []) {
|
119
|
-
|
120
|
-
_validatePropertyOverride(property, type);
|
121
|
-
}
|
117
|
+
_validatePropertyOverride(property, type);
|
122
118
|
}
|
123
119
|
}
|
124
120
|
if (spec.isClassOrInterfaceType(type) && (type.interfaces?.length ?? 0) > 0) {
|
@@ -130,24 +126,6 @@ function _defaultValidations() {
|
|
130
126
|
}
|
131
127
|
}
|
132
128
|
}
|
133
|
-
// Validate static members separately - they cannot be covariant
|
134
|
-
for (const type of _allTypes(assembly)) {
|
135
|
-
if (spec.isClassType(type) && type.base) {
|
136
|
-
const baseType = _dereference(type.base, assembly, validator);
|
137
|
-
if (baseType) {
|
138
|
-
for (const method of type.methods ?? []) {
|
139
|
-
if (method.static) {
|
140
|
-
_validateStaticMethodOverride(method, type, baseType);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
for (const property of type.properties ?? []) {
|
144
|
-
if (property.static) {
|
145
|
-
_validateStaticPropertyOverride(property, type, baseType);
|
146
|
-
}
|
147
|
-
}
|
148
|
-
}
|
149
|
-
}
|
150
|
-
}
|
151
129
|
/**
|
152
130
|
* Lists all "implementations" from the given type, using the provided
|
153
131
|
* implementation getter. Note that abstract members may be part of the
|
@@ -205,7 +183,9 @@ function _defaultValidations() {
|
|
205
183
|
if (!overridden) {
|
206
184
|
return _validateMethodOverride(method, baseType);
|
207
185
|
}
|
208
|
-
_assertSignaturesMatch(overridden, method, `${type.fqn}#${method.name}`, `overriding ${baseType.fqn}
|
186
|
+
_assertSignaturesMatch(overridden, method, `${type.fqn}#${method.name}`, `overriding ${baseType.fqn}`, {
|
187
|
+
allowCovariance: true,
|
188
|
+
});
|
209
189
|
method.overrides = baseType.fqn;
|
210
190
|
return true;
|
211
191
|
}
|
@@ -221,7 +201,9 @@ function _defaultValidations() {
|
|
221
201
|
if (!overridden) {
|
222
202
|
return _validatePropertyOverride(property, baseType);
|
223
203
|
}
|
224
|
-
_assertPropertiesMatch(overridden, property, `${type.fqn}#${property.name}`, `overriding ${baseType.fqn}
|
204
|
+
_assertPropertiesMatch(overridden, property, `${type.fqn}#${property.name}`, `overriding ${baseType.fqn}`, {
|
205
|
+
allowCovariance: true,
|
206
|
+
});
|
225
207
|
property.overrides = baseType.fqn;
|
226
208
|
return true;
|
227
209
|
}
|
@@ -237,7 +219,9 @@ function _defaultValidations() {
|
|
237
219
|
const ifaceType = _dereference(iface, assembly, validator);
|
238
220
|
const implemented = (ifaceType.methods ?? []).find((m) => m.name === method.name);
|
239
221
|
if (implemented) {
|
240
|
-
_assertSignaturesMatch(implemented, method, `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}
|
222
|
+
_assertSignaturesMatch(implemented, method, `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}`, {
|
223
|
+
allowCovariance: false,
|
224
|
+
});
|
241
225
|
// We won't replace a previous overrides declaration from a method override, as those have
|
242
226
|
// higher precedence than an initial implementation.
|
243
227
|
method.overrides = method.overrides ?? iface;
|
@@ -261,7 +245,7 @@ function _defaultValidations() {
|
|
261
245
|
const ifaceType = _dereference(iface, assembly, validator);
|
262
246
|
const implemented = (ifaceType.properties ?? []).find((p) => p.name === property.name);
|
263
247
|
if (implemented) {
|
264
|
-
_assertPropertiesMatch(implemented, property, `${type.fqn}#${property.name}`, `implementing ${ifaceType.fqn}
|
248
|
+
_assertPropertiesMatch(implemented, property, `${type.fqn}#${property.name}`, `implementing ${ifaceType.fqn}`, { allowCovariance: false });
|
265
249
|
// We won't replace a previous overrides declaration from a property override, as those
|
266
250
|
// have higher precedence than an initial implementation.
|
267
251
|
property.overrides = property.overrides ?? ifaceType.fqn;
|
@@ -273,19 +257,21 @@ function _defaultValidations() {
|
|
273
257
|
}
|
274
258
|
return false;
|
275
259
|
}
|
276
|
-
function _assertSignaturesMatch(expected, actual, label, action) {
|
260
|
+
function _assertSignaturesMatch(expected, actual, label, action, opts) {
|
277
261
|
if (!!expected.protected !== !!actual.protected) {
|
278
262
|
const expVisibility = expected.protected ? 'protected' : 'public';
|
279
263
|
const actVisibility = actual.protected ? 'protected' : 'public';
|
280
264
|
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.createDetached(label, action, actVisibility, expVisibility));
|
281
265
|
}
|
282
|
-
//
|
266
|
+
// Types must generally be the same, but can be covariant sometimes
|
283
267
|
if (!deepEqual(actual.returns, expected.returns)) {
|
284
268
|
const actualReturnType = actual.returns?.type;
|
285
269
|
const expectedReturnType = expected.returns?.type;
|
286
|
-
|
287
|
-
|
288
|
-
|
270
|
+
if (
|
271
|
+
// static members can never change
|
272
|
+
actual.static ||
|
273
|
+
// Check if this is a valid covariant return type (actual is more specific than expected)
|
274
|
+
!(opts.allowCovariance && _isCovariantOf(actualReturnType, expectedReturnType))) {
|
289
275
|
const expType = spec.describeTypeReference(expectedReturnType);
|
290
276
|
const actType = spec.describeTypeReference(actualReturnType);
|
291
277
|
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE.createDetached(label, action, actType, expType));
|
@@ -313,6 +299,10 @@ function _defaultValidations() {
|
|
313
299
|
}
|
314
300
|
}
|
315
301
|
function _isCovariantOf(candidateType, expectedType) {
|
302
|
+
// one void, while other isn't => not covariant
|
303
|
+
if ((candidateType === undefined) !== (expectedType === undefined)) {
|
304
|
+
return false;
|
305
|
+
}
|
316
306
|
// Same type is always covariant
|
317
307
|
if (deepEqual(candidateType, expectedType)) {
|
318
308
|
return true;
|
@@ -390,25 +380,7 @@ function _defaultValidations() {
|
|
390
380
|
}
|
391
381
|
return false;
|
392
382
|
}
|
393
|
-
function
|
394
|
-
const overridden = (baseType.methods ?? []).find((m) => m.name === method.name && m.static);
|
395
|
-
if (overridden) {
|
396
|
-
// Static methods must have exact same signature - no covariance allowed
|
397
|
-
if (!deepEqual(method.returns, overridden.returns)) {
|
398
|
-
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE.createDetached(`${type.fqn}#${method.name}`, `overriding ${baseType.fqn}`, spec.describeTypeReference(method.returns?.type), spec.describeTypeReference(overridden.returns?.type)));
|
399
|
-
}
|
400
|
-
}
|
401
|
-
}
|
402
|
-
function _validateStaticPropertyOverride(property, type, baseType) {
|
403
|
-
const overridden = (baseType.properties ?? []).find((p) => p.name === property.name && p.static);
|
404
|
-
if (overridden) {
|
405
|
-
// Static properties must have exact same type - no covariance allowed
|
406
|
-
if (!deepEqual(property.type, overridden.type)) {
|
407
|
-
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.createDetached(`${type.fqn}#${property.name}`, `overriding ${baseType.fqn}`, property.type, overridden.type));
|
408
|
-
}
|
409
|
-
}
|
410
|
-
}
|
411
|
-
function _assertPropertiesMatch(expected, actual, label, action) {
|
383
|
+
function _assertPropertiesMatch(expected, actual, label, action, opts) {
|
412
384
|
const actualNode = bindings.getPropertyRelatedNode(actual);
|
413
385
|
const expectedNode = bindings.getPropertyRelatedNode(expected);
|
414
386
|
if (!!expected.protected !== !!actual.protected) {
|
@@ -416,8 +388,15 @@ function _defaultValidations() {
|
|
416
388
|
const actVisibility = actual.protected ? 'protected' : 'public';
|
417
389
|
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.create(actualNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.PublicKeyword || mod.kind === ts.SyntaxKind.ProtectedKeyword) ?? declarationName(actualNode), label, action, actVisibility, expVisibility).maybeAddRelatedInformation(expectedNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.PublicKeyword || mod.kind === ts.SyntaxKind.ProtectedKeyword) ?? declarationName(expectedNode), 'The implemented declaration is here.'));
|
418
390
|
}
|
419
|
-
|
420
|
-
|
391
|
+
// Types must generally be the same, but can be covariant sometimes
|
392
|
+
if (!deepEqual(actual.type, expected.type)) {
|
393
|
+
if (
|
394
|
+
// static members can never change
|
395
|
+
actual.static ||
|
396
|
+
// immutable properties may change in some case, as long as they are covariant
|
397
|
+
!(opts.allowCovariance && actual.immutable && _isCovariantOf(actual.type, expected.type))) {
|
398
|
+
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.create(actualNode?.type ?? declarationName(actualNode), label, action, actual.type, expected.type).maybeAddRelatedInformation(expectedNode?.type ?? declarationName(expectedNode), 'The implemented declaration is here.'));
|
399
|
+
}
|
421
400
|
}
|
422
401
|
if (expected.immutable !== actual.immutable) {
|
423
402
|
diagnostic(jsii_diagnostic_1.JsiiDiagnostic.JSII_5010_OVERRIDE_CHANGES_MUTABILITY.create(actualNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword) ??
|
package/lib/validator.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,mCAAmC;AACnC,6CAA6C;AAC7C,iCAAiC;AACjC,+B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H,SAAS,eAAe,CAAC,IAAgD;IACvE,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,gGAAgG;QAChG,OAAO,IAAW,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC/C,CAAC","sourcesContent":["import * as assert from 'node:assert';\nimport * as spec from '@jsii/spec';\nimport * as deepEqual from 'fast-deep-equal';\nimport * as ts from 'typescript';\nimport * as Case from './case';\nimport { Emitter } from './emitter';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport { getRelatedNode } from './node-bindings';\nimport * as bindings from './node-bindings';\nimport { ProjectInfo } from './project-info';\n\nexport class Validator implements Emitter {\n public static VALIDATIONS: ValidationFunction[] = _defaultValidations();\n\n public constructor(public readonly projectInfo: ProjectInfo, public readonly assembly: spec.Assembly) {}\n\n public emit(): ts.EmitResult {\n const diagnostics = new Array<ts.Diagnostic>();\n\n for (const validation of Validator.VALIDATIONS) {\n validation(this, this.assembly, diagnostics.push.bind(diagnostics));\n }\n\n return {\n diagnostics: diagnostics,\n emitSkipped: diagnostics.some((diag) => diag.category === ts.DiagnosticCategory.Error),\n };\n }\n}\n\nexport type DiagnosticEmitter = (diag: JsiiDiagnostic) => void;\nexport type ValidationFunction = (validator: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) => void;\n\nfunction _defaultValidations(): ValidationFunction[] {\n return [\n _enumMembersMustUserUpperSnakeCase,\n _memberNamesMustUseCamelCase,\n _staticConstantNamesMustUseUpperSnakeCase,\n _memberNamesMustNotLookLikeJavaGettersOrSetters,\n _allTypeReferencesAreValid,\n _inehritanceDoesNotChangeContracts,\n _staticMembersAndNestedTypesMustNotSharePascalCaseName,\n _abstractClassesMustImplementAllProperties,\n ];\n\n function _enumMembersMustUserUpperSnakeCase(_: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {\n for (const type of _allTypes(assembly)) {\n if (!spec.isEnumType(type)) {\n continue;\n }\n\n for (const member of type.members) {\n if (member.name && !isConstantCase(member.name)) {\n diagnostic(JsiiDiagnostic.JSII_8001_ALL_CAPS_ENUM_MEMBERS.createDetached(member.name, type.fqn));\n }\n }\n }\n }\n\n function _memberNamesMustUseCamelCase(_: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {\n for (const { member, type } of _allMembers(assembly)) {\n if (member.static && (member as spec.Property).const) {\n continue;\n }\n if (member.name && member.name !== Case.camel(member.name)) {\n diagnostic(JsiiDiagnostic.JSII_8002_CAMEL_CASED_MEMBERS.createDetached(member.name, type.fqn));\n }\n }\n }\n\n function _staticConstantNamesMustUseUpperSnakeCase(\n _: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const { member, type } of _allMembers(assembly)) {\n if (!member.static || !(member as spec.Property).const) {\n continue;\n }\n if (\n member.name &&\n !isConstantCase(member.name) &&\n member.name !== Case.pascal(member.name) &&\n member.name !== Case.camel(member.name)\n ) {\n diagnostic(JsiiDiagnostic.JSII_8003_STATIC_CONST_CASING.createDetached(member.name, type.name));\n }\n }\n }\n\n function _memberNamesMustNotLookLikeJavaGettersOrSetters(\n _: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const { member, type } of _allMembers(assembly)) {\n if (!member.name) {\n continue;\n }\n const snakeName = Case.snake(member.name);\n if (snakeName.startsWith('get_') && _isEmpty((member as spec.Method).parameters)) {\n diagnostic(JsiiDiagnostic.JSII_5000_JAVA_GETTERS.createDetached(member.name, type.name));\n } else if (snakeName.startsWith('set_') && ((member as spec.Method).parameters ?? []).length === 1) {\n diagnostic(JsiiDiagnostic.JSII_5001_JAVA_SETTERS.createDetached(member.name, type.name));\n }\n }\n }\n\n function _allTypeReferencesAreValid(validator: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {\n for (const typeRef of _allTypeReferences(assembly)) {\n const [assm] = typeRef.fqn.split('.');\n if (assembly.name === assm) {\n if (!(typeRef.fqn in (assembly.types ?? {}))) {\n diagnostic(\n JsiiDiagnostic.JSII_3000_EXPORTED_API_USES_HIDDEN_TYPE.create(\n typeRef.node!, // Pretend there is always a value\n typeRef.fqn,\n ),\n );\n }\n continue;\n }\n const foreignAssm = validator.projectInfo.dependencyClosure.find((dep) => dep.name === assm);\n if (!foreignAssm) {\n diagnostic(JsiiDiagnostic.JSII_9000_UNKNOWN_MODULE.createDetached(assm));\n continue;\n }\n if (!(typeRef.fqn in (foreignAssm.types ?? {}))) {\n diagnostic(JsiiDiagnostic.JSII_9001_TYPE_NOT_FOUND.createDetached(typeRef));\n }\n }\n }\n\n function _inehritanceDoesNotChangeContracts(\n validator: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const type of _allTypes(assembly)) {\n if (spec.isClassType(type)) {\n for (const method of type.methods ?? []) {\n if (!method.static) {\n _validateMethodOverride(method, type);\n }\n }\n for (const property of type.properties ?? []) {\n if (!property.static) {\n _validatePropertyOverride(property, type);\n }\n }\n }\n if (spec.isClassOrInterfaceType(type) && (type.interfaces?.length ?? 0) > 0) {\n for (const method of _allImplementations(type, (t) => t.methods)) {\n _validateMethodImplementation(method, type);\n }\n for (const property of _allImplementations(type, (t) => t.properties)) {\n _validatePropertyImplementation(property, type);\n }\n }\n }\n\n // Validate static members separately - they cannot be covariant\n for (const type of _allTypes(assembly)) {\n if (spec.isClassType(type) && type.base) {\n const baseType = _dereference(type.base, assembly, validator) as spec.ClassType;\n if (baseType) {\n for (const method of type.methods ?? []) {\n if (method.static) {\n _validateStaticMethodOverride(method, type, baseType);\n }\n }\n for (const property of type.properties ?? []) {\n if (property.static) {\n _validateStaticPropertyOverride(property, type, baseType);\n }\n }\n }\n }\n }\n\n /**\n * Lists all \"implementations\" from the given type, using the provided\n * implementation getter. Note that abstract members may be part of the\n * result (in particular, if `type` is an interface type, or if it's an\n * abstract class with unimplemented members) -- I just couldn't come up\n * with a name that actually describes this.\n *\n * @param type the type which implemented members are needed.\n * @param getter the getter to obtain methods or properties from the type.\n *\n * @returns a list of members (possibly empty, always defined)\n */\n function _allImplementations<T extends spec.Property | spec.Method>(\n type: spec.ClassType | spec.InterfaceType,\n getter: (type: spec.ClassType | spec.InterfaceType) => T[] | undefined,\n ): T[] {\n const result = new Array<T>();\n const known = new Set<string>();\n\n for (const member of getter(type) ?? []) {\n result.push(member);\n known.add(member.name);\n }\n\n if (spec.isClassType(type) && type.base) {\n // We have a parent class, collect their concrete members, too (recursively)...\n const base = _dereference(type.base, assembly, validator);\n assert(base != null && spec.isClassType(base));\n for (const member of _allImplementations(base, getter)) {\n if (known.has(member.name)) {\n continue;\n }\n // The member is copied, so that its `overrides` property won't be\n // altered, since this member is \"borrowed\" from a parent type. We\n // only check it, but should not record `overrides` relationships to\n // it as those could be invalid per the parent type (i.e: the parent\n // member may not be able to implement an interface, if that type does\n // not actually declare implementing that).\n const memberCopy = { ...member };\n // Forward the related node if there's one, so diagnostics are bound.\n const node = bindings.getRelatedNode(member);\n if (node != null) {\n bindings.setRelatedNode(memberCopy, node);\n }\n\n result.push(memberCopy);\n known.add(member.name);\n }\n }\n\n return result;\n }\n\n function _validateMethodOverride(method: spec.Method, type: spec.ClassType): boolean {\n if (!type.base) {\n return false;\n }\n const baseType = _dereference(type.base, assembly, validator) as spec.ClassType;\n if (!baseType) {\n return false;\n }\n const overridden = (baseType.methods ?? []).find((m) => m.name === method.name);\n if (!overridden) {\n return _validateMethodOverride(method, baseType);\n }\n _assertSignaturesMatch(overridden, method, `${type.fqn}#${method.name}`, `overriding ${baseType.fqn}`);\n method.overrides = baseType.fqn;\n return true;\n }\n\n function _validatePropertyOverride(property: spec.Property, type: spec.ClassType): boolean {\n if (!type.base) {\n return false;\n }\n const baseType = _dereference(type.base, assembly, validator) as spec.ClassType;\n if (!baseType) {\n return false;\n }\n const overridden = (baseType.properties ?? []).find((p) => p.name === property.name);\n if (!overridden) {\n return _validatePropertyOverride(property, baseType);\n }\n _assertPropertiesMatch(overridden, property, `${type.fqn}#${property.name}`, `overriding ${baseType.fqn}`);\n property.overrides = baseType.fqn;\n return true;\n }\n\n function _validateMethodImplementation(method: spec.Method, type: spec.ClassType | spec.InterfaceType): boolean {\n if (!type.interfaces) {\n // Abstract classes may not directly implement all members, need to check their supertypes...\n if (spec.isClassType(type) && type.base && type.abstract) {\n return _validateMethodImplementation(method, _dereference(type.base, assembly, validator) as spec.ClassType);\n }\n return false;\n }\n for (const iface of type.interfaces) {\n const ifaceType = _dereference(iface, assembly, validator) as spec.InterfaceType;\n const implemented = (ifaceType.methods ?? []).find((m) => m.name === method.name);\n if (implemented) {\n _assertSignaturesMatch(implemented, method, `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}`);\n // We won't replace a previous overrides declaration from a method override, as those have\n // higher precedence than an initial implementation.\n method.overrides = method.overrides ?? iface;\n return true;\n }\n if (_validateMethodImplementation(method, ifaceType)) {\n return true;\n }\n }\n return false;\n }\n\n function _validatePropertyImplementation(\n property: spec.Property,\n type: spec.ClassType | spec.InterfaceType,\n ): boolean {\n if (!type.interfaces) {\n // Abstract classes may not directly implement all members, need to check their supertypes...\n if (spec.isClassType(type) && type.base && type.abstract) {\n return _validatePropertyImplementation(\n property,\n _dereference(type.base, assembly, validator) as spec.ClassType,\n );\n }\n return false;\n }\n for (const iface of type.interfaces) {\n const ifaceType = _dereference(iface, assembly, validator) as spec.InterfaceType;\n const implemented = (ifaceType.properties ?? []).find((p) => p.name === property.name);\n if (implemented) {\n _assertPropertiesMatch(\n implemented,\n property,\n `${type.fqn}#${property.name}`,\n `implementing ${ifaceType.fqn}`,\n );\n // We won't replace a previous overrides declaration from a property override, as those\n // have higher precedence than an initial implementation.\n property.overrides = property.overrides ?? ifaceType.fqn;\n return true;\n }\n if (_validatePropertyImplementation(property, ifaceType)) {\n return true;\n }\n }\n return false;\n }\n\n function _assertSignaturesMatch(expected: spec.Method, actual: spec.Method, label: string, action: string) {\n if (!!expected.protected !== !!actual.protected) {\n const expVisibility = expected.protected ? 'protected' : 'public';\n const actVisibility = actual.protected ? 'protected' : 'public';\n diagnostic(\n JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.createDetached(\n label,\n action,\n actVisibility,\n expVisibility,\n ),\n );\n }\n // Allow covariant return types - actual return type can be more specific than expected\n if (!deepEqual(actual.returns, expected.returns)) {\n const actualReturnType = actual.returns?.type;\n const expectedReturnType = expected.returns?.type;\n\n // Check if this is a valid covariant return type (actual is more specific than expected)\n const isCovariantReturn =\n actualReturnType && expectedReturnType && _isCovariantOf(actualReturnType, expectedReturnType);\n\n if (!isCovariantReturn) {\n const expType = spec.describeTypeReference(expectedReturnType);\n const actType = spec.describeTypeReference(actualReturnType);\n diagnostic(\n JsiiDiagnostic.JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE.createDetached(label, action, actType, expType),\n );\n }\n }\n const expectedParams = expected.parameters ?? [];\n const actualParams = actual.parameters ?? [];\n if (expectedParams.length !== actualParams.length) {\n diagnostic(\n JsiiDiagnostic.JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT.createDetached(\n label,\n action,\n actualParams.length,\n expectedParams.length,\n ),\n );\n return;\n }\n for (let i = 0; i < expectedParams.length; i++) {\n const expParam = expectedParams[i];\n const actParam = actualParams[i];\n if (!deepEqual(expParam.type, actParam.type)) {\n diagnostic(\n JsiiDiagnostic.JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE.createDetached(label, action, actParam, expParam),\n );\n }\n // Not-ing those to force the values to a strictly boolean context (they're optional, undefined means false)\n if (expParam.variadic !== actParam.variadic) {\n diagnostic(\n JsiiDiagnostic.JSII_5007_OVERRIDE_CHANGES_VARIADIC.createDetached(\n label,\n action,\n actParam.variadic,\n expParam.variadic,\n ),\n );\n }\n if (expParam.optional !== actParam.optional) {\n diagnostic(\n JsiiDiagnostic.JSII_5008_OVERRIDE_CHANGES_PARAM_OPTIONAL.createDetached(label, action, actParam, expParam),\n );\n }\n }\n }\n\n function _isCovariantOf(candidateType: spec.TypeReference, expectedType: spec.TypeReference): boolean {\n // Same type is always covariant\n if (deepEqual(candidateType, expectedType)) {\n return true;\n }\n\n if (!spec.isNamedTypeReference(candidateType) || !spec.isNamedTypeReference(expectedType)) {\n return false;\n }\n\n const candidateTypeSpec = _dereference(candidateType.fqn, assembly, validator);\n const expectedTypeSpec = _dereference(expectedType.fqn, assembly, validator);\n\n if (!candidateTypeSpec || !expectedTypeSpec) {\n return false;\n }\n\n // Handle class-to-class inheritance\n if (spec.isClassType(candidateTypeSpec) && spec.isClassType(expectedTypeSpec)) {\n // Check if candidateType extends expectedType (directly or indirectly)\n return _classExtendsClass(candidateTypeSpec, expectedType.fqn);\n }\n\n // Handle class implementing interface\n if (spec.isClassType(candidateTypeSpec) && spec.isInterfaceType(expectedTypeSpec)) {\n return _classImplementsInterface(candidateTypeSpec, expectedType.fqn);\n }\n\n return false;\n }\n\n function _classExtendsClass(classType: spec.ClassType, targetFqn: string): boolean {\n let current = classType;\n while (current.base) {\n if (current.base === targetFqn) {\n return true;\n }\n const baseType = _dereference(current.base, assembly, validator);\n if (!spec.isClassType(baseType)) {\n break;\n }\n current = baseType;\n }\n return false;\n }\n\n function _classImplementsInterface(classType: spec.ClassType, interfaceFqn: string): boolean {\n // Check direct interfaces\n if (classType.interfaces?.includes(interfaceFqn)) {\n return true;\n }\n\n // Check inherited interfaces\n if (classType.interfaces) {\n for (const iface of classType.interfaces) {\n const ifaceType = _dereference(iface, assembly, validator);\n if (spec.isInterfaceType(ifaceType) && _interfaceExtendsInterface(ifaceType, interfaceFqn)) {\n return true;\n }\n }\n }\n\n // Check base class interfaces\n if (classType.base) {\n const baseType = _dereference(classType.base, assembly, validator);\n if (spec.isClassType(baseType)) {\n return _classImplementsInterface(baseType, interfaceFqn);\n }\n }\n\n return false;\n }\n\n function _interfaceExtendsInterface(interfaceType: spec.InterfaceType, targetFqn: string): boolean {\n if (interfaceType.fqn === targetFqn) {\n return true;\n }\n\n if (interfaceType.interfaces) {\n for (const iface of interfaceType.interfaces) {\n if (iface === targetFqn) {\n return true;\n }\n const ifaceType = _dereference(iface, assembly, validator);\n if (spec.isInterfaceType(ifaceType) && _interfaceExtendsInterface(ifaceType, targetFqn)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n function _validateStaticMethodOverride(method: spec.Method, type: spec.ClassType, baseType: spec.ClassType): void {\n const overridden = (baseType.methods ?? []).find((m) => m.name === method.name && m.static);\n if (overridden) {\n // Static methods must have exact same signature - no covariance allowed\n if (!deepEqual(method.returns, overridden.returns)) {\n diagnostic(\n JsiiDiagnostic.JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE.createDetached(\n `${type.fqn}#${method.name}`,\n `overriding ${baseType.fqn}`,\n spec.describeTypeReference(method.returns?.type),\n spec.describeTypeReference(overridden.returns?.type),\n ),\n );\n }\n }\n }\n\n function _validateStaticPropertyOverride(\n property: spec.Property,\n type: spec.ClassType,\n baseType: spec.ClassType,\n ): void {\n const overridden = (baseType.properties ?? []).find((p) => p.name === property.name && p.static);\n if (overridden) {\n // Static properties must have exact same type - no covariance allowed\n if (!deepEqual(property.type, overridden.type)) {\n diagnostic(\n JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.createDetached(\n `${type.fqn}#${property.name}`,\n `overriding ${baseType.fqn}`,\n property.type,\n overridden.type,\n ),\n );\n }\n }\n }\n\n function _assertPropertiesMatch(expected: spec.Property, actual: spec.Property, label: string, action: string) {\n const actualNode = bindings.getPropertyRelatedNode(actual);\n const expectedNode = bindings.getPropertyRelatedNode(expected);\n if (!!expected.protected !== !!actual.protected) {\n const expVisibility = expected.protected ? 'protected' : 'public';\n const actVisibility = actual.protected ? 'protected' : 'public';\n diagnostic(\n JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.create(\n actualNode?.modifiers?.find(\n (mod) => mod.kind === ts.SyntaxKind.PublicKeyword || mod.kind === ts.SyntaxKind.ProtectedKeyword,\n ) ?? declarationName(actualNode),\n label,\n action,\n actVisibility,\n expVisibility,\n ).maybeAddRelatedInformation(\n expectedNode?.modifiers?.find(\n (mod) => mod.kind === ts.SyntaxKind.PublicKeyword || mod.kind === ts.SyntaxKind.ProtectedKeyword,\n ) ?? declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n\n if (!_isCovariantOf(actual.type, expected.type)) {\n diagnostic(\n JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.create(\n actualNode?.type ?? declarationName(actualNode),\n label,\n action,\n actual.type,\n expected.type,\n ).maybeAddRelatedInformation(\n expectedNode?.type ?? declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n if (expected.immutable !== actual.immutable) {\n diagnostic(\n JsiiDiagnostic.JSII_5010_OVERRIDE_CHANGES_MUTABILITY.create(\n actualNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword) ??\n declarationName(actualNode),\n label,\n action,\n actual.immutable,\n expected.immutable,\n ).maybeAddRelatedInformation(\n expectedNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword) ??\n declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n if (expected.optional !== actual.optional) {\n diagnostic(\n JsiiDiagnostic.JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL.create(\n actualNode?.questionToken ?? actualNode?.type ?? declarationName(actualNode),\n label,\n action,\n actual.optional,\n expected.optional,\n ).maybeAddRelatedInformation(\n expectedNode?.questionToken ?? expectedNode?.type ?? declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n }\n }\n\n /**\n * Abstract classes that implement an interface should have a declaration for every member.\n *\n * For non-optional members, TypeScript already enforces this. This leaves the user the\n * ability to forget optional properties (`readonly prop?: string`).\n *\n * At least our codegen for this case fails in C#, and I'm not convinced it does the right\n * thing in Java either. So we will disallow this, and require users to declare these\n * fields on the class. It can always be `public abstract readonly prop?: string` if they\n * don't want to give an implementation yet.\n */\n function _abstractClassesMustImplementAllProperties(\n validator: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const type of _allTypes(assembly)) {\n if (!spec.isClassType(type) || !type.abstract) {\n continue;\n }\n\n const classProps = collectClassProps(type, new Set());\n\n for (const implFqn of type.interfaces ?? []) {\n checkInterfacePropsImplemented(implFqn, type, classProps);\n }\n }\n\n /**\n * Return all property names declared on this class and its base classes\n */\n function collectClassProps(type: spec.ClassType, into: Set<string>): Set<string> {\n for (const prop of type.properties ?? []) {\n into.add(prop.name);\n }\n\n if (type.base) {\n const base = _dereference(type.base, assembly, validator);\n if (spec.isClassType(base)) {\n collectClassProps(base, into);\n }\n }\n\n return into;\n }\n\n function checkInterfacePropsImplemented(interfaceFqn: string, cls: spec.ClassType, propNames: Set<string>) {\n const intf = _dereference(interfaceFqn, assembly, validator);\n if (!spec.isInterfaceType(intf)) {\n return;\n }\n\n // We only have to check for optional properties, because anything required\n // would have been caught by the TypeScript compiler already.\n for (const prop of intf.properties ?? []) {\n if (!prop.optional) {\n continue;\n }\n\n if (!propNames.has(prop.name)) {\n diagnostic(\n JsiiDiagnostic.JSII_5021_ABSTRACT_CLASS_MISSING_PROP_IMPL.create(\n bindings.getClassOrInterfaceRelatedNode(cls),\n intf,\n cls,\n prop.name,\n ).maybeAddRelatedInformation(bindings.getPropertyRelatedNode(prop), 'The implemented declaration is here.'),\n );\n }\n }\n\n for (const extFqn of intf.interfaces ?? []) {\n checkInterfacePropsImplemented(extFqn, cls, propNames);\n }\n }\n }\n\n function _staticMembersAndNestedTypesMustNotSharePascalCaseName(\n _: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const nestedType of Object.values(assembly.types ?? {})) {\n if (nestedType.namespace == null) {\n continue;\n }\n const nestingType = assembly.types![`${assembly.name}.${nestedType.namespace}`];\n if (nestingType == null) {\n continue;\n }\n const nestedTypeName = Case.pascal(nestedType.name);\n for (const { name, member } of staticMembers(nestingType)) {\n if (name === nestedTypeName) {\n let diag = JsiiDiagnostic.JSII_5020_STATIC_MEMBER_CONFLICTS_WITH_NESTED_TYPE.create(\n getRelatedNode(member)!,\n nestingType,\n member,\n nestedType,\n );\n const nestedTypeNode = getRelatedNode(nestedType);\n if (nestedTypeNode != null) {\n diag = diag.addRelatedInformation(nestedTypeNode, 'This is the conflicting nested type declaration');\n }\n diagnostic(diag);\n }\n }\n }\n\n function staticMembers(type: spec.Type) {\n if (spec.isClassOrInterfaceType(type)) {\n return [\n ...(type.methods?.filter((method) => method.static) ?? []),\n ...(type.properties?.filter((prop) => prop.static) ?? []),\n ].map((member) => ({ name: Case.pascal(member.name), member }));\n }\n return type.members.map((member) => ({ name: member.name, member }));\n }\n }\n}\n\nfunction _allTypes(assm: spec.Assembly): spec.Type[] {\n return Object.values(assm.types ?? {});\n}\n\nfunction _allMethods(assm: spec.Assembly): Array<{ member: spec.Method; type: spec.Type }> {\n const methods = new Array<{ member: spec.Method; type: spec.Type }>();\n for (const type of _allTypes(assm)) {\n if (!spec.isClassOrInterfaceType(type)) {\n continue;\n }\n if (!type.methods) {\n continue;\n }\n for (const method of type.methods) methods.push({ member: method, type });\n }\n return methods;\n}\n\nfunction _allProperties(assm: spec.Assembly): Array<{ member: spec.Property; type: spec.Type }> {\n const properties = new Array<{ member: spec.Property; type: spec.Type }>();\n for (const type of _allTypes(assm)) {\n if (!spec.isClassOrInterfaceType(type)) {\n continue;\n }\n if (!type.properties) {\n continue;\n }\n for (const property of type.properties) properties.push({ member: property, type });\n }\n return properties;\n}\n\nfunction _allMembers(assm: spec.Assembly): Array<{ member: spec.Property | spec.Method; type: spec.Type }> {\n return [..._allMethods(assm), ..._allProperties(assm)];\n}\n\ninterface AnnotatedTypeReference extends spec.NamedTypeReference {\n readonly node: ts.Node | undefined;\n}\n\nfunction _allTypeReferences(assm: spec.Assembly): readonly AnnotatedTypeReference[] {\n const typeReferences = new Array<AnnotatedTypeReference>();\n for (const type of _allTypes(assm)) {\n if (!spec.isClassOrInterfaceType(type)) {\n continue;\n }\n if (spec.isClassType(type)) {\n const node = bindings.getClassRelatedNode(type);\n if (type.base) {\n typeReferences.push({\n fqn: type.base,\n node: node?.heritageClauses?.find((hc) => hc.token === ts.SyntaxKind.ExtendsKeyword)?.types[0],\n });\n }\n if (type.initializer?.parameters) {\n for (const param of type.initializer.parameters) {\n _collectTypeReferences(param.type, bindings.getParameterRelatedNode(param)?.type);\n }\n }\n }\n if (type.interfaces) {\n const node = bindings.getClassOrInterfaceRelatedNode(type);\n for (const iface of type.interfaces) {\n typeReferences.push({\n fqn: iface,\n node: node?.heritageClauses?.find(\n (hc) =>\n hc.token ===\n (spec.isInterfaceType(type) ? ts.SyntaxKind.ImplementsKeyword : ts.SyntaxKind.ExtendsKeyword),\n ),\n });\n }\n }\n }\n for (const { member: prop } of _allProperties(assm)) {\n _collectTypeReferences(prop.type, bindings.getPropertyRelatedNode(prop)?.type);\n }\n for (const { member: meth } of _allMethods(assm)) {\n if (meth.returns) {\n _collectTypeReferences(meth.returns.type, bindings.getMethodRelatedNode(meth)?.type);\n }\n for (const param of meth.parameters ?? []) {\n _collectTypeReferences(param.type, bindings.getParameterRelatedNode(param)?.type);\n }\n }\n return typeReferences;\n\n function _collectTypeReferences(type: spec.TypeReference, node: ts.Node | undefined): void {\n if (spec.isNamedTypeReference(type)) {\n typeReferences.push({ ...type, node });\n } else if (spec.isCollectionTypeReference(type)) {\n _collectTypeReferences(type.collection.elementtype, node);\n } else if (spec.isUnionTypeReference(type)) {\n for (const t of type.union.types) _collectTypeReferences(t, node);\n }\n }\n}\n\nfunction _dereference(\n typeRef: string | spec.NamedTypeReference,\n assembly: spec.Assembly,\n validator: Validator,\n): spec.Type | undefined {\n if (typeof typeRef !== 'string') {\n typeRef = typeRef.fqn;\n }\n const [assm] = typeRef.split('.');\n if (assembly.name === assm) {\n return assembly.types?.[typeRef];\n }\n const foreignAssm = validator.projectInfo.dependencyClosure.find((dep) => dep.name === assm);\n return foreignAssm?.types?.[typeRef];\n}\n\nfunction _isEmpty(array: undefined | any[]): array is undefined {\n return array == null || array.length === 0;\n}\n\n/**\n * Return whether an identifier only consists of upperchase characters, digits and underscores\n *\n * We have our own check here (isConstantCase) which is more lenient than what\n * `case.constant()` prescribes. We also want to allow combinations of letters\n * and digits without underscores: `C5A`, which `case` would force to `C5_A`.\n * The hint we print will still use `case.constant()` but that is fine.\n */\nfunction isConstantCase(x: string) {\n return !/[^A-Z0-9_]/.exec(x);\n}\n\n/**\n * Obtains the name of the given declaration, if it has one, or returns the declaration itself.\n * This function is meant to be used as a convenience to obtain the `ts.Node` to bind a\n * `JsiiDianostic` instance on.\n *\n * It may return `undefined` but is typed as `ts.Node` so that it is easier to use with\n * `JsiiDiagnostic` factories.\n *\n * @param decl the declaration which name is needed.\n *\n * @returns the name of the declaration if it has one, or the declaration itself. Might return\n * `undefined` if the provided declaration is undefined.\n */\nfunction declarationName(decl: ts.Declaration | ts.Expression | undefined): ts.Node {\n if (decl == null) {\n // Pretend we returned a node - this is used to create diagnostics, worst case it'll be unbound.\n return decl as any;\n }\n return ts.getNameOfDeclaration(decl) ?? decl;\n}\n"]}
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,mCAAmC;AACnC,6CAA6C;AAC7C,iCAAiC;AACjC,+BAA+B;AAE/B,uDAAmD;AACnD,mDAAiD;AACjD,4CAA4C;AAG5C,MAAa,SAAS;IAGpB,YAAmC,WAAwB,EAAkB,QAAuB;QAAjE,gBAAW,GAAX,WAAW,CAAa;QAAkB,aAAQ,GAAR,QAAQ,CAAe;IAAG,CAAC;IAEjG,IAAI;QACT,MAAM,WAAW,GAAG,IAAI,KAAK,EAAiB,CAAC;QAE/C,KAAK,MAAM,UAAU,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YAC/C,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,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AAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAC7F,OAAO,WAAW,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAwB;IACxC,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,eAAe,CAAC,IAAgD;IACvE,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,gGAAgG;QAChG,OAAO,IAAW,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC/C,CAAC","sourcesContent":["import * as assert from 'node:assert';\nimport * as spec from '@jsii/spec';\nimport * as deepEqual from 'fast-deep-equal';\nimport * as ts from 'typescript';\nimport * as Case from './case';\nimport { Emitter } from './emitter';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport { getRelatedNode } from './node-bindings';\nimport * as bindings from './node-bindings';\nimport { ProjectInfo } from './project-info';\n\nexport class Validator implements Emitter {\n public static VALIDATIONS: ValidationFunction[] = _defaultValidations();\n\n public constructor(public readonly projectInfo: ProjectInfo, public readonly assembly: spec.Assembly) {}\n\n public emit(): ts.EmitResult {\n const diagnostics = new Array<ts.Diagnostic>();\n\n for (const validation of Validator.VALIDATIONS) {\n validation(this, this.assembly, diagnostics.push.bind(diagnostics));\n }\n\n return {\n diagnostics: diagnostics,\n emitSkipped: diagnostics.some((diag) => diag.category === ts.DiagnosticCategory.Error),\n };\n }\n}\n\nexport type DiagnosticEmitter = (diag: JsiiDiagnostic) => void;\nexport type ValidationFunction = (validator: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) => void;\n\nfunction _defaultValidations(): ValidationFunction[] {\n return [\n _enumMembersMustUserUpperSnakeCase,\n _memberNamesMustUseCamelCase,\n _staticConstantNamesMustUseUpperSnakeCase,\n _memberNamesMustNotLookLikeJavaGettersOrSetters,\n _allTypeReferencesAreValid,\n _inehritanceDoesNotChangeContracts,\n _staticMembersAndNestedTypesMustNotSharePascalCaseName,\n _abstractClassesMustImplementAllProperties,\n ];\n\n function _enumMembersMustUserUpperSnakeCase(_: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {\n for (const type of _allTypes(assembly)) {\n if (!spec.isEnumType(type)) {\n continue;\n }\n\n for (const member of type.members) {\n if (member.name && !isConstantCase(member.name)) {\n diagnostic(JsiiDiagnostic.JSII_8001_ALL_CAPS_ENUM_MEMBERS.createDetached(member.name, type.fqn));\n }\n }\n }\n }\n\n function _memberNamesMustUseCamelCase(_: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {\n for (const { member, type } of _allMembers(assembly)) {\n if (member.static && (member as spec.Property).const) {\n continue;\n }\n if (member.name && member.name !== Case.camel(member.name)) {\n diagnostic(JsiiDiagnostic.JSII_8002_CAMEL_CASED_MEMBERS.createDetached(member.name, type.fqn));\n }\n }\n }\n\n function _staticConstantNamesMustUseUpperSnakeCase(\n _: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const { member, type } of _allMembers(assembly)) {\n if (!member.static || !(member as spec.Property).const) {\n continue;\n }\n if (\n member.name &&\n !isConstantCase(member.name) &&\n member.name !== Case.pascal(member.name) &&\n member.name !== Case.camel(member.name)\n ) {\n diagnostic(JsiiDiagnostic.JSII_8003_STATIC_CONST_CASING.createDetached(member.name, type.name));\n }\n }\n }\n\n function _memberNamesMustNotLookLikeJavaGettersOrSetters(\n _: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const { member, type } of _allMembers(assembly)) {\n if (!member.name) {\n continue;\n }\n const snakeName = Case.snake(member.name);\n if (snakeName.startsWith('get_') && _isEmpty((member as spec.Method).parameters)) {\n diagnostic(JsiiDiagnostic.JSII_5000_JAVA_GETTERS.createDetached(member.name, type.name));\n } else if (snakeName.startsWith('set_') && ((member as spec.Method).parameters ?? []).length === 1) {\n diagnostic(JsiiDiagnostic.JSII_5001_JAVA_SETTERS.createDetached(member.name, type.name));\n }\n }\n }\n\n function _allTypeReferencesAreValid(validator: Validator, assembly: spec.Assembly, diagnostic: DiagnosticEmitter) {\n for (const typeRef of _allTypeReferences(assembly)) {\n const [assm] = typeRef.fqn.split('.');\n if (assembly.name === assm) {\n if (!(typeRef.fqn in (assembly.types ?? {}))) {\n diagnostic(\n JsiiDiagnostic.JSII_3000_EXPORTED_API_USES_HIDDEN_TYPE.create(\n typeRef.node!, // Pretend there is always a value\n typeRef.fqn,\n ),\n );\n }\n continue;\n }\n const foreignAssm = validator.projectInfo.dependencyClosure.find((dep) => dep.name === assm);\n if (!foreignAssm) {\n diagnostic(JsiiDiagnostic.JSII_9000_UNKNOWN_MODULE.createDetached(assm));\n continue;\n }\n if (!(typeRef.fqn in (foreignAssm.types ?? {}))) {\n diagnostic(JsiiDiagnostic.JSII_9001_TYPE_NOT_FOUND.createDetached(typeRef));\n }\n }\n }\n\n function _inehritanceDoesNotChangeContracts(\n validator: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const type of _allTypes(assembly)) {\n if (spec.isClassType(type)) {\n for (const method of type.methods ?? []) {\n _validateMethodOverride(method, type);\n }\n for (const property of type.properties ?? []) {\n _validatePropertyOverride(property, type);\n }\n }\n if (spec.isClassOrInterfaceType(type) && (type.interfaces?.length ?? 0) > 0) {\n for (const method of _allImplementations(type, (t) => t.methods)) {\n _validateMethodImplementation(method, type);\n }\n for (const property of _allImplementations(type, (t) => t.properties)) {\n _validatePropertyImplementation(property, type);\n }\n }\n }\n\n /**\n * Lists all \"implementations\" from the given type, using the provided\n * implementation getter. Note that abstract members may be part of the\n * result (in particular, if `type` is an interface type, or if it's an\n * abstract class with unimplemented members) -- I just couldn't come up\n * with a name that actually describes this.\n *\n * @param type the type which implemented members are needed.\n * @param getter the getter to obtain methods or properties from the type.\n *\n * @returns a list of members (possibly empty, always defined)\n */\n function _allImplementations<T extends spec.Property | spec.Method>(\n type: spec.ClassType | spec.InterfaceType,\n getter: (type: spec.ClassType | spec.InterfaceType) => T[] | undefined,\n ): T[] {\n const result = new Array<T>();\n const known = new Set<string>();\n\n for (const member of getter(type) ?? []) {\n result.push(member);\n known.add(member.name);\n }\n\n if (spec.isClassType(type) && type.base) {\n // We have a parent class, collect their concrete members, too (recursively)...\n const base = _dereference(type.base, assembly, validator);\n assert(base != null && spec.isClassType(base));\n for (const member of _allImplementations(base, getter)) {\n if (known.has(member.name)) {\n continue;\n }\n // The member is copied, so that its `overrides` property won't be\n // altered, since this member is \"borrowed\" from a parent type. We\n // only check it, but should not record `overrides` relationships to\n // it as those could be invalid per the parent type (i.e: the parent\n // member may not be able to implement an interface, if that type does\n // not actually declare implementing that).\n const memberCopy = { ...member };\n // Forward the related node if there's one, so diagnostics are bound.\n const node = bindings.getRelatedNode(member);\n if (node != null) {\n bindings.setRelatedNode(memberCopy, node);\n }\n\n result.push(memberCopy);\n known.add(member.name);\n }\n }\n\n return result;\n }\n\n function _validateMethodOverride(method: spec.Method, type: spec.ClassType): boolean {\n if (!type.base) {\n return false;\n }\n const baseType = _dereference(type.base, assembly, validator) as spec.ClassType;\n if (!baseType) {\n return false;\n }\n const overridden = (baseType.methods ?? []).find((m) => m.name === method.name);\n if (!overridden) {\n return _validateMethodOverride(method, baseType);\n }\n _assertSignaturesMatch(overridden, method, `${type.fqn}#${method.name}`, `overriding ${baseType.fqn}`, {\n allowCovariance: true,\n });\n method.overrides = baseType.fqn;\n return true;\n }\n\n function _validatePropertyOverride(property: spec.Property, type: spec.ClassType): boolean {\n if (!type.base) {\n return false;\n }\n const baseType = _dereference(type.base, assembly, validator) as spec.ClassType;\n if (!baseType) {\n return false;\n }\n const overridden = (baseType.properties ?? []).find((p) => p.name === property.name);\n if (!overridden) {\n return _validatePropertyOverride(property, baseType);\n }\n _assertPropertiesMatch(overridden, property, `${type.fqn}#${property.name}`, `overriding ${baseType.fqn}`, {\n allowCovariance: true,\n });\n property.overrides = baseType.fqn;\n return true;\n }\n\n function _validateMethodImplementation(method: spec.Method, type: spec.ClassType | spec.InterfaceType): boolean {\n if (!type.interfaces) {\n // Abstract classes may not directly implement all members, need to check their supertypes...\n if (spec.isClassType(type) && type.base && type.abstract) {\n return _validateMethodImplementation(method, _dereference(type.base, assembly, validator) as spec.ClassType);\n }\n return false;\n }\n for (const iface of type.interfaces) {\n const ifaceType = _dereference(iface, assembly, validator) as spec.InterfaceType;\n const implemented = (ifaceType.methods ?? []).find((m) => m.name === method.name);\n if (implemented) {\n _assertSignaturesMatch(implemented, method, `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}`, {\n allowCovariance: false,\n });\n // We won't replace a previous overrides declaration from a method override, as those have\n // higher precedence than an initial implementation.\n method.overrides = method.overrides ?? iface;\n return true;\n }\n if (_validateMethodImplementation(method, ifaceType)) {\n return true;\n }\n }\n return false;\n }\n\n function _validatePropertyImplementation(\n property: spec.Property,\n type: spec.ClassType | spec.InterfaceType,\n ): boolean {\n if (!type.interfaces) {\n // Abstract classes may not directly implement all members, need to check their supertypes...\n if (spec.isClassType(type) && type.base && type.abstract) {\n return _validatePropertyImplementation(\n property,\n _dereference(type.base, assembly, validator) as spec.ClassType,\n );\n }\n return false;\n }\n for (const iface of type.interfaces) {\n const ifaceType = _dereference(iface, assembly, validator) as spec.InterfaceType;\n const implemented = (ifaceType.properties ?? []).find((p) => p.name === property.name);\n if (implemented) {\n _assertPropertiesMatch(\n implemented,\n property,\n `${type.fqn}#${property.name}`,\n `implementing ${ifaceType.fqn}`,\n { allowCovariance: false },\n );\n // We won't replace a previous overrides declaration from a property override, as those\n // have higher precedence than an initial implementation.\n property.overrides = property.overrides ?? ifaceType.fqn;\n return true;\n }\n if (_validatePropertyImplementation(property, ifaceType)) {\n return true;\n }\n }\n return false;\n }\n\n function _assertSignaturesMatch(\n expected: spec.Method,\n actual: spec.Method,\n label: string,\n action: string,\n opts: {\n allowCovariance: boolean;\n },\n ) {\n if (!!expected.protected !== !!actual.protected) {\n const expVisibility = expected.protected ? 'protected' : 'public';\n const actVisibility = actual.protected ? 'protected' : 'public';\n diagnostic(\n JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.createDetached(\n label,\n action,\n actVisibility,\n expVisibility,\n ),\n );\n }\n\n // Types must generally be the same, but can be covariant sometimes\n if (!deepEqual(actual.returns, expected.returns)) {\n const actualReturnType = actual.returns?.type;\n const expectedReturnType = expected.returns?.type;\n\n if (\n // static members can never change\n actual.static ||\n // Check if this is a valid covariant return type (actual is more specific than expected)\n !(opts.allowCovariance && _isCovariantOf(actualReturnType, expectedReturnType))\n ) {\n const expType = spec.describeTypeReference(expectedReturnType);\n const actType = spec.describeTypeReference(actualReturnType);\n diagnostic(\n JsiiDiagnostic.JSII_5003_OVERRIDE_CHANGES_RETURN_TYPE.createDetached(label, action, actType, expType),\n );\n }\n }\n const expectedParams = expected.parameters ?? [];\n const actualParams = actual.parameters ?? [];\n if (expectedParams.length !== actualParams.length) {\n diagnostic(\n JsiiDiagnostic.JSII_5005_OVERRIDE_CHANGES_PARAM_COUNT.createDetached(\n label,\n action,\n actualParams.length,\n expectedParams.length,\n ),\n );\n return;\n }\n for (let i = 0; i < expectedParams.length; i++) {\n const expParam = expectedParams[i];\n const actParam = actualParams[i];\n if (!deepEqual(expParam.type, actParam.type)) {\n diagnostic(\n JsiiDiagnostic.JSII_5006_OVERRIDE_CHANGES_PARAM_TYPE.createDetached(label, action, actParam, expParam),\n );\n }\n // Not-ing those to force the values to a strictly boolean context (they're optional, undefined means false)\n if (expParam.variadic !== actParam.variadic) {\n diagnostic(\n JsiiDiagnostic.JSII_5007_OVERRIDE_CHANGES_VARIADIC.createDetached(\n label,\n action,\n actParam.variadic,\n expParam.variadic,\n ),\n );\n }\n if (expParam.optional !== actParam.optional) {\n diagnostic(\n JsiiDiagnostic.JSII_5008_OVERRIDE_CHANGES_PARAM_OPTIONAL.createDetached(label, action, actParam, expParam),\n );\n }\n }\n }\n\n function _isCovariantOf(candidateType?: spec.TypeReference, expectedType?: spec.TypeReference): boolean {\n // one void, while other isn't => not covariant\n if ((candidateType === undefined) !== (expectedType === undefined)) {\n return false;\n }\n\n // Same type is always covariant\n if (deepEqual(candidateType, expectedType)) {\n return true;\n }\n\n if (!spec.isNamedTypeReference(candidateType) || !spec.isNamedTypeReference(expectedType)) {\n return false;\n }\n\n const candidateTypeSpec = _dereference(candidateType.fqn, assembly, validator);\n const expectedTypeSpec = _dereference(expectedType.fqn, assembly, validator);\n\n if (!candidateTypeSpec || !expectedTypeSpec) {\n return false;\n }\n\n // Handle class-to-class inheritance\n if (spec.isClassType(candidateTypeSpec) && spec.isClassType(expectedTypeSpec)) {\n // Check if candidateType extends expectedType (directly or indirectly)\n return _classExtendsClass(candidateTypeSpec, expectedType.fqn);\n }\n\n // Handle class implementing interface\n if (spec.isClassType(candidateTypeSpec) && spec.isInterfaceType(expectedTypeSpec)) {\n return _classImplementsInterface(candidateTypeSpec, expectedType.fqn);\n }\n\n return false;\n }\n\n function _classExtendsClass(classType: spec.ClassType, targetFqn: string): boolean {\n let current = classType;\n while (current.base) {\n if (current.base === targetFqn) {\n return true;\n }\n const baseType = _dereference(current.base, assembly, validator);\n if (!spec.isClassType(baseType)) {\n break;\n }\n current = baseType;\n }\n return false;\n }\n\n function _classImplementsInterface(classType: spec.ClassType, interfaceFqn: string): boolean {\n // Check direct interfaces\n if (classType.interfaces?.includes(interfaceFqn)) {\n return true;\n }\n\n // Check inherited interfaces\n if (classType.interfaces) {\n for (const iface of classType.interfaces) {\n const ifaceType = _dereference(iface, assembly, validator);\n if (spec.isInterfaceType(ifaceType) && _interfaceExtendsInterface(ifaceType, interfaceFqn)) {\n return true;\n }\n }\n }\n\n // Check base class interfaces\n if (classType.base) {\n const baseType = _dereference(classType.base, assembly, validator);\n if (spec.isClassType(baseType)) {\n return _classImplementsInterface(baseType, interfaceFqn);\n }\n }\n\n return false;\n }\n\n function _interfaceExtendsInterface(interfaceType: spec.InterfaceType, targetFqn: string): boolean {\n if (interfaceType.fqn === targetFqn) {\n return true;\n }\n\n if (interfaceType.interfaces) {\n for (const iface of interfaceType.interfaces) {\n if (iface === targetFqn) {\n return true;\n }\n const ifaceType = _dereference(iface, assembly, validator);\n if (spec.isInterfaceType(ifaceType) && _interfaceExtendsInterface(ifaceType, targetFqn)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n function _assertPropertiesMatch(\n expected: spec.Property,\n actual: spec.Property,\n label: string,\n action: string,\n opts: {\n allowCovariance: boolean;\n },\n ) {\n const actualNode = bindings.getPropertyRelatedNode(actual);\n const expectedNode = bindings.getPropertyRelatedNode(expected);\n if (!!expected.protected !== !!actual.protected) {\n const expVisibility = expected.protected ? 'protected' : 'public';\n const actVisibility = actual.protected ? 'protected' : 'public';\n diagnostic(\n JsiiDiagnostic.JSII_5002_OVERRIDE_CHANGES_VISIBILITY.create(\n actualNode?.modifiers?.find(\n (mod) => mod.kind === ts.SyntaxKind.PublicKeyword || mod.kind === ts.SyntaxKind.ProtectedKeyword,\n ) ?? declarationName(actualNode),\n label,\n action,\n actVisibility,\n expVisibility,\n ).maybeAddRelatedInformation(\n expectedNode?.modifiers?.find(\n (mod) => mod.kind === ts.SyntaxKind.PublicKeyword || mod.kind === ts.SyntaxKind.ProtectedKeyword,\n ) ?? declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n\n // Types must generally be the same, but can be covariant sometimes\n if (!deepEqual(actual.type, expected.type)) {\n if (\n // static members can never change\n actual.static ||\n // immutable properties may change in some case, as long as they are covariant\n !(opts.allowCovariance && actual.immutable && _isCovariantOf(actual.type, expected.type))\n ) {\n diagnostic(\n JsiiDiagnostic.JSII_5004_OVERRIDE_CHANGES_PROP_TYPE.create(\n actualNode?.type ?? declarationName(actualNode),\n label,\n action,\n actual.type,\n expected.type,\n ).maybeAddRelatedInformation(\n expectedNode?.type ?? declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n }\n if (expected.immutable !== actual.immutable) {\n diagnostic(\n JsiiDiagnostic.JSII_5010_OVERRIDE_CHANGES_MUTABILITY.create(\n actualNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword) ??\n declarationName(actualNode),\n label,\n action,\n actual.immutable,\n expected.immutable,\n ).maybeAddRelatedInformation(\n expectedNode?.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ReadonlyKeyword) ??\n declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n if (expected.optional !== actual.optional) {\n diagnostic(\n JsiiDiagnostic.JSII_5009_OVERRIDE_CHANGES_PROP_OPTIONAL.create(\n actualNode?.questionToken ?? actualNode?.type ?? declarationName(actualNode),\n label,\n action,\n actual.optional,\n expected.optional,\n ).maybeAddRelatedInformation(\n expectedNode?.questionToken ?? expectedNode?.type ?? declarationName(expectedNode),\n 'The implemented declaration is here.',\n ),\n );\n }\n }\n }\n\n /**\n * Abstract classes that implement an interface should have a declaration for every member.\n *\n * For non-optional members, TypeScript already enforces this. This leaves the user the\n * ability to forget optional properties (`readonly prop?: string`).\n *\n * At least our codegen for this case fails in C#, and I'm not convinced it does the right\n * thing in Java either. So we will disallow this, and require users to declare these\n * fields on the class. It can always be `public abstract readonly prop?: string` if they\n * don't want to give an implementation yet.\n */\n function _abstractClassesMustImplementAllProperties(\n validator: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const type of _allTypes(assembly)) {\n if (!spec.isClassType(type) || !type.abstract) {\n continue;\n }\n\n const classProps = collectClassProps(type, new Set());\n\n for (const implFqn of type.interfaces ?? []) {\n checkInterfacePropsImplemented(implFqn, type, classProps);\n }\n }\n\n /**\n * Return all property names declared on this class and its base classes\n */\n function collectClassProps(type: spec.ClassType, into: Set<string>): Set<string> {\n for (const prop of type.properties ?? []) {\n into.add(prop.name);\n }\n\n if (type.base) {\n const base = _dereference(type.base, assembly, validator);\n if (spec.isClassType(base)) {\n collectClassProps(base, into);\n }\n }\n\n return into;\n }\n\n function checkInterfacePropsImplemented(interfaceFqn: string, cls: spec.ClassType, propNames: Set<string>) {\n const intf = _dereference(interfaceFqn, assembly, validator);\n if (!spec.isInterfaceType(intf)) {\n return;\n }\n\n // We only have to check for optional properties, because anything required\n // would have been caught by the TypeScript compiler already.\n for (const prop of intf.properties ?? []) {\n if (!prop.optional) {\n continue;\n }\n\n if (!propNames.has(prop.name)) {\n diagnostic(\n JsiiDiagnostic.JSII_5021_ABSTRACT_CLASS_MISSING_PROP_IMPL.create(\n bindings.getClassOrInterfaceRelatedNode(cls),\n intf,\n cls,\n prop.name,\n ).maybeAddRelatedInformation(bindings.getPropertyRelatedNode(prop), 'The implemented declaration is here.'),\n );\n }\n }\n\n for (const extFqn of intf.interfaces ?? []) {\n checkInterfacePropsImplemented(extFqn, cls, propNames);\n }\n }\n }\n\n function _staticMembersAndNestedTypesMustNotSharePascalCaseName(\n _: Validator,\n assembly: spec.Assembly,\n diagnostic: DiagnosticEmitter,\n ) {\n for (const nestedType of Object.values(assembly.types ?? {})) {\n if (nestedType.namespace == null) {\n continue;\n }\n const nestingType = assembly.types![`${assembly.name}.${nestedType.namespace}`];\n if (nestingType == null) {\n continue;\n }\n const nestedTypeName = Case.pascal(nestedType.name);\n for (const { name, member } of staticMembers(nestingType)) {\n if (name === nestedTypeName) {\n let diag = JsiiDiagnostic.JSII_5020_STATIC_MEMBER_CONFLICTS_WITH_NESTED_TYPE.create(\n getRelatedNode(member)!,\n nestingType,\n member,\n nestedType,\n );\n const nestedTypeNode = getRelatedNode(nestedType);\n if (nestedTypeNode != null) {\n diag = diag.addRelatedInformation(nestedTypeNode, 'This is the conflicting nested type declaration');\n }\n diagnostic(diag);\n }\n }\n }\n\n function staticMembers(type: spec.Type) {\n if (spec.isClassOrInterfaceType(type)) {\n return [\n ...(type.methods?.filter((method) => method.static) ?? []),\n ...(type.properties?.filter((prop) => prop.static) ?? []),\n ].map((member) => ({ name: Case.pascal(member.name), member }));\n }\n return type.members.map((member) => ({ name: member.name, member }));\n }\n }\n}\n\nfunction _allTypes(assm: spec.Assembly): spec.Type[] {\n return Object.values(assm.types ?? {});\n}\n\nfunction _allMethods(assm: spec.Assembly): Array<{ member: spec.Method; type: spec.Type }> {\n const methods = new Array<{ member: spec.Method; type: spec.Type }>();\n for (const type of _allTypes(assm)) {\n if (!spec.isClassOrInterfaceType(type)) {\n continue;\n }\n if (!type.methods) {\n continue;\n }\n for (const method of type.methods) methods.push({ member: method, type });\n }\n return methods;\n}\n\nfunction _allProperties(assm: spec.Assembly): Array<{ member: spec.Property; type: spec.Type }> {\n const properties = new Array<{ member: spec.Property; type: spec.Type }>();\n for (const type of _allTypes(assm)) {\n if (!spec.isClassOrInterfaceType(type)) {\n continue;\n }\n if (!type.properties) {\n continue;\n }\n for (const property of type.properties) properties.push({ member: property, type });\n }\n return properties;\n}\n\nfunction _allMembers(assm: spec.Assembly): Array<{ member: spec.Property | spec.Method; type: spec.Type }> {\n return [..._allMethods(assm), ..._allProperties(assm)];\n}\n\ninterface AnnotatedTypeReference extends spec.NamedTypeReference {\n readonly node: ts.Node | undefined;\n}\n\nfunction _allTypeReferences(assm: spec.Assembly): readonly AnnotatedTypeReference[] {\n const typeReferences = new Array<AnnotatedTypeReference>();\n for (const type of _allTypes(assm)) {\n if (!spec.isClassOrInterfaceType(type)) {\n continue;\n }\n if (spec.isClassType(type)) {\n const node = bindings.getClassRelatedNode(type);\n if (type.base) {\n typeReferences.push({\n fqn: type.base,\n node: node?.heritageClauses?.find((hc) => hc.token === ts.SyntaxKind.ExtendsKeyword)?.types[0],\n });\n }\n if (type.initializer?.parameters) {\n for (const param of type.initializer.parameters) {\n _collectTypeReferences(param.type, bindings.getParameterRelatedNode(param)?.type);\n }\n }\n }\n if (type.interfaces) {\n const node = bindings.getClassOrInterfaceRelatedNode(type);\n for (const iface of type.interfaces) {\n typeReferences.push({\n fqn: iface,\n node: node?.heritageClauses?.find(\n (hc) =>\n hc.token ===\n (spec.isInterfaceType(type) ? ts.SyntaxKind.ImplementsKeyword : ts.SyntaxKind.ExtendsKeyword),\n ),\n });\n }\n }\n }\n for (const { member: prop } of _allProperties(assm)) {\n _collectTypeReferences(prop.type, bindings.getPropertyRelatedNode(prop)?.type);\n }\n for (const { member: meth } of _allMethods(assm)) {\n if (meth.returns) {\n _collectTypeReferences(meth.returns.type, bindings.getMethodRelatedNode(meth)?.type);\n }\n for (const param of meth.parameters ?? []) {\n _collectTypeReferences(param.type, bindings.getParameterRelatedNode(param)?.type);\n }\n }\n return typeReferences;\n\n function _collectTypeReferences(type: spec.TypeReference, node: ts.Node | undefined): void {\n if (spec.isNamedTypeReference(type)) {\n typeReferences.push({ ...type, node });\n } else if (spec.isCollectionTypeReference(type)) {\n _collectTypeReferences(type.collection.elementtype, node);\n } else if (spec.isUnionTypeReference(type)) {\n for (const t of type.union.types) _collectTypeReferences(t, node);\n }\n }\n}\n\nfunction _dereference(\n typeRef: string | spec.NamedTypeReference,\n assembly: spec.Assembly,\n validator: Validator,\n): spec.Type | undefined {\n if (typeof typeRef !== 'string') {\n typeRef = typeRef.fqn;\n }\n const [assm] = typeRef.split('.');\n if (assembly.name === assm) {\n return assembly.types?.[typeRef];\n }\n const foreignAssm = validator.projectInfo.dependencyClosure.find((dep) => dep.name === assm);\n return foreignAssm?.types?.[typeRef];\n}\n\nfunction _isEmpty(array: undefined | any[]): array is undefined {\n return array == null || array.length === 0;\n}\n\n/**\n * Return whether an identifier only consists of upperchase characters, digits and underscores\n *\n * We have our own check here (isConstantCase) which is more lenient than what\n * `case.constant()` prescribes. We also want to allow combinations of letters\n * and digits without underscores: `C5A`, which `case` would force to `C5_A`.\n * The hint we print will still use `case.constant()` but that is fine.\n */\nfunction isConstantCase(x: string) {\n return !/[^A-Z0-9_]/.exec(x);\n}\n\n/**\n * Obtains the name of the given declaration, if it has one, or returns the declaration itself.\n * This function is meant to be used as a convenience to obtain the `ts.Node` to bind a\n * `JsiiDianostic` instance on.\n *\n * It may return `undefined` but is typed as `ts.Node` so that it is easier to use with\n * `JsiiDiagnostic` factories.\n *\n * @param decl the declaration which name is needed.\n *\n * @returns the name of the declaration if it has one, or the declaration itself. Might return\n * `undefined` if the provided declaration is undefined.\n */\nfunction declarationName(decl: ts.Declaration | ts.Expression | undefined): ts.Node {\n if (decl == null) {\n // Pretend we returned a node - this is used to create diagnostics, worst case it'll be unbound.\n return decl as any;\n }\n return ts.getNameOfDeclaration(decl) ?? decl;\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.5-dev.
|
2
|
+
export declare const SHORT_VERSION = "5.9.5-dev.5";
|
3
3
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
4
|
-
export declare const VERSION = "5.9.5-dev.
|
4
|
+
export declare const VERSION = "5.9.5-dev.5 (build a419c49)";
|
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.5-dev.
|
7
|
+
exports.SHORT_VERSION = '5.9.5-dev.5';
|
8
8
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
9
|
-
exports.VERSION = '5.9.5-dev.
|
9
|
+
exports.VERSION = '5.9.5-dev.5 (build a419c49)';
|
10
10
|
/** The release line identifier for this JSII compiler (e.g: `X.Y`) */
|
11
11
|
exports.RELEASE_LINE = typescript_1.versionMajorMinor;
|
12
12
|
//# sourceMappingURL=version.js.map
|
package/lib/version.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,aAAa,CAAC;AAE3C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,6BAA6B,CAAC;AAErD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.9.5-dev.
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,aAAa,CAAC;AAE3C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,6BAA6B,CAAC;AAErD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.9.5-dev.5';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.9.5-dev.5 (build a419c49)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
|
package/package.json
CHANGED
@@ -71,7 +71,7 @@
|
|
71
71
|
},
|
72
72
|
"dependencies": {
|
73
73
|
"@jsii/check-node": "1.113.0",
|
74
|
-
"@jsii/spec": "^1.
|
74
|
+
"@jsii/spec": "^1.114.1",
|
75
75
|
"case": "^1.6.3",
|
76
76
|
"chalk": "^4",
|
77
77
|
"fast-deep-equal": "^3.1.3",
|
@@ -92,7 +92,7 @@
|
|
92
92
|
"publishConfig": {
|
93
93
|
"access": "public"
|
94
94
|
},
|
95
|
-
"version": "5.9.5-dev.
|
95
|
+
"version": "5.9.5-dev.5",
|
96
96
|
"types": "lib/index.d.ts",
|
97
97
|
"exports": {
|
98
98
|
".": "./lib/index.js",
|