@napi-rs/cli 3.0.0-alpha.5 → 3.0.0-alpha.7

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 (124) hide show
  1. package/dist/api/artifacts.js +5 -2
  2. package/dist/api/artifacts.js.map +1 -0
  3. package/dist/api/build.d.ts +1 -1
  4. package/dist/api/build.js +75 -17
  5. package/dist/api/build.js.map +1 -0
  6. package/dist/api/create-npm-dirs.js +1 -0
  7. package/dist/api/create-npm-dirs.js.map +1 -0
  8. package/dist/api/load-wasi-template.d.ts +1 -0
  9. package/dist/api/load-wasi-template.js +63 -0
  10. package/dist/api/load-wasi-template.js.map +1 -0
  11. package/dist/api/new.js +2 -1
  12. package/dist/api/new.js.map +1 -0
  13. package/dist/api/pre-publish.js +1 -0
  14. package/dist/api/pre-publish.js.map +1 -0
  15. package/dist/api/rename.js +1 -0
  16. package/dist/api/rename.js.map +1 -0
  17. package/dist/api/templates/.gitignore.d.ts +1 -1
  18. package/dist/api/templates/.gitignore.js +2 -0
  19. package/dist/api/templates/.gitignore.js.map +1 -0
  20. package/dist/api/templates/.npmignore.js +1 -0
  21. package/dist/api/templates/.npmignore.js.map +1 -0
  22. package/dist/api/templates/build.rs.js +1 -0
  23. package/dist/api/templates/build.rs.js.map +1 -0
  24. package/dist/api/templates/cargo.toml.js +1 -0
  25. package/dist/api/templates/cargo.toml.js.map +1 -0
  26. package/dist/api/templates/ci-template.js +48 -33
  27. package/dist/api/templates/ci-template.js.map +1 -0
  28. package/dist/api/templates/ci.yml.d.ts +1 -1
  29. package/dist/api/templates/ci.yml.js +2 -1
  30. package/dist/api/templates/ci.yml.js.map +1 -0
  31. package/dist/api/templates/index.js +1 -0
  32. package/dist/api/templates/index.js.map +1 -0
  33. package/dist/api/templates/js-binding.js +46 -11
  34. package/dist/api/templates/js-binding.js.map +1 -0
  35. package/dist/api/templates/lib.rs.js +1 -0
  36. package/dist/api/templates/lib.rs.js.map +1 -0
  37. package/dist/api/templates/package.json.js +1 -0
  38. package/dist/api/templates/package.json.js.map +1 -0
  39. package/dist/api/universalize.js +1 -0
  40. package/dist/api/universalize.js.map +1 -0
  41. package/dist/api/version.js +1 -0
  42. package/dist/api/version.js.map +1 -0
  43. package/dist/api/wasi-worker-template.d.ts +1 -0
  44. package/dist/api/wasi-worker-template.js +53 -0
  45. package/dist/api/wasi-worker-template.js.map +1 -0
  46. package/dist/cli.js +1 -0
  47. package/dist/cli.js.map +1 -0
  48. package/dist/commands/artifacts.js +1 -0
  49. package/dist/commands/artifacts.js.map +1 -0
  50. package/dist/commands/build.js +1 -0
  51. package/dist/commands/build.js.map +1 -0
  52. package/dist/commands/create-npm-dirs.js +1 -0
  53. package/dist/commands/create-npm-dirs.js.map +1 -0
  54. package/dist/commands/help.js +1 -0
  55. package/dist/commands/help.js.map +1 -0
  56. package/dist/commands/new.js +1 -0
  57. package/dist/commands/new.js.map +1 -0
  58. package/dist/commands/pre-publish.js +1 -0
  59. package/dist/commands/pre-publish.js.map +1 -0
  60. package/dist/commands/rename.js +1 -0
  61. package/dist/commands/rename.js.map +1 -0
  62. package/dist/commands/universalize.js +1 -0
  63. package/dist/commands/universalize.js.map +1 -0
  64. package/dist/commands/version.js +1 -0
  65. package/dist/commands/version.js.map +1 -0
  66. package/dist/def/artifacts.js +1 -0
  67. package/dist/def/artifacts.js.map +1 -0
  68. package/dist/def/build.js +1 -0
  69. package/dist/def/build.js.map +1 -0
  70. package/dist/def/create-npm-dirs.js +1 -0
  71. package/dist/def/create-npm-dirs.js.map +1 -0
  72. package/dist/def/new.js +1 -0
  73. package/dist/def/new.js.map +1 -0
  74. package/dist/def/pre-publish.js +1 -0
  75. package/dist/def/pre-publish.js.map +1 -0
  76. package/dist/def/rename.js +1 -0
  77. package/dist/def/rename.js.map +1 -0
  78. package/dist/def/universalize.js +1 -0
  79. package/dist/def/universalize.js.map +1 -0
  80. package/dist/def/version.js +1 -0
  81. package/dist/def/version.js.map +1 -0
  82. package/dist/index.cjs +537 -202
  83. package/dist/index.js +1 -0
  84. package/dist/index.js.map +1 -0
  85. package/dist/utils/__tests__/target.spec.js +1 -0
  86. package/dist/utils/__tests__/target.spec.js.map +1 -0
  87. package/dist/utils/__tests__/typegen.spec.js +1 -0
  88. package/dist/utils/__tests__/typegen.spec.js.map +1 -0
  89. package/dist/utils/__tests__/version.spec.js +1 -0
  90. package/dist/utils/__tests__/version.spec.js.map +1 -0
  91. package/dist/utils/cargo.js +1 -0
  92. package/dist/utils/cargo.js.map +1 -0
  93. package/dist/utils/ci.js +1 -0
  94. package/dist/utils/ci.js.map +1 -0
  95. package/dist/utils/config.d.ts +1 -1
  96. package/dist/utils/config.js +2 -1
  97. package/dist/utils/config.js.map +1 -0
  98. package/dist/utils/index.js +1 -0
  99. package/dist/utils/index.js.map +1 -0
  100. package/dist/utils/log.js +1 -0
  101. package/dist/utils/log.js.map +1 -0
  102. package/dist/utils/metadata.js +1 -0
  103. package/dist/utils/metadata.js.map +1 -0
  104. package/dist/utils/misc.js +1 -0
  105. package/dist/utils/misc.js.map +1 -0
  106. package/dist/utils/target.d.ts +4 -3
  107. package/dist/utils/target.js +10 -0
  108. package/dist/utils/target.js.map +1 -0
  109. package/dist/utils/typegen.js +1 -0
  110. package/dist/utils/typegen.js.map +1 -0
  111. package/dist/utils/version.js +1 -0
  112. package/dist/utils/version.js.map +1 -0
  113. package/package.json +43 -11
  114. package/src/api/artifacts.ts +5 -2
  115. package/src/api/build.ts +102 -16
  116. package/src/api/load-wasi-template.ts +65 -0
  117. package/src/api/new.ts +1 -4
  118. package/src/api/templates/.gitignore.ts +1 -0
  119. package/src/api/templates/ci-template.ts +47 -33
  120. package/src/api/templates/ci.yml.ts +1 -4
  121. package/src/api/templates/js-binding.ts +45 -11
  122. package/src/api/wasi-worker-template.ts +52 -0
  123. package/src/utils/config.ts +2 -2
  124. package/src/utils/target.ts +16 -7
package/dist/index.cjs CHANGED
@@ -1193,19 +1193,21 @@ var require_lib = __commonJS({
1193
1193
  message: `requires using`
1194
1194
  }
1195
1195
  };
1196
- function hasKeyRelationship(subject, relationship, others, { ignore = [] } = {}) {
1197
- const skipped = new Set(ignore);
1196
+ function hasKeyRelationship(subject, relationship, others, options) {
1197
+ var _a, _b;
1198
+ const skipped = new Set((_a = options === null || options === void 0 ? void 0 : options.ignore) !== null && _a !== void 0 ? _a : []);
1199
+ const check = checks[(_b = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _b !== void 0 ? _b : "missing"];
1198
1200
  const otherSet = new Set(others);
1199
1201
  const spec = keyRelationships[relationship];
1200
1202
  const conjunction = relationship === exports2.KeyRelationship.Forbids ? `or` : `and`;
1201
1203
  return makeValidator({
1202
1204
  test: (value, state) => {
1203
1205
  const keys2 = new Set(Object.keys(value));
1204
- if (!keys2.has(subject) || skipped.has(value[subject]))
1206
+ if (!check(keys2, subject, value) || skipped.has(value[subject]))
1205
1207
  return true;
1206
1208
  const problems = [];
1207
1209
  for (const key of otherSet)
1208
- if ((keys2.has(key) && !skipped.has(value[key])) !== spec.expect)
1210
+ if ((check(keys2, key, value) && !skipped.has(value[key])) !== spec.expect)
1209
1211
  problems.push(key);
1210
1212
  if (problems.length >= 1)
1211
1213
  return pushError(state, `Property "${subject}" ${spec.message} ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, conjunction)}`);
@@ -3810,7 +3812,7 @@ var require_dist_node = __commonJS({
3810
3812
  if (typeof navigator === "object" && "userAgent" in navigator) {
3811
3813
  return navigator.userAgent;
3812
3814
  }
3813
- if (typeof process === "object" && "version" in process) {
3815
+ if (typeof process === "object" && process.version !== void 0) {
3814
3816
  return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
3815
3817
  }
3816
3818
  return "<environment undetectable>";
@@ -4016,7 +4018,7 @@ var require_dist_node2 = __commonJS({
4016
4018
  });
4017
4019
  module2.exports = __toCommonJS2(dist_src_exports);
4018
4020
  var import_universal_user_agent = require_dist_node();
4019
- var VERSION = "9.0.0";
4021
+ var VERSION = "9.0.2";
4020
4022
  var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
4021
4023
  var DEFAULTS = {
4022
4024
  method: "GET",
@@ -4206,7 +4208,7 @@ var require_dist_node2 = __commonJS({
4206
4208
  }
4207
4209
  function expand(template, context) {
4208
4210
  var operators = ["+", "#", ".", "/", ";", "?", "&"];
4209
- return template.replace(
4211
+ template = template.replace(
4210
4212
  /\{([^\{\}]+)\}|([^\{\}]+)/g,
4211
4213
  function(_, expression, literal) {
4212
4214
  if (expression) {
@@ -4236,6 +4238,11 @@ var require_dist_node2 = __commonJS({
4236
4238
  }
4237
4239
  }
4238
4240
  );
4241
+ if (template === "/") {
4242
+ return template;
4243
+ } else {
4244
+ return template.replace(/\/$/, "");
4245
+ }
4239
4246
  }
4240
4247
  function parse3(options) {
4241
4248
  let method = options.method.toUpperCase();
@@ -4531,7 +4538,7 @@ var require_dist_node5 = __commonJS({
4531
4538
  module2.exports = __toCommonJS2(dist_src_exports);
4532
4539
  var import_endpoint = require_dist_node2();
4533
4540
  var import_universal_user_agent = require_dist_node();
4534
- var VERSION = "8.1.0";
4541
+ var VERSION = "8.1.4";
4535
4542
  var import_is_plain_object = require_is_plain_object();
4536
4543
  var import_request_error = require_dist_node4();
4537
4544
  function getBufferResponse(response) {
@@ -4553,7 +4560,7 @@ var require_dist_node5 = __commonJS({
4553
4560
  }
4554
4561
  if (!fetch) {
4555
4562
  throw new Error(
4556
- 'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.'
4563
+ "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
4557
4564
  );
4558
4565
  }
4559
4566
  return fetch(requestOptions.url, {
@@ -4631,7 +4638,15 @@ var require_dist_node5 = __commonJS({
4631
4638
  throw error;
4632
4639
  else if (error.name === "AbortError")
4633
4640
  throw error;
4634
- throw new import_request_error.RequestError(error.message, 500, {
4641
+ let message = error.message;
4642
+ if (error.name === "TypeError" && "cause" in error) {
4643
+ if (error.cause instanceof Error) {
4644
+ message = error.cause.message;
4645
+ } else if (typeof error.cause === "string") {
4646
+ message = error.cause;
4647
+ }
4648
+ }
4649
+ throw new import_request_error.RequestError(message, 500, {
4635
4650
  request: requestOptions
4636
4651
  });
4637
4652
  });
@@ -4718,7 +4733,7 @@ var require_dist_node6 = __commonJS({
4718
4733
  module2.exports = __toCommonJS2(dist_src_exports);
4719
4734
  var import_request3 = require_dist_node5();
4720
4735
  var import_universal_user_agent = require_dist_node();
4721
- var VERSION = "7.0.1";
4736
+ var VERSION = "7.0.2";
4722
4737
  var import_request2 = require_dist_node5();
4723
4738
  var import_request = require_dist_node5();
4724
4739
  function _buildMessageForResponseErrors(data) {
@@ -4928,7 +4943,7 @@ var require_dist_node8 = __commonJS({
4928
4943
  var import_request = require_dist_node5();
4929
4944
  var import_graphql = require_dist_node6();
4930
4945
  var import_auth_token = require_dist_node7();
4931
- var VERSION = "5.0.0";
4946
+ var VERSION = "5.0.1";
4932
4947
  var Octokit2 = class {
4933
4948
  static {
4934
4949
  this.VERSION = VERSION;
@@ -5135,7 +5150,7 @@ var require_dist_node10 = __commonJS({
5135
5150
  paginatingEndpoints: () => paginatingEndpoints
5136
5151
  });
5137
5152
  module2.exports = __toCommonJS2(dist_src_exports);
5138
- var VERSION = "8.0.0";
5153
+ var VERSION = "9.1.2";
5139
5154
  function normalizePaginatedListResponse(response) {
5140
5155
  if (!response.data) {
5141
5156
  return {
@@ -5232,9 +5247,13 @@ var require_dist_node10 = __commonJS({
5232
5247
  iterator
5233
5248
  });
5234
5249
  var paginatingEndpoints = [
5250
+ "GET /advisories",
5235
5251
  "GET /app/hook/deliveries",
5236
5252
  "GET /app/installation-requests",
5237
5253
  "GET /app/installations",
5254
+ "GET /assignments/{assignment_id}/accepted_assignments",
5255
+ "GET /classrooms",
5256
+ "GET /classrooms/{classroom_id}/assignments",
5238
5257
  "GET /enterprises/{enterprise}/dependabot/alerts",
5239
5258
  "GET /enterprises/{enterprise}/secret-scanning/alerts",
5240
5259
  "GET /events",
@@ -5254,13 +5273,8 @@ var require_dist_node10 = __commonJS({
5254
5273
  "GET /networks/{owner}/{repo}/events",
5255
5274
  "GET /notifications",
5256
5275
  "GET /organizations",
5257
- "GET /organizations/{org}/personal-access-token-requests",
5258
- "GET /organizations/{org}/personal-access-token-requests/{pat_request_id}/repositories",
5259
- "GET /organizations/{org}/personal-access-tokens",
5260
- "GET /organizations/{org}/personal-access-tokens/{pat_id}/repositories",
5261
5276
  "GET /orgs/{org}/actions/cache/usage-by-repository",
5262
5277
  "GET /orgs/{org}/actions/permissions/repositories",
5263
- "GET /orgs/{org}/actions/required_workflows",
5264
5278
  "GET /orgs/{org}/actions/runners",
5265
5279
  "GET /orgs/{org}/actions/secrets",
5266
5280
  "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
@@ -5271,6 +5285,7 @@ var require_dist_node10 = __commonJS({
5271
5285
  "GET /orgs/{org}/codespaces",
5272
5286
  "GET /orgs/{org}/codespaces/secrets",
5273
5287
  "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
5288
+ "GET /orgs/{org}/copilot/billing/seats",
5274
5289
  "GET /orgs/{org}/dependabot/alerts",
5275
5290
  "GET /orgs/{org}/dependabot/secrets",
5276
5291
  "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
@@ -5289,11 +5304,18 @@ var require_dist_node10 = __commonJS({
5289
5304
  "GET /orgs/{org}/outside_collaborators",
5290
5305
  "GET /orgs/{org}/packages",
5291
5306
  "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
5307
+ "GET /orgs/{org}/personal-access-token-requests",
5308
+ "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
5309
+ "GET /orgs/{org}/personal-access-tokens",
5310
+ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
5292
5311
  "GET /orgs/{org}/projects",
5312
+ "GET /orgs/{org}/properties/values",
5293
5313
  "GET /orgs/{org}/public_members",
5294
5314
  "GET /orgs/{org}/repos",
5295
5315
  "GET /orgs/{org}/rulesets",
5316
+ "GET /orgs/{org}/rulesets/rule-suites",
5296
5317
  "GET /orgs/{org}/secret-scanning/alerts",
5318
+ "GET /orgs/{org}/security-advisories",
5297
5319
  "GET /orgs/{org}/teams",
5298
5320
  "GET /orgs/{org}/teams/{team_slug}/discussions",
5299
5321
  "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
@@ -5307,12 +5329,10 @@ var require_dist_node10 = __commonJS({
5307
5329
  "GET /projects/columns/{column_id}/cards",
5308
5330
  "GET /projects/{project_id}/collaborators",
5309
5331
  "GET /projects/{project_id}/columns",
5310
- "GET /repos/{org}/{repo}/actions/required_workflows",
5311
5332
  "GET /repos/{owner}/{repo}/actions/artifacts",
5312
5333
  "GET /repos/{owner}/{repo}/actions/caches",
5313
5334
  "GET /repos/{owner}/{repo}/actions/organization-secrets",
5314
5335
  "GET /repos/{owner}/{repo}/actions/organization-variables",
5315
- "GET /repos/{owner}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/runs",
5316
5336
  "GET /repos/{owner}/{repo}/actions/runners",
5317
5337
  "GET /repos/{owner}/{repo}/actions/runs",
5318
5338
  "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
@@ -5322,6 +5342,7 @@ var require_dist_node10 = __commonJS({
5322
5342
  "GET /repos/{owner}/{repo}/actions/variables",
5323
5343
  "GET /repos/{owner}/{repo}/actions/workflows",
5324
5344
  "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
5345
+ "GET /repos/{owner}/{repo}/activity",
5325
5346
  "GET /repos/{owner}/{repo}/assignees",
5326
5347
  "GET /repos/{owner}/{repo}/branches",
5327
5348
  "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
@@ -5384,6 +5405,7 @@ var require_dist_node10 = __commonJS({
5384
5405
  "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
5385
5406
  "GET /repos/{owner}/{repo}/rules/branches/{branch}",
5386
5407
  "GET /repos/{owner}/{repo}/rulesets",
5408
+ "GET /repos/{owner}/{repo}/rulesets/rule-suites",
5387
5409
  "GET /repos/{owner}/{repo}/secret-scanning/alerts",
5388
5410
  "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
5389
5411
  "GET /repos/{owner}/{repo}/security-advisories",
@@ -5503,7 +5525,7 @@ var require_dist_node11 = __commonJS({
5503
5525
  restEndpointMethods: () => restEndpointMethods
5504
5526
  });
5505
5527
  module2.exports = __toCommonJS2(dist_src_exports);
5506
- var VERSION = "9.0.0";
5528
+ var VERSION = "10.1.2";
5507
5529
  var Endpoints = {
5508
5530
  actions: {
5509
5531
  addCustomLabelsToSelfHostedRunnerForOrg: [
@@ -5518,9 +5540,6 @@ var require_dist_node11 = __commonJS({
5518
5540
  addSelectedRepoToOrgVariable: [
5519
5541
  "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
5520
5542
  ],
5521
- addSelectedRepoToRequiredWorkflow: [
5522
- "PUT /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}"
5523
- ],
5524
5543
  approveWorkflowRun: [
5525
5544
  "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
5526
5545
  ],
@@ -5549,7 +5568,6 @@ var require_dist_node11 = __commonJS({
5549
5568
  "POST /repos/{owner}/{repo}/actions/runners/remove-token"
5550
5569
  ],
5551
5570
  createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
5552
- createRequiredWorkflow: ["POST /orgs/{org}/actions/required_workflows"],
5553
5571
  createWorkflowDispatch: [
5554
5572
  "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
5555
5573
  ],
@@ -5576,9 +5594,6 @@ var require_dist_node11 = __commonJS({
5576
5594
  deleteRepoVariable: [
5577
5595
  "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
5578
5596
  ],
5579
- deleteRequiredWorkflow: [
5580
- "DELETE /orgs/{org}/actions/required_workflows/{required_workflow_id}"
5581
- ],
5582
5597
  deleteSelfHostedRunnerFromOrg: [
5583
5598
  "DELETE /orgs/{org}/actions/runners/{runner_id}"
5584
5599
  ],
@@ -5613,6 +5628,9 @@ var require_dist_node11 = __commonJS({
5613
5628
  enableWorkflow: [
5614
5629
  "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
5615
5630
  ],
5631
+ forceCancelWorkflowRun: [
5632
+ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
5633
+ ],
5616
5634
  generateRunnerJitconfigForOrg: [
5617
5635
  "POST /orgs/{org}/actions/runners/generate-jitconfig"
5618
5636
  ],
@@ -5666,17 +5684,8 @@ var require_dist_node11 = __commonJS({
5666
5684
  { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
5667
5685
  ],
5668
5686
  getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
5669
- getRepoRequiredWorkflow: [
5670
- "GET /repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}"
5671
- ],
5672
- getRepoRequiredWorkflowUsage: [
5673
- "GET /repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/timing"
5674
- ],
5675
5687
  getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
5676
5688
  getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
5677
- getRequiredWorkflow: [
5678
- "GET /orgs/{org}/actions/required_workflows/{required_workflow_id}"
5679
- ],
5680
5689
  getReviewsForRun: [
5681
5690
  "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
5682
5691
  ],
@@ -5725,16 +5734,9 @@ var require_dist_node11 = __commonJS({
5725
5734
  listRepoOrganizationVariables: [
5726
5735
  "GET /repos/{owner}/{repo}/actions/organization-variables"
5727
5736
  ],
5728
- listRepoRequiredWorkflows: [
5729
- "GET /repos/{org}/{repo}/actions/required_workflows"
5730
- ],
5731
5737
  listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
5732
5738
  listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
5733
5739
  listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
5734
- listRequiredWorkflowRuns: [
5735
- "GET /repos/{owner}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/runs"
5736
- ],
5737
- listRequiredWorkflows: ["GET /orgs/{org}/actions/required_workflows"],
5738
5740
  listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
5739
5741
  listRunnerApplicationsForRepo: [
5740
5742
  "GET /repos/{owner}/{repo}/actions/runners/downloads"
@@ -5748,9 +5750,6 @@ var require_dist_node11 = __commonJS({
5748
5750
  listSelectedRepositoriesEnabledGithubActionsOrganization: [
5749
5751
  "GET /orgs/{org}/actions/permissions/repositories"
5750
5752
  ],
5751
- listSelectedRepositoriesRequiredWorkflow: [
5752
- "GET /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories"
5753
- ],
5754
5753
  listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
5755
5754
  listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
5756
5755
  listWorkflowRunArtifacts: [
@@ -5785,9 +5784,6 @@ var require_dist_node11 = __commonJS({
5785
5784
  removeSelectedRepoFromOrgVariable: [
5786
5785
  "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
5787
5786
  ],
5788
- removeSelectedRepoFromRequiredWorkflow: [
5789
- "DELETE /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}"
5790
- ],
5791
5787
  reviewCustomGatesForRun: [
5792
5788
  "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
5793
5789
  ],
@@ -5824,9 +5820,6 @@ var require_dist_node11 = __commonJS({
5824
5820
  setSelectedReposForOrgVariable: [
5825
5821
  "PUT /orgs/{org}/actions/variables/{name}/repositories"
5826
5822
  ],
5827
- setSelectedReposToRequiredWorkflow: [
5828
- "PUT /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories"
5829
- ],
5830
5823
  setSelectedRepositoriesEnabledGithubActionsOrganization: [
5831
5824
  "PUT /orgs/{org}/actions/permissions/repositories"
5832
5825
  ],
@@ -5839,9 +5832,6 @@ var require_dist_node11 = __commonJS({
5839
5832
  updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
5840
5833
  updateRepoVariable: [
5841
5834
  "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
5842
- ],
5843
- updateRequiredWorkflow: [
5844
- "PATCH /orgs/{org}/actions/required_workflows/{required_workflow_id}"
5845
5835
  ]
5846
5836
  },
5847
5837
  activity: {
@@ -6050,6 +6040,9 @@ var require_dist_node11 = __commonJS({
6050
6040
  addSelectedRepoToOrgSecret: [
6051
6041
  "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
6052
6042
  ],
6043
+ checkPermissionsForDevcontainer: [
6044
+ "GET /repos/{owner}/{repo}/codespaces/permissions_check"
6045
+ ],
6053
6046
  codespaceMachinesForAuthenticatedUser: [
6054
6047
  "GET /user/codespaces/{codespace_name}/machines"
6055
6048
  ],
@@ -6069,9 +6062,6 @@ var require_dist_node11 = __commonJS({
6069
6062
  createWithRepoForAuthenticatedUser: [
6070
6063
  "POST /repos/{owner}/{repo}/codespaces"
6071
6064
  ],
6072
- deleteCodespacesBillingUsers: [
6073
- "DELETE /orgs/{org}/codespaces/billing/selected_users"
6074
- ],
6075
6065
  deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
6076
6066
  deleteFromOrganization: [
6077
6067
  "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
@@ -6143,10 +6133,6 @@ var require_dist_node11 = __commonJS({
6143
6133
  repoMachinesForAuthenticatedUser: [
6144
6134
  "GET /repos/{owner}/{repo}/codespaces/machines"
6145
6135
  ],
6146
- setCodespacesBilling: ["PUT /orgs/{org}/codespaces/billing"],
6147
- setCodespacesBillingUsers: [
6148
- "POST /orgs/{org}/codespaces/billing/selected_users"
6149
- ],
6150
6136
  setRepositoriesForSecretForAuthenticatedUser: [
6151
6137
  "PUT /user/codespaces/secrets/{secret_name}/repositories"
6152
6138
  ],
@@ -6160,6 +6146,25 @@ var require_dist_node11 = __commonJS({
6160
6146
  ],
6161
6147
  updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
6162
6148
  },
6149
+ copilot: {
6150
+ addCopilotForBusinessSeatsForTeams: [
6151
+ "POST /orgs/{org}/copilot/billing/selected_teams"
6152
+ ],
6153
+ addCopilotForBusinessSeatsForUsers: [
6154
+ "POST /orgs/{org}/copilot/billing/selected_users"
6155
+ ],
6156
+ cancelCopilotSeatAssignmentForTeams: [
6157
+ "DELETE /orgs/{org}/copilot/billing/selected_teams"
6158
+ ],
6159
+ cancelCopilotSeatAssignmentForUsers: [
6160
+ "DELETE /orgs/{org}/copilot/billing/selected_users"
6161
+ ],
6162
+ getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
6163
+ getCopilotSeatDetailsForUser: [
6164
+ "GET /orgs/{org}/members/{username}/copilot"
6165
+ ],
6166
+ listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
6167
+ },
6163
6168
  dependabot: {
6164
6169
  addSelectedRepoToOrgSecret: [
6165
6170
  "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
@@ -6368,7 +6373,13 @@ var require_dist_node11 = __commonJS({
6368
6373
  root: ["GET /"]
6369
6374
  },
6370
6375
  migrations: {
6371
- cancelImport: ["DELETE /repos/{owner}/{repo}/import"],
6376
+ cancelImport: [
6377
+ "DELETE /repos/{owner}/{repo}/import",
6378
+ {},
6379
+ {
6380
+ deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
6381
+ }
6382
+ ],
6372
6383
  deleteArchiveForAuthenticatedUser: [
6373
6384
  "DELETE /user/migrations/{migration_id}/archive"
6374
6385
  ],
@@ -6381,9 +6392,27 @@ var require_dist_node11 = __commonJS({
6381
6392
  getArchiveForAuthenticatedUser: [
6382
6393
  "GET /user/migrations/{migration_id}/archive"
6383
6394
  ],
6384
- getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"],
6385
- getImportStatus: ["GET /repos/{owner}/{repo}/import"],
6386
- getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"],
6395
+ getCommitAuthors: [
6396
+ "GET /repos/{owner}/{repo}/import/authors",
6397
+ {},
6398
+ {
6399
+ deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
6400
+ }
6401
+ ],
6402
+ getImportStatus: [
6403
+ "GET /repos/{owner}/{repo}/import",
6404
+ {},
6405
+ {
6406
+ deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
6407
+ }
6408
+ ],
6409
+ getLargeFiles: [
6410
+ "GET /repos/{owner}/{repo}/import/large_files",
6411
+ {},
6412
+ {
6413
+ deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
6414
+ }
6415
+ ],
6387
6416
  getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
6388
6417
  getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
6389
6418
  listForAuthenticatedUser: ["GET /user/migrations"],
@@ -6397,18 +6426,42 @@ var require_dist_node11 = __commonJS({
6397
6426
  {},
6398
6427
  { renamed: ["migrations", "listReposForAuthenticatedUser"] }
6399
6428
  ],
6400
- mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"],
6401
- setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"],
6429
+ mapCommitAuthor: [
6430
+ "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
6431
+ {},
6432
+ {
6433
+ deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
6434
+ }
6435
+ ],
6436
+ setLfsPreference: [
6437
+ "PATCH /repos/{owner}/{repo}/import/lfs",
6438
+ {},
6439
+ {
6440
+ deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
6441
+ }
6442
+ ],
6402
6443
  startForAuthenticatedUser: ["POST /user/migrations"],
6403
6444
  startForOrg: ["POST /orgs/{org}/migrations"],
6404
- startImport: ["PUT /repos/{owner}/{repo}/import"],
6445
+ startImport: [
6446
+ "PUT /repos/{owner}/{repo}/import",
6447
+ {},
6448
+ {
6449
+ deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
6450
+ }
6451
+ ],
6405
6452
  unlockRepoForAuthenticatedUser: [
6406
6453
  "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
6407
6454
  ],
6408
6455
  unlockRepoForOrg: [
6409
6456
  "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
6410
6457
  ],
6411
- updateImport: ["PATCH /repos/{owner}/{repo}/import"]
6458
+ updateImport: [
6459
+ "PATCH /repos/{owner}/{repo}/import",
6460
+ {},
6461
+ {
6462
+ deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
6463
+ }
6464
+ ]
6412
6465
  },
6413
6466
  orgs: {
6414
6467
  addSecurityManagerTeam: [
@@ -6423,6 +6476,13 @@ var require_dist_node11 = __commonJS({
6423
6476
  "PUT /orgs/{org}/outside_collaborators/{username}"
6424
6477
  ],
6425
6478
  createInvitation: ["POST /orgs/{org}/invitations"],
6479
+ createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
6480
+ createOrUpdateCustomPropertiesValuesForRepos: [
6481
+ "PATCH /orgs/{org}/properties/values"
6482
+ ],
6483
+ createOrUpdateCustomProperty: [
6484
+ "PUT /orgs/{org}/properties/schema/{custom_property_name}"
6485
+ ],
6426
6486
  createWebhook: ["POST /orgs/{org}/hooks"],
6427
6487
  delete: ["DELETE /orgs/{org}"],
6428
6488
  deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
@@ -6430,6 +6490,10 @@ var require_dist_node11 = __commonJS({
6430
6490
  "POST /orgs/{org}/{security_product}/{enablement}"
6431
6491
  ],
6432
6492
  get: ["GET /orgs/{org}"],
6493
+ getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
6494
+ getCustomProperty: [
6495
+ "GET /orgs/{org}/properties/schema/{custom_property_name}"
6496
+ ],
6433
6497
  getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
6434
6498
  getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
6435
6499
  getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
@@ -6440,6 +6504,7 @@ var require_dist_node11 = __commonJS({
6440
6504
  list: ["GET /organizations"],
6441
6505
  listAppInstallations: ["GET /orgs/{org}/installations"],
6442
6506
  listBlockedUsers: ["GET /orgs/{org}/blocks"],
6507
+ listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
6443
6508
  listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
6444
6509
  listForAuthenticatedUser: ["GET /user/orgs"],
6445
6510
  listForUser: ["GET /users/{username}/orgs"],
@@ -6448,15 +6513,13 @@ var require_dist_node11 = __commonJS({
6448
6513
  listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
6449
6514
  listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
6450
6515
  listPatGrantRepositories: [
6451
- "GET /organizations/{org}/personal-access-tokens/{pat_id}/repositories"
6516
+ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
6452
6517
  ],
6453
6518
  listPatGrantRequestRepositories: [
6454
- "GET /organizations/{org}/personal-access-token-requests/{pat_request_id}/repositories"
6455
- ],
6456
- listPatGrantRequests: [
6457
- "GET /organizations/{org}/personal-access-token-requests"
6519
+ "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
6458
6520
  ],
6459
- listPatGrants: ["GET /organizations/{org}/personal-access-tokens"],
6521
+ listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
6522
+ listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
6460
6523
  listPendingInvitations: ["GET /orgs/{org}/invitations"],
6461
6524
  listPublicMembers: ["GET /orgs/{org}/public_members"],
6462
6525
  listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
@@ -6466,6 +6529,9 @@ var require_dist_node11 = __commonJS({
6466
6529
  redeliverWebhookDelivery: [
6467
6530
  "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
6468
6531
  ],
6532
+ removeCustomProperty: [
6533
+ "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
6534
+ ],
6469
6535
  removeMember: ["DELETE /orgs/{org}/members/{username}"],
6470
6536
  removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
6471
6537
  removeOutsideCollaborator: [
@@ -6478,10 +6544,10 @@ var require_dist_node11 = __commonJS({
6478
6544
  "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
6479
6545
  ],
6480
6546
  reviewPatGrantRequest: [
6481
- "POST /organizations/{org}/personal-access-token-requests/{pat_request_id}"
6547
+ "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
6482
6548
  ],
6483
6549
  reviewPatGrantRequestsInBulk: [
6484
- "POST /organizations/{org}/personal-access-token-requests"
6550
+ "POST /orgs/{org}/personal-access-token-requests"
6485
6551
  ],
6486
6552
  setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
6487
6553
  setPublicMembershipForAuthenticatedUser: [
@@ -6492,10 +6558,8 @@ var require_dist_node11 = __commonJS({
6492
6558
  updateMembershipForAuthenticatedUser: [
6493
6559
  "PATCH /user/memberships/orgs/{org}"
6494
6560
  ],
6495
- updatePatAccess: [
6496
- "POST /organizations/{org}/personal-access-tokens/{pat_id}"
6497
- ],
6498
- updatePatAccesses: ["POST /organizations/{org}/personal-access-tokens"],
6561
+ updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
6562
+ updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
6499
6563
  updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
6500
6564
  updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
6501
6565
  },
@@ -6775,6 +6839,9 @@ var require_dist_node11 = __commonJS({
6775
6839
  {},
6776
6840
  { mapToData: "users" }
6777
6841
  ],
6842
+ checkAutomatedSecurityFixes: [
6843
+ "GET /repos/{owner}/{repo}/automated-security-fixes"
6844
+ ],
6778
6845
  checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
6779
6846
  checkVulnerabilityAlerts: [
6780
6847
  "GET /repos/{owner}/{repo}/vulnerability-alerts"
@@ -6878,7 +6945,9 @@ var require_dist_node11 = __commonJS({
6878
6945
  disableDeploymentProtectionRule: [
6879
6946
  "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
6880
6947
  ],
6881
- disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"],
6948
+ disablePrivateVulnerabilityReporting: [
6949
+ "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
6950
+ ],
6882
6951
  disableVulnerabilityAlerts: [
6883
6952
  "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
6884
6953
  ],
@@ -6892,7 +6961,9 @@ var require_dist_node11 = __commonJS({
6892
6961
  enableAutomatedSecurityFixes: [
6893
6962
  "PUT /repos/{owner}/{repo}/automated-security-fixes"
6894
6963
  ],
6895
- enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"],
6964
+ enablePrivateVulnerabilityReporting: [
6965
+ "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
6966
+ ],
6896
6967
  enableVulnerabilityAlerts: [
6897
6968
  "PUT /repos/{owner}/{repo}/vulnerability-alerts"
6898
6969
  ],
@@ -6941,6 +7012,7 @@ var require_dist_node11 = __commonJS({
6941
7012
  getCustomDeploymentProtectionRule: [
6942
7013
  "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
6943
7014
  ],
7015
+ getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
6944
7016
  getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
6945
7017
  getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
6946
7018
  getDeploymentBranchPolicy: [
@@ -6954,6 +7026,8 @@ var require_dist_node11 = __commonJS({
6954
7026
  ],
6955
7027
  getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
6956
7028
  getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
7029
+ getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
7030
+ getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
6957
7031
  getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
6958
7032
  getOrgRulesets: ["GET /orgs/{org}/rulesets"],
6959
7033
  getPages: ["GET /repos/{owner}/{repo}/pages"],
@@ -6969,6 +7043,10 @@ var require_dist_node11 = __commonJS({
6969
7043
  getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
6970
7044
  getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
6971
7045
  getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
7046
+ getRepoRuleSuite: [
7047
+ "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
7048
+ ],
7049
+ getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
6972
7050
  getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
6973
7051
  getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
6974
7052
  getStatusChecksProtection: [
@@ -6990,6 +7068,7 @@ var require_dist_node11 = __commonJS({
6990
7068
  getWebhookDelivery: [
6991
7069
  "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
6992
7070
  ],
7071
+ listActivities: ["GET /repos/{owner}/{repo}/activity"],
6993
7072
  listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
6994
7073
  listBranches: ["GET /repos/{owner}/{repo}/branches"],
6995
7074
  listBranchesForHeadCommit: [
@@ -7169,9 +7248,15 @@ var require_dist_node11 = __commonJS({
7169
7248
  createRepositoryAdvisory: [
7170
7249
  "POST /repos/{owner}/{repo}/security-advisories"
7171
7250
  ],
7251
+ createRepositoryAdvisoryCveRequest: [
7252
+ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
7253
+ ],
7254
+ getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
7172
7255
  getRepositoryAdvisory: [
7173
7256
  "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
7174
7257
  ],
7258
+ listGlobalAdvisories: ["GET /advisories"],
7259
+ listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
7175
7260
  listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
7176
7261
  updateRepositoryAdvisory: [
7177
7262
  "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
@@ -7395,11 +7480,41 @@ var require_dist_node11 = __commonJS({
7395
7480
  }
7396
7481
  }
7397
7482
  var handler = {
7483
+ has({ scope }, methodName) {
7484
+ return endpointMethodsMap.get(scope).has(methodName);
7485
+ },
7486
+ getOwnPropertyDescriptor(target, methodName) {
7487
+ return {
7488
+ value: this.get(target, methodName),
7489
+ // ensures method is in the cache
7490
+ configurable: true,
7491
+ writable: true,
7492
+ enumerable: true
7493
+ };
7494
+ },
7495
+ defineProperty(target, methodName, descriptor) {
7496
+ Object.defineProperty(target.cache, methodName, descriptor);
7497
+ return true;
7498
+ },
7499
+ deleteProperty(target, methodName) {
7500
+ delete target.cache[methodName];
7501
+ return true;
7502
+ },
7503
+ ownKeys({ scope }) {
7504
+ return [...endpointMethodsMap.get(scope).keys()];
7505
+ },
7506
+ set(target, methodName, value) {
7507
+ return target.cache[methodName] = value;
7508
+ },
7398
7509
  get({ octokit, scope, cache }, methodName) {
7399
7510
  if (cache[methodName]) {
7400
7511
  return cache[methodName];
7401
7512
  }
7402
- const { decorations, endpointDefaults } = endpointMethodsMap.get(scope).get(methodName);
7513
+ const method = endpointMethodsMap.get(scope).get(methodName);
7514
+ if (!method) {
7515
+ return void 0;
7516
+ }
7517
+ const { endpointDefaults, decorations } = method;
7403
7518
  if (decorations) {
7404
7519
  cache[methodName] = decorate(
7405
7520
  octokit,
@@ -7510,7 +7625,7 @@ var require_dist_node12 = __commonJS({
7510
7625
  var import_plugin_request_log = require_dist_node9();
7511
7626
  var import_plugin_paginate_rest = require_dist_node10();
7512
7627
  var import_plugin_rest_endpoint_methods = require_dist_node11();
7513
- var VERSION = "20.0.1";
7628
+ var VERSION = "20.0.2";
7514
7629
  var Octokit2 = import_core.Octokit.plugin(
7515
7630
  import_plugin_request_log.requestLog,
7516
7631
  import_plugin_rest_endpoint_methods.legacyRestEndpointMethods,
@@ -7529,7 +7644,7 @@ __export(dist_exports, {
7529
7644
  module.exports = __toCommonJS(dist_exports);
7530
7645
 
7531
7646
  // dist/api/artifacts.js
7532
- var import_path = require("path");
7647
+ var import_node_path = require("node:path");
7533
7648
 
7534
7649
  // ../node_modules/colorette/index.js
7535
7650
  var tty = __toESM(require("tty"), 1);
@@ -7784,6 +7899,15 @@ var UniArchsByPlatform = {
7784
7899
  darwin: ["x64", "arm64"]
7785
7900
  };
7786
7901
  function parseTriple(rawTriple) {
7902
+ if (rawTriple === "wasm32-wasi-preview1-threads") {
7903
+ return {
7904
+ triple: rawTriple,
7905
+ platformArchABI: rawTriple,
7906
+ platform: "wasi",
7907
+ arch: "wasm32",
7908
+ abi: "wasi"
7909
+ };
7910
+ }
7787
7911
  const triple = rawTriple.endsWith("eabi") ? `${rawTriple.slice(0, -4)}-eabi` : rawTriple;
7788
7912
  const triples = triple.split("-");
7789
7913
  let cpu;
@@ -10291,7 +10415,7 @@ async function readNapiConfig(path2) {
10291
10415
  napiConfig.packageName = userNapiConfig.package.name;
10292
10416
  }
10293
10417
  if (!targets.length) {
10294
- if (userNapiConfig.triples?.default) {
10418
+ if (userNapiConfig.triples?.defaults) {
10295
10419
  targets = targets.concat(DEFAULT_TARGETS);
10296
10420
  }
10297
10421
  if (userNapiConfig.triples?.additional?.length) {
@@ -10507,15 +10631,17 @@ function correctStringIdent(src, ident) {
10507
10631
  var debug2 = debugFactory("artifacts");
10508
10632
  async function collectArtifacts(userOptions) {
10509
10633
  const options = applyDefaultArtifactsOptions(userOptions);
10510
- const packageJsonPath = (0, import_path.resolve)(options.cwd, options.packageJsonPath);
10634
+ const packageJsonPath = (0, import_node_path.resolve)(options.cwd, options.packageJsonPath);
10511
10635
  const { targets, binaryName } = await readNapiConfig(packageJsonPath);
10512
- const distDirs = targets.map((platform2) => (0, import_path.resolve)(options.cwd, options.npmDir, platform2.platformArchABI));
10636
+ const distDirs = targets.map((platform2) => (0, import_node_path.resolve)(options.cwd, options.npmDir, platform2.platformArchABI));
10513
10637
  const universalSourceBins = new Set(targets.filter((platform2) => platform2.arch === "universal").flatMap((p) => UniArchsByPlatform[p.platform]?.map((a) => `${p.platform}-${a}`)).filter(Boolean));
10514
- await collectNodeBinaries((0, import_path.resolve)(options.cwd, options.outputDir)).then((output) => Promise.all(output.map(async (filePath) => {
10638
+ await collectNodeBinaries((0, import_node_path.resolve)(options.cwd, options.outputDir)).then((output) => Promise.all(output.map(async (filePath) => {
10515
10639
  debug2.info(`Read [${yellowBright(filePath)}]`);
10516
10640
  const sourceContent = await readFileAsync(filePath);
10517
- const parsedName = (0, import_path.parse)(filePath);
10518
- const [_binaryName, platformArchABI] = parsedName.name.split(".");
10641
+ const parsedName = (0, import_node_path.parse)(filePath);
10642
+ const terms = parsedName.name.split(".");
10643
+ const platformArchABI = terms.pop();
10644
+ const _binaryName = terms.join(".");
10519
10645
  if (_binaryName !== binaryName) {
10520
10646
  debug2.warn(`[${_binaryName}] is not matched with [${binaryName}], skip`);
10521
10647
  return;
@@ -10528,29 +10654,92 @@ async function collectArtifacts(userOptions) {
10528
10654
  if (!dir) {
10529
10655
  throw new Error(`No dist dir found for ${filePath}`);
10530
10656
  }
10531
- const distFilePath = (0, import_path.join)(dir, parsedName.base);
10657
+ const distFilePath = (0, import_node_path.join)(dir, parsedName.base);
10532
10658
  debug2.info(`Write file content to [${yellowBright(distFilePath)}]`);
10533
10659
  await writeFileAsync(distFilePath, sourceContent);
10534
- const distFilePathLocal = (0, import_path.join)((0, import_path.parse)(packageJsonPath).dir, parsedName.base);
10660
+ const distFilePathLocal = (0, import_node_path.join)((0, import_node_path.parse)(packageJsonPath).dir, parsedName.base);
10535
10661
  debug2.info(`Write file content to [${yellowBright(distFilePathLocal)}]`);
10536
10662
  await writeFileAsync(distFilePathLocal, sourceContent);
10537
10663
  })));
10538
10664
  }
10539
10665
  async function collectNodeBinaries(root2) {
10540
10666
  const files = await readdirAsync(root2, { withFileTypes: true });
10541
- const nodeBinaries = files.filter((file) => file.isFile() && file.name.endsWith(".node")).map((file) => (0, import_path.join)(root2, file.name));
10667
+ const nodeBinaries = files.filter((file) => file.isFile() && file.name.endsWith(".node")).map((file) => (0, import_node_path.join)(root2, file.name));
10542
10668
  const dirs = files.filter((file) => file.isDirectory());
10543
10669
  for (const dir of dirs) {
10544
- nodeBinaries.push(...await collectNodeBinaries((0, import_path.join)(root2, dir.name)));
10670
+ nodeBinaries.push(...await collectNodeBinaries((0, import_node_path.join)(root2, dir.name)));
10545
10671
  }
10546
10672
  return nodeBinaries;
10547
10673
  }
10548
10674
 
10549
10675
  // dist/api/build.js
10550
- var import_child_process4 = require("child_process");
10551
- var import_crypto = require("crypto");
10552
- var import_os = require("os");
10553
- var import_path2 = require("path");
10676
+ var import_node_child_process = require("node:child_process");
10677
+ var import_node_crypto = require("node:crypto");
10678
+ var import_node_module = require("node:module");
10679
+ var import_node_os = require("node:os");
10680
+ var import_node_path2 = require("node:path");
10681
+
10682
+ // dist/api/load-wasi-template.js
10683
+ var createWasiBinding = (wasmFileName, wasiRegisterFunctions) => `/* eslint-disable */
10684
+ /* prettier-ignore */
10685
+
10686
+ /* auto-generated by NAPI-RS */
10687
+
10688
+ import * as __nodeFsPromises from 'node:fs/promises'
10689
+ import * as __nodePath from 'node:path'
10690
+ import { WASI as __nodeWASI } from 'node:wasi'
10691
+ import { Worker } from 'node:worker_threads'
10692
+ import * as __nodeURL from 'node:url'
10693
+
10694
+ import { instantiateNapiModule as __emnapiInstantiateNapiModule } from '@emnapi/core'
10695
+ import { getDefaultContext as __emnapiGetDefaultContext } from '@emnapi/runtime'
10696
+
10697
+ const __wasi = new __nodeWASI({
10698
+ env: process.env,
10699
+ preopens: {
10700
+ '/': __nodePath.join(__nodeURL.fileURLToPath(import.meta.url), '..'),
10701
+ }
10702
+ })
10703
+
10704
+ const __dirname = __nodePath.join(__nodeURL.fileURLToPath(import.meta.url), '..')
10705
+
10706
+ const __emnapiContext = __emnapiGetDefaultContext()
10707
+
10708
+ const __sharedMemory = new WebAssembly.Memory({
10709
+ initial: 1024,
10710
+ maximum: 10240,
10711
+ shared: true,
10712
+ })
10713
+
10714
+ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule } = await __emnapiInstantiateNapiModule(__nodeFsPromises.readFile(__nodePath.join(__dirname, '${wasmFileName}.wasm')), {
10715
+ context: __emnapiContext,
10716
+ asyncWorkPoolSize: 4,
10717
+ wasi: __wasi,
10718
+ onCreateWorker() {
10719
+ return new Worker(__nodePath.join(__dirname, 'wasi-worker.mjs'), {
10720
+ env: process.env,
10721
+ execArgv: ['--experimental-wasi-unstable-preview1'],
10722
+ })
10723
+ },
10724
+ overwriteImports(importObject) {
10725
+ importObject.env = {
10726
+ ...importObject.env,
10727
+ ...importObject.napi,
10728
+ ...importObject.emnapi,
10729
+ memory: __sharedMemory,
10730
+ }
10731
+ },
10732
+ beforeInit({ instance }) {
10733
+ __napi_rs_initialize_modules(instance)
10734
+ }
10735
+ })
10736
+
10737
+ function __napi_rs_initialize_modules(__napiInstance) {
10738
+ ${wasiRegisterFunctions.map((name) => ` __napiInstance.exports['${name}']()`).join("\n")}
10739
+ }
10740
+
10741
+ const binding = __napiModule.exports
10742
+ `;
10554
10743
 
10555
10744
  // dist/api/templates/.gitignore.js
10556
10745
  var gitIgnore = `# Created by https://www.toptal.com/developers/gitignore/api/node
@@ -10750,6 +10939,7 @@ Cargo.lock
10750
10939
  !.yarn/versions
10751
10940
 
10752
10941
  *.node
10942
+ *.wasm
10753
10943
  `;
10754
10944
 
10755
10945
  // dist/api/templates/.npmignore.js
@@ -13466,6 +13656,10 @@ env:
13466
13656
  DEBUG: 'napi:*'
13467
13657
  MACOSX_DEPLOYMENT_TARGET: '10.13'
13468
13658
 
13659
+ permissions:
13660
+ contents: write
13661
+ id-token: write
13662
+
13469
13663
  on:
13470
13664
  push:
13471
13665
  branches:
@@ -13575,10 +13769,10 @@ jobs:
13575
13769
  runs-on: \${{ matrix.settings.host }}
13576
13770
 
13577
13771
  steps:
13578
- - uses: actions/checkout@v3
13772
+ - uses: actions/checkout@v4
13579
13773
 
13580
13774
  - name: Setup node
13581
- uses: actions/setup-node@v3
13775
+ uses: actions/setup-node@v4
13582
13776
  if: \${{ !matrix.settings.docker }}
13583
13777
  with:
13584
13778
  node-version: 18
@@ -13605,7 +13799,7 @@ jobs:
13605
13799
  - uses: goto-bus-stop/setup-zig@v2
13606
13800
  if: \${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
13607
13801
  with:
13608
- version: 0.10.1
13802
+ version: 0.11.0
13609
13803
 
13610
13804
  - name: Setup toolchain
13611
13805
  run: \${{ matrix.settings.setup }}
@@ -13621,7 +13815,7 @@ jobs:
13621
13815
  run: yarn install
13622
13816
 
13623
13817
  - name: Setup node x86
13624
- uses: actions/setup-node@v3
13818
+ uses: actions/setup-node@v4
13625
13819
  if: matrix.settings.target == 'i686-pc-windows-msvc'
13626
13820
  with:
13627
13821
  node-version: 18
@@ -13652,32 +13846,32 @@ jobs:
13652
13846
  runs-on: macos-12
13653
13847
  name: Build FreeBSD
13654
13848
  steps:
13655
- - uses: actions/checkout@v3
13849
+ - uses: actions/checkout@v4
13656
13850
  - name: Build
13657
13851
  id: build
13658
- uses: vmactions/freebsd-vm@v0
13852
+ uses: cross-platform-actions/action@v0.21.0
13659
13853
  env:
13660
13854
  DEBUG: 'napi:*'
13661
- RUSTUP_HOME: /usr/local/rustup
13662
- CARGO_HOME: /usr/local/cargo
13663
13855
  RUSTUP_IO_THREADS: 1
13664
13856
  with:
13665
- envs: 'DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS'
13666
- usesh: true
13667
- mem: 3000
13857
+ operating_system: freebsd
13858
+ version: '13.2'
13859
+ memory: 13G
13860
+ cpu_count: 3
13861
+ environment_variables: 'DEBUG RUSTUP_IO_THREADS'
13862
+ shell: bash
13668
13863
  prepare: |
13669
- pkg install -y -f curl node libnghttp2 npm yarn
13864
+ sudo pkg install -y -f curl node libnghttp2 npm
13865
+ sudo npm install -g yarn --ignore-scripts
13670
13866
  curl https://sh.rustup.rs -sSf --output rustup.sh
13671
- sh rustup.sh -y --profile minimal --default-toolchain beta
13672
- export PATH="/usr/local/cargo/bin:$PATH"
13867
+ sh rustup.sh -y --profile minimal --default-toolchain stable
13868
+ source "$HOME/.cargo/env"
13673
13869
  echo "~~~~ rustc --version ~~~~"
13674
13870
  rustc --version
13675
13871
  echo "~~~~ node -v ~~~~"
13676
13872
  node -v
13677
13873
  echo "~~~~ yarn --version ~~~~"
13678
13874
  yarn --version
13679
- run: |
13680
- export PATH="/usr/local/cargo/bin:$PATH"
13681
13875
  pwd
13682
13876
  ls -lah
13683
13877
  whoami
@@ -13710,13 +13904,14 @@ jobs:
13710
13904
  - host: windows-latest
13711
13905
  target: 'x86_64-pc-windows-msvc'
13712
13906
  node: ['16', '18']
13907
+ node: ['18', '20']
13713
13908
  runs-on: \${{ matrix.settings.host }}
13714
13909
 
13715
13910
  steps:
13716
- - uses: actions/checkout@v3
13911
+ - uses: actions/checkout@v4
13717
13912
 
13718
13913
  - name: Setup node
13719
- uses: actions/setup-node@v3
13914
+ uses: actions/setup-node@v4
13720
13915
  with:
13721
13916
  node-version: \${{ matrix.node }}
13722
13917
  cache: 'yarn'
@@ -13745,13 +13940,14 @@ jobs:
13745
13940
  fail-fast: false
13746
13941
  matrix:
13747
13942
  node: ['16', '18']
13943
+ node: ['18', '20']
13748
13944
  runs-on: ubuntu-latest
13749
13945
 
13750
13946
  steps:
13751
- - uses: actions/checkout@v3
13947
+ - uses: actions/checkout@v4
13752
13948
 
13753
13949
  - name: Setup node
13754
- uses: actions/setup-node@v3
13950
+ uses: actions/setup-node@v4
13755
13951
  with:
13756
13952
  node-version: \${{ matrix.node }}
13757
13953
  cache: 'yarn'
@@ -13780,13 +13976,14 @@ jobs:
13780
13976
  fail-fast: false
13781
13977
  matrix:
13782
13978
  node: ['16', '18']
13979
+ node: ['18', '20']
13783
13980
  runs-on: ubuntu-latest
13784
13981
 
13785
13982
  steps:
13786
- - uses: actions/checkout@v3
13983
+ - uses: actions/checkout@v4
13787
13984
 
13788
13985
  - name: Setup node
13789
- uses: actions/setup-node@v3
13986
+ uses: actions/setup-node@v4
13790
13987
  with:
13791
13988
  node-version: \${{ matrix.node }}
13792
13989
  cache: 'yarn'
@@ -13817,10 +14014,11 @@ jobs:
13817
14014
  fail-fast: false
13818
14015
  matrix:
13819
14016
  node: ['16', '18']
14017
+ node: ['18', '20']
13820
14018
  runs-on: ubuntu-latest
13821
14019
 
13822
14020
  steps:
13823
- - uses: actions/checkout@v3
14021
+ - uses: actions/checkout@v4
13824
14022
 
13825
14023
  - name: Download artifacts
13826
14024
  uses: actions/download-artifact@v3
@@ -13839,7 +14037,7 @@ jobs:
13839
14037
  yarn install
13840
14038
 
13841
14039
  - name: Set up QEMU
13842
- uses: docker/setup-qemu-action@v2
14040
+ uses: docker/setup-qemu-action@v3
13843
14041
  with:
13844
14042
  platforms: arm64
13845
14043
  - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@@ -13858,11 +14056,15 @@ jobs:
13858
14056
  name: Test bindings on aarch64-unknown-linux-musl - node@\${{ matrix.node }}
13859
14057
  needs:
13860
14058
  - build
14059
+ strategy:
14060
+ fail-fast: false
14061
+ matrix:
14062
+ node: ['16', '18']
13861
14063
 
13862
14064
  runs-on: ubuntu-latest
13863
14065
 
13864
14066
  steps:
13865
- - uses: actions/checkout@v3
14067
+ - uses: actions/checkout@v4
13866
14068
 
13867
14069
  - name: Download artifacts
13868
14070
  uses: actions/download-artifact@v3
@@ -13881,7 +14083,7 @@ jobs:
13881
14083
  yarn install
13882
14084
 
13883
14085
  - name: Set up QEMU
13884
- uses: docker/setup-qemu-action@v2
14086
+ uses: docker/setup-qemu-action@v3
13885
14087
  with:
13886
14088
  platforms: arm64
13887
14089
  - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@@ -13889,7 +14091,7 @@ jobs:
13889
14091
  - name: Setup and run tests
13890
14092
  uses: addnab/docker-run-action@v3
13891
14093
  with:
13892
- image: node:lts-alpine
14094
+ image: node:\${{ matrix.node }}-alpine
13893
14095
  options: --platform linux/arm64 -v \${{ github.workspace }}:/build -w /build
13894
14096
  run: |
13895
14097
  set -e
@@ -13903,10 +14105,11 @@ jobs:
13903
14105
  fail-fast: false
13904
14106
  matrix:
13905
14107
  node: ['16', '18']
14108
+ node: ['18', '20']
13906
14109
  runs-on: ubuntu-latest
13907
14110
 
13908
14111
  steps:
13909
- - uses: actions/checkout@v3
14112
+ - uses: actions/checkout@v4
13910
14113
 
13911
14114
  - name: Download artifacts
13912
14115
  uses: actions/download-artifact@v3
@@ -13924,7 +14127,7 @@ jobs:
13924
14127
  yarn install
13925
14128
 
13926
14129
  - name: Set up QEMU
13927
- uses: docker/setup-qemu-action@v2
14130
+ uses: docker/setup-qemu-action@v3
13928
14131
  with:
13929
14132
  platforms: arm
13930
14133
  - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@@ -13946,10 +14149,10 @@ jobs:
13946
14149
  runs-on: macos-latest
13947
14150
 
13948
14151
  steps:
13949
- - uses: actions/checkout@v3
14152
+ - uses: actions/checkout@v4
13950
14153
 
13951
14154
  - name: Setup node
13952
- uses: actions/setup-node@v3
14155
+ uses: actions/setup-node@v4
13953
14156
  with:
13954
14157
  node-version: 18
13955
14158
  cache: yarn
@@ -13991,10 +14194,10 @@ jobs:
13991
14194
  - build-freebsd
13992
14195
 
13993
14196
  steps:
13994
- - uses: actions/checkout@v3
14197
+ - uses: actions/checkout@v4
13995
14198
 
13996
14199
  - name: Setup node
13997
- uses: actions/setup-node@v3
14200
+ uses: actions/setup-node@v4
13998
14201
  with:
13999
14202
  node-version: 18
14000
14203
  cache: 'yarn'
@@ -14016,6 +14219,7 @@ jobs:
14016
14219
 
14017
14220
  - name: Publish
14018
14221
  run: |
14222
+ npm config set provenance true
14019
14223
  if git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$";
14020
14224
  then
14021
14225
  echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
@@ -14041,7 +14245,7 @@ var TEST_LINUX_AARCH64_GNU = "test-linux-aarch64-gnu-binding";
14041
14245
  var TEST_LINUX_AARCH64_MUSL = "test-linux-aarch64-musl-binding";
14042
14246
  var TEST_LINUX_ARM_GNUEABIHF = "test-linux-arm-gnueabihf-binding";
14043
14247
  var UNIVERSAL_MACOS = "universal-macOS";
14044
- var createGithubActionsCIYml = (binaryName, targets) => {
14248
+ var createGithubActionsCIYml = (targets) => {
14045
14249
  const allTargets = new Set(targets.flatMap((t) => {
14046
14250
  const platform2 = parseTriple(t);
14047
14251
  if (platform2.arch === "universal") {
@@ -14179,18 +14383,52 @@ let nativeBinding = null
14179
14383
  let localFileExisted = false
14180
14384
  let loadError = null
14181
14385
 
14182
- function isMusl() {
14183
- // For Node 10
14184
- if (!process.report || typeof process.report.getReport !== 'function') {
14185
- try {
14186
- const lddPath = require('child_process').execSync('which ldd').toString().trim()
14187
- return readFileSync(lddPath, 'utf8').includes('musl')
14188
- } catch (e) {
14386
+ const isMusl = () => {
14387
+ let musl = false
14388
+ if (process.platform === 'linux') {
14389
+ musl = isMuslFromFilesystem()
14390
+ if (musl === null) {
14391
+ musl = isMuslFromReport()
14392
+ }
14393
+ if (musl === null) {
14394
+ musl = isMuslFromChildProcess()
14395
+ }
14396
+ }
14397
+ return musl
14398
+ }
14399
+
14400
+ const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
14401
+
14402
+ const isMuslFromFilesystem = () => {
14403
+ try {
14404
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
14405
+ } catch {
14406
+ return null
14407
+ }
14408
+ }
14409
+
14410
+ const isMuslFromReport = () => {
14411
+ const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
14412
+ if (!report) {
14413
+ return null
14414
+ }
14415
+ if (report.header && report.header.glibcVersionRuntime) {
14416
+ return false
14417
+ }
14418
+ if (Array.isArray(report.sharedObjects)) {
14419
+ if (report.sharedObjects.some(isFileMusl)) {
14189
14420
  return true
14190
14421
  }
14191
- } else {
14192
- const { glibcVersionRuntime } = process.report.getReport().header
14193
- return !glibcVersionRuntime
14422
+ }
14423
+ return false
14424
+ }
14425
+
14426
+ const isMuslFromChildProcess = () => {
14427
+ try {
14428
+ return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
14429
+ } catch (e) {
14430
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
14431
+ return false
14194
14432
  }
14195
14433
  }
14196
14434
 
@@ -14418,16 +14656,71 @@ if (!nativeBinding) {
14418
14656
  throw new Error(\`Failed to load native binding\`)
14419
14657
  }
14420
14658
 
14421
- ${idents.map((ident) => `module.exports.${ident} = binding.${ident}`).join("\n")}
14659
+ ${idents.map((ident) => `module.exports.${ident} = nativeBinding.${ident}`).join("\n")}
14422
14660
  `;
14423
14661
  }
14424
14662
 
14663
+ // dist/api/wasi-worker-template.js
14664
+ var WASI_WORKER_TEMPLATE = `import fs from "node:fs";
14665
+ import { createRequire } from "node:module";
14666
+ import { parentPort, Worker } from "node:worker_threads";
14667
+
14668
+ import { instantiateNapiModuleSync, MessageHandler } from "@emnapi/core";
14669
+ import { WASI } from "@tybys/wasm-util";
14670
+
14671
+ const require = createRequire(import.meta.url);
14672
+
14673
+ if (parentPort) {
14674
+ parentPort.on("message", (data) => {
14675
+ globalThis.onmessage({ data });
14676
+ });
14677
+ }
14678
+
14679
+ Object.assign(globalThis, {
14680
+ self: globalThis,
14681
+ require,
14682
+ Worker,
14683
+ importScripts: function (f) {
14684
+ ;(0, eval)(fs.readFileSync(f, "utf8") + "//# sourceURL=" + f);
14685
+ },
14686
+ postMessage: function (msg) {
14687
+ if (parentPort) {
14688
+ parentPort.postMessage(msg);
14689
+ }
14690
+ },
14691
+ });
14692
+
14693
+ const handler = new MessageHandler({
14694
+ onLoad({ wasmModule, wasmMemory }) {
14695
+ const wasi = new WASI({ fs });
14696
+
14697
+ return instantiateNapiModuleSync(wasmModule, {
14698
+ childThread: true,
14699
+ wasi,
14700
+ overwriteImports(importObject) {
14701
+ importObject.env = {
14702
+ ...importObject.env,
14703
+ ...importObject.napi,
14704
+ ...importObject.emnapi,
14705
+ memory: wasmMemory
14706
+ };
14707
+ },
14708
+ });
14709
+ },
14710
+ });
14711
+
14712
+ globalThis.onmessage = function (e) {
14713
+ handler.handle(e);
14714
+ };
14715
+ `;
14716
+
14425
14717
  // dist/api/build.js
14426
14718
  var debug3 = debugFactory("build");
14719
+ var require3 = (0, import_node_module.createRequire)(__filename);
14427
14720
  async function buildProject(options) {
14428
14721
  debug3("napi build command receive options: %O", options);
14429
14722
  const cwd = options.cwd ?? process.cwd();
14430
- const resolvePath = (...paths) => (0, import_path2.resolve)(cwd, ...paths);
14723
+ const resolvePath = (...paths) => (0, import_node_path2.resolve)(cwd, ...paths);
14431
14724
  const manifestPath = resolvePath(options.manifestPath ?? "Cargo.toml");
14432
14725
  const metadata = parseMetadata(manifestPath);
14433
14726
  const pkg = metadata.packages.find((p) => {
@@ -14440,7 +14733,7 @@ async function buildProject(options) {
14440
14733
  if (!pkg) {
14441
14734
  throw new Error("Unable to find crate to build. It seems you are trying to build a crate in a workspace, try using `--package` option to specify the package to build.");
14442
14735
  }
14443
- const crateDir = (0, import_path2.parse)(pkg.manifest_path).dir;
14736
+ const crateDir = (0, import_node_path2.parse)(pkg.manifest_path).dir;
14444
14737
  const builder = new Builder(options, pkg, cwd, options.target ? parseTriple(options.target) : process.env.CARGO_BUILD_TARGET ? parseTriple(process.env.CARGO_BUILD_TARGET) : getSystemDefaultTarget(), crateDir, resolvePath(options.outputDir ?? crateDir), options.targetDir ?? process.env.CARGO_BUILD_TARGET_DIR ?? metadata.target_directory, await readNapiConfig(resolvePath(options.packageJsonPath ?? "package.json")));
14445
14738
  return builder.build();
14446
14739
  }
@@ -14491,7 +14784,7 @@ var Builder = class {
14491
14784
  const watch = this.options.watch;
14492
14785
  const buildTask = new Promise((resolve8, reject) => {
14493
14786
  const command = process.env.CARGO ?? (this.options.useCross ? "cross" : "cargo");
14494
- const buildProcess = (0, import_child_process4.spawn)(command, this.args, {
14787
+ const buildProcess = (0, import_node_child_process.spawn)(command, this.args, {
14495
14788
  env: {
14496
14789
  ...process.env,
14497
14790
  ...this.envs
@@ -14624,16 +14917,22 @@ var Builder = class {
14624
14917
  }
14625
14918
  const targetArch = this.target.arch === "arm" ? "armv7a" : "aarch64";
14626
14919
  const targetPlatform = this.target.arch === "arm" ? "androideabi24" : "android24";
14920
+ const hostPlatform = process.platform === "darwin" ? "darwin" : process.platform === "win32" ? "windows" : "linux";
14627
14921
  Object.assign(this.envs, {
14628
- CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${targetArch}-linux-android24-clang`,
14629
- CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${targetArch}-linux-androideabi24-clang`,
14630
- CC: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${targetArch}-linux-${targetPlatform}-clang`,
14631
- CXX: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${targetArch}-linux-${targetPlatform}-clang++`,
14632
- AR: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar`,
14922
+ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin/${targetArch}-linux-android24-clang`,
14923
+ CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin/${targetArch}-linux-androideabi24-clang`,
14924
+ CC: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin/${targetArch}-linux-${targetPlatform}-clang`,
14925
+ CXX: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin/${targetArch}-linux-${targetPlatform}-clang++`,
14926
+ AR: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin/llvm-ar`,
14927
+ RANLIB: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin/llvm-ranlib`,
14633
14928
  ANDROID_NDK: ANDROID_NDK_LATEST_HOME,
14634
- PATH: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${process.env.PATH}`
14929
+ PATH: `${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/${hostPlatform}-x86_64/bin:${process.env.PATH}`
14635
14930
  });
14636
14931
  }
14932
+ if (this.target.platform === "wasi") {
14933
+ const emnapi = (0, import_node_path2.join)(require3.resolve("emnapi"), "..", "lib", "wasm32-wasi-threads");
14934
+ this.envs.EMNAPI_LINK_DIR = emnapi;
14935
+ }
14637
14936
  debug3("Set envs: ");
14638
14937
  Object.entries(this.envs).forEach(([k, v]) => {
14639
14938
  debug3(" %i", `${k}=${v}`);
@@ -14673,10 +14972,10 @@ var Builder = class {
14673
14972
  return this;
14674
14973
  }
14675
14974
  getIntermediateTypeFile() {
14676
- return (0, import_path2.join)((0, import_os.tmpdir)(), `${this.crate.name}-${(0, import_crypto.createHash)("sha256").update(this.crate.manifest_path).update(CLI_VERSION).digest("hex").substring(0, 8)}.napi_type_def.tmp`);
14975
+ return (0, import_node_path2.join)((0, import_node_os.tmpdir)(), `${this.crate.name}-${(0, import_node_crypto.createHash)("sha256").update(this.crate.manifest_path).update(CLI_VERSION).digest("hex").substring(0, 8)}.napi_type_def.tmp`);
14677
14976
  }
14678
14977
  getIntermediateWasiRegisterFile() {
14679
- return (0, import_path2.join)((0, import_os.tmpdir)(), `${this.crate.name}-${(0, import_crypto.createHash)("sha256").update(this.crate.manifest_path).update(CLI_VERSION).digest("hex").substring(0, 8)}.napi_wasi_register.tmp`);
14978
+ return (0, import_node_path2.join)((0, import_node_os.tmpdir)(), `${this.crate.name}-${(0, import_node_crypto.createHash)("sha256").update(this.crate.manifest_path).update(CLI_VERSION).digest("hex").substring(0, 8)}.napi_wasi_register.tmp`);
14680
14979
  }
14681
14980
  async postBuild() {
14682
14981
  try {
@@ -14689,10 +14988,22 @@ var Builder = class {
14689
14988
  cause: e
14690
14989
  });
14691
14990
  }
14692
- await this.copyArtifact();
14991
+ const dest = await this.copyArtifact();
14693
14992
  if (this.cdyLibName) {
14694
14993
  const idents = await this.generateTypeDef();
14695
- await this.writeJsBinding(idents);
14994
+ const intermediateWasiRegisterFile = this.envs.WASI_REGISTER_TMP_PATH;
14995
+ const wasiRegisterFunctions = this.target.arch === "wasm32" ? JSON.parse(await readFileAsync(intermediateWasiRegisterFile, "utf8").catch((err) => {
14996
+ console.warn(`Read ${yellowBright(intermediateWasiRegisterFile)} failed, reason: ${err.message}`);
14997
+ return `[]`;
14998
+ })) : [];
14999
+ const jsOutput = await this.writeJsBinding(idents);
15000
+ const wasmOutput = await this.writeWasiBinding(wasiRegisterFunctions, dest ?? "index.wasm", idents);
15001
+ if (jsOutput) {
15002
+ this.outputs.push(jsOutput);
15003
+ }
15004
+ if (wasmOutput) {
15005
+ this.outputs.push(wasmOutput);
15006
+ }
14696
15007
  }
14697
15008
  return this.outputs;
14698
15009
  }
@@ -14702,9 +15013,9 @@ var Builder = class {
14702
15013
  return;
14703
15014
  }
14704
15015
  const profile = this.options.profile ?? (this.options.release ? "release" : "debug");
14705
- const src = (0, import_path2.join)(this.targetDir, this.target.triple, profile, srcName);
15016
+ const src = (0, import_node_path2.join)(this.targetDir, this.target.triple, profile, srcName);
14706
15017
  debug3(`Copy artifact from: [${src}]`);
14707
- const dest = (0, import_path2.join)(this.outputDir, destName);
15018
+ const dest = (0, import_node_path2.join)(this.outputDir, destName);
14708
15019
  try {
14709
15020
  if (await fileExists(dest)) {
14710
15021
  debug3("Old artifact found, remove it first");
@@ -14717,6 +15028,7 @@ var Builder = class {
14717
15028
  kind: dest.endsWith(".node") ? "node" : "exe",
14718
15029
  path: dest
14719
15030
  });
15031
+ return dest;
14720
15032
  } catch (e) {
14721
15033
  throw new Error("Failed to copy artifact", {
14722
15034
  cause: e
@@ -14726,12 +15038,16 @@ var Builder = class {
14726
15038
  getArtifactNames() {
14727
15039
  if (this.cdyLibName) {
14728
15040
  const cdyLib = this.cdyLibName.replace(/-/g, "_");
14729
- const srcName = this.target.platform === "darwin" ? `lib${cdyLib}.dylib` : this.target.platform === "win32" ? `${cdyLib}.dll` : `lib${cdyLib}.so`;
15041
+ const srcName = this.target.platform === "darwin" ? `lib${cdyLib}.dylib` : this.target.platform === "win32" ? `${cdyLib}.dll` : this.target.platform === "wasi" || this.target.platform === "wasm" ? `${cdyLib}.wasm` : `lib${cdyLib}.so`;
14730
15042
  let destName = this.config.binaryName;
14731
15043
  if (this.options.platform) {
14732
15044
  destName += `.${this.target.platformArchABI}`;
14733
15045
  }
14734
- destName += ".node";
15046
+ if (srcName.endsWith(".wasm")) {
15047
+ destName += ".wasi-wasm32.wasm";
15048
+ } else {
15049
+ destName += ".node";
15050
+ }
14735
15051
  return [srcName, destName];
14736
15052
  } else if (this.binName) {
14737
15053
  const srcName = this.target.platform === "win32" ? `${this.binName}.exe` : this.binName;
@@ -14743,7 +15059,7 @@ var Builder = class {
14743
15059
  if (!await fileExists(this.envs.TYPE_DEF_TMP_PATH)) {
14744
15060
  return [];
14745
15061
  }
14746
- const dest = (0, import_path2.join)(this.outputDir, this.options.dts ?? "index.d.ts");
15062
+ const dest = (0, import_node_path2.join)(this.outputDir, this.options.dts ?? "index.d.ts");
14747
15063
  const { dts, exports: exports2 } = await processTypeDef(this.envs.TYPE_DEF_TMP_PATH, !this.options.noDtsHeader ? this.options.dtsHeader ?? DEFAULT_TYPE_DEF_HEADER : "");
14748
15064
  try {
14749
15065
  debug3("Writing type def to:");
@@ -14764,25 +15080,44 @@ var Builder = class {
14764
15080
  this.options.noJsBinding || idents.length === 0) {
14765
15081
  return;
14766
15082
  }
14767
- const name = (0, import_path2.parse)(this.options.jsBinding ?? "index.js").name;
15083
+ const name = (0, import_node_path2.parse)(this.options.jsBinding ?? "index.js").name;
14768
15084
  const cjs = createCjsBinding(this.config.binaryName, this.config.packageName, idents);
14769
15085
  try {
14770
- const dest = (0, import_path2.join)(this.outputDir, `${name}.js`);
15086
+ const dest = (0, import_node_path2.join)(this.outputDir, `${name}.js`);
14771
15087
  debug3("Writing js binding to:");
14772
15088
  debug3(" %i", dest);
14773
15089
  await writeFileAsync(dest, cjs, "utf-8");
14774
- this.outputs.push({
15090
+ return {
14775
15091
  kind: "js",
14776
15092
  path: dest
14777
- });
15093
+ };
14778
15094
  } catch (e) {
14779
15095
  throw new Error("Failed to write js binding file", { cause: e });
14780
15096
  }
14781
15097
  }
15098
+ async writeWasiBinding(wasiRegisterFunctions, distFileName, idents) {
15099
+ if (distFileName && wasiRegisterFunctions.length) {
15100
+ const { name, dir } = (0, import_node_path2.parse)(distFileName);
15101
+ const newPath = (0, import_node_path2.join)(dir, `${this.config.binaryName}.wasi.mjs`);
15102
+ const workerPath = (0, import_node_path2.join)(dir, "wasi-worker.mjs");
15103
+ const declareCodes = `const { ${idents.join(", ")} } = binding
15104
+ `;
15105
+ const exportsCode = `export {
15106
+ ${idents.map((ident) => ` ${ident}`).join(",\n")}
15107
+ }`;
15108
+ await writeFileAsync(newPath, createWasiBinding(name, wasiRegisterFunctions) + declareCodes + exportsCode + "\n", "utf8");
15109
+ await writeFileAsync(workerPath, WASI_WORKER_TEMPLATE, "utf8");
15110
+ return {
15111
+ kind: "wasm",
15112
+ path: newPath
15113
+ };
15114
+ }
15115
+ return null;
15116
+ }
14782
15117
  };
14783
15118
 
14784
15119
  // dist/api/create-npm-dirs.js
14785
- var import_path3 = require("path");
15120
+ var import_path = require("path");
14786
15121
 
14787
15122
  // dist/def/create-npm-dirs.js
14788
15123
  var import_clipanion2 = __toESM(require_advanced(), 1);
@@ -14843,12 +15178,12 @@ async function createNpmDirs(userOptions) {
14843
15178
  }
14844
15179
  await writeFileAsync(file, content);
14845
15180
  }
14846
- const packageJsonPath = (0, import_path3.resolve)(options.cwd, options.packageJsonPath);
14847
- const npmPath = (0, import_path3.resolve)(options.cwd, options.npmDir);
15181
+ const packageJsonPath = (0, import_path.resolve)(options.cwd, options.packageJsonPath);
15182
+ const npmPath = (0, import_path.resolve)(options.cwd, options.npmDir);
14848
15183
  debug4(`Read content from [${packageJsonPath}]`);
14849
15184
  const { targets, binaryName, packageName, packageJson } = await readNapiConfig(packageJsonPath);
14850
15185
  for (const target of targets) {
14851
- const targetDir = (0, import_path3.join)(npmPath, `${target.platformArchABI}`);
15186
+ const targetDir = (0, import_path.join)(npmPath, `${target.platformArchABI}`);
14852
15187
  await mkdirAsync2(targetDir);
14853
15188
  const binaryFileName = `${binaryName}.${target.platformArchABI}.node`;
14854
15189
  const scopedPackageJson = {
@@ -14865,9 +15200,9 @@ async function createNpmDirs(userOptions) {
14865
15200
  } else if (target.abi === "musl") {
14866
15201
  scopedPackageJson.libc = ["musl"];
14867
15202
  }
14868
- const targetPackageJson = (0, import_path3.join)(targetDir, "package.json");
15203
+ const targetPackageJson = (0, import_path.join)(targetDir, "package.json");
14869
15204
  await writeFileAsync2(targetPackageJson, JSON.stringify(scopedPackageJson, null, 2));
14870
- const targetReadme = (0, import_path3.join)(targetDir, "README.md");
15205
+ const targetReadme = (0, import_path.join)(targetDir, "README.md");
14871
15206
  await writeFileAsync2(targetReadme, readme(packageName, target));
14872
15207
  debug4.info(`${packageName}-${target.platformArchABI} created`);
14873
15208
  }
@@ -14880,7 +15215,7 @@ This is the **${target.triple}** binary for \`${packageName}\`
14880
15215
  }
14881
15216
 
14882
15217
  // dist/api/new.js
14883
- var import_path4 = __toESM(require("path"), 1);
15218
+ var import_path2 = __toESM(require("path"), 1);
14884
15219
 
14885
15220
  // dist/def/new.js
14886
15221
  var import_clipanion3 = __toESM(require_advanced(), 1);
@@ -14952,10 +15287,10 @@ function applyDefaultNewOptions(options) {
14952
15287
  var debug5 = debugFactory("new");
14953
15288
  function processOptions(options) {
14954
15289
  debug5("Processing options...");
14955
- options.path = import_path4.default.resolve(process.cwd(), options.path);
15290
+ options.path = import_path2.default.resolve(process.cwd(), options.path);
14956
15291
  debug5(`Resolved target path to: ${options.path}`);
14957
15292
  if (!options.name) {
14958
- options.name = import_path4.default.parse(options.path).base;
15293
+ options.name = import_path2.default.parse(options.path).base;
14959
15294
  debug5(`No project name provided, fix it to dir name: ${options.name}`);
14960
15295
  }
14961
15296
  if (!options.targets?.length) {
@@ -15007,10 +15342,10 @@ function generateFiles(options) {
15007
15342
  if (Array.isArray(output)) {
15008
15343
  return output.map((o) => ({
15009
15344
  ...o,
15010
- target: import_path4.default.join(options.path, o.target)
15345
+ target: import_path2.default.join(options.path, o.target)
15011
15346
  }));
15012
15347
  } else {
15013
- return [{ ...output, target: import_path4.default.join(options.path, output.target) }];
15348
+ return [{ ...output, target: import_path2.default.join(options.path, output.target) }];
15014
15349
  }
15015
15350
  });
15016
15351
  }
@@ -15056,7 +15391,7 @@ function generateGithubWorkflow(options) {
15056
15391
  }
15057
15392
  return {
15058
15393
  target: "./.github/workflows/ci.yml",
15059
- content: createGithubActionsCIYml(getBinaryName(options.name), options.targets)
15394
+ content: createGithubActionsCIYml(options.targets)
15060
15395
  };
15061
15396
  }
15062
15397
  function generateIgnoreFiles(_options) {
@@ -15082,7 +15417,7 @@ async function dumpOutputs(outputs, dryRun) {
15082
15417
  continue;
15083
15418
  }
15084
15419
  try {
15085
- await mkdirAsync(import_path4.default.dirname(output.target), { recursive: true });
15420
+ await mkdirAsync(import_path2.default.dirname(output.target), { recursive: true });
15086
15421
  await writeFileAsync(output.target, output.content, "utf-8");
15087
15422
  } catch (e) {
15088
15423
  throw new Error(`Failed to write file: ${output.target}`, { cause: e });
@@ -15094,9 +15429,9 @@ function getBinaryName(name) {
15094
15429
  }
15095
15430
 
15096
15431
  // dist/api/pre-publish.js
15097
- var import_child_process5 = require("child_process");
15432
+ var import_child_process4 = require("child_process");
15098
15433
  var import_fs3 = require("fs");
15099
- var import_path6 = require("path");
15434
+ var import_path4 = require("path");
15100
15435
  var import_rest = __toESM(require_dist_node12(), 1);
15101
15436
 
15102
15437
  // dist/def/pre-publish.js
@@ -15156,7 +15491,7 @@ function applyDefaultPrePublishOptions(options) {
15156
15491
  }
15157
15492
 
15158
15493
  // dist/api/version.js
15159
- var import_path5 = require("path");
15494
+ var import_path3 = require("path");
15160
15495
 
15161
15496
  // dist/def/version.js
15162
15497
  var import_clipanion5 = __toESM(require_advanced(), 1);
@@ -15195,12 +15530,12 @@ function applyDefaultVersionOptions(options) {
15195
15530
  var debug6 = debugFactory("version");
15196
15531
  async function version(userOptions) {
15197
15532
  const options = applyDefaultVersionOptions(userOptions);
15198
- const packageJsonPath = (0, import_path5.resolve)(options.cwd, options.packageJsonPath);
15533
+ const packageJsonPath = (0, import_path3.resolve)(options.cwd, options.packageJsonPath);
15199
15534
  const config = await readNapiConfig(packageJsonPath);
15200
15535
  for (const target of config.targets) {
15201
- const pkgDir = (0, import_path5.resolve)(options.cwd, options.npmDir, target.platformArchABI);
15536
+ const pkgDir = (0, import_path3.resolve)(options.cwd, options.npmDir, target.platformArchABI);
15202
15537
  debug6(`Update version to %i in [%i]`, config.packageJson.version, pkgDir);
15203
- await updatePackageJson((0, import_path5.join)(pkgDir, "package.json"), {
15538
+ await updatePackageJson((0, import_path3.join)(pkgDir, "package.json"), {
15204
15539
  version: config.packageJson.version
15205
15540
  });
15206
15541
  }
@@ -15212,7 +15547,7 @@ async function prePublish(userOptions) {
15212
15547
  debug7("Receive pre-publish options:");
15213
15548
  debug7(" %O", userOptions);
15214
15549
  const options = applyDefaultPrePublishOptions(userOptions);
15215
- const packageJsonPath = (0, import_path6.relative)(options.cwd, options.packageJsonPath);
15550
+ const packageJsonPath = (0, import_path4.relative)(options.cwd, options.packageJsonPath);
15216
15551
  const { packageJson, targets, packageName, binaryName, npmClient } = await readNapiConfig(packageJsonPath);
15217
15552
  async function createGhRelease(packageName2, version2) {
15218
15553
  if (!options.ghRelease) {
@@ -15247,7 +15582,7 @@ async function prePublish(userOptions) {
15247
15582
  return { owner: owner2, repo: repo2, pkgInfo: pkgInfo2, octokit: octokit2 };
15248
15583
  }
15249
15584
  function getRepoInfo(packageName2, version2) {
15250
- const headCommit = (0, import_child_process5.execSync)("git log -1 --pretty=%B", {
15585
+ const headCommit = (0, import_child_process4.execSync)("git log -1 --pretty=%B", {
15251
15586
  encoding: "utf-8"
15252
15587
  }).trim();
15253
15588
  const { GITHUB_REPOSITORY } = process.env;
@@ -15290,15 +15625,15 @@ async function prePublish(userOptions) {
15290
15625
  }
15291
15626
  const { owner, repo, pkgInfo, octokit } = options.ghReleaseId ? getRepoInfo(packageName, packageJson.version) : await createGhRelease(packageName, packageJson.version);
15292
15627
  for (const target of targets) {
15293
- const pkgDir = (0, import_path6.resolve)(options.cwd, options.npmDir, `${target.platformArchABI}`);
15628
+ const pkgDir = (0, import_path4.resolve)(options.cwd, options.npmDir, `${target.platformArchABI}`);
15294
15629
  const filename = `${binaryName}.${target.platformArchABI}.node`;
15295
- const dstPath = (0, import_path6.join)(pkgDir, filename);
15630
+ const dstPath = (0, import_path4.join)(pkgDir, filename);
15296
15631
  if (!options.dryRun) {
15297
15632
  if (!(0, import_fs3.existsSync)(dstPath)) {
15298
15633
  debug7.warn(`%s doesn't exist`, dstPath);
15299
15634
  continue;
15300
15635
  }
15301
- (0, import_child_process5.execSync)(`${npmClient} publish`, {
15636
+ (0, import_child_process4.execSync)(`${npmClient} publish`, {
15302
15637
  cwd: pkgDir,
15303
15638
  env: process.env
15304
15639
  });
@@ -15345,7 +15680,7 @@ function parseTag(tag) {
15345
15680
  }
15346
15681
 
15347
15682
  // dist/api/rename.js
15348
- var import_path7 = require("path");
15683
+ var import_path5 = require("path");
15349
15684
 
15350
15685
  // dist/def/rename.js
15351
15686
  var import_clipanion6 = __toESM(require_advanced(), 1);
@@ -15408,8 +15743,8 @@ function applyDefaultRenameOptions(options) {
15408
15743
  // dist/api/rename.js
15409
15744
  async function renameProject(userOptions) {
15410
15745
  const options = applyDefaultRenameOptions(userOptions);
15411
- const packageJsonPath = (0, import_path7.resolve)(options.cwd, options.packageJsonPath);
15412
- const cargoTomlPath = (0, import_path7.resolve)(options.cwd, options.manifestPath);
15746
+ const packageJsonPath = (0, import_path5.resolve)(options.cwd, options.packageJsonPath);
15747
+ const cargoTomlPath = (0, import_path5.resolve)(options.cwd, options.manifestPath);
15413
15748
  const packageJsonContent = await readFileAsync(packageJsonPath, "utf8");
15414
15749
  const packageJsonData = JSON.parse(packageJsonContent);
15415
15750
  merge_default(packageJsonData, omitBy_default(pick_default(options, ["name", "description", "author", "license"]), isNil_default), {
@@ -15431,8 +15766,8 @@ async function renameProject(userOptions) {
15431
15766
  }
15432
15767
 
15433
15768
  // dist/api/universalize.js
15434
- var import_child_process6 = require("child_process");
15435
- var import_path8 = require("path");
15769
+ var import_child_process5 = require("child_process");
15770
+ var import_path6 = require("path");
15436
15771
 
15437
15772
  // dist/def/universalize.js
15438
15773
  var import_clipanion7 = __toESM(require_advanced(), 1);
@@ -15471,14 +15806,14 @@ function applyDefaultUniversalizeOptions(options) {
15471
15806
  var debug8 = debugFactory("universalize");
15472
15807
  var universalizers = {
15473
15808
  darwin: (inputs, output) => {
15474
- (0, import_child_process6.spawnSync)("lipo", ["-create", "-output", output, ...inputs], {
15809
+ (0, import_child_process5.spawnSync)("lipo", ["-create", "-output", output, ...inputs], {
15475
15810
  stdio: "inherit"
15476
15811
  });
15477
15812
  }
15478
15813
  };
15479
15814
  async function universalizeBinaries(userOptions) {
15480
15815
  const options = applyDefaultUniversalizeOptions(userOptions);
15481
- const packageJsonPath = (0, import_path8.join)(options.cwd, options.packageJsonPath);
15816
+ const packageJsonPath = (0, import_path6.join)(options.cwd, options.packageJsonPath);
15482
15817
  const config = await readNapiConfig(packageJsonPath);
15483
15818
  const target = config.targets.find((t) => t.platform === process.platform && t.arch === "universal");
15484
15819
  if (!target) {
@@ -15490,12 +15825,12 @@ async function universalizeBinaries(userOptions) {
15490
15825
  }
15491
15826
  debug8(`Looking up source binaries to combine: `);
15492
15827
  debug8(" %O", srcFiles);
15493
- const srcFileLookup = await Promise.all(srcFiles.map((f) => fileExists((0, import_path8.resolve)(options.cwd, options.outputDir, f))));
15828
+ const srcFileLookup = await Promise.all(srcFiles.map((f) => fileExists((0, import_path6.resolve)(options.cwd, options.outputDir, f))));
15494
15829
  const notFoundFiles = srcFiles.filter((_, i) => !srcFileLookup[i]);
15495
15830
  if (notFoundFiles.length) {
15496
15831
  throw new Error(`Some binary files were not found: ${JSON.stringify(notFoundFiles)}`);
15497
15832
  }
15498
- const output = (0, import_path8.resolve)(options.cwd, options.outputDir, `${config.binaryName}.${process.platform}-universal.node`);
15833
+ const output = (0, import_path6.resolve)(options.cwd, options.outputDir, `${config.binaryName}.${process.platform}-universal.node`);
15499
15834
  universalizers[process.platform]?.(srcFiles, output);
15500
15835
  debug8(`Produced universal binary: ${output}`);
15501
15836
  }