@skuba-lib/api 2.3.0 → 2.3.1-clanker-migrate-20260901033953

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 (38) hide show
  1. package/lib/buildkite/index.cjs +1 -1
  2. package/lib/buildkite/index.mjs +1 -1
  3. package/lib/{buildkite-B0gyBRNS.mjs → buildkite-C7bwlxiU.mjs} +2 -4
  4. package/lib/{buildkite-CM-xlOq5.cjs → buildkite-z4owathk.cjs} +3 -5
  5. package/lib/cdk/index.cjs +2 -2
  6. package/lib/cdk/index.mjs +1 -1
  7. package/lib/{error-BSBcaHO0.cjs → error-CzNs0bXO.cjs} +1 -1
  8. package/lib/{exec-Dp89sakg.mjs → exec-Csi1HI7c.mjs} +0 -1
  9. package/lib/{exec-BGMWpmZ7.cjs → exec-DCUB5Shx.cjs} +2 -3
  10. package/lib/fs-BrQNZY8y.mjs +14 -0
  11. package/lib/fs-DS2eIMxA.cjs +21 -0
  12. package/lib/git/index.cjs +1 -1
  13. package/lib/git/index.mjs +1 -1
  14. package/lib/{git-DyhV01cl.mjs → git-DKqd7R1V.mjs} +1 -12
  15. package/lib/{git-BeGqD0KV.cjs → git-DMONyZI2.cjs} +3 -14
  16. package/lib/github/index.cjs +2 -2
  17. package/lib/github/index.mjs +2 -2
  18. package/lib/{github-C91l-j0Z.cjs → github-AhCiyYZt.cjs} +16 -15
  19. package/lib/{github-CmHDTIHw.mjs → github-DsrERrG3.mjs} +17 -15
  20. package/lib/index-BKHTGdUP.d.cts +97 -0
  21. package/lib/index-BKHTGdUP.d.mts +97 -0
  22. package/lib/index.cjs +11 -4
  23. package/lib/index.d.cts +2 -1
  24. package/lib/index.d.mts +2 -1
  25. package/lib/index.mjs +6 -5
  26. package/lib/net/index.cjs +1 -1
  27. package/lib/net/index.mjs +1 -1
  28. package/lib/{net-97EvMPiP.mjs → net-Bf2HV_vG.mjs} +1 -1
  29. package/lib/{net-zrteIHld.cjs → net-HILKQTAq.cjs} +2 -2
  30. package/lib/rolldown/index.cjs +3 -0
  31. package/lib/rolldown/index.d.cts +2 -0
  32. package/lib/rolldown/index.d.mts +2 -0
  33. package/lib/rolldown/index.mjs +2 -0
  34. package/lib/rolldown-CH9krqYt.mjs +265 -0
  35. package/lib/rolldown-CV08omMx.cjs +278 -0
  36. package/lib/{rolldown-runtime-DakpK96I.cjs → rolldown-runtime-C0BPl7ul.cjs} +1 -1
  37. package/package.json +18 -3
  38. package/rolldown/package.json +6 -0
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_buildkite = require("../buildkite-CM-xlOq5.cjs");
2
+ const require_buildkite = require("../buildkite-z4owathk.cjs");
3
3
  exports.annotate = require_buildkite.annotate;
4
4
  exports.md = require_buildkite.md;
@@ -1,2 +1,2 @@
1
- import { n as md, r as annotate } from "../buildkite-B0gyBRNS.mjs";
1
+ import { n as md, r as annotate } from "../buildkite-C7bwlxiU.mjs";
2
2
  export { annotate, md };
@@ -1,9 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { t as log } from "./logging-BQNEupxh.mjs";
3
- import { n as exec, r as hasCommand } from "./exec-Dp89sakg.mjs";
3
+ import { n as exec, r as hasCommand } from "./exec-Csi1HI7c.mjs";
4
4
  //#region src/buildkite/annotate.ts
5
5
  const isAnnotationEnabled = async () => Boolean(process.env.BUILDKITE && process.env.BUILDKITE_AGENT_ACCESS_TOKEN && process.env.BUILDKITE_JOB_ID && await hasCommand("buildkite-agent"));
6
- const MAX_SIZE = 1024 * 1024;
7
6
  const TRUNCATION_WARNING = "... [Truncated due to size limit]";
8
7
  /**
9
8
  * Asynchronously uploads a Buildkite annotation.
@@ -21,8 +20,7 @@ const annotate = async (markdown, opts = {}) => {
21
20
  if (!await isAnnotationEnabled()) return;
22
21
  let truncatedMarkdown = markdown;
23
22
  if (markdown.length > 1048576) {
24
- const remainingSpace = MAX_SIZE - 33;
25
- truncatedMarkdown = markdown.slice(0, remainingSpace) + TRUNCATION_WARNING;
23
+ truncatedMarkdown = markdown.slice(0, 1048543) + TRUNCATION_WARNING;
26
24
  log.warn(`Annotation truncated, full message is: ${markdown}`);
27
25
  }
28
26
  const context = [opts.scopeContextToStep && process.env.BUILDKITE_STEP_ID, opts.context].filter(Boolean).join("|");
@@ -1,9 +1,8 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_logging = require("./logging-BqpzZfsF.cjs");
3
- const require_exec = require("./exec-BGMWpmZ7.cjs");
3
+ const require_exec = require("./exec-DCUB5Shx.cjs");
4
4
  //#region src/buildkite/annotate.ts
5
5
  const isAnnotationEnabled = async () => Boolean(process.env.BUILDKITE && process.env.BUILDKITE_AGENT_ACCESS_TOKEN && process.env.BUILDKITE_JOB_ID && await require_exec.hasCommand("buildkite-agent"));
6
- const MAX_SIZE = 1024 * 1024;
7
6
  const TRUNCATION_WARNING = "... [Truncated due to size limit]";
8
7
  /**
9
8
  * Asynchronously uploads a Buildkite annotation.
@@ -21,8 +20,7 @@ const annotate = async (markdown, opts = {}) => {
21
20
  if (!await isAnnotationEnabled()) return;
22
21
  let truncatedMarkdown = markdown;
23
22
  if (markdown.length > 1048576) {
24
- const remainingSpace = MAX_SIZE - 33;
25
- truncatedMarkdown = markdown.slice(0, remainingSpace) + TRUNCATION_WARNING;
23
+ truncatedMarkdown = markdown.slice(0, 1048543) + TRUNCATION_WARNING;
26
24
  require_logging.log.warn(`Annotation truncated, full message is: ${markdown}`);
27
25
  }
28
26
  const context = [opts.scopeContextToStep && process.env.BUILDKITE_STEP_ID, opts.context].filter(Boolean).join("|");
package/lib/cdk/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/cdk/index.ts
3
- var cdk_exports = /* @__PURE__ */ require("../rolldown-runtime-DakpK96I.cjs").__exportAll({ normaliseTemplate: () => normaliseTemplate });
4
- const normaliseTemplateJsonString = (json) => json.replace(/"S3Key":"([0-9a-f]+)\.zip"/g, (_, hash) => `"S3Key":"${"x".repeat(hash.length)}.zip"`).replace(/workerCurrentVersion([0-9a-zA-Z]+)"/g, (_, hash) => `workerCurrentVersion${"x".repeat(hash.length)}"`).replaceAll(/"Value":"\d+\.\d+\.\d+-([^"]+)"/g, (_, hash) => `"Value": "x.x.x-${"x".repeat(hash.length)}"`).replaceAll(/"Value":"v\d+\.\d+\.\d+"/g, (_) => "\"Value\": \"vx.x.x\"").replace(/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)",/g, "").replaceAll(/(layer:Datadog-[^-]+-.+?:)\d+/g, (_, layer) => `${layer}x`);
3
+ var cdk_exports = /* @__PURE__ */ require("../rolldown-runtime-C0BPl7ul.cjs").__exportAll({ normaliseTemplate: () => normaliseTemplate });
4
+ const normaliseTemplateJsonString = (json) => json.replace(/"S3Key":"([0-9a-f]+)\.zip"/g, (_, hash) => `"S3Key":"${"x".repeat(hash.length)}.zip"`).replace(/CurrentVersion([0-9a-zA-Z]+)"/g, (_, hash) => `CurrentVersion${"x".repeat(hash.length)}"`).replaceAll(/"Value":"\d+\.\d+\.\d+-([^"]+)"/g, (_, hash) => `"Value": "x.x.x-${"x".repeat(hash.length)}"`).replaceAll(/"Value":"v\d+\.\d+\.\d+"/g, (_) => "\"Value\": \"vx.x.x\"").replace(/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)",/g, "").replaceAll(/(layer:Datadog-[^-]+-.+?:)\d+/g, (_, layer) => `${layer}x`);
5
5
  const normaliseTemplate = (template) => JSON.parse(normaliseTemplateJsonString(JSON.stringify(template)));
6
6
  //#endregion
7
7
  Object.defineProperty(exports, "cdk_exports", {
package/lib/cdk/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
2
  //#region src/cdk/index.ts
3
3
  var cdk_exports = /* @__PURE__ */ __exportAll({ normaliseTemplate: () => normaliseTemplate });
4
- const normaliseTemplateJsonString = (json) => json.replace(/"S3Key":"([0-9a-f]+)\.zip"/g, (_, hash) => `"S3Key":"${"x".repeat(hash.length)}.zip"`).replace(/workerCurrentVersion([0-9a-zA-Z]+)"/g, (_, hash) => `workerCurrentVersion${"x".repeat(hash.length)}"`).replaceAll(/"Value":"\d+\.\d+\.\d+-([^"]+)"/g, (_, hash) => `"Value": "x.x.x-${"x".repeat(hash.length)}"`).replaceAll(/"Value":"v\d+\.\d+\.\d+"/g, (_) => "\"Value\": \"vx.x.x\"").replace(/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)",/g, "").replaceAll(/(layer:Datadog-[^-]+-.+?:)\d+/g, (_, layer) => `${layer}x`);
4
+ const normaliseTemplateJsonString = (json) => json.replace(/"S3Key":"([0-9a-f]+)\.zip"/g, (_, hash) => `"S3Key":"${"x".repeat(hash.length)}.zip"`).replace(/CurrentVersion([0-9a-zA-Z]+)"/g, (_, hash) => `CurrentVersion${"x".repeat(hash.length)}"`).replaceAll(/"Value":"\d+\.\d+\.\d+-([^"]+)"/g, (_, hash) => `"Value": "x.x.x-${"x".repeat(hash.length)}"`).replaceAll(/"Value":"v\d+\.\d+\.\d+"/g, (_) => "\"Value\": \"vx.x.x\"").replace(/"DD_TAGS":"git.commit.sha:([0-9a-f]+),git.repository_url:([^\"]+)",/g, "").replaceAll(/(layer:Datadog-[^-]+-.+?:)\d+/g, (_, layer) => `${layer}x`);
5
5
  const normaliseTemplate = (template) => JSON.parse(normaliseTemplateJsonString(JSON.stringify(template)));
6
6
  //#endregion
7
7
  export { normaliseTemplate, cdk_exports as t };
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  require("util");
3
3
  let zod_v4 = require("zod/v4");
4
4
  zod_v4 = require_rolldown_runtime.__toESM(zod_v4, 1);
@@ -40,7 +40,6 @@ const runCommand = (command, args, { streamStdio, ...execaOptions } = {}) => {
40
40
  case true:
41
41
  subprocess.stderr?.pipe(process.stderr);
42
42
  subprocess.stdout?.pipe(process.stdout);
43
- break;
44
43
  }
45
44
  return subprocess;
46
45
  };
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
2
- const require_error = require("./error-BSBcaHO0.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_error = require("./error-CzNs0bXO.cjs");
3
3
  let stream = require("stream");
4
4
  stream = require_rolldown_runtime.__toESM(stream, 1);
5
5
  let util = require("util");
@@ -44,7 +44,6 @@ const runCommand = (command, args, { streamStdio, ...execaOptions } = {}) => {
44
44
  case true:
45
45
  subprocess.stderr?.pipe(process.stderr);
46
46
  subprocess.stdout?.pipe(process.stdout);
47
- break;
48
47
  }
49
48
  return subprocess;
50
49
  };
@@ -0,0 +1,14 @@
1
+ import { t as isErrorWithCode } from "./error-CxiNRw9A.mjs";
2
+ import fs from "fs-extra";
3
+ //#region ../../src/utils/fs.ts
4
+ const pathExists = async (filePath) => {
5
+ try {
6
+ await fs.promises.access(filePath);
7
+ return true;
8
+ } catch (error) {
9
+ if (isErrorWithCode(error, "ENOENT")) return false;
10
+ throw error;
11
+ }
12
+ };
13
+ //#endregion
14
+ export { pathExists as t };
@@ -0,0 +1,21 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_error = require("./error-CzNs0bXO.cjs");
3
+ let fs_extra = require("fs-extra");
4
+ fs_extra = require_rolldown_runtime.__toESM(fs_extra, 1);
5
+ //#region ../../src/utils/fs.ts
6
+ const pathExists = async (filePath) => {
7
+ try {
8
+ await fs_extra.default.promises.access(filePath);
9
+ return true;
10
+ } catch (error) {
11
+ if (require_error.isErrorWithCode(error, "ENOENT")) return false;
12
+ throw error;
13
+ }
14
+ };
15
+ //#endregion
16
+ Object.defineProperty(exports, "pathExists", {
17
+ enumerable: true,
18
+ get: function() {
19
+ return pathExists;
20
+ }
21
+ });
package/lib/git/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_git = require("../git-BeGqD0KV.cjs");
2
+ const require_git = require("../git-DMONyZI2.cjs");
3
3
  exports.commit = require_git.commit;
4
4
  exports.commitAllChanges = require_git.commitAllChanges;
5
5
  exports.currentBranch = require_git.currentBranch;
package/lib/git/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as push, d as getHeadCommitMessage, f as currentBranch, g as commit, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, n as isFileGitIgnored, p as commitAllChanges, r as reset, u as getHeadCommitId } from "../git-DyhV01cl.mjs";
1
+ import { a as push, d as getHeadCommitMessage, f as currentBranch, g as commit, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, n as isFileGitIgnored, p as commitAllChanges, r as reset, u as getHeadCommitId } from "../git-DKqd7R1V.mjs";
2
2
  export { commit, commitAllChanges, currentBranch, fastForwardBranch, findRoot, getChangedFiles, getHeadCommitId, getHeadCommitMessage, getOwnerAndRepo, isFileGitIgnored, push, reset };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { t as isErrorWithCode } from "./error-CxiNRw9A.mjs";
2
+ import { t as pathExists } from "./fs-BrQNZY8y.mjs";
3
3
  import fs from "fs-extra";
4
4
  import git, { findRoot } from "isomorphic-git";
5
5
  import path from "path";
@@ -34,17 +34,6 @@ const findRoot$1 = async ({ dir }) => {
34
34
  }
35
35
  };
36
36
  //#endregion
37
- //#region ../../src/utils/fs.ts
38
- const pathExists = async (filePath) => {
39
- try {
40
- await fs.promises.access(filePath);
41
- return true;
42
- } catch (error) {
43
- if (isErrorWithCode(error, "ENOENT")) return false;
44
- throw error;
45
- }
46
- };
47
- //#endregion
48
37
  //#region src/git/getChangedFiles.ts
49
38
  const mapState = (row) => {
50
39
  if (row[1] === 0) return "added";
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
2
- const require_error = require("./error-BSBcaHO0.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_fs = require("./fs-DS2eIMxA.cjs");
3
3
  let fs_extra = require("fs-extra");
4
4
  fs_extra = require_rolldown_runtime.__toESM(fs_extra, 1);
5
5
  let isomorphic_git = require("isomorphic-git");
@@ -39,17 +39,6 @@ const findRoot$1 = async ({ dir }) => {
39
39
  }
40
40
  };
41
41
  //#endregion
42
- //#region ../../src/utils/fs.ts
43
- const pathExists = async (filePath) => {
44
- try {
45
- await fs_extra.default.promises.access(filePath);
46
- return true;
47
- } catch (error) {
48
- if (require_error.isErrorWithCode(error, "ENOENT")) return false;
49
- throw error;
50
- }
51
- };
52
- //#endregion
53
42
  //#region src/git/getChangedFiles.ts
54
43
  const mapState = (row) => {
55
44
  if (row[1] === 0) return "added";
@@ -140,7 +129,7 @@ const getChangedFilesFromRefs = async ({ dir, src, dst }) => {
140
129
  const createIsLfsFilter = async (gitRoot) => {
141
130
  if (!gitRoot) return () => false;
142
131
  const lfsFile = `${gitRoot}/.gitattributes`;
143
- if (!await pathExists(lfsFile)) return () => false;
132
+ if (!await require_fs.pathExists(lfsFile)) return () => false;
144
133
  const filter = (0, ignore.default)().add((await fs_extra.default.promises.readFile(lfsFile, "utf8")).split("\n").map((l) => l.trim()).filter((l) => !l.startsWith("#") && l.includes("filter=lfs")).map((l) => l.split(/\s+/)[0]).flatMap((l) => l ? [l] : []));
145
134
  return (pathname) => filter.ignores(pathname);
146
135
  };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_git = require("../git-BeGqD0KV.cjs");
3
- const require_github = require("../github-C91l-j0Z.cjs");
2
+ const require_git = require("../git-DMONyZI2.cjs");
3
+ const require_github = require("../github-AhCiyYZt.cjs");
4
4
  exports.apiTokenFromEnvironment = require_git.apiTokenFromEnvironment;
5
5
  exports.buildNameFromEnvironment = require_git.buildNameFromEnvironment;
6
6
  exports.createCheckRun = require_github.createCheckRun;
@@ -1,3 +1,3 @@
1
- import { c as enabledFromEnvironment, o as apiTokenFromEnvironment, s as buildNameFromEnvironment } from "../git-DyhV01cl.mjs";
2
- import { a as putIssueComment, i as uploadFileChanges, n as readFileChanges, o as getPullRequestNumber, r as uploadAllFileChanges, s as createCheckRun } from "../github-CmHDTIHw.mjs";
1
+ import { c as enabledFromEnvironment, o as apiTokenFromEnvironment, s as buildNameFromEnvironment } from "../git-DKqd7R1V.mjs";
2
+ import { a as putIssueComment, i as uploadFileChanges, n as readFileChanges, o as getPullRequestNumber, r as uploadAllFileChanges, s as createCheckRun } from "../github-DsrERrG3.mjs";
3
3
  export { apiTokenFromEnvironment, buildNameFromEnvironment, createCheckRun, enabledFromEnvironment, getPullRequestNumber, putIssueComment, readFileChanges, uploadAllFileChanges, uploadFileChanges };
@@ -1,6 +1,6 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_logging = require("./logging-BqpzZfsF.cjs");
3
- const require_git = require("./git-BeGqD0KV.cjs");
3
+ const require_git = require("./git-DMONyZI2.cjs");
4
4
  let fs_extra = require("fs-extra");
5
5
  fs_extra = require_rolldown_runtime.__toESM(fs_extra, 1);
6
6
  let path = require("path");
@@ -213,6 +213,19 @@ const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fi
213
213
  const authToken = require_git.apiTokenFromEnvironment();
214
214
  if (!authToken) throw new Error("Could not read a GitHub API token from the environment. Please set GITHUB_API_TOKEN or GITHUB_TOKEN.");
215
215
  const [{ owner, repo }, headCommitId] = await Promise.all([require_git.getOwnerAndRepo({ dir }), require_git.getHeadCommitId({ dir })]);
216
+ const input = {
217
+ branch: {
218
+ repositoryNameWithOwner: `${owner}/${repo}`,
219
+ branchName: branch
220
+ },
221
+ message: {
222
+ headline: messageHeadline,
223
+ body: messageBody
224
+ },
225
+ expectedHeadOid: headCommitId,
226
+ clientMutationId: "skuba",
227
+ fileChanges
228
+ };
216
229
  return (await graphql(`
217
230
  mutation Mutation($input: CreateCommitOnBranchInput!) {
218
231
  createCommitOnBranch(input: $input) {
@@ -222,19 +235,7 @@ const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fi
222
235
  }
223
236
  }
224
237
  `, {
225
- input: {
226
- branch: {
227
- repositoryNameWithOwner: `${owner}/${repo}`,
228
- branchName: branch
229
- },
230
- message: {
231
- headline: messageHeadline,
232
- body: messageBody
233
- },
234
- expectedHeadOid: headCommitId,
235
- clientMutationId: "skuba",
236
- fileChanges
237
- },
238
+ input,
238
239
  headers: { authorization: `Bearer ${authToken}` }
239
240
  })).createCommitOnBranch.commit.oid;
240
241
  };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { n as pluralise } from "./logging-BQNEupxh.mjs";
3
- import { c as enabledFromEnvironment, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, o as apiTokenFromEnvironment, s as buildNameFromEnvironment, u as getHeadCommitId } from "./git-DyhV01cl.mjs";
3
+ import { c as enabledFromEnvironment, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, o as apiTokenFromEnvironment, s as buildNameFromEnvironment, u as getHeadCommitId } from "./git-DKqd7R1V.mjs";
4
4
  import fs from "fs-extra";
5
5
  import path from "path";
6
6
  //#region src/github/octokit.ts
@@ -96,7 +96,8 @@ const getUserId = async (client) => {
96
96
  const putIssueComment = async (params) => {
97
97
  if (params.body === null && !params.internalId) throw new Error("Cannot remove comment without an internalId");
98
98
  const env = params.env ?? process.env;
99
- const { owner, repo } = await getOwnerAndRepo({ dir: process.cwd() });
99
+ const dir = process.cwd();
100
+ const { owner, repo } = await getOwnerAndRepo({ dir });
100
101
  const client = await createRestClient({ auth: apiTokenFromEnvironment() });
101
102
  const issueNumber = params.issueNumber ?? await getPullRequestNumber({
102
103
  client,
@@ -210,6 +211,19 @@ const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fi
210
211
  const authToken = apiTokenFromEnvironment();
211
212
  if (!authToken) throw new Error("Could not read a GitHub API token from the environment. Please set GITHUB_API_TOKEN or GITHUB_TOKEN.");
212
213
  const [{ owner, repo }, headCommitId] = await Promise.all([getOwnerAndRepo({ dir }), getHeadCommitId({ dir })]);
214
+ const input = {
215
+ branch: {
216
+ repositoryNameWithOwner: `${owner}/${repo}`,
217
+ branchName: branch
218
+ },
219
+ message: {
220
+ headline: messageHeadline,
221
+ body: messageBody
222
+ },
223
+ expectedHeadOid: headCommitId,
224
+ clientMutationId: "skuba",
225
+ fileChanges
226
+ };
213
227
  return (await graphql(`
214
228
  mutation Mutation($input: CreateCommitOnBranchInput!) {
215
229
  createCommitOnBranch(input: $input) {
@@ -219,19 +233,7 @@ const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fi
219
233
  }
220
234
  }
221
235
  `, {
222
- input: {
223
- branch: {
224
- repositoryNameWithOwner: `${owner}/${repo}`,
225
- branchName: branch
226
- },
227
- message: {
228
- headline: messageHeadline,
229
- body: messageBody
230
- },
231
- expectedHeadOid: headCommitId,
232
- clientMutationId: "skuba",
233
- fileChanges
234
- },
236
+ input,
235
237
  headers: { authorization: `Bearer ${authToken}` }
236
238
  })).createCommitOnBranch.commit.oid;
237
239
  };
@@ -0,0 +1,97 @@
1
+ import { Plugin } from "rolldown";
2
+ //#region src/rolldown/lambdaAsset.d.ts
3
+ interface LambdaAssetFile {
4
+ /**
5
+ * Path to the file or directory to copy, resolved relative to `projectRoot`.
6
+ */
7
+ from: string;
8
+ /**
9
+ * Destination path relative to the output directory.
10
+ *
11
+ * Defaults to the basename of `from`, placing it at the top of the output
12
+ * directory.
13
+ */
14
+ to?: string;
15
+ }
16
+ interface LambdaAssetOptions {
17
+ /**
18
+ * npm packages to install into the output directory rather than embed in the
19
+ * bundle.
20
+ *
21
+ * Versions are resolved from the copy installed under `projectRoot`. Mark
22
+ * these packages `external` in your rolldown config too, otherwise they will
23
+ * be bundled _and_ installed.
24
+ *
25
+ * Packages with native binaries (e.g. `sharp`) are the usual candidates.
26
+ */
27
+ nodeModules?: string[];
28
+ /**
29
+ * Extra files or directories to copy into the output directory alongside the
30
+ * bundle, e.g. static assets or configuration the handler reads at runtime.
31
+ *
32
+ * Each `from` is resolved relative to `projectRoot`; each `to` defaults to
33
+ * the basename of `from` and is resolved relative to the output directory.
34
+ */
35
+ assets?: LambdaAssetFile[];
36
+ /**
37
+ * Directory that `nodeModules` versions are resolved from, and that `assets`
38
+ * are copied from.
39
+ *
40
+ * This is the directory holding the `package.json` that depends on them; in a
41
+ * workspace, that is the individual package rather than the workspace root.
42
+ *
43
+ * Relative paths resolve against rolldown's `cwd`, which defaults to
44
+ * `process.cwd()`.
45
+ */
46
+ projectRoot?: string;
47
+ /**
48
+ * Path to the `pnpm-lock.yaml` to install against.
49
+ *
50
+ * pnpm keeps this at the workspace root, so its directory is also where the
51
+ * workspace config and patches are staged from.
52
+ *
53
+ * Defaults to the nearest lock file, walking up from rolldown's `cwd`, which
54
+ * defaults to `process.cwd()`. A relative path resolves against that `cwd`.
55
+ */
56
+ depsLockFilePath?: string;
57
+ }
58
+ /**
59
+ * Prepares a rolldown output directory for deployment as a Lambda asset.
60
+ *
61
+ * The plugin supports ESM output and pnpm only. It makes no assumptions about
62
+ * how you bundle; it only augments what rolldown has already written:
63
+ *
64
+ * 1. Emits any extra `assets` into the build output alongside the bundle, via
65
+ * rolldown's `emitFile`.
66
+ * 2. Writes a `package.json` of `type: 'module'`.
67
+ * 3. Installs `nodeModules` into the output directory with pnpm, staging the
68
+ * workspace config, `.npmrc`, lock file and patches to do so.
69
+ * 4. Strips those install-only files back out, leaving the bundle, the
70
+ * generated `package.json` and `node_modules`.
71
+ *
72
+ * The result can be handed to CDK as `aws_lambda.Code.fromAsset(outputDir)`.
73
+ *
74
+ * @example
75
+ * ```js
76
+ * // rolldown.config.mjs
77
+ * import { Rolldown } from 'skuba';
78
+ *
79
+ * export default {
80
+ * input: { index: 'src/lambda.ts' },
81
+ * output: { dir: 'lib' },
82
+ * external: ['sharp'],
83
+ * plugins: [
84
+ * Rolldown.lambdaAsset({
85
+ * nodeModules: ['sharp'],
86
+ * assets: [{ from: 'src/config.json' }],
87
+ * }),
88
+ * ],
89
+ * };
90
+ * ```
91
+ */
92
+ declare const lambdaAsset: ({ nodeModules, assets, projectRoot: projectRootOption, depsLockFilePath: depsLockFilePathOption }?: LambdaAssetOptions) => Plugin;
93
+ declare namespace index_d_exports {
94
+ export { LambdaAssetFile, LambdaAssetOptions, lambdaAsset };
95
+ }
96
+ //#endregion
97
+ export { lambdaAsset as i, LambdaAssetFile as n, LambdaAssetOptions as r, index_d_exports as t };
@@ -0,0 +1,97 @@
1
+ import { Plugin } from "rolldown";
2
+ //#region src/rolldown/lambdaAsset.d.ts
3
+ interface LambdaAssetFile {
4
+ /**
5
+ * Path to the file or directory to copy, resolved relative to `projectRoot`.
6
+ */
7
+ from: string;
8
+ /**
9
+ * Destination path relative to the output directory.
10
+ *
11
+ * Defaults to the basename of `from`, placing it at the top of the output
12
+ * directory.
13
+ */
14
+ to?: string;
15
+ }
16
+ interface LambdaAssetOptions {
17
+ /**
18
+ * npm packages to install into the output directory rather than embed in the
19
+ * bundle.
20
+ *
21
+ * Versions are resolved from the copy installed under `projectRoot`. Mark
22
+ * these packages `external` in your rolldown config too, otherwise they will
23
+ * be bundled _and_ installed.
24
+ *
25
+ * Packages with native binaries (e.g. `sharp`) are the usual candidates.
26
+ */
27
+ nodeModules?: string[];
28
+ /**
29
+ * Extra files or directories to copy into the output directory alongside the
30
+ * bundle, e.g. static assets or configuration the handler reads at runtime.
31
+ *
32
+ * Each `from` is resolved relative to `projectRoot`; each `to` defaults to
33
+ * the basename of `from` and is resolved relative to the output directory.
34
+ */
35
+ assets?: LambdaAssetFile[];
36
+ /**
37
+ * Directory that `nodeModules` versions are resolved from, and that `assets`
38
+ * are copied from.
39
+ *
40
+ * This is the directory holding the `package.json` that depends on them; in a
41
+ * workspace, that is the individual package rather than the workspace root.
42
+ *
43
+ * Relative paths resolve against rolldown's `cwd`, which defaults to
44
+ * `process.cwd()`.
45
+ */
46
+ projectRoot?: string;
47
+ /**
48
+ * Path to the `pnpm-lock.yaml` to install against.
49
+ *
50
+ * pnpm keeps this at the workspace root, so its directory is also where the
51
+ * workspace config and patches are staged from.
52
+ *
53
+ * Defaults to the nearest lock file, walking up from rolldown's `cwd`, which
54
+ * defaults to `process.cwd()`. A relative path resolves against that `cwd`.
55
+ */
56
+ depsLockFilePath?: string;
57
+ }
58
+ /**
59
+ * Prepares a rolldown output directory for deployment as a Lambda asset.
60
+ *
61
+ * The plugin supports ESM output and pnpm only. It makes no assumptions about
62
+ * how you bundle; it only augments what rolldown has already written:
63
+ *
64
+ * 1. Emits any extra `assets` into the build output alongside the bundle, via
65
+ * rolldown's `emitFile`.
66
+ * 2. Writes a `package.json` of `type: 'module'`.
67
+ * 3. Installs `nodeModules` into the output directory with pnpm, staging the
68
+ * workspace config, `.npmrc`, lock file and patches to do so.
69
+ * 4. Strips those install-only files back out, leaving the bundle, the
70
+ * generated `package.json` and `node_modules`.
71
+ *
72
+ * The result can be handed to CDK as `aws_lambda.Code.fromAsset(outputDir)`.
73
+ *
74
+ * @example
75
+ * ```js
76
+ * // rolldown.config.mjs
77
+ * import { Rolldown } from 'skuba';
78
+ *
79
+ * export default {
80
+ * input: { index: 'src/lambda.ts' },
81
+ * output: { dir: 'lib' },
82
+ * external: ['sharp'],
83
+ * plugins: [
84
+ * Rolldown.lambdaAsset({
85
+ * nodeModules: ['sharp'],
86
+ * assets: [{ from: 'src/config.json' }],
87
+ * }),
88
+ * ],
89
+ * };
90
+ * ```
91
+ */
92
+ declare const lambdaAsset: ({ nodeModules, assets, projectRoot: projectRootOption, depsLockFilePath: depsLockFilePathOption }?: LambdaAssetOptions) => Plugin;
93
+ declare namespace index_d_exports {
94
+ export { LambdaAssetFile, LambdaAssetOptions, lambdaAsset };
95
+ }
96
+ //#endregion
97
+ export { lambdaAsset as i, LambdaAssetFile as n, LambdaAssetOptions as r, index_d_exports as t };
package/lib/index.cjs CHANGED
@@ -1,9 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_buildkite = require("./buildkite-CM-xlOq5.cjs");
2
+ const require_buildkite = require("./buildkite-z4owathk.cjs");
3
3
  const require_cdk_index = require("./cdk/index.cjs");
4
- const require_git = require("./git-BeGqD0KV.cjs");
5
- const require_github = require("./github-C91l-j0Z.cjs");
6
- const require_net = require("./net-zrteIHld.cjs");
4
+ const require_git = require("./git-DMONyZI2.cjs");
5
+ const require_github = require("./github-AhCiyYZt.cjs");
6
+ const require_net = require("./net-HILKQTAq.cjs");
7
+ const require_rolldown = require("./rolldown-CV08omMx.cjs");
7
8
  Object.defineProperty(exports, "Buildkite", {
8
9
  enumerable: true,
9
10
  get: function() {
@@ -34,3 +35,9 @@ Object.defineProperty(exports, "Net", {
34
35
  return require_net.net_exports;
35
36
  }
36
37
  });
38
+ Object.defineProperty(exports, "Rolldown", {
39
+ enumerable: true,
40
+ get: function() {
41
+ return require_rolldown.rolldown_exports;
42
+ }
43
+ });
package/lib/index.d.cts CHANGED
@@ -3,4 +3,5 @@ import { t as index_d_exports$1 } from "./cdk/index.cjs";
3
3
  import { t as index_d_exports$2 } from "./index-CLEYcnJY.cjs";
4
4
  import { t as index_d_exports$3 } from "./index-CPm5rAMy.cjs";
5
5
  import { t as index_d_exports$4 } from "./index-C9lVo3vU.cjs";
6
- export { index_d_exports as Buildkite, index_d_exports$1 as Cdk, index_d_exports$2 as Git, index_d_exports$3 as GitHub, index_d_exports$4 as Net };
6
+ import { t as index_d_exports$5 } from "./index-BKHTGdUP.cjs";
7
+ export { index_d_exports as Buildkite, index_d_exports$1 as Cdk, index_d_exports$2 as Git, index_d_exports$3 as GitHub, index_d_exports$4 as Net, index_d_exports$5 as Rolldown };
package/lib/index.d.mts CHANGED
@@ -3,4 +3,5 @@ import { t as index_d_exports$1 } from "./cdk/index.mjs";
3
3
  import { t as index_d_exports$2 } from "./index-CLEYcnJY.mjs";
4
4
  import { t as index_d_exports$3 } from "./index-CwdiFn_m.mjs";
5
5
  import { t as index_d_exports$4 } from "./index-C9lVo3vU.mjs";
6
- export { index_d_exports as Buildkite, index_d_exports$1 as Cdk, index_d_exports$2 as Git, index_d_exports$3 as GitHub, index_d_exports$4 as Net };
6
+ import { t as index_d_exports$5 } from "./index-BKHTGdUP.mjs";
7
+ export { index_d_exports as Buildkite, index_d_exports$1 as Cdk, index_d_exports$2 as Git, index_d_exports$3 as GitHub, index_d_exports$4 as Net, index_d_exports$5 as Rolldown };
package/lib/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { t as buildkite_exports } from "./buildkite-B0gyBRNS.mjs";
1
+ import { t as buildkite_exports } from "./buildkite-C7bwlxiU.mjs";
2
2
  import { t as cdk_exports } from "./cdk/index.mjs";
3
- import { t as git_exports } from "./git-DyhV01cl.mjs";
4
- import { t as github_exports } from "./github-CmHDTIHw.mjs";
5
- import { t as net_exports } from "./net-97EvMPiP.mjs";
6
- export { buildkite_exports as Buildkite, cdk_exports as Cdk, git_exports as Git, github_exports as GitHub, net_exports as Net };
3
+ import { t as git_exports } from "./git-DKqd7R1V.mjs";
4
+ import { t as github_exports } from "./github-DsrERrG3.mjs";
5
+ import { t as net_exports } from "./net-Bf2HV_vG.mjs";
6
+ import { t as rolldown_exports } from "./rolldown-CH9krqYt.mjs";
7
+ export { buildkite_exports as Buildkite, cdk_exports as Cdk, git_exports as Git, github_exports as GitHub, net_exports as Net, rolldown_exports as Rolldown };
package/lib/net/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_net = require("../net-zrteIHld.cjs");
2
+ const require_net = require("../net-HILKQTAq.cjs");
3
3
  exports.waitFor = require_net.waitFor;
package/lib/net/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as waitFor } from "../net-97EvMPiP.mjs";
1
+ import { n as waitFor } from "../net-Bf2HV_vG.mjs";
2
2
  export { waitFor };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { t as createExec } from "./exec-Dp89sakg.mjs";
2
+ import { t as createExec } from "./exec-Csi1HI7c.mjs";
3
3
  import net from "net";
4
4
  //#region src/net/compose.ts
5
5
  const portStringToNumber = (portString) => {
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
2
- const require_exec = require("./exec-BGMWpmZ7.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_exec = require("./exec-DCUB5Shx.cjs");
3
3
  let net = require("net");
4
4
  net = require_rolldown_runtime.__toESM(net, 1);
5
5
  //#region src/net/compose.ts
@@ -0,0 +1,3 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_rolldown = require("../rolldown-CV08omMx.cjs");
3
+ exports.lambdaAsset = require_rolldown.lambdaAsset;
@@ -0,0 +1,2 @@
1
+ import { i as lambdaAsset, n as LambdaAssetFile, r as LambdaAssetOptions } from "../index-BKHTGdUP.cjs";
2
+ export { type LambdaAssetFile, type LambdaAssetOptions, lambdaAsset };
@@ -0,0 +1,2 @@
1
+ import { i as lambdaAsset, n as LambdaAssetFile, r as LambdaAssetOptions } from "../index-BKHTGdUP.mjs";
2
+ export { type LambdaAssetFile, type LambdaAssetOptions, lambdaAsset };
@@ -0,0 +1,2 @@
1
+ import { n as lambdaAsset } from "../rolldown-CH9krqYt.mjs";
2
+ export { lambdaAsset };
@@ -0,0 +1,265 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { t as log } from "./logging-BQNEupxh.mjs";
3
+ import { t as createExec } from "./exec-Csi1HI7c.mjs";
4
+ import { t as pathExists } from "./fs-BrQNZY8y.mjs";
5
+ import { findPackageJSON } from "node:module";
6
+ import fs from "fs-extra";
7
+ import * as path from "node:path";
8
+ import { findUp } from "find-up";
9
+ import { pathToFileURL } from "node:url";
10
+ import { isMap, parseDocument } from "yaml";
11
+ //#region src/rolldown/pnpm.ts
12
+ const PNPM_LOCK = "pnpm-lock.yaml";
13
+ const PNPM_WORKSPACE_YAML = "pnpm-workspace.yaml";
14
+ const PNPM_PATCHES_DIR = "patches";
15
+ const PNPM_WORKSPACE_FILES = [
16
+ PNPM_WORKSPACE_YAML,
17
+ ".npmrc",
18
+ ".pnpmfile.cjs",
19
+ ".pnpmfile.mjs"
20
+ ];
21
+ const PNPM_METADATA_FILES = [path.join("node_modules", ".modules.yaml"), path.join("node_modules", ".pnpm-workspace-state-v1.json")];
22
+ const PNPM_INSTALL_COMMAND = [
23
+ "pnpm",
24
+ "install",
25
+ "--config.node-linker=hoisted",
26
+ "--config.package-import-method=clone-or-copy",
27
+ "--no-frozen-lockfile",
28
+ "--prefer-offline"
29
+ ];
30
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
31
+ const readJsonFile = async (filePath) => {
32
+ try {
33
+ return await fs.readJson(filePath);
34
+ } catch (err) {
35
+ throw new Error(`Failed to parse ${filePath} as JSON: ${err.message}`);
36
+ }
37
+ };
38
+ const PACKAGE_MANAGER_FIELDS = ["packageManager", "devEngines"];
39
+ /**
40
+ * Reads the package manager pin from the workspace root manifest.
41
+ *
42
+ * Forwarding it to the output directory keeps the staged install on the same
43
+ * pnpm version as the project.
44
+ */
45
+ const readPackageManagerFields = async (workspaceRoot) => {
46
+ const pkgPath = path.join(workspaceRoot, "package.json");
47
+ if (!await pathExists(pkgPath)) return {};
48
+ const parsed = await readJsonFile(pkgPath);
49
+ if (!isRecord(parsed)) return {};
50
+ return Object.fromEntries(PACKAGE_MANAGER_FIELDS.flatMap((field) => parsed[field] === void 0 ? [] : [[field, parsed[field]]]));
51
+ };
52
+ /**
53
+ * The output directory installs a subset of the workspace's dependencies, so
54
+ * most `patchedDependencies` entries have nothing to apply to. pnpm fails the
55
+ * install on an unused patch unless this is set.
56
+ */
57
+ const allowUnusedPatches = (content) => {
58
+ const doc = parseDocument(content);
59
+ const [error] = doc.errors;
60
+ if (error) throw new Error(`Failed to parse ${PNPM_WORKSPACE_YAML}: ${error.message}`);
61
+ if (!isMap(doc.contents)) return content;
62
+ doc.set("allowUnusedPatches", true);
63
+ return doc.toString();
64
+ };
65
+ /**
66
+ * Stages the pnpm config that an install in `outputDir` needs.
67
+ *
68
+ * Patch files are staged from `patches`, where `pnpm patch-commit` writes them.
69
+ *
70
+ * Every path written is appended to `stagedFiles` so the caller can strip it
71
+ * back out once the install is done; `.npmrc` in particular may hold registry
72
+ * credentials that must not ship in the asset.
73
+ */
74
+ const stageWorkspaceFiles = async (workspaceRoot, outputDir, stagedFiles = []) => {
75
+ const present = (await Promise.all(PNPM_WORKSPACE_FILES.map(async (file) => {
76
+ const src = path.join(workspaceRoot, file);
77
+ return await pathExists(src) ? {
78
+ file,
79
+ src
80
+ } : void 0;
81
+ }))).filter((entry) => entry !== void 0);
82
+ for (const { file } of present) stagedFiles.push(path.join(outputDir, file));
83
+ await Promise.all(present.map(async ({ file, src }) => {
84
+ const dest = path.join(outputDir, file);
85
+ if (file === PNPM_WORKSPACE_YAML) await fs.promises.writeFile(dest, allowUnusedPatches(await fs.promises.readFile(src, "utf8")));
86
+ else await fs.promises.copyFile(src, dest);
87
+ }));
88
+ const patchesSrc = path.join(workspaceRoot, PNPM_PATCHES_DIR);
89
+ if (await pathExists(patchesSrc)) {
90
+ const patchesDest = path.join(outputDir, PNPM_PATCHES_DIR);
91
+ stagedFiles.push(patchesDest);
92
+ await fs.copy(patchesSrc, patchesDest);
93
+ }
94
+ return stagedFiles;
95
+ };
96
+ /**
97
+ * Resolves the installed version of each module, as seen from `resolveFrom`.
98
+ */
99
+ const extractDependencies = async (resolveFrom, modules) => {
100
+ const result = {};
101
+ const base = pathToFileURL(resolveFrom);
102
+ for (const mod of modules) {
103
+ let modPkgPath;
104
+ try {
105
+ modPkgPath = findPackageJSON(mod, base);
106
+ } catch {
107
+ modPkgPath = void 0;
108
+ }
109
+ const parsed = modPkgPath ? await readJsonFile(modPkgPath) : void 0;
110
+ const version = isRecord(parsed) && typeof parsed.version === "string" ? parsed.version.trim() : void 0;
111
+ if (!version) throw new Error(`Cannot extract version for module '${mod}'. Check that it's referenced in your package.json or installed.`);
112
+ result[mod] = version;
113
+ }
114
+ return result;
115
+ };
116
+ //#endregion
117
+ //#region src/rolldown/lambdaAsset.ts
118
+ const PLUGIN_NAME = "skuba:lambda-asset";
119
+ const resolveOutputDir = ({ dir, file }, cwd) => {
120
+ if (!dir) throw new Error(`${PLUGIN_NAME} requires \`output.dir\`; it prepares a deployable directory, so a single \`output.file\`${file ? ` (${file})` : ""} has nowhere to install into.`);
121
+ return path.resolve(cwd, dir);
122
+ };
123
+ const resolveLockFile = async (depsLockFilePath, cwd) => {
124
+ if (!depsLockFilePath) return findUp(PNPM_LOCK, { cwd });
125
+ const resolved = path.resolve(cwd, depsLockFilePath);
126
+ if (!await pathExists(resolved)) throw new Error(`${PLUGIN_NAME} cannot find a ${PNPM_LOCK} at '${depsLockFilePath}'.`);
127
+ return resolved;
128
+ };
129
+ const toPosix = (p) => p.split(path.sep).join("/");
130
+ /**
131
+ * Emits extra `assets` into the build output alongside the bundle.
132
+ *
133
+ * `from` is resolved relative to `projectRoot`; `to` becomes the emitted
134
+ * `fileName`, which rolldown writes relative to the output directory, creating
135
+ * parent directories as needed. Directories are emitted recursively, one asset
136
+ * per file. `originalFileName` points rolldown at each source file so watch mode
137
+ * rebuilds when it changes.
138
+ */
139
+ const emitAssets = async (emit, projectRoot, assets) => {
140
+ await Promise.all(assets.map(async (asset) => {
141
+ const from = path.resolve(projectRoot, asset.from);
142
+ const to = asset.to ?? path.basename(asset.from);
143
+ const normalized = path.normalize(to);
144
+ if (path.isAbsolute(normalized) || normalized === "." || normalized === ".." || normalized.startsWith(`..${path.sep}`)) throw new Error(`${PLUGIN_NAME} refuses to copy asset '${asset.from}' to '${asset.to}': it escapes the output directory.`);
145
+ const files = (await fs.promises.stat(from)).isDirectory() ? (await fs.promises.readdir(from, {
146
+ recursive: true,
147
+ withFileTypes: true
148
+ })).filter((entry) => entry.isFile()).map((entry) => path.join(entry.parentPath, entry.name)) : [from];
149
+ await Promise.all(files.map(async (absFile) => {
150
+ const rel = path.relative(from, absFile);
151
+ emit({
152
+ type: "asset",
153
+ fileName: toPosix(rel ? path.join(to, rel) : to),
154
+ originalFileName: absFile,
155
+ source: await fs.promises.readFile(absFile)
156
+ });
157
+ }));
158
+ }));
159
+ };
160
+ const writeOutputPackageJson = (outputDir, fields = {}) => fs.promises.writeFile(path.join(outputDir, "package.json"), JSON.stringify({
161
+ type: "module",
162
+ ...fields
163
+ }, null, 2));
164
+ /**
165
+ * Strips the install-only files back out of the output directory.
166
+ *
167
+ * `.npmrc` may hold registry credentials, so one path failing to remove must
168
+ * not skip the rest, and the caller must hear about it.
169
+ */
170
+ const stripInstallFiles = async (outputDir, stagedFiles, cause) => {
171
+ const reasons = (await Promise.allSettled([...stagedFiles, ...PNPM_METADATA_FILES.map((file) => path.join(outputDir, file))].map((file) => fs.remove(file)))).flatMap((result) => result.status === "rejected" ? [String(result.reason)] : []);
172
+ if (reasons.length) throw new Error(`${PLUGIN_NAME} could not strip install-only files from '${outputDir}'; these may include registry credentials and must not be deployed. ${reasons.join("; ")}`, { cause });
173
+ };
174
+ /**
175
+ * Prepares a rolldown output directory for deployment as a Lambda asset.
176
+ *
177
+ * The plugin supports ESM output and pnpm only. It makes no assumptions about
178
+ * how you bundle; it only augments what rolldown has already written:
179
+ *
180
+ * 1. Emits any extra `assets` into the build output alongside the bundle, via
181
+ * rolldown's `emitFile`.
182
+ * 2. Writes a `package.json` of `type: 'module'`.
183
+ * 3. Installs `nodeModules` into the output directory with pnpm, staging the
184
+ * workspace config, `.npmrc`, lock file and patches to do so.
185
+ * 4. Strips those install-only files back out, leaving the bundle, the
186
+ * generated `package.json` and `node_modules`.
187
+ *
188
+ * The result can be handed to CDK as `aws_lambda.Code.fromAsset(outputDir)`.
189
+ *
190
+ * @example
191
+ * ```js
192
+ * // rolldown.config.mjs
193
+ * import { Rolldown } from 'skuba';
194
+ *
195
+ * export default {
196
+ * input: { index: 'src/lambda.ts' },
197
+ * output: { dir: 'lib' },
198
+ * external: ['sharp'],
199
+ * plugins: [
200
+ * Rolldown.lambdaAsset({
201
+ * nodeModules: ['sharp'],
202
+ * assets: [{ from: 'src/config.json' }],
203
+ * }),
204
+ * ],
205
+ * };
206
+ * ```
207
+ */
208
+ const lambdaAsset = ({ nodeModules = [], assets = [], projectRoot: projectRootOption, depsLockFilePath: depsLockFilePathOption } = {}) => {
209
+ const prepared = /* @__PURE__ */ new Set();
210
+ let cwd = process.cwd();
211
+ return {
212
+ name: PLUGIN_NAME,
213
+ async buildStart(options) {
214
+ cwd = options.cwd;
215
+ prepared.clear();
216
+ if (assets.length) {
217
+ const projectRoot = path.resolve(cwd, projectRootOption ?? ".");
218
+ await emitAssets((file) => this.emitFile(file), projectRoot, assets);
219
+ }
220
+ },
221
+ async writeBundle(outputOptions) {
222
+ const outputDir = resolveOutputDir(outputOptions, cwd);
223
+ if (prepared.has(outputDir)) return;
224
+ prepared.add(outputDir);
225
+ const projectRoot = path.resolve(cwd, projectRootOption ?? ".");
226
+ if (!nodeModules.length) {
227
+ await writeOutputPackageJson(outputDir);
228
+ return;
229
+ }
230
+ const depsLockFilePath = await resolveLockFile(depsLockFilePathOption, cwd);
231
+ if (!depsLockFilePath) throw new Error(`${PLUGIN_NAME} cannot find a ${PNPM_LOCK}, which \`nodeModules\` requires. Specify one with \`depsLockFilePath\`.`);
232
+ const workspaceRoot = path.dirname(depsLockFilePath);
233
+ const projectPackageJson = path.join(projectRoot, "package.json");
234
+ if (!await pathExists(projectPackageJson)) throw new Error(`${PLUGIN_NAME} cannot find a package.json in '${projectRoot}', which \`nodeModules\` requires. Specify the directory with \`projectRoot\`.`);
235
+ const [dependencies, packageManagerFields] = await Promise.all([extractDependencies(projectPackageJson, nodeModules), readPackageManagerFields(workspaceRoot)]);
236
+ await writeOutputPackageJson(outputDir, {
237
+ dependencies,
238
+ ...packageManagerFields
239
+ });
240
+ const stagedFiles = [];
241
+ try {
242
+ await stageWorkspaceFiles(workspaceRoot, outputDir, stagedFiles);
243
+ const lockDest = path.join(outputDir, PNPM_LOCK);
244
+ stagedFiles.push(lockDest);
245
+ await fs.promises.copyFile(depsLockFilePath, lockDest);
246
+ log.plain(log.bold(PLUGIN_NAME), "installing", log.bold(nodeModules.join(", ")));
247
+ const [bin, ...args] = PNPM_INSTALL_COMMAND;
248
+ await createExec({ cwd: outputDir })(bin, ...args);
249
+ } catch (err) {
250
+ await stripInstallFiles(outputDir, [
251
+ ...stagedFiles,
252
+ path.join(outputDir, "package.json"),
253
+ path.join(outputDir, "node_modules")
254
+ ], err);
255
+ throw err;
256
+ }
257
+ await stripInstallFiles(outputDir, stagedFiles);
258
+ }
259
+ };
260
+ };
261
+ //#endregion
262
+ //#region src/rolldown/index.ts
263
+ var rolldown_exports = /* @__PURE__ */ __exportAll({ lambdaAsset: () => lambdaAsset });
264
+ //#endregion
265
+ export { lambdaAsset as n, rolldown_exports as t };
@@ -0,0 +1,278 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_logging = require("./logging-BqpzZfsF.cjs");
3
+ const require_exec = require("./exec-DCUB5Shx.cjs");
4
+ const require_fs = require("./fs-DS2eIMxA.cjs");
5
+ let fs_extra = require("fs-extra");
6
+ fs_extra = require_rolldown_runtime.__toESM(fs_extra, 1);
7
+ let node_path = require("node:path");
8
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
9
+ let find_up = require("find-up");
10
+ let node_module = require("node:module");
11
+ let node_url = require("node:url");
12
+ let yaml = require("yaml");
13
+ //#region src/rolldown/pnpm.ts
14
+ const PNPM_LOCK = "pnpm-lock.yaml";
15
+ const PNPM_WORKSPACE_YAML = "pnpm-workspace.yaml";
16
+ const PNPM_PATCHES_DIR = "patches";
17
+ const PNPM_WORKSPACE_FILES = [
18
+ PNPM_WORKSPACE_YAML,
19
+ ".npmrc",
20
+ ".pnpmfile.cjs",
21
+ ".pnpmfile.mjs"
22
+ ];
23
+ const PNPM_METADATA_FILES = [node_path.join("node_modules", ".modules.yaml"), node_path.join("node_modules", ".pnpm-workspace-state-v1.json")];
24
+ const PNPM_INSTALL_COMMAND = [
25
+ "pnpm",
26
+ "install",
27
+ "--config.node-linker=hoisted",
28
+ "--config.package-import-method=clone-or-copy",
29
+ "--no-frozen-lockfile",
30
+ "--prefer-offline"
31
+ ];
32
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
33
+ const readJsonFile = async (filePath) => {
34
+ try {
35
+ return await fs_extra.default.readJson(filePath);
36
+ } catch (err) {
37
+ throw new Error(`Failed to parse ${filePath} as JSON: ${err.message}`);
38
+ }
39
+ };
40
+ const PACKAGE_MANAGER_FIELDS = ["packageManager", "devEngines"];
41
+ /**
42
+ * Reads the package manager pin from the workspace root manifest.
43
+ *
44
+ * Forwarding it to the output directory keeps the staged install on the same
45
+ * pnpm version as the project.
46
+ */
47
+ const readPackageManagerFields = async (workspaceRoot) => {
48
+ const pkgPath = node_path.join(workspaceRoot, "package.json");
49
+ if (!await require_fs.pathExists(pkgPath)) return {};
50
+ const parsed = await readJsonFile(pkgPath);
51
+ if (!isRecord(parsed)) return {};
52
+ return Object.fromEntries(PACKAGE_MANAGER_FIELDS.flatMap((field) => parsed[field] === void 0 ? [] : [[field, parsed[field]]]));
53
+ };
54
+ /**
55
+ * The output directory installs a subset of the workspace's dependencies, so
56
+ * most `patchedDependencies` entries have nothing to apply to. pnpm fails the
57
+ * install on an unused patch unless this is set.
58
+ */
59
+ const allowUnusedPatches = (content) => {
60
+ const doc = (0, yaml.parseDocument)(content);
61
+ const [error] = doc.errors;
62
+ if (error) throw new Error(`Failed to parse ${PNPM_WORKSPACE_YAML}: ${error.message}`);
63
+ if (!(0, yaml.isMap)(doc.contents)) return content;
64
+ doc.set("allowUnusedPatches", true);
65
+ return doc.toString();
66
+ };
67
+ /**
68
+ * Stages the pnpm config that an install in `outputDir` needs.
69
+ *
70
+ * Patch files are staged from `patches`, where `pnpm patch-commit` writes them.
71
+ *
72
+ * Every path written is appended to `stagedFiles` so the caller can strip it
73
+ * back out once the install is done; `.npmrc` in particular may hold registry
74
+ * credentials that must not ship in the asset.
75
+ */
76
+ const stageWorkspaceFiles = async (workspaceRoot, outputDir, stagedFiles = []) => {
77
+ const present = (await Promise.all(PNPM_WORKSPACE_FILES.map(async (file) => {
78
+ const src = node_path.join(workspaceRoot, file);
79
+ return await require_fs.pathExists(src) ? {
80
+ file,
81
+ src
82
+ } : void 0;
83
+ }))).filter((entry) => entry !== void 0);
84
+ for (const { file } of present) stagedFiles.push(node_path.join(outputDir, file));
85
+ await Promise.all(present.map(async ({ file, src }) => {
86
+ const dest = node_path.join(outputDir, file);
87
+ if (file === PNPM_WORKSPACE_YAML) await fs_extra.default.promises.writeFile(dest, allowUnusedPatches(await fs_extra.default.promises.readFile(src, "utf8")));
88
+ else await fs_extra.default.promises.copyFile(src, dest);
89
+ }));
90
+ const patchesSrc = node_path.join(workspaceRoot, PNPM_PATCHES_DIR);
91
+ if (await require_fs.pathExists(patchesSrc)) {
92
+ const patchesDest = node_path.join(outputDir, PNPM_PATCHES_DIR);
93
+ stagedFiles.push(patchesDest);
94
+ await fs_extra.default.copy(patchesSrc, patchesDest);
95
+ }
96
+ return stagedFiles;
97
+ };
98
+ /**
99
+ * Resolves the installed version of each module, as seen from `resolveFrom`.
100
+ */
101
+ const extractDependencies = async (resolveFrom, modules) => {
102
+ const result = {};
103
+ const base = (0, node_url.pathToFileURL)(resolveFrom);
104
+ for (const mod of modules) {
105
+ let modPkgPath;
106
+ try {
107
+ modPkgPath = (0, node_module.findPackageJSON)(mod, base);
108
+ } catch {
109
+ modPkgPath = void 0;
110
+ }
111
+ const parsed = modPkgPath ? await readJsonFile(modPkgPath) : void 0;
112
+ const version = isRecord(parsed) && typeof parsed.version === "string" ? parsed.version.trim() : void 0;
113
+ if (!version) throw new Error(`Cannot extract version for module '${mod}'. Check that it's referenced in your package.json or installed.`);
114
+ result[mod] = version;
115
+ }
116
+ return result;
117
+ };
118
+ //#endregion
119
+ //#region src/rolldown/lambdaAsset.ts
120
+ const PLUGIN_NAME = "skuba:lambda-asset";
121
+ const resolveOutputDir = ({ dir, file }, cwd) => {
122
+ if (!dir) throw new Error(`${PLUGIN_NAME} requires \`output.dir\`; it prepares a deployable directory, so a single \`output.file\`${file ? ` (${file})` : ""} has nowhere to install into.`);
123
+ return node_path.resolve(cwd, dir);
124
+ };
125
+ const resolveLockFile = async (depsLockFilePath, cwd) => {
126
+ if (!depsLockFilePath) return (0, find_up.findUp)(PNPM_LOCK, { cwd });
127
+ const resolved = node_path.resolve(cwd, depsLockFilePath);
128
+ if (!await require_fs.pathExists(resolved)) throw new Error(`${PLUGIN_NAME} cannot find a ${PNPM_LOCK} at '${depsLockFilePath}'.`);
129
+ return resolved;
130
+ };
131
+ const toPosix = (p) => p.split(node_path.sep).join("/");
132
+ /**
133
+ * Emits extra `assets` into the build output alongside the bundle.
134
+ *
135
+ * `from` is resolved relative to `projectRoot`; `to` becomes the emitted
136
+ * `fileName`, which rolldown writes relative to the output directory, creating
137
+ * parent directories as needed. Directories are emitted recursively, one asset
138
+ * per file. `originalFileName` points rolldown at each source file so watch mode
139
+ * rebuilds when it changes.
140
+ */
141
+ const emitAssets = async (emit, projectRoot, assets) => {
142
+ await Promise.all(assets.map(async (asset) => {
143
+ const from = node_path.resolve(projectRoot, asset.from);
144
+ const to = asset.to ?? node_path.basename(asset.from);
145
+ const normalized = node_path.normalize(to);
146
+ if (node_path.isAbsolute(normalized) || normalized === "." || normalized === ".." || normalized.startsWith(`..${node_path.sep}`)) throw new Error(`${PLUGIN_NAME} refuses to copy asset '${asset.from}' to '${asset.to}': it escapes the output directory.`);
147
+ const files = (await fs_extra.default.promises.stat(from)).isDirectory() ? (await fs_extra.default.promises.readdir(from, {
148
+ recursive: true,
149
+ withFileTypes: true
150
+ })).filter((entry) => entry.isFile()).map((entry) => node_path.join(entry.parentPath, entry.name)) : [from];
151
+ await Promise.all(files.map(async (absFile) => {
152
+ const rel = node_path.relative(from, absFile);
153
+ emit({
154
+ type: "asset",
155
+ fileName: toPosix(rel ? node_path.join(to, rel) : to),
156
+ originalFileName: absFile,
157
+ source: await fs_extra.default.promises.readFile(absFile)
158
+ });
159
+ }));
160
+ }));
161
+ };
162
+ const writeOutputPackageJson = (outputDir, fields = {}) => fs_extra.default.promises.writeFile(node_path.join(outputDir, "package.json"), JSON.stringify({
163
+ type: "module",
164
+ ...fields
165
+ }, null, 2));
166
+ /**
167
+ * Strips the install-only files back out of the output directory.
168
+ *
169
+ * `.npmrc` may hold registry credentials, so one path failing to remove must
170
+ * not skip the rest, and the caller must hear about it.
171
+ */
172
+ const stripInstallFiles = async (outputDir, stagedFiles, cause) => {
173
+ const reasons = (await Promise.allSettled([...stagedFiles, ...PNPM_METADATA_FILES.map((file) => node_path.join(outputDir, file))].map((file) => fs_extra.default.remove(file)))).flatMap((result) => result.status === "rejected" ? [String(result.reason)] : []);
174
+ if (reasons.length) throw new Error(`${PLUGIN_NAME} could not strip install-only files from '${outputDir}'; these may include registry credentials and must not be deployed. ${reasons.join("; ")}`, { cause });
175
+ };
176
+ /**
177
+ * Prepares a rolldown output directory for deployment as a Lambda asset.
178
+ *
179
+ * The plugin supports ESM output and pnpm only. It makes no assumptions about
180
+ * how you bundle; it only augments what rolldown has already written:
181
+ *
182
+ * 1. Emits any extra `assets` into the build output alongside the bundle, via
183
+ * rolldown's `emitFile`.
184
+ * 2. Writes a `package.json` of `type: 'module'`.
185
+ * 3. Installs `nodeModules` into the output directory with pnpm, staging the
186
+ * workspace config, `.npmrc`, lock file and patches to do so.
187
+ * 4. Strips those install-only files back out, leaving the bundle, the
188
+ * generated `package.json` and `node_modules`.
189
+ *
190
+ * The result can be handed to CDK as `aws_lambda.Code.fromAsset(outputDir)`.
191
+ *
192
+ * @example
193
+ * ```js
194
+ * // rolldown.config.mjs
195
+ * import { Rolldown } from 'skuba';
196
+ *
197
+ * export default {
198
+ * input: { index: 'src/lambda.ts' },
199
+ * output: { dir: 'lib' },
200
+ * external: ['sharp'],
201
+ * plugins: [
202
+ * Rolldown.lambdaAsset({
203
+ * nodeModules: ['sharp'],
204
+ * assets: [{ from: 'src/config.json' }],
205
+ * }),
206
+ * ],
207
+ * };
208
+ * ```
209
+ */
210
+ const lambdaAsset = ({ nodeModules = [], assets = [], projectRoot: projectRootOption, depsLockFilePath: depsLockFilePathOption } = {}) => {
211
+ const prepared = /* @__PURE__ */ new Set();
212
+ let cwd = process.cwd();
213
+ return {
214
+ name: PLUGIN_NAME,
215
+ async buildStart(options) {
216
+ cwd = options.cwd;
217
+ prepared.clear();
218
+ if (assets.length) {
219
+ const projectRoot = node_path.resolve(cwd, projectRootOption ?? ".");
220
+ await emitAssets((file) => this.emitFile(file), projectRoot, assets);
221
+ }
222
+ },
223
+ async writeBundle(outputOptions) {
224
+ const outputDir = resolveOutputDir(outputOptions, cwd);
225
+ if (prepared.has(outputDir)) return;
226
+ prepared.add(outputDir);
227
+ const projectRoot = node_path.resolve(cwd, projectRootOption ?? ".");
228
+ if (!nodeModules.length) {
229
+ await writeOutputPackageJson(outputDir);
230
+ return;
231
+ }
232
+ const depsLockFilePath = await resolveLockFile(depsLockFilePathOption, cwd);
233
+ if (!depsLockFilePath) throw new Error(`${PLUGIN_NAME} cannot find a ${PNPM_LOCK}, which \`nodeModules\` requires. Specify one with \`depsLockFilePath\`.`);
234
+ const workspaceRoot = node_path.dirname(depsLockFilePath);
235
+ const projectPackageJson = node_path.join(projectRoot, "package.json");
236
+ if (!await require_fs.pathExists(projectPackageJson)) throw new Error(`${PLUGIN_NAME} cannot find a package.json in '${projectRoot}', which \`nodeModules\` requires. Specify the directory with \`projectRoot\`.`);
237
+ const [dependencies, packageManagerFields] = await Promise.all([extractDependencies(projectPackageJson, nodeModules), readPackageManagerFields(workspaceRoot)]);
238
+ await writeOutputPackageJson(outputDir, {
239
+ dependencies,
240
+ ...packageManagerFields
241
+ });
242
+ const stagedFiles = [];
243
+ try {
244
+ await stageWorkspaceFiles(workspaceRoot, outputDir, stagedFiles);
245
+ const lockDest = node_path.join(outputDir, PNPM_LOCK);
246
+ stagedFiles.push(lockDest);
247
+ await fs_extra.default.promises.copyFile(depsLockFilePath, lockDest);
248
+ require_logging.log.plain(require_logging.log.bold(PLUGIN_NAME), "installing", require_logging.log.bold(nodeModules.join(", ")));
249
+ const [bin, ...args] = PNPM_INSTALL_COMMAND;
250
+ await require_exec.createExec({ cwd: outputDir })(bin, ...args);
251
+ } catch (err) {
252
+ await stripInstallFiles(outputDir, [
253
+ ...stagedFiles,
254
+ node_path.join(outputDir, "package.json"),
255
+ node_path.join(outputDir, "node_modules")
256
+ ], err);
257
+ throw err;
258
+ }
259
+ await stripInstallFiles(outputDir, stagedFiles);
260
+ }
261
+ };
262
+ };
263
+ //#endregion
264
+ //#region src/rolldown/index.ts
265
+ var rolldown_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ lambdaAsset: () => lambdaAsset });
266
+ //#endregion
267
+ Object.defineProperty(exports, "lambdaAsset", {
268
+ enumerable: true,
269
+ get: function() {
270
+ return lambdaAsset;
271
+ }
272
+ });
273
+ Object.defineProperty(exports, "rolldown_exports", {
274
+ enumerable: true,
275
+ get: function() {
276
+ return rolldown_exports;
277
+ }
278
+ });
@@ -24,7 +24,7 @@ var __copyProps = (to, from, except, desc) => {
24
24
  }
25
25
  return to;
26
26
  };
27
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
28
28
  value: mod,
29
29
  enumerable: true
30
30
  }) : target, mod));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skuba-lib/api",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-clanker-migrate-20260901033953",
4
4
  "description": "Node.js development API for skuba",
5
5
  "homepage": "https://github.com/seek-oss/skuba#readme",
6
6
  "bugs": {
@@ -39,6 +39,10 @@
39
39
  "import": "./lib/net/index.mjs",
40
40
  "require": "./lib/net/index.cjs"
41
41
  },
42
+ "./rolldown": {
43
+ "import": "./lib/rolldown/index.mjs",
44
+ "require": "./lib/rolldown/index.cjs"
45
+ },
42
46
  "./package.json": "./package.json"
43
47
  },
44
48
  "main": "./lib/index.cjs",
@@ -50,21 +54,32 @@
50
54
  "cdk",
51
55
  "git",
52
56
  "github",
53
- "net"
57
+ "net",
58
+ "rolldown"
54
59
  ],
55
60
  "dependencies": {
56
61
  "@octokit/graphql": "^9.0.0",
57
62
  "@octokit/rest": "^22.0.0",
58
- "@octokit/types": "^16.0.0",
63
+ "@octokit/types": "^17.0.0",
59
64
  "concurrently": "^10.0.0",
60
65
  "execa": "^9.6.1",
66
+ "find-up": "^8.0.0",
61
67
  "fs-extra": "^11.0.0",
62
68
  "ignore": "^7.0.0",
63
69
  "isomorphic-git": "^1.37.6",
64
70
  "npm-run-path": "^6.0.0",
65
71
  "npm-which": "^3.0.1",
72
+ "yaml": "^2.9.0",
66
73
  "zod": "^4.3.5"
67
74
  },
75
+ "peerDependencies": {
76
+ "rolldown": "^1.1.0"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "rolldown": {
80
+ "optional": true
81
+ }
82
+ },
68
83
  "engines": {
69
84
  "node": ">=22.14.0"
70
85
  },
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "main": "../lib/rolldown/index.cjs",
4
+ "module": "../lib/rolldown/index.mjs",
5
+ "types": "../lib/rolldown/index.d.cts"
6
+ }