@udondan/avanti 0.3.0 → 0.3.2
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/CHANGELOG.md +14 -0
- package/README.md +47 -18
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/diff.js +1 -1
- package/dist/sources/github.d.ts.map +1 -1
- package/dist/sources/github.js +25 -14
- package/dist/sources/github.js.map +1 -1
- package/dist/sources/gitlab.d.ts.map +1 -1
- package/dist/sources/gitlab.js +88 -20
- package/dist/sources/gitlab.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.2](https://github.com/udondan/avanti/compare/v0.3.1...v0.3.2) (2026-05-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **sources:** fix GitLab pagination, add archive fast path, and explicit directory detection ([#17](https://github.com/udondan/avanti/issues/17)) ([5b348ef](https://github.com/udondan/avanti/commit/5b348ef68b0ba9caebebd5ec6668fd9b07d4eafe))
|
|
9
|
+
|
|
10
|
+
## [0.3.1](https://github.com/udondan/avanti/compare/v0.3.0...v0.3.1) (2026-05-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* read CLI version dynamically from package.json ([#14](https://github.com/udondan/avanti/issues/14)) ([8ccbb80](https://github.com/udondan/avanti/commit/8ccbb80aeea645a50439ddc41693fd20931ad860))
|
|
16
|
+
|
|
3
17
|
## [0.3.0](https://github.com/udondan/avanti/compare/v0.2.1...v0.3.0) (2026-05-07)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ npx @udondan/avanti --help
|
|
|
32
32
|
|
|
33
33
|
## Usage
|
|
34
34
|
|
|
35
|
-
```
|
|
35
|
+
```text
|
|
36
36
|
avanti [options] [command]
|
|
37
37
|
|
|
38
38
|
Options:
|
|
@@ -54,15 +54,15 @@ Fetches all sources, shows the diff, and prompts for confirmation before writing
|
|
|
54
54
|
|
|
55
55
|
## Working Directory
|
|
56
56
|
|
|
57
|
-
All relative `src` and `target` paths are resolved relative to the **working directory** — the directory where you invoke `avanti`, or the path given with `-
|
|
57
|
+
All relative `src` and `target` paths are resolved relative to the **working directory** — the directory where you invoke `avanti`, or the path given with `-w`.
|
|
58
58
|
|
|
59
|
-
This is independent of where the config file lives. A config loaded from another directory with `-c /shared/avanti.yml` still resolves all paths from your working directory (or the one you specify with `-
|
|
59
|
+
This is independent of where the config file lives. A config loaded from another directory with `-c /shared/avanti.yml` still resolves all paths from your working directory (or the one you specify with `-w`).
|
|
60
60
|
|
|
61
|
-
Use `-
|
|
61
|
+
Use `-w` to deploy the same config to multiple locations without `cd`-ing there first:
|
|
62
62
|
|
|
63
63
|
```sh
|
|
64
|
-
avanti -c /shared/avanti.yml -
|
|
65
|
-
avanti -c /shared/avanti.yml -
|
|
64
|
+
avanti -c /shared/avanti.yml -w /project-a pull
|
|
65
|
+
avanti -c /shared/avanti.yml -w /project-b pull
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### Path Constraints
|
|
@@ -124,14 +124,13 @@ files:
|
|
|
124
124
|
|
|
125
125
|
### File Entry Fields
|
|
126
126
|
|
|
127
|
-
| Field | Required | Description
|
|
128
|
-
| --------- | ----------- |
|
|
129
|
-
| `src` | Yes | Source (see below). May be a single source or a **list** of sources to concatenate.
|
|
130
|
-
| `target` | Conditional | Local path to write to. Required for `exec:` and `raw:` sources and when `src` is a list. May be omitted when filename is inferable. |
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `post` | No | Shell script. Content is piped via stdin; stdout is used as the result. Runs after `replace`. |
|
|
127
|
+
| Field | Required | Description |
|
|
128
|
+
| --------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| `src` | Yes | Source (see below). May be a single source or a **list** of sources to concatenate. |
|
|
130
|
+
| `target` | Conditional | Local path to write to. Required for `exec:` and `raw:` sources and when `src` is a list. May be omitted when filename is inferable. End with `/` when `src` is a directory — files are written inside, preserving their relative paths. |
|
|
131
|
+
| `mode` | No | File permission mode, e.g. `"0755"` |
|
|
132
|
+
| `replace` | No | List of `{from, to}` replacement rules. `from` may be a plain string or `/pattern/flags` regex. |
|
|
133
|
+
| `post` | No | Shell script. Content is piped via stdin; stdout is used as the result. Runs after `replace`. |
|
|
135
134
|
|
|
136
135
|
### Source Types
|
|
137
136
|
|
|
@@ -166,6 +165,36 @@ src:
|
|
|
166
165
|
ref: main # branch or tag (optional)
|
|
167
166
|
```
|
|
168
167
|
|
|
168
|
+
### Directory Sources
|
|
169
|
+
|
|
170
|
+
Any source type that references a path (local, GitLab, GitHub) can point to a directory instead of a single file. End the path with `/` to declare it a directory explicitly; without a trailing slash the tool probes the remote to decide.
|
|
171
|
+
|
|
172
|
+
When `src` is a directory, the matched files are written individually under `target` (which must also end with `/`), preserving the subdirectory structure relative to the source root:
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
# All files under skills/ in the GitLab repo are written into local skills.new/
|
|
176
|
+
- src:
|
|
177
|
+
gitlab:
|
|
178
|
+
project: group/repo
|
|
179
|
+
file: skills/
|
|
180
|
+
ref: main
|
|
181
|
+
target: skills/
|
|
182
|
+
|
|
183
|
+
# GitHub directory → local directory
|
|
184
|
+
- src:
|
|
185
|
+
github:
|
|
186
|
+
repo: org/repo
|
|
187
|
+
file: .github/workflows/
|
|
188
|
+
ref: main
|
|
189
|
+
target: .github/workflows/
|
|
190
|
+
|
|
191
|
+
# Local directory → local directory
|
|
192
|
+
- src: ~/shared/hooks/
|
|
193
|
+
target: .githooks/
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Directory sources cannot be mixed into a multi-source list (`src` as a list), because the list mode always produces a single file.
|
|
197
|
+
|
|
169
198
|
**List** — combine multiple sources into one file (all source types supported; `target` required):
|
|
170
199
|
|
|
171
200
|
```yaml
|
|
@@ -402,8 +431,8 @@ files:
|
|
|
402
431
|
|
|
403
432
|
```sh
|
|
404
433
|
git clone ...
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
434
|
+
bun install
|
|
435
|
+
bun run dev -- --help # run via tsx
|
|
436
|
+
bun test # run tests
|
|
437
|
+
bun run build # compile to dist/
|
|
409
438
|
```
|
package/dist/cli.js
CHANGED
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const diff_1 = require("./commands/diff");
|
|
6
6
|
const pull_1 = require("./commands/pull");
|
|
7
|
+
const package_json_1 = require("../package.json");
|
|
7
8
|
const program = new commander_1.Command();
|
|
8
9
|
program
|
|
9
10
|
.name('avanti')
|
|
10
11
|
.description('Assemble local files from any source via a declarative YAML spec')
|
|
11
|
-
.version(
|
|
12
|
+
.version(package_json_1.version)
|
|
12
13
|
.option('-c, --config <path>', 'path to config file')
|
|
13
14
|
.option('-w, --working-dir <path>', 'working directory for resolving relative paths (default: current directory)');
|
|
14
15
|
program.addCommand((0, diff_1.diffCommand)());
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,0CAA8C;AAC9C,0CAA8C;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,0CAA8C;AAC9C,0CAA8C;AAC9C,kDAA0C;AAE1C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CACV,kEAAkE,CACnE;KACA,OAAO,CAAC,sBAAO,CAAC;KAChB,MAAM,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;KACpD,MAAM,CACL,0BAA0B,EAC1B,6EAA6E,CAC9E,CAAC;AAEJ,OAAO,CAAC,UAAU,CAAC,IAAA,kBAAW,GAAE,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,IAAA,kBAAW,GAAE,CAAC,CAAC;AAElC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/diff.js
CHANGED
|
@@ -75,7 +75,7 @@ function resolveTargetPath(entry, relPath, workingDir, vars = {}) {
|
|
|
75
75
|
if (target) {
|
|
76
76
|
if (path.isAbsolute(target)) {
|
|
77
77
|
if (workingDir !== '/') {
|
|
78
|
-
throw new Error(`Absolute target path "${target}" is not allowed when working directory is not "/". Use a relative path or run with -
|
|
78
|
+
throw new Error(`Absolute target path "${target}" is not allowed when working directory is not "/". Use a relative path or run with -w /.`);
|
|
79
79
|
}
|
|
80
80
|
if (target.endsWith('/') || target.endsWith(path.sep)) {
|
|
81
81
|
return path.resolve(target, relPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/sources/github.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/sources/github.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AA0ED,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,YAAY,CA0Bd"}
|
package/dist/sources/github.js
CHANGED
|
@@ -41,6 +41,18 @@ function ghRun(args) {
|
|
|
41
41
|
status: result.status,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
function detectPathType(repo, filePath, ref) {
|
|
45
|
+
const res = ghRun([
|
|
46
|
+
'api',
|
|
47
|
+
`repos/${repo}/contents/${filePath}?ref=${encodeURIComponent(ref)}`,
|
|
48
|
+
'--jq',
|
|
49
|
+
'if type == "array" then "directory" else "file" end',
|
|
50
|
+
]);
|
|
51
|
+
if (res.status !== 0) {
|
|
52
|
+
throw new Error(`Failed to stat ${filePath} in ${repo}@${ref}: ${res.stderr}`);
|
|
53
|
+
}
|
|
54
|
+
return res.stdout.trim();
|
|
55
|
+
}
|
|
44
56
|
function fetchFile(repo, filePath, ref) {
|
|
45
57
|
const res = ghRun([
|
|
46
58
|
'api',
|
|
@@ -68,21 +80,20 @@ function listTree(repo, dirPath, ref) {
|
|
|
68
80
|
}
|
|
69
81
|
function fetchGitHub(repo, file, ref) {
|
|
70
82
|
const resolvedRef = ref ?? 'HEAD';
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
const normalizedPath = file.replace(/\/$/, '');
|
|
84
|
+
const isDirectory = file.endsWith('/') ||
|
|
85
|
+
detectPathType(repo, normalizedPath, resolvedRef) === 'directory';
|
|
86
|
+
if (!isDirectory) {
|
|
87
|
+
const content = fetchFile(repo, normalizedPath, resolvedRef);
|
|
88
|
+
return { files: new Map([[path.basename(normalizedPath), content]]) };
|
|
75
89
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const content = fetchFile(repo, p, resolvedRef);
|
|
84
|
-
files.set(rel, content);
|
|
85
|
-
}
|
|
90
|
+
const paths = listTree(repo, normalizedPath, resolvedRef);
|
|
91
|
+
if (!paths.length) {
|
|
92
|
+
throw new Error(`Failed to fetch ${file} from ${repo}@${resolvedRef} (not a file or empty directory)`);
|
|
93
|
+
}
|
|
94
|
+
const files = new Map();
|
|
95
|
+
for (const p of paths) {
|
|
96
|
+
files.set(path.relative(normalizedPath, p), fetchFile(repo, p, resolvedRef));
|
|
86
97
|
}
|
|
87
98
|
return { files };
|
|
88
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/sources/github.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,2CAA6B;AAM7B,SAAS,KAAK,CAAC,IAAc;IAK3B,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3D,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QACvC,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,IAAY,EAAE,QAAgB,EAAE,GAAW;IAC5D,MAAM,GAAG,GAAG,KAAK,CAAC;QAChB,KAAK;QACL,SAAS,IAAI,aAAa,QAAQ,QAAQ,kBAAkB,CAAC,GAAG,CAAC,EAAE;QACnE,MAAM;QACN,UAAU;KACX,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,mBAAmB,QAAQ,S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AAC;QACjB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;QAC7D,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,mBAAmB,IAAI,SAAS,IAAI,IAAI,WAAW,kCAAkC,CACtF,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,KAAK,CAAC,GAAG,CACP,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,EAChC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,CAChC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC;AA9BD,kCA8BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.d.ts","sourceRoot":"","sources":["../../src/sources/gitlab.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab.d.ts","sourceRoot":"","sources":["../../src/sources/gitlab.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AAsKD,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,YAAY,CAkCd"}
|
package/dist/sources/gitlab.js
CHANGED
|
@@ -25,6 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.fetchGitLab = void 0;
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
|
+
const fs = __importStar(require("fs"));
|
|
29
|
+
const os = __importStar(require("os"));
|
|
28
30
|
const path = __importStar(require("path"));
|
|
29
31
|
function glabRun(args) {
|
|
30
32
|
const result = (0, child_process_1.spawnSync)('glab', args, { encoding: 'utf8' });
|
|
@@ -70,34 +72,100 @@ function fetchFile(project, filePath, ref) {
|
|
|
70
72
|
return res.stdout;
|
|
71
73
|
}
|
|
72
74
|
function listTree(project, dirPath, ref) {
|
|
75
|
+
const allPaths = [];
|
|
76
|
+
const perPage = 100;
|
|
77
|
+
let page = 1;
|
|
78
|
+
while (true) {
|
|
79
|
+
const res = glabRun([
|
|
80
|
+
'api',
|
|
81
|
+
`projects/${encodeURIComponent(project)}/repository/tree?path=${encodeURIComponent(dirPath)}&ref=${encodeURIComponent(ref)}&recursive=true&per_page=${perPage}&page=${page}`,
|
|
82
|
+
]);
|
|
83
|
+
if (res.status !== 0) {
|
|
84
|
+
throw new Error(`Failed to list tree ${dirPath} in ${project}@${ref}: ${res.stderr}`);
|
|
85
|
+
}
|
|
86
|
+
const items = JSON.parse(res.stdout);
|
|
87
|
+
allPaths.push(...items.filter((i) => i.type === 'blob').map((i) => i.path));
|
|
88
|
+
if (items.length < perPage)
|
|
89
|
+
break;
|
|
90
|
+
page++;
|
|
91
|
+
}
|
|
92
|
+
return allPaths;
|
|
93
|
+
}
|
|
94
|
+
function collectFiles(baseDir, dir, files) {
|
|
95
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
96
|
+
const full = path.join(dir, entry.name);
|
|
97
|
+
if (entry.isDirectory()) {
|
|
98
|
+
collectFiles(baseDir, full, files);
|
|
99
|
+
}
|
|
100
|
+
else if (entry.isFile()) {
|
|
101
|
+
files.set(path.relative(baseDir, full), fs.readFileSync(full, 'utf8'));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function detectPathType(project, filePath, ref) {
|
|
106
|
+
const encodedPath = encodeURIComponent(filePath);
|
|
73
107
|
const res = glabRun([
|
|
74
108
|
'api',
|
|
75
|
-
`projects/${encodeURIComponent(project)}/repository/
|
|
109
|
+
`projects/${encodeURIComponent(project)}/repository/files/${encodedPath}?ref=${encodeURIComponent(ref)}`,
|
|
76
110
|
]);
|
|
77
|
-
|
|
78
|
-
|
|
111
|
+
return res.status === 0 ? 'file' : 'directory';
|
|
112
|
+
}
|
|
113
|
+
// Downloads the directory as a tar.gz archive (one API call) and extracts it locally.
|
|
114
|
+
// Returns null if the archive approach fails, so the caller can fall back.
|
|
115
|
+
function fetchDirectoryViaArchive(project, dirPath, ref) {
|
|
116
|
+
const encodedProject = encodeURIComponent(project);
|
|
117
|
+
const result = (0, child_process_1.spawnSync)('glab', [
|
|
118
|
+
'api',
|
|
119
|
+
`projects/${encodedProject}/repository/archive.tar.gz?sha=${encodeURIComponent(ref)}&path=${encodeURIComponent(dirPath)}`,
|
|
120
|
+
], { encoding: 'buffer' });
|
|
121
|
+
if (result.error || result.status !== 0 || !result.stdout?.length)
|
|
122
|
+
return null;
|
|
123
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'scync-gl-'));
|
|
124
|
+
try {
|
|
125
|
+
const archivePath = path.join(tmpDir, 'archive.tar.gz');
|
|
126
|
+
const extractDir = path.join(tmpDir, 'extracted');
|
|
127
|
+
fs.writeFileSync(archivePath, result.stdout);
|
|
128
|
+
fs.mkdirSync(extractDir);
|
|
129
|
+
const tarResult = (0, child_process_1.spawnSync)('tar', ['-xzf', archivePath, '-C', extractDir], {
|
|
130
|
+
encoding: 'utf8',
|
|
131
|
+
});
|
|
132
|
+
if (tarResult.status !== 0)
|
|
133
|
+
return null;
|
|
134
|
+
// The archive root is a single dir with a dynamic name (project-ref-sha/)
|
|
135
|
+
const rootEntries = fs.readdirSync(extractDir);
|
|
136
|
+
if (rootEntries.length !== 1)
|
|
137
|
+
return null;
|
|
138
|
+
const targetDir = path.join(extractDir, rootEntries[0], dirPath);
|
|
139
|
+
if (!fs.existsSync(targetDir))
|
|
140
|
+
return null;
|
|
141
|
+
const files = new Map();
|
|
142
|
+
collectFiles(targetDir, targetDir, files);
|
|
143
|
+
return files.size > 0 ? files : null;
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
79
147
|
}
|
|
80
|
-
const items = JSON.parse(res.stdout);
|
|
81
|
-
return items.filter((i) => i.type === 'blob').map((i) => i.path);
|
|
82
148
|
}
|
|
83
149
|
function fetchGitLab(project, file, ref) {
|
|
84
150
|
const resolvedRef = resolveRef(project, ref);
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
151
|
+
const normalizedPath = file.replace(/\/$/, '');
|
|
152
|
+
const isDirectory = file.endsWith('/') ||
|
|
153
|
+
detectPathType(project, normalizedPath, resolvedRef) === 'directory';
|
|
154
|
+
if (!isDirectory) {
|
|
155
|
+
const content = fetchFile(project, normalizedPath, resolvedRef);
|
|
156
|
+
return { files: new Map([[path.basename(normalizedPath), content]]) };
|
|
89
157
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
158
|
+
// Directory — archive approach first (one API call), then fall back to per-file fetches
|
|
159
|
+
const archived = fetchDirectoryViaArchive(project, normalizedPath, resolvedRef);
|
|
160
|
+
if (archived)
|
|
161
|
+
return { files: archived };
|
|
162
|
+
const paths = listTree(project, normalizedPath, resolvedRef);
|
|
163
|
+
if (!paths.length) {
|
|
164
|
+
throw new Error(`Failed to fetch ${file} from ${project}@${resolvedRef} (not a file or empty directory)`);
|
|
165
|
+
}
|
|
166
|
+
const files = new Map();
|
|
167
|
+
for (const p of paths) {
|
|
168
|
+
files.set(path.relative(normalizedPath, p), fetchFile(project, p, resolvedRef));
|
|
101
169
|
}
|
|
102
170
|
return { files };
|
|
103
171
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../src/sources/gitlab.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA0C;AAC1C,2CAA6B;AAO7B,SAAS,OAAO,CAAC,IAAc;IAK7B,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,MAAM,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7D,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QACvC,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,OAAe,EAAE,GAAuB;IAC1D,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,OAAO,CAAC;YAClB,KAAK;YACL,YAAY,kBAAkB,CAAC,OAAO,CAAC,wDAAwD;SAChG,CAAC,CAAC;QACH,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,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