Skip to content
Merged
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
24 changes: 11 additions & 13 deletions .github/workflows/jumble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Jumble CI

on:
push:
branches: [main]
branches: [main, denoify]
pull_request:
branches: [main]

Expand All @@ -13,25 +13,23 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.0.0
- uses: actions/setup-node@v4
with:
node-version: "20.11.0"
cache: "pnpm"
cache-dependency-path: "./typescript/packages/pnpm-lock.yaml"

- name: Install Dependencies
working-directory: ./typescript/packages
run: pnpm install --frozen-lockfile
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "2.2.2"

- name: Build
working-directory: ./typescript/packages/jumble
run: pnpm run build
run: deno task build
env:
VITE_STORAGE_TYPE: "remote"
TOOLSHED_API_URL: ${{ secrets.TOOLSHED_API_URL }}
VITE_TOOLSHED_API_URL: ${{ secrets.TOOLSHED_API_URL }}

- name: Tarballify dist
working-directory: ./typescript/packages/jumble
run: tar -czvf dist.tar.gz dist

- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toolshed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "2.1.9"
deno-version: "2.2.2"

- name: Cache dependencies
uses: actions/cache@v3
Expand Down
69 changes: 35 additions & 34 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: UI Tests
on:
push:
branches:
- main
pull_request:
branches:
- main

# DISABLED until browser tests working again
#on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main

jobs:
test:
Expand All @@ -14,30 +16,29 @@ jobs:
matrix:
node-version: [22]
steps:
- name: Install test dependencies
run: |
sudo apt update
sudo apt-get install -y xvfb x11-xserver-utils
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: typescript/packages/pnpm-lock.yaml
- name: Install dependencies
run: |
cd typescript/packages
pnpm install
- name: UI Tests
run: |
cd typescript/packages/common-iframe-sandbox
pnpm test
cd -
cd typescript/packages/common-identity
pnpm test
cd -

- name: Install test dependencies
run: |
sudo apt update
sudo apt-get install -y xvfb x11-xserver-utils
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache-dependency-path: typescript/packages/pnpm-lock.yaml
- name: Install dependencies
run: |
cd typescript/packages
pnpm install
- name: UI Tests
run: |
cd typescript/packages/common-iframe-sandbox
pnpm test
cd -
cd typescript/packages/common-identity
pnpm test
cd -
33 changes: 33 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ./typescript/packages
steps:
- uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "2.2.2"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.deno
~/.cache/deno
key: ${{ runner.os }}-deno-${{ hashFiles('**/deno.json') }}
- name: Run tests
working-directory: typescript/packages
run: deno task test-all
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"deno.enable": true,
"deno.enablePaths": ["typescript/packages/common-memory", "typescript/packages/toolshed"]
"editor.defaultFormatter": "denoland.vscode-deno",
"deno.enable": true
}
6 changes: 0 additions & 6 deletions typescript/packages/.prettierignore

This file was deleted.

7 changes: 7 additions & 0 deletions typescript/packages/common-builder/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@commontools/builder",
"exports": "./src/index.ts",
"tasks": {
"build": "../scripts/build.ts"
}
}
39 changes: 0 additions & 39 deletions typescript/packages/common-builder/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions typescript/packages/common-builder/src/built-in.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createNodeFactory, lift } from "./module.js";
import type { NodeFactory, Opaque, OpaqueRef } from "./types.js";
import { createNodeFactory, lift } from "./module.ts";
import type { NodeFactory, Opaque, OpaqueRef } from "./types.ts";

export const llm = createNodeFactory({
type: "ref",
Expand Down
14 changes: 7 additions & 7 deletions typescript/packages/common-builder/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export { opaqueRef as cell, stream } from "./opaque-ref.js";
export { $, event, select, Spell } from "./spell.js";
export { byRef, compute, createNodeFactory, derive, handler, lift, render } from "./module.js";
export { opaqueRef as cell, stream } from "./opaque-ref.ts";
export { $, event, select, Spell } from "./spell.ts";
export { byRef, compute, createNodeFactory, derive, handler, lift, render } from "./module.ts";
export {
getTopFrame,
popFrame,
pushFrame,
pushFrameFromCause,
recipe,
recipeFromFrame,
} from "./recipe.js";
export { fetchData, ifElse, llm, navigateTo, str, streamData } from "./built-in.js";
} from "./recipe.ts";
export { fetchData, ifElse, llm, navigateTo, str, streamData } from "./built-in.ts";
export {
type Alias,
type Frame,
Expand Down Expand Up @@ -42,7 +42,7 @@ export {
unsafe_originalRecipe,
unsafe_parentRecipe,
type UnsafeBinding,
} from "./types.js";
} from "./types.ts";

// This should be a separate package, but for now it's easier to keep it here.
export { createJsonSchema, deepEqual, getValueAtPath, setValueAtPath } from "./utils.js";
export { createJsonSchema, deepEqual, getValueAtPath, setValueAtPath } from "./utils.ts";
10 changes: 5 additions & 5 deletions typescript/packages/common-builder/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import type {
Opaque,
OpaqueRef,
toJSON,
} from "./types.js";
import { isModule } from "./types.js";
import { opaqueRef } from "./opaque-ref.js";
import { connectInputAndOutputs, moduleToJSON, traverseValue } from "./utils.js";
import { getTopFrame } from "./recipe.js";
} from "./types.ts";
import { isModule } from "./types.ts";
import { opaqueRef } from "./opaque-ref.ts";
import { connectInputAndOutputs, moduleToJSON, traverseValue } from "./utils.ts";
import { getTopFrame } from "./recipe.ts";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";

Expand Down
8 changes: 4 additions & 4 deletions typescript/packages/common-builder/src/opaque-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
type ShadowRef,
toOpaqueRef,
type UnsafeBinding,
} from "./types.js";
import { hasValueAtPath, setValueAtPath } from "./utils.js";
import { getTopFrame, recipe } from "./recipe.js";
import { createNodeFactory } from "./module.js";
} from "./types.ts";
import { hasValueAtPath, setValueAtPath } from "./utils.ts";
import { getTopFrame, recipe } from "./recipe.ts";
import { createNodeFactory } from "./module.ts";

let mapFactory: NodeFactory<any, any>;

Expand Down
6 changes: 3 additions & 3 deletions typescript/packages/common-builder/src/recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
type toJSON,
UI,
type UnsafeBinding,
} from "./types.js";
import { createShadowRef, opaqueRef } from "./opaque-ref.js";
} from "./types.ts";
import { createShadowRef, opaqueRef } from "./opaque-ref.ts";
import {
connectInputAndOutputs,
createJsonSchema,
Expand All @@ -26,7 +26,7 @@ import {
setValueAtPath,
toJSONWithAliases,
traverseValue,
} from "./utils.js";
} from "./utils.ts";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";

Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/common-builder/src/spell.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { derive, type OpaqueRef, recipe, stream, UI } from "./index.js";
import { derive, type OpaqueRef, recipe, stream, UI } from "./index.ts";

// $ is a proxy that just collect paths, so that one can call [getPath] on it
// and get an array. For example for `q = $.foo.bar[0]` `q[getPath]` yields
Expand Down
6 changes: 3 additions & 3 deletions typescript/packages/common-builder/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createShadowRef } from "./opaque-ref.js";
import { createShadowRef } from "./opaque-ref.ts";
import {
type Alias,
canBeOpaqueRef,
Expand All @@ -17,8 +17,8 @@ import {
type OpaqueRef,
type Recipe,
unsafe_originalRecipe,
} from "./types.js";
import { getTopFrame } from "./recipe.js";
} from "./types.ts";
import { getTopFrame } from "./recipe.ts";

/**
* Traverse a value, _not_ entering cells
Expand Down
13 changes: 7 additions & 6 deletions typescript/packages/common-builder/test/module.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { afterEach, beforeEach, describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import {
type Frame,
isModule,
isOpaqueRef,
type JSONSchema,
type Module,
type OpaqueRef,
} from "../src/types.js";
import { handler, lift } from "../src/module.js";
import { opaqueRef } from "../src/opaque-ref.js";
import { pushFrame } from "../src/recipe.js";
import { popFrame } from "../src/recipe.js";
} from "../src/types.ts";
import { handler, lift } from "../src/module.ts";
import { opaqueRef } from "../src/opaque-ref.ts";
import { pushFrame } from "../src/recipe.ts";
import { popFrame } from "../src/recipe.ts";
import { z } from "zod";

type MouseEvent = {
Expand Down
9 changes: 5 additions & 4 deletions typescript/packages/common-builder/test/opaque-ref.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { type Frame, isOpaqueRef, isShadowRef } from "../src/types.js";
import { createShadowRef, opaqueRef } from "../src/opaque-ref.js";
import { popFrame, pushFrame } from "../src/recipe.js";
import { afterEach, beforeEach, describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { type Frame, isOpaqueRef, isShadowRef } from "../src/types.ts";
import { createShadowRef, opaqueRef } from "../src/opaque-ref.ts";
import { popFrame, pushFrame } from "../src/recipe.ts";

describe("opaqueRef function", () => {
let frame: Frame;
Expand Down
11 changes: 6 additions & 5 deletions typescript/packages/common-builder/test/recipe.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { describe, expect, it } from "vitest";
import { isModule, isRecipe, type Module, type Recipe } from "../src/types.js";
import { lift } from "../src/module.js";
import { recipe } from "../src/recipe.js";
import { describe, it } from "@std/testing/bdd";
import { expect } from "@std/expect";
import { isModule, isRecipe, type Module, type Recipe } from "../src/types.ts";
import { lift } from "../src/module.ts";
import { recipe } from "../src/recipe.ts";
import { z } from "zod";
import { opaqueRef } from "../src/opaque-ref.js";
import { opaqueRef } from "../src/opaque-ref.ts";

describe("recipe function", () => {
it("creates a recipe", () => {
Expand Down
Loading