Skip to content

Commit

Permalink
Get rid of the shim.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
p2004a committed Jun 17, 2024
1 parent f48ec62 commit 0237f94
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 2,152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
cache: "npm"
- run: npm ci
- run: npm run format:check
- run: npm run typecheck
- run: npm run lint
- run: npm run build:clean && git diff --exit-code
- run: npm run typecheck # typecheck depends on the `dist` directory for type-helpers.ts
- run: npm test
1 change: 1 addition & 0 deletions src/generate-docs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { TObject, TSchema, TUnion } from "@sinclair/typebox";
import fs from "fs";
import { objectKeys, titleCase } from "jaz-ts-utils";
// @ts-ignore
import { JSONSchemaFaker } from "json-schema-faker";
import { compile } from "json-schema-to-typescript";

Expand Down
6 changes: 5 additions & 1 deletion src/generate-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ async function generateTempIndex(tachyonConfig: TachyonConfig) {
version: packageJson.version,
schema: tachyonConfig.schemaMeta,
};

const typeHelpers = (await fs.readFile("src/type-helpers.ts", "utf-8")).split(
"//--DIST-START--\n"
)[1];
const indexContents = `
export const tachyonMeta = ${JSON.stringify(meta, null, 4)} as const;
import { TachyonCommand } from "./types.js";
${await fs.readFile("src/type-helpers.ts", "utf-8")}`;
${typeHelpers}`;
await fs.writeFile("dist/index.ts", indexContents);
}

Expand Down
2 changes: 1 addition & 1 deletion src/generate-json-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { pathToFileURL } from "url";

import { FailedResponseSchema, SuccessResponseSchema } from "@/generator-helpers";
import { EndpointConfig } from "@/generator-helpers.js";
import { TachyonActor } from "@/type-helpers";
import { TachyonActor } from "@/tachyon-constants";
import { UnionEnum } from "@/union-enum";

const schemaBaseUri = "https://schema.beyondallreason.dev/tachyon";
Expand Down
2 changes: 1 addition & 1 deletion src/generator-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@sinclair/typebox";
import { SetOptional } from "type-fest";

import { TachyonActor } from "@/type-helpers";
import { TachyonActor } from "@/tachyon-constants";

export type EndpointConfig = {
/** Where the command should be sent from */
Expand Down
Loading

0 comments on commit 0237f94

Please sign in to comment.