jsii 5.4.16-dev.1 → 5.4.16-dev.3
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/case.d.ts +1 -0
- package/lib/case.js +2 -1
- package/lib/case.js.map +1 -1
- package/lib/compiler.d.ts +38 -14
- package/lib/compiler.js +114 -108
- package/lib/compiler.js.map +1 -1
- package/lib/jsii-diagnostic.d.ts +3 -0
- package/lib/jsii-diagnostic.js +15 -1
- package/lib/jsii-diagnostic.js.map +1 -1
- package/lib/main.js +45 -2
- package/lib/main.js.map +1 -1
- package/lib/project-info.d.ts +5 -0
- package/lib/project-info.js +13 -0
- package/lib/project-info.js.map +1 -1
- package/lib/tsconfig/compiler-options.d.ts +54 -0
- package/lib/tsconfig/compiler-options.js +136 -0
- package/lib/tsconfig/compiler-options.js.map +1 -0
- package/lib/tsconfig/index.d.ts +18 -0
- package/lib/tsconfig/index.js +11 -0
- package/lib/tsconfig/index.js.map +1 -0
- package/lib/tsconfig/rulesets/configurable.d.ts +4 -0
- package/lib/tsconfig/rulesets/configurable.js +22 -0
- package/lib/tsconfig/rulesets/configurable.js.map +1 -0
- package/lib/tsconfig/rulesets/generated.public.d.ts +4 -0
- package/lib/tsconfig/rulesets/generated.public.js +28 -0
- package/lib/tsconfig/rulesets/generated.public.js.map +1 -0
- package/lib/tsconfig/rulesets/incompatible-options.d.ts +4 -0
- package/lib/tsconfig/rulesets/incompatible-options.js +11 -0
- package/lib/tsconfig/rulesets/incompatible-options.js.map +1 -0
- package/lib/tsconfig/rulesets/minimal.public.d.ts +4 -0
- package/lib/tsconfig/rulesets/minimal.public.js +11 -0
- package/lib/tsconfig/rulesets/minimal.public.js.map +1 -0
- package/lib/tsconfig/rulesets/strict.public.d.ts +4 -0
- package/lib/tsconfig/rulesets/strict.public.js +29 -0
- package/lib/tsconfig/rulesets/strict.public.js.map +1 -0
- package/lib/tsconfig/tsconfig-validator.d.ts +16 -0
- package/lib/tsconfig/tsconfig-validator.js +46 -0
- package/lib/tsconfig/tsconfig-validator.js.map +1 -0
- package/lib/tsconfig/validator.d.ts +155 -0
- package/lib/tsconfig/validator.js +301 -0
- package/lib/tsconfig/validator.js.map +1 -0
- package/lib/version.d.ts +2 -2
- package/lib/version.js +2 -2
- package/lib/version.js.map +1 -1
- package/package.json +2 -1
package/lib/compiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,kCAAkC;AAClC,+BAA+B;AAC/B,iCAAiC;AACjC,iCAAiC;AAEjC,2CAAwC;AACxC,+BAA+B;AAC/B,oDAA8D;AAC9D,mDAA4E;AAE5E,uDAAmD;AAEnD,4EAA2E;AAC3E,iCAAiC;AAEjC,MAAM,qBAAqB,GAAuB;IAChD,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,WAAW,EAAE,IAAI;IACjB,GAAG,EAAE,CAAC,iBAAiB,CAAC;IACxB,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ;IAC9B,aAAa,EAAE,IAAI;IACnB,0BAA0B,EAAE,IAAI;IAChC,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;IACpB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,gBAAgB,EAAE,IAAI;IACtB,4BAA4B,EAAE,IAAI;IAClC,aAAa,EAAE,KAAK;IACpB,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;CAC/B,CAAC;AAEF,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;AACjC,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QA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AM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;KACtD,CAAC;AACJ,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as chalk from 'chalk';\nimport * as log4js from 'log4js';\nimport * as ts from 'typescript';\n\nimport { Assembler } from './assembler';\nimport * as Case from './case';\nimport { findDependencyDirectory } from './common/find-utils';\nimport { emitDownleveledDeclarations, TYPES_COMPAT } from './downlevel-dts';\nimport { Emitter } from './emitter';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport { ProjectInfo } from './project-info';\nimport { WARNINGSCODE_FILE_NAME } from './transforms/deprecation-warnings';\nimport * as utils from './utils';\n\nconst BASE_COMPILER_OPTIONS: ts.CompilerOptions = {\n alwaysStrict: true,\n declaration: true,\n experimentalDecorators: true,\n incremental: true,\n lib: ['lib.es2020.d.ts'],\n module: ts.ModuleKind.CommonJS,\n noEmitOnError: true,\n noFallthroughCasesInSwitch: true,\n noImplicitAny: true,\n noImplicitReturns: true,\n noImplicitThis: true,\n noUnusedLocals: true,\n noUnusedParameters: true,\n resolveJsonModule: true,\n skipLibCheck: true,\n strict: true,\n strictNullChecks: true,\n strictPropertyInitialization: true,\n stripInternal: false,\n target: ts.ScriptTarget.ES2020,\n};\n\nconst LOG = log4js.getLogger('jsii/compiler');\nexport const DIAGNOSTICS = 'diagnostics';\nexport const JSII_DIAGNOSTICS_CODE = 9999;\n\nexport interface CompilerOptions {\n /** The information about the project to be built */\n projectInfo: ProjectInfo;\n /** Whether the compiler should watch for changes or just compile once */\n watch?: boolean;\n /** Whether to detect and generate TypeScript project references */\n projectReferences?: boolean;\n /** Whether to fail when a warning is emitted */\n failOnWarnings?: boolean;\n /** Whether to strip deprecated members from emitted artifacts */\n stripDeprecated?: boolean;\n /** The path to an allowlist of FQNs to strip if stripDeprecated is set */\n stripDeprecatedAllowListFile?: string;\n /** Whether to add warnings for deprecated elements */\n addDeprecationWarnings?: boolean;\n /**\n * The name of the tsconfig file to generate\n * @default \"tsconfig.json\"\n */\n generateTypeScriptConfig?: string;\n /**\n * Whether to compress the assembly\n * @default false\n */\n compressAssembly?: boolean;\n}\n\nexport interface TypescriptConfig {\n compilerOptions: ts.CompilerOptions;\n include?: string[];\n exclude?: string[];\n references?: ts.ProjectReference[];\n}\n\nexport class Compiler implements Emitter {\n private readonly system: ts.System;\n private readonly compilerHost: ts.CompilerHost;\n private typescriptConfig?: TypescriptConfig;\n private rootFiles: string[] = [];\n private readonly configPath: string;\n private readonly projectReferences: boolean;\n\n public constructor(private readonly options: CompilerOptions) {\n const rootDir = this.options.projectInfo.projectRoot;\n this.system = {\n ...ts.sys,\n getCurrentDirectory: () => rootDir,\n createDirectory: (pth) => ts.sys.createDirectory(path.resolve(rootDir, pth)),\n deleteFile: ts.sys.deleteFile && ((pth) => ts.sys.deleteFile!(path.join(rootDir, pth))),\n fileExists: (pth) => ts.sys.fileExists(path.resolve(rootDir, pth)),\n getFileSize: ts.sys.getFileSize && ((pth) => ts.sys.getFileSize!(path.resolve(rootDir, pth))),\n readFile: (pth, encoding) => ts.sys.readFile(path.resolve(rootDir, pth), encoding),\n watchFile:\n ts.sys.watchFile &&\n ((pth, callback, pollingInterval, watchOptions) =>\n ts.sys.watchFile!(path.resolve(rootDir, pth), callback, pollingInterval, watchOptions)),\n writeFile: (pth, data, writeByteOrderMark) =>\n ts.sys.writeFile(path.resolve(rootDir, pth), data, writeByteOrderMark),\n };\n this.compilerHost = ts.createIncrementalCompilerHost(BASE_COMPILER_OPTIONS, this.system);\n\n const configFileName = options.generateTypeScriptConfig ?? 'tsconfig.json';\n\n this.configPath = path.join(this.options.projectInfo.projectRoot, configFileName);\n\n this.projectReferences =\n options.projectReferences !== undefined\n ? options.projectReferences\n : options.projectInfo.projectReferences !== undefined\n ? options.projectInfo.projectReferences\n : false;\n }\n\n /**\n * Compiles the configured program.\n *\n * @param files can be specified to override the standard source code location logic. Useful for example when testing \"negatives\".\n */\n public emit(...files: string[]): ts.EmitResult {\n this._prepareForBuild(...files);\n return this._buildOnce();\n }\n\n /**\n * Watches for file-system changes and dynamically recompiles the project as needed. In non-blocking mode, this\n * returns the TypeScript watch handle for the application to use.\n *\n * @internal\n */\n public async watch(opts: NonBlockingWatchOptions): Promise<ts.Watch<ts.BuilderProgram>>;\n /**\n * Watches for file-system changes and dynamically recompiles the project as needed. In blocking mode, this results\n * in a never-resolving promise.\n */\n public async watch(): Promise<never>;\n public async watch(opts?: NonBlockingWatchOptions): Promise<ts.Watch<ts.BuilderProgram> | never> {\n this._prepareForBuild();\n\n const pi = this.options.projectInfo;\n const projectRoot = pi.projectRoot;\n const host = ts.createWatchCompilerHost(\n this.configPath,\n {\n ...pi.tsc,\n ...BASE_COMPILER_OPTIONS,\n noEmitOnError: false,\n },\n this.system,\n ts.createEmitAndSemanticDiagnosticsBuilderProgram,\n opts?.reportDiagnostics,\n opts?.reportWatchStatus,\n );\n if (!host.getDefaultLibLocation) {\n throw new Error('No default library location was found on the TypeScript compiler host!');\n }\n const orig = host.afterProgramCreate;\n // This is a callback cascade, so it's \"okay\" to return an unhandled promise there. This may\n // cause an unhandled promise rejection warning, but that's not a big deal.\n //\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n host.afterProgramCreate = (builderProgram) => {\n const emitResult = this._consumeProgram(builderProgram.getProgram(), host.getDefaultLibLocation!());\n\n for (const diag of emitResult.diagnostics.filter((d) => d.code === JSII_DIAGNOSTICS_CODE)) {\n utils.logDiagnostic(diag, projectRoot);\n }\n\n if (orig) {\n orig.call(host, builderProgram);\n }\n if (opts?.compilationComplete) {\n opts.compilationComplete(emitResult);\n }\n };\n const watch = ts.createWatchProgram(host);\n\n if (opts?.nonBlocking) {\n // In non-blocking mode, returns the handle to the TypeScript watch interface.\n return watch;\n }\n // In blocking mode, returns a never-resolving promise.\n return new Promise<never>(() => null);\n }\n\n /**\n * Prepares the project for build, by creating the necessary configuration\n * file(s), and assigning the relevant root file(s).\n *\n * @param files the files that were specified as input in the CLI invocation.\n */\n private _prepareForBuild(...files: string[]) {\n this.buildTypeScriptConfig();\n this.writeTypeScriptConfig();\n this.rootFiles = this.determineSources(files);\n }\n\n /**\n * Do a single build\n */\n private _buildOnce(): ts.EmitResult {\n if (!this.compilerHost.getDefaultLibLocation) {\n throw new Error('No default library location was found on the TypeScript compiler host!');\n }\n\n const tsconf = this.typescriptConfig!;\n const pi = this.options.projectInfo;\n\n const prog = ts.createIncrementalProgram({\n rootNames: this.rootFiles.concat(_pathOfLibraries(this.compilerHost)),\n options: {\n ...pi.tsc,\n ...(tsconf?.compilerOptions ?? BASE_COMPILER_OPTIONS),\n },\n // Make the references absolute for the compiler\n projectReferences: tsconf.references?.map((ref) => ({\n path: path.resolve(path.dirname(this.configPath), ref.path),\n })),\n host: this.compilerHost,\n });\n\n return this._consumeProgram(prog.getProgram(), this.compilerHost.getDefaultLibLocation());\n }\n\n private _consumeProgram(program: ts.Program, stdlib: string): ts.EmitResult {\n const diagnostics = [...ts.getPreEmitDiagnostics(program)];\n let hasErrors = false;\n\n if (!hasErrors && this.diagsHaveAbortableErrors(diagnostics)) {\n hasErrors = true;\n LOG.error('Compilation errors prevented the JSII assembly from being created');\n }\n\n // Do the \"Assembler\" part first because we need some of the analysis done in there\n // to post-process the AST\n const assembler = new Assembler(this.options.projectInfo, this.system, program, stdlib, {\n stripDeprecated: this.options.stripDeprecated,\n stripDeprecatedAllowListFile: this.options.stripDeprecatedAllowListFile,\n addDeprecationWarnings: this.options.addDeprecationWarnings,\n compressAssembly: this.options.compressAssembly,\n });\n\n try {\n const assmEmit = assembler.emit();\n if (!hasErrors && (assmEmit.emitSkipped || this.diagsHaveAbortableErrors(assmEmit.diagnostics))) {\n hasErrors = true;\n LOG.error('Type model errors prevented the JSII assembly from being created');\n }\n\n diagnostics.push(...assmEmit.diagnostics);\n } catch (e: any) {\n diagnostics.push(JsiiDiagnostic.JSII_9997_UNKNOWN_ERROR.createDetached(e));\n hasErrors = true;\n }\n\n // Do the emit, but add in transformers which are going to replace real\n // comments with synthetic ones.\n const emit = program.emit(\n undefined, // targetSourceFile\n undefined, // writeFile\n undefined, // cancellationToken\n undefined, // emitOnlyDtsFiles\n assembler.customTransformers,\n );\n diagnostics.push(...emit.diagnostics);\n\n if (!hasErrors && (emit.emitSkipped || this.diagsHaveAbortableErrors(emit.diagnostics))) {\n hasErrors = true;\n LOG.error('Compilation errors prevented the JSII assembly from being created');\n }\n\n if (!hasErrors) {\n emitDownleveledDeclarations(this.options.projectInfo);\n }\n\n // Some extra validation on the config.\n // Make sure that { \"./.warnings.jsii.js\": \"./.warnings.jsii.js\" } is in the set of\n // exports, if they are specified.\n if (this.options.addDeprecationWarnings && this.options.projectInfo.exports !== undefined) {\n const expected = `./${WARNINGSCODE_FILE_NAME}`;\n const warningsExport = Object.entries(this.options.projectInfo.exports).filter(\n ([k, v]) => k === expected && v === expected,\n );\n\n if (warningsExport.length === 0) {\n hasErrors = true;\n diagnostics.push(JsiiDiagnostic.JSII_0007_MISSING_WARNINGS_EXPORT.createDetached());\n }\n }\n\n return {\n emitSkipped: hasErrors,\n diagnostics: ts.sortAndDeduplicateDiagnostics(diagnostics),\n emittedFiles: emit.emittedFiles,\n };\n }\n\n /**\n * Build the TypeScript config object\n *\n * This is the object that will be written to disk.\n */\n private buildTypeScriptConfig() {\n let references: string[] | undefined;\n if (this.projectReferences) {\n references = this.findProjectReferences();\n }\n\n const pi = this.options.projectInfo;\n\n this.typescriptConfig = {\n compilerOptions: {\n ...pi.tsc,\n ...BASE_COMPILER_OPTIONS,\n // Enable composite mode if project references are enabled\n composite: this.projectReferences,\n // When incremental, configure a tsbuildinfo file\n tsBuildInfoFile: path.join(pi.tsc?.outDir ?? '.', 'tsconfig.tsbuildinfo'),\n },\n include: [pi.tsc?.rootDir != null ? path.join(pi.tsc.rootDir, '**', '*.ts') : path.join('**', '*.ts')],\n exclude: [\n 'node_modules',\n pi.tsc?.outDir != null ? path.resolve(pi.tsc.outDir, TYPES_COMPAT) : TYPES_COMPAT,\n ...(pi.excludeTypescript ?? []),\n ...(pi.tsc?.outDir != null &&\n (pi.tsc?.rootDir == null || path.resolve(pi.tsc.outDir).startsWith(path.resolve(pi.tsc.rootDir) + path.sep))\n ? [path.join(pi.tsc.outDir, '**', '*.ts')]\n : []),\n ],\n // Change the references a little. We write 'originalpath' to the\n // file under the 'path' key, which is the same as what the\n // TypeScript compiler does. Make it relative so that the files are\n // movable. Not strictly required but looks better.\n references: references?.map((p) => ({ path: p })),\n };\n }\n\n /**\n * Creates a `tsconfig.json` file to improve the IDE experience.\n *\n * @return the fully qualified path to the `tsconfig.json` file\n */\n private writeTypeScriptConfig(): void {\n const commentKey = '_generated_by_jsii_';\n const commentValue = 'Generated by jsii - safe to delete, and ideally should be in .gitignore';\n\n (this.typescriptConfig as any)[commentKey] = commentValue;\n\n if (fs.existsSync(this.configPath)) {\n const currentConfig = JSON.parse(fs.readFileSync(this.configPath, 'utf-8'));\n if (!(commentKey in currentConfig)) {\n throw new Error(\n `A '${this.configPath}' file that was not generated by jsii is in ${this.options.projectInfo.projectRoot}. Aborting instead of overwriting.`,\n );\n }\n }\n\n const outputConfig = {\n ...this.typescriptConfig,\n compilerOptions: {\n ...this.typescriptConfig?.compilerOptions,\n lib: this.typescriptConfig?.compilerOptions?.lib?.map((lib) =>\n // Drop the \"lib.\" prefix and \".d.ts\" suffix before writing up the tsconfig.json file\n lib.slice(4, lib.length - 5),\n ),\n // Re-write the module, targets & jsx to be the JSON format instead of Programmatic API\n module: (this.typescriptConfig?.compilerOptions?.module &&\n ts.ModuleKind[this.typescriptConfig.compilerOptions.module]) as any,\n newLine: newLineForTsconfigJson(this.typescriptConfig?.compilerOptions.newLine),\n target: (this.typescriptConfig?.compilerOptions?.target &&\n ts.ScriptTarget[this.typescriptConfig.compilerOptions.target]) as any,\n jsx: (this.typescriptConfig?.compilerOptions?.jsx &&\n Case.snake(ts.JsxEmit[this.typescriptConfig.compilerOptions.jsx])) as any,\n },\n };\n\n LOG.debug(`Creating or updating ${chalk.blue(this.configPath)}`);\n fs.writeFileSync(this.configPath, JSON.stringify(outputConfig, null, 2), 'utf8');\n\n /**\n * This is annoying - the values expected in the tsconfig.json file are not\n * the same as the enum constant names, or their values. So we need this\n * function to map the \"compiler API version\" to the \"tsconfig.json version\"\n *\n * @param newLine the compiler form of the new line configuration\n *\n * @return the requivalent value to put in tsconfig.json\n */\n function newLineForTsconfigJson(newLine: ts.NewLineKind | undefined) {\n switch (newLine) {\n case ts.NewLineKind.CarriageReturnLineFeed:\n return 'crlf';\n case ts.NewLineKind.LineFeed:\n return 'lf';\n default:\n return undefined;\n }\n }\n }\n\n /**\n * Find all dependencies that look like TypeScript projects.\n *\n * Enumerate all dependencies, if they have a tsconfig.json file with\n * \"composite: true\" we consider them project references.\n *\n * (Note: TypeScript seems to only correctly find transitive project references\n * if there's an \"index\" tsconfig.json of all projects somewhere up the directory\n * tree)\n */\n private findProjectReferences(): string[] {\n const pkg = this.options.projectInfo.packageJson;\n\n const ret = new Array<string>();\n\n const dependencyNames = new Set<string>();\n for (const dependencyMap of [pkg.dependencies, pkg.devDependencies, pkg.peerDependencies]) {\n if (dependencyMap === undefined) {\n continue;\n }\n for (const name of Object.keys(dependencyMap)) {\n dependencyNames.add(name);\n }\n }\n\n for (const tsconfigFile of Array.from(dependencyNames).map((depName) => this.findMonorepoPeerTsconfig(depName))) {\n if (!tsconfigFile) {\n continue;\n }\n\n const { config: tsconfig } = ts.readConfigFile(tsconfigFile, this.system.readFile);\n\n // Add references to any TypeScript package we find that is 'composite' enabled.\n // Make it relative.\n if (tsconfig.compilerOptions?.composite) {\n ret.push(path.relative(this.options.projectInfo.projectRoot, path.dirname(tsconfigFile)));\n } else {\n // Not a composite package--if this package is in a node_modules directory, that is most\n // likely correct, otherwise it is most likely an error (heuristic here, I don't know how to\n // properly check this).\n if (tsconfigFile.includes('node_modules')) {\n LOG.warn('%s: not a composite TypeScript package, but it probably should be', path.dirname(tsconfigFile));\n }\n }\n }\n\n return ret;\n }\n\n /**\n * Find source files using the same mechanism that the TypeScript compiler itself uses.\n *\n * Respects includes/excludes/etc.\n *\n * This makes it so that running 'typescript' and running 'jsii' has the same behavior.\n */\n private determineSources(files: string[]): string[] {\n const ret = new Array<string>();\n\n if (files.length > 0) {\n ret.push(...files);\n } else {\n const parseConfigHost = parseConfigHostFromCompilerHost(this.compilerHost);\n const parsed = ts.parseJsonConfigFileContent(\n this.typescriptConfig,\n parseConfigHost,\n this.options.projectInfo.projectRoot,\n );\n ret.push(...parsed.fileNames);\n }\n\n return ret;\n }\n\n /**\n * Resolve the given dependency name from the current package, and find the associated tsconfig.json location\n *\n * Because we have the following potential directory layout:\n *\n * package/node_modules/some_dependency\n * package/tsconfig.json\n *\n * We resolve symlinks and only find a \"TypeScript\" dependency if doesn't have 'node_modules' in\n * the path after resolving symlinks (i.e., if it's a peer package in the same monorepo).\n *\n * Returns undefined if no such tsconfig could be found.\n */\n private findMonorepoPeerTsconfig(depName: string): string | undefined {\n // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires\n const { builtinModules } = require('node:module');\n if ((builtinModules ?? []).includes(depName)) {\n // Can happen for modules like 'punycode' which are declared as dependency for polyfill purposes\n return undefined;\n }\n\n try {\n const depDir = findDependencyDirectory(depName, this.options.projectInfo.projectRoot);\n\n const dep = path.join(depDir, 'tsconfig.json');\n if (!fs.existsSync(dep)) {\n return undefined;\n }\n\n // Resolve symlinks, to check if this is a monorepo peer\n const dependencyRealPath = fs.realpathSync(dep);\n if (dependencyRealPath.split(path.sep).includes('node_modules')) {\n return undefined;\n }\n\n return dependencyRealPath;\n } catch (e: any) {\n // @types modules cannot be required, for example\n if (['MODULE_NOT_FOUND', 'ERR_PACKAGE_PATH_NOT_EXPORTED'].includes(e.code)) {\n return undefined;\n }\n throw e;\n }\n }\n\n private diagsHaveAbortableErrors(diags: readonly ts.Diagnostic[]) {\n return diags.some(\n (d) =>\n d.category === ts.DiagnosticCategory.Error ||\n (this.options.failOnWarnings && d.category === ts.DiagnosticCategory.Warning),\n );\n }\n}\n\n/**\n * Options for Watch in non-blocking mode.\n *\n * @internal\n */\nexport interface NonBlockingWatchOptions {\n /**\n * Signals non-blocking execution\n */\n readonly nonBlocking: true;\n\n /**\n * Configures the diagnostics reporter\n */\n readonly reportDiagnostics: ts.DiagnosticReporter;\n\n /**\n * Configures the watch status reporter\n */\n readonly reportWatchStatus: ts.WatchStatusReporter;\n\n /**\n * This hook gets invoked when a compilation cycle (complete with Assembler execution) completes.\n */\n readonly compilationComplete: (emitResult: ts.EmitResult) => void;\n}\n\nfunction _pathOfLibraries(host: ts.CompilerHost | ts.WatchCompilerHost<any>): string[] {\n if (!BASE_COMPILER_OPTIONS.lib || BASE_COMPILER_OPTIONS.lib.length === 0) {\n return [];\n }\n const lib = host.getDefaultLibLocation?.();\n if (!lib) {\n throw new Error(\n `Compiler host doesn't have a default library directory available for ${BASE_COMPILER_OPTIONS.lib.join(', ')}`,\n );\n }\n return BASE_COMPILER_OPTIONS.lib.map((name) => path.join(lib, name));\n}\n\nfunction parseConfigHostFromCompilerHost(host: ts.CompilerHost): ts.ParseConfigHost {\n // Copied from upstream\n // https://github.com/Microsoft/TypeScript/blob/9e05abcfd3f8bb3d6775144ede807daceab2e321/src/compiler/program.ts#L3105\n return {\n fileExists: (f) => host.fileExists(f),\n readDirectory(root, extensions, excludes, includes, depth) {\n if (host.readDirectory === undefined) {\n throw new Error(\"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'\");\n }\n return host.readDirectory(root, extensions, excludes, includes, depth);\n },\n readFile: (f) => host.readFile(f),\n useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),\n trace: host.trace ? (s) => host.trace!(s) : undefined,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,kCAAkC;AAClC,+BAA+B;AAC/B,iCAAiC;AACjC,iCAAiC;AAEjC,2CAAwC;A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CAAC,QAAQ,CAAC,CAAC,CAAC;QACjC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,EAAE;QAC3D,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;KACtD,CAAC;AACJ,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as chalk from 'chalk';\nimport * as log4js from 'log4js';\nimport * as ts from 'typescript';\n\nimport { Assembler } from './assembler';\nimport { findDependencyDirectory } from './common/find-utils';\nimport { emitDownleveledDeclarations, TYPES_COMPAT } from './downlevel-dts';\nimport { Emitter } from './emitter';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport { ProjectInfo } from './project-info';\nimport { WARNINGSCODE_FILE_NAME } from './transforms/deprecation-warnings';\nimport { TypeScriptConfig, TypeScriptConfigValidationRuleSet } from './tsconfig';\nimport { BASE_COMPILER_OPTIONS, convertForJson } from './tsconfig/compiler-options';\nimport { TypeScriptConfigValidator } from './tsconfig/tsconfig-validator';\nimport { ValidationError } from './tsconfig/validator';\nimport * as utils from './utils';\n\nconst LOG = log4js.getLogger('jsii/compiler');\nexport const DIAGNOSTICS = 'diagnostics';\nexport const JSII_DIAGNOSTICS_CODE = 9999;\n\nexport interface CompilerOptions {\n /** The information about the project to be built */\n projectInfo: ProjectInfo;\n /** Whether the compiler should watch for changes or just compile once */\n watch?: boolean;\n /** Whether to detect and generate TypeScript project references */\n projectReferences?: boolean;\n /** Whether to fail when a warning is emitted */\n failOnWarnings?: boolean;\n /** Whether to strip deprecated members from emitted artifacts */\n stripDeprecated?: boolean;\n /** The path to an allowlist of FQNs to strip if stripDeprecated is set */\n stripDeprecatedAllowListFile?: string;\n /** Whether to add warnings for deprecated elements */\n addDeprecationWarnings?: boolean;\n /**\n * The name of the tsconfig file to generate.\n * Cannot be used at the same time as `typeScriptConfig`.\n * @default \"tsconfig.json\"\n */\n generateTypeScriptConfig?: string;\n /**\n * The name of the tsconfig file to use.\n * Cannot be used at the same time as `generateTypeScriptConfig`.\n * @default - generate the tsconfig file\n */\n typeScriptConfig?: string;\n /**\n * The ruleset to validate the provided tsconfig file against.\n * Can only be used when `typeScriptConfig` is provided.\n * @default TypeScriptConfigValidationRuleSet.STRICT - if `typeScriptConfig` is provided\n */\n validateTypeScriptConfig?: TypeScriptConfigValidationRuleSet;\n /**\n * Whether to compress the assembly\n * @default false\n */\n compressAssembly?: boolean;\n}\n\nexport class Compiler implements Emitter {\n private readonly system: ts.System;\n private readonly compilerHost: ts.CompilerHost;\n private readonly userProvidedTypeScriptConfig: boolean;\n private readonly tsConfig: TypeScriptConfig;\n private rootFiles: string[] = [];\n private readonly configPath: string;\n private readonly projectRoot: string;\n\n public constructor(private readonly options: CompilerOptions) {\n if (options.generateTypeScriptConfig != null && options.typeScriptConfig != null) {\n throw new Error(\n 'Cannot use `generateTypeScriptConfig` and `typeScriptConfig` together. Provide only one of them.',\n );\n }\n\n this.projectRoot = this.options.projectInfo.projectRoot;\n const configFileName = options.typeScriptConfig ?? options.generateTypeScriptConfig ?? 'tsconfig.json';\n this.configPath = path.join(this.projectRoot, configFileName);\n this.userProvidedTypeScriptConfig = Boolean(options.typeScriptConfig);\n this.tsConfig = this.configureTypeScript();\n\n this.system = {\n ...ts.sys,\n getCurrentDirectory: () => this.projectRoot,\n createDirectory: (pth) => ts.sys.createDirectory(path.resolve(this.projectRoot, pth)),\n deleteFile: ts.sys.deleteFile && ((pth) => ts.sys.deleteFile!(path.join(this.projectRoot, pth))),\n fileExists: (pth) => ts.sys.fileExists(path.resolve(this.projectRoot, pth)),\n getFileSize: ts.sys.getFileSize && ((pth) => ts.sys.getFileSize!(path.resolve(this.projectRoot, pth))),\n readFile: (pth, encoding) => ts.sys.readFile(path.resolve(this.projectRoot, pth), encoding),\n watchFile:\n ts.sys.watchFile &&\n ((pth, callback, pollingInterval, watchOptions) =>\n ts.sys.watchFile!(path.resolve(this.projectRoot, pth), callback, pollingInterval, watchOptions)),\n writeFile: (pth, data, writeByteOrderMark) =>\n ts.sys.writeFile(path.resolve(this.projectRoot, pth), data, writeByteOrderMark),\n };\n\n this.compilerHost = ts.createIncrementalCompilerHost(this.tsConfig.compilerOptions, this.system);\n }\n\n /**\n * Compiles the configured program.\n *\n * @param files can be specified to override the standard source code location logic. Useful for example when testing \"negatives\".\n */\n public emit(...files: string[]): ts.EmitResult {\n this.prepareForBuild(...files);\n return this.buildOnce();\n }\n\n /**\n * Watches for file-system changes and dynamically recompiles the project as needed. In non-blocking mode, this\n * returns the TypeScript watch handle for the application to use.\n *\n * @internal\n */\n public async watch(opts: NonBlockingWatchOptions): Promise<ts.Watch<ts.BuilderProgram>>;\n /**\n * Watches for file-system changes and dynamically recompiles the project as needed. In blocking mode, this results\n * in a never-resolving promise.\n */\n public async watch(): Promise<never>;\n public async watch(opts?: NonBlockingWatchOptions): Promise<ts.Watch<ts.BuilderProgram> | never> {\n this.prepareForBuild();\n\n const host = ts.createWatchCompilerHost(\n this.configPath,\n {\n ...this.tsConfig.compilerOptions,\n noEmitOnError: false,\n },\n this.system,\n ts.createEmitAndSemanticDiagnosticsBuilderProgram,\n opts?.reportDiagnostics,\n opts?.reportWatchStatus,\n this.tsConfig.watchOptions,\n );\n if (!host.getDefaultLibLocation) {\n throw new Error('No default library location was found on the TypeScript compiler host!');\n }\n const orig = host.afterProgramCreate;\n // This is a callback cascade, so it's \"okay\" to return an unhandled promise there. This may\n // cause an unhandled promise rejection warning, but that's not a big deal.\n //\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n host.afterProgramCreate = (builderProgram) => {\n const emitResult = this.consumeProgram(builderProgram.getProgram(), host.getDefaultLibLocation!());\n\n for (const diag of emitResult.diagnostics.filter((d) => d.code === JSII_DIAGNOSTICS_CODE)) {\n utils.logDiagnostic(diag, this.projectRoot);\n }\n\n if (orig) {\n orig.call(host, builderProgram);\n }\n if (opts?.compilationComplete) {\n opts.compilationComplete(emitResult);\n }\n };\n const watch = ts.createWatchProgram(host);\n\n if (opts?.nonBlocking) {\n // In non-blocking mode, returns the handle to the TypeScript watch interface.\n return watch;\n }\n // In blocking mode, returns a never-resolving promise.\n return new Promise<never>(() => null);\n }\n\n /**\n * Prepares the project for build, by creating the necessary configuration\n * file(s), and assigning the relevant root file(s).\n *\n * @param files the files that were specified as input in the CLI invocation.\n */\n private configureTypeScript(): TypeScriptConfig {\n if (this.userProvidedTypeScriptConfig) {\n const config = this.readTypeScriptConfig();\n\n // emit a warning if validation is disabled\n const rules = this.options.validateTypeScriptConfig ?? TypeScriptConfigValidationRuleSet.NONE;\n if (rules === TypeScriptConfigValidationRuleSet.NONE) {\n utils.logDiagnostic(\n JsiiDiagnostic.JSII_4009_DISABLED_TSCONFIG_VALIDATION.create(undefined, this.configPath),\n this.projectRoot,\n );\n }\n\n // validate the user provided config\n if (rules !== TypeScriptConfigValidationRuleSet.NONE) {\n try {\n const validator = new TypeScriptConfigValidator(rules);\n validator.validate({\n ...config,\n // convert the internal format to the user format which is what the validator operates on\n compilerOptions: convertForJson(config.compilerOptions),\n });\n } catch (error: unknown) {\n if (error instanceof ValidationError) {\n utils.logDiagnostic(\n JsiiDiagnostic.JSII_4000_FAILED_TSCONFIG_VALIDATION.create(undefined, this.configPath, error.violations),\n this.projectRoot,\n );\n }\n\n const configName = path.relative(this.projectRoot, this.configPath);\n throw new Error(\n `Failed validation of tsconfig \"compilerOptions\" in \"${configName}\" against rule set \"${rules}\"!`,\n );\n }\n }\n\n return config;\n }\n\n // generated config if none is provided by the user\n return this.buildTypeScriptConfig();\n }\n\n /**\n * Final preparations of the project for build.\n *\n * These are preparations that either\n * - must happen immediately before the build, or\n * - can be different for every build like assigning the relevant root file(s).\n *\n * @param files the files that were specified as input in the CLI invocation.\n */\n private prepareForBuild(...files: string[]) {\n if (!this.userProvidedTypeScriptConfig) {\n this.writeTypeScriptConfig();\n }\n\n this.rootFiles = this.determineSources(files);\n }\n\n /**\n * Do a single build\n */\n private buildOnce(): ts.EmitResult {\n if (!this.compilerHost.getDefaultLibLocation) {\n throw new Error('No default library location was found on the TypeScript compiler host!');\n }\n\n const tsconf = this.tsConfig!;\n\n const prog = ts.createIncrementalProgram({\n rootNames: this.rootFiles.concat(_pathOfLibraries(this.compilerHost)),\n options: tsconf.compilerOptions,\n // Make the references absolute for the compiler\n projectReferences: tsconf.references?.map((ref) => ({\n path: path.resolve(path.dirname(this.configPath), ref.path),\n })),\n host: this.compilerHost,\n });\n\n return this.consumeProgram(prog.getProgram(), this.compilerHost.getDefaultLibLocation());\n }\n\n private consumeProgram(program: ts.Program, stdlib: string): ts.EmitResult {\n const diagnostics = [...ts.getPreEmitDiagnostics(program)];\n let hasErrors = false;\n\n if (!hasErrors && this.diagsHaveAbortableErrors(diagnostics)) {\n hasErrors = true;\n LOG.error('Compilation errors prevented the JSII assembly from being created');\n }\n\n // Do the \"Assembler\" part first because we need some of the analysis done in there\n // to post-process the AST\n const assembler = new Assembler(this.options.projectInfo, this.system, program, stdlib, {\n stripDeprecated: this.options.stripDeprecated,\n stripDeprecatedAllowListFile: this.options.stripDeprecatedAllowListFile,\n addDeprecationWarnings: this.options.addDeprecationWarnings,\n compressAssembly: this.options.compressAssembly,\n });\n\n try {\n const assmEmit = assembler.emit();\n if (!hasErrors && (assmEmit.emitSkipped || this.diagsHaveAbortableErrors(assmEmit.diagnostics))) {\n hasErrors = true;\n LOG.error('Type model errors prevented the JSII assembly from being created');\n }\n\n diagnostics.push(...assmEmit.diagnostics);\n } catch (e: any) {\n diagnostics.push(JsiiDiagnostic.JSII_9997_UNKNOWN_ERROR.createDetached(e));\n hasErrors = true;\n }\n\n // Do the emit, but add in transformers which are going to replace real\n // comments with synthetic ones.\n const emit = program.emit(\n undefined, // targetSourceFile\n undefined, // writeFile\n undefined, // cancellationToken\n undefined, // emitOnlyDtsFiles\n assembler.customTransformers,\n );\n diagnostics.push(...emit.diagnostics);\n\n if (!hasErrors && (emit.emitSkipped || this.diagsHaveAbortableErrors(emit.diagnostics))) {\n hasErrors = true;\n LOG.error('Compilation errors prevented the JSII assembly from being created');\n }\n\n if (!hasErrors) {\n emitDownleveledDeclarations(this.options.projectInfo);\n }\n\n // Some extra validation on the config.\n // Make sure that { \"./.warnings.jsii.js\": \"./.warnings.jsii.js\" } is in the set of\n // exports, if they are specified.\n if (this.options.addDeprecationWarnings && this.options.projectInfo.exports !== undefined) {\n const expected = `./${WARNINGSCODE_FILE_NAME}`;\n const warningsExport = Object.entries(this.options.projectInfo.exports).filter(\n ([k, v]) => k === expected && v === expected,\n );\n\n if (warningsExport.length === 0) {\n hasErrors = true;\n diagnostics.push(JsiiDiagnostic.JSII_0007_MISSING_WARNINGS_EXPORT.createDetached());\n }\n }\n\n return {\n emitSkipped: hasErrors,\n diagnostics: ts.sortAndDeduplicateDiagnostics(diagnostics),\n emittedFiles: emit.emittedFiles,\n };\n }\n\n /**\n * Build the TypeScript config object from jsii config\n *\n * This is the object that will be written to disk\n * unless an existing tsconfig was provided.\n */\n private buildTypeScriptConfig(): TypeScriptConfig {\n let references: string[] | undefined;\n\n const isComposite =\n this.options.projectReferences !== undefined\n ? this.options.projectReferences\n : this.options.projectInfo.projectReferences !== undefined\n ? this.options.projectInfo.projectReferences\n : false;\n if (isComposite) {\n references = this.findProjectReferences();\n }\n\n const pi = this.options.projectInfo;\n\n return {\n compilerOptions: {\n ...pi.tsc,\n ...BASE_COMPILER_OPTIONS,\n // Enable composite mode if project references are enabled\n composite: isComposite,\n // When incremental, configure a tsbuildinfo file\n tsBuildInfoFile: path.join(pi.tsc?.outDir ?? '.', 'tsconfig.tsbuildinfo'),\n },\n include: [pi.tsc?.rootDir != null ? path.join(pi.tsc.rootDir, '**', '*.ts') : path.join('**', '*.ts')],\n exclude: [\n 'node_modules',\n pi.tsc?.outDir != null ? path.resolve(pi.tsc.outDir, TYPES_COMPAT) : TYPES_COMPAT,\n ...(pi.excludeTypescript ?? []),\n ...(pi.tsc?.outDir != null &&\n (pi.tsc?.rootDir == null || path.resolve(pi.tsc.outDir).startsWith(path.resolve(pi.tsc.rootDir) + path.sep))\n ? [path.join(pi.tsc.outDir, '**', '*.ts')]\n : []),\n ],\n // Change the references a little. We write 'originalpath' to the\n // file under the 'path' key, which is the same as what the\n // TypeScript compiler does. Make it relative so that the files are\n // movable. Not strictly required but looks better.\n references: references?.map((p) => ({ path: p })),\n };\n }\n\n /**\n * Load the TypeScript config object from a provided file\n */\n private readTypeScriptConfig(): TypeScriptConfig {\n const projectRoot = this.options.projectInfo.projectRoot;\n const { config, error } = ts.readConfigFile(this.configPath, ts.sys.readFile);\n if (error) {\n utils.logDiagnostic(error, projectRoot);\n throw new Error(`Failed to load tsconfig at ${this.configPath}`);\n }\n const extended = ts.parseJsonConfigFileContent(config, ts.sys, projectRoot);\n // the tsconfig parser adds this in, but it is not an expected compilerOption\n delete extended.options.configFilePath;\n\n return {\n compilerOptions: extended.options,\n watchOptions: extended.watchOptions,\n };\n }\n\n /**\n * Creates a `tsconfig.json` file to improve the IDE experience.\n *\n * @return the fully qualified path to the `tsconfig.json` file\n */\n private writeTypeScriptConfig(): void {\n const commentKey = '_generated_by_jsii_';\n const commentValue = 'Generated by jsii - safe to delete, and ideally should be in .gitignore';\n\n (this.tsConfig as any)[commentKey] = commentValue;\n\n if (fs.existsSync(this.configPath)) {\n const currentConfig = JSON.parse(fs.readFileSync(this.configPath, 'utf-8'));\n if (!(commentKey in currentConfig)) {\n throw new Error(\n `A '${this.configPath}' file that was not generated by jsii is in ${this.options.projectInfo.projectRoot}. Aborting instead of overwriting.`,\n );\n }\n }\n\n const outputConfig = {\n ...this.tsConfig,\n compilerOptions: convertForJson(this.tsConfig?.compilerOptions),\n };\n\n LOG.debug(`Creating or updating ${chalk.blue(this.configPath)}`);\n fs.writeFileSync(this.configPath, JSON.stringify(outputConfig, null, 2), 'utf8');\n }\n\n /**\n * Find all dependencies that look like TypeScript projects.\n *\n * Enumerate all dependencies, if they have a tsconfig.json file with\n * \"composite: true\" we consider them project references.\n *\n * (Note: TypeScript seems to only correctly find transitive project references\n * if there's an \"index\" tsconfig.json of all projects somewhere up the directory\n * tree)\n */\n private findProjectReferences(): string[] {\n const pkg = this.options.projectInfo.packageJson;\n\n const ret = new Array<string>();\n\n const dependencyNames = new Set<string>();\n for (const dependencyMap of [pkg.dependencies, pkg.devDependencies, pkg.peerDependencies]) {\n if (dependencyMap === undefined) {\n continue;\n }\n for (const name of Object.keys(dependencyMap)) {\n dependencyNames.add(name);\n }\n }\n\n for (const tsconfigFile of Array.from(dependencyNames).map((depName) => this.findMonorepoPeerTsconfig(depName))) {\n if (!tsconfigFile) {\n continue;\n }\n\n const { config: tsconfig } = ts.readConfigFile(tsconfigFile, this.system.readFile);\n\n // Add references to any TypeScript package we find that is 'composite' enabled.\n // Make it relative.\n if (tsconfig.compilerOptions?.composite) {\n ret.push(path.relative(this.options.projectInfo.projectRoot, path.dirname(tsconfigFile)));\n } else {\n // Not a composite package--if this package is in a node_modules directory, that is most\n // likely correct, otherwise it is most likely an error (heuristic here, I don't know how to\n // properly check this).\n if (tsconfigFile.includes('node_modules')) {\n LOG.warn('%s: not a composite TypeScript package, but it probably should be', path.dirname(tsconfigFile));\n }\n }\n }\n\n return ret;\n }\n\n /**\n * Find source files using the same mechanism that the TypeScript compiler itself uses.\n *\n * Respects includes/excludes/etc.\n *\n * This makes it so that running 'typescript' and running 'jsii' has the same behavior.\n */\n private determineSources(files: string[]): string[] {\n const ret = new Array<string>();\n\n if (files.length > 0) {\n ret.push(...files);\n } else {\n const parseConfigHost = parseConfigHostFromCompilerHost(this.compilerHost);\n const parsed = ts.parseJsonConfigFileContent(\n this.tsConfig,\n parseConfigHost,\n this.options.projectInfo.projectRoot,\n );\n ret.push(...parsed.fileNames);\n }\n\n return ret;\n }\n\n /**\n * Resolve the given dependency name from the current package, and find the associated tsconfig.json location\n *\n * Because we have the following potential directory layout:\n *\n * package/node_modules/some_dependency\n * package/tsconfig.json\n *\n * We resolve symlinks and only find a \"TypeScript\" dependency if doesn't have 'node_modules' in\n * the path after resolving symlinks (i.e., if it's a peer package in the same monorepo).\n *\n * Returns undefined if no such tsconfig could be found.\n */\n private findMonorepoPeerTsconfig(depName: string): string | undefined {\n // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires\n const { builtinModules } = require('node:module');\n if ((builtinModules ?? []).includes(depName)) {\n // Can happen for modules like 'punycode' which are declared as dependency for polyfill purposes\n return undefined;\n }\n\n try {\n const depDir = findDependencyDirectory(depName, this.options.projectInfo.projectRoot);\n\n const dep = path.join(depDir, 'tsconfig.json');\n if (!fs.existsSync(dep)) {\n return undefined;\n }\n\n // Resolve symlinks, to check if this is a monorepo peer\n const dependencyRealPath = fs.realpathSync(dep);\n if (dependencyRealPath.split(path.sep).includes('node_modules')) {\n return undefined;\n }\n\n return dependencyRealPath;\n } catch (e: any) {\n // @types modules cannot be required, for example\n if (['MODULE_NOT_FOUND', 'ERR_PACKAGE_PATH_NOT_EXPORTED'].includes(e.code)) {\n return undefined;\n }\n throw e;\n }\n }\n\n private diagsHaveAbortableErrors(diags: readonly ts.Diagnostic[]) {\n return diags.some(\n (d) =>\n d.category === ts.DiagnosticCategory.Error ||\n (this.options.failOnWarnings && d.category === ts.DiagnosticCategory.Warning),\n );\n }\n}\n\n/**\n * Options for Watch in non-blocking mode.\n *\n * @internal\n */\nexport interface NonBlockingWatchOptions {\n /**\n * Signals non-blocking execution\n */\n readonly nonBlocking: true;\n\n /**\n * Configures the diagnostics reporter\n */\n readonly reportDiagnostics: ts.DiagnosticReporter;\n\n /**\n * Configures the watch status reporter\n */\n readonly reportWatchStatus: ts.WatchStatusReporter;\n\n /**\n * This hook gets invoked when a compilation cycle (complete with Assembler execution) completes.\n */\n readonly compilationComplete: (emitResult: ts.EmitResult) => void;\n}\n\nfunction _pathOfLibraries(host: ts.CompilerHost | ts.WatchCompilerHost<any>): string[] {\n if (!BASE_COMPILER_OPTIONS.lib || BASE_COMPILER_OPTIONS.lib.length === 0) {\n return [];\n }\n const lib = host.getDefaultLibLocation?.();\n if (!lib) {\n throw new Error(\n `Compiler host doesn't have a default library directory available for ${BASE_COMPILER_OPTIONS.lib.join(', ')}`,\n );\n }\n return BASE_COMPILER_OPTIONS.lib.map((name) => path.join(lib, name));\n}\n\nfunction parseConfigHostFromCompilerHost(host: ts.CompilerHost): ts.ParseConfigHost {\n // Copied from upstream\n // https://github.com/Microsoft/TypeScript/blob/9e05abcfd3f8bb3d6775144ede807daceab2e321/src/compiler/program.ts#L3105\n return {\n fileExists: (f) => host.fileExists(f),\n readDirectory(root, extensions, excludes, includes, depth) {\n if (host.readDirectory === undefined) {\n throw new Error(\"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'\");\n }\n return host.readDirectory(root, extensions, excludes, includes, depth);\n },\n readFile: (f) => host.readFile(f),\n useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),\n trace: host.trace ? (s) => host.trace!(s) : undefined,\n };\n}\n"]}
|
package/lib/jsii-diagnostic.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as spec from '@jsii/spec';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
3
|
import { TypeSystemHints } from './docs';
|
|
4
|
+
import { Violation } from './tsconfig/validator';
|
|
4
5
|
/**
|
|
5
6
|
* Descriptors for all valid jsii diagnostic codes.
|
|
6
7
|
*
|
|
@@ -111,6 +112,8 @@ export declare class JsiiDiagnostic implements ts.Diagnostic {
|
|
|
111
112
|
static readonly JSII_3008_STRUCT_PROPS_MUST_BE_READONLY: Code<(propName: string, struct: spec.InterfaceType) => string>;
|
|
112
113
|
static readonly JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED: Code<(param: spec.Parameter, nextParam: spec.Parameter) => string>;
|
|
113
114
|
static readonly JSII_3999_INCOHERENT_TYPE_MODEL: Code<(messageText: any) => any>;
|
|
115
|
+
static readonly JSII_4000_FAILED_TSCONFIG_VALIDATION: Code<(config: string, violations: Array<Violation>) => string>;
|
|
116
|
+
static readonly JSII_4009_DISABLED_TSCONFIG_VALIDATION: Code<(config: string) => string>;
|
|
114
117
|
static readonly JSII_5000_JAVA_GETTERS: Code<(badName: string, typeName: string) => string>;
|
|
115
118
|
static readonly JSII_5001_JAVA_SETTERS: Code<(badName: string, typeName: string) => string>;
|
|
116
119
|
static readonly JSII_5002_OVERRIDE_CHANGES_VISIBILITY: Code<(newElement: string, action: string, newValue: 'protected' | 'public', oldValue: 'protected' | 'public') => string>;
|
package/lib/jsii-diagnostic.js
CHANGED
|
@@ -415,7 +415,21 @@ JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL = Code.error({
|
|
|
415
415
|
name: 'type-model/incoherent-type-model',
|
|
416
416
|
});
|
|
417
417
|
//////////////////////////////////////////////////////////////////////////////
|
|
418
|
-
// 4000 => 4999 --
|
|
418
|
+
// 4000 => 4999 -- TYPESCRIPT & JSII CONFIG ERRORS
|
|
419
|
+
JsiiDiagnostic.JSII_4000_FAILED_TSCONFIG_VALIDATION = Code.error({
|
|
420
|
+
code: 4000,
|
|
421
|
+
formatter: (config, violations) => {
|
|
422
|
+
return `Typescript compiler options in "${config}" are not passing validation, found the following rule violations:\n${violations
|
|
423
|
+
.map((v) => ` - ${v.field}: ${v.message}`)
|
|
424
|
+
.join('\n')}`;
|
|
425
|
+
},
|
|
426
|
+
name: 'typescript-config/invalid-tsconfig',
|
|
427
|
+
});
|
|
428
|
+
JsiiDiagnostic.JSII_4009_DISABLED_TSCONFIG_VALIDATION = Code.warning({
|
|
429
|
+
code: 4009,
|
|
430
|
+
formatter: (config) => `Validation of typescript config "${config}" is disabled. This is intended for experimental setups only. Compilation might fail or produce incompatible artifacts.`,
|
|
431
|
+
name: 'typescript-config/disabled-tsconfig-validation',
|
|
432
|
+
});
|
|
419
433
|
//////////////////////////////////////////////////////////////////////////////
|
|
420
434
|
// 5000 => 5999 -- LANGUAGE COMPATIBILITY ERRORS
|
|
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AAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,GAAG,CAAC,CAAC;QAC5D,CAAC;QACD,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;AACH,CAAC;AARD,kDAQC;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 { 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[codeOrName];\n }\n return this.byName[codeOrName];\n }\n\n private static readonly byCode: { [code: number]: Code } = {};\n private static readonly byName: { [name: string]: Code } = {};\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[code] = Code.byName[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 -- RESERVED\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 //////////////////////////////////////////////////////////////////////////////\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 `Unable to resolve type \"${reference}\". It may be @internal or not exported from the module's entry point (as configured in \"package.json\" as \"main\").`,\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":";;;;;;;;;;;;;;;AAAA,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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,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[codeOrName];\n }\n return this.byName[codeOrName];\n }\n\n private static readonly byCode: { [code: number]: Code } = {};\n private static readonly byName: { [name: string]: Code } = {};\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[code] = Code.byName[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, violations: Array<Violation>) => {\n return `Typescript compiler options in \"${config}\" are not passing validation, 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 //////////////////////////////////////////////////////////////////////////////\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 `Unable to resolve type \"${reference}\". It may be @internal or not exported from the module's entry point (as configured in \"package.json\" as \"main\").`,\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"]}
|