@skuba-lib/api 2.2.0-add-cdk-NodejsFunction-20260613135656 → 2.2.0-add-cdk-NodejsFunction-20260614035222

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.
@@ -1,2 +1,2 @@
1
- import { n as md, r as annotate } from "../buildkite-CJ4a_6Cv.mjs";
1
+ import { n as md, r as annotate } from "../buildkite-DiYlcd9q.mjs";
2
2
  export { annotate, md };
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./chunk-D7D4PA-g.mjs";
1
+ import { t as __exportAll } from "./chunk-8H4AJuhK.mjs";
2
2
  import { n as log } from "./error-BYLsj5YU.mjs";
3
3
  import { n as exec, r as hasCommand } from "./exec-CbhqWxN4.mjs";
4
4
  //#region src/buildkite/annotate.ts
package/lib/cdk/index.cjs CHANGED
@@ -1,6 +1,22 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let node_module = require("node:module");
2
3
  //#region src/cdk/normaliseTemplate/index.ts
3
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
5
  const normaliseTemplate = (template) => JSON.parse(normaliseTemplateJsonString(JSON.stringify(template)));
5
6
  //#endregion
6
- exports.normaliseTemplate = normaliseTemplate;
7
+ //#region src/cdk/index.ts
8
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
9
+ let cached;
10
+ const Cdk = {
11
+ normaliseTemplate,
12
+ /**
13
+ * Lazily loads {@link NodejsFunction} on first access so that the optional
14
+ * `aws-cdk-lib`, `constructs` and `rolldown` peer dependencies are only
15
+ * required by consumers that actually use the construct.
16
+ */
17
+ get NodejsFunction() {
18
+ return cached ??= require$1("@skuba-lib/api/cdk/nodejsFunction").NodejsFunction;
19
+ }
20
+ };
21
+ //#endregion
22
+ exports.Cdk = Cdk;
@@ -1,4 +1,14 @@
1
- //#region src/cdk/normaliseTemplate/index.d.ts
2
- declare const normaliseTemplate: (template: object) => unknown;
1
+ import { i as ICommandHooks, n as NodejsFunctionProps, r as BundlingOptions, t as NodejsFunction } from "../index-DnMMX6Ji.cjs";
2
+
3
+ //#region src/cdk/index.d.ts
4
+ declare const Cdk: {
5
+ normaliseTemplate: (template: object) => unknown;
6
+ /**
7
+ * Lazily loads {@link NodejsFunction} on first access so that the optional
8
+ * `aws-cdk-lib`, `constructs` and `rolldown` peer dependencies are only
9
+ * required by consumers that actually use the construct.
10
+ */
11
+ readonly NodejsFunction: typeof NodejsFunction;
12
+ };
3
13
  //#endregion
4
- export { normaliseTemplate };
14
+ export { type BundlingOptions, Cdk, type ICommandHooks, type NodejsFunctionProps };
@@ -1,4 +1,14 @@
1
- //#region src/cdk/normaliseTemplate/index.d.ts
2
- declare const normaliseTemplate: (template: object) => unknown;
1
+ import { i as ICommandHooks, n as NodejsFunctionProps, r as BundlingOptions, t as NodejsFunction } from "../index-DnMMX6Ji.mjs";
2
+
3
+ //#region src/cdk/index.d.ts
4
+ declare const Cdk: {
5
+ normaliseTemplate: (template: object) => unknown;
6
+ /**
7
+ * Lazily loads {@link NodejsFunction} on first access so that the optional
8
+ * `aws-cdk-lib`, `constructs` and `rolldown` peer dependencies are only
9
+ * required by consumers that actually use the construct.
10
+ */
11
+ readonly NodejsFunction: typeof NodejsFunction;
12
+ };
3
13
  //#endregion
4
- export { normaliseTemplate };
14
+ export { type BundlingOptions, Cdk, type ICommandHooks, type NodejsFunctionProps };
package/lib/cdk/index.mjs CHANGED
@@ -1,5 +1,21 @@
1
+ import { createRequire } from "node:module";
1
2
  //#region src/cdk/normaliseTemplate/index.ts
2
3
  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
4
  const normaliseTemplate = (template) => JSON.parse(normaliseTemplateJsonString(JSON.stringify(template)));
4
5
  //#endregion
5
- export { normaliseTemplate };
6
+ //#region src/cdk/index.ts
7
+ const require = createRequire(import.meta.url);
8
+ let cached;
9
+ const Cdk = {
10
+ normaliseTemplate,
11
+ /**
12
+ * Lazily loads {@link NodejsFunction} on first access so that the optional
13
+ * `aws-cdk-lib`, `constructs` and `rolldown` peer dependencies are only
14
+ * required by consumers that actually use the construct.
15
+ */
16
+ get NodejsFunction() {
17
+ return cached ??= require("@skuba-lib/api/cdk/nodejsFunction").NodejsFunction;
18
+ }
19
+ };
20
+ //#endregion
21
+ export { Cdk };
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-DakpK96I.cjs");
3
+ let node_module = require("node:module");
3
4
  let node_fs = require("node:fs");
4
5
  node_fs = require_chunk.__toESM(node_fs, 1);
5
6
  let node_path = require("node:path");
@@ -11,7 +12,6 @@ let aws_cdk_lib = require("aws-cdk-lib");
11
12
  aws_cdk_lib = require_chunk.__toESM(aws_cdk_lib, 1);
12
13
  let node_url = require("node:url");
13
14
  let yaml = require("yaml");
14
- let node_module = require("node:module");
15
15
  //#region src/cdk/nodejsFunction/errors.ts
16
16
  var ValidationError = class extends Error {
17
17
  constructor(message) {
@@ -1,32 +1,2 @@
1
- import * as lambda from "aws-cdk-lib/aws-lambda";
2
- import { Construct } from "constructs";
3
-
4
- //#region src/cdk/nodejsFunction/types.d.ts
5
- interface ICommandHooks {
6
- beforeBundling(inputDir: string, outputDir: string): string[];
7
- afterBundling(inputDir: string, outputDir: string): string[];
8
- beforeInstall(inputDir: string, outputDir: string): string[];
9
- }
10
- interface BundlingOptions {
11
- bundlerConfig: string;
12
- nodeModules?: string[];
13
- commandHooks?: ICommandHooks;
14
- assetHash?: string;
15
- timeout?: number;
16
- ignoreScripts?: boolean;
17
- }
18
- //#endregion
19
- //#region src/cdk/nodejsFunction/function.d.ts
20
- interface NodejsFunctionProps extends lambda.FunctionOptions {
21
- readonly entry: string;
22
- readonly handler?: string;
23
- readonly runtime?: lambda.Runtime;
24
- readonly depsLockFilePath?: string;
25
- readonly projectRoot?: string;
26
- readonly bundling: BundlingOptions;
27
- }
28
- declare class NodejsFunction extends lambda.Function {
29
- constructor(scope: Construct, id: string, props: NodejsFunctionProps);
30
- }
31
- //#endregion
1
+ import { i as ICommandHooks, n as NodejsFunctionProps, r as BundlingOptions, t as NodejsFunction } from "../../index-DnMMX6Ji.cjs";
32
2
  export { type BundlingOptions, type ICommandHooks, NodejsFunction, type NodejsFunctionProps };
@@ -1,32 +1,2 @@
1
- import * as lambda from "aws-cdk-lib/aws-lambda";
2
- import { Construct } from "constructs";
3
-
4
- //#region src/cdk/nodejsFunction/types.d.ts
5
- interface ICommandHooks {
6
- beforeBundling(inputDir: string, outputDir: string): string[];
7
- afterBundling(inputDir: string, outputDir: string): string[];
8
- beforeInstall(inputDir: string, outputDir: string): string[];
9
- }
10
- interface BundlingOptions {
11
- bundlerConfig: string;
12
- nodeModules?: string[];
13
- commandHooks?: ICommandHooks;
14
- assetHash?: string;
15
- timeout?: number;
16
- ignoreScripts?: boolean;
17
- }
18
- //#endregion
19
- //#region src/cdk/nodejsFunction/function.d.ts
20
- interface NodejsFunctionProps extends lambda.FunctionOptions {
21
- readonly entry: string;
22
- readonly handler?: string;
23
- readonly runtime?: lambda.Runtime;
24
- readonly depsLockFilePath?: string;
25
- readonly projectRoot?: string;
26
- readonly bundling: BundlingOptions;
27
- }
28
- declare class NodejsFunction extends lambda.Function {
29
- constructor(scope: Construct, id: string, props: NodejsFunctionProps);
30
- }
31
- //#endregion
1
+ import { i as ICommandHooks, n as NodejsFunctionProps, r as BundlingOptions, t as NodejsFunction } from "../../index-DnMMX6Ji.mjs";
32
2
  export { type BundlingOptions, type ICommandHooks, NodejsFunction, type NodejsFunctionProps };
@@ -1,3 +1,4 @@
1
+ import "node:module";
1
2
  //#region \0rolldown/runtime.js
2
3
  var __defProp = Object.defineProperty;
3
4
  var __exportAll = (all, no_symbols) => {
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-BSWQdkgU.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-DEbnLMom.mjs";
2
2
  export { commit, commitAllChanges, currentBranch, fastForwardBranch, findRoot, getChangedFiles, getHeadCommitId, getHeadCommitMessage, getOwnerAndRepo, isFileGitIgnored, push, reset };
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./chunk-D7D4PA-g.mjs";
1
+ import { t as __exportAll } from "./chunk-8H4AJuhK.mjs";
2
2
  import { t as isErrorWithCode } from "./error-BYLsj5YU.mjs";
3
3
  import fs from "fs-extra";
4
4
  import git, { findRoot } from "isomorphic-git";
@@ -1,3 +1,3 @@
1
- import { c as enabledFromEnvironment, o as apiTokenFromEnvironment, s as buildNameFromEnvironment } from "../git-BSWQdkgU.mjs";
2
- import { a as putIssueComment, i as uploadFileChanges, n as readFileChanges, o as getPullRequestNumber, r as uploadAllFileChanges, s as createCheckRun } from "../github-IYwiDs5D.mjs";
1
+ import { c as enabledFromEnvironment, o as apiTokenFromEnvironment, s as buildNameFromEnvironment } from "../git-DEbnLMom.mjs";
2
+ import { a as putIssueComment, i as uploadFileChanges, n as readFileChanges, o as getPullRequestNumber, r as uploadAllFileChanges, s as createCheckRun } from "../github-Dq4RJqAX.mjs";
3
3
  export { apiTokenFromEnvironment, buildNameFromEnvironment, createCheckRun, enabledFromEnvironment, getPullRequestNumber, putIssueComment, readFileChanges, uploadAllFileChanges, uploadFileChanges };
@@ -1,6 +1,6 @@
1
- import { t as __exportAll } from "./chunk-D7D4PA-g.mjs";
1
+ import { t as __exportAll } from "./chunk-8H4AJuhK.mjs";
2
2
  import { r as pluralise } from "./error-BYLsj5YU.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-BSWQdkgU.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-DEbnLMom.mjs";
4
4
  import fs from "fs-extra";
5
5
  import path from "path";
6
6
  //#region src/github/octokit.ts
@@ -0,0 +1,32 @@
1
+ import * as lambda from "aws-cdk-lib/aws-lambda";
2
+ import { Construct } from "constructs";
3
+
4
+ //#region src/cdk/nodejsFunction/types.d.ts
5
+ interface ICommandHooks {
6
+ beforeBundling(inputDir: string, outputDir: string): string[];
7
+ afterBundling(inputDir: string, outputDir: string): string[];
8
+ beforeInstall(inputDir: string, outputDir: string): string[];
9
+ }
10
+ interface BundlingOptions {
11
+ bundlerConfig: string;
12
+ nodeModules?: string[];
13
+ commandHooks?: ICommandHooks;
14
+ assetHash?: string;
15
+ timeout?: number;
16
+ ignoreScripts?: boolean;
17
+ }
18
+ //#endregion
19
+ //#region src/cdk/nodejsFunction/function.d.ts
20
+ interface NodejsFunctionProps extends lambda.FunctionOptions {
21
+ readonly entry: string;
22
+ readonly handler?: string;
23
+ readonly runtime?: lambda.Runtime;
24
+ readonly depsLockFilePath?: string;
25
+ readonly projectRoot?: string;
26
+ readonly bundling: BundlingOptions;
27
+ }
28
+ declare class NodejsFunction extends lambda.Function {
29
+ constructor(scope: Construct, id: string, props: NodejsFunctionProps);
30
+ }
31
+ //#endregion
32
+ export { ICommandHooks as i, NodejsFunctionProps as n, BundlingOptions as r, NodejsFunction as t };
@@ -0,0 +1,32 @@
1
+ import * as lambda from "aws-cdk-lib/aws-lambda";
2
+ import { Construct } from "constructs";
3
+
4
+ //#region src/cdk/nodejsFunction/types.d.ts
5
+ interface ICommandHooks {
6
+ beforeBundling(inputDir: string, outputDir: string): string[];
7
+ afterBundling(inputDir: string, outputDir: string): string[];
8
+ beforeInstall(inputDir: string, outputDir: string): string[];
9
+ }
10
+ interface BundlingOptions {
11
+ bundlerConfig: string;
12
+ nodeModules?: string[];
13
+ commandHooks?: ICommandHooks;
14
+ assetHash?: string;
15
+ timeout?: number;
16
+ ignoreScripts?: boolean;
17
+ }
18
+ //#endregion
19
+ //#region src/cdk/nodejsFunction/function.d.ts
20
+ interface NodejsFunctionProps extends lambda.FunctionOptions {
21
+ readonly entry: string;
22
+ readonly handler?: string;
23
+ readonly runtime?: lambda.Runtime;
24
+ readonly depsLockFilePath?: string;
25
+ readonly projectRoot?: string;
26
+ readonly bundling: BundlingOptions;
27
+ }
28
+ declare class NodejsFunction extends lambda.Function {
29
+ constructor(scope: Construct, id: string, props: NodejsFunctionProps);
30
+ }
31
+ //#endregion
32
+ export { ICommandHooks as i, NodejsFunctionProps as n, BundlingOptions as r, NodejsFunction as t };
package/lib/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as buildkite_exports } from "./buildkite-CJ4a_6Cv.mjs";
2
- import { t as git_exports } from "./git-BSWQdkgU.mjs";
3
- import { t as github_exports } from "./github-IYwiDs5D.mjs";
4
- import { t as net_exports } from "./net-ZfhL_QSV.mjs";
1
+ import { t as buildkite_exports } from "./buildkite-DiYlcd9q.mjs";
2
+ import { t as git_exports } from "./git-DEbnLMom.mjs";
3
+ import { t as github_exports } from "./github-Dq4RJqAX.mjs";
4
+ import { t as net_exports } from "./net-CBMRjy4b.mjs";
5
5
  export { buildkite_exports as Buildkite, git_exports as Git, github_exports as GitHub, net_exports as Net };
package/lib/net/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as waitFor } from "../net-ZfhL_QSV.mjs";
1
+ import { n as waitFor } from "../net-CBMRjy4b.mjs";
2
2
  export { waitFor };
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./chunk-D7D4PA-g.mjs";
1
+ import { t as __exportAll } from "./chunk-8H4AJuhK.mjs";
2
2
  import { t as createExec } from "./exec-CbhqWxN4.mjs";
3
3
  import net from "net";
4
4
  //#region src/net/compose.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skuba-lib/api",
3
- "version": "2.2.0-add-cdk-NodejsFunction-20260613135656",
3
+ "version": "2.2.0-add-cdk-NodejsFunction-20260614035222",
4
4
  "description": "Node.js development API for skuba",
5
5
  "homepage": "https://github.com/seek-oss/skuba#readme",
6
6
  "bugs": {