@trigger.dev/build 3.3.16 → 3.3.17

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Official TypeScript SDK for Trigger.dev
1
+ # Official Build Package of Trigger.dev
2
2
 
3
- View the full documentation for the [here](https://trigger.dev/docs)
3
+ View the full documentation [here](https://trigger.dev/docs)
@@ -1,64 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.additionalFiles = additionalFiles;
4
- const node_path_1 = require("node:path");
5
- const tinyglobby_1 = require("tinyglobby");
6
- const promises_1 = require("node:fs/promises");
4
+ const additionalFiles_js_1 = require("../../internal/additionalFiles.js");
7
5
  function additionalFiles(options) {
8
6
  return {
9
7
  name: "additionalFiles",
10
8
  async onBuildComplete(context, manifest) {
11
- // Copy any static assets to the destination
12
- const staticAssets = await findStaticAssetFiles(options.files ?? [], manifest.outputPath, {
13
- cwd: context.workingDir,
14
- });
15
- for (const { assets, matcher } of staticAssets) {
16
- if (assets.length === 0) {
17
- console.warn("No files found for matcher", matcher);
18
- }
19
- }
20
- await copyStaticAssets(staticAssets);
9
+ await (0, additionalFiles_js_1.addAdditionalFilesToBuild)("additionalFiles", options, context, manifest);
21
10
  },
22
11
  };
23
12
  }
24
- async function findStaticAssetFiles(matchers, destinationPath, options) {
25
- const result = [];
26
- for (const matcher of matchers) {
27
- const assets = await findStaticAssetsForMatcher(matcher, destinationPath, options);
28
- result.push({ matcher, assets });
29
- }
30
- return result;
31
- }
32
- async function findStaticAssetsForMatcher(matcher, destinationPath, options) {
33
- const result = [];
34
- const files = await (0, tinyglobby_1.glob)({
35
- patterns: [matcher],
36
- cwd: options?.cwd,
37
- ignore: options?.ignore ?? [],
38
- onlyFiles: true,
39
- absolute: true,
40
- });
41
- let matches = 0;
42
- for (const file of files) {
43
- matches++;
44
- const pathInsideDestinationDir = (0, node_path_1.relative)(options?.cwd ?? process.cwd(), file)
45
- .split(node_path_1.posix.sep)
46
- .filter((p) => p !== "..")
47
- .join(node_path_1.posix.sep);
48
- const relativeDestinationPath = (0, node_path_1.join)(destinationPath, pathInsideDestinationDir);
49
- result.push({
50
- source: file,
51
- destination: relativeDestinationPath,
52
- });
53
- }
54
- return result;
55
- }
56
- async function copyStaticAssets(staticAssetFiles) {
57
- for (const { assets } of staticAssetFiles) {
58
- for (const { source, destination } of assets) {
59
- await (0, promises_1.mkdir)((0, node_path_1.dirname)(destination), { recursive: true });
60
- await (0, promises_1.copyFile)(source, destination);
61
- }
62
- }
63
- }
64
13
  //# sourceMappingURL=additionalFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../../src/extensions/core/additionalFiles.ts"],"names":[],"mappings":";;AASA,0CAkBC;AA3BD,yCAA2D;AAC3D,2CAAkC;AAClC,+CAAmD;AAOnD,SAAgB,eAAe,CAAC,OAA+B;IAC7D,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ;YACrC,4CAA4C;YAC5C,MAAM,YAAY,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,EAAE;gBACxF,GAAG,EAAE,OAAO,CAAC,UAAU;aACxB,CAAC,CAAC;YAEH,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;gBAC/C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACxB,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC;YAED,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC;AASD,KAAK,UAAU,oBAAoB,CACjC,QAAkB,EAClB,eAAuB,EACvB,OAA6C;I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AC;AAChB,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,gBAAuC;IACrE,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC1C,KAAK,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,MAAM,EAAE,CAAC;YAC7C,MAAM,IAAA,gBAAK,EAAC,IAAA,mBAAO,EAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,MAAM,IAAA,mBAAQ,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../../src/extensions/core/additionalFiles.ts"],"names":[],"mappings":";;AAOA,0CAOC;AAbD,0EAA8E;AAM9E,SAAgB,eAAe,CAAC,OAA+B;IAC7D,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ;YACrC,MAAM,IAAA,8CAAyB,EAAC,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { BuildManifest } from "@trigger.dev/core/v3";
2
+ import { BuildContext } from "@trigger.dev/core/v3/build";
3
+ export type AdditionalFilesOptions = {
4
+ files: string[];
5
+ };
6
+ export declare function addAdditionalFilesToBuild(source: string, options: AdditionalFilesOptions, context: BuildContext, manifest: BuildManifest): Promise<void>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addAdditionalFilesToBuild = addAdditionalFilesToBuild;
4
+ const promises_1 = require("node:fs/promises");
5
+ const node_path_1 = require("node:path");
6
+ const tinyglobby_1 = require("tinyglobby");
7
+ async function addAdditionalFilesToBuild(source, options, context, manifest) {
8
+ // Copy any static assets to the destination
9
+ const staticAssets = await findStaticAssetFiles(options.files ?? [], manifest.outputPath, {
10
+ cwd: context.workingDir,
11
+ });
12
+ for (const { assets, matcher } of staticAssets) {
13
+ if (assets.length === 0) {
14
+ context.logger.warn(`[${source}] No files found for matcher`, matcher);
15
+ }
16
+ else {
17
+ context.logger.debug(`[${source}] Found ${assets.length} files for matcher`, matcher);
18
+ }
19
+ }
20
+ await copyStaticAssets(staticAssets, source, context);
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,
38
+ });
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
+ }
63
+ //# sourceMappingURL=additionalFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"additionalFiles.js","sourceRoot":"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,CAAC,KAAK,CAAC,IAAI,UAAU,aAAa,MAAM,OAAO,WAAW,EAAE,CAAC,CAAC;YAE5E,MAAM,IAAA,mBAAQ,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./internal/additionalFiles.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./internal/additionalFiles.js"), exports);
18
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "3.3.16";
4
+ exports.VERSION = "3.3.17";
5
5
  //# sourceMappingURL=version.js.map
@@ -1,61 +1,10 @@
1
- import { relative, join, posix, dirname } from "node:path";
2
- import { glob } from "tinyglobby";
3
- import { copyFile, mkdir } from "node:fs/promises";
1
+ import { addAdditionalFilesToBuild } from "../../internal/additionalFiles.js";
4
2
  export function additionalFiles(options) {
5
3
  return {
6
4
  name: "additionalFiles",
7
5
  async onBuildComplete(context, manifest) {
8
- // Copy any static assets to the destination
9
- const staticAssets = await findStaticAssetFiles(options.files ?? [], manifest.outputPath, {
10
- cwd: context.workingDir,
11
- });
12
- for (const { assets, matcher } of staticAssets) {
13
- if (assets.length === 0) {
14
- console.warn("No files found for matcher", matcher);
15
- }
16
- }
17
- await copyStaticAssets(staticAssets);
6
+ await addAdditionalFilesToBuild("additionalFiles", options, context, manifest);
18
7
  },
19
8
  };
20
9
  }
21
- async function findStaticAssetFiles(matchers, destinationPath, options) {
22
- const result = [];
23
- for (const matcher of matchers) {
24
- const assets = await findStaticAssetsForMatcher(matcher, destinationPath, options);
25
- result.push({ matcher, assets });
26
- }
27
- return result;
28
- }
29
- async function findStaticAssetsForMatcher(matcher, destinationPath, options) {
30
- const result = [];
31
- const files = await glob({
32
- patterns: [matcher],
33
- cwd: options?.cwd,
34
- ignore: options?.ignore ?? [],
35
- onlyFiles: true,
36
- absolute: true,
37
- });
38
- let matches = 0;
39
- for (const file of files) {
40
- matches++;
41
- const pathInsideDestinationDir = relative(options?.cwd ?? process.cwd(), file)
42
- .split(posix.sep)
43
- .filter((p) => p !== "..")
44
- .join(posix.sep);
45
- const relativeDestinationPath = join(destinationPath, pathInsideDestinationDir);
46
- result.push({
47
- source: file,
48
- destination: relativeDestinationPath,
49
- });
50
- }
51
- return result;
52
- }
53
- async function copyStaticAssets(staticAssetFiles) {
54
- for (const { assets } of staticAssetFiles) {
55
- for (const { source, destination } of assets) {
56
- await mkdir(dirname(destination), { recursive: true });
57
- await copyFile(source, destination);
58
- }
59
- }
60
- }
61
10
  //# sourceMappingURL=additionalFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../../src/extensions/core/additionalFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,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AM,mCAAmC,CAAC;AAM9E,MAAM,UAAU,eAAe,CAAC,OAA+B;IAC7D,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ;YACrC,MAAM,yBAAyB,CAAC,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { BuildManifest } from "@trigger.dev/core/v3";
2
+ import { BuildContext } from "@trigger.dev/core/v3/build";
3
+ export type AdditionalFilesOptions = {
4
+ files: string[];
5
+ };
6
+ export declare function addAdditionalFilesToBuild(source: string, options: AdditionalFilesOptions, context: BuildContext, manifest: BuildManifest): Promise<void>;
@@ -0,0 +1,60 @@
1
+ import { copyFile, mkdir } from "node:fs/promises";
2
+ import { dirname, join, posix, relative } from "node:path";
3
+ import { glob } from "tinyglobby";
4
+ export async function addAdditionalFilesToBuild(source, options, context, manifest) {
5
+ // Copy any static assets to the destination
6
+ const staticAssets = await findStaticAssetFiles(options.files ?? [], manifest.outputPath, {
7
+ cwd: context.workingDir,
8
+ });
9
+ for (const { assets, matcher } of staticAssets) {
10
+ if (assets.length === 0) {
11
+ context.logger.warn(`[${source}] No files found for matcher`, matcher);
12
+ }
13
+ else {
14
+ context.logger.debug(`[${source}] Found ${assets.length} files for matcher`, matcher);
15
+ }
16
+ }
17
+ await copyStaticAssets(staticAssets, source, context);
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,
35
+ });
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
+ }
60
+ //# sourceMappingURL=additionalFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"additionalFiles.js","sourceRoot":"","sources":["../../../src/internal/additionalFiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMlC,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAc,EACd,OAA+B,EAC/B,OAAqB,EACrB,QAAuB;IAEvB,4CAA4C;IAC5C,MAAM,YAAY,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,EAAE;QACxF,GAAG,EAAE,OAAO,CAAC,UAAU;KACxB,CAAC,CAAC;IAEH,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;QAC/C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,MAAM,CAAC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C,GAAG,CAAC;aAChB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;aACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnB,MAAM,uBAAuB,GAAG,IAAI,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;QAEhF,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,uBAAuB;SACrC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,gBAAgB,CAC7B,gBAAuC,EACvC,UAAkB,EAClB,OAAqB;IAErB,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC1C,KAAK,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,MAAM,EAAE,CAAC;YAC7C,MAAM,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAEvD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,UAAU,aAAa,MAAM,OAAO,WAAW,EAAE,CAAC,CAAC;YAE5E,MAAM,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./internal/additionalFiles.js";
@@ -0,0 +1,2 @@
1
+ export * from "./internal/additionalFiles.js";
2
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -1,2 +1,2 @@
1
- export const VERSION = "3.3.16";
1
+ export const VERSION = "3.3.17";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/build",
3
- "version": "3.3.16",
3
+ "version": "3.3.17",
4
4
  "description": "trigger.dev build extensions",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -23,6 +23,7 @@
23
23
  "exports": {
24
24
  "./package.json": "./package.json",
25
25
  ".": "./src/index.ts",
26
+ "./internal": "./src/internal.ts",
26
27
  "./extensions": "./src/extensions/index.ts",
27
28
  "./extensions/core": "./src/extensions/core.ts",
28
29
  "./extensions/prisma": "./src/extensions/prisma.ts",
@@ -36,6 +37,9 @@
36
37
  },
37
38
  "typesVersions": {
38
39
  "*": {
40
+ "internal": [
41
+ "dist/commonjs/internal.d.ts"
42
+ ],
39
43
  "extensions": [
40
44
  "dist/commonjs/extensions/index.d.ts"
41
45
  ],
@@ -57,7 +61,7 @@
57
61
  }
58
62
  },
59
63
  "dependencies": {
60
- "@trigger.dev/core": "3.3.16",
64
+ "@trigger.dev/core": "3.3.17",
61
65
  "pkg-types": "^1.1.3",
62
66
  "tinyglobby": "^0.2.2",
63
67
  "tsconfck": "3.1.3"
@@ -87,6 +91,17 @@
87
91
  "default": "./dist/commonjs/index.js"
88
92
  }
89
93
  },
94
+ "./internal": {
95
+ "import": {
96
+ "@triggerdotdev/source": "./src/internal.ts",
97
+ "types": "./dist/esm/internal.d.ts",
98
+ "default": "./dist/esm/internal.js"
99
+ },
100
+ "require": {
101
+ "types": "./dist/commonjs/internal.d.ts",
102
+ "default": "./dist/commonjs/internal.js"
103
+ }
104
+ },
90
105
  "./extensions": {
91
106
  "import": {
92
107
  "@triggerdotdev/source": "./src/extensions/index.ts",