skuba 13.0.0-custom-conditions-exports-20250923055337 → 13.0.0-custom-conditions-exports-20251007055842
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/build/assets.js +3 -7
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/esbuild.d.ts +2 -1
- package/lib/cli/build/esbuild.js +4 -3
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +8 -4
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/init/git.js +1 -1
- package/lib/cli/init/git.js.map +2 -2
- package/lib/cli/init/index.js +4 -4
- package/lib/cli/init/index.js.map +3 -3
- package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/index.js +1 -1
- package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
- package/lib/cli/lint/annotate/buildkite/internal.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +2 -2
- package/lib/cli/lint/annotate/github/eslint.d.ts +1 -1
- package/lib/cli/lint/annotate/github/eslint.js.map +2 -2
- package/lib/cli/lint/annotate/github/index.js +3 -4
- package/lib/cli/lint/annotate/github/index.js.map +2 -2
- package/lib/cli/lint/annotate/github/internal.d.ts +1 -1
- package/lib/cli/lint/annotate/github/internal.js.map +2 -2
- package/lib/cli/lint/annotate/github/prettier.d.ts +1 -1
- package/lib/cli/lint/annotate/github/prettier.js.map +2 -2
- package/lib/cli/lint/annotate/github/tsc.d.ts +1 -1
- package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
- package/lib/cli/lint/autofix.d.ts +1 -1
- package/lib/cli/lint/autofix.js +3 -3
- package/lib/cli/lint/autofix.js.map +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +1 -1
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/{api/buildkite → cli/lint/internalLints/upgrade/patches/12.3.0}/index.js +17 -9
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +100 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +99 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +2 -0
- package/lib/{api/net → cli/lint/internalLints/upgrade/patches/12.4.0}/index.js +12 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +101 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/configureTsConfigForESM.js +9 -7
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/configureTsConfigForESM.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/index.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.d.ts +13 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js +225 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js.map +7 -0
- package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.js +3 -4
- package/lib/cli/test/reporters/github/index.js.map +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -4
- package/lib/index.js.map +2 -2
- package/lib/utils/dir.js +2 -2
- package/lib/utils/dir.js.map +3 -3
- package/lib/utils/manifest.d.ts +5 -1
- package/lib/utils/manifest.js +16 -7
- package/lib/utils/manifest.js.map +2 -2
- package/package.json +4 -3
- package/template/base/_pnpm-workspace.yaml +1 -0
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +0 -2
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/Dockerfile +0 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +0 -2
- package/template/koa-rest-api/package.json +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +0 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +2 -2
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/README.md +1 -1
- package/lib/api/buildkite/annotate.d.ts +0 -28
- package/lib/api/buildkite/annotate.js +0 -62
- package/lib/api/buildkite/annotate.js.map +0 -7
- package/lib/api/buildkite/index.d.ts +0 -3
- package/lib/api/buildkite/index.js.map +0 -7
- package/lib/api/buildkite/md.d.ts +0 -6
- package/lib/api/buildkite/md.js +0 -33
- package/lib/api/buildkite/md.js.map +0 -7
- package/lib/api/git/commit.d.ts +0 -15
- package/lib/api/git/commit.js +0 -52
- package/lib/api/git/commit.js.map +0 -7
- package/lib/api/git/commitAllChanges.d.ts +0 -19
- package/lib/api/git/commitAllChanges.js +0 -83
- package/lib/api/git/commitAllChanges.js.map +0 -7
- package/lib/api/git/currentBranch.d.ts +0 -10
- package/lib/api/git/currentBranch.js +0 -59
- package/lib/api/git/currentBranch.js.map +0 -7
- package/lib/api/git/findRoot.d.ts +0 -9
- package/lib/api/git/findRoot.js +0 -52
- package/lib/api/git/findRoot.js.map +0 -7
- package/lib/api/git/getChangedFiles.d.ts +0 -20
- package/lib/api/git/getChangedFiles.js +0 -81
- package/lib/api/git/getChangedFiles.js.map +0 -7
- package/lib/api/git/index.d.ts +0 -12
- package/lib/api/git/index.js +0 -61
- package/lib/api/git/index.js.map +0 -7
- package/lib/api/git/isFileGitIgnored.d.ts +0 -4
- package/lib/api/git/isFileGitIgnored.js +0 -49
- package/lib/api/git/isFileGitIgnored.js.map +0 -7
- package/lib/api/git/log.d.ts +0 -19
- package/lib/api/git/log.js +0 -71
- package/lib/api/git/log.js.map +0 -7
- package/lib/api/git/pull.d.ts +0 -35
- package/lib/api/git/pull.js +0 -69
- package/lib/api/git/pull.js.map +0 -7
- package/lib/api/git/push.d.ts +0 -52
- package/lib/api/git/push.js +0 -70
- package/lib/api/git/push.js.map +0 -7
- package/lib/api/git/remote.d.ts +0 -20
- package/lib/api/git/remote.js +0 -73
- package/lib/api/git/remote.js.map +0 -7
- package/lib/api/git/reset.d.ts +0 -12
- package/lib/api/git/reset.js +0 -62
- package/lib/api/git/reset.js.map +0 -7
- package/lib/api/git/statusMatrix.d.ts +0 -7
- package/lib/api/git/statusMatrix.js +0 -47
- package/lib/api/git/statusMatrix.js.map +0 -7
- package/lib/api/github/checkRun.d.ts +0 -44
- package/lib/api/github/checkRun.js +0 -81
- package/lib/api/github/checkRun.js.map +0 -7
- package/lib/api/github/environment.d.ts +0 -17
- package/lib/api/github/environment.js +0 -48
- package/lib/api/github/environment.js.map +0 -7
- package/lib/api/github/index.d.ts +0 -7
- package/lib/api/github/index.js +0 -48
- package/lib/api/github/index.js.map +0 -7
- package/lib/api/github/issueComment.d.ts +0 -61
- package/lib/api/github/issueComment.js +0 -99
- package/lib/api/github/issueComment.js.map +0 -7
- package/lib/api/github/octokit.d.ts +0 -6
- package/lib/api/github/octokit.js +0 -42
- package/lib/api/github/octokit.js.map +0 -7
- package/lib/api/github/pullRequest.d.ts +0 -21
- package/lib/api/github/pullRequest.js +0 -69
- package/lib/api/github/pullRequest.js.map +0 -7
- package/lib/api/github/push.d.ts +0 -85
- package/lib/api/github/push.js +0 -166
- package/lib/api/github/push.js.map +0 -7
- package/lib/api/net/compose.d.ts +0 -4
- package/lib/api/net/compose.js +0 -51
- package/lib/api/net/compose.js.map +0 -7
- package/lib/api/net/index.d.ts +0 -1
- package/lib/api/net/index.js.map +0 -7
- package/lib/api/net/socket.d.ts +0 -5
- package/lib/api/net/socket.js +0 -68
- package/lib/api/net/socket.js.map +0 -7
- package/lib/api/net/waitFor.d.ts +0 -22
- package/lib/api/net/waitFor.js +0 -40
- package/lib/api/net/waitFor.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/configureTsConfigForESM.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.d.ts +0 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.js +0 -110
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/rewriteSrcImports.js.map +0 -7
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 12.3.0}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/configureTsConfigForESM.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.2.0 → 13.0.0}/index.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["import readPkgUp, { type NormalizedPackageJson } from 'read-pkg-up';\nimport * as z from 'zod/v4';\n\nimport { hasProp } from './validation.js';\n\nexport type ProjectType = z.infer<typeof projectTypeSchema>;\n\nexport const projectTypeSchema = z.union([\n z.literal('application'),\n z.literal('package'),\n]);\n\nexport const PROJECT_TYPES = ['application', 'package'] as const;\n\nconst DEFAULT_ENTRY_POINT = 'src/app.ts';\n\nlet skubaManifest: NormalizedPackageJson | undefined;\n\nexport const getSkubaManifest = async (): Promise<NormalizedPackageJson> => {\n if (skubaManifest !== undefined) {\n return skubaManifest;\n }\n\n const result = await readPkgUp({ cwd: __dirname });\n\n if (result === undefined) {\n throw Error('skuba could not find its own manifest');\n }\n\n return (skubaManifest = result.packageJson);\n};\n\nexport const getConsumerManifest = (cwd?: string) =>\n readPkgUp({ cwd, normalize: false });\n\nexport const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAsD;AACtD,QAAmB;AAEnB,wBAAwB;AAIjB,MAAM,oBAAoB,EAAE,MAAM;AAAA,EACvC,EAAE,QAAQ,aAAa;AAAA,EACvB,EAAE,QAAQ,SAAS;AACrB,CAAC;AAEM,MAAM,gBAAgB,CAAC,eAAe,SAAS;AAEtD,MAAM,sBAAsB;AAE5B,IAAI;AAEG,MAAM,mBAAmB,YAA4C;AAC1E,MAAI,kBAAkB,QAAW;AAC/B,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,UAAM,mBAAAA,SAAU,EAAE,KAAK,UAAU,CAAC;AAEjD,MAAI,WAAW,QAAW;AACxB,UAAM,MAAM,uCAAuC;AAAA,EACrD;AAEA,SAAQ,gBAAgB,OAAO;AACjC;AAEO,MAAM,sBAAsB,CAAC,YAClC,mBAAAA,SAAU,EAAE,KAAK,WAAW,MAAM,CAAC;AAE9B,MAAM,
|
|
4
|
+
"sourcesContent": ["import readPkgUp, { type NormalizedPackageJson } from 'read-pkg-up';\nimport * as z from 'zod/v4';\n\nimport { hasProp } from './validation.js';\n\nexport type ProjectType = z.infer<typeof projectTypeSchema>;\n\nexport const projectTypeSchema = z.union([\n z.literal('application'),\n z.literal('package'),\n]);\n\nexport const PROJECT_TYPES = ['application', 'package'] as const;\n\nconst DEFAULT_ENTRY_POINT = 'src/app.ts';\n\nlet skubaManifest: NormalizedPackageJson | undefined;\n\nexport const getSkubaManifest = async (): Promise<NormalizedPackageJson> => {\n if (skubaManifest !== undefined) {\n return skubaManifest;\n }\n\n const result = await readPkgUp({ cwd: __dirname });\n\n if (result === undefined) {\n throw Error('skuba could not find its own manifest');\n }\n\n return (skubaManifest = result.packageJson);\n};\n\nexport const getConsumerManifest = (cwd?: string) =>\n readPkgUp({ cwd, normalize: false });\n\nexport const getManifestProperties = async <T extends string, V = unknown>(\n prop: T,\n): Promise<\n | {\n value: V | undefined;\n type: string | undefined;\n path: string;\n }\n | undefined\n> => {\n const manifest = await getConsumerManifest();\n\n if (!manifest) {\n return undefined;\n }\n\n const value = hasProp<T, V>(manifest.packageJson.skuba, prop)\n ? manifest.packageJson.skuba[prop]\n : undefined;\n\n const type =\n typeof manifest.packageJson.type === 'string'\n ? manifest.packageJson.type\n : undefined;\n\n return {\n value,\n type,\n path: manifest.path,\n };\n};\n\nexport const getStringPropFromConsumerManifest = async <T extends string>(\n prop: T,\n): Promise<string | undefined> => {\n const manifest = await getManifestProperties(prop);\n\n return typeof manifest?.value === 'string' ? manifest.value : undefined;\n};\n\nexport const getEntryPointFromManifest = async (): Promise<string> => {\n const entryPoint = await getStringPropFromConsumerManifest('entryPoint');\n\n return entryPoint ?? DEFAULT_ENTRY_POINT;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAsD;AACtD,QAAmB;AAEnB,wBAAwB;AAIjB,MAAM,oBAAoB,EAAE,MAAM;AAAA,EACvC,EAAE,QAAQ,aAAa;AAAA,EACvB,EAAE,QAAQ,SAAS;AACrB,CAAC;AAEM,MAAM,gBAAgB,CAAC,eAAe,SAAS;AAEtD,MAAM,sBAAsB;AAE5B,IAAI;AAEG,MAAM,mBAAmB,YAA4C;AAC1E,MAAI,kBAAkB,QAAW;AAC/B,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,UAAM,mBAAAA,SAAU,EAAE,KAAK,UAAU,CAAC;AAEjD,MAAI,WAAW,QAAW;AACxB,UAAM,MAAM,uCAAuC;AAAA,EACrD;AAEA,SAAQ,gBAAgB,OAAO;AACjC;AAEO,MAAM,sBAAsB,CAAC,YAClC,mBAAAA,SAAU,EAAE,KAAK,WAAW,MAAM,CAAC;AAE9B,MAAM,wBAAwB,OACnC,SAQG;AACH,QAAM,WAAW,MAAM,oBAAoB;AAE3C,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AAEA,QAAM,YAAQ,2BAAc,SAAS,YAAY,OAAO,IAAI,IACxD,SAAS,YAAY,MAAM,IAAI,IAC/B;AAEJ,QAAM,OACJ,OAAO,SAAS,YAAY,SAAS,WACjC,SAAS,YAAY,OACrB;AAEN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,MAAM,SAAS;AAAA,EACjB;AACF;AAEO,MAAM,oCAAoC,OAC/C,SACgC;AAChC,QAAM,WAAW,MAAM,sBAAsB,IAAI;AAEjD,SAAO,OAAO,UAAU,UAAU,WAAW,SAAS,QAAQ;AAChE;AAEO,MAAM,4BAA4B,YAA6B;AACpE,QAAM,aAAa,MAAM,kCAAkC,YAAY;AAEvE,SAAO,cAAc;AACvB;",
|
|
6
6
|
"names": ["readPkgUp"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "13.0.0-custom-conditions-exports-
|
|
3
|
+
"version": "13.0.0-custom-conditions-exports-20251007055842",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -103,7 +103,8 @@
|
|
|
103
103
|
"tsx": "^4.16.2",
|
|
104
104
|
"typescript": "~5.9.0",
|
|
105
105
|
"zod": "^4.0.0",
|
|
106
|
-
"
|
|
106
|
+
"@skuba-lib/api": "^1.0.1",
|
|
107
|
+
"eslint-config-skuba": "7.1.2"
|
|
107
108
|
},
|
|
108
109
|
"devDependencies": {
|
|
109
110
|
"@changesets/cli": "2.29.7",
|
|
@@ -151,7 +152,7 @@
|
|
|
151
152
|
"entryPoint": "src/index.ts",
|
|
152
153
|
"template": null,
|
|
153
154
|
"type": "package",
|
|
154
|
-
"version": "12.
|
|
155
|
+
"version": "12.4.1"
|
|
155
156
|
},
|
|
156
157
|
"scripts": {
|
|
157
158
|
"build": "scripts/build.sh",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^22.13.10",
|
|
26
|
-
"skuba": "13.0.0-custom-conditions-exports-
|
|
26
|
+
"skuba": "13.0.0-custom-conditions-exports-20251007055842"
|
|
27
27
|
},
|
|
28
|
-
"packageManager": "pnpm@10.17.
|
|
28
|
+
"packageManager": "pnpm@10.17.1",
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=22"
|
|
31
31
|
}
|
|
@@ -19,7 +19,7 @@ import { DatadogLambda } from 'datadog-cdk-constructs-v2';
|
|
|
19
19
|
import { config } from './config.js';
|
|
20
20
|
|
|
21
21
|
// Updated by https://github.com/seek-oss/rynovate
|
|
22
|
-
const DATADOG_EXTENSION_LAYER_VERSION =
|
|
22
|
+
const DATADOG_EXTENSION_LAYER_VERSION = 87;
|
|
23
23
|
|
|
24
24
|
// Updated by https://github.com/seek-oss/rynovate
|
|
25
25
|
const DATADOG_NODE_LAYER_VERSION = 126;
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"datadog-lambda-js": "^12.0.0",
|
|
42
42
|
"dd-trace": "^5.0.0",
|
|
43
43
|
"pino-pretty": "^13.0.0",
|
|
44
|
-
"skuba": "13.0.0-custom-conditions-exports-
|
|
44
|
+
"skuba": "13.0.0-custom-conditions-exports-20251007055842"
|
|
45
45
|
},
|
|
46
|
-
"packageManager": "pnpm@10.17.
|
|
46
|
+
"packageManager": "pnpm@10.17.1",
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=22"
|
|
49
49
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type AnnotationStyle = 'success' | 'info' | 'warning' | 'error';
|
|
2
|
-
interface AnnotationOptions {
|
|
3
|
-
context?: string;
|
|
4
|
-
/**
|
|
5
|
-
* Scopes an annotation's context to the Buildkite step ID.
|
|
6
|
-
*
|
|
7
|
-
* This lets you emit distinct annotations per step, and only takes effect if
|
|
8
|
-
* the `BUILDKITE_STEP_ID` environment variable is present.
|
|
9
|
-
*/
|
|
10
|
-
scopeContextToStep?: boolean;
|
|
11
|
-
style?: AnnotationStyle;
|
|
12
|
-
}
|
|
13
|
-
export declare const MAX_SIZE: number;
|
|
14
|
-
export declare const TRUNCATION_WARNING = "... [Truncated due to size limit]";
|
|
15
|
-
/**
|
|
16
|
-
* Asynchronously uploads a Buildkite annotation.
|
|
17
|
-
*
|
|
18
|
-
* If the following environment variables are not present,
|
|
19
|
-
* the function will silently return without attempting to annotate:
|
|
20
|
-
*
|
|
21
|
-
* - `BUILDKITE`
|
|
22
|
-
* - `BUILDKITE_AGENT_ACCESS_TOKEN`
|
|
23
|
-
* - `BUILDKITE_JOB_ID`
|
|
24
|
-
*
|
|
25
|
-
* The `buildkite-agent` binary must also be on your `PATH`.
|
|
26
|
-
*/
|
|
27
|
-
export declare const annotate: (markdown: string, opts?: AnnotationOptions) => Promise<void>;
|
|
28
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var annotate_exports = {};
|
|
20
|
-
__export(annotate_exports, {
|
|
21
|
-
MAX_SIZE: () => MAX_SIZE,
|
|
22
|
-
TRUNCATION_WARNING: () => TRUNCATION_WARNING,
|
|
23
|
-
annotate: () => annotate
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(annotate_exports);
|
|
26
|
-
var import_exec = require("../../utils/exec.js");
|
|
27
|
-
var import_logging = require("../../utils/logging.js");
|
|
28
|
-
const isAnnotationEnabled = async () => Boolean(
|
|
29
|
-
process.env.BUILDKITE && process.env.BUILDKITE_AGENT_ACCESS_TOKEN && process.env.BUILDKITE_JOB_ID && await (0, import_exec.hasCommand)("buildkite-agent")
|
|
30
|
-
);
|
|
31
|
-
const MAX_SIZE = 1024 * 1024;
|
|
32
|
-
const TRUNCATION_WARNING = "... [Truncated due to size limit]";
|
|
33
|
-
const annotate = async (markdown, opts = {}) => {
|
|
34
|
-
if (!await isAnnotationEnabled()) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
let truncatedMarkdown = markdown;
|
|
38
|
-
if (markdown.length > MAX_SIZE) {
|
|
39
|
-
const remainingSpace = MAX_SIZE - TRUNCATION_WARNING.length;
|
|
40
|
-
truncatedMarkdown = markdown.slice(0, remainingSpace) + TRUNCATION_WARNING;
|
|
41
|
-
import_logging.log.warn(`Annotation truncated, full message is: ${markdown}`);
|
|
42
|
-
}
|
|
43
|
-
const context = [
|
|
44
|
-
opts.scopeContextToStep && process.env.BUILDKITE_STEP_ID,
|
|
45
|
-
opts.context
|
|
46
|
-
].filter(Boolean).join("|");
|
|
47
|
-
const { style } = opts;
|
|
48
|
-
await (0, import_exec.exec)(
|
|
49
|
-
"buildkite-agent",
|
|
50
|
-
"annotate",
|
|
51
|
-
...context ? ["--context", context] : [],
|
|
52
|
-
...style ? ["--style", style] : [],
|
|
53
|
-
truncatedMarkdown
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
MAX_SIZE,
|
|
59
|
-
TRUNCATION_WARNING,
|
|
60
|
-
annotate
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=annotate.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/buildkite/annotate.ts"],
|
|
4
|
-
"sourcesContent": ["import { exec, hasCommand } from '../../utils/exec.js';\nimport { log } from '../../utils/logging.js';\n\nexport type AnnotationStyle = 'success' | 'info' | 'warning' | 'error';\n\nconst isAnnotationEnabled = async () =>\n Boolean(\n process.env.BUILDKITE &&\n process.env.BUILDKITE_AGENT_ACCESS_TOKEN &&\n process.env.BUILDKITE_JOB_ID &&\n (await hasCommand('buildkite-agent')),\n );\n\ninterface AnnotationOptions {\n context?: string;\n\n /**\n * Scopes an annotation's context to the Buildkite step ID.\n *\n * This lets you emit distinct annotations per step, and only takes effect if\n * the `BUILDKITE_STEP_ID` environment variable is present.\n */\n scopeContextToStep?: boolean;\n\n style?: AnnotationStyle;\n}\n\n// Buildkite annotation currently only supports 1MiB of data\nexport const MAX_SIZE = 1024 * 1024; // 1MiB in bytes\nexport const TRUNCATION_WARNING = '... [Truncated due to size limit]';\n\n/**\n * Asynchronously uploads a Buildkite annotation.\n *\n * If the following environment variables are not present,\n * the function will silently return without attempting to annotate:\n *\n * - `BUILDKITE`\n * - `BUILDKITE_AGENT_ACCESS_TOKEN`\n * - `BUILDKITE_JOB_ID`\n *\n * The `buildkite-agent` binary must also be on your `PATH`.\n */\nexport const annotate = async (\n markdown: string,\n opts: AnnotationOptions = {},\n): Promise<void> => {\n if (!(await isAnnotationEnabled())) {\n return;\n }\n\n // Check if the annotation exceeds the maximum size\n let truncatedMarkdown = markdown;\n if (markdown.length > MAX_SIZE) {\n // Notify user of truncation, leave space for message\n const remainingSpace = MAX_SIZE - TRUNCATION_WARNING.length;\n truncatedMarkdown = markdown.slice(0, remainingSpace) + TRUNCATION_WARNING;\n // Log full message to the build log\n log.warn(`Annotation truncated, full message is: ${markdown}`);\n }\n\n // Always scope to the current Buildkite step.\n const context = [\n opts.scopeContextToStep && process.env.BUILDKITE_STEP_ID,\n opts.context,\n ]\n .filter(Boolean)\n .join('|');\n\n const { style } = opts;\n\n await exec(\n 'buildkite-agent',\n 'annotate',\n ...(context ? ['--context', context] : []),\n ...(style ? ['--style', style] : []),\n truncatedMarkdown,\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AACjC,qBAAoB;AAIpB,MAAM,sBAAsB,YAC1B;AAAA,EACE,QAAQ,IAAI,aACV,QAAQ,IAAI,gCACZ,QAAQ,IAAI,oBACX,UAAM,wBAAW,iBAAiB;AACvC;AAiBK,MAAM,WAAW,OAAO;AACxB,MAAM,qBAAqB;AAc3B,MAAM,WAAW,OACtB,UACA,OAA0B,CAAC,MACT;AAClB,MAAI,CAAE,MAAM,oBAAoB,GAAI;AAClC;AAAA,EACF;AAGA,MAAI,oBAAoB;AACxB,MAAI,SAAS,SAAS,UAAU;AAE9B,UAAM,iBAAiB,WAAW,mBAAmB;AACrD,wBAAoB,SAAS,MAAM,GAAG,cAAc,IAAI;AAExD,uBAAI,KAAK,0CAA0C,QAAQ,EAAE;AAAA,EAC/D;AAGA,QAAM,UAAU;AAAA,IACd,KAAK,sBAAsB,QAAQ,IAAI;AAAA,IACvC,KAAK;AAAA,EACP,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,QAAM,EAAE,MAAM,IAAI;AAElB,YAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,GAAI,UAAU,CAAC,aAAa,OAAO,IAAI,CAAC;AAAA,IACxC,GAAI,QAAQ,CAAC,WAAW,KAAK,IAAI,CAAC;AAAA,IAClC;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/buildkite/index.ts"],
|
|
4
|
-
"sourcesContent": ["export type { AnnotationStyle } from './annotate.js';\nexport { annotate } from './annotate.js';\nexport { md } from './md.js';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAyB;AACzB,gBAAmB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/lib/api/buildkite/md.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var md_exports = {};
|
|
20
|
-
__export(md_exports, {
|
|
21
|
-
md: () => md
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(md_exports);
|
|
24
|
-
const md = {
|
|
25
|
-
terminal: (code) => `\`\`\`term
|
|
26
|
-
${code.replace(/```/g, "\\`\\`\\`")}
|
|
27
|
-
\`\`\``
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
md
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=md.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/buildkite/md.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @internal\n */\nexport const md = {\n terminal: (code: string) =>\n `\\`\\`\\`term\\n${code.replace(/```/g, '\\\\`\\\\`\\\\`')}\\n\\`\\`\\``,\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,KAAK;AAAA,EAChB,UAAU,CAAC,SACT;AAAA,EAAe,KAAK,QAAQ,QAAQ,WAAW,CAAC;AAAA;AACpD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/lib/api/git/commit.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface Identity {
|
|
2
|
-
email?: string;
|
|
3
|
-
name?: string;
|
|
4
|
-
}
|
|
5
|
-
interface CommitParameters {
|
|
6
|
-
author?: Identity;
|
|
7
|
-
committer?: Identity;
|
|
8
|
-
dir: string;
|
|
9
|
-
message: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Writes a commit to the local Git repository.
|
|
13
|
-
*/
|
|
14
|
-
export declare const commit: ({ author, committer, dir, message, }: CommitParameters) => Promise<string>;
|
|
15
|
-
export {};
|
package/lib/api/git/commit.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var commit_exports = {};
|
|
30
|
-
__export(commit_exports, {
|
|
31
|
-
commit: () => commit
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(commit_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
36
|
-
const commit = async ({
|
|
37
|
-
author = { name: "skuba" },
|
|
38
|
-
committer = { name: "skuba" },
|
|
39
|
-
dir,
|
|
40
|
-
message
|
|
41
|
-
}) => import_isomorphic_git.default.commit({
|
|
42
|
-
author,
|
|
43
|
-
committer,
|
|
44
|
-
dir,
|
|
45
|
-
fs: import_fs_extra.default,
|
|
46
|
-
message
|
|
47
|
-
});
|
|
48
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
-
0 && (module.exports = {
|
|
50
|
-
commit
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=commit.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/commit.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nexport interface Identity {\n email?: string;\n name?: string;\n}\n\ninterface CommitParameters {\n author?: Identity;\n committer?: Identity;\n dir: string;\n message: string;\n}\n\n/**\n * Writes a commit to the local Git repository.\n */\nexport const commit = async ({\n author = { name: 'skuba' },\n committer = { name: 'skuba' },\n dir,\n message,\n}: CommitParameters): Promise<string> =>\n git.commit({\n author,\n committer,\n dir,\n fs,\n message,\n });\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAiBT,MAAM,SAAS,OAAO;AAAA,EAC3B,SAAS,EAAE,MAAM,QAAQ;AAAA,EACzB,YAAY,EAAE,MAAM,QAAQ;AAAA,EAC5B;AAAA,EACA;AACF,MACE,sBAAAA,QAAI,OAAO;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,EACA;AACF,CAAC;",
|
|
6
|
-
"names": ["git", "fs"]
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type Identity } from './commit.js';
|
|
2
|
-
import { type ChangedFile } from './getChangedFiles.js';
|
|
3
|
-
interface CommitAllParameters {
|
|
4
|
-
dir: string;
|
|
5
|
-
message: string;
|
|
6
|
-
author?: Identity;
|
|
7
|
-
committer?: Identity;
|
|
8
|
-
/**
|
|
9
|
-
* File changes to exclude from the commit.
|
|
10
|
-
*
|
|
11
|
-
* Defaults to `[]` (no exclusions).
|
|
12
|
-
*/
|
|
13
|
-
ignore?: ChangedFile[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Stages all changes and writes a commit to the local Git repository.
|
|
17
|
-
*/
|
|
18
|
-
export declare const commitAllChanges: ({ dir, message, author, committer, ignore, }: CommitAllParameters) => Promise<string | undefined>;
|
|
19
|
-
export {};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var commitAllChanges_exports = {};
|
|
30
|
-
__export(commitAllChanges_exports, {
|
|
31
|
-
commitAllChanges: () => commitAllChanges
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(commitAllChanges_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
37
|
-
var import_commit = require("./commit.js");
|
|
38
|
-
var import_findRoot = require("./findRoot.js");
|
|
39
|
-
var import_getChangedFiles = require("./getChangedFiles.js");
|
|
40
|
-
const commitAllChanges = async ({
|
|
41
|
-
dir,
|
|
42
|
-
message,
|
|
43
|
-
author,
|
|
44
|
-
committer,
|
|
45
|
-
ignore
|
|
46
|
-
}) => {
|
|
47
|
-
const changedFiles = await (0, import_getChangedFiles.getChangedFiles)({ dir, ignore });
|
|
48
|
-
if (!changedFiles.length) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const gitRoot = await (0, import_findRoot.findRoot)({ dir });
|
|
52
|
-
if (!gitRoot) {
|
|
53
|
-
throw new Error(`Could not find Git root from directory: ${dir}`);
|
|
54
|
-
}
|
|
55
|
-
await Promise.all(
|
|
56
|
-
changedFiles.map(async (file) => {
|
|
57
|
-
const relativePath = import_path.default.relative(dir, file.path);
|
|
58
|
-
if (relativePath.startsWith("..")) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
return file.state === "deleted" ? import_isomorphic_git.default.remove({
|
|
62
|
-
fs: import_fs_extra.default,
|
|
63
|
-
dir: gitRoot,
|
|
64
|
-
filepath: file.path
|
|
65
|
-
}) : import_isomorphic_git.default.add({
|
|
66
|
-
fs: import_fs_extra.default,
|
|
67
|
-
dir: gitRoot,
|
|
68
|
-
filepath: file.path
|
|
69
|
-
});
|
|
70
|
-
})
|
|
71
|
-
);
|
|
72
|
-
return (0, import_commit.commit)({
|
|
73
|
-
dir: gitRoot,
|
|
74
|
-
message,
|
|
75
|
-
author,
|
|
76
|
-
committer
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
commitAllChanges
|
|
82
|
-
});
|
|
83
|
-
//# sourceMappingURL=commitAllChanges.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/commitAllChanges.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { type Identity, commit } from './commit.js';\nimport { findRoot } from './findRoot.js';\nimport { type ChangedFile, getChangedFiles } from './getChangedFiles.js';\n\ninterface CommitAllParameters {\n dir: string;\n message: string;\n author?: Identity;\n committer?: Identity;\n\n /**\n * File changes to exclude from the commit.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\n/**\n * Stages all changes and writes a commit to the local Git repository.\n */\nexport const commitAllChanges = async ({\n dir,\n message,\n\n author,\n committer,\n ignore,\n}: CommitAllParameters): Promise<string | undefined> => {\n const changedFiles = await getChangedFiles({ dir, ignore });\n\n if (!changedFiles.length) {\n return;\n }\n\n const gitRoot = await findRoot({ dir });\n\n if (!gitRoot) {\n throw new Error(`Could not find Git root from directory: ${dir}`);\n }\n\n await Promise.all(\n changedFiles.map(async (file) => {\n const relativePath = path.relative(dir, file.path);\n\n // Skipping file outside working directory, see https://github.com/seek-oss/skuba/pull/1269#discussion_r1335308704\n if (relativePath.startsWith('..')) {\n return;\n }\n\n return file.state === 'deleted'\n ? git.remove({\n fs,\n dir: gitRoot,\n filepath: file.path,\n })\n : git.add({\n fs,\n dir: gitRoot,\n filepath: file.path,\n });\n }),\n );\n\n return commit({\n dir: gitRoot,\n message,\n author,\n committer,\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAEhB,oBAAsC;AACtC,sBAAyB;AACzB,6BAAkD;AAmB3C,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF,MAAwD;AACtD,QAAM,eAAe,UAAM,wCAAgB,EAAE,KAAK,OAAO,CAAC;AAE1D,MAAI,CAAC,aAAa,QAAQ;AACxB;AAAA,EACF;AAEA,QAAM,UAAU,UAAM,0BAAS,EAAE,IAAI,CAAC;AAEtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,2CAA2C,GAAG,EAAE;AAAA,EAClE;AAEA,QAAM,QAAQ;AAAA,IACZ,aAAa,IAAI,OAAO,SAAS;AAC/B,YAAM,eAAe,YAAAA,QAAK,SAAS,KAAK,KAAK,IAAI;AAGjD,UAAI,aAAa,WAAW,IAAI,GAAG;AACjC;AAAA,MACF;AAEA,aAAO,KAAK,UAAU,YAClB,sBAAAC,QAAI,OAAO;AAAA,QACT,oBAAAC;AAAA,QACA,KAAK;AAAA,QACL,UAAU,KAAK;AAAA,MACjB,CAAC,IACD,sBAAAD,QAAI,IAAI;AAAA,QACN,oBAAAC;AAAA,QACA,KAAK;AAAA,QACL,UAAU,KAAK;AAAA,MACjB,CAAC;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAO,sBAAO;AAAA,IACZ,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
|
-
"names": ["path", "git", "fs"]
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface CurrentBranchParameters {
|
|
2
|
-
dir?: string;
|
|
3
|
-
env?: Record<string, string | undefined>;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Tries to return a Git branch name from CI environment variables, falling back
|
|
7
|
-
* to the local Git repository when the current working `dir` is supplied.
|
|
8
|
-
*/
|
|
9
|
-
export declare const currentBranch: ({ dir, env, }?: CurrentBranchParameters) => Promise<string | undefined>;
|
|
10
|
-
export {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var currentBranch_exports = {};
|
|
30
|
-
__export(currentBranch_exports, {
|
|
31
|
-
currentBranch: () => currentBranch
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(currentBranch_exports);
|
|
34
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
35
|
-
var import_isomorphic_git = __toESM(require("isomorphic-git"));
|
|
36
|
-
const currentBranchFromEnvironment = (env = process.env) => env.BUILDKITE_BRANCH ?? env.GITHUB_HEAD_REF ?? env.GITHUB_REF_NAME;
|
|
37
|
-
const currentBranch = async ({
|
|
38
|
-
dir,
|
|
39
|
-
env = process.env
|
|
40
|
-
} = {}) => {
|
|
41
|
-
const fromEnv = currentBranchFromEnvironment(env);
|
|
42
|
-
if (fromEnv) {
|
|
43
|
-
return fromEnv;
|
|
44
|
-
}
|
|
45
|
-
if (!dir) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const gitRoot = await import_isomorphic_git.default.findRoot({ filepath: dir, fs: import_fs_extra.default });
|
|
49
|
-
const fromRepo = await import_isomorphic_git.default.currentBranch({
|
|
50
|
-
dir: gitRoot,
|
|
51
|
-
fs: import_fs_extra.default
|
|
52
|
-
});
|
|
53
|
-
return fromRepo ?? void 0;
|
|
54
|
-
};
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
currentBranch
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=currentBranch.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/api/git/currentBranch.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\n/**\n * Tries to return a Git branch name from CI environment variables.\n */\nconst currentBranchFromEnvironment = (env = process.env): string | undefined =>\n env.BUILDKITE_BRANCH ?? env.GITHUB_HEAD_REF ?? env.GITHUB_REF_NAME;\n\ninterface CurrentBranchParameters {\n dir?: string;\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Tries to return a Git branch name from CI environment variables, falling back\n * to the local Git repository when the current working `dir` is supplied.\n */\nexport const currentBranch = async ({\n dir,\n env = process.env,\n}: CurrentBranchParameters = {}): Promise<string | undefined> => {\n const fromEnv = currentBranchFromEnvironment(env);\n\n if (fromEnv) {\n return fromEnv;\n }\n\n if (!dir) {\n return;\n }\n\n const gitRoot = await git.findRoot({ filepath: dir, fs });\n\n const fromRepo = await git.currentBranch({\n dir: gitRoot,\n fs,\n });\n\n return fromRepo ?? undefined;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAKhB,MAAM,+BAA+B,CAAC,MAAM,QAAQ,QAClD,IAAI,oBAAoB,IAAI,mBAAmB,IAAI;AAW9C,MAAM,gBAAgB,OAAO;AAAA,EAClC;AAAA,EACA,MAAM,QAAQ;AAChB,IAA6B,CAAC,MAAmC;AAC/D,QAAM,UAAU,6BAA6B,GAAG;AAEhD,MAAI,SAAS;AACX,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,KAAK;AACR;AAAA,EACF;AAEA,QAAM,UAAU,MAAM,sBAAAA,QAAI,SAAS,EAAE,UAAU,KAAK,oBAAAC,QAAG,CAAC;AAExD,QAAM,WAAW,MAAM,sBAAAD,QAAI,cAAc;AAAA,IACvC,KAAK;AAAA,IACL,oBAAAC;AAAA,EACF,CAAC;AAED,SAAO,YAAY;AACrB;",
|
|
6
|
-
"names": ["git", "fs"]
|
|
7
|
-
}
|