Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add libreoffice extension #1420

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"./extensions/prisma": "./src/extensions/prisma.ts",
"./extensions/audioWaveform": "./src/extensions/audioWaveform.ts",
"./extensions/typescript": "./src/extensions/typescript.ts",
"./extensions/puppeteer": "./src/extensions/puppeteer.ts"
"./extensions/puppeteer": "./src/extensions/puppeteer.ts",
"./extensions/libreoffice": "./src/extensions/libreoffice.ts"
},
"sourceDialects": [
"@triggerdotdev/source"
Expand All @@ -53,6 +54,9 @@
],
"extensions/puppeteer": [
"dist/commonjs/extensions/puppeteer.d.ts"
],
"extensions/libreoffice": [
"dist/commonjs/extensions/libreoffice.d.ts"
]
}
},
Expand Down Expand Up @@ -160,6 +164,17 @@
"types": "./dist/commonjs/extensions/puppeteer.d.ts",
"default": "./dist/commonjs/extensions/puppeteer.js"
}
},
"./extensions/libreoffice": {
"import": {
"@triggerdotdev/source": "./src/extensions/libreoffice.ts",
"types": "./dist/esm/extensions/libreoffice.d.ts",
"default": "./dist/esm/extensions/libreoffice.js"
},
"require": {
"types": "./dist/commonjs/extensions/libreoffice.d.ts",
"default": "./dist/commonjs/extensions/libreoffice.js"
}
}
},
"main": "./dist/commonjs/index.js",
Expand Down
32 changes: 32 additions & 0 deletions packages/build/src/extensions/libreoffice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { BuildManifest } from "@trigger.dev/core/v3";
import { BuildContext, BuildExtension } from "@trigger.dev/core/v3/build";

export function libreoffice() {
return new LibreOfficeExtension();
}

class LibreOfficeExtension implements BuildExtension {
public readonly name = "LibreOfficeExtension";

async onBuildComplete(context: BuildContext, manifest: BuildManifest) {
if (context.target === "dev") {
return;
}

context.logger.debug(`Adding ${this.name} to the build`);

const instructions = [
`RUN apt-get update && apt-get install -y \
libreoffice \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*`,
];

context.addLayer({
id: "libreoffice",
image: {
instructions,
},
});
}
}
Loading