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,CAAC;gBACvC,MAAM;YACR,KAAK,SAAS;gBACZ,QAAQ,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;gBACzC,MAAM;YACR,KAAK,YAAY;gBACf,QAAQ,GAAG,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC;gBAC5C,MAAM;YACR,KAAK,SAAS;gBACZ,QAAQ,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;gBACzC,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,qBAAqB,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,GAAG,CAAC,CAAC;QAC9E,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,eAAe,CAAI,EAAqB,EAAE,SAAmC;IACpF,MAAM,GAAG,GAAsB,EAAE,CAAC;IAClC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9C,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as spec from '@jsii/spec';\nimport { findAssemblyFile, loadAssemblyFromFile } from '@jsii/spec';\nimport * as log4js from 'log4js';\nimport * as semver from 'semver';\nimport * as ts from 'typescript';\n\nimport { findDependencyDirectory } from './common/find-utils';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport { TypeScriptConfigValidationRuleSet } from './tsconfig';\nimport { parsePerson, parseRepository } from './utils';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports\nconst spdx: Set<string> = require('spdx-license-list/simple');\n\nconst LOG = log4js.getLogger('jsii/package-info');\n\nexport type TSCompilerOptions = Partial<\n Pick<\n ts.CompilerOptions,\n // Directory preferences\n | 'outDir'\n | 'rootDir'\n // TypeScript path mapping\n | 'baseUrl'\n | 'paths'\n // Style preferences\n | 'forceConsistentCasingInFileNames'\n | 'noImplicitOverride'\n | 'noPropertyAccessFromIndexSignature'\n | 'noUncheckedIndexedAccess'\n // Source map preferences\n | 'declarationMap'\n | 'inlineSourceMap'\n | 'inlineSources'\n | 'sourceMap'\n // Types limitations\n | 'types'\n >\n>;\n\nexport interface ProjectInfo {\n readonly projectRoot: string;\n readonly packageJson: PackageJson;\n\n readonly name: string;\n readonly version: string;\n readonly author: spec.Person;\n readonly deprecated?: string;\n readonly stability?: spec.Stability;\n readonly license: string;\n readonly repository: {\n readonly type: string;\n readonly url: string;\n readonly directory?: string;\n };\n readonly keywords?: readonly string[];\n\n readonly main: string;\n readonly types: string;\n\n readonly dependencies: { readonly [name: string]: string };\n readonly peerDependencies: { readonly [name: string]: string };\n readonly dependencyClosure: readonly spec.Assembly[];\n readonly bundleDependencies?: { readonly [name: string]: string };\n readonly targets: spec.AssemblyTargets;\n readonly metadata?: { readonly [key: string]: any };\n readonly jsiiVersionFormat: 'short' | 'full';\n readonly diagnostics?: { readonly [code: string]: ts.DiagnosticCategory };\n readonly description?: string;\n readonly homepage?: string;\n readonly contributors?: readonly spec.Person[];\n readonly excludeTypescript: readonly string[];\n readonly projectReferences?: boolean;\n readonly tsc?: TSCompilerOptions;\n readonly bin?: { readonly [name: string]: string };\n readonly exports?: {\n readonly [name: string]: string | { readonly [name: string]: string };\n };\n\n // user-provided tsconfig\n readonly tsconfig?: string;\n readonly validateTsconfig?: TypeScriptConfigValidationRuleSet;\n}\n\nexport interface PackageJson {\n readonly description?: string;\n readonly homepage?: string;\n readonly name?: string;\n readonly version?: string;\n readonly keywords?: readonly string[];\n readonly license?: string;\n readonly private?: boolean;\n\n readonly exports?: { readonly [path: string]: string | { readonly [name: string]: string } };\n readonly main?: string;\n readonly types?: string;\n /**\n * @example { \"<4.0\": { \"*\": [\"ts3.9/*\"] } }\n * @example { \"<4.0\": { \"index.d.ts\": [\"index.ts3-9.d.ts\"] } }\n */\n readonly typesVersions?: {\n readonly [versionRange: string]: { readonly [pattern: string]: readonly string[] };\n };\n\n readonly bin?: { readonly [name: string]: string };\n\n readonly stability?: string;\n readonly deprecated?: string;\n\n readonly dependencies?: { readonly [name: string]: string };\n readonly devDependencies?: { readonly [name: string]: string };\n readonly peerDependencies?: { readonly [name: string]: string };\n\n readonly bundleDependencies?: readonly string[];\n readonly bundledDependencies?: readonly string[];\n\n readonly jsii?: {\n // main jsii config\n readonly diagnostics?: { readonly [id: string]: 'error' | 'warning' | 'suggestion' | 'message' };\n readonly metadata?: { readonly [key: string]: unknown };\n readonly targets?: { readonly [name: string]: unknown };\n readonly versionFormat?: 'short' | 'full';\n\n // Either user-provided config ...\n readonly tsconfig?: string;\n readonly validateTsconfig?: string;\n\n // ... or configure tsc here\n readonly excludeTypescript?: readonly string[];\n readonly projectReferences?: boolean;\n readonly tsc?: TSCompilerOptions;\n\n // unexpected options\n readonly [key: string]: unknown;\n };\n\n readonly [key: string]: unknown;\n}\n\nexport interface ProjectInfoResult {\n readonly projectInfo: ProjectInfo;\n readonly diagnostics: readonly ts.Diagnostic[];\n}\n\nexport function loadProjectInfo(projectRoot: string): ProjectInfoResult {\n const packageJsonPath = path.join(projectRoot, 'package.json');\n const pkg: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n\n const diagnostics: ts.Diagnostic[] = [];\n\n let bundleDependencies: { [name: string]: string } | undefined;\n for (const name of pkg.bundleDependencies ?? pkg.bundledDependencies ?? []) {\n const version = pkg.dependencies?.[name];\n if (!version) {\n throw new Error(\n `The \"package.json\" file has \"${name}\" in \"bundleDependencies\", but it is not declared in \"dependencies\"`,\n );\n }\n\n if (pkg.peerDependencies && name in pkg.peerDependencies) {\n throw new Error(`The \"package.json\" file has \"${name}\" in \"bundleDependencies\", and also in \"peerDependencies\"`);\n }\n\n bundleDependencies = bundleDependencies ?? {};\n bundleDependencies[name] = _resolveVersion(version, projectRoot).version;\n }\n\n // Check peerDependencies are also in devDependencies\n // You need this to write tests properly. There are probably cases where\n // it makes sense to have this different, so most of what this checking\n // produces is warnings, not errors.\n const devDependencies = pkg.devDependencies ?? {};\n for (const [name, rng] of Object.entries(pkg.peerDependencies ?? {})) {\n const range = new semver.Range(_resolveVersion(rng as string, projectRoot).version);\n const minVersion = semver.minVersion(range)?.raw;\n\n if (!(name in devDependencies) || devDependencies[name] !== `${minVersion}`) {\n diagnostics.push(\n JsiiDiagnostic.JSII_0006_MISSING_DEV_DEPENDENCY.createDetached(\n name,\n `${rng as any}`,\n `${minVersion}`,\n `${devDependencies[name]}`,\n ),\n );\n continue;\n }\n }\n\n const bundled = new Set(Object.keys(bundleDependencies ?? {}));\n const dependencies: Record<string, string> = filterDictByKey(\n pkg.dependencies ?? {},\n (depName) => !bundled.has(depName),\n );\n const peerDependencies: Record<string, string> = pkg.peerDependencies ?? {};\n\n const resolver = new DependencyResolver();\n const resolved = resolver.discoverDependencyTree(projectRoot, {\n ...dependencies,\n ...peerDependencies,\n });\n const transitiveDependencies = resolver.assemblyClosure(resolved);\n\n const metadata = mergeMetadata(\n {\n jsii: {\n pacmak: {\n // When `true`, `jsii-pacmak` will use the `Jsii$Default` implementation in code generation even for dependencies.\n hasDefaultInterfaces: true,\n },\n },\n },\n pkg.jsii?.metadata,\n );\n\n const projectInfo: ProjectInfo = {\n projectRoot,\n packageJson: pkg,\n\n name: _required(pkg.name, 'The \"package.json\" file must specify the \"name\" attribute'),\n version: _required(pkg.version, 'The \"package.json\" file must specify the \"version\" attribute'),\n deprecated: pkg.deprecated,\n stability: _validateStability(pkg.stability, pkg.deprecated),\n author: _toPerson(_required(pkg.author, 'The \"package.json\" file must specify the \"author\" attribute'), 'author'),\n repository: _toRepository(\n _required(pkg.repository, 'The \"package.json\" file must specify the \"repository\" attribute'),\n ),\n license: _validateLicense(pkg.license),\n keywords: pkg.keywords,\n\n main: _required(pkg.main, 'The \"package.json\" file must specify the \"main\" attribute'),\n types: _required(pkg.types, 'The \"package.json\" file must specify the \"types\" attribute'),\n\n dependencies,\n peerDependencies,\n dependencyClosure: transitiveDependencies,\n bundleDependencies,\n targets: {\n ..._required(pkg.jsii, 'The \"package.json\" file must specify the \"jsii\" attribute').targets,\n js: { npm: pkg.name },\n },\n metadata,\n jsiiVersionFormat: _validateVersionFormat(pkg.jsii?.versionFormat ?? 'full'),\n\n description: pkg.description,\n homepage: pkg.homepage,\n contributors: (pkg.contributors as any[])?.map((contrib, index) =>\n _toPerson(contrib, `contributors[${index}]`, 'contributor'),\n ),\n\n excludeTypescript: pkg.jsii?.excludeTypescript ?? [],\n projectReferences: pkg.jsii?.projectReferences,\n tsc: {\n outDir: pkg.jsii?.tsc?.outDir,\n rootDir: pkg.jsii?.tsc?.rootDir,\n baseUrl: pkg.jsii?.tsc?.baseUrl,\n paths: pkg.jsii?.tsc?.paths,\n forceConsistentCasingInFileNames: pkg.jsii?.tsc?.forceConsistentCasingInFileNames,\n noImplicitOverride: pkg.jsii?.tsc?.noImplicitOverride,\n noPropertyAccessFromIndexSignature: pkg.jsii?.tsc?.noPropertyAccessFromIndexSignature,\n noUncheckedIndexedAccess: pkg.jsii?.tsc?.noUncheckedIndexedAccess,\n ..._sourceMapPreferences(pkg.jsii?.tsc),\n types: pkg.jsii?.tsc?.types,\n },\n bin: pkg.bin,\n exports: pkg.exports,\n diagnostics: _loadDiagnostics(pkg.jsii?.diagnostics),\n\n // user-provided tsconfig\n tsconfig: pkg.jsii?.tsconfig,\n validateTsconfig: _validateTsconfigRuleSet(pkg.jsii?.validateTsconfig ?? 'strict'),\n };\n return { projectInfo, diagnostics };\n}\n\nfunction _guessRepositoryType(url: string): string {\n if (url.endsWith('.git')) {\n return 'git';\n }\n const parts = /^([^:]+):\\/\\//.exec(url);\n if (parts?.[1] !== 'http' && parts?.[1] !== 'https') {\n return parts![1];\n }\n throw new Error(`The \"package.json\" file must specify the \"repository.type\" attribute (could not guess from ${url})`);\n}\n\nfunction _sourceMapPreferences({ declarationMap, inlineSourceMap, inlineSources, sourceMap }: TSCompilerOptions = {}) {\n // If none of the options are specified, use the default configuration from jsii <= 1.58.0, which\n // means inline source maps with embedded source information.\n if (declarationMap == null && inlineSourceMap == null && inlineSources == null && sourceMap == null) {\n declarationMap = false;\n inlineSourceMap = true;\n inlineSources = true;\n sourceMap = undefined;\n }\n\n return {\n declarationMap,\n inlineSourceMap,\n inlineSources,\n sourceMap,\n };\n}\n\ninterface DependencyInfo {\n readonly assembly: spec.Assembly;\n readonly resolvedDependencies: Record<string, string>;\n}\n\nclass DependencyResolver {\n private readonly cache = new Map<string, DependencyInfo>();\n\n /**\n * Discover the dependency tree starting at 'root', validating versions as we go along\n *\n * This primes the data structures in this class and should be called first.\n *\n * Return the resolved jsii dependency paths\n */\n public discoverDependencyTree(root: string, dependencies: Record<string, string>): Record<string, string> {\n const ret: Record<string, string> = {};\n for (const [name, declaration] of Object.entries(dependencies)) {\n // eslint-disable-next-line no-await-in-loop\n let resolved;\n try {\n resolved = this.resolveDependency(root, name, declaration);\n } catch (e) {\n LOG.error(\n `Unable to find a JSII dependency named \"${name}\" as \"${declaration}\". If you meant to include a non-JSII dependency, try adding it to bundledDependencies instead.`,\n );\n throw e;\n }\n\n const actualVersion = resolved.dependencyInfo.assembly.version;\n if (!semver.satisfies(actualVersion, declaration)) {\n throw new Error(\n `Declared dependency on version ${declaration} of ${name}, but version ${actualVersion} was found`,\n );\n }\n\n ret[name] = resolved.resolvedFile;\n }\n return ret;\n }\n\n /**\n * From a set of resolved paths, recursively return all assemblies\n */\n public assemblyClosure(resolved: Record<string, string>): spec.Assembly[] {\n const closure = new Map<string, spec.Assembly>();\n const queue = Array.from(Object.values(resolved));\n while (queue.length > 0) {\n const next = queue.shift()!;\n const depInfo = this.cache.get(next);\n if (!depInfo) {\n throw new Error(`Path ${next} not seen before`);\n }\n if (closure.has(next)) {\n continue;\n }\n\n closure.set(next, depInfo.assembly);\n queue.push(...Object.values(depInfo.resolvedDependencies));\n }\n return Array.from(closure.values());\n }\n\n private resolveDependency(root: string, name: string, declaration: string) {\n const { version: versionString, localPackage } = _resolveVersion(declaration, root);\n const version = new semver.Range(versionString);\n if (!version) {\n throw new Error(`Invalid semver expression for ${name}: ${versionString}`);\n }\n const jsiiFile = _tryResolveAssembly(name, localPackage, root);\n LOG.debug(`Resolved dependency ${name} to ${jsiiFile}`);\n return {\n resolvedVersion: versionString,\n resolvedFile: jsiiFile,\n dependencyInfo: this.loadAssemblyAndRecurse(jsiiFile),\n };\n }\n\n private loadAssemblyAndRecurse(jsiiFile: string) {\n // Only recurse if we haven't seen this assembly yet\n if (this.cache.has(jsiiFile)) {\n return this.cache.get(jsiiFile)!;\n }\n\n const assembly = loadAssemblyFromFile(jsiiFile);\n\n // Continue loading any dependencies declared in the asm\n const resolvedDependencies = assembly.dependencies\n ? this.discoverDependencyTree(path.dirname(jsiiFile), assembly.dependencies)\n : {};\n\n const depInfo: DependencyInfo = {\n assembly,\n resolvedDependencies,\n };\n this.cache.set(jsiiFile, depInfo);\n return depInfo;\n }\n}\n\nfunction _required<T>(value: T | undefined, message: string): T {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\n\nfunction _toPerson(value: any, field: string, defaultRole: string = field): spec.Person {\n if (typeof value === 'string') {\n value = parsePerson(value);\n }\n return {\n name: _required(value.name, `The \"package.json\" file must specify the \"${field}.name\" attribute`),\n roles: value.roles ? [...new Set(value.roles as string[])] : [defaultRole],\n email: value.email,\n url: value.url,\n organization: value.organization ? value.organization : undefined,\n };\n}\n\nfunction _toRepository(value: any): {\n type: string;\n url: string;\n directory?: string;\n} {\n if (typeof value === 'string') {\n value = parseRepository(value);\n }\n return {\n url: _required(value.url, 'The \"package.json\" file must specify the \"repository.url\" attribute'),\n type: value.type || _guessRepositoryType(value.url),\n directory: value.directory,\n };\n}\n\nfunction _tryResolveAssembly(mod: string, localPackage: string | undefined, searchPath: string): string {\n if (localPackage) {\n const result = findAssemblyFile(localPackage);\n if (!fs.existsSync(result)) {\n throw new Error(`Assembly does not exist: ${result}`);\n }\n return result;\n }\n try {\n const dependencyDir = findDependencyDirectory(mod, searchPath);\n return findAssemblyFile(dependencyDir);\n } catch (e: any) {\n throw new Error(\n `Unable to locate jsii assembly for \"${mod}\". If this module is not jsii-enabled, it must also be declared under bundledDependencies: ${e}`,\n );\n }\n}\n\nfunction _validateLicense(id: string | undefined): string {\n if (id == null) {\n throw new Error(\n 'No \"license\" was specified in \"package.json\", see valid license identifiers at https://spdx.org/licenses/',\n );\n }\n if (id === 'UNLICENSED') {\n return id;\n }\n if (!spdx.has(id)) {\n throw new Error(`Invalid license identifier \"${id}\", see valid license identifiers at https://spdx.org/licenses/`);\n }\n return id;\n}\n\nfunction _validateVersionFormat(format: string): 'short' | 'full' {\n if (format !== 'short' && format !== 'full') {\n throw new Error(`Invalid jsii.versionFormat \"${format}\", it must be either \"short\" or \"full\" (the default)`);\n }\n return format;\n}\n\nfunction _validateStability(stability: string | undefined, deprecated: string | undefined): spec.Stability | undefined {\n if (!stability && deprecated) {\n stability = spec.Stability.Deprecated;\n } else if (deprecated && stability !== spec.Stability.Deprecated) {\n console.warn(\n `Package is deprecated (${deprecated}), but it's stability is ${stability} and not ${spec.Stability.Deprecated}`,\n );\n }\n if (!stability) {\n return undefined;\n }\n if (!Object.values(spec.Stability).includes(stability as any)) {\n throw new Error(`Invalid stability \"${stability}\", it must be one of ${Object.values(spec.Stability).join(', ')}`);\n }\n return stability as spec.Stability;\n}\n\nfunction _validateTsconfigRuleSet(ruleSet: string): TypeScriptConfigValidationRuleSet | undefined {\n if (ruleSet == null) {\n return undefined;\n }\n if (!Object.values(TypeScriptConfigValidationRuleSet).includes(ruleSet as any)) {\n throw new Error(\n `Invalid validateTsconfig \"${ruleSet}\", it must be one of ${Object.values(TypeScriptConfigValidationRuleSet).join(\n ', ',\n )}`,\n );\n }\n\n return ruleSet as TypeScriptConfigValidationRuleSet;\n}\n\n/**\n * Resolves an NPM package specifier to a version range\n *\n * If it was already a version range, return it. If it the\n * package references a local file, return the version that\n * package is at.\n */\nfunction _resolveVersion(dep: string, searchPath: string): { version: string; localPackage?: string } {\n const matches = /^file:(.+)$/.exec(dep);\n if (!matches) {\n return { version: dep };\n }\n const localPackage = path.resolve(searchPath, matches[1]);\n return {\n // Rendering as a caret version to maintain uniformity against the \"standard\".\n // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires\n version: `^${JSON.parse(fs.readFileSync(path.join(localPackage, 'package.json'), 'utf-8')).version}`,\n localPackage,\n };\n}\n\n/**\n * Merges two metadata blocks together.\n *\n * @param base the base values\n * @param user the user-supplied values, which can override the `base` values\n *\n * @returns the merged metadata block\n */\nfunction mergeMetadata(\n base: NonNullable<ProjectInfo['metadata']>,\n user: ProjectInfo['metadata'],\n): ProjectInfo['metadata'] {\n if (user == null) {\n return base;\n }\n return mergeObjects(base, user);\n\n function mergeObjects(baseObj: Record<string, any>, override: Record<string, any>): Record<string, any> {\n const result: Record<string, any> = {};\n const allKeys = Array.from(new Set([...Object.keys(baseObj), ...Object.keys(override)])).sort();\n for (const key of allKeys) {\n const baseValue = baseObj[key];\n const overrideValue = override[key];\n\n if (typeof baseValue === 'object' && typeof overrideValue === 'object') {\n if (overrideValue != null) {\n result[key] = mergeObjects(baseValue, overrideValue);\n }\n } else {\n result[key] = overrideValue ?? baseValue;\n }\n }\n return result;\n }\n}\n\nfunction _loadDiagnostics(entries?: { [key: string]: string }):\n | {\n readonly [key: string]: ts.DiagnosticCategory;\n }\n | undefined {\n if (entries === undefined || Object.keys(entries).length === 0) {\n return undefined;\n }\n const result: { [key: string]: ts.DiagnosticCategory } = {};\n for (const code of Object.keys(entries)) {\n let category: ts.DiagnosticCategory;\n switch (entries[code].trim().toLowerCase()) {\n case 'error':\n category = ts.DiagnosticCategory.Error;\n break;\n case 'warning':\n category = ts.DiagnosticCategory.Warning;\n break;\n case 'suggestion':\n category = ts.DiagnosticCategory.Suggestion;\n break;\n case 'message':\n category = ts.DiagnosticCategory.Message;\n break;\n default:\n throw new Error(`Invalid category '${entries[code]}' for code '${code}'`);\n }\n result[code] = category;\n }\n return result;\n}\n\nfunction filterDictByKey<A>(xs: Record<string, A>, predicate: (key: string) => boolean): Record<string, A> {\n const ret: Record<string, A> = {};\n for (const [key, value] of Object.entries(xs)) {\n if (predicate(key)) {\n ret[key] = value;\n }\n }\n return ret;\n}\n"]}
\No newline at end of file