@trigger.dev/build 4.0.0-v4-beta.14 → 4.0.0-v4-beta.16

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.
@@ -1,10 +1,21 @@
1
1
  import { BuildExtension } from "@trigger.dev/core/v3/build";
2
2
  export type FfmpegOptions = {
3
+ /**
4
+ * The version of ffmpeg to install. If not provided, the latest version from apt will be installed.
5
+ * If set to '7' or starts with '7.', a static build of ffmpeg 7.x from johnvansickle.com will be used instead of apt.
6
+ * @example
7
+ * ffmpeg() // Installs latest ffmpeg from apt
8
+ * ffmpeg({ version: '7' }) // Installs static build of ffmpeg 7.x
9
+ * ffmpeg({ version: '7.0.1' }) // Installs static build of ffmpeg 7.x
10
+ * ffmpeg({ version: '6' }) // Version ignored, installs latest ffmpeg from apt
11
+ * ffmpeg({ version: '8' }) // Version ignored, installs latest ffmpeg from apt
12
+ */
3
13
  version?: string;
4
14
  };
5
15
  /**
6
16
  * Add ffmpeg to the build, and automatically set the FFMPEG_PATH and FFPROBE_PATH environment variables.
7
- * @param options.version The version of ffmpeg to install. If not provided, the latest version will be installed.
17
+ * @param options.version The version of ffmpeg to install. If not provided, the latest version from apt will be installed.
18
+ * If set to '7' or starts with '7.', a static build of ffmpeg 7.x from johnvansickle.com will be used instead of apt.
8
19
  *
9
20
  * @returns The build extension.
10
21
  */
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ffmpeg = ffmpeg;
4
4
  /**
5
5
  * Add ffmpeg to the build, and automatically set the FFMPEG_PATH and FFPROBE_PATH environment variables.
6
- * @param options.version The version of ffmpeg to install. If not provided, the latest version will be installed.
6
+ * @param options.version The version of ffmpeg to install. If not provided, the latest version from apt will be installed.
7
+ * If set to '7' or starts with '7.', a static build of ffmpeg 7.x from johnvansickle.com will be used instead of apt.
7
8
  *
8
9
  * @returns The build extension.
9
10
  */
@@ -17,10 +18,41 @@ function ffmpeg(options = {}) {
17
18
  context.logger.debug("Adding ffmpeg", {
18
19
  options,
19
20
  });
21
+ // Use static build for version 7 or 7.x
22
+ if (options.version === "7" || options.version?.startsWith("7.")) {
23
+ context.addLayer({
24
+ id: "ffmpeg",
25
+ image: {
26
+ instructions: [
27
+ // Install ffmpeg after checksum validation
28
+ "RUN apt-get update && apt-get install -y --no-install-recommends wget xz-utils nscd ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists/* && " +
29
+ "wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5 && " +
30
+ "wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz && " +
31
+ "md5sum -c ffmpeg-git-amd64-static.tar.xz.md5 && " +
32
+ "tar xvf ffmpeg-git-amd64-static.tar.xz -C /usr/bin --strip-components=1 --no-anchored 'ffmpeg' 'ffprobe' && " +
33
+ "rm ffmpeg-git-amd64-static.tar.xz*",
34
+ ],
35
+ },
36
+ deploy: {
37
+ env: {
38
+ FFMPEG_PATH: "/usr/bin/ffmpeg",
39
+ FFPROBE_PATH: "/usr/bin/ffprobe",
40
+ },
41
+ override: true,
42
+ },
43
+ });
44
+ return;
45
+ }
46
+ else if (options.version) {
47
+ context.logger.warn("Custom ffmpeg version not supported, ignoring", {
48
+ version: options.version,
49
+ });
50
+ }
51
+ // Default: use apt
20
52
  context.addLayer({
21
53
  id: "ffmpeg",
22
54
  image: {
23
- pkgs: options.version ? [`ffmpeg=${options.version}`] : ["ffmpeg"],
55
+ pkgs: ["ffmpeg"],
24
56
  },
25
57
  deploy: {
26
58
  env: {
@@ -1 +1 @@
1
- {"version":3,"file":"ffmpeg.js","sourceRoot":"","sources":["../../../../src/extensions/core/ffmpeg.ts"],"names":[],"mappings":";;AAYA,wBA2BC;AAjCD;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,UAAyB,EAAE;IAChD,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,eAAe,CAAC,OAAO;YACrB,IAAI,OAAO,CAAC,MAA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9G,oCAAoC;yBACvC;qBACF;oBACD,MAAM,EAAE;wBACN,GAAG,EAAE;4BACH,WAAW,EAAE,iBAAiB;4BAC9B,YAAY,EAAE,kBAAkB;yBACjC;wBACD,QAAQ,EAAE,IAAI;qBACf;iBACF,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;iBAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,EAAE;oBACnE,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB,CAAC,CAAC;YACL,CAAC;YAED,mBAAmB;YACnB,OAAO,CAAC,QAAQ,CAAC;gBACf,EAAE,EAAE,QAAQ;gBACZ,KAAK,EAAE;oBACL,IAAI,EAAE,CAAC,QAAQ,CAAC;iBACjB;gBACD,MAAM,EAAE;oBACN,GAAG,EAAE;wBACH,WAAW,EAAE,iBAAiB;wBAC9B,YAAY,EAAE,kBAAkB;qBACjC;oBACD,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { BuildContext, BuildExtension } from "@trigger.dev/core/v3/build";
2
+ import type { BuildManifest, BuildTarget } from "@trigger.dev/core/v3";
3
+ type PlaywrightBrowser = "chromium" | "firefox" | "webkit";
4
+ interface PlaywrightExtensionOptions {
5
+ /**
6
+ * Browsers to install. Select only needed browsers to optimize build time and size.
7
+ * @default ["chromium"]
8
+ */
9
+ browsers?: PlaywrightBrowser[];
10
+ /**
11
+ * Run the browsers in headless mode (Recommended)
12
+ * @default true
13
+ */
14
+ headless?: boolean;
15
+ /**
16
+ * Playwright version override. If not provided, we will try to detect the version automatically.
17
+ */
18
+ version?: string;
19
+ }
20
+ /**
21
+ * Installs Playwright browsers and dependencies for your Trigger.dev deployments.
22
+ *
23
+ * @param options - Configuration options for the Playwright extension.
24
+ * @param options.browsers Browsers to install. Accepts an array of strings. Default: `["chromium"]`
25
+ * @param options.headless Whether to run browsers in headless mode. Default: `true`
26
+ * @param options.version Playwright version to use for browser installation. When not set, will automatically detect the version (recommended). Default: `undefined`
27
+ *
28
+ */
29
+ export declare function playwright(options?: PlaywrightExtensionOptions): PlaywrightExtension;
30
+ /**
31
+ * Background:
32
+ *
33
+ * Running `npx playwright install --with-deps` normally will install the browsers and the dependencies.
34
+ * However, this is not possible in a build context, because we don't have sudo access.
35
+ *
36
+ * So we need to install the dependencies manually and then download and install the browsers.
37
+ * This has a few challenges:
38
+ * 1. We don't want to download all browsers, only the ones we need with it's dependencies
39
+ * The less dependencies we have to install, the faster the build, and the smaller the image.
40
+ * 2. We need to know where to download the browsers from
41
+ * while we can hardcode the download url it might change over time (as it has in the past)
42
+ * so we need to download the browser info first and then parse the output to get the download url.
43
+ *
44
+ * Note: While this looks like we are downloading & installing a lot of stuff, it's actually not that bad
45
+ * since running `npx playwright install --with-deps` will result in the same amount of downloads.
46
+ */
47
+ declare class PlaywrightExtension implements BuildExtension {
48
+ readonly name = "PlaywrightExtension";
49
+ private moduleExternals;
50
+ private readonly options;
51
+ constructor({ browsers, headless, version, }?: PlaywrightExtensionOptions);
52
+ externalsForTarget(target: BuildTarget): string[];
53
+ onBuildComplete(context: BuildContext, manifest: BuildManifest): void;
54
+ }
55
+ export {};
@@ -0,0 +1,290 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.playwright = playwright;
4
+ /**
5
+ * This list is from the official playwright registry.
6
+ *
7
+ * @see https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/registry/nativeDeps.ts
8
+ */
9
+ const debian12Deps = {
10
+ tools: [
11
+ "xvfb",
12
+ "fonts-noto-color-emoji",
13
+ "fonts-unifont",
14
+ "libfontconfig1",
15
+ "libfreetype6",
16
+ "xfonts-scalable",
17
+ "fonts-liberation",
18
+ "fonts-ipafont-gothic",
19
+ "fonts-wqy-zenhei",
20
+ "fonts-tlwg-loma-otf",
21
+ "fonts-freefont-ttf",
22
+ ],
23
+ chromium: [
24
+ "libasound2",
25
+ "libatk-bridge2.0-0",
26
+ "libatk1.0-0",
27
+ "libatspi2.0-0",
28
+ "libcairo2",
29
+ "libcups2",
30
+ "libdbus-1-3",
31
+ "libdrm2",
32
+ "libgbm1",
33
+ "libglib2.0-0",
34
+ "libnspr4",
35
+ "libnss3",
36
+ "libpango-1.0-0",
37
+ "libx11-6",
38
+ "libxcb1",
39
+ "libxcomposite1",
40
+ "libxdamage1",
41
+ "libxext6",
42
+ "libxfixes3",
43
+ "libxkbcommon0",
44
+ "libxrandr2",
45
+ ],
46
+ firefox: [
47
+ "libasound2",
48
+ "libatk1.0-0",
49
+ "libcairo-gobject2",
50
+ "libcairo2",
51
+ "libdbus-1-3",
52
+ "libdbus-glib-1-2",
53
+ "libfontconfig1",
54
+ "libfreetype6",
55
+ "libgdk-pixbuf-2.0-0",
56
+ "libglib2.0-0",
57
+ "libgtk-3-0",
58
+ "libharfbuzz0b",
59
+ "libpango-1.0-0",
60
+ "libpangocairo-1.0-0",
61
+ "libx11-6",
62
+ "libx11-xcb1",
63
+ "libxcb-shm0",
64
+ "libxcb1",
65
+ "libxcomposite1",
66
+ "libxcursor1",
67
+ "libxdamage1",
68
+ "libxext6",
69
+ "libxfixes3",
70
+ "libxi6",
71
+ "libxrandr2",
72
+ "libxrender1",
73
+ "libxtst6",
74
+ ],
75
+ webkit: [
76
+ "libsoup-3.0-0",
77
+ "gstreamer1.0-libav",
78
+ "gstreamer1.0-plugins-bad",
79
+ "gstreamer1.0-plugins-base",
80
+ "gstreamer1.0-plugins-good",
81
+ "libatk-bridge2.0-0",
82
+ "libatk1.0-0",
83
+ "libcairo2",
84
+ "libdbus-1-3",
85
+ "libdrm2",
86
+ "libegl1",
87
+ "libenchant-2-2",
88
+ "libepoxy0",
89
+ "libevdev2",
90
+ "libfontconfig1",
91
+ "libfreetype6",
92
+ "libgbm1",
93
+ "libgdk-pixbuf-2.0-0",
94
+ "libgles2",
95
+ "libglib2.0-0",
96
+ "libglx0",
97
+ "libgstreamer-gl1.0-0",
98
+ "libgstreamer-plugins-base1.0-0",
99
+ "libgstreamer1.0-0",
100
+ "libgtk-4-1",
101
+ "libgudev-1.0-0",
102
+ "libharfbuzz-icu0",
103
+ "libharfbuzz0b",
104
+ "libhyphen0",
105
+ "libicu72",
106
+ "libjpeg62-turbo",
107
+ "liblcms2-2",
108
+ "libmanette-0.2-0",
109
+ "libnotify4",
110
+ "libopengl0",
111
+ "libopenjp2-7",
112
+ "libopus0",
113
+ "libpango-1.0-0",
114
+ "libpng16-16",
115
+ "libproxy1v5",
116
+ "libsecret-1-0",
117
+ "libwayland-client0",
118
+ "libwayland-egl1",
119
+ "libwayland-server0",
120
+ "libwebp7",
121
+ "libwebpdemux2",
122
+ "libwoff1",
123
+ "libx11-6",
124
+ "libxcomposite1",
125
+ "libxdamage1",
126
+ "libxkbcommon0",
127
+ "libxml2",
128
+ "libxslt1.1",
129
+ "libatomic1",
130
+ "libevent-2.1-7",
131
+ "libavif15",
132
+ ],
133
+ lib2package: {
134
+ "libavif.so.15": "libavif15",
135
+ "libsoup-3.0.so.0": "libsoup-3.0-0",
136
+ "libasound.so.2": "libasound2",
137
+ "libatk-1.0.so.0": "libatk1.0-0",
138
+ "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0",
139
+ "libatspi.so.0": "libatspi2.0-0",
140
+ "libcairo.so.2": "libcairo2",
141
+ "libcups.so.2": "libcups2",
142
+ "libdbus-1.so.3": "libdbus-1-3",
143
+ "libdrm.so.2": "libdrm2",
144
+ "libgbm.so.1": "libgbm1",
145
+ "libgio-2.0.so.0": "libglib2.0-0",
146
+ "libglib-2.0.so.0": "libglib2.0-0",
147
+ "libgobject-2.0.so.0": "libglib2.0-0",
148
+ "libnspr4.so": "libnspr4",
149
+ "libnss3.so": "libnss3",
150
+ "libnssutil3.so": "libnss3",
151
+ "libpango-1.0.so.0": "libpango-1.0-0",
152
+ "libsmime3.so": "libnss3",
153
+ "libX11.so.6": "libx11-6",
154
+ "libxcb.so.1": "libxcb1",
155
+ "libXcomposite.so.1": "libxcomposite1",
156
+ "libXdamage.so.1": "libxdamage1",
157
+ "libXext.so.6": "libxext6",
158
+ "libXfixes.so.3": "libxfixes3",
159
+ "libxkbcommon.so.0": "libxkbcommon0",
160
+ "libXrandr.so.2": "libxrandr2",
161
+ "libgtk-4.so.1": "libgtk-4-1",
162
+ },
163
+ };
164
+ /**
165
+ * Installs Playwright browsers and dependencies for your Trigger.dev deployments.
166
+ *
167
+ * @param options - Configuration options for the Playwright extension.
168
+ * @param options.browsers Browsers to install. Accepts an array of strings. Default: `["chromium"]`
169
+ * @param options.headless Whether to run browsers in headless mode. Default: `true`
170
+ * @param options.version Playwright version to use for browser installation. When not set, will automatically detect the version (recommended). Default: `undefined`
171
+ *
172
+ */
173
+ function playwright(options = {}) {
174
+ return new PlaywrightExtension(options);
175
+ }
176
+ /**
177
+ * Background:
178
+ *
179
+ * Running `npx playwright install --with-deps` normally will install the browsers and the dependencies.
180
+ * However, this is not possible in a build context, because we don't have sudo access.
181
+ *
182
+ * So we need to install the dependencies manually and then download and install the browsers.
183
+ * This has a few challenges:
184
+ * 1. We don't want to download all browsers, only the ones we need with it's dependencies
185
+ * The less dependencies we have to install, the faster the build, and the smaller the image.
186
+ * 2. We need to know where to download the browsers from
187
+ * while we can hardcode the download url it might change over time (as it has in the past)
188
+ * so we need to download the browser info first and then parse the output to get the download url.
189
+ *
190
+ * Note: While this looks like we are downloading & installing a lot of stuff, it's actually not that bad
191
+ * since running `npx playwright install --with-deps` will result in the same amount of downloads.
192
+ */
193
+ class PlaywrightExtension {
194
+ name = "PlaywrightExtension";
195
+ moduleExternals;
196
+ options;
197
+ constructor({ browsers = ["chromium"], headless = true, version, } = {}) {
198
+ if (browsers && browsers.length === 0) {
199
+ throw new Error("At least one browser must be specified");
200
+ }
201
+ this.options = { browsers, headless, version };
202
+ this.moduleExternals = ["playwright"];
203
+ }
204
+ externalsForTarget(target) {
205
+ if (target === "dev") {
206
+ return [];
207
+ }
208
+ return this.moduleExternals;
209
+ }
210
+ onBuildComplete(context, manifest) {
211
+ if (context.target === "dev")
212
+ return;
213
+ // Detect Playwright version from manifest.externals or use override
214
+ const playwrightExternal = manifest.externals?.find((external) => external.name === "playwright" || external.name === "@playwright/test");
215
+ const version = playwrightExternal?.version ?? this.options.version;
216
+ if (!version) {
217
+ throw new Error("PlaywrightExtension could not determine the version of playwright. Please provide a version in the PlaywrightExtension options.");
218
+ }
219
+ context.logger.debug(`Adding ${this.name} to the build with browsers: ${this.options.browsers.join(", ")}, version: ${version}`);
220
+ const instructions = [
221
+ // Base dependencies, we need these to download the browsers
222
+ `RUN apt-get update && apt-get install -y --no-install-recommends \
223
+ curl \
224
+ unzip \
225
+ jq \
226
+ grep \
227
+ sed \
228
+ npm \
229
+ && apt-get clean && rm -rf /var/lib/apt/lists/*`,
230
+ // Install Playwright globally with detected version
231
+ `RUN npm install -g playwright@${version}`,
232
+ ];
233
+ const deps = [...debian12Deps.tools, ...Object.values(debian12Deps.lib2package)];
234
+ if (this.options.browsers.includes("chromium"))
235
+ deps.push(...debian12Deps.chromium);
236
+ if (this.options.browsers.includes("firefox"))
237
+ deps.push(...debian12Deps.firefox);
238
+ if (this.options.browsers.includes("webkit"))
239
+ deps.push(...debian12Deps.webkit);
240
+ instructions.push(`RUN apt-get update && apt-get install -y --no-install-recommends ${deps.join(" ")} \
241
+ && apt-get clean && rm -rf /var/lib/apt/lists/*`);
242
+ // Setup directory for playwright browsers
243
+ instructions.push(`RUN mkdir -p /ms-playwright`);
244
+ /**
245
+ * `npx playwright install --dry-run` prints the download urls for the browsers.
246
+ * We save this output to a file and then parse it to get the download urls for the browsers.
247
+ */
248
+ instructions.push(`RUN npx playwright install --dry-run > /tmp/browser-info.txt`);
249
+ this.options.browsers.forEach((browser) => {
250
+ const browserType = browser === "chromium" ? "chromium-headless-shell" : browser;
251
+ instructions.push(`RUN grep -A5 "browser: ${browserType}" /tmp/browser-info.txt > /tmp/${browser}-info.txt`, `RUN INSTALL_DIR=$(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs) && \
252
+ DIR_NAME=$(basename "$INSTALL_DIR") && \
253
+ if [ -z "$DIR_NAME" ]; then echo "Failed to extract installation directory for ${browser}"; exit 1; fi && \
254
+ MS_DIR="/ms-playwright/$DIR_NAME" && \
255
+ mkdir -p "$MS_DIR"`, `RUN DOWNLOAD_URL=$(grep "Download url:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs | sed "s/mac-arm64/linux/g" | sed "s/mac-15-arm64/ubuntu-20.04/g") && \
256
+ if [ -z "$DOWNLOAD_URL" ]; then echo "Failed to extract download URL for ${browser}"; exit 1; fi && \
257
+ echo "Downloading ${browser} from $DOWNLOAD_URL" && \
258
+ curl -L -o /tmp/${browser}.zip "$DOWNLOAD_URL" && \
259
+ if [ $? -ne 0 ]; then echo "Failed to download ${browser}"; exit 1; fi && \
260
+ unzip -q /tmp/${browser}.zip -d "/ms-playwright/$(basename $(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs))" && \
261
+ if [ $? -ne 0 ]; then echo "Failed to extract ${browser}"; exit 1; fi && \
262
+ chmod -R +x "/ms-playwright/$(basename $(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs))" && \
263
+ rm /tmp/${browser}.zip`);
264
+ });
265
+ // Environment variables
266
+ const envVars = {
267
+ PLAYWRIGHT_BROWSERS_PATH: "/ms-playwright", // where playwright will find the browsers
268
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1", // we already downloaded the browsers
269
+ PLAYWRIGHT_SKIP_BROWSER_VALIDATION: "1", // we already downloaded the browsers
270
+ };
271
+ if (!this.options.headless) {
272
+ instructions.push(`RUN echo '#!/bin/sh' > /usr/local/bin/xvfb-exec`, `RUN echo 'Xvfb :99 -screen 0 1024x768x24 &' >> /usr/local/bin/xvfb-exec`, `RUN echo 'exec "$@"' >> /usr/local/bin/xvfb-exec`, `RUN chmod +x /usr/local/bin/xvfb-exec`);
273
+ envVars.DISPLAY = ":99"; // Virtual display for the browsers
274
+ }
275
+ context.addLayer({
276
+ id: "playwright",
277
+ image: {
278
+ instructions,
279
+ },
280
+ deploy: {
281
+ env: envVars,
282
+ override: true,
283
+ },
284
+ dependencies: {
285
+ playwright: version,
286
+ },
287
+ });
288
+ }
289
+ }
290
+ //# sourceMappingURL=playwright.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright.js","sourceRoot":"","sources":["../../../src/extensions/playwright.ts"],"names":[],"mappings":";;AAkMA,gCAEC;AA5KD;;;;GAIG;AACH,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE;QACL,MAAM;QACN,wBAAwB;QACxB,eAAe;QACf,gBAAgB;QAChB,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,sBAAsB;QACtB,kBAAkB;QAClB,qBAAqB;QACrB,oBAAoB;KACrB;IACD,QAAQ,EAAE;QACR,YAAY;QACZ,oBAAoB;QACpB,aAAa;QACb,eAAe;QACf,WAAW;QACX,UAAU;QACV,aAAa;QACb,SAAS;QACT,SAAS;QACT,cAAc;QACd,UAAU;QACV,SAAS;QACT,gBAAgB;QAChB,UAAU;QACV,SAAS;QACT,gBAAgB;QAChB,aAAa;QACb,UAAU;QACV,YAAY;QACZ,eAAe;QACf,YAAY;KACb;IACD,OAAO,EAAE;QACP,YAAY;QACZ,aAAa;QACb,mBAAmB;QACnB,WAAW;QACX,aAAa;QACb,kBAAkB;QAClB,gBAAgB;QAChB,cAAc;QACd,qBAAqB;QACrB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,gBAAgB;QAChB,qBAAqB;QACrB,UAAU;QACV,aAAa;QACb,aAAa;QACb,SAAS;QACT,gBAAgB;QAChB,aAAa;QACb,aAAa;QACb,UAAU;QACV,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,UAAU;KACX;IACD,MAAM,EAAE;QACN,eAAe;QACf,oBAAo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exports.VERSION = void 0;
4
- exports.VERSION = "4.0.0-v4-beta.14";
4
+ exports.VERSION = "4.0.0-v4-beta.16";
5
5
  //# sourceMappingURL=version.js.map
@@ -1,10 +1,21 @@
1
1
  import { BuildExtension } from "@trigger.dev/core/v3/build";
2
2
  export type FfmpegOptions = {
3
+ /**
4
+ * The version of ffmpeg to install. If not provided, the latest version from apt will be installed.
5
+ * If set to '7' or starts with '7.', a static build of ffmpeg 7.x from johnvansickle.com will be used instead of apt.
6
+ * @example
7
+ * ffmpeg() // Installs latest ffmpeg from apt
8
+ * ffmpeg({ version: '7' }) // Installs static build of ffmpeg 7.x
9
+ * ffmpeg({ version: '7.0.1' }) // Installs static build of ffmpeg 7.x
10
+ * ffmpeg({ version: '6' }) // Version ignored, installs latest ffmpeg from apt
11
+ * ffmpeg({ version: '8' }) // Version ignored, installs latest ffmpeg from apt
12
+ */
3
13
  version?: string;
4
14
  };
5
15
  /**
6
16
  * Add ffmpeg to the build, and automatically set the FFMPEG_PATH and FFPROBE_PATH environment variables.
7
- * @param options.version The version of ffmpeg to install. If not provided, the latest version will be installed.
17
+ * @param options.version The version of ffmpeg to install. If not provided, the latest version from apt will be installed.
18
+ * If set to '7' or starts with '7.', a static build of ffmpeg 7.x from johnvansickle.com will be used instead of apt.
8
19
  *
9
20
  * @returns The build extension.
10
21
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Add ffmpeg to the build, and automatically set the FFMPEG_PATH and FFPROBE_PATH environment variables.
3
- * @param options.version The version of ffmpeg to install. If not provided, the latest version will be installed.
3
+ * @param options.version The version of ffmpeg to install. If not provided, the latest version from apt will be installed.
4
+ * If set to '7' or starts with '7.', a static build of ffmpeg 7.x from johnvansickle.com will be used instead of apt.
4
5
  *
5
6
  * @returns The build extension.
6
7
  */
@@ -14,10 +15,41 @@ export function ffmpeg(options = {}) {
14
15
  context.logger.debug("Adding ffmpeg", {
15
16
  options,
16
17
  });
18
+ // Use static build for version 7 or 7.x
19
+ if (options.version === "7" || options.version?.startsWith("7.")) {
20
+ context.addLayer({
21
+ id: "ffmpeg",
22
+ image: {
23
+ instructions: [
24
+ // Install ffmpeg after checksum validation
25
+ "RUN apt-get update && apt-get install -y --no-install-recommends wget xz-utils nscd ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists/* && " +
26
+ "wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5 && " +
27
+ "wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz && " +
28
+ "md5sum -c ffmpeg-git-amd64-static.tar.xz.md5 && " +
29
+ "tar xvf ffmpeg-git-amd64-static.tar.xz -C /usr/bin --strip-components=1 --no-anchored 'ffmpeg' 'ffprobe' && " +
30
+ "rm ffmpeg-git-amd64-static.tar.xz*",
31
+ ],
32
+ },
33
+ deploy: {
34
+ env: {
35
+ FFMPEG_PATH: "/usr/bin/ffmpeg",
36
+ FFPROBE_PATH: "/usr/bin/ffprobe",
37
+ },
38
+ override: true,
39
+ },
40
+ });
41
+ return;
42
+ }
43
+ else if (options.version) {
44
+ context.logger.warn("Custom ffmpeg version not supported, ignoring", {
45
+ version: options.version,
46
+ });
47
+ }
48
+ // Default: use apt
17
49
  context.addLayer({
18
50
  id: "ffmpeg",
19
51
  image: {
20
- pkgs: options.version ? [`ffmpeg=${options.version}`] : ["ffmpeg"],
52
+ pkgs: ["ffmpeg"],
21
53
  },
22
54
  deploy: {
23
55
  env: {
@@ -1 +1 @@
1
- {"version":3,"file":"ffmpeg.js","sourceRoot":"","sources":["../../../../src/extensions/core/ffmpeg.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,UAAyB,EAAE;IAChD,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,eAAe,CAAC,OAAO;YACrB,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;gBAC7B,OAAO;YACT,CAAC;YAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAA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,EAAE,kBAAkB;yBACjC;wBACD,QAAQ,EAAE,IAAI;qBACf;iBACF,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;iBAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,EAAE;oBACnE,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB,CAAC,CAAC;YACL,CAAC;YAED,mBAAmB;YACnB,OAAO,CAAC,QAAQ,CAAC;gBACf,EAAE,EAAE,QAAQ;gBACZ,KAAK,EAAE;oBACL,IAAI,EAAE,CAAC,QAAQ,CAAC;iBACjB;gBACD,MAAM,EAAE;oBACN,GAAG,EAAE;wBACH,WAAW,EAAE,iBAAiB;wBAC9B,YAAY,EAAE,kBAAkB;qBACjC;oBACD,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { BuildContext, BuildExtension } from "@trigger.dev/core/v3/build";
2
+ import type { BuildManifest, BuildTarget } from "@trigger.dev/core/v3";
3
+ type PlaywrightBrowser = "chromium" | "firefox" | "webkit";
4
+ interface PlaywrightExtensionOptions {
5
+ /**
6
+ * Browsers to install. Select only needed browsers to optimize build time and size.
7
+ * @default ["chromium"]
8
+ */
9
+ browsers?: PlaywrightBrowser[];
10
+ /**
11
+ * Run the browsers in headless mode (Recommended)
12
+ * @default true
13
+ */
14
+ headless?: boolean;
15
+ /**
16
+ * Playwright version override. If not provided, we will try to detect the version automatically.
17
+ */
18
+ version?: string;
19
+ }
20
+ /**
21
+ * Installs Playwright browsers and dependencies for your Trigger.dev deployments.
22
+ *
23
+ * @param options - Configuration options for the Playwright extension.
24
+ * @param options.browsers Browsers to install. Accepts an array of strings. Default: `["chromium"]`
25
+ * @param options.headless Whether to run browsers in headless mode. Default: `true`
26
+ * @param options.version Playwright version to use for browser installation. When not set, will automatically detect the version (recommended). Default: `undefined`
27
+ *
28
+ */
29
+ export declare function playwright(options?: PlaywrightExtensionOptions): PlaywrightExtension;
30
+ /**
31
+ * Background:
32
+ *
33
+ * Running `npx playwright install --with-deps` normally will install the browsers and the dependencies.
34
+ * However, this is not possible in a build context, because we don't have sudo access.
35
+ *
36
+ * So we need to install the dependencies manually and then download and install the browsers.
37
+ * This has a few challenges:
38
+ * 1. We don't want to download all browsers, only the ones we need with it's dependencies
39
+ * The less dependencies we have to install, the faster the build, and the smaller the image.
40
+ * 2. We need to know where to download the browsers from
41
+ * while we can hardcode the download url it might change over time (as it has in the past)
42
+ * so we need to download the browser info first and then parse the output to get the download url.
43
+ *
44
+ * Note: While this looks like we are downloading & installing a lot of stuff, it's actually not that bad
45
+ * since running `npx playwright install --with-deps` will result in the same amount of downloads.
46
+ */
47
+ declare class PlaywrightExtension implements BuildExtension {
48
+ readonly name = "PlaywrightExtension";
49
+ private moduleExternals;
50
+ private readonly options;
51
+ constructor({ browsers, headless, version, }?: PlaywrightExtensionOptions);
52
+ externalsForTarget(target: BuildTarget): string[];
53
+ onBuildComplete(context: BuildContext, manifest: BuildManifest): void;
54
+ }
55
+ export {};
@@ -0,0 +1,287 @@
1
+ /**
2
+ * This list is from the official playwright registry.
3
+ *
4
+ * @see https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/registry/nativeDeps.ts
5
+ */
6
+ const debian12Deps = {
7
+ tools: [
8
+ "xvfb",
9
+ "fonts-noto-color-emoji",
10
+ "fonts-unifont",
11
+ "libfontconfig1",
12
+ "libfreetype6",
13
+ "xfonts-scalable",
14
+ "fonts-liberation",
15
+ "fonts-ipafont-gothic",
16
+ "fonts-wqy-zenhei",
17
+ "fonts-tlwg-loma-otf",
18
+ "fonts-freefont-ttf",
19
+ ],
20
+ chromium: [
21
+ "libasound2",
22
+ "libatk-bridge2.0-0",
23
+ "libatk1.0-0",
24
+ "libatspi2.0-0",
25
+ "libcairo2",
26
+ "libcups2",
27
+ "libdbus-1-3",
28
+ "libdrm2",
29
+ "libgbm1",
30
+ "libglib2.0-0",
31
+ "libnspr4",
32
+ "libnss3",
33
+ "libpango-1.0-0",
34
+ "libx11-6",
35
+ "libxcb1",
36
+ "libxcomposite1",
37
+ "libxdamage1",
38
+ "libxext6",
39
+ "libxfixes3",
40
+ "libxkbcommon0",
41
+ "libxrandr2",
42
+ ],
43
+ firefox: [
44
+ "libasound2",
45
+ "libatk1.0-0",
46
+ "libcairo-gobject2",
47
+ "libcairo2",
48
+ "libdbus-1-3",
49
+ "libdbus-glib-1-2",
50
+ "libfontconfig1",
51
+ "libfreetype6",
52
+ "libgdk-pixbuf-2.0-0",
53
+ "libglib2.0-0",
54
+ "libgtk-3-0",
55
+ "libharfbuzz0b",
56
+ "libpango-1.0-0",
57
+ "libpangocairo-1.0-0",
58
+ "libx11-6",
59
+ "libx11-xcb1",
60
+ "libxcb-shm0",
61
+ "libxcb1",
62
+ "libxcomposite1",
63
+ "libxcursor1",
64
+ "libxdamage1",
65
+ "libxext6",
66
+ "libxfixes3",
67
+ "libxi6",
68
+ "libxrandr2",
69
+ "libxrender1",
70
+ "libxtst6",
71
+ ],
72
+ webkit: [
73
+ "libsoup-3.0-0",
74
+ "gstreamer1.0-libav",
75
+ "gstreamer1.0-plugins-bad",
76
+ "gstreamer1.0-plugins-base",
77
+ "gstreamer1.0-plugins-good",
78
+ "libatk-bridge2.0-0",
79
+ "libatk1.0-0",
80
+ "libcairo2",
81
+ "libdbus-1-3",
82
+ "libdrm2",
83
+ "libegl1",
84
+ "libenchant-2-2",
85
+ "libepoxy0",
86
+ "libevdev2",
87
+ "libfontconfig1",
88
+ "libfreetype6",
89
+ "libgbm1",
90
+ "libgdk-pixbuf-2.0-0",
91
+ "libgles2",
92
+ "libglib2.0-0",
93
+ "libglx0",
94
+ "libgstreamer-gl1.0-0",
95
+ "libgstreamer-plugins-base1.0-0",
96
+ "libgstreamer1.0-0",
97
+ "libgtk-4-1",
98
+ "libgudev-1.0-0",
99
+ "libharfbuzz-icu0",
100
+ "libharfbuzz0b",
101
+ "libhyphen0",
102
+ "libicu72",
103
+ "libjpeg62-turbo",
104
+ "liblcms2-2",
105
+ "libmanette-0.2-0",
106
+ "libnotify4",
107
+ "libopengl0",
108
+ "libopenjp2-7",
109
+ "libopus0",
110
+ "libpango-1.0-0",
111
+ "libpng16-16",
112
+ "libproxy1v5",
113
+ "libsecret-1-0",
114
+ "libwayland-client0",
115
+ "libwayland-egl1",
116
+ "libwayland-server0",
117
+ "libwebp7",
118
+ "libwebpdemux2",
119
+ "libwoff1",
120
+ "libx11-6",
121
+ "libxcomposite1",
122
+ "libxdamage1",
123
+ "libxkbcommon0",
124
+ "libxml2",
125
+ "libxslt1.1",
126
+ "libatomic1",
127
+ "libevent-2.1-7",
128
+ "libavif15",
129
+ ],
130
+ lib2package: {
131
+ "libavif.so.15": "libavif15",
132
+ "libsoup-3.0.so.0": "libsoup-3.0-0",
133
+ "libasound.so.2": "libasound2",
134
+ "libatk-1.0.so.0": "libatk1.0-0",
135
+ "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0",
136
+ "libatspi.so.0": "libatspi2.0-0",
137
+ "libcairo.so.2": "libcairo2",
138
+ "libcups.so.2": "libcups2",
139
+ "libdbus-1.so.3": "libdbus-1-3",
140
+ "libdrm.so.2": "libdrm2",
141
+ "libgbm.so.1": "libgbm1",
142
+ "libgio-2.0.so.0": "libglib2.0-0",
143
+ "libglib-2.0.so.0": "libglib2.0-0",
144
+ "libgobject-2.0.so.0": "libglib2.0-0",
145
+ "libnspr4.so": "libnspr4",
146
+ "libnss3.so": "libnss3",
147
+ "libnssutil3.so": "libnss3",
148
+ "libpango-1.0.so.0": "libpango-1.0-0",
149
+ "libsmime3.so": "libnss3",
150
+ "libX11.so.6": "libx11-6",
151
+ "libxcb.so.1": "libxcb1",
152
+ "libXcomposite.so.1": "libxcomposite1",
153
+ "libXdamage.so.1": "libxdamage1",
154
+ "libXext.so.6": "libxext6",
155
+ "libXfixes.so.3": "libxfixes3",
156
+ "libxkbcommon.so.0": "libxkbcommon0",
157
+ "libXrandr.so.2": "libxrandr2",
158
+ "libgtk-4.so.1": "libgtk-4-1",
159
+ },
160
+ };
161
+ /**
162
+ * Installs Playwright browsers and dependencies for your Trigger.dev deployments.
163
+ *
164
+ * @param options - Configuration options for the Playwright extension.
165
+ * @param options.browsers Browsers to install. Accepts an array of strings. Default: `["chromium"]`
166
+ * @param options.headless Whether to run browsers in headless mode. Default: `true`
167
+ * @param options.version Playwright version to use for browser installation. When not set, will automatically detect the version (recommended). Default: `undefined`
168
+ *
169
+ */
170
+ export function playwright(options = {}) {
171
+ return new PlaywrightExtension(options);
172
+ }
173
+ /**
174
+ * Background:
175
+ *
176
+ * Running `npx playwright install --with-deps` normally will install the browsers and the dependencies.
177
+ * However, this is not possible in a build context, because we don't have sudo access.
178
+ *
179
+ * So we need to install the dependencies manually and then download and install the browsers.
180
+ * This has a few challenges:
181
+ * 1. We don't want to download all browsers, only the ones we need with it's dependencies
182
+ * The less dependencies we have to install, the faster the build, and the smaller the image.
183
+ * 2. We need to know where to download the browsers from
184
+ * while we can hardcode the download url it might change over time (as it has in the past)
185
+ * so we need to download the browser info first and then parse the output to get the download url.
186
+ *
187
+ * Note: While this looks like we are downloading & installing a lot of stuff, it's actually not that bad
188
+ * since running `npx playwright install --with-deps` will result in the same amount of downloads.
189
+ */
190
+ class PlaywrightExtension {
191
+ name = "PlaywrightExtension";
192
+ moduleExternals;
193
+ options;
194
+ constructor({ browsers = ["chromium"], headless = true, version, } = {}) {
195
+ if (browsers && browsers.length === 0) {
196
+ throw new Error("At least one browser must be specified");
197
+ }
198
+ this.options = { browsers, headless, version };
199
+ this.moduleExternals = ["playwright"];
200
+ }
201
+ externalsForTarget(target) {
202
+ if (target === "dev") {
203
+ return [];
204
+ }
205
+ return this.moduleExternals;
206
+ }
207
+ onBuildComplete(context, manifest) {
208
+ if (context.target === "dev")
209
+ return;
210
+ // Detect Playwright version from manifest.externals or use override
211
+ const playwrightExternal = manifest.externals?.find((external) => external.name === "playwright" || external.name === "@playwright/test");
212
+ const version = playwrightExternal?.version ?? this.options.version;
213
+ if (!version) {
214
+ throw new Error("PlaywrightExtension could not determine the version of playwright. Please provide a version in the PlaywrightExtension options.");
215
+ }
216
+ context.logger.debug(`Adding ${this.name} to the build with browsers: ${this.options.browsers.join(", ")}, version: ${version}`);
217
+ const instructions = [
218
+ // Base dependencies, we need these to download the browsers
219
+ `RUN apt-get update && apt-get install -y --no-install-recommends \
220
+ curl \
221
+ unzip \
222
+ jq \
223
+ grep \
224
+ sed \
225
+ npm \
226
+ && apt-get clean && rm -rf /var/lib/apt/lists/*`,
227
+ // Install Playwright globally with detected version
228
+ `RUN npm install -g playwright@${version}`,
229
+ ];
230
+ const deps = [...debian12Deps.tools, ...Object.values(debian12Deps.lib2package)];
231
+ if (this.options.browsers.includes("chromium"))
232
+ deps.push(...debian12Deps.chromium);
233
+ if (this.options.browsers.includes("firefox"))
234
+ deps.push(...debian12Deps.firefox);
235
+ if (this.options.browsers.includes("webkit"))
236
+ deps.push(...debian12Deps.webkit);
237
+ instructions.push(`RUN apt-get update && apt-get install -y --no-install-recommends ${deps.join(" ")} \
238
+ && apt-get clean && rm -rf /var/lib/apt/lists/*`);
239
+ // Setup directory for playwright browsers
240
+ instructions.push(`RUN mkdir -p /ms-playwright`);
241
+ /**
242
+ * `npx playwright install --dry-run` prints the download urls for the browsers.
243
+ * We save this output to a file and then parse it to get the download urls for the browsers.
244
+ */
245
+ instructions.push(`RUN npx playwright install --dry-run > /tmp/browser-info.txt`);
246
+ this.options.browsers.forEach((browser) => {
247
+ const browserType = browser === "chromium" ? "chromium-headless-shell" : browser;
248
+ instructions.push(`RUN grep -A5 "browser: ${browserType}" /tmp/browser-info.txt > /tmp/${browser}-info.txt`, `RUN INSTALL_DIR=$(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs) && \
249
+ DIR_NAME=$(basename "$INSTALL_DIR") && \
250
+ if [ -z "$DIR_NAME" ]; then echo "Failed to extract installation directory for ${browser}"; exit 1; fi && \
251
+ MS_DIR="/ms-playwright/$DIR_NAME" && \
252
+ mkdir -p "$MS_DIR"`, `RUN DOWNLOAD_URL=$(grep "Download url:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs | sed "s/mac-arm64/linux/g" | sed "s/mac-15-arm64/ubuntu-20.04/g") && \
253
+ if [ -z "$DOWNLOAD_URL" ]; then echo "Failed to extract download URL for ${browser}"; exit 1; fi && \
254
+ echo "Downloading ${browser} from $DOWNLOAD_URL" && \
255
+ curl -L -o /tmp/${browser}.zip "$DOWNLOAD_URL" && \
256
+ if [ $? -ne 0 ]; then echo "Failed to download ${browser}"; exit 1; fi && \
257
+ unzip -q /tmp/${browser}.zip -d "/ms-playwright/$(basename $(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs))" && \
258
+ if [ $? -ne 0 ]; then echo "Failed to extract ${browser}"; exit 1; fi && \
259
+ chmod -R +x "/ms-playwright/$(basename $(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs))" && \
260
+ rm /tmp/${browser}.zip`);
261
+ });
262
+ // Environment variables
263
+ const envVars = {
264
+ PLAYWRIGHT_BROWSERS_PATH: "/ms-playwright", // where playwright will find the browsers
265
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1", // we already downloaded the browsers
266
+ PLAYWRIGHT_SKIP_BROWSER_VALIDATION: "1", // we already downloaded the browsers
267
+ };
268
+ if (!this.options.headless) {
269
+ instructions.push(`RUN echo '#!/bin/sh' > /usr/local/bin/xvfb-exec`, `RUN echo 'Xvfb :99 -screen 0 1024x768x24 &' >> /usr/local/bin/xvfb-exec`, `RUN echo 'exec "$@"' >> /usr/local/bin/xvfb-exec`, `RUN chmod +x /usr/local/bin/xvfb-exec`);
270
+ envVars.DISPLAY = ":99"; // Virtual display for the browsers
271
+ }
272
+ context.addLayer({
273
+ id: "playwright",
274
+ image: {
275
+ instructions,
276
+ },
277
+ deploy: {
278
+ env: envVars,
279
+ override: true,
280
+ },
281
+ dependencies: {
282
+ playwright: version,
283
+ },
284
+ });
285
+ }
286
+ }
287
+ //# sourceMappingURL=playwright.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright.js","sourceRoot":"","sources":["../../../src/extensions/playwright.ts"],"names":[],"mappings":"AAwBA;;;;GAIG;AACH,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE;QACL,MAAM;QACN,wBAAwB;QACxB,eAAe;QACf,gBAAgB;QAChB,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,sBAAsB;QACtB,kBAAkB;QAClB,qBAAqB;QACrB,oBAAoB;KACrB;IACD,QAAQ,EAAE;QACR,YAAY;QACZ,oBAAoB;QACpB,aAAa;QACb,eAAe;QACf,WAAW;QACX,UAAU;QACV,aAAa;QACb,SAAS;QACT,SAAS;QACT,cAAc;QACd,UAAU;QACV,SAAS;QACT,gBAAgB;QAChB,UAAU;QACV,SAAS;QACT,gBAAgB;QAChB,aAAa;QACb,UAAU;QACV,YAAY;QACZ,eAAe;QACf,YAAY;KACb;IACD,OAAO,EAAE;QACP,YAAY;QACZ,aAAa;QACb,mBAAmB;QACnB,WAAW;QACX,aAAa;QACb,kBAAkB;QAClB,gBAAgB;QAChB,cAAc;QACd,qBAAqB;QACrB,cAAc;QACd,YAAY;QACZ,eAAe;QACf,gBAAgB;QAChB,qBAAqB;QACrB,UAAU;QACV,aAAa;QACb,aAAa;QACb,SAAS;QACT,gBAAgB;QAChB,aAAa;QACb,aAAa;QACb,UAAU;QACV,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,UAAU;KACX;IACD,MAAM,EAAE;QACN,eAAe;QACf,oBAAoB;QACpB,0BAA0B;QAC1B,2BAA2B;QAC3B,2BAA2B;QAC3B,oBAAoB;QACpB,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,SAAS;QACT,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,gBAAgB;QAChB,cAAc;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AC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC;YACjF,YAAY,CAAC,IAAI,CACf,0BAA0B,WAAW,kCAAkC,OAAO,WAAW,EAEzF,mDAAmD,OAAO;;2FAEyB,OAAO;;6BAErE,EAErB,gDAAgD,OAAO;qFACsB,OAAO;8BAC9D,OAAO;4BACT,OAAO;2DACwB,OAAO;0BACxC,OAAO,sEAAsE,OAAO;0DACpD,OAAO;mFACkB,OAAO;oBACtE,OAAO,MAAM,CAC1B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,wBAAwB;QACxB,MAAM,OAAO,GAA2B;YACtC,wBAAwB,EAAE,gBAAgB,EAAE,0CAA0C;YACtF,gCAAgC,EAAE,GAAG,EAAE,qCAAqC;YAC5E,kCAAkC,EAAE,GAAG,EAAE,qCAAqC;SAC/E,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC3B,YAAY,CAAC,IAAI,CACf,iDAAiD,EACjD,yEAAyE,EACzE,kDAAkD,EAClD,uCAAuC,CACxC,CAAC;YAEF,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,mCAAmC;QAC9D,CAAC;QAED,OAAO,CAAC,QAAQ,CAAC;YACf,EAAE,EAAE,YAAY;YAChB,KAAK,EAAE;gBACL,YAAY;aACb;YACD,MAAM,EAAE;gBACN,GAAG,EAAE,OAAO;gBACZ,QAAQ,EAAE,IAAI;aACf;YACD,YAAY,EAAE;gBACZ,UAAU,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- export const VERSION = "4.0.0-v4-beta.14";
1
+ export const VERSION = "4.0.0-v4-beta.16";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/build",
3
- "version": "4.0.0-v4-beta.14",
3
+ "version": "4.0.0-v4-beta.16",
4
4
  "description": "trigger.dev build extensions",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -29,7 +29,8 @@
29
29
  "./extensions/prisma": "./src/extensions/prisma.ts",
30
30
  "./extensions/audioWaveform": "./src/extensions/audioWaveform.ts",
31
31
  "./extensions/typescript": "./src/extensions/typescript.ts",
32
- "./extensions/puppeteer": "./src/extensions/puppeteer.ts"
32
+ "./extensions/puppeteer": "./src/extensions/puppeteer.ts",
33
+ "./extensions/playwright": "./src/extensions/playwright.ts"
33
34
  },
34
35
  "sourceDialects": [
35
36
  "@triggerdotdev/source"
@@ -57,11 +58,14 @@
57
58
  ],
58
59
  "extensions/puppeteer": [
59
60
  "dist/commonjs/extensions/puppeteer.d.ts"
61
+ ],
62
+ "extensions/playwright": [
63
+ "dist/commonjs/extensions/playwright.d.ts"
60
64
  ]
61
65
  }
62
66
  },
63
67
  "dependencies": {
64
- "@trigger.dev/core": "4.0.0-v4-beta.14",
68
+ "@trigger.dev/core": "4.0.0-v4-beta.16",
65
69
  "pkg-types": "^1.1.3",
66
70
  "tinyglobby": "^0.2.2",
67
71
  "tsconfck": "3.1.3"
@@ -165,6 +169,17 @@
165
169
  "types": "./dist/commonjs/extensions/puppeteer.d.ts",
166
170
  "default": "./dist/commonjs/extensions/puppeteer.js"
167
171
  }
172
+ },
173
+ "./extensions/playwright": {
174
+ "import": {
175
+ "@triggerdotdev/source": "./src/extensions/playwright.ts",
176
+ "types": "./dist/esm/extensions/playwright.d.ts",
177
+ "default": "./dist/esm/extensions/playwright.js"
178
+ },
179
+ "require": {
180
+ "types": "./dist/commonjs/extensions/playwright.d.ts",
181
+ "default": "./dist/commonjs/extensions/playwright.js"
182
+ }
168
183
  }
169
184
  },
170
185
  "main": "./dist/commonjs/index.js",