Skip to content

v3: new build system fixes #1278

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

Merged
merged 25 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d67cad1
Support custom config file names & paths
ericallam Sep 2, 2024
8adc8a6
Fix entry point paths on windows
ericallam Sep 2, 2024
e7cc5a6
Support custom conditions
ericallam Sep 2, 2024
eb61293
Add changeset
ericallam Sep 2, 2024
4bb5f8f
Fix passing CLI process.env down to the task processes
ericallam Sep 2, 2024
d3c8190
Remove unused import
ericallam Sep 3, 2024
140b3e5
reviving the e2e CLI tests
ericallam Sep 3, 2024
659306b
Another attempt at fixing windows
ericallam Sep 3, 2024
1a04196
yet another windows attempt (yawa)
ericallam Sep 4, 2024
bcb4627
Output index child stdout and stderr (yawa)
ericallam Sep 4, 2024
cf43edf
normalize import paths for windows
ericallam Sep 4, 2024
f840373
Added some logging (yawa)
ericallam Sep 4, 2024
a73cdd0
normalize the loader path as well
ericallam Sep 4, 2024
a601e2f
Added some logging to figure out why the entry points aren’t being fo…
ericallam Sep 4, 2024
6f43f2b
Fix for entry point detection on windows
ericallam Sep 4, 2024
a0907ac
Normalize runner import loader path
ericallam Sep 4, 2024
6dc0149
Normalize import paths in dev and make sure rewritten build manifest …
ericallam Sep 4, 2024
c227180
Various cleanup after windows fixes
ericallam Sep 4, 2024
53c2034
Remove the webapp e2e for now
ericallam Sep 4, 2024
ff2571a
Add node10 type resolution support for subpath exports (still does no…
ericallam Sep 4, 2024
c7a7abf
init using templates again but downloaded from the repo this time
ericallam Sep 5, 2024
2d17d26
Adding init schedule example
ericallam Sep 5, 2024
8884605
Support for js init
ericallam Sep 5, 2024
2eac124
init now working with js
ericallam Sep 5, 2024
41e3edb
Fix issues with links in terminals that don’t support them. Also skip…
ericallam Sep 5, 2024
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
5 changes: 5 additions & 0 deletions .changeset/many-papayas-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

Fix entry point paths on windows
5 changes: 5 additions & 0 deletions .changeset/smart-meals-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

Support custom config file names & paths
6 changes: 6 additions & 0 deletions .changeset/witty-dancers-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"trigger.dev": patch
"@trigger.dev/core": patch
---

Support for custom conditions
72 changes: 5 additions & 67 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ on:
type: string
jobs:
cli-v3:
name: "🧪 CLI v3 tests"
name: "🧪 CLI v3 tests (${{ matrix.os }} - ${{ matrix.package-manager }})"
if: inputs.package == 'cli-v3' || inputs.package == ''
runs-on: buildjet-8vcpu-ubuntu-2204
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [buildjet-8vcpu-ubuntu-2204, windows-latest]
package-manager: ["npm", "pnpm", "yarn"]
steps:
- name: ⬇️ Checkout repo
Expand Down Expand Up @@ -46,71 +47,8 @@ jobs:
run: corepack enable

- name: Run E2E Tests
shell: bash
run: |
PM=${{ matrix.package-manager }} pnpm --filter trigger.dev run test:e2e
webapp:
name: "🧪 Webapp tests"
if: inputs.package == 'webapp' || inputs.package == ''
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- name: 🐳 Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME || vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN || vars.DOCKERHUB_TOKEN }}

- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
LOG=debug PM=${{ matrix.package-manager }} pnpm --filter trigger.dev run test:e2e
- name: ⎔ Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.5
- name: ⎔ Setup node
uses: buildjet/setup-node@v3
with:
node-version: 20.11.1
cache: "pnpm"

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: |
# Setup environment variables
cp ./.env.example ./.env
cp ./references/nextjs-test/.env.example ./references/nextjs-test/.env.local
# Build packages
pnpm run build --filter @references/nextjs-test^...
cd apps/webapp && pnpm run build:server
cd ../..
pnpm --filter @trigger.dev/database generate
pnpm --filter @trigger.dev/otlp-importer generate
# Move trigger-cli bin to correct place
pnpm install --frozen-lockfile
# Execute tests
pnpm run docker
pnpm run db:migrate
pnpm run db:seed
pnpm run test:e2e
# Cleanup
pnpm run docker:stop
- name: Upload Playwright report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
14 changes: 7 additions & 7 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ jobs:
uses: ./.github/workflows/unit-tests.yml
secrets: inherit

e2e:
uses: ./.github/workflows/e2e.yml
with:
package: cli-v3
secrets: inherit

preview-release:
name: Preview Release
needs: [typecheck, units]
needs: [typecheck, units, e2e]
if: |
github.repository == 'triggerdotdev/trigger.dev'
runs-on: buildjet-8vcpu-ubuntu-2204
Expand Down Expand Up @@ -52,9 +58,3 @@ jobs:

- name: ⚡ publish preview release
run: npx pkg-pr-new publish --no-template $(ls -d ./packages/*)

# e2e:
# uses: ./.github/workflows/e2e.yml
# with:
# package: webapp
# secrets: inherit
5 changes: 4 additions & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ jobs:
run: pnpm run generate

- name: 🔎 Type check
run: pnpm run typecheck --filter webapp
run: pnpm run typecheck

- name: 🔎 Check exports
run: pnpm run check-exports
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ apps/**/public/build
/playwright/.cache/

.cosine
.trigger/
.tshy*
.trigger
.tshy*
.yarn
*.tsbuildinfo
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
"cwd": "${workspaceFolder}/references/job-catalog",
"sourceMaps": true
},
{
"type": "node-terminal",
"request": "launch",
"name": "Debug V3 init CLI",
"command": "pnpm exec triggerdev init",
"cwd": "${workspaceFolder}/references/init-shell",
"sourceMaps": true
},
{
"type": "node-terminal",
"request": "launch",
Expand Down Expand Up @@ -76,6 +84,14 @@
"port": 9229,
"restart": true,
"skipFiles": ["<node_internals>/**"]
},
{
"type": "node-terminal",
"request": "launch",
"name": "Debug CLI e2e tests",
"command": "PM=yarn pnpm run test:e2e",
"cwd": "${workspaceFolder}/packages/cli-v3",
"sourceMaps": true
}
]
}
4 changes: 2 additions & 2 deletions docs/guides/new-build-system-preview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ import { defineConfig } from "@trigger.dev/sdk/v3";
export default defineConfig({
project: "<project ref>",
build: {
externals: ["native-module"],
external: ["native-module"],
},
});
```

`externals` is an array of strings, where each string is the name of a dependency that should be made external. Glob expressions are also supported and use the [minimatch](https://github.com/isaacs/minimatch) matcher.
`external` is an array of strings, where each string is the name of a dependency that should be made external. Glob expressions are also supported and use the [minimatch](https://github.com/isaacs/minimatch) matcher.

### `additionalFiles`

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"test": "turbo run test",
"test:dev": "turbo run test:dev",
"start": "turbo run start",
"check-exports": "turbo run check-exports",
"clean": "turbo run clean",
"clean:node_modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"typecheck": "turbo run typecheck",
Expand Down
25 changes: 23 additions & 2 deletions packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,32 @@
"@triggerdotdev/source"
]
},
"typesVersions": {
"*": {
"extensions": [
"dist/commonjs/extensions/index.d.ts"
],
"extensions/core": [
"dist/commonjs/extensions/core.d.ts"
],
"extensions/prisma": [
"dist/commonjs/extensions/prisma.d.ts"
],
"extensions/audioWaveform": [
"dist/commonjs/extensions/audioWaveform.d.ts"
],
"extensions/typescript": [
"dist/commonjs/extensions/typescript.d.ts"
]
}
},
"scripts": {
"clean": "rimraf dist",
"build": "tshy && pnpm run update-version",
"dev": "tshy --watch",
"typecheck": "tsc --noEmit -p tsconfig.src.json",
"update-version": "tsx ../../scripts/updateVersion.ts"
"update-version": "tsx ../../scripts/updateVersion.ts",
"check-exports": "attw --pack ."
},
"dependencies": {
"@trigger.dev/core": "workspace:3.0.0-beta.56",
Expand All @@ -51,7 +71,8 @@
"tshy": "^3.0.2",
"typescript": "^5.5.4",
"tsx": "4.17.0",
"esbuild": "^0.23.0"
"esbuild": "^0.23.0",
"@arethetypeswrong/cli": "^0.15.4"
},
"engines": {
"node": ">=18.20.0"
Expand Down
1 change: 1 addition & 0 deletions packages/build/tsconfig.src.tsbuildinfo

Large diffs are not rendered by default.

Loading
Loading