jsii 5.9.30 → 5.9.31
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/assembler.js +15 -7
- package/lib/assembler.js.map +1 -1
- package/lib/utils.d.ts +5 -0
- package/lib/utils.js +8 -0
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +2 -2
- package/lib/version.js +2 -2
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
package/lib/utils.d.ts
CHANGED
|
@@ -84,4 +84,9 @@ export declare class JsiiError extends Error {
|
|
|
84
84
|
*/
|
|
85
85
|
constructor(message: string, showHelp?: boolean);
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns the parent namespace of a fully qualified name.
|
|
89
|
+
* E.g. "aws-cdk-lib.aws_s3.Bucket" returns "aws-cdk-lib.aws_s3".
|
|
90
|
+
*/
|
|
91
|
+
export declare function parentFqn(fqn: string): string;
|
|
87
92
|
//# sourceMappingURL=utils.d.ts.map
|
package/lib/utils.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.formatCompilationSummary = formatCompilationSummary;
|
|
|
9
9
|
exports.parsePerson = parsePerson;
|
|
10
10
|
exports.parseRepository = parseRepository;
|
|
11
11
|
exports.stripAnsi = stripAnsi;
|
|
12
|
+
exports.parentFqn = parentFqn;
|
|
12
13
|
const log4js = require("log4js");
|
|
13
14
|
const ts = require("typescript");
|
|
14
15
|
const jsii_diagnostic_1 = require("./jsii-diagnostic");
|
|
@@ -212,4 +213,11 @@ class JsiiError extends Error {
|
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
exports.JsiiError = JsiiError;
|
|
216
|
+
/**
|
|
217
|
+
* Returns the parent namespace of a fully qualified name.
|
|
218
|
+
* E.g. "aws-cdk-lib.aws_s3.Bucket" returns "aws-cdk-lib.aws_s3".
|
|
219
|
+
*/
|
|
220
|
+
function parentFqn(fqn) {
|
|
221
|
+
return fqn.substring(0, fqn.lastIndexOf('.'));
|
|
222
|
+
}
|
|
215
223
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AA2BA,8CA2BC;AAUD,4CAMC;AAYD,8CAyBC;AAED,sCASC;AAKD,4DA0BC;AAWD,kCAgBC;AAGD,0CAkBC;AAMD,8BAEC;AA7MD,iCAAiC;AACjC,iCAAiC;AAEjC,uDAAyD;AACzD,yCAAwC;AAExC;;GAEG;AACU,QAAA,UAAU,GAAG,UAAU,CAAC;AACrC;;GAEG;AACU,QAAA,WAAW,GAAG,aAAa,CAAC;AACzC;;GAEG;AACU,QAAA,qBAAqB,GAAG,IAAI,CAAC;AAE1C;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,UAAyB;IAEzB,QAAQ,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5B,KAAK,EAAE,CAAC,kBAAkB,CAAC,KAAK;YAC9B,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,KAAK,EAAE,CAAC,kBAAkB,CAAC,OAAO;YAChC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,CAAC;gBAC5B,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,EAAE,CAAC,kBAAkB,CAAC,OAAO;YAChC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,KAAK,EAAE,CAAC,kB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AAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;CACF;AAZD,8BAYC","sourcesContent":["import * as log4js from 'log4js';\nimport * as ts from 'typescript';\n\nimport { Code, JsiiDiagnostic } from './jsii-diagnostic';\nimport { isSilenced } from './warnings';\n\n/**\n * Name of the logger for cli errors\n */\nexport const CLI_LOGGER = 'jsii/cli';\n/**\n * Name of the logger for diagnostics information\n */\nexport const DIAGNOSTICS = 'diagnostics';\n/**\n * Diagnostic code for JSII-generated messages.\n */\nexport const JSII_DIAGNOSTICS_CODE = 9999;\n\n/**\n * Obtains the relevant logger to be used for a given diagnostic message.\n *\n * @param logger the ``log4js.Logger`` to use for emitting the message.\n * @param diagnostic the message for which a logger is requested.\n *\n * @returns a logger method of the ``logger`` for the appropriate level.\n */\nexport function diagnosticsLogger(\n logger: log4js.Logger,\n diagnostic: ts.Diagnostic,\n): ((message: any, ...args: any[]) => void) | undefined {\n switch (diagnostic.category) {\n case ts.DiagnosticCategory.Error:\n if (!logger.isErrorEnabled()) {\n return undefined;\n }\n return logger.error.bind(logger);\n case ts.DiagnosticCategory.Warning:\n if (!logger.isWarnEnabled()) {\n return undefined;\n }\n return logger.warn.bind(logger);\n case ts.DiagnosticCategory.Message:\n if (!logger.isDebugEnabled()) {\n return undefined;\n }\n return logger.debug.bind(logger);\n case ts.DiagnosticCategory.Suggestion:\n default:\n if (!logger.isTraceEnabled()) {\n return undefined;\n }\n return logger.trace.bind(logger);\n }\n}\n\n/**\n * Formats a diagnostic message with color and context, if possible.\n *\n * @param diagnostic the diagnostic message ot be formatted.\n * @param projectRoot the root of the TypeScript project.\n *\n * @returns a formatted string.\n */\nexport function formatDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) {\n if (JsiiDiagnostic.isJsiiDiagnostic(diagnostic)) {\n // Ensure we leverage pre-rendered diagnostics where available.\n return diagnostic.format(projectRoot);\n }\n return _formatDiagnostic(diagnostic, projectRoot);\n}\n\n/**\n * Formats a diagnostic message with color and context, if possible. Users\n * should use `formatDiagnostic` instead, as this implementation is intended for\n * internal usafe only.\n *\n * @param diagnostic the diagnostic message ot be formatted.\n * @param projectRoot the root of the TypeScript project.\n *\n * @returns a formatted string.\n */\nexport function _formatDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) {\n const formatDiagnosticsHost: ts.FormatDiagnosticsHost = {\n getCurrentDirectory: () => projectRoot,\n getCanonicalFileName: (fileName) => fileName,\n getNewLine: () => ts.sys.newLine,\n };\n\n const message = ts.formatDiagnosticsWithColorAndContext([diagnostic], formatDiagnosticsHost);\n\n if (!JsiiDiagnostic.isJsiiDiagnostic(diagnostic)) {\n return message;\n }\n\n // This is our own diagnostics, so we'll format appropriately (replacing TS#### with JSII####).\n const formatted = message.replace(` TS${JSII_DIAGNOSTICS_CODE}: `, ` JSII${diagnostic.jsiiCode}: `);\n const diagName = Code.lookup(diagnostic.jsiiCode)?.name;\n if (diagName) {\n // Insert the diagnostic name after the message text on the first line\n const firstNewline = formatted.indexOf('\\n');\n if (firstNewline !== -1) {\n return `${formatted.slice(0, firstNewline)} [${diagName}]${formatted.slice(firstNewline)}`;\n }\n return formatted.trimEnd() + ` [${diagName}]\\n`;\n }\n return formatted;\n}\n\nexport function logDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) {\n if (isSilenced(diagnostic)) {\n return;\n }\n const logFunc = diagnosticsLogger(log4js.getLogger(DIAGNOSTICS), diagnostic);\n if (!logFunc) {\n return;\n }\n logFunc(formatDiagnostic(diagnostic, projectRoot).trim());\n}\n\n/**\n * Format a compilation summary with status line and counts line.\n */\nexport function formatCompilationSummary(\n diagnostics: readonly ts.Diagnostic[],\n emitSkipped: boolean,\n elapsedMs: number,\n): string {\n let errors = 0;\n let warnings = 0;\n let silenced = 0;\n for (const d of diagnostics) {\n if (d.category === ts.DiagnosticCategory.Error) {\n errors++;\n } else if (d.category === ts.DiagnosticCategory.Warning) {\n if (isSilenced(d)) {\n silenced++;\n } else {\n warnings++;\n }\n }\n }\n\n const status = emitSkipped ? '❌ Failed with errors' : warnings > 0 ? '✨ Successful with warnings' : '✨ Successful';\n\n const parts = [`Errors: ${errors}`, `Warnings: ${warnings}${silenced > 0 ? ` (+${silenced} silenced)` : ''}`];\n parts.push(`Time: ${(elapsedMs / 1000).toFixed(2)}s`);\n\n return `\\n${status}\\n${parts.join(' | ')}`;\n}\n\nconst PERSON_REGEX = /^\\s*(.+?)(?:\\s*<([^>]+)>)?(?:\\s*\\(([^)]+)\\))?\\s*$/;\n/**\n * Parses a string-formatted person entry from `package.json`.\n * @param value the string-formatted person entry.\n *\n * @example\n * parsePerson(\"Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)\");\n * // => { name: \"Barney Rubble\", email: \"b@rubble.com\", url: \"http://barnyrubble.tumblr.com/\" }\n */\nexport function parsePerson(value: string) {\n const match = PERSON_REGEX.exec(value);\n if (!match) {\n throw new JsiiError(`Invalid stringified \"person\" value: ${value}`);\n }\n const [, name, email, url] = match;\n const result: { name: string; email?: string; url?: string } = {\n name: name.trim(),\n };\n if (email) {\n result.email = email.trim();\n }\n if (url) {\n result.url = url.trim();\n }\n return result;\n}\n\nconst REPOSITORY_REGEX = /^(?:(github|gist|bitbucket|gitlab):)?([A-Za-z\\d_-]+\\/[A-Za-z\\d_-]+)$/;\nexport function parseRepository(value: string): { url: string } {\n const match = REPOSITORY_REGEX.exec(value);\n if (!match) {\n return { url: value };\n }\n const [, host, slug] = match;\n switch (host ?? 'github') {\n case 'github':\n return { url: `https://github.com/${slug}.git` };\n case 'gist':\n return { url: `https://gist.github.com/${slug}.git` };\n case 'bitbucket':\n return { url: `https://bitbucket.org/${slug}.git` };\n case 'gitlab':\n return { url: `https://gitlab.com/${slug}.git` };\n default:\n throw new JsiiError(`Unknown repository hosting service: ${host}`);\n }\n}\n\nconst ANSI_REGEX =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\nexport function stripAnsi(x: string): string {\n return x.replace(ANSI_REGEX, '');\n}\n\n/**\n * Maps the provided type to stip all `readonly` modifiers from its properties.\n */\nexport type Mutable<T> = { -readonly [K in keyof T]: Mutable<T[K]> };\n\n/**\n * Throws an error that is intended as CLI output.\n */\nexport class JsiiError extends Error {\n /**\n * An expected error that can be nicely formatted where needed (e.g. in CLI output)\n * This should only be used for errors that a user can fix themselves.\n *\n * @param message The error message to be printed to the user.\n * @param showHelp Print the help before the error.\n */\n constructor(public override readonly message: string, public readonly showHelp = false) {\n super(message);\n Object.setPrototypeOf(this, JsiiError.prototype);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AA2BA,8CA2BC;AAUD,4CAMC;AAYD,8CAyBC;AAED,sCASC;AAKD,4DA0BC;AAWD,kCAgBC;AAGD,0CAkBC;AAMD,8BAEC;AA4BD,8BAEC;AA3OD,iCAAiC;AACjC,iCAAiC;AAEjC,uDAAyD;AACzD,yCAAwC;AAExC;;GAEG;AACU,QAAA,UAAU,GAAG,UAAU,CAAC;AACrC;;GAEG;AACU,QAAA,WAAW,GAAG,aAAa,CAAC;AACzC;;GAEG;AACU,QAAA,qBAAqB,GAAG,IAAI,CAAC;AAE1C;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,UAAyB;IAEzB,QAAQ,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5B,KAAK,EAAE,CAAC,kBAAkB,CAAC,KAAK;YAC9B,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,KAAK,EAAE,CAAC,kBAAkB,CAAC,OAAO;YAChC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,CAA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hF,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAOD;;GAEG;AACH,MAAa,SAAU,SAAQ,KAAK;IAClC;;;;;;OAMG;IACH,YAAqC,OAAe,EAAkB,WAAW,KAAK;QACpF,KAAK,CAAC,OAAO,CAAC,CAAC;QADoB,YAAO,GAAP,OAAO,CAAQ;QAAkB,aAAQ,GAAR,QAAQ,CAAQ;QAEpF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;CACF;AAZD,8BAYC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import * as log4js from 'log4js';\nimport * as ts from 'typescript';\n\nimport { Code, JsiiDiagnostic } from './jsii-diagnostic';\nimport { isSilenced } from './warnings';\n\n/**\n * Name of the logger for cli errors\n */\nexport const CLI_LOGGER = 'jsii/cli';\n/**\n * Name of the logger for diagnostics information\n */\nexport const DIAGNOSTICS = 'diagnostics';\n/**\n * Diagnostic code for JSII-generated messages.\n */\nexport const JSII_DIAGNOSTICS_CODE = 9999;\n\n/**\n * Obtains the relevant logger to be used for a given diagnostic message.\n *\n * @param logger the ``log4js.Logger`` to use for emitting the message.\n * @param diagnostic the message for which a logger is requested.\n *\n * @returns a logger method of the ``logger`` for the appropriate level.\n */\nexport function diagnosticsLogger(\n logger: log4js.Logger,\n diagnostic: ts.Diagnostic,\n): ((message: any, ...args: any[]) => void) | undefined {\n switch (diagnostic.category) {\n case ts.DiagnosticCategory.Error:\n if (!logger.isErrorEnabled()) {\n return undefined;\n }\n return logger.error.bind(logger);\n case ts.DiagnosticCategory.Warning:\n if (!logger.isWarnEnabled()) {\n return undefined;\n }\n return logger.warn.bind(logger);\n case ts.DiagnosticCategory.Message:\n if (!logger.isDebugEnabled()) {\n return undefined;\n }\n return logger.debug.bind(logger);\n case ts.DiagnosticCategory.Suggestion:\n default:\n if (!logger.isTraceEnabled()) {\n return undefined;\n }\n return logger.trace.bind(logger);\n }\n}\n\n/**\n * Formats a diagnostic message with color and context, if possible.\n *\n * @param diagnostic the diagnostic message ot be formatted.\n * @param projectRoot the root of the TypeScript project.\n *\n * @returns a formatted string.\n */\nexport function formatDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) {\n if (JsiiDiagnostic.isJsiiDiagnostic(diagnostic)) {\n // Ensure we leverage pre-rendered diagnostics where available.\n return diagnostic.format(projectRoot);\n }\n return _formatDiagnostic(diagnostic, projectRoot);\n}\n\n/**\n * Formats a diagnostic message with color and context, if possible. Users\n * should use `formatDiagnostic` instead, as this implementation is intended for\n * internal usafe only.\n *\n * @param diagnostic the diagnostic message ot be formatted.\n * @param projectRoot the root of the TypeScript project.\n *\n * @returns a formatted string.\n */\nexport function _formatDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) {\n const formatDiagnosticsHost: ts.FormatDiagnosticsHost = {\n getCurrentDirectory: () => projectRoot,\n getCanonicalFileName: (fileName) => fileName,\n getNewLine: () => ts.sys.newLine,\n };\n\n const message = ts.formatDiagnosticsWithColorAndContext([diagnostic], formatDiagnosticsHost);\n\n if (!JsiiDiagnostic.isJsiiDiagnostic(diagnostic)) {\n return message;\n }\n\n // This is our own diagnostics, so we'll format appropriately (replacing TS#### with JSII####).\n const formatted = message.replace(` TS${JSII_DIAGNOSTICS_CODE}: `, ` JSII${diagnostic.jsiiCode}: `);\n const diagName = Code.lookup(diagnostic.jsiiCode)?.name;\n if (diagName) {\n // Insert the diagnostic name after the message text on the first line\n const firstNewline = formatted.indexOf('\\n');\n if (firstNewline !== -1) {\n return `${formatted.slice(0, firstNewline)} [${diagName}]${formatted.slice(firstNewline)}`;\n }\n return formatted.trimEnd() + ` [${diagName}]\\n`;\n }\n return formatted;\n}\n\nexport function logDiagnostic(diagnostic: ts.Diagnostic, projectRoot: string) {\n if (isSilenced(diagnostic)) {\n return;\n }\n const logFunc = diagnosticsLogger(log4js.getLogger(DIAGNOSTICS), diagnostic);\n if (!logFunc) {\n return;\n }\n logFunc(formatDiagnostic(diagnostic, projectRoot).trim());\n}\n\n/**\n * Format a compilation summary with status line and counts line.\n */\nexport function formatCompilationSummary(\n diagnostics: readonly ts.Diagnostic[],\n emitSkipped: boolean,\n elapsedMs: number,\n): string {\n let errors = 0;\n let warnings = 0;\n let silenced = 0;\n for (const d of diagnostics) {\n if (d.category === ts.DiagnosticCategory.Error) {\n errors++;\n } else if (d.category === ts.DiagnosticCategory.Warning) {\n if (isSilenced(d)) {\n silenced++;\n } else {\n warnings++;\n }\n }\n }\n\n const status = emitSkipped ? '❌ Failed with errors' : warnings > 0 ? '✨ Successful with warnings' : '✨ Successful';\n\n const parts = [`Errors: ${errors}`, `Warnings: ${warnings}${silenced > 0 ? ` (+${silenced} silenced)` : ''}`];\n parts.push(`Time: ${(elapsedMs / 1000).toFixed(2)}s`);\n\n return `\\n${status}\\n${parts.join(' | ')}`;\n}\n\nconst PERSON_REGEX = /^\\s*(.+?)(?:\\s*<([^>]+)>)?(?:\\s*\\(([^)]+)\\))?\\s*$/;\n/**\n * Parses a string-formatted person entry from `package.json`.\n * @param value the string-formatted person entry.\n *\n * @example\n * parsePerson(\"Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)\");\n * // => { name: \"Barney Rubble\", email: \"b@rubble.com\", url: \"http://barnyrubble.tumblr.com/\" }\n */\nexport function parsePerson(value: string) {\n const match = PERSON_REGEX.exec(value);\n if (!match) {\n throw new JsiiError(`Invalid stringified \"person\" value: ${value}`);\n }\n const [, name, email, url] = match;\n const result: { name: string; email?: string; url?: string } = {\n name: name.trim(),\n };\n if (email) {\n result.email = email.trim();\n }\n if (url) {\n result.url = url.trim();\n }\n return result;\n}\n\nconst REPOSITORY_REGEX = /^(?:(github|gist|bitbucket|gitlab):)?([A-Za-z\\d_-]+\\/[A-Za-z\\d_-]+)$/;\nexport function parseRepository(value: string): { url: string } {\n const match = REPOSITORY_REGEX.exec(value);\n if (!match) {\n return { url: value };\n }\n const [, host, slug] = match;\n switch (host ?? 'github') {\n case 'github':\n return { url: `https://github.com/${slug}.git` };\n case 'gist':\n return { url: `https://gist.github.com/${slug}.git` };\n case 'bitbucket':\n return { url: `https://bitbucket.org/${slug}.git` };\n case 'gitlab':\n return { url: `https://gitlab.com/${slug}.git` };\n default:\n throw new JsiiError(`Unknown repository hosting service: ${host}`);\n }\n}\n\nconst ANSI_REGEX =\n // eslint-disable-next-line no-control-regex\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;\n\nexport function stripAnsi(x: string): string {\n return x.replace(ANSI_REGEX, '');\n}\n\n/**\n * Maps the provided type to stip all `readonly` modifiers from its properties.\n */\nexport type Mutable<T> = { -readonly [K in keyof T]: Mutable<T[K]> };\n\n/**\n * Throws an error that is intended as CLI output.\n */\nexport class JsiiError extends Error {\n /**\n * An expected error that can be nicely formatted where needed (e.g. in CLI output)\n * This should only be used for errors that a user can fix themselves.\n *\n * @param message The error message to be printed to the user.\n * @param showHelp Print the help before the error.\n */\n constructor(public override readonly message: string, public readonly showHelp = false) {\n super(message);\n Object.setPrototypeOf(this, JsiiError.prototype);\n }\n}\n\n/**\n * Returns the parent namespace of a fully qualified name.\n * E.g. \"aws-cdk-lib.aws_s3.Bucket\" returns \"aws-cdk-lib.aws_s3\".\n */\nexport function parentFqn(fqn: string): string {\n return fqn.substring(0, fqn.lastIndexOf('.'));\n}\n"]}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */
|
|
2
|
-
export declare const SHORT_VERSION = "5.9.
|
|
2
|
+
export declare const SHORT_VERSION = "5.9.31";
|
|
3
3
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
|
4
|
-
export declare const VERSION = "5.9.
|
|
4
|
+
export declare const VERSION = "5.9.31 (build 550e607)";
|
|
5
5
|
/** The release line identifier for this JSII compiler (e.g: `X.Y`) */
|
|
6
6
|
export declare const RELEASE_LINE = "5.9";
|
|
7
7
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
|
@@ -4,9 +4,9 @@ exports.RELEASE_LINE = exports.VERSION = exports.SHORT_VERSION = void 0;
|
|
|
4
4
|
const typescript_1 = require("typescript");
|
|
5
5
|
// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!
|
|
6
6
|
/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */
|
|
7
|
-
exports.SHORT_VERSION = '5.9.
|
|
7
|
+
exports.SHORT_VERSION = '5.9.31';
|
|
8
8
|
/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */
|
|
9
|
-
exports.VERSION = '5.9.
|
|
9
|
+
exports.VERSION = '5.9.31 (build 550e607)';
|
|
10
10
|
/** The release line identifier for this JSII compiler (e.g: `X.Y`) */
|
|
11
11
|
exports.RELEASE_LINE = typescript_1.versionMajorMinor;
|
|
12
12
|
//# sourceMappingURL=version.js.map
|
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,QAAQ,CAAC;AAEtC,yFAAyF;AAC5E,QAAA,OAAO,GAAG,wBAAwB,CAAC;AAEhD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.9.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,uFAAuF;AAEvF,qEAAqE;AACxD,QAAA,aAAa,GAAG,QAAQ,CAAC;AAEtC,yFAAyF;AAC5E,QAAA,OAAO,GAAG,wBAAwB,CAAC;AAEhD,sEAAsE;AACzD,QAAA,YAAY,GAAG,8BAAiB,CAAC","sourcesContent":["import { versionMajorMinor } from 'typescript';\n\n// GENERATED: This file is generated by build-tools/code-gen.ts -- Do not edit by hand!\n\n/** The short version number for this JSII compiler (e.g: `X.Y.Z`) */\nexport const SHORT_VERSION = '5.9.31';\n\n/** The qualified version number for this JSII compiler (e.g: `X.Y.Z (build #######)`) */\nexport const VERSION = '5.9.31 (build 550e607)';\n\n/** The release line identifier for this JSII compiler (e.g: `X.Y`) */\nexport const RELEASE_LINE = versionMajorMinor;\n"]}
|