jsii 5.4.16-dev.3 → 5.4.16-dev.4

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.
Files changed (45) hide show
  1. package/lib/case.d.ts +0 -1
  2. package/lib/case.js +1 -2
  3. package/lib/case.js.map +1 -1
  4. package/lib/compiler.d.ts +14 -38
  5. package/lib/compiler.js +108 -114
  6. package/lib/compiler.js.map +1 -1
  7. package/lib/jsii-diagnostic.d.ts +0 -3
  8. package/lib/jsii-diagnostic.js +1 -15
  9. package/lib/jsii-diagnostic.js.map +1 -1
  10. package/lib/main.js +2 -45
  11. package/lib/main.js.map +1 -1
  12. package/lib/project-info.d.ts +0 -5
  13. package/lib/project-info.js +0 -13
  14. package/lib/project-info.js.map +1 -1
  15. package/lib/version.d.ts +2 -2
  16. package/lib/version.js +2 -2
  17. package/lib/version.js.map +1 -1
  18. package/package.json +2 -2
  19. package/lib/tsconfig/compiler-options.d.ts +0 -54
  20. package/lib/tsconfig/compiler-options.js +0 -136
  21. package/lib/tsconfig/compiler-options.js.map +0 -1
  22. package/lib/tsconfig/index.d.ts +0 -18
  23. package/lib/tsconfig/index.js +0 -11
  24. package/lib/tsconfig/index.js.map +0 -1
  25. package/lib/tsconfig/rulesets/configurable.d.ts +0 -4
  26. package/lib/tsconfig/rulesets/configurable.js +0 -22
  27. package/lib/tsconfig/rulesets/configurable.js.map +0 -1
  28. package/lib/tsconfig/rulesets/generated.public.d.ts +0 -4
  29. package/lib/tsconfig/rulesets/generated.public.js +0 -28
  30. package/lib/tsconfig/rulesets/generated.public.js.map +0 -1
  31. package/lib/tsconfig/rulesets/incompatible-options.d.ts +0 -4
  32. package/lib/tsconfig/rulesets/incompatible-options.js +0 -11
  33. package/lib/tsconfig/rulesets/incompatible-options.js.map +0 -1
  34. package/lib/tsconfig/rulesets/minimal.public.d.ts +0 -4
  35. package/lib/tsconfig/rulesets/minimal.public.js +0 -11
  36. package/lib/tsconfig/rulesets/minimal.public.js.map +0 -1
  37. package/lib/tsconfig/rulesets/strict.public.d.ts +0 -4
  38. package/lib/tsconfig/rulesets/strict.public.js +0 -29
  39. package/lib/tsconfig/rulesets/strict.public.js.map +0 -1
  40. package/lib/tsconfig/tsconfig-validator.d.ts +0 -16
  41. package/lib/tsconfig/tsconfig-validator.js +0 -46
  42. package/lib/tsconfig/tsconfig-validator.js.map +0 -1
  43. package/lib/tsconfig/validator.d.ts +0 -155
  44. package/lib/tsconfig/validator.js +0 -301
  45. package/lib/tsconfig/validator.js.map +0 -1
package/lib/main.js CHANGED
@@ -10,28 +10,10 @@ const compiler_1 = require("./compiler");
10
10
  const jsii_diagnostic_1 = require("./jsii-diagnostic");
11
11
  const project_info_1 = require("./project-info");
12
12
  const support_1 = require("./support");
13
- const tsconfig_1 = require("./tsconfig");
14
13
  const utils = require("./utils");
15
14
  const version_1 = require("./version");
16
15
  const warnings_1 = require("./warnings");
17
16
  const warningTypes = Object.keys(warnings_1.enabledWarnings);
18
- function choiceWithDesc(choices, desc) {
19
- return {
20
- choices: Object.keys(choices),
21
- desc: [desc, ...Object.entries(choices).map(([choice, docs]) => `${choice}: ${docs}`)].join('\n'),
22
- };
23
- }
24
- var OPTION_GROUP;
25
- (function (OPTION_GROUP) {
26
- OPTION_GROUP["JSII"] = "jsii compiler options:";
27
- OPTION_GROUP["TS"] = "TypeScript config options:";
28
- })(OPTION_GROUP || (OPTION_GROUP = {}));
29
- const ruleSets = {
30
- [tsconfig_1.TypeScriptConfigValidationRuleSet.STRICT]: 'Validates the provided config against a strict rule set designed for maximum backwards-compatibility.',
31
- [tsconfig_1.TypeScriptConfigValidationRuleSet.GENERATED]: 'Enforces a config as created by --generate-tsconfig. Use this to stay compatible with the generated config, but have full ownership over the file.',
32
- [tsconfig_1.TypeScriptConfigValidationRuleSet.MINIMAL]: 'Only enforce options that are known to be incompatible with jsii. This rule set is likely to be incomplete and new rules will be added without notice as incompatibilities emerge.',
33
- [tsconfig_1.TypeScriptConfigValidationRuleSet.NONE]: 'Disables all config validation, including options that are known to be incompatible with jsii. Intended for experimentation only. Use at your own risk.',
34
- };
35
17
  (async () => {
36
18
  await (0, support_1.emitSupportPolicyInformation)();
37
19
  await yargs
@@ -49,10 +31,9 @@ const ruleSets = {
49
31
  desc: 'Watch for file changes and recompile automatically',
50
32
  })
51
33
  .option('project-references', {
52
- group: OPTION_GROUP.JSII,
53
34
  alias: 'r',
54
35
  type: 'boolean',
55
- desc: 'Generate TypeScript project references (also [package.json].jsii.projectReferences)\nHas no effect if --tsconfig is provided',
36
+ desc: 'Generate TypeScript project references (also [package.json].jsii.projectReferences)',
56
37
  })
57
38
  .option('fix-peer-dependencies', {
58
39
  type: 'boolean',
@@ -61,48 +42,30 @@ const ruleSets = {
61
42
  hidden: true,
62
43
  })
63
44
  .options('fail-on-warnings', {
64
- group: OPTION_GROUP.JSII,
65
45
  alias: 'Werr',
66
46
  type: 'boolean',
67
47
  desc: 'Treat warnings as errors',
68
48
  })
69
49
  .option('silence-warnings', {
70
- group: OPTION_GROUP.JSII,
71
50
  type: 'array',
72
51
  default: [],
73
52
  desc: `List of warnings to silence (warnings: ${warningTypes.join(',')})`,
74
53
  })
75
54
  .option('strip-deprecated', {
76
- group: OPTION_GROUP.JSII,
77
55
  type: 'string',
78
56
  desc: '[EXPERIMENTAL] Hides all @deprecated members from the API (implementations remain). If an optional file name is given, only FQNs present in the file will be stripped.',
79
57
  })
80
58
  .option('add-deprecation-warnings', {
81
- group: OPTION_GROUP.JSII,
82
59
  type: 'boolean',
83
60
  default: false,
84
61
  desc: '[EXPERIMENTAL] Injects warning statements for all deprecated elements, to be printed at runtime',
85
62
  })
86
63
  .option('generate-tsconfig', {
87
- group: OPTION_GROUP.TS,
88
64
  type: 'string',
89
- defaultDescription: 'tsconfig.json',
65
+ default: 'tsconfig.json',
90
66
  desc: 'Name of the typescript configuration file to generate with compiler settings',
91
- })
92
- .option('tsconfig', {
93
- group: OPTION_GROUP.TS,
94
- alias: 'c',
95
- type: 'string',
96
- desc: '[EXPERIMENTAL] Use this typescript configuration file to compile the jsii project.',
97
- })
98
- .conflicts('tsconfig', ['generate-tsconfig', 'project-references'])
99
- .option('validate-tsconfig', {
100
- group: OPTION_GROUP.TS,
101
- ...choiceWithDesc(ruleSets, '[EXPERIMENTAL] Validate the provided typescript configuration file against a set of rules.'),
102
- default: tsconfig_1.TypeScriptConfigValidationRuleSet.STRICT,
103
67
  })
104
68
  .option('compress-assembly', {
105
- group: OPTION_GROUP.JSII,
106
69
  type: 'boolean',
107
70
  default: false,
108
71
  desc: 'Emit a compressed version of the assembly',
@@ -114,9 +77,6 @@ const ruleSets = {
114
77
  global: true,
115
78
  }), async (argv) => {
116
79
  _configureLog4js(argv.verbose);
117
- if (argv['generate-tsconfig'] != null && argv.tsconfig != null) {
118
- throw new Error('Options --generate-tsconfig and --tsconfig are mutually exclusive');
119
- }
120
80
  const projectRoot = path.normalize(path.resolve(process.cwd(), argv.PROJECT_ROOT));
121
81
  const { projectInfo, diagnostics: projectInfoDiagnostics } = (0, project_info_1.loadProjectInfo)(projectRoot);
122
82
  // disable all silenced warnings
@@ -135,9 +95,6 @@ const ruleSets = {
135
95
  stripDeprecatedAllowListFile: argv['strip-deprecated'],
136
96
  addDeprecationWarnings: argv['add-deprecation-warnings'],
137
97
  generateTypeScriptConfig: argv['generate-tsconfig'],
138
- typeScriptConfig: argv.tsconfig ?? projectInfo.packageJson.jsii?.tsconfig,
139
- validateTypeScriptConfig: argv['validate-tsconfig'] ??
140
- projectInfo.packageJson.jsii?.validateTsConfig,
141
98
  compressAssembly: argv['compress-assembly'],
142
99
  });
143
100
  const emitResult = argv.watch ? await compiler.watch() : compiler.emit();
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,gCAA8B;AAE9B,kCAAkC;AAClC,kCAAkC;AAClC,iCAAiC;AACjC,0DAA+D;AAC/D,+BAA+B;AAE/B,yCAA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ACzE;aACF;SACF;QACD,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;YACvD,qGAAqG;YACrG,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;gBACnB,SAAS,EAAE,CAAC,aAAa,CAAC;gBAC1B,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;aACzC;SACF;KACF,CAAC,CAAC;IAEH,SAAS,SAAS,CAAC,cAAc,GAAG,SAAS;QAC3C,QAAQ,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC;gBACJ,OAAO,MAAM,CAAC;YAChB,KAAK,CAAC;gBACJ,OAAO,MAAM,CAAC;YAChB,KAAK,CAAC;gBACJ,OAAO,OAAO,CAAC;YACjB,KAAK,CAAC;gBACJ,OAAO,OAAO,CAAC;YACjB;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import '@jsii/check-node/run';\n\nimport * as path from 'node:path';\nimport * as util from 'node:util';\nimport * as log4js from 'log4js';\nimport { version as tsVersion } from 'typescript/package.json';\nimport * as yargs from 'yargs';\n\nimport { Compiler } from './compiler';\nimport { configureCategories } from './jsii-diagnostic';\nimport { loadProjectInfo } from './project-info';\nimport { emitSupportPolicyInformation } from './support';\nimport { TypeScriptConfigValidationRuleSet } from './tsconfig';\nimport * as utils from './utils';\nimport { VERSION } from './version';\nimport { enabledWarnings } from './warnings';\n\nconst warningTypes = Object.keys(enabledWarnings);\n\nfunction choiceWithDesc(\n choices: { [choice: string]: string },\n desc: string,\n): {\n choices: string[];\n desc: string;\n} {\n return {\n choices: Object.keys(choices),\n desc: [desc, ...Object.entries(choices).map(([choice, docs]) => `${choice}: ${docs}`)].join('\\n'),\n };\n}\n\nenum OPTION_GROUP {\n JSII = 'jsii compiler options:',\n TS = 'TypeScript config options:',\n}\n\nconst ruleSets: {\n [choice in TypeScriptConfigValidationRuleSet]: string;\n} = {\n [TypeScriptConfigValidationRuleSet.STRICT]:\n 'Validates the provided config against a strict rule set designed for maximum backwards-compatibility.',\n [TypeScriptConfigValidationRuleSet.GENERATED]:\n 'Enforces a config as created by --generate-tsconfig. Use this to stay compatible with the generated config, but have full ownership over the file.',\n [TypeScriptConfigValidationRuleSet.MINIMAL]:\n 'Only enforce options that are known to be incompatible with jsii. This rule set is likely to be incomplete and new rules will be added without notice as incompatibilities emerge.',\n [TypeScriptConfigValidationRuleSet.NONE]:\n 'Disables all config validation, including options that are known to be incompatible with jsii. Intended for experimentation only. Use at your own risk.',\n};\n\n(async () => {\n await emitSupportPolicyInformation();\n\n await yargs\n .env('JSII')\n .command(\n ['$0 [PROJECT_ROOT]', 'compile [PROJECT_ROOT]'],\n 'Compiles a jsii/TypeScript project',\n (argv) =>\n argv\n .positional('PROJECT_ROOT', {\n type: 'string',\n desc: 'The root of the project to be compiled',\n default: '.',\n normalize: true,\n })\n .option('watch', {\n alias: 'w',\n type: 'boolean',\n desc: 'Watch for file changes and recompile automatically',\n })\n .option('project-references', {\n group: OPTION_GROUP.JSII,\n alias: 'r',\n type: 'boolean',\n desc: 'Generate TypeScript project references (also [package.json].jsii.projectReferences)\\nHas no effect if --tsconfig is provided',\n })\n .option('fix-peer-dependencies', {\n type: 'boolean',\n default: true,\n desc: 'This option no longer has any effect.',\n hidden: true,\n })\n .options('fail-on-warnings', {\n group: OPTION_GROUP.JSII,\n alias: 'Werr',\n type: 'boolean',\n desc: 'Treat warnings as errors',\n })\n .option('silence-warnings', {\n group: OPTION_GROUP.JSII,\n type: 'array',\n default: [],\n desc: `List of warnings to silence (warnings: ${warningTypes.join(',')})`,\n })\n .option('strip-deprecated', {\n group: OPTION_GROUP.JSII,\n type: 'string',\n desc: '[EXPERIMENTAL] Hides all @deprecated members from the API (implementations remain). If an optional file name is given, only FQNs present in the file will be stripped.',\n })\n .option('add-deprecation-warnings', {\n group: OPTION_GROUP.JSII,\n type: 'boolean',\n default: false,\n desc: '[EXPERIMENTAL] Injects warning statements for all deprecated elements, to be printed at runtime',\n })\n .option('generate-tsconfig', {\n group: OPTION_GROUP.TS,\n type: 'string',\n defaultDescription: 'tsconfig.json',\n desc: 'Name of the typescript configuration file to generate with compiler settings',\n })\n .option('tsconfig', {\n group: OPTION_GROUP.TS,\n alias: 'c',\n type: 'string',\n desc: '[EXPERIMENTAL] Use this typescript configuration file to compile the jsii project.',\n })\n .conflicts('tsconfig', ['generate-tsconfig', 'project-references'])\n .option('validate-tsconfig', {\n group: OPTION_GROUP.TS,\n ...choiceWithDesc(\n ruleSets,\n '[EXPERIMENTAL] Validate the provided typescript configuration file against a set of rules.',\n ),\n default: TypeScriptConfigValidationRuleSet.STRICT,\n })\n .option('compress-assembly', {\n group: OPTION_GROUP.JSII,\n type: 'boolean',\n default: false,\n desc: 'Emit a compressed version of the assembly',\n })\n .option('verbose', {\n alias: 'v',\n type: 'count',\n desc: 'Increase the verbosity of output',\n global: true,\n }),\n async (argv) => {\n _configureLog4js(argv.verbose);\n\n if (argv['generate-tsconfig'] != null && argv.tsconfig != null) {\n throw new Error('Options --generate-tsconfig and --tsconfig are mutually exclusive');\n }\n\n const projectRoot = path.normalize(path.resolve(process.cwd(), argv.PROJECT_ROOT));\n\n const { projectInfo, diagnostics: projectInfoDiagnostics } = loadProjectInfo(projectRoot);\n\n // disable all silenced warnings\n for (const key of argv['silence-warnings']) {\n if (!(key in enabledWarnings)) {\n throw new Error(`Unknown warning type ${key as any}. Must be one of: ${warningTypes.join(', ')}`);\n }\n\n enabledWarnings[key] = false;\n }\n\n configureCategories(projectInfo.diagnostics ?? {});\n\n const compiler = new Compiler({\n projectInfo,\n projectReferences: argv['project-references'],\n failOnWarnings: argv['fail-on-warnings'],\n stripDeprecated: argv['strip-deprecated'] != null,\n stripDeprecatedAllowListFile: argv['strip-deprecated'],\n addDeprecationWarnings: argv['add-deprecation-warnings'],\n generateTypeScriptConfig: argv['generate-tsconfig'],\n typeScriptConfig: argv.tsconfig ?? projectInfo.packageJson.jsii?.tsconfig,\n validateTypeScriptConfig:\n (argv['validate-tsconfig'] as TypeScriptConfigValidationRuleSet) ??\n projectInfo.packageJson.jsii?.validateTsConfig,\n compressAssembly: argv['compress-assembly'],\n });\n\n const emitResult = argv.watch ? await compiler.watch() : compiler.emit();\n\n const allDiagnostics = [...projectInfoDiagnostics, ...emitResult.diagnostics];\n\n for (const diagnostic of allDiagnostics) {\n utils.logDiagnostic(diagnostic, projectRoot);\n }\n if (emitResult.emitSkipped) {\n process.exitCode = 1;\n }\n },\n )\n .help()\n .version(`${VERSION}, typescript ${tsVersion}`)\n .parse();\n})().catch((e) => {\n console.error(`Error: ${e.stack}`);\n process.exitCode = -1;\n});\n\nfunction _configureLog4js(verbosity: number) {\n const stderrColor = !!process.stderr.isTTY;\n const stdoutColor = !!process.stdout.isTTY;\n\n log4js.addLayout('passThroughNoColor', () => {\n return (loggingEvent) => utils.stripAnsi(util.format(...loggingEvent.data));\n });\n\n log4js.configure({\n appenders: {\n console: {\n type: 'stderr',\n layout: { type: stderrColor ? 'colored' : 'basic' },\n },\n [utils.DIAGNOSTICS]: {\n type: 'stdout',\n layout: {\n type: stdoutColor ? 'messagePassThrough' : ('passThroughNoColor' as any),\n },\n },\n },\n categories: {\n default: { appenders: ['console'], level: _logLevel() },\n // The diagnostics logger must be set to INFO or more verbose, or watch won't show important messages\n [utils.DIAGNOSTICS]: {\n appenders: ['diagnostics'],\n level: _logLevel(Math.max(verbosity, 1)),\n },\n },\n });\n\n function _logLevel(verbosityLevel = verbosity): keyof log4js.Levels {\n switch (verbosityLevel) {\n case 0:\n return 'WARN';\n case 1:\n return 'INFO';\n case 2:\n return 'DEBUG';\n case 3:\n return 'TRACE';\n default:\n return 'ALL';\n }\n }\n}\n"]}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,gCAA8B;AAE9B,kCAAkC;AAClC,kCA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B,KAAK,CAAC;gBACJ,OAAO,MAAM,CAAC;YAChB,KAAK,CAAC;gBACJ,OAAO,OAAO,CAAC;YACjB,KAAK,CAAC;gBACJ,OAAO,OAAO,CAAC;YACjB;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import '@jsii/check-node/run';\n\nimport * as path from 'node:path';\nimport * as util from 'node:util';\nimport * as log4js from 'log4js';\nimport { version as tsVersion } from 'typescript/package.json';\nimport * as yargs from 'yargs';\n\nimport { Compiler } from './compiler';\nimport { configureCategories } from './jsii-diagnostic';\nimport { loadProjectInfo } from './project-info';\nimport { emitSupportPolicyInformation } from './support';\nimport * as utils from './utils';\nimport { VERSION } from './version';\nimport { enabledWarnings } from './warnings';\n\nconst warningTypes = Object.keys(enabledWarnings);\n\n(async () => {\n await emitSupportPolicyInformation();\n\n await yargs\n .env('JSII')\n .command(\n ['$0 [PROJECT_ROOT]', 'compile [PROJECT_ROOT]'],\n 'Compiles a jsii/TypeScript project',\n (argv) =>\n argv\n .positional('PROJECT_ROOT', {\n type: 'string',\n desc: 'The root of the project to be compiled',\n default: '.',\n normalize: true,\n })\n .option('watch', {\n alias: 'w',\n type: 'boolean',\n desc: 'Watch for file changes and recompile automatically',\n })\n .option('project-references', {\n alias: 'r',\n type: 'boolean',\n desc: 'Generate TypeScript project references (also [package.json].jsii.projectReferences)',\n })\n .option('fix-peer-dependencies', {\n type: 'boolean',\n default: true,\n desc: 'This option no longer has any effect.',\n hidden: true,\n })\n .options('fail-on-warnings', {\n alias: 'Werr',\n type: 'boolean',\n desc: 'Treat warnings as errors',\n })\n .option('silence-warnings', {\n type: 'array',\n default: [],\n desc: `List of warnings to silence (warnings: ${warningTypes.join(',')})`,\n })\n .option('strip-deprecated', {\n type: 'string',\n desc: '[EXPERIMENTAL] Hides all @deprecated members from the API (implementations remain). If an optional file name is given, only FQNs present in the file will be stripped.',\n })\n .option('add-deprecation-warnings', {\n type: 'boolean',\n default: false,\n desc: '[EXPERIMENTAL] Injects warning statements for all deprecated elements, to be printed at runtime',\n })\n .option('generate-tsconfig', {\n type: 'string',\n default: 'tsconfig.json',\n desc: 'Name of the typescript configuration file to generate with compiler settings',\n })\n .option('compress-assembly', {\n type: 'boolean',\n default: false,\n desc: 'Emit a compressed version of the assembly',\n })\n .option('verbose', {\n alias: 'v',\n type: 'count',\n desc: 'Increase the verbosity of output',\n global: true,\n }),\n async (argv) => {\n _configureLog4js(argv.verbose);\n\n const projectRoot = path.normalize(path.resolve(process.cwd(), argv.PROJECT_ROOT));\n\n const { projectInfo, diagnostics: projectInfoDiagnostics } = loadProjectInfo(projectRoot);\n\n // disable all silenced warnings\n for (const key of argv['silence-warnings']) {\n if (!(key in enabledWarnings)) {\n throw new Error(`Unknown warning type ${key as any}. Must be one of: ${warningTypes.join(', ')}`);\n }\n\n enabledWarnings[key] = false;\n }\n\n configureCategories(projectInfo.diagnostics ?? {});\n\n const compiler = new Compiler({\n projectInfo,\n projectReferences: argv['project-references'],\n failOnWarnings: argv['fail-on-warnings'],\n stripDeprecated: argv['strip-deprecated'] != null,\n stripDeprecatedAllowListFile: argv['strip-deprecated'],\n addDeprecationWarnings: argv['add-deprecation-warnings'],\n generateTypeScriptConfig: argv['generate-tsconfig'],\n compressAssembly: argv['compress-assembly'],\n });\n\n const emitResult = argv.watch ? await compiler.watch() : compiler.emit();\n\n const allDiagnostics = [...projectInfoDiagnostics, ...emitResult.diagnostics];\n\n for (const diagnostic of allDiagnostics) {\n utils.logDiagnostic(diagnostic, projectRoot);\n }\n if (emitResult.emitSkipped) {\n process.exitCode = 1;\n }\n },\n )\n .help()\n .version(`${VERSION}, typescript ${tsVersion}`)\n .parse();\n})().catch((e) => {\n console.error(`Error: ${e.stack}`);\n process.exitCode = -1;\n});\n\nfunction _configureLog4js(verbosity: number) {\n const stderrColor = !!process.stderr.isTTY;\n const stdoutColor = !!process.stdout.isTTY;\n\n log4js.addLayout('passThroughNoColor', () => {\n return (loggingEvent) => utils.stripAnsi(util.format(...loggingEvent.data));\n });\n\n log4js.configure({\n appenders: {\n console: {\n type: 'stderr',\n layout: { type: stderrColor ? 'colored' : 'basic' },\n },\n [utils.DIAGNOSTICS]: {\n type: 'stdout',\n layout: {\n type: stdoutColor ? 'messagePassThrough' : ('passThroughNoColor' as any),\n },\n },\n },\n categories: {\n default: { appenders: ['console'], level: _logLevel() },\n // The diagnostics logger must be set to INFO or more verbose, or watch won't show important messages\n [utils.DIAGNOSTICS]: {\n appenders: ['diagnostics'],\n level: _logLevel(Math.max(verbosity, 1)),\n },\n },\n });\n\n function _logLevel(verbosityLevel = verbosity): keyof log4js.Levels {\n switch (verbosityLevel) {\n case 0:\n return 'WARN';\n case 1:\n return 'INFO';\n case 2:\n return 'DEBUG';\n case 3:\n return 'TRACE';\n default:\n return 'ALL';\n }\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import * as spec from '@jsii/spec';
2
2
  import * as ts from 'typescript';
3
- import { TypeScriptConfigValidationRuleSet } from './tsconfig';
4
3
  export type TSCompilerOptions = Partial<Pick<ts.CompilerOptions, 'outDir' | 'rootDir' | 'baseUrl' | 'paths' | 'forceConsistentCasingInFileNames' | 'noImplicitOverride' | 'noPropertyAccessFromIndexSignature' | 'noUncheckedIndexedAccess' | 'declarationMap' | 'inlineSourceMap' | 'inlineSources' | 'sourceMap' | 'types'>>;
5
4
  export interface ProjectInfo {
6
5
  readonly projectRoot: string;
@@ -51,8 +50,6 @@ export interface ProjectInfo {
51
50
  readonly [name: string]: string;
52
51
  };
53
52
  };
54
- readonly tsconfig?: string;
55
- readonly validateTsConfig?: TypeScriptConfigValidationRuleSet;
56
53
  }
57
54
  export interface PackageJson {
58
55
  readonly description?: string;
@@ -105,8 +102,6 @@ export interface PackageJson {
105
102
  readonly [name: string]: unknown;
106
103
  };
107
104
  readonly versionFormat?: 'short' | 'full';
108
- readonly tsconfig?: string;
109
- readonly validateTsConfig?: string;
110
105
  readonly excludeTypescript?: readonly string[];
111
106
  readonly projectReferences?: boolean;
112
107
  readonly tsc?: TSCompilerOptions;
@@ -10,7 +10,6 @@ const semver = require("semver");
10
10
  const ts = require("typescript");
11
11
  const find_utils_1 = require("./common/find-utils");
12
12
  const jsii_diagnostic_1 = require("./jsii-diagnostic");
13
- const tsconfig_1 = require("./tsconfig");
14
13
  const utils_1 = require("./utils");
15
14
  // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
16
15
  const spdx = require('spdx-license-list/simple');
@@ -104,9 +103,6 @@ function loadProjectInfo(projectRoot) {
104
103
  bin: pkg.bin,
105
104
  exports: pkg.exports,
106
105
  diagnostics: _loadDiagnostics(pkg.jsii?.diagnostics),
107
- // user-provided tsconfig
108
- tsconfig: pkg.jsii?.tsconfig,
109
- validateTsConfig: _validateTsConfigRuleSet(pkg.jsii?.validateTsConfig ?? 'strict'),
110
106
  };
111
107
  return { projectInfo, diagnostics };
112
108
  }
@@ -297,15 +293,6 @@ function _validateStability(stability, deprecated) {
297
293
  }
298
294
  return stability;
299
295
  }
300
- function _validateTsConfigRuleSet(ruleSet) {
301
- if (ruleSet == null) {
302
- return undefined;
303
- }
304
- if (!Object.values(tsconfig_1.TypeScriptConfigValidationRuleSet).includes(ruleSet)) {
305
- throw new Error(`Invalid validateTsConfig "${ruleSet}", it must be one of ${Object.values(tsconfig_1.TypeScriptConfigValidationRuleSet).join(', ')}`);
306
- }
307
- return ruleSet;
308
- }
309
296
  /**
310
297
  * Resolves an NPM package specifier to a version range
311
298
  *
@@ -1 +1 @@
1
- {"version":3,"file":"project-info.js","sourceRoot":"","sources":["../src/project-info.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,kCAAkC;AAClC,mCAAmC;AACnC,qCAAoE;AACpE,iCAAiC;AACjC,iCAAiC;AACjC,iCAAiC;AAEjC,oDAA8D;AAC9D,uDAAmD;AACnD,yCAA+D;AAC/D,mCAAuD;AAEvD,qGAAqG;AACrG,MAAM,IAAI,GAAgB,OAAO,CAA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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 }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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 { 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\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 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 readonly excludeTypescript?: readonly string[];\n readonly projectReferences?: boolean;\n readonly tsc?: TSCompilerOptions;\n\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 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\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"]}
package/lib/version.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /** The short version number for this JSII compiler (e.g: `X.Y.Z`) */
2
- export declare const SHORT_VERSION = "5.4.16-dev.3";
2
+ export declare const SHORT_VERSION = "5.4.16-dev.4";
3
3
  /** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
4
- export declare const VERSION = "5.4.16-dev.3 (build 14a51b9)";
4
+ export declare const VERSION = "5.4.16-dev.4 (build 9b93f65)";
5
5
  /** The release line identifier for this JSII compiler (e.g: `X.Y`) */
6
6
  export declare const RELEASE_LINE = "5.4";
7
7
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -4,9 +4,9 @@ exports.RELEASE_LINE = exports.VERSION = exports.SHORT_VERSION = void 0;
4
4
  const typescript_1 = require("typescript");
5
5
  // GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!
6
6
  /** The short version number for this JSII compiler (e.g: `X.Y.Z`) */
7
- exports.SHORT_VERSION = '5.4.16-dev.3';
7
+ exports.SHORT_VERSION = '5.4.16-dev.4';
8
8
  /** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
9
- exports.VERSION = '5.4.16-dev.3 (build 14a51b9)';
9
+ exports.VERSION = '5.4.16-dev.4 (build 9b93f65)';
10
10
  /** The release line identifier for this JSII compiler (e.g: `X.Y`) */
11
11
  exports.RELEASE_LINE = typescript_1.versionMajorMinor;
12
12
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,cAAc,CAAC;AAE5C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,8BAA8B,CAAC;AAEtD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.4.16-dev.3';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.4.16-dev.3 (build 14a51b9)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,cAAc,CAAC;AAE5C,yFAAyF;AAC5E,QAAA,OAAO,GAAG,8BAA8B,CAAC;AAEtD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript'\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.4.16-dev.4';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.4.16-dev.4 (build 9b93f65)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
package/package.json CHANGED
@@ -64,7 +64,7 @@
64
64
  "npm": "^9.9.3",
65
65
  "npm-check-updates": "^16",
66
66
  "prettier": "^2.8.8",
67
- "projen": "^0.81.10",
67
+ "projen": "^0.81.11",
68
68
  "tar": "^6.2.1",
69
69
  "ts-jest": "^29.1.2",
70
70
  "ts-node": "^10.9.2"
@@ -90,7 +90,7 @@
90
90
  "main": "lib/index.js",
91
91
  "license": "Apache-2.0",
92
92
  "homepage": "https://aws.github.io/jsii",
93
- "version": "5.4.16-dev.3",
93
+ "version": "5.4.16-dev.4",
94
94
  "types": "lib/index.d.ts",
95
95
  "exports": {
96
96
  ".": "./lib/index.js",
@@ -1,54 +0,0 @@
1
- import * as ts from 'typescript';
2
- export declare const BASE_COMPILER_OPTIONS: ts.CompilerOptions;
3
- /**
4
- * Helper function to convert a TS enum into a list of allowed values,
5
- * converting everything to camel case.
6
- * This is used for example for the watch options
7
- */
8
- export declare function enumAsCamel(enumData: Record<string, string | number>): string[];
9
- /**
10
- * Helper function to convert a TS enum into a list of allowed values,
11
- * converting everything to lower case.
12
- * This is used for example for the "target" compiler option
13
- */
14
- export declare function enumAsLower(enumData: Record<string, string | number>): string[];
15
- /**
16
- * Helper function to convert a TS enum into a list of allowed values,
17
- * converting everything to kebab case.
18
- * This is used for example for the "jsx" compiler option
19
- */
20
- export declare function enumAsKebab(enumData: Record<string, string | number>): string[];
21
- /**
22
- * The compilerOptions in the programmatic API are slightly differently than the format used in tsconfig.json
23
- * This helper performs the necessary conversion from the programmatic API format the one used in tsconfig.json
24
- *
25
- * @param opt compilerOptions in programmatic API format
26
- * @returns compilerOptions ready to be written on disk
27
- */
28
- export declare function convertForJson(opt: ts.CompilerOptions): ts.CompilerOptions;
29
- /**
30
- * Convert an internal enum value to what a user would write in tsconfig.json
31
- * Possibly using a converter function to adjust casing.
32
- * @param value The internal enum value
33
- * @param enumObj The enum object to convert from
34
- * @param converter The converter function, defaults to lowercase
35
- * @returns The humanized version of the enum value
36
- */
37
- export declare function convertEnumToJson<T>(value: keyof T, enumObj: T, converter?: (value: string) => string): string;
38
- /**
39
- * Convert the internal lib strings to what a user would write in tsconfig.json
40
- * @param input The input libs array
41
- * @returns The humanized version lib array
42
- */
43
- export declare function convertLibForJson(input: string[]): string[];
44
- /**
45
- * This is annoying - the values expected in the tsconfig.json file are not
46
- * the same as the enum constant names, or their values. So we need this
47
- * function to map the "compiler API version" to the "tsconfig.json version"
48
- *
49
- * @param newLine the compiler form of the new line configuration
50
- *
51
- * @return the equivalent value to put in tsconfig.json
52
- */
53
- export declare function convertNewLineForJson(newLine: ts.NewLineKind): string;
54
- //# sourceMappingURL=compiler-options.d.ts.map