Skip to content

Commit e1dd635

Browse files
committed
Fixed a bunch more schema stuff
1 parent 1b4d0e1 commit e1dd635

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

packages/cli-v3/src/entryPoints/dev-index-worker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,12 @@ async function convertSchemasToJsonSchemas(tasks: TaskManifest[]): Promise<TaskM
199199
const schema = resourceCatalog.getTaskSchema(task.id);
200200

201201
if (schema) {
202-
const result = schemaToJsonSchema(schema);
203-
return { ...task, payloadSchema: result?.jsonSchema };
202+
try {
203+
const result = schemaToJsonSchema(schema);
204+
return { ...task, payloadSchema: result?.jsonSchema };
205+
} catch {
206+
return task;
207+
}
204208
}
205209

206210
return task;

packages/cli-v3/src/entryPoints/managed-index-worker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,12 @@ async function convertSchemasToJsonSchemas(tasks: TaskManifest[]): Promise<TaskM
205205
const schema = resourceCatalog.getTaskSchema(task.id);
206206

207207
if (schema) {
208-
const result = schemaToJsonSchema(schema);
209-
return { ...task, payloadSchema: result?.jsonSchema };
208+
try {
209+
const result = schemaToJsonSchema(schema);
210+
return { ...task, payloadSchema: result?.jsonSchema };
211+
} catch {
212+
return task;
213+
}
210214
}
211215

212216
return task;

packages/schema-to-json/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
}
3232
},
3333
"scripts": {
34-
"clean": "rimraf dist",
35-
"build": "npm run clean && npm run build:tshy",
34+
"clean": "rimraf dist .tshy .tshy-build .turbo",
35+
"build": "pnpm run clean && pnpm run build:tshy && pnpm run update-version",
3636
"build:tshy": "tshy",
3737
"dev": "tshy --watch",
3838
"typecheck": "tsc -p tsconfig.src.json --noEmit",
@@ -81,7 +81,7 @@
8181
"superstruct": {
8282
"optional": true
8383
},
84-
"typebox": {
84+
"@sinclair/typebox": {
8585
"optional": true
8686
},
8787
"valibot": {

packages/schema-to-json/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,8 @@ export async function initializeSchemaConverters(): Promise<void> {
192192
let module;
193193
try {
194194
module = await import("effect");
195-
} catch {
196-
module = await import("@effect/schema");
197-
}
195+
} catch {}
196+
198197
if (module?.JSONSchema) {
199198
// @ts-ignore
200199
globalThis.__effectJsonSchema = { JSONSchema: module.JSONSchema };

packages/schema-to-json/src/tests/index.test.ts renamed to packages/schema-to-json/tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
detectSchemaType,
1111
initializeSchemaConverters,
1212
areConvertersInitialized,
13-
} from "../index.js";
13+
} from "../src/index.js";
1414

1515
// Initialize converters before running tests
1616
beforeAll(async () => {

packages/schema-to-json/tsconfig.src.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": ["./src/**/*.ts"],
4+
"exclude": ["src/**/*.test.ts"],
45
"compilerOptions": {
56
"isolatedDeclarations": false,
67
"composite": true,

packages/schema-to-json/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["./test/**/*.ts"],
3+
"include": ["./tests/**/*.ts"],
44
"references": [{ "path": "./tsconfig.src.json" }],
55
"compilerOptions": {
66
"isolatedDeclarations": false,

references/hello-world/src/trigger/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const helloWorldTask = task({
1414
logger.info("Hello, world from the onStart hook", { payload, init });
1515
},
1616
run: async (payload: any, { ctx }) => {
17-
logger.info("Hello, world from the init", { ctx, payload });
17+
logger.info("Hello, world froms the init", { ctx, payload });
1818
logger.info("env vars", {
1919
env: process.env,
2020
});

0 commit comments

Comments
 (0)