jsii-rosetta 5.4.12 → 5.4.14
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/languages/python.d.ts +1 -1
- package/lib/languages/record-references.d.ts +1 -1
- package/lib/languages/target-language.d.ts +6 -0
- package/lib/languages/target-language.js +2 -7
- package/lib/languages/target-language.js.map +1 -1
- package/lib/languages/visualize.d.ts +1 -1
- package/package.json +1 -1
|
@@ -75,7 +75,7 @@ export declare class PythonVisitor extends DefaultVisitor<PythonLanguageContext>
|
|
|
75
75
|
* existing cached translations.
|
|
76
76
|
*/
|
|
77
77
|
static readonly VERSION = "2";
|
|
78
|
-
readonly language = TargetLanguage.
|
|
78
|
+
readonly language = TargetLanguage.PYTHON;
|
|
79
79
|
readonly defaultContext: {};
|
|
80
80
|
/**
|
|
81
81
|
* Keep track of module imports we've seen, so that if we need to render a type we can pick from these modules
|
|
@@ -14,7 +14,7 @@ type RecordReferencesRenderer = AstRenderer<RecordReferencesContext>;
|
|
|
14
14
|
export declare class RecordReferencesVisitor extends DefaultVisitor<RecordReferencesContext> {
|
|
15
15
|
private readonly visibleSpans;
|
|
16
16
|
static readonly VERSION = "2";
|
|
17
|
-
readonly language = TargetLanguage.
|
|
17
|
+
readonly language = TargetLanguage.PYTHON;
|
|
18
18
|
readonly defaultContext: {};
|
|
19
19
|
private readonly references;
|
|
20
20
|
constructor(visibleSpans: Spans);
|
|
@@ -4,10 +4,16 @@ export declare enum TargetLanguage {
|
|
|
4
4
|
JAVA = "java",
|
|
5
5
|
GO = "go"
|
|
6
6
|
}
|
|
7
|
+
export declare function targetName(language: TargetLanguage): 'python' | 'dotnet' | 'java' | 'go';
|
|
7
8
|
export declare function targetName(language: TargetLanguage.PYTHON): 'python';
|
|
8
9
|
export declare function targetName(language: TargetLanguage.CSHARP): 'dotnet';
|
|
9
10
|
export declare function targetName(language: TargetLanguage.JAVA): 'java';
|
|
10
11
|
export declare function targetName(language: TargetLanguage.GO): 'go';
|
|
12
|
+
/**
|
|
13
|
+
* @param language a possible value for `TargetLanguage`.
|
|
14
|
+
*
|
|
15
|
+
* @returns the name of the target configuration block for the given language.
|
|
16
|
+
*/
|
|
11
17
|
export declare function targetName(language: TargetLanguage): 'python' | 'dotnet' | 'java' | 'go';
|
|
12
18
|
/**
|
|
13
19
|
* Determines whether the supplied language supports transitive submodule
|
|
@@ -4,19 +4,14 @@ exports.supportsTransitiveSubmoduleAccess = exports.targetName = exports.TargetL
|
|
|
4
4
|
const assert = require("node:assert");
|
|
5
5
|
var TargetLanguage;
|
|
6
6
|
(function (TargetLanguage) {
|
|
7
|
-
/** @internal an alias of PYTHON to make intent clear when language is irrelevant */
|
|
8
|
-
TargetLanguage["VISUALIZE"] = "python";
|
|
9
7
|
TargetLanguage["PYTHON"] = "python";
|
|
10
8
|
TargetLanguage["CSHARP"] = "csharp";
|
|
11
9
|
TargetLanguage["JAVA"] = "java";
|
|
12
10
|
TargetLanguage["GO"] = "go";
|
|
11
|
+
/** @internal an alias of PYTHON to make intent clear when language is irrelevant, must be last */
|
|
12
|
+
TargetLanguage["VISUALIZE"] = "python";
|
|
13
13
|
})(TargetLanguage || (exports.TargetLanguage = TargetLanguage = {}));
|
|
14
14
|
const VALID_TARGET_LANGUAGES = new Set(Object.values(TargetLanguage));
|
|
15
|
-
/**
|
|
16
|
-
* @param language a possible value for `TargetLanguage`.
|
|
17
|
-
*
|
|
18
|
-
* @returns the name of the target configuration block for the given language.
|
|
19
|
-
*/
|
|
20
15
|
function targetName(language) {
|
|
21
16
|
// The TypeScript compiler should guarantee the below `switch` statement covers all possible
|
|
22
17
|
// values of the TargetLanguage enum, but we add an assert here for clarity of intent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target-language.js","sourceRoot":"","sources":["../../src/languages/target-language.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AAEtC,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,
|
|
1
|
+
{"version":3,"file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EAYC","sourcesContent":["import * as assert from 'node:assert';\n\nexport enum TargetLanguage {\n PYTHON = 'python',\n CSHARP = 'csharp',\n JAVA = 'java',\n GO = 'go',\n /** @internal an alias of PYTHON to make intent clear when language is irrelevant, must be last */\n VISUALIZE = 'python',\n}\n\nconst VALID_TARGET_LANGUAGES = new Set(Object.values(TargetLanguage));\n\nexport function targetName(language: TargetLanguage): 'python' | 'dotnet' | 'java' | 'go';\nexport function targetName(language: TargetLanguage.PYTHON): 'python';\nexport function targetName(language: TargetLanguage.CSHARP): 'dotnet';\nexport function targetName(language: TargetLanguage.JAVA): 'java';\nexport function targetName(language: TargetLanguage.GO): 'go';\n/** @internal an alias of PYTHON to make intent clear when language is irrelevant, must be last override */\nexport function targetName(language: TargetLanguage.VISUALIZE): 'python';\n\n/**\n * @param language a possible value for `TargetLanguage`.\n *\n * @returns the name of the target configuration block for the given language.\n */\nexport function targetName(language: TargetLanguage): 'python' | 'dotnet' | 'java' | 'go';\nexport function targetName(language: TargetLanguage): 'python' | 'dotnet' | 'java' | 'go' {\n // The TypeScript compiler should guarantee the below `switch` statement covers all possible\n // values of the TargetLanguage enum, but we add an assert here for clarity of intent.\n assert(VALID_TARGET_LANGUAGES.has(language), `Invalid/unexpected target language identifier: ${language}`);\n\n switch (language) {\n case TargetLanguage.VISUALIZE:\n case TargetLanguage.PYTHON:\n return 'python';\n case TargetLanguage.CSHARP:\n return 'dotnet';\n case TargetLanguage.JAVA:\n return 'java';\n case TargetLanguage.GO:\n return 'go';\n }\n}\n\n/**\n * Determines whether the supplied language supports transitive submodule\n * access (similar to how TypeScript/Javascript allows to use a partially\n * qualified name to access a namespace-nested value).\n *\n * If `true`, imports will mirror those found in the original TypeScript\n * code, namespace-traversing property accesses will be rendered as such. This\n * means the following snippet would be transformed \"as-is\":\n * ```ts\n * import * as cdk from 'aws-cdk-lib';\n * new cdk.aws_s3.Bucket(this, 'Bucket');\n * ```\n *\n * If `false` on the other hand, each used submodule will be imported\n * separately and namespace-traversing property accesses will be replaced with\n * references to the separately-imported submodule. This means the above\n * snippet would be transformed as if it had been modifired to:\n * ```ts\n * import * as aws_s3 from 'aws-cdk-lib/aws-s3';\n * new aws_s3.Bucket(this, 'Bucket');\n * ```\n */\nexport function supportsTransitiveSubmoduleAccess(language: TargetLanguage): boolean {\n switch (language) {\n case TargetLanguage.VISUALIZE:\n case TargetLanguage.PYTHON:\n return true;\n case TargetLanguage.CSHARP:\n return true;\n case TargetLanguage.JAVA:\n return false;\n case TargetLanguage.GO:\n return false;\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import { AstRenderer, AstHandler, CommentSyntax } from '../renderer';
|
|
|
5
5
|
import { ImportStatement } from '../typescript/imports';
|
|
6
6
|
export declare class VisualizeAstVisitor implements AstHandler<void> {
|
|
7
7
|
private readonly includeHandlerNames?;
|
|
8
|
-
readonly language = TargetLanguage.
|
|
8
|
+
readonly language = TargetLanguage.PYTHON;
|
|
9
9
|
readonly defaultContext: void;
|
|
10
10
|
constructor(includeHandlerNames?: boolean | undefined);
|
|
11
11
|
mergeContext(_old: any, _update: any): any;
|