@trigger.dev/build 0.0.0-chat-prerelease-20260418083610 → 0.0.0-chat-prerelease-20260419173457
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/dist/commonjs/internal/additionalFiles.js +5 -49
- package/dist/commonjs/internal/additionalFiles.js.map +1 -1
- package/dist/commonjs/internal/copyFiles.d.ts +45 -0
- package/dist/commonjs/internal/copyFiles.js +76 -0
- package/dist/commonjs/internal/copyFiles.js.map +1 -0
- package/dist/commonjs/internal.d.ts +1 -0
- package/dist/commonjs/internal.js +1 -0
- package/dist/commonjs/internal.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/internal/additionalFiles.js +5 -49
- package/dist/esm/internal/additionalFiles.js.map +1 -1
- package/dist/esm/internal/copyFiles.d.ts +45 -0
- package/dist/esm/internal/copyFiles.js +70 -0
- package/dist/esm/internal/copyFiles.js.map +1 -0
- package/dist/esm/internal.d.ts +1 -0
- package/dist/esm/internal.js +1 -0
- package/dist/esm/internal.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAdditionalFilesToBuild = addAdditionalFilesToBuild;
|
|
4
|
-
const
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
const tinyglobby_1 = require("tinyglobby");
|
|
4
|
+
const copyFiles_js_1 = require("./copyFiles.js");
|
|
7
5
|
async function addAdditionalFilesToBuild(source, options, context, manifest) {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
cwd: context.workingDir,
|
|
11
|
-
});
|
|
12
|
-
for (const { assets, matcher } of staticAssets) {
|
|
6
|
+
const matcherResults = await (0, copyFiles_js_1.findFilesByMatchers)(options.files ?? [], manifest.outputPath, { cwd: context.workingDir });
|
|
7
|
+
for (const { assets, matcher } of matcherResults) {
|
|
13
8
|
if (assets.length === 0) {
|
|
14
9
|
context.logger.warn(`[${source}] No files found for matcher`, matcher);
|
|
15
10
|
}
|
|
@@ -17,47 +12,8 @@ async function addAdditionalFilesToBuild(source, options, context, manifest) {
|
|
|
17
12
|
context.logger.debug(`[${source}] Found ${assets.length} files for matcher`, matcher);
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
|
-
await
|
|
21
|
-
}
|
|
22
|
-
async function findStaticAssetFiles(matchers, destinationPath, options) {
|
|
23
|
-
const result = [];
|
|
24
|
-
for (const matcher of matchers) {
|
|
25
|
-
const assets = await findStaticAssetsForMatcher(matcher, destinationPath, options);
|
|
26
|
-
result.push({ matcher, assets });
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
async function findStaticAssetsForMatcher(matcher, destinationPath, options) {
|
|
31
|
-
const result = [];
|
|
32
|
-
const files = await (0, tinyglobby_1.glob)({
|
|
33
|
-
patterns: [matcher],
|
|
34
|
-
cwd: options?.cwd,
|
|
35
|
-
ignore: options?.ignore ?? [],
|
|
36
|
-
onlyFiles: true,
|
|
37
|
-
absolute: true,
|
|
15
|
+
await (0, copyFiles_js_1.copyMatcherResults)(matcherResults, (pair) => {
|
|
16
|
+
context.logger.debug(`[${source}] Copying ${pair.source} to ${pair.destination}`);
|
|
38
17
|
});
|
|
39
|
-
let matches = 0;
|
|
40
|
-
for (const file of files) {
|
|
41
|
-
matches++;
|
|
42
|
-
const pathInsideDestinationDir = (0, node_path_1.relative)(options?.cwd ?? process.cwd(), file)
|
|
43
|
-
.split(node_path_1.posix.sep)
|
|
44
|
-
.filter((p) => p !== "..")
|
|
45
|
-
.join(node_path_1.posix.sep);
|
|
46
|
-
const relativeDestinationPath = (0, node_path_1.join)(destinationPath, pathInsideDestinationDir);
|
|
47
|
-
result.push({
|
|
48
|
-
source: file,
|
|
49
|
-
destination: relativeDestinationPath,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
async function copyStaticAssets(staticAssetFiles, sourceName, context) {
|
|
55
|
-
for (const { assets } of staticAssetFiles) {
|
|
56
|
-
for (const { source, destination } of assets) {
|
|
57
|
-
await (0, promises_1.mkdir)((0, node_path_1.dirname)(destination), { recursive: true });
|
|
58
|
-
context.logger.debug(`[${sourceName}] Copying ${source} to ${destination}`);
|
|
59
|
-
await (0, promises_1.copyFile)(source, destination);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
18
|
}
|
|
63
19
|
//# sourceMappingURL=additionalFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../src/internal/additionalFiles.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../src/internal/additionalFiles.ts"],"names":[],"mappings":";;AAYA,8DAuBC;AAjCD,iDAIwB;AAMjB,KAAK,UAAU,yBAAyB,CAC7C,MAAc,EACd,OAA+B,EAC/B,OAAqB,EACrB,QAAuB;IAEvB,MAAM,cAAc,GAAoB,MAAM,IAAA,kCAAmB,EAC/D,OAAO,CAAC,KAAK,IAAI,EAAE,EACnB,QAAQ,CAAC,UAAU,EACnB,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,EAAE,CAC5B,CAAC;IAEF,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE,CAAC;QACjD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,8BAA8B,EAAE,OAAO,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,WAAW,MAAM,CAAC,MAAM,oBAAoB,EAAE,OAAO,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;IAED,MAAM,IAAA,iCAAkB,EAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QAChD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,aAAa,IAAI,CAAC,MAAM,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single matched asset — source file and its destination inside the
|
|
3
|
+
* build output directory.
|
|
4
|
+
*/
|
|
5
|
+
export type CopyPair = {
|
|
6
|
+
source: string;
|
|
7
|
+
destination: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Result of a single matcher's glob, grouped with the matcher that
|
|
11
|
+
* produced it so callers can warn on empty matches.
|
|
12
|
+
*/
|
|
13
|
+
export type MatcherResult = {
|
|
14
|
+
matcher: string;
|
|
15
|
+
assets: CopyPair[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Glob a set of matchers relative to `cwd` and return pairs describing
|
|
19
|
+
* where each matched file should be copied to under `destinationDir`.
|
|
20
|
+
*
|
|
21
|
+
* Relative paths are preserved under `destinationDir`. Leading `..`
|
|
22
|
+
* segments (from `../shared/file.txt` style patterns) are stripped so
|
|
23
|
+
* files always land inside the destination.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findFilesByMatchers(matchers: string[], destinationDir: string, options?: {
|
|
26
|
+
cwd?: string;
|
|
27
|
+
ignore?: string[];
|
|
28
|
+
}): Promise<MatcherResult[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Copy a single file, creating parent directories as needed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function copyFileEnsuringDir(source: string, destination: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Copy every pair in the given matcher results. Parent directories are
|
|
35
|
+
* created automatically. Returns the total number of files copied.
|
|
36
|
+
*/
|
|
37
|
+
export declare function copyMatcherResults(matcherResults: MatcherResult[], onCopy?: (pair: CopyPair) => void): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* Recursively copy a directory to another location. Preserves structure;
|
|
40
|
+
* overwrites existing files at the destination.
|
|
41
|
+
*
|
|
42
|
+
* Used by the built-in skill bundler — we copy entire skill folders as a
|
|
43
|
+
* unit, not file-by-file.
|
|
44
|
+
*/
|
|
45
|
+
export declare function copyDirectoryRecursive(source: string, destination: string): Promise<void>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findFilesByMatchers = findFilesByMatchers;
|
|
4
|
+
exports.copyFileEnsuringDir = copyFileEnsuringDir;
|
|
5
|
+
exports.copyMatcherResults = copyMatcherResults;
|
|
6
|
+
exports.copyDirectoryRecursive = copyDirectoryRecursive;
|
|
7
|
+
const promises_1 = require("node:fs/promises");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const tinyglobby_1 = require("tinyglobby");
|
|
10
|
+
/**
|
|
11
|
+
* Glob a set of matchers relative to `cwd` and return pairs describing
|
|
12
|
+
* where each matched file should be copied to under `destinationDir`.
|
|
13
|
+
*
|
|
14
|
+
* Relative paths are preserved under `destinationDir`. Leading `..`
|
|
15
|
+
* segments (from `../shared/file.txt` style patterns) are stripped so
|
|
16
|
+
* files always land inside the destination.
|
|
17
|
+
*/
|
|
18
|
+
async function findFilesByMatchers(matchers, destinationDir, options) {
|
|
19
|
+
const result = [];
|
|
20
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
21
|
+
for (const matcher of matchers) {
|
|
22
|
+
const files = await (0, tinyglobby_1.glob)({
|
|
23
|
+
patterns: [matcher],
|
|
24
|
+
cwd,
|
|
25
|
+
ignore: options?.ignore ?? [],
|
|
26
|
+
onlyFiles: true,
|
|
27
|
+
absolute: true,
|
|
28
|
+
});
|
|
29
|
+
const assets = files.map((file) => {
|
|
30
|
+
const pathInsideDestinationDir = (0, node_path_1.relative)(cwd, file)
|
|
31
|
+
.split(node_path_1.posix.sep)
|
|
32
|
+
.filter((p) => p !== "..")
|
|
33
|
+
.join(node_path_1.posix.sep);
|
|
34
|
+
return {
|
|
35
|
+
source: file,
|
|
36
|
+
destination: (0, node_path_1.join)(destinationDir, pathInsideDestinationDir),
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
result.push({ matcher, assets });
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Copy a single file, creating parent directories as needed.
|
|
45
|
+
*/
|
|
46
|
+
async function copyFileEnsuringDir(source, destination) {
|
|
47
|
+
await (0, promises_1.mkdir)((0, node_path_1.dirname)(destination), { recursive: true });
|
|
48
|
+
await (0, promises_1.copyFile)(source, destination);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Copy every pair in the given matcher results. Parent directories are
|
|
52
|
+
* created automatically. Returns the total number of files copied.
|
|
53
|
+
*/
|
|
54
|
+
async function copyMatcherResults(matcherResults, onCopy) {
|
|
55
|
+
let count = 0;
|
|
56
|
+
for (const { assets } of matcherResults) {
|
|
57
|
+
for (const pair of assets) {
|
|
58
|
+
onCopy?.(pair);
|
|
59
|
+
await copyFileEnsuringDir(pair.source, pair.destination);
|
|
60
|
+
count++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return count;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Recursively copy a directory to another location. Preserves structure;
|
|
67
|
+
* overwrites existing files at the destination.
|
|
68
|
+
*
|
|
69
|
+
* Used by the built-in skill bundler — we copy entire skill folders as a
|
|
70
|
+
* unit, not file-by-file.
|
|
71
|
+
*/
|
|
72
|
+
async function copyDirectoryRecursive(source, destination) {
|
|
73
|
+
await (0, promises_1.mkdir)(destination, { recursive: true });
|
|
74
|
+
await (0, promises_1.cp)(source, destination, { recursive: true, force: true });
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=copyFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,UAAU,mBAAmB,CAAC,MAAc,EAAE,WAAmB;IAC3E,MAAM,IAAA,gBAAK,EAAC,IAAA,mBAAO,EAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,IAAA,mBAAQ,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CACtC,cAA+B,EAC/B,MAAiC;IAEjC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,cAAc,EAAE,CAAC;QACxC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;YACf,MAAM,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACzD,KAAK,EAAE,CAAC;QACV,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,sBAAsB,CAAC,MAAc,EAAE,WAAmB;IAC9E,MAAM,IAAA,gBAAK,EAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,IAAA,aAAE,EAAC,MAAM,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./internal/additionalFiles.js"), exports);
|
|
18
|
+
__exportStar(require("./internal/copyFiles.js"), exports);
|
|
18
19
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C"}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,0DAAwC"}
|
package/dist/commonjs/version.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { dirname, join, posix, relative } from "node:path";
|
|
3
|
-
import { glob } from "tinyglobby";
|
|
1
|
+
import { copyMatcherResults, findFilesByMatchers, } from "./copyFiles.js";
|
|
4
2
|
export async function addAdditionalFilesToBuild(source, options, context, manifest) {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
cwd: context.workingDir,
|
|
8
|
-
});
|
|
9
|
-
for (const { assets, matcher } of staticAssets) {
|
|
3
|
+
const matcherResults = await findFilesByMatchers(options.files ?? [], manifest.outputPath, { cwd: context.workingDir });
|
|
4
|
+
for (const { assets, matcher } of matcherResults) {
|
|
10
5
|
if (assets.length === 0) {
|
|
11
6
|
context.logger.warn(`[${source}] No files found for matcher`, matcher);
|
|
12
7
|
}
|
|
@@ -14,47 +9,8 @@ export async function addAdditionalFilesToBuild(source, options, context, manife
|
|
|
14
9
|
context.logger.debug(`[${source}] Found ${assets.length} files for matcher`, matcher);
|
|
15
10
|
}
|
|
16
11
|
}
|
|
17
|
-
await
|
|
18
|
-
}
|
|
19
|
-
async function findStaticAssetFiles(matchers, destinationPath, options) {
|
|
20
|
-
const result = [];
|
|
21
|
-
for (const matcher of matchers) {
|
|
22
|
-
const assets = await findStaticAssetsForMatcher(matcher, destinationPath, options);
|
|
23
|
-
result.push({ matcher, assets });
|
|
24
|
-
}
|
|
25
|
-
return result;
|
|
26
|
-
}
|
|
27
|
-
async function findStaticAssetsForMatcher(matcher, destinationPath, options) {
|
|
28
|
-
const result = [];
|
|
29
|
-
const files = await glob({
|
|
30
|
-
patterns: [matcher],
|
|
31
|
-
cwd: options?.cwd,
|
|
32
|
-
ignore: options?.ignore ?? [],
|
|
33
|
-
onlyFiles: true,
|
|
34
|
-
absolute: true,
|
|
12
|
+
await copyMatcherResults(matcherResults, (pair) => {
|
|
13
|
+
context.logger.debug(`[${source}] Copying ${pair.source} to ${pair.destination}`);
|
|
35
14
|
});
|
|
36
|
-
let matches = 0;
|
|
37
|
-
for (const file of files) {
|
|
38
|
-
matches++;
|
|
39
|
-
const pathInsideDestinationDir = relative(options?.cwd ?? process.cwd(), file)
|
|
40
|
-
.split(posix.sep)
|
|
41
|
-
.filter((p) => p !== "..")
|
|
42
|
-
.join(posix.sep);
|
|
43
|
-
const relativeDestinationPath = join(destinationPath, pathInsideDestinationDir);
|
|
44
|
-
result.push({
|
|
45
|
-
source: file,
|
|
46
|
-
destination: relativeDestinationPath,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
async function copyStaticAssets(staticAssetFiles, sourceName, context) {
|
|
52
|
-
for (const { assets } of staticAssetFiles) {
|
|
53
|
-
for (const { source, destination } of assets) {
|
|
54
|
-
await mkdir(dirname(destination), { recursive: true });
|
|
55
|
-
context.logger.debug(`[${sourceName}] Copying ${source} to ${destination}`);
|
|
56
|
-
await copyFile(source, destination);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
15
|
}
|
|
60
16
|
//# sourceMappingURL=additionalFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../src/internal/additionalFiles.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../src/internal/additionalFiles.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAMxB,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAc,EACd,OAA+B,EAC/B,OAAqB,EACrB,QAAuB;IAEvB,MAAM,cAAc,GAAoB,MAAM,mBAAmB,CAC/D,OAAO,CAAC,KAAK,IAAI,EAAE,EACnB,QAAQ,CAAC,UAAU,EACnB,EAAE,GAAG,EAAE,OAAO,CAAC,UAAU,EAAE,CAC5B,CAAC;IAEF,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE,CAAC;QACjD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,8BAA8B,EAAE,OAAO,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,WAAW,MAAM,CAAC,MAAM,oBAAoB,EAAE,OAAO,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;IAED,MAAM,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QAChD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,aAAa,IAAI,CAAC,MAAM,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single matched asset — source file and its destination inside the
|
|
3
|
+
* build output directory.
|
|
4
|
+
*/
|
|
5
|
+
export type CopyPair = {
|
|
6
|
+
source: string;
|
|
7
|
+
destination: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Result of a single matcher's glob, grouped with the matcher that
|
|
11
|
+
* produced it so callers can warn on empty matches.
|
|
12
|
+
*/
|
|
13
|
+
export type MatcherResult = {
|
|
14
|
+
matcher: string;
|
|
15
|
+
assets: CopyPair[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Glob a set of matchers relative to `cwd` and return pairs describing
|
|
19
|
+
* where each matched file should be copied to under `destinationDir`.
|
|
20
|
+
*
|
|
21
|
+
* Relative paths are preserved under `destinationDir`. Leading `..`
|
|
22
|
+
* segments (from `../shared/file.txt` style patterns) are stripped so
|
|
23
|
+
* files always land inside the destination.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findFilesByMatchers(matchers: string[], destinationDir: string, options?: {
|
|
26
|
+
cwd?: string;
|
|
27
|
+
ignore?: string[];
|
|
28
|
+
}): Promise<MatcherResult[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Copy a single file, creating parent directories as needed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function copyFileEnsuringDir(source: string, destination: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Copy every pair in the given matcher results. Parent directories are
|
|
35
|
+
* created automatically. Returns the total number of files copied.
|
|
36
|
+
*/
|
|
37
|
+
export declare function copyMatcherResults(matcherResults: MatcherResult[], onCopy?: (pair: CopyPair) => void): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* Recursively copy a directory to another location. Preserves structure;
|
|
40
|
+
* overwrites existing files at the destination.
|
|
41
|
+
*
|
|
42
|
+
* Used by the built-in skill bundler — we copy entire skill folders as a
|
|
43
|
+
* unit, not file-by-file.
|
|
44
|
+
*/
|
|
45
|
+
export declare function copyDirectoryRecursive(source: string, destination: string): Promise<void>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cp, copyFile, mkdir } from "node:fs/promises";
|
|
2
|
+
import { dirname, join, posix, relative } from "node:path";
|
|
3
|
+
import { glob } from "tinyglobby";
|
|
4
|
+
/**
|
|
5
|
+
* Glob a set of matchers relative to `cwd` and return pairs describing
|
|
6
|
+
* where each matched file should be copied to under `destinationDir`.
|
|
7
|
+
*
|
|
8
|
+
* Relative paths are preserved under `destinationDir`. Leading `..`
|
|
9
|
+
* segments (from `../shared/file.txt` style patterns) are stripped so
|
|
10
|
+
* files always land inside the destination.
|
|
11
|
+
*/
|
|
12
|
+
export async function findFilesByMatchers(matchers, destinationDir, options) {
|
|
13
|
+
const result = [];
|
|
14
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
15
|
+
for (const matcher of matchers) {
|
|
16
|
+
const files = await glob({
|
|
17
|
+
patterns: [matcher],
|
|
18
|
+
cwd,
|
|
19
|
+
ignore: options?.ignore ?? [],
|
|
20
|
+
onlyFiles: true,
|
|
21
|
+
absolute: true,
|
|
22
|
+
});
|
|
23
|
+
const assets = files.map((file) => {
|
|
24
|
+
const pathInsideDestinationDir = relative(cwd, file)
|
|
25
|
+
.split(posix.sep)
|
|
26
|
+
.filter((p) => p !== "..")
|
|
27
|
+
.join(posix.sep);
|
|
28
|
+
return {
|
|
29
|
+
source: file,
|
|
30
|
+
destination: join(destinationDir, pathInsideDestinationDir),
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
result.push({ matcher, assets });
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Copy a single file, creating parent directories as needed.
|
|
39
|
+
*/
|
|
40
|
+
export async function copyFileEnsuringDir(source, destination) {
|
|
41
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
42
|
+
await copyFile(source, destination);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Copy every pair in the given matcher results. Parent directories are
|
|
46
|
+
* created automatically. Returns the total number of files copied.
|
|
47
|
+
*/
|
|
48
|
+
export async function copyMatcherResults(matcherResults, onCopy) {
|
|
49
|
+
let count = 0;
|
|
50
|
+
for (const { assets } of matcherResults) {
|
|
51
|
+
for (const pair of assets) {
|
|
52
|
+
onCopy?.(pair);
|
|
53
|
+
await copyFileEnsuringDir(pair.source, pair.destination);
|
|
54
|
+
count++;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return count;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Recursively copy a directory to another location. Preserves structure;
|
|
61
|
+
* overwrites existing files at the destination.
|
|
62
|
+
*
|
|
63
|
+
* Used by the built-in skill bundler — we copy entire skill folders as a
|
|
64
|
+
* unit, not file-by-file.
|
|
65
|
+
*/
|
|
66
|
+
export async function copyDirectoryRecursive(source, destination) {
|
|
67
|
+
await mkdir(destination, { recursive: true });
|
|
68
|
+
await cp(source, destination, { recursive: true, force: true });
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=copyFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyFiles.js","sourceRoot":"","sources":["../../../src/internal/copyFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAiBlC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAkB,EAClB,cAAsB,EACtB,OAA6C;IAE7C,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC;YACvB,QAAQ,EAAE,CAAC,OAAO,CAAC;YACnB,GAAG;YACH,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE;YAC7B,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,MAAM,MAAM,GAAe,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,wBAAwB,GAAG,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;iBACjD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;iBAChB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC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,EAAE,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/esm/internal.d.ts
CHANGED
package/dist/esm/internal.js
CHANGED
package/dist/esm/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.0.0-chat-prerelease-
|
|
1
|
+
export const VERSION = "0.0.0-chat-prerelease-20260419173457";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/build",
|
|
3
|
-
"version": "0.0.0-chat-prerelease-
|
|
3
|
+
"version": "0.0.0-chat-prerelease-20260419173457",
|
|
4
4
|
"description": "trigger.dev build extensions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@prisma/config": "^6.10.0",
|
|
77
|
-
"@trigger.dev/core": "0.0.0-chat-prerelease-
|
|
77
|
+
"@trigger.dev/core": "0.0.0-chat-prerelease-20260419173457",
|
|
78
78
|
"mlly": "^1.7.1",
|
|
79
79
|
"pkg-types": "^1.1.3",
|
|
80
80
|
"resolve": "^1.22.8",
|