Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
44cc4d3
initial step of refactoring builder API to be created by a factory + …
seefeldb Jun 6, 2025
8c4f7fa
deno.lock change, not sure this is right
seefeldb Jun 6, 2025
2a712d9
let's just go back to `any` here, this is wonky
seefeldb Jun 6, 2025
2ac3fe2
builder/interface.ts and builder/schema-to-ts.ts are now together ent…
seefeldb Jun 6, 2025
27de921
lots of types fixes for previous change
seefeldb Jun 6, 2025
d8837ba
more type fixes
seefeldb Jun 6, 2025
14b319b
remove this syntax for now
seefeldb Jun 6, 2025
82ca353
remove extraneous parameter for createBuilder
seefeldb Jun 6, 2025
9c614de
add back ability to set schema with cell/opaqueRef
seefeldb Jun 7, 2025
f2fe26a
fix more tests
seefeldb Jun 7, 2025
79ef937
export opaqueRef directly still, for internal use outside of recipes
seefeldb Jun 7, 2025
6074063
partially fix test
seefeldb Jun 7, 2025
c630bc1
import type with `type` annotation
seefeldb Jun 9, 2025
6f97b4d
interface is now truly just the public interface. users should only i…
seefeldb Jun 9, 2025
d6398e3
separated imports in other places
seefeldb Jun 9, 2025
4d9e789
fix misaligned exports
seefeldb Jun 9, 2025
f11897e
removed Mutable from interface
seefeldb Jun 9, 2025
255a1cb
change all recipes to import from /interface.
seefeldb Jun 9, 2025
70139fe
redo use of SchemaWithoutCell in the right places, this fixed the tests
seefeldb Jun 9, 2025
0206774
need Mutable<> after all, so duplicating here to keep interface.ts an…
seefeldb Jun 9, 2025
fe6edc7
recipe also needs SchemaWithoutCell
seefeldb Jun 9, 2025
65c14ca
and recipe needs that also for the recipe function!
seefeldb Jun 9, 2025
1300446
fix recipes
seefeldb Jun 9, 2025
2a226d6
move getRecipeEnvironment to public environment
seefeldb Jun 9, 2025
5c4f4b7
revert to original deno.lock
seefeldb Jun 9, 2025
2bb1e50
also exports constants via builder!
seefeldb Jun 9, 2025
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
Prev Previous commit
Next Next commit
remove extraneous parameter for createBuilder
  • Loading branch information
seefeldb committed Jun 9, 2025
commit 82ca353f3fe0abfd91754f542337e15656df45e5
3 changes: 1 addition & 2 deletions packages/builder/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
str,
streamData,
} from "./built-in.ts";
import { type Runtime } from "@commontools/runner";
import { getCellLinkOrThrow, type Runtime } from "@commontools/runner";

/**
* Creates a set of builder functions with the given runtime
Expand All @@ -29,7 +29,6 @@ import { type Runtime } from "@commontools/runner";
*/
export const createBuilder = (
runtime: Runtime,
getCellLinkOrThrow?: (value: any) => any,
): BuilderFunctions => {
// Implementation of createCell moved from runner/harness
const createCell: CreateCellFunction = function createCell<T = any>(
Expand Down
2 changes: 1 addition & 1 deletion packages/runner/src/harness/local-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const tsToExports = async (
case "@commontools/html":
return commonHtml;
case "@commontools/builder":
return createBuilder(config.runtime, getCellLinkOrThrow);
return createBuilder(config.runtime);
case "zod":
return zod;
case "merkle-reference":
Expand Down
2 changes: 1 addition & 1 deletion packages/runner/test/recipes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("Recipe Runner", () => {
runtime = new Runtime({
storageUrl: "volatile://",
});
const builder = createBuilder(runtime, getCellLinkOrThrow);
const builder = createBuilder(runtime);
({
lift,
recipe,
Expand Down
9 changes: 8 additions & 1 deletion packages/runner/test/schema-lineage.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { afterEach, beforeEach, describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { createBuilder } from "@commontools/builder";
import { JSONSchema, UI } from "@commontools/builder/interface";
import { type Cell, isCell } from "../src/cell.ts";
import { Runtime } from "../src/runtime.ts";
import { type JSONSchema, recipe, UI } from "@commontools/builder";

describe("Schema Lineage", () => {
let runtime: Runtime;
let recipe: ReturnType<typeof createBuilder>["recipe"];

beforeEach(() => {
runtime = new Runtime({
storageUrl: "volatile://",
});
const builder = createBuilder(runtime);
({ recipe } = builder);
});

afterEach(async () => {
Expand Down Expand Up @@ -225,11 +229,14 @@ describe("Schema Lineage", () => {

describe("Schema propagation end-to-end example", () => {
let runtime: Runtime;
let recipe: ReturnType<typeof createBuilder>["recipe"];

beforeEach(() => {
runtime = new Runtime({
storageUrl: "volatile://",
});
const builder = createBuilder(runtime);
({ recipe } = builder);
});

afterEach(async () => {
Expand Down