jsii-rosetta 1.80.0 → 1.81.0
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/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/json.d.ts +4 -3
- package/lib/json.js +7 -7
- package/lib/tablets/tablets.js +1 -2
- package/lib/upgrade-prompt.d.ts +1 -0
- package/lib/upgrade-prompt.js +21 -0
- package/package.json +7 -7
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -34,4 +34,5 @@ __exportStar(require("./rosetta-translator"), exports);
|
|
|
34
34
|
__exportStar(require("./snippet"), exports);
|
|
35
35
|
__exportStar(require("./markdown"), exports);
|
|
36
36
|
__exportStar(require("./strict"), exports);
|
|
37
|
+
require("./upgrade-prompt");
|
|
37
38
|
//# sourceMappingURL=index.js.map
|
package/lib/json.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { Readable } from 'stream';
|
|
3
4
|
/**
|
|
4
5
|
* Asynchronously parses a single JSON value from the provided reader. The JSON
|
|
5
6
|
* text might be longer than what could fit in a single string value, since the
|
|
@@ -22,7 +23,7 @@ export declare function parse(reader: Readable): Promise<any>;
|
|
|
22
23
|
* better performance.
|
|
23
24
|
*
|
|
24
25
|
* @param value the value to be serialized.
|
|
25
|
-
* @param
|
|
26
|
+
* @param writers the sequence of write streams to use to output the JSON text.
|
|
26
27
|
*/
|
|
27
|
-
export declare function stringify(value: any,
|
|
28
|
+
export declare function stringify(value: any, ...writers: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream>): Promise<void>;
|
|
28
29
|
//# sourceMappingURL=json.d.ts.map
|
package/lib/json.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stringify = exports.parse = void 0;
|
|
4
|
-
const
|
|
5
|
-
const node_util_1 = require("node:util");
|
|
4
|
+
const stream_1 = require("stream");
|
|
6
5
|
const stream_json_1 = require("stream-json");
|
|
7
6
|
const Assembler = require("stream-json/Assembler");
|
|
8
7
|
const Disassembler_1 = require("stream-json/Disassembler");
|
|
9
8
|
const Stringer_1 = require("stream-json/Stringer");
|
|
9
|
+
const util_1 = require("util");
|
|
10
10
|
// NB: In node 15+, there is a node:stream.promises object that has this built-in.
|
|
11
|
-
const asyncPipeline = (0,
|
|
11
|
+
const asyncPipeline = (0, util_1.promisify)(stream_1.pipeline);
|
|
12
12
|
/**
|
|
13
13
|
* Asynchronously parses a single JSON value from the provided reader. The JSON
|
|
14
14
|
* text might be longer than what could fit in a single string value, since the
|
|
@@ -37,13 +37,13 @@ exports.parse = parse;
|
|
|
37
37
|
* better performance.
|
|
38
38
|
*
|
|
39
39
|
* @param value the value to be serialized.
|
|
40
|
-
* @param
|
|
40
|
+
* @param writers the sequence of write streams to use to output the JSON text.
|
|
41
41
|
*/
|
|
42
|
-
async function stringify(value,
|
|
43
|
-
const reader = new
|
|
42
|
+
async function stringify(value, ...writers) {
|
|
43
|
+
const reader = new stream_1.Readable({ objectMode: true });
|
|
44
44
|
reader.push(value);
|
|
45
45
|
reader.push(null);
|
|
46
|
-
return asyncPipeline(reader, (0, Disassembler_1.disassembler)(), (0, Stringer_1.stringer)(),
|
|
46
|
+
return asyncPipeline(reader, (0, Disassembler_1.disassembler)(), (0, Stringer_1.stringer)(), ...writers);
|
|
47
47
|
}
|
|
48
48
|
exports.stringify = stringify;
|
|
49
49
|
//# sourceMappingURL=json.js.map
|
package/lib/tablets/tablets.js
CHANGED
|
@@ -160,8 +160,7 @@ class LanguageTablet {
|
|
|
160
160
|
await fs_1.promises.mkdir(path.dirname(filename), { recursive: true });
|
|
161
161
|
const writeStream = (0, fs_1.createWriteStream)(filename, { flags: 'w' });
|
|
162
162
|
const gzip = compress ? zlib.createGzip() : undefined;
|
|
163
|
-
|
|
164
|
-
return (0, json_1.stringify)(this.toSchema(), gzip ?? writeStream);
|
|
163
|
+
return (0, json_1.stringify)(this.toSchema(), ...(gzip ? [gzip] : []), writeStream);
|
|
165
164
|
}
|
|
166
165
|
toSchema() {
|
|
167
166
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=upgrade-prompt.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Note: intentionally using the same environment variable as the compiler here instead of customizing...
|
|
3
|
+
if (process.env.JSII_SUPPRESS_UPGRADE_PROMPT == null) {
|
|
4
|
+
console.error([
|
|
5
|
+
'#######################################################################################################',
|
|
6
|
+
'### You are currently using jsii-rosetta@1.x. We recommend upgrading to jsii-rosetta@5.0.x or ###',
|
|
7
|
+
'### later. This will allow you to use modern TypeScript syntax, and improves compatibility with ###',
|
|
8
|
+
'### many common dependencies. For example, recent versions of @types/node. ###',
|
|
9
|
+
'### ###',
|
|
10
|
+
'### 5.0.x and subsequent releases of jsii-rosetta use the same major.minor version as the ###',
|
|
11
|
+
'### TypeScript compiler they are built on. We recommend declaring a minor-pinned (also known as ###',
|
|
12
|
+
'### "tilde") dependency on jsii-rosetta (e.g: `"jsii-rosetta": "5.0.x"` or ###',
|
|
13
|
+
'### `"jsii-rosetta": "~5.0.7"`). ###',
|
|
14
|
+
'### ###',
|
|
15
|
+
'### For more information, see: https://aws.github.io/jsii/compiler-and-rosetta-maintenance/ ###',
|
|
16
|
+
'### ###',
|
|
17
|
+
'### This warning can be suppressed by setting the JSII_SUPPRESS_UPGRADE_PROMPT environment variable ###',
|
|
18
|
+
'#######################################################################################################',
|
|
19
|
+
].join('\n'));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=upgrade-prompt.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsii-rosetta",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.81.0",
|
|
4
4
|
"description": "Translate TypeScript code snippets to other languages",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,24 +21,24 @@
|
|
|
21
21
|
"@types/stream-json": "^1.7.3",
|
|
22
22
|
"@types/workerpool": "^6.4.0",
|
|
23
23
|
"@types/semver": "^7.3.13",
|
|
24
|
-
"jsii-build-tools": "1.
|
|
24
|
+
"jsii-build-tools": "1.81.0",
|
|
25
25
|
"jsii-calc": "3.20.120",
|
|
26
26
|
"memory-streams": "^0.1.3",
|
|
27
27
|
"mock-fs": "^5.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@jsii/check-node": "1.
|
|
31
|
-
"@jsii/spec": "1.
|
|
30
|
+
"@jsii/check-node": "1.81.0",
|
|
31
|
+
"@jsii/spec": "1.81.0",
|
|
32
32
|
"commonmark": "^0.30.0",
|
|
33
33
|
"typescript": "~3.9.10",
|
|
34
|
-
"@xmldom/xmldom": "^0.8.
|
|
34
|
+
"@xmldom/xmldom": "^0.8.7",
|
|
35
35
|
"workerpool": "^6.4.0",
|
|
36
36
|
"yargs": "^16.2.0",
|
|
37
37
|
"stream-json": "^1.7.5",
|
|
38
|
-
"semver": "^7.
|
|
38
|
+
"semver": "^7.5.0",
|
|
39
39
|
"semver-intersect": "^1.4.0",
|
|
40
40
|
"fast-glob": "^3.2.12",
|
|
41
|
-
"jsii": "1.
|
|
41
|
+
"jsii": "1.81.0"
|
|
42
42
|
},
|
|
43
43
|
"license": "Apache-2.0",
|
|
44
44
|
"author": {
|