skuba 12.0.0-enable-js-extensions-20250711082837 → 12.0.0-enable-js-extensions-20250715070836

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.
@@ -32,6 +32,7 @@ __export(getChangedFiles_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(getChangedFiles_exports);
34
34
  var import_fs_extra = __toESM(require("fs-extra"));
35
+ var import_ignore = __toESM(require("ignore"));
35
36
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
37
  var import_statusMatrix = require("./statusMatrix.js");
37
38
  const mapState = (row) => {
@@ -48,15 +49,31 @@ const getChangedFiles = async ({
48
49
  ignore = []
49
50
  }) => {
50
51
  const gitRoot = await (0, import_isomorphic_git.findRoot)({ fs: import_fs_extra.default, filepath: dir });
51
- const allFiles = await import_isomorphic_git.default.statusMatrix({ fs: import_fs_extra.default, dir: gitRoot ?? dir });
52
+ const [allFiles, isLfs] = await Promise.all([
53
+ import_isomorphic_git.default.statusMatrix({ fs: import_fs_extra.default, dir: gitRoot ?? dir }),
54
+ createIsLfsFilter(gitRoot)
55
+ ]);
52
56
  return allFiles.filter(
53
57
  (row) => row[import_statusMatrix.HEAD] !== import_statusMatrix.UNMODIFIED || row[import_statusMatrix.WORKDIR] !== import_statusMatrix.UNMODIFIED || row[import_statusMatrix.STAGE] !== import_statusMatrix.UNMODIFIED
54
58
  ).map((row) => ({ path: row[import_statusMatrix.FILEPATH], state: mapState(row) })).filter(
55
59
  (changedFile) => !ignore.some(
56
60
  (i) => i.path === changedFile.path && i.state === changedFile.state
57
- )
61
+ ) && !isLfs(changedFile.path)
58
62
  );
59
63
  };
64
+ const createIsLfsFilter = async (gitRoot) => {
65
+ if (!gitRoot) {
66
+ return () => false;
67
+ }
68
+ const lfsFile = `${gitRoot}/.gitattributes`;
69
+ if (!await import_fs_extra.default.pathExists(lfsFile)) {
70
+ return () => false;
71
+ }
72
+ const filter = (0, import_ignore.default)().add(
73
+ (await import_fs_extra.default.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] : [])
74
+ );
75
+ return (pathname) => filter.ignores(pathname);
76
+ };
60
77
  // Annotate the CommonJS export names for ESM import in node:
61
78
  0 && (module.exports = {
62
79
  getChangedFiles
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/getChangedFiles.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\nimport git, { findRoot } from 'isomorphic-git';\n\nimport {\n ABSENT,\n FILEPATH,\n HEAD,\n MODIFIED,\n STAGE,\n UNMODIFIED,\n WORKDIR,\n} from './statusMatrix.js';\n\ntype ChangedFileState = 'added' | 'modified' | 'deleted';\nexport interface ChangedFile {\n path: string;\n state: ChangedFileState;\n}\ninterface ChangedFilesParameters {\n dir: string;\n\n /**\n * File changes to exclude from the result.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\nconst mapState = (\n row: [string, 0 | 1, 0 | 1 | 2, 0 | 1 | 2 | 3],\n): ChangedFileState => {\n if (row[HEAD] === ABSENT) {\n return 'added';\n }\n\n if (row[WORKDIR] === MODIFIED) {\n return 'modified';\n }\n\n return 'deleted';\n};\n\n/**\n * Returns all the files which have been added, modified or deleted in the\n * working directory of the local Git repository since the last commit.\n */\nexport const getChangedFiles = async ({\n dir,\n\n ignore = [],\n}: ChangedFilesParameters): Promise<ChangedFile[]> => {\n const gitRoot = await findRoot({ fs, filepath: dir });\n const allFiles = await git.statusMatrix({ fs, dir: gitRoot ?? dir });\n return allFiles\n .filter(\n (row) =>\n row[HEAD] !== UNMODIFIED ||\n row[WORKDIR] !== UNMODIFIED ||\n row[STAGE] !== UNMODIFIED,\n )\n .map((row) => ({ path: row[FILEPATH], state: mapState(row) }))\n .filter(\n (changedFile) =>\n !ignore.some(\n (i) => i.path === changedFile.path && i.state === changedFile.state,\n ),\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAA8B;AAE9B,0BAQO;AAkBP,MAAM,WAAW,CACf,QACqB;AACrB,MAAI,IAAI,wBAAI,MAAM,4BAAQ;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,IAAI,2BAAO,MAAM,8BAAU;AAC7B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAMO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EAEA,SAAS,CAAC;AACZ,MAAsD;AACpD,QAAM,UAAU,UAAM,gCAAS,EAAE,oBAAAA,SAAI,UAAU,IAAI,CAAC;AACpD,QAAM,WAAW,MAAM,sBAAAC,QAAI,aAAa,EAAE,oBAAAD,SAAI,KAAK,WAAW,IAAI,CAAC;AACnE,SAAO,SACJ;AAAA,IACC,CAAC,QACC,IAAI,wBAAI,MAAM,kCACd,IAAI,2BAAO,MAAM,kCACjB,IAAI,yBAAK,MAAM;AAAA,EACnB,EACC,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,4BAAQ,GAAG,OAAO,SAAS,GAAG,EAAE,EAAE,EAC5D;AAAA,IACC,CAAC,gBACC,CAAC,OAAO;AAAA,MACN,CAAC,MAAM,EAAE,SAAS,YAAY,QAAQ,EAAE,UAAU,YAAY;AAAA,IAChE;AAAA,EACJ;AACJ;",
6
- "names": ["fs", "git"]
4
+ "sourcesContent": ["import fs from 'fs-extra';\nimport ignoreFilter from 'ignore';\nimport git, { findRoot } from 'isomorphic-git';\n\nimport {\n ABSENT,\n FILEPATH,\n HEAD,\n MODIFIED,\n STAGE,\n UNMODIFIED,\n WORKDIR,\n} from './statusMatrix.js';\n\ntype ChangedFileState = 'added' | 'modified' | 'deleted';\nexport interface ChangedFile {\n path: string;\n state: ChangedFileState;\n}\ninterface ChangedFilesParameters {\n dir: string;\n\n /**\n * File changes to exclude from the result.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\nconst mapState = (\n row: [string, 0 | 1, 0 | 1 | 2, 0 | 1 | 2 | 3],\n): ChangedFileState => {\n if (row[HEAD] === ABSENT) {\n return 'added';\n }\n\n if (row[WORKDIR] === MODIFIED) {\n return 'modified';\n }\n\n return 'deleted';\n};\n\n/**\n * Returns all the files which have been added, modified or deleted in the\n * working directory of the local Git repository since the last commit.\n */\nexport const getChangedFiles = async ({\n dir,\n\n ignore = [],\n}: ChangedFilesParameters): Promise<ChangedFile[]> => {\n const gitRoot = await findRoot({ fs, filepath: dir });\n const [allFiles, isLfs] = await Promise.all([\n git.statusMatrix({ fs, dir: gitRoot ?? dir }),\n createIsLfsFilter(gitRoot),\n ]);\n\n return allFiles\n .filter(\n (row) =>\n row[HEAD] !== UNMODIFIED ||\n row[WORKDIR] !== UNMODIFIED ||\n row[STAGE] !== UNMODIFIED,\n )\n .map((row) => ({ path: row[FILEPATH], state: mapState(row) }))\n .filter(\n (changedFile) =>\n !ignore.some(\n (i) => i.path === changedFile.path && i.state === changedFile.state,\n ) && !isLfs(changedFile.path),\n );\n};\n\nconst createIsLfsFilter = async (\n gitRoot: string | null,\n): Promise<(pathname: string) => boolean> => {\n if (!gitRoot) {\n return () => false;\n }\n\n const lfsFile = `${gitRoot}/.gitattributes`;\n if (!(await fs.pathExists(lfsFile))) {\n return () => false;\n }\n\n const filter = ignoreFilter().add(\n (await fs.readFile(lfsFile, 'utf8'))\n .split('\\n')\n .map((l) => l.trim())\n .filter((l) => !l.startsWith('#') && l.includes('filter=lfs'))\n .map((l) => l.split(/\\s+/)[0])\n .flatMap((l) => (l ? [l] : [])),\n );\n\n return (pathname) => filter.ignores(pathname);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,oBAAyB;AACzB,4BAA8B;AAE9B,0BAQO;AAkBP,MAAM,WAAW,CAC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AC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,YAAY,CAAC,EAC5D,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,EAAE,CAAC,CAAC,EAC5B,QAAQ,CAAC,MAAO,IAAI,CAAC,CAAC,IAAI,CAAC,CAAE;AAAA,EAClC;AAEA,SAAO,CAAC,aAAa,OAAO,QAAQ,QAAQ;AAC9C;",
6
+ "names": ["fs", "git", "ignoreFilter"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "12.0.0-enable-js-extensions-20250711082837",
3
+ "version": "12.0.0-enable-js-extensions-20250715070836",
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",
@@ -98,13 +98,13 @@
98
98
  "tsx": "^4.16.2",
99
99
  "typescript": "~5.8.0",
100
100
  "zod": "^3.25.67",
101
- "eslint-config-skuba": "7.0.0-enable-js-extensions-20250711082837"
101
+ "eslint-config-skuba": "7.0.0-enable-js-extensions-20250715070836"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@changesets/cli": "2.29.5",
105
105
  "@changesets/get-github-info": "0.6.0",
106
- "@jest/reporters": "30.0.2",
107
- "@jest/test-result": "30.0.2",
106
+ "@jest/reporters": "30.0.4",
107
+ "@jest/test-result": "30.0.4",
108
108
  "@types/ejs": "3.1.5",
109
109
  "@types/express": "5.0.3",
110
110
  "@types/fs-extra": "11.0.4",
@@ -120,14 +120,14 @@
120
120
  "enhanced-resolve": "5.18.2",
121
121
  "express": "5.1.0",
122
122
  "fastify": "5.4.0",
123
- "jest-diff": "30.0.3",
123
+ "jest-diff": "30.0.4",
124
124
  "jsonfile": "6.1.0",
125
125
  "koa": "3.0.0",
126
126
  "memfs": "4.17.2",
127
127
  "remark-cli": "12.0.1",
128
128
  "remark-preset-lint-recommended": "7.0.1",
129
129
  "semver": "7.7.2",
130
- "supertest": "7.1.1",
130
+ "supertest": "7.1.3",
131
131
  "type-fest": "2.19.0"
132
132
  },
133
133
  "peerDependencies": {
@@ -149,7 +149,7 @@
149
149
  "entryPoint": "src/index.ts",
150
150
  "template": null,
151
151
  "type": "package",
152
- "version": "11.0.0"
152
+ "version": "11.1.0"
153
153
  },
154
154
  "scripts": {
155
155
  "build": "scripts/build.sh",
@@ -49,10 +49,11 @@ steps:
49
49
  plugins:
50
50
  - *docker-ecr-cache
51
51
  - docker-compose#v5.10.0:
52
- run: app
53
52
  environment:
54
53
  - GITHUB_API_TOKEN
54
+ mount-buildkite-agent: true
55
55
  propagate-environment: true
56
+ run: app
56
57
  timeout_in_minutes: 10
57
58
 
58
59
  - label: 📦 Build & Package
@@ -4,7 +4,5 @@ services:
4
4
  init: true
5
5
  volumes:
6
6
  - ./:/workdir
7
- # Mount agent for Buildkite annotations.
8
- - /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
9
7
  # Mount cached dependencies.
10
8
  - /workdir/node_modules
@@ -30,8 +30,9 @@ steps:
30
30
  plugins:
31
31
  - *docker-ecr-cache
32
32
  - docker-compose#v5.10.0:
33
- run: app
34
33
  environment:
35
34
  - GITHUB_API_TOKEN
35
+ mount-buildkite-agent: true
36
36
  propagate-environment: true
37
+ run: app
37
38
  timeout_in_minutes: 10
@@ -4,7 +4,5 @@ services:
4
4
  init: true
5
5
  volumes:
6
6
  - ./:/workdir
7
- # Mount agent for Buildkite annotations.
8
- - /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
9
7
  # Mount cached dependencies.
10
8
  - /workdir/node_modules
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "^22.13.10",
20
- "skuba": "12.0.0-enable-js-extensions-20250711082837"
20
+ "skuba": "12.0.0-enable-js-extensions-20250715070836"
21
21
  },
22
22
  "packageManager": "pnpm@10.12.4",
23
23
  "engines": {
@@ -49,10 +49,11 @@ steps:
49
49
  plugins:
50
50
  - *docker-ecr-cache
51
51
  - docker-compose#v5.10.0:
52
- run: app
53
52
  environment:
54
53
  - GITHUB_API_TOKEN
54
+ mount-buildkite-agent: true
55
55
  propagate-environment: true
56
+ run: app
56
57
  timeout_in_minutes: 10
57
58
 
58
59
  - label: 📦 Build & Package
@@ -4,7 +4,5 @@ services:
4
4
  init: true
5
5
  volumes:
6
6
  - ./:/workdir
7
- # Mount agent for Buildkite annotations.
8
- - /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
9
7
  # Mount cached dependencies.
10
8
  - /workdir/node_modules
@@ -17,11 +17,11 @@
17
17
  "@koa/router": "^13.0.0",
18
18
  "@opentelemetry/api": "^1.9.0",
19
19
  "@opentelemetry/core": "^2.0.0",
20
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.202.0",
21
- "@opentelemetry/instrumentation-aws-sdk": "^0.54.0",
22
- "@opentelemetry/instrumentation-http": "^0.202.0",
20
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.203.0",
21
+ "@opentelemetry/instrumentation-aws-sdk": "^0.56.0",
22
+ "@opentelemetry/instrumentation-http": "^0.203.0",
23
23
  "@opentelemetry/propagator-b3": "^2.0.0",
24
- "@opentelemetry/sdk-node": "^0.202.0",
24
+ "@opentelemetry/sdk-node": "^0.203.0",
25
25
  "@seek/logger": "^10.0.0",
26
26
  "hot-shots": "^10.0.0",
27
27
  "koa": "^2.16.1",
@@ -25,10 +25,11 @@ configs:
25
25
  - *docker-ecr-cache
26
26
  - docker-compose#v5.10.0:
27
27
  dependencies: false
28
- run: app
29
28
  environment:
30
29
  - GITHUB_API_TOKEN
30
+ mount-buildkite-agent: true
31
31
  propagate-environment: true
32
+ run: app
32
33
  retry:
33
34
  manual:
34
35
  # Only use this if you need to roll back a deployment ASAP.
@@ -4,8 +4,6 @@ services:
4
4
  init: true
5
5
  volumes:
6
6
  - ./:/workdir
7
- # Mount agent for Buildkite annotations.
8
- - /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
9
7
  # Mount cached dependencies.
10
8
  - /workdir/node_modules
11
9
  - /workdir/lib/node_modules
@@ -37,7 +37,7 @@
37
37
  "constructs": "^10.0.17",
38
38
  "datadog-cdk-constructs-v2": "^2.0.0",
39
39
  "pino-pretty": "^13.0.0",
40
- "skuba": "12.0.0-enable-js-extensions-20250711082837"
40
+ "skuba": "12.0.0-enable-js-extensions-20250715070836"
41
41
  },
42
42
  "packageManager": "pnpm@10.12.4",
43
43
  "engines": {