jsii-pacmak 1.111.0 → 1.113.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.
Files changed (46) hide show
  1. package/lib/dependency-graph.d.ts +1 -1
  2. package/lib/dependency-graph.js +1 -2
  3. package/lib/index.js +2 -2
  4. package/lib/logging.js +6 -6
  5. package/lib/markdown.js +2 -3
  6. package/lib/naming-util.js +1 -2
  7. package/lib/npm-modules.js +2 -3
  8. package/lib/target.js +2 -2
  9. package/lib/targets/_utils.js +2 -3
  10. package/lib/targets/dotnet/dotnetgenerator.d.ts +2 -1
  11. package/lib/targets/dotnet/dotnetgenerator.js +53 -58
  12. package/lib/targets/dotnet/dotnettyperesolver.d.ts +2 -2
  13. package/lib/targets/dotnet/dotnettyperesolver.js +7 -3
  14. package/lib/targets/dotnet/filegenerator.js +2 -2
  15. package/lib/targets/dotnet/runtime-type-checking.js +3 -3
  16. package/lib/targets/dotnet.js +4 -4
  17. package/lib/targets/go/comparators.d.ts +1 -1
  18. package/lib/targets/go/comparators.js +1 -2
  19. package/lib/targets/go/dependencies.js +3 -3
  20. package/lib/targets/go/package.d.ts +1 -1
  21. package/lib/targets/go/package.js +1 -1
  22. package/lib/targets/go/runtime/constants.d.ts +13 -13
  23. package/lib/targets/go/runtime/emit-arguments.js +1 -2
  24. package/lib/targets/go/runtime/runtime-type-checking.js +10 -10
  25. package/lib/targets/go/runtime/util.js +2 -3
  26. package/lib/targets/go/types/class.js +4 -6
  27. package/lib/targets/go/types/go-type-reference.d.ts +1 -1
  28. package/lib/targets/go/types/go-type-reference.js +1 -3
  29. package/lib/targets/go/util.js +7 -8
  30. package/lib/targets/index.d.ts +1 -1
  31. package/lib/targets/index.js +1 -1
  32. package/lib/targets/java.js +17 -17
  33. package/lib/targets/js.d.ts +1 -1
  34. package/lib/targets/python/requirements-dev.txt +1 -1
  35. package/lib/targets/python/type-name.js +9 -10
  36. package/lib/targets/python/util.js +2 -3
  37. package/lib/targets/python.d.ts +2 -2
  38. package/lib/targets/python.js +5 -11
  39. package/lib/targets/version-utils.js +4 -5
  40. package/lib/toposort.d.ts +3 -3
  41. package/lib/toposort.js +1 -2
  42. package/lib/util.d.ts +0 -1
  43. package/lib/util.js +17 -17
  44. package/lib/version.d.ts +1 -1
  45. package/lib/version.js +3 -3
  46. package/package.json +18 -18
@@ -6,7 +6,7 @@ import { GoType } from './go-type';
6
6
  * TypeMap used to recursively resolve interfaces in nested types for use in
7
7
  * resolving scoped type names and implementation maps.
8
8
  */
9
- declare type TypeMap = {
9
+ type TypeMap = {
10
10
  readonly type: 'primitive';
11
11
  readonly value: string;
12
12
  } | {
@@ -86,9 +86,7 @@ class GoTypeRef {
86
86
  return this.reference.void;
87
87
  }
88
88
  get typeMap() {
89
- if (!this._typeMap) {
90
- this._typeMap = this.buildTypeMap(this);
91
- }
89
+ this._typeMap ?? (this._typeMap = this.buildTypeMap(this));
92
90
  return this._typeMap;
93
91
  }
94
92
  /**
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tarballName = exports.substituteReservedWords = exports.getParamDependencies = exports.getMemberDependencies = exports.flatMap = exports.goPackageNameForAssembly = exports.findTypeInTree = void 0;
3
+ exports.findTypeInTree = findTypeInTree;
4
+ exports.goPackageNameForAssembly = goPackageNameForAssembly;
5
+ exports.flatMap = flatMap;
6
+ exports.getMemberDependencies = getMemberDependencies;
7
+ exports.getParamDependencies = getParamDependencies;
8
+ exports.substituteReservedWords = substituteReservedWords;
9
+ exports.tarballName = tarballName;
4
10
  /*
5
11
  * Recursively search module for type with fqn
6
12
  */
@@ -13,7 +19,6 @@ function findTypeInTree(module, fqn) {
13
19
  return accum ?? findTypeInTree(sm, fqn);
14
20
  }, undefined);
15
21
  }
16
- exports.findTypeInTree = findTypeInTree;
17
22
  /*
18
23
  * Format NPM package names as idiomatic Go module name
19
24
  */
@@ -24,24 +29,20 @@ function goPackageNameForAssembly(assembly) {
24
29
  }
25
30
  return assembly.name.replace(/[^a-z0-9.]/gi, '').toLowerCase();
26
31
  }
27
- exports.goPackageNameForAssembly = goPackageNameForAssembly;
28
32
  function flatMap(collection, mapper) {
29
33
  return collection
30
34
  .map(mapper)
31
35
  .reduce((acc, elt) => acc.concat(elt), new Array());
32
36
  }
33
- exports.flatMap = flatMap;
34
37
  /*
35
38
  * Return module dependencies of a class or interface members
36
39
  */
37
40
  function getMemberDependencies(members) {
38
41
  return members.flatMap((member) => member.reference?.dependencies ?? []);
39
42
  }
40
- exports.getMemberDependencies = getMemberDependencies;
41
43
  function getParamDependencies(methods) {
42
44
  return methods.flatMap(({ parameters }) => parameters.flatMap((param) => param.reference?.dependencies ?? []));
43
45
  }
44
- exports.getParamDependencies = getParamDependencies;
45
46
  const RESERVED_WORDS = {
46
47
  break: 'break_',
47
48
  default: 'default_',
@@ -76,7 +77,6 @@ const RESERVED_WORDS = {
76
77
  function substituteReservedWords(name) {
77
78
  return RESERVED_WORDS[name] || name;
78
79
  }
79
- exports.substituteReservedWords = substituteReservedWords;
80
80
  /**
81
81
  * Computes a safe tarball name for the provided assembly.
82
82
  *
@@ -88,5 +88,4 @@ function tarballName(assm) {
88
88
  const name = assm.name.replace(/^@/, '').replace(/\//g, '-');
89
89
  return `${name}-${assm.version}.tgz`;
90
90
  }
91
- exports.tarballName = tarballName;
92
91
  //# sourceMappingURL=util.js.map
@@ -8,7 +8,7 @@ export declare enum TargetName {
8
8
  JAVASCRIPT = "js",
9
9
  PYTHON = "python"
10
10
  }
11
- export declare type BuilderFactory = (modules: Toposorted<JsiiModule>, options: BuildOptions) => TargetBuilder;
11
+ export type BuilderFactory = (modules: Toposorted<JsiiModule>, options: BuildOptions) => TargetBuilder;
12
12
  export declare const ALL_BUILDERS: {
13
13
  [key in TargetName]: BuilderFactory;
14
14
  };
@@ -15,7 +15,7 @@ var TargetName;
15
15
  TargetName["JAVA"] = "java";
16
16
  TargetName["JAVASCRIPT"] = "js";
17
17
  TargetName["PYTHON"] = "python";
18
- })(TargetName = exports.TargetName || (exports.TargetName = {}));
18
+ })(TargetName || (exports.TargetName = TargetName = {}));
19
19
  exports.ALL_BUILDERS = {
20
20
  dotnet: (ms, o) => new dotnet_1.DotnetBuilder((0, util_1.flatten)(ms), o),
21
21
  go: (ms, o) => new builder_1.IndependentPackageBuilder(TargetName.GO, go_1.Golang, ms, o),
@@ -248,10 +248,6 @@ function moduleArtifactsSubdir(module) {
248
248
  return `${groupId.replace(/\./g, '/')}/${artifactId}`;
249
249
  }
250
250
  class Java extends target_1.Target {
251
- constructor(options) {
252
- super(options);
253
- this.generator = new JavaGenerator(options);
254
- }
255
251
  static toPackageInfos(assm) {
256
252
  const groupId = assm.targets.java.maven.groupId;
257
253
  const artifactId = assm.targets.java.maven.artifactId;
@@ -295,6 +291,10 @@ class Java extends target_1.Target {
295
291
  const [, ...name] = type.fqn.split('.');
296
292
  return { java: `import ${[options.package, ...name].join('.')};` };
297
293
  }
294
+ constructor(options) {
295
+ super(options);
296
+ this.generator = new JavaGenerator(options);
297
+ }
298
298
  async build(sourceDir, outDir) {
299
299
  const url = `file://${outDir}`;
300
300
  const mvnArguments = new Array();
@@ -332,17 +332,6 @@ const MODULE_CLASS_NAME = '$Module';
332
332
  const INTERFACE_PROXY_CLASS_NAME = 'Jsii$Proxy';
333
333
  const INTERFACE_DEFAULT_CLASS_NAME = 'Jsii$Default';
334
334
  class JavaGenerator extends generator_1.Generator {
335
- constructor(options) {
336
- super({ ...options, generateOverloadsForMethodWithOptionals: true });
337
- /**
338
- * A map of all the modules ever referenced during code generation. These include
339
- * direct dependencies but can potentially also include transitive dependencies, when,
340
- * for example, we need to refer to their types when flatting the class hierarchy for
341
- * interface proxies.
342
- */
343
- this.referencedModules = {};
344
- this.rosetta = options.rosetta;
345
- }
346
335
  /**
347
336
  * Turns a raw javascript property name (eg: 'default') into a safe Java property name (eg: 'defaultValue').
348
337
  * @param propertyName the raw JSII property Name
@@ -377,6 +366,17 @@ class JavaGenerator extends generator_1.Generator {
377
366
  }
378
367
  return methodName;
379
368
  }
369
+ constructor(options) {
370
+ super({ ...options, generateOverloadsForMethodWithOptionals: true });
371
+ /**
372
+ * A map of all the modules ever referenced during code generation. These include
373
+ * direct dependencies but can potentially also include transitive dependencies, when,
374
+ * for example, we need to refer to their types when flatting the class hierarchy for
375
+ * interface proxies.
376
+ */
377
+ this.referencedModules = {};
378
+ this.rosetta = options.rosetta;
379
+ }
380
380
  onBeginAssembly(assm, fingerprint) {
381
381
  this.emitFullGeneratorInfo = fingerprint;
382
382
  this.moduleClass = this.emitModuleFile(assm);
@@ -1521,7 +1521,7 @@ class JavaGenerator extends generator_1.Generator {
1521
1521
  parameters: [
1522
1522
  {
1523
1523
  name: fieldName,
1524
- type: spec.CANONICAL_ANY,
1524
+ type: spec.CANONICAL_ANY, // We don't quite care in this context!
1525
1525
  docs: prop.spec.docs,
1526
1526
  },
1527
1527
  ],
@@ -1531,7 +1531,7 @@ class JavaGenerator extends generator_1.Generator {
1531
1531
  })) {
1532
1532
  this.addJavaDocs(setter, {
1533
1533
  api: 'member',
1534
- fqn: prop.definingType.fqn,
1534
+ fqn: prop.definingType.fqn, // Could be inherited
1535
1535
  memberName: prop.name,
1536
1536
  });
1537
1537
  this.emitStabilityAnnotations(prop.spec);
@@ -7,7 +7,7 @@ export default class JavaScript extends Target {
7
7
  };
8
8
  static toNativeReference(type: spec.Type): {
9
9
  typescript: string;
10
- javascript?: string | undefined;
10
+ javascript?: string;
11
11
  };
12
12
  protected readonly generator: PackOnly;
13
13
  build(sourceDir: string, outDir: string): Promise<void>;
@@ -4,7 +4,7 @@
4
4
  # package (wheel, sdist), but not declared as build-system dependencies.
5
5
 
6
6
  setuptools~=75.3.2 # build-system
7
- wheel~=0.42 # build-system
7
+ build~=1.2.2.post1 # build-system
8
8
 
9
9
  twine~=6.1.0
10
10
 
@@ -12,7 +12,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
12
12
  };
13
13
  var _Dict_element, _List_element, _Optional_wrapped, _Primitive_pythonType, _Union_options, _UserType_fqn;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.toPythonFqn = exports.mergePythonImports = exports.toPackageName = exports.toTypeName = void 0;
15
+ exports.toTypeName = toTypeName;
16
+ exports.toPackageName = toPackageName;
17
+ exports.mergePythonImports = mergePythonImports;
18
+ exports.toPythonFqn = toPythonFqn;
16
19
  const spec_1 = require("@jsii/spec");
17
20
  const codemaker_1 = require("codemaker");
18
21
  const crypto_1 = require("crypto");
@@ -44,7 +47,6 @@ function toTypeName(ref) {
44
47
  }
45
48
  return optional ? new Optional(result) : result;
46
49
  }
47
- exports.toTypeName = toTypeName;
48
50
  /**
49
51
  * Obtains the Python package name for a given submodule FQN.
50
52
  *
@@ -54,7 +56,6 @@ exports.toTypeName = toTypeName;
54
56
  function toPackageName(fqn, rootAssm) {
55
57
  return getPackageName(fqn, rootAssm).packageName;
56
58
  }
57
- exports.toPackageName = toPackageName;
58
59
  function mergePythonImports(...pythonImports) {
59
60
  const result = {};
60
61
  for (const bag of pythonImports) {
@@ -69,7 +70,6 @@ function mergePythonImports(...pythonImports) {
69
70
  }
70
71
  return result;
71
72
  }
72
- exports.mergePythonImports = mergePythonImports;
73
73
  function isOptionalValue(type) {
74
74
  return type.type != null;
75
75
  }
@@ -125,11 +125,6 @@ class Optional {
125
125
  }
126
126
  _Optional_wrapped = new WeakMap();
127
127
  class Primitive {
128
- constructor(pythonType) {
129
- // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
130
- _Primitive_pythonType.set(this, void 0);
131
- __classPrivateFieldSet(this, _Primitive_pythonType, pythonType, "f");
132
- }
133
128
  static of(type) {
134
129
  switch (type.primitive) {
135
130
  case spec_1.PrimitiveType.Boolean:
@@ -147,6 +142,11 @@ class Primitive {
147
142
  return Primitive.ANY;
148
143
  }
149
144
  }
145
+ constructor(pythonType) {
146
+ // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
147
+ _Primitive_pythonType.set(this, void 0);
148
+ __classPrivateFieldSet(this, _Primitive_pythonType, pythonType, "f");
149
+ }
150
150
  pythonType() {
151
151
  return __classPrivateFieldGet(this, _Primitive_pythonType, "f");
152
152
  }
@@ -277,7 +277,6 @@ function toPythonFqn(fqn, rootAssm) {
277
277
  }
278
278
  return { assemblyName, packageName, pythonFqn: fqnParts.join('.') };
279
279
  }
280
- exports.toPythonFqn = toPythonFqn;
281
280
  /**
282
281
  * Computes the python relative import path from `fromModule` to `toModule`.
283
282
  *
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toPythonIdentifier = exports.die = void 0;
3
+ exports.die = die;
4
+ exports.toPythonIdentifier = toPythonIdentifier;
4
5
  const PYTHON_KEYWORDS = new Set([
5
6
  'False',
6
7
  'None',
@@ -41,12 +42,10 @@ const PYTHON_KEYWORDS = new Set([
41
42
  function die(message) {
42
43
  throw new Error(message);
43
44
  }
44
- exports.die = die;
45
45
  function toPythonIdentifier(name) {
46
46
  if (PYTHON_KEYWORDS.has(name)) {
47
47
  return `${name}_`;
48
48
  }
49
49
  return name;
50
50
  }
51
- exports.toPythonIdentifier = toPythonIdentifier;
52
51
  //# sourceMappingURL=util.js.map
@@ -36,8 +36,8 @@ interface PythonType extends PythonBase {
36
36
  readonly fqn?: string;
37
37
  addMember(member: PythonBase): void;
38
38
  }
39
- declare type FindModuleCallback = (fqn: string) => spec.AssemblyConfiguration;
40
- declare type FindTypeCallback = (fqn: string) => spec.Type;
39
+ type FindModuleCallback = (fqn: string) => spec.AssemblyConfiguration;
40
+ type FindTypeCallback = (fqn: string) => spec.Type;
41
41
  declare class TypeResolver {
42
42
  private readonly types;
43
43
  private readonly boundTo?;
@@ -57,7 +57,7 @@ class Python extends target_1.Target {
57
57
  await (0, util_1.shell)(process.platform === 'win32' ? 'python' : 'python3', [
58
58
  '-m',
59
59
  'venv',
60
- '--system-site-packages',
60
+ '--system-site-packages', // Allow using globally installed packages (saves time & disk space)
61
61
  venv,
62
62
  ]);
63
63
  const env = {
@@ -73,11 +73,7 @@ class Python extends target_1.Target {
73
73
  retry: { maxAttempts: 5 },
74
74
  });
75
75
  // Actually package up our code, both as a sdist and a wheel for publishing.
76
- await (0, util_1.shell)(python, ['setup.py', 'sdist', '--dist-dir', outDir], {
77
- cwd: sourceDir,
78
- env,
79
- });
80
- await (0, util_1.shell)(python, ['-m', 'pip', 'wheel', '--no-deps', '--wheel-dir', outDir, sourceDir], {
76
+ await (0, util_1.shell)(python, ['-m', 'build', '--outdir', outDir, sourceDir], {
81
77
  cwd: sourceDir,
82
78
  env,
83
79
  retry: { maxAttempts: 5 },
@@ -116,12 +112,12 @@ class TypeCheckingStub {
116
112
  __classPrivateFieldSet(this, _TypeCheckingStub_arguments, args.map((arg) => arg.replace(/"/g, '')), "f");
117
113
  __classPrivateFieldSet(this, _TypeCheckingStub_hash, crypto
118
114
  .createHash('sha256')
119
- .update(__classPrivateFieldGet(TypeCheckingStub, _a, "f", _TypeCheckingStub_PREFIX))
115
+ .update(__classPrivateFieldGet(_a, _a, "f", _TypeCheckingStub_PREFIX))
120
116
  .update(fqn)
121
117
  .digest('hex'), "f");
122
118
  }
123
119
  get name() {
124
- return `${__classPrivateFieldGet(TypeCheckingStub, _a, "f", _TypeCheckingStub_PREFIX)}${__classPrivateFieldGet(this, _TypeCheckingStub_hash, "f")}`;
120
+ return `${__classPrivateFieldGet(_a, _a, "f", _TypeCheckingStub_PREFIX)}${__classPrivateFieldGet(this, _TypeCheckingStub_hash, "f")}`;
125
121
  }
126
122
  emit(code) {
127
123
  code.line();
@@ -1705,9 +1701,7 @@ class PythonGenerator extends generator_1.Generator {
1705
1701
  if ((!docs || Object.keys(docs).length === 0) && !options.arguments) {
1706
1702
  return;
1707
1703
  }
1708
- if (!docs) {
1709
- docs = {};
1710
- }
1704
+ docs ?? (docs = {});
1711
1705
  const lines = new Array();
1712
1706
  if (docs.summary) {
1713
1707
  lines.push((0, markdown_1.md2rst)((0, _utils_1.renderSummary)(docs)));
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toReleaseVersion = exports.toPythonVersionRange = exports.toNuGetVersionRange = exports.toMavenVersionRange = void 0;
3
+ exports.toMavenVersionRange = toMavenVersionRange;
4
+ exports.toNuGetVersionRange = toNuGetVersionRange;
5
+ exports.toPythonVersionRange = toPythonVersionRange;
6
+ exports.toReleaseVersion = toReleaseVersion;
4
7
  const semver_1 = require("semver");
5
8
  const util_1 = require("util");
6
9
  const _1 = require(".");
@@ -18,7 +21,6 @@ function toMavenVersionRange(semverRange, suffix) {
18
21
  target: _1.TargetName.JAVA,
19
22
  });
20
23
  }
21
- exports.toMavenVersionRange = toMavenVersionRange;
22
24
  /**
23
25
  * Converts a SemVer range expression to a NuGet version range expression.
24
26
  *
@@ -32,7 +34,6 @@ function toNuGetVersionRange(semverRange) {
32
34
  target: _1.TargetName.DOTNET,
33
35
  });
34
36
  }
35
- exports.toNuGetVersionRange = toNuGetVersionRange;
36
37
  /**
37
38
  * Converts a SemVer range expression to a Python setuptools compatible version
38
39
  * constraint expression.
@@ -60,7 +61,6 @@ function toPythonVersionRange(semverRange) {
60
61
  .join(', '))
61
62
  .join(', ');
62
63
  }
63
- exports.toPythonVersionRange = toPythonVersionRange;
64
64
  /**
65
65
  * Converts an original version number from the NPM convention to the target
66
66
  * language's convention for expressing the same. For versions that do not
@@ -139,7 +139,6 @@ function toReleaseVersion(assemblyVersion, target) {
139
139
  }
140
140
  return assemblyVersion;
141
141
  }
142
- exports.toReleaseVersion = toReleaseVersion;
143
142
  /**
144
143
  * Converts a semantic version range to the kind of bracket notation used by
145
144
  * Maven and NuGet. For example, this turns `^1.2.3` into `[1.2.3,2.0.0)`.
package/lib/toposort.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare type KeyFunc<T> = (x: T) => string;
2
- export declare type DepFunc<T> = (x: T) => string[];
1
+ export type KeyFunc<T> = (x: T) => string;
2
+ export type DepFunc<T> = (x: T) => string[];
3
3
  /**
4
4
  * Return a topological sort of all elements of xs, according to the given dependency functions
5
5
  *
@@ -34,5 +34,5 @@ export declare function topologicalSort<T>(xs: Iterable<T>, keyFn: KeyFunc<T>, d
34
34
  * We do declare the type `Toposorted<A>` here so that if we ever change
35
35
  * the type, we can find all usage sites quickly.
36
36
  */
37
- export declare type Toposorted<A> = readonly A[][];
37
+ export type Toposorted<A> = readonly A[][];
38
38
  //# sourceMappingURL=toposort.d.ts.map
package/lib/toposort.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.topologicalSort = void 0;
3
+ exports.topologicalSort = topologicalSort;
4
4
  /**
5
5
  * Return a topological sort of all elements of xs, according to the given dependency functions
6
6
  *
@@ -37,5 +37,4 @@ function topologicalSort(xs, keyFn, depFn) {
37
37
  }
38
38
  return ret;
39
39
  }
40
- exports.topologicalSort = topologicalSort;
41
40
  //# sourceMappingURL=toposort.js.map
package/lib/util.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { SpawnOptions } from 'child_process';
3
2
  /**
4
3
  * Find the directory that contains a given dependency, identified by its 'package.json', from a starting search directory
package/lib/util.js CHANGED
@@ -1,6 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flatten = exports.wait = exports.filterAsync = exports.setExtend = exports.Scratch = exports.slugify = exports.shell = exports.retry = exports.AllAttemptsFailed = exports.findUp = exports.findPackageJsonUp = exports.isBuiltinModule = exports.findDependencyDirectory = void 0;
3
+ exports.Scratch = exports.AllAttemptsFailed = void 0;
4
+ exports.findDependencyDirectory = findDependencyDirectory;
5
+ exports.isBuiltinModule = isBuiltinModule;
6
+ exports.findPackageJsonUp = findPackageJsonUp;
7
+ exports.findUp = findUp;
8
+ exports.retry = retry;
9
+ exports.shell = shell;
10
+ exports.slugify = slugify;
11
+ exports.setExtend = setExtend;
12
+ exports.filterAsync = filterAsync;
13
+ exports.wait = wait;
14
+ exports.flatten = flatten;
4
15
  const child_process_1 = require("child_process");
5
16
  const fs = require("fs-extra");
6
17
  const os = require("os");
@@ -26,7 +37,6 @@ async function findDependencyDirectory(dependencyName, searchStart) {
26
37
  }
27
38
  return depPkgJsonPath;
28
39
  }
29
- exports.findDependencyDirectory = findDependencyDirectory;
30
40
  /**
31
41
  * Whether the given dependency is a built-in
32
42
  *
@@ -38,7 +48,6 @@ function isBuiltinModule(depName) {
38
48
  const { builtinModules } = require('module');
39
49
  return (builtinModules ?? []).includes(depName);
40
50
  }
41
- exports.isBuiltinModule = isBuiltinModule;
42
51
  /**
43
52
  * Find the package.json for a given package upwards from the given directory
44
53
  *
@@ -52,7 +61,6 @@ async function findPackageJsonUp(packageName, directory) {
52
61
  (await fs.readJson(pjFile)).name === packageName);
53
62
  });
54
63
  }
55
- exports.findPackageJsonUp = findPackageJsonUp;
56
64
  /**
57
65
  * Find a directory up the tree from a starting directory matching a condition
58
66
  *
@@ -75,7 +83,6 @@ async function findUp(directory, pred) {
75
83
  directory = parent;
76
84
  }
77
85
  }
78
- exports.findUp = findUp;
79
86
  class AllAttemptsFailed extends Error {
80
87
  constructor(callback, errors) {
81
88
  super(`All attempts failed. Last error: ${errors[errors.length - 1].message}`);
@@ -126,7 +133,6 @@ async function retry(cb, opts = {}, waiter = wait) {
126
133
  }
127
134
  return Promise.reject(new AllAttemptsFailed(cb, errors));
128
135
  }
129
- exports.retry = retry;
130
136
  /**
131
137
  * Spawns a child process with the provided command and arguments. The child
132
138
  * process is always spawned using `shell: true`, and the contents of
@@ -202,23 +208,16 @@ async function shell(cmd, args, { retry: retryOptions, ...options } = {}) {
202
208
  }
203
209
  return spawn1();
204
210
  }
205
- exports.shell = shell;
206
211
  /**
207
212
  * Strip filesystem unsafe characters from a string
208
213
  */
209
214
  function slugify(x) {
210
215
  return x.replace(/[^a-zA-Z0-9_-]/g, '_');
211
216
  }
212
- exports.slugify = slugify;
213
217
  /**
214
218
  * Class that makes a temporary directory and holds on to an operation object
215
219
  */
216
220
  class Scratch {
217
- constructor(directory, object, fake) {
218
- this.directory = directory;
219
- this.object = object;
220
- this.fake = fake;
221
- }
222
221
  static async make(factory) {
223
222
  const tmpdir = await fs.mkdtemp(path.join(os.tmpdir(), 'npm-pack'));
224
223
  return new Scratch(tmpdir, await factory(tmpdir), false);
@@ -229,6 +228,11 @@ class Scratch {
229
228
  static async cleanupAll(tempDirs) {
230
229
  await Promise.all(tempDirs.map((t) => t.cleanup()));
231
230
  }
231
+ constructor(directory, object, fake) {
232
+ this.directory = directory;
233
+ this.object = object;
234
+ this.fake = fake;
235
+ }
232
236
  async cleanup() {
233
237
  if (!this.fake) {
234
238
  try {
@@ -260,18 +264,14 @@ function setExtend(xs, els) {
260
264
  xs.add(el);
261
265
  }
262
266
  }
263
- exports.setExtend = setExtend;
264
267
  async function filterAsync(xs, pred) {
265
268
  const mapped = await Promise.all(xs.map(async (x) => ({ x, pred: await pred(x) })));
266
269
  return mapped.filter(({ pred }) => pred).map(({ x }) => x);
267
270
  }
268
- exports.filterAsync = filterAsync;
269
271
  async function wait(ms) {
270
272
  return new Promise((ok) => setTimeout(ok, ms));
271
273
  }
272
- exports.wait = wait;
273
274
  function flatten(xs) {
274
275
  return Array.prototype.concat.call([], ...xs);
275
276
  }
276
- exports.flatten = flatten;
277
277
  //# sourceMappingURL=util.js.map
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.111.0 (build cc021d6)";
4
+ export declare const VERSION_DESC = "1.113.0 (build fc68b25)";
5
5
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
- // Generated at 2025-04-02T16:26:41Z by generate.sh
2
+ // Generated at 2025-07-31T12:47:09Z 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.111.0';
7
+ exports.VERSION = '1.113.0';
8
8
  /** The qualified version number for this jsii-pacmak release (e.g: `X.Y.Z (build #######)`) */
9
- exports.VERSION_DESC = '1.111.0 (build cc021d6)';
9
+ exports.VERSION_DESC = '1.113.0 (build fc68b25)';
10
10
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsii-pacmak",
3
- "version": "1.111.0",
3
+ "version": "1.113.0",
4
4
  "description": "A code generation framework for jsii backend languages",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -26,46 +26,46 @@
26
26
  },
27
27
  "scripts": {
28
28
  "gen": "bash generate.sh",
29
- "build": "npm run gen && tsc --build && chmod +x bin/jsii-pacmak && npm run lint",
29
+ "build": "yarn gen && tsc --build && chmod +x bin/jsii-pacmak && yarn lint",
30
30
  "watch": "tsc --build -w",
31
31
  "lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts --ignore-path=.gitignore",
32
32
  "lint:fix": "yarn lint --fix",
33
- "test": "npm run test:unit && npm run test:build",
33
+ "test": "yarn test:unit && yarn test:build",
34
34
  "test:unit": "jest",
35
35
  "test:build": "bash test/build-test.sh",
36
- "test:update": "jest -u && npm run test:build",
36
+ "test:update": "jest -u && yarn test:build",
37
37
  "package": "package-js"
38
38
  },
39
39
  "dependencies": {
40
- "@jsii/check-node": "1.111.0",
41
- "@jsii/spec": "^1.111.0",
40
+ "@jsii/check-node": "1.113.0",
41
+ "@jsii/spec": "^1.113.0",
42
42
  "clone": "^2.1.2",
43
- "codemaker": "^1.111.0",
43
+ "codemaker": "^1.113.0",
44
44
  "commonmark": "^0.31.2",
45
45
  "escape-string-regexp": "^4.0.0",
46
46
  "fs-extra": "^10.1.0",
47
- "jsii-reflect": "^1.111.0",
48
- "semver": "^7.7.1",
49
- "spdx-license-list": "^6.9.0",
47
+ "jsii-reflect": "^1.113.0",
48
+ "semver": "^7.7.2",
49
+ "spdx-license-list": "^6.10.0",
50
50
  "xmlbuilder": "^15.1.1",
51
51
  "yargs": "^16.2.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@jsii/dotnet-runtime": "^1.111.0",
55
- "@jsii/go-runtime": "^1.111.0",
56
- "@jsii/java-runtime": "^1.111.0",
57
- "@scope/jsii-calc-lib": "^1.111.0",
54
+ "@jsii/dotnet-runtime": "^1.113.0",
55
+ "@jsii/go-runtime": "^1.113.0",
56
+ "@jsii/java-runtime": "^1.113.0",
57
+ "@scope/jsii-calc-lib": "^1.113.0",
58
58
  "@types/clone": "^2.1.4",
59
- "@types/commonmark": "^0.27.9",
59
+ "@types/commonmark": "^0.27.10",
60
60
  "@types/diff": "^5.2.3",
61
61
  "@types/fs-extra": "^9.0.13",
62
- "@types/semver": "^7.5.8",
62
+ "@types/semver": "^7.7.0",
63
63
  "diff": "^5.2.0",
64
64
  "jsii": "^5.8.0",
65
- "jsii-build-tools": "^1.111.0",
65
+ "jsii-build-tools": "^1.113.0",
66
66
  "jsii-calc": "^3.20.120",
67
67
  "jsii-rosetta": "~5.8.0",
68
- "pyright": "^1.1.395"
68
+ "pyright": "^1.1.403"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "jsii-rosetta": ">=5.5.0"