jsii-pacmak 1.78.1 → 1.80.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/bin/jsii-pacmak.js +7 -0
- package/lib/index.js +1 -1
- package/lib/packaging.d.ts +2 -1
- package/lib/packaging.js +20 -9
- package/lib/targets/python/requirements-dev.txt +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +3 -3
- package/package.json +15 -15
package/bin/jsii-pacmak.js
CHANGED
|
@@ -6,6 +6,7 @@ const jsii_rosetta_1 = require("jsii-rosetta");
|
|
|
6
6
|
const yargs = require("yargs");
|
|
7
7
|
const lib_1 = require("../lib");
|
|
8
8
|
const logging_1 = require("../lib/logging");
|
|
9
|
+
const packaging_1 = require("../lib/packaging");
|
|
9
10
|
const version_1 = require("../lib/version");
|
|
10
11
|
(async function main() {
|
|
11
12
|
const argv = await yargs
|
|
@@ -139,6 +140,12 @@ const version_1 = require("../lib/version");
|
|
|
139
140
|
defaultDescription: 'A temporary directory is used.',
|
|
140
141
|
default: undefined,
|
|
141
142
|
hidden: true,
|
|
143
|
+
})
|
|
144
|
+
.option('pack-command', {
|
|
145
|
+
type: 'string',
|
|
146
|
+
desc: 'Configure a custom command to create package tarballs. Command must output the name of the tarball.',
|
|
147
|
+
default: packaging_1.DEFAULT_PACK_COMMAND,
|
|
148
|
+
hidden: true,
|
|
142
149
|
})
|
|
143
150
|
.option('validate-assemblies', {
|
|
144
151
|
type: 'boolean',
|
package/lib/index.js
CHANGED
|
@@ -46,7 +46,7 @@ async function pacmak({ argv = {}, clean = true, codeOnly = false, fingerprint =
|
|
|
46
46
|
}
|
|
47
47
|
await timers.recordAsync('npm pack', () => {
|
|
48
48
|
logging.info('Packaging NPM bundles');
|
|
49
|
-
return Promise.all(modulesToPackageFlat.map((m) => m.npmPack()));
|
|
49
|
+
return Promise.all(modulesToPackageFlat.map((m) => m.npmPack(argv['pack-command'])));
|
|
50
50
|
});
|
|
51
51
|
await timers.recordAsync('load jsii', () => {
|
|
52
52
|
logging.info('Loading jsii assemblies and translations');
|
package/lib/packaging.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Assembly, TypeSystem } from 'jsii-reflect';
|
|
2
|
+
export declare const DEFAULT_PACK_COMMAND = "npm pack";
|
|
2
3
|
export interface JsiiModuleOptions {
|
|
3
4
|
/**
|
|
4
5
|
* Name of the module
|
|
@@ -33,7 +34,7 @@ export declare class JsiiModule {
|
|
|
33
34
|
/**
|
|
34
35
|
* Prepare an NPM package from this source module
|
|
35
36
|
*/
|
|
36
|
-
npmPack(): Promise<void>;
|
|
37
|
+
npmPack(packCommand?: string): Promise<void>;
|
|
37
38
|
get tarball(): string;
|
|
38
39
|
load(system: TypeSystem, validate?: boolean): Promise<Assembly>;
|
|
39
40
|
get assembly(): Assembly;
|
package/lib/packaging.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsiiModule = void 0;
|
|
3
|
+
exports.JsiiModule = exports.DEFAULT_PACK_COMMAND = void 0;
|
|
4
|
+
const fs = require("fs-extra");
|
|
4
5
|
const os = require("os");
|
|
5
6
|
const path = require("path");
|
|
6
7
|
const logging = require("../lib/logging");
|
|
7
8
|
const util_1 = require("./util");
|
|
9
|
+
exports.DEFAULT_PACK_COMMAND = 'npm pack';
|
|
8
10
|
class JsiiModule {
|
|
9
11
|
constructor(options) {
|
|
10
12
|
this.name = options.name;
|
|
@@ -16,22 +18,31 @@ class JsiiModule {
|
|
|
16
18
|
/**
|
|
17
19
|
* Prepare an NPM package from this source module
|
|
18
20
|
*/
|
|
19
|
-
async npmPack() {
|
|
21
|
+
async npmPack(packCommand = exports.DEFAULT_PACK_COMMAND) {
|
|
20
22
|
this._tarball = await util_1.Scratch.make(async (tmpdir) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
args.push(
|
|
23
|
+
const args = [];
|
|
24
|
+
if (packCommand === exports.DEFAULT_PACK_COMMAND) {
|
|
25
|
+
// Quoting (JSON-stringifying) the module directory in order to avoid
|
|
26
|
+
// problems if there are spaces or other special characters in the path.
|
|
27
|
+
args.push(JSON.stringify(this.moduleDirectory));
|
|
28
|
+
if (logging.level >= logging.LEVEL_VERBOSE) {
|
|
29
|
+
args.push('--loglevel=verbose');
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
|
-
|
|
32
|
+
else {
|
|
33
|
+
// Ensure module is copied to tmpdir to ensure parallel execution does not contend on generated tarballs
|
|
34
|
+
await fs.copy(this.moduleDirectory, tmpdir, { dereference: true });
|
|
35
|
+
}
|
|
36
|
+
const out = await (0, util_1.shell)(packCommand, args, {
|
|
37
|
+
cwd: tmpdir,
|
|
38
|
+
});
|
|
28
39
|
// Take only the last line of npm pack which should contain the
|
|
29
40
|
// tarball name. otherwise, there can be a lot of extra noise there
|
|
30
41
|
// from scripts that emit to STDOUT.
|
|
31
42
|
const lines = out.trim().split(os.EOL);
|
|
32
43
|
const lastLine = lines[lines.length - 1].trim();
|
|
33
44
|
if (!lastLine.endsWith('.tgz') && !lastLine.endsWith('.tar.gz')) {
|
|
34
|
-
throw new Error(
|
|
45
|
+
throw new Error(`${packCommand} did not produce tarball from ${this.moduleDirectory} into ${tmpdir} (output was ${JSON.stringify(lines)})`);
|
|
35
46
|
}
|
|
36
47
|
return path.resolve(tmpdir, lastLine);
|
|
37
48
|
});
|
package/lib/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The short version number for this jsii-pacmak release (e.g: `X.Y.Z`) */
|
|
2
2
|
export declare const VERSION: string;
|
|
3
3
|
/** The qualified version number for this jsii-pacmak release (e.g: `X.Y.Z (build #######)`) */
|
|
4
|
-
export declare const VERSION_DESC = "1.
|
|
4
|
+
export declare const VERSION_DESC = "1.80.0 (build bce6a1d)";
|
|
5
5
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Generated at 2023-
|
|
2
|
+
// Generated at 2023-04-04T15:19:12Z by generate.sh
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.VERSION_DESC = exports.VERSION = void 0;
|
|
5
5
|
/** The short version number for this jsii-pacmak release (e.g: `X.Y.Z`) */
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
7
|
-
exports.VERSION = '1.
|
|
7
|
+
exports.VERSION = '1.80.0';
|
|
8
8
|
/** The qualified version number for this jsii-pacmak release (e.g: `X.Y.Z (build #######)`) */
|
|
9
|
-
exports.VERSION_DESC = '1.
|
|
9
|
+
exports.VERSION_DESC = '1.80.0 (build bce6a1d)';
|
|
10
10
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsii-pacmak",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.80.0",
|
|
4
4
|
"description": "A code generation framework for jsii backend languages",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -37,35 +37,35 @@
|
|
|
37
37
|
"package": "package-js"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@jsii/check-node": "1.
|
|
41
|
-
"@jsii/spec": "^1.
|
|
40
|
+
"@jsii/check-node": "1.80.0",
|
|
41
|
+
"@jsii/spec": "^1.80.0",
|
|
42
42
|
"clone": "^2.1.2",
|
|
43
|
-
"codemaker": "^1.
|
|
43
|
+
"codemaker": "^1.80.0",
|
|
44
44
|
"commonmark": "^0.30.0",
|
|
45
45
|
"escape-string-regexp": "^4.0.0",
|
|
46
46
|
"fs-extra": "^10.1.0",
|
|
47
|
-
"jsii-reflect": "^1.
|
|
48
|
-
"jsii-rosetta": "^1.
|
|
47
|
+
"jsii-reflect": "^1.80.0",
|
|
48
|
+
"jsii-rosetta": "^1.80.0",
|
|
49
49
|
"semver": "^7.3.8",
|
|
50
50
|
"spdx-license-list": "^6.6.0",
|
|
51
51
|
"xmlbuilder": "^15.1.1",
|
|
52
52
|
"yargs": "^16.2.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@jsii/dotnet-runtime": "^1.
|
|
56
|
-
"@jsii/java-runtime": "^1.
|
|
57
|
-
"@jsii/go-runtime": "^1.
|
|
58
|
-
"@scope/jsii-calc-lib": "^1.
|
|
55
|
+
"@jsii/dotnet-runtime": "^1.80.0",
|
|
56
|
+
"@jsii/java-runtime": "^1.80.0",
|
|
57
|
+
"@jsii/go-runtime": "^1.80.0",
|
|
58
|
+
"@scope/jsii-calc-lib": "^1.80.0",
|
|
59
59
|
"@types/clone": "^2.1.1",
|
|
60
|
-
"@types/diff": "^5.0.
|
|
61
|
-
"@types/commonmark": "^0.27.
|
|
60
|
+
"@types/diff": "^5.0.3",
|
|
61
|
+
"@types/commonmark": "^0.27.6",
|
|
62
62
|
"@types/fs-extra": "^9.0.13",
|
|
63
63
|
"@types/semver": "^7.3.13",
|
|
64
64
|
"diff": "^5.1.0",
|
|
65
|
-
"jsii": "^1.
|
|
66
|
-
"jsii-build-tools": "^1.
|
|
65
|
+
"jsii": "^1.80.0",
|
|
66
|
+
"jsii-build-tools": "^1.80.0",
|
|
67
67
|
"jsii-calc": "^3.20.120",
|
|
68
|
-
"pyright": "^1.1.
|
|
68
|
+
"pyright": "^1.1.301"
|
|
69
69
|
},
|
|
70
70
|
"keywords": [
|
|
71
71
|
"jsii",
|