chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1 @@
|
||||
nodeLinker: node-modules
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "emit-decorator-metadata",
|
||||
"private": true,
|
||||
"packageManager": "yarn@4.2.2+sha512.c44e283c54e02de9d1da8687025b030078c1b9648d2895a65aab8e64225bfb7becba87e1809fc0b4b6778bbd47a1e2ab6ac647de4c5e383a53a7c17db6c3ff4b",
|
||||
"engines": {
|
||||
"pnpm": "10.33.2",
|
||||
"yarn": "4.2.2"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"@trigger.dev/sdk": "0.0.0-prerelease-20250321122618",
|
||||
"reflect-metadata": "0.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trigger.dev/build": "0.0.0-prerelease-20250321122618",
|
||||
"@types/node": "^22.20.0",
|
||||
"typescript": "5.5.4"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
# https://github.com/pnpm/pnpm/issues/2412
|
||||
packages:
|
||||
- "packages/*"
|
||||
@@ -0,0 +1,56 @@
|
||||
import { task } from "@trigger.dev/sdk/v3";
|
||||
import "reflect-metadata";
|
||||
|
||||
class Point {
|
||||
constructor(
|
||||
public x: number,
|
||||
public y: number
|
||||
) {}
|
||||
}
|
||||
|
||||
class Line {
|
||||
private _start: Point;
|
||||
private _end: Point;
|
||||
|
||||
@validate
|
||||
set start(value: Point) {
|
||||
this._start = value;
|
||||
}
|
||||
|
||||
get start() {
|
||||
return this._start;
|
||||
}
|
||||
|
||||
@validate
|
||||
set end(value: Point) {
|
||||
this._end = value;
|
||||
}
|
||||
|
||||
get end() {
|
||||
return this._end;
|
||||
}
|
||||
}
|
||||
|
||||
function validate<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) {
|
||||
let set = descriptor.set!;
|
||||
|
||||
descriptor.set = function (value: T) {
|
||||
let type = Reflect.getMetadata("design:type", target, propertyKey);
|
||||
|
||||
if (!(value instanceof type)) {
|
||||
throw new TypeError(`Invalid type, got ${typeof value} not ${type.name}.`);
|
||||
}
|
||||
|
||||
set.call(this, value);
|
||||
};
|
||||
}
|
||||
|
||||
export const decoratorsTask = task({
|
||||
id: "decoratorsTask",
|
||||
run: async () => {
|
||||
const line = new Line();
|
||||
line.start = new Point(0, 0);
|
||||
|
||||
console.log("Hello, World!", { line });
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { defineConfig } from "@trigger.dev/sdk/v3";
|
||||
import { emitDecoratorMetadata } from "@trigger.dev/build/extensions/typescript";
|
||||
|
||||
export default defineConfig({
|
||||
project: "<fixture project>",
|
||||
dirs: ["./src/trigger"],
|
||||
build: {
|
||||
extensions: [emitDecoratorMetadata()],
|
||||
},
|
||||
maxDuration: 3600,
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"moduleDetection": "force",
|
||||
"verbatimModuleSyntax": false,
|
||||
"jsx": "react",
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"strictPropertyInitialization": false,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"resolveJsonModule": true,
|
||||
"removeComments": false,
|
||||
"esModuleInterop": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"downlevelIteration": true,
|
||||
"isolatedModules": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"include": ["src/**/*.ts", "trigger.config.ts"],
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"emitDecoratorMetadata": true
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user