diff --git a/.changeset/brown-hotels-march.md b/.changeset/brown-hotels-march.md new file mode 100644 index 0000000..056faa7 --- /dev/null +++ b/.changeset/brown-hotels-march.md @@ -0,0 +1,5 @@ +--- +"@taskless/loader": patch +--- + +Fixes issue where types were not available in taskless/core diff --git a/src/dev/packcheck.ts b/src/dev/packcheck.ts index 6aaaef6..e8185b1 100644 --- a/src/dev/packcheck.ts +++ b/src/dev/packcheck.ts @@ -1,6 +1,7 @@ /* eslint-disable n/no-process-env */ import process from "node:process"; -import { type ConsolePayload, taskless } from "@~/core.js"; +import { taskless } from "@~/core.js"; +import { type ConsolePayload } from "@~/types.js"; import { http } from "msw"; import { setupServer } from "msw/node"; @@ -13,7 +14,10 @@ type Fixture = { * Packcheck - simple tool for checking your Taskless packs, easily integrated * with your existing unit testing framework */ -export async function packcheck(configOrPack: string, fixture: Fixture) { +export async function packCheck( + configOrPack: string, + fixture: Fixture +): Promise { if (process.env.NODE_ENV === "production") { throw new Error( "Taskless `dev` actions cannot be used in production node environments" @@ -69,3 +73,5 @@ export async function packcheck(configOrPack: string, fixture: Fixture) { const result = Array.from(grouped.values())[0] ?? {}; return result; } + +export { type ConsolePayload } from "@~/types.js"; diff --git a/src/index.ts b/src/index.ts index 3cd4710..cd0fbe7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,3 +56,4 @@ autoload(TASKLESS_API_KEY, { // eslint-disable-next-line @typescript-eslint/no-useless-empty-export export {}; +export type * from "./types.js"; diff --git a/src/lib/taskless.ts b/src/lib/taskless.ts index e8274ed..0192d7e 100644 --- a/src/lib/taskless.ts +++ b/src/lib/taskless.ts @@ -514,3 +514,5 @@ export const autoload = (secret?: string, options?: InitOptions) => { handleError(error); } }; + +export type * from "../types.js"; diff --git a/test/env.spec.ts b/test/env.spec.ts index 4ffb69a..d6ac5c2 100644 --- a/test/env.spec.ts +++ b/test/env.spec.ts @@ -2,9 +2,7 @@ import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { execa } from "execa"; import { vi, test as vitest, afterEach, describe, beforeAll } from "vitest"; -import { packcheck } from "../dist/dev/packcheck.js"; import { taskless } from "../src/core.js"; -import sampleYaml from "./fixtures/sample.yaml?raw"; import { defaultConfig, withHono } from "./helpers/server.js"; const test = withHono(vitest); diff --git a/test/packcheck.spec.ts b/test/packcheck.spec.ts index 9a25070..aa8e288 100644 --- a/test/packcheck.spec.ts +++ b/test/packcheck.spec.ts @@ -1,10 +1,10 @@ -import { packcheck } from "@~/dev/packcheck.js"; +import { packCheck } from "@~/dev/packcheck.js"; import { describe, test } from "vitest"; import sampleYaml from "./fixtures/sample.yaml?raw"; describe("Packcheck", () => { test("Packcheck assertion library is working", async ({ expect }) => { - const results = await packcheck(sampleYaml, { + const results = await packCheck(sampleYaml, { request: new Request("https://example.com"), response: new Response("Hello world!"), }); diff --git a/vite.config.ts b/vite.config.ts index 3d81de2..64699d1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ tsconfigPaths(), externalizeDeps(), dts({ - include: Object.values(ENTRY_POINTS), + include: ["src/**/*"], }), ], test: {