Skip to content

Commit

Permalink
move caml assets
Browse files Browse the repository at this point in the history
  • Loading branch information
fulpm committed Oct 2, 2024
1 parent 830809e commit 402d324
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Note that by running this utility, files will be added/updated/deleted in the
`src` directory. Once generated, files should then be committed back to the
repository.

Ensure that the Howso Engine caml file located at `src/engine/howso.caml` is
Ensure that the Howso Engine caml file located at `src/assets/howso.caml` is
up to date before generation.

### Generating the code
Expand Down
7 changes: 4 additions & 3 deletions codegen/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface Schema extends BaseSchema {
values?: SchemaType | Schema | Ref;
indices?: Record<string, SchemaType | Schema | Ref>;
dynamic_indices?: Record<string, SchemaType | Schema | Ref>;
additional_indices?: SchemaType | Schema | Ref;
additional_indices?: SchemaType | Schema | Ref | false;
}

export interface LabelDefinition {
Expand All @@ -49,7 +49,7 @@ export interface EngineApi {

export async function getEngineApi(): Promise<EngineApi> {
const handle = "default";
const enginePath = require.resolve("../../src/engine/howso.caml");
const enginePath = require.resolve("../../src/assets/howso.caml");
const dataPath = require.resolve("@howso/amalgam-lang/lib/amalgam-st.data");
const wasmPath = require.resolve("@howso/amalgam-lang/lib/amalgam-st.wasm");

Expand Down Expand Up @@ -101,6 +101,7 @@ export function isSchema(value: SchemaType | Schema | Ref | null | undefined): v
return !isRef(value) && "type" in value && typeof value.type === "string";
}

export function isSchemaOrRef(value: SchemaType | Schema | Ref | null | undefined): value is Schema | Ref {
export function isSchemaOrRef(value: SchemaType | Schema | Ref | boolean | null | undefined): value is Schema | Ref {
if (typeof value === "boolean") return false;
return isRef(value) || isSchema(value);
}
2 changes: 1 addition & 1 deletion codegen/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
copy({
targets: [
{
src: ["src/engine/howso.caml"],
src: ["src/assets/howso.caml"],
dest: "./codegen/build",
},
{
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
copy({
targets: [
{
src: ["src/engine/howso.caml", "src/engine/migrations.caml"],
src: ["src/assets/howso.caml", "src/assets/migrations.caml"],
dest: "lib",
},
],
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/client/worker/HowsoWorkerClient.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Node HowsoWorkerClient", () => {
const fs = new NodeFileSystem(worker);
client = new HowsoWorkerClient(worker, fs, {
trace: false,
howsoUrl: resolve(__dirname, "../../engine/howso.caml"),
howsoUrl: resolve(__dirname, "../../assets/howso.caml"),
});
await client.setup();
const dataPath = resolve(__dirname, "../../tests/assets/iris.json");
Expand Down

0 comments on commit 402d324

Please sign in to comment.