diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e6b73b3..756cfe3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,7 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store- - run: pnpm install + - run: pnpm run tc - run: pnpm run build - run: pnpm run circular - run: pnpm run test diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 59acd31c..d5db8f69 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,7 +3,7 @@ name: PR Flow on: pull_request: branches: - - 'main' + - "main" # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -49,6 +49,7 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store- - run: pnpm install + - run: pnpm run tc - run: pnpm run build - run: pnpm run circular - run: pnpm run test --coverage diff --git a/.madgerc b/.madgerc new file mode 100644 index 00000000..b407c6b4 --- /dev/null +++ b/.madgerc @@ -0,0 +1,7 @@ +{ + "detectiveOptions": { + "ts": { + "skipTypeImports": true + } + } +} diff --git a/package.json b/package.json index 3c6e81e4..17934efd 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,13 @@ "clean": "node scripts/clean.mjs && rimraf tsconfig.tsbuildinfo", "build": "pnpm gen && preconstruct fix && preconstruct build && pnpm gen", "gen": "build-utils prepare-v1", - "circular": "madge --ts-config ./tsconfig.json --circular --no-color --no-spinner packages/*", + "circular": "madge --extensions ts --circular --no-color --no-spinner packages/*/src", "test": "vitest", "autofix": "ultra -r autofix", "docs": "ultra -r docgen && pnpm docs-cp", "docs-cp": "node scripts/docs-cp.js", "lint": "ultra -r lint", + "tc": "ultra -r tsc -b", "version": "changeset version && pnpm install --no-frozen-lockfile" }, "packageManager": "pnpm@8.6.10", diff --git a/packages/platform-browser/package.json b/packages/platform-browser/package.json index 635adcf9..6a6dcdd1 100644 --- a/packages/platform-browser/package.json +++ b/packages/platform-browser/package.json @@ -14,7 +14,7 @@ } }, "effect": { - "generateIndex": false + "generateIndex": true }, "publishConfig": { "access": "public" diff --git a/packages/platform-bun/package.json b/packages/platform-bun/package.json index 58f16963..c8af4057 100644 --- a/packages/platform-bun/package.json +++ b/packages/platform-bun/package.json @@ -15,7 +15,7 @@ } }, "effect": { - "generateIndex": false + "generateIndex": true }, "publishConfig": { "access": "public" diff --git a/packages/platform-node/package.json b/packages/platform-node/package.json index 8350a340..0a4acf3d 100644 --- a/packages/platform-node/package.json +++ b/packages/platform-node/package.json @@ -15,7 +15,7 @@ } }, "effect": { - "generateIndex": false + "generateIndex": true }, "publishConfig": { "access": "public" diff --git a/packages/platform/package.json b/packages/platform/package.json index 63b7e276..c6c53cac 100644 --- a/packages/platform/package.json +++ b/packages/platform/package.json @@ -15,7 +15,7 @@ } }, "effect": { - "generateIndex": false + "generateIndex": true }, "publishConfig": { "access": "public" diff --git a/packages/platform/src/internal/http/router.ts b/packages/platform/src/internal/http/router.ts index 5377a62a..5bfc41a5 100644 --- a/packages/platform/src/internal/http/router.ts +++ b/packages/platform/src/internal/http/router.ts @@ -49,7 +49,7 @@ export const schemaParams = >, A>(sche ) } -class RouterImpl extends Effectable.Effectable< +class RouterImpl extends Effectable.StructuralClass< Exclude, E | Error.RouteNotFound, ServerResponse.ServerResponse diff --git a/packages/platform/src/internal/http/serverResponse.ts b/packages/platform/src/internal/http/serverResponse.ts index e7496d6d..a0dbf5b3 100644 --- a/packages/platform/src/internal/http/serverResponse.ts +++ b/packages/platform/src/internal/http/serverResponse.ts @@ -15,7 +15,7 @@ import * as internalBody from "./body" /** @internal */ export const TypeId: ServerResponse.TypeId = Symbol.for("@effect/platform/Http/ServerResponse") as ServerResponse.TypeId -class ServerResponseImpl extends Effectable.Effectable +class ServerResponseImpl extends Effectable.StructuralClass implements ServerResponse.ServerResponse { readonly [TypeId]: ServerResponse.TypeId diff --git a/packages/platform/tsconfig.json b/packages/platform/tsconfig.json index a7b48283..01fd4896 100644 --- a/packages/platform/tsconfig.json +++ b/packages/platform/tsconfig.json @@ -1,5 +1,7 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": {}, + "compilerOptions": { + "outDir": "build" + }, "include": ["./src/**/*", "test/**/*", "examples/**/*"] } diff --git a/scripts/clean.mjs b/scripts/clean.mjs index 5f964d90..896e0dfa 100644 --- a/scripts/clean.mjs +++ b/scripts/clean.mjs @@ -8,12 +8,13 @@ import * as Glob from "glob"; [ ".ultra.cache.json", "build", + "tsconfig.tsbuildinfo", "coverage", ...(pkg === "." ? [] : ["docs"]), ...files, ] .filter((_) => _ !== "src") .forEach((file) => { - Fs.rmSync(`${pkg}/${file}`, { recursive: true, force: true }); + Fs.rm(`${pkg}/${file}`, { recursive: true, force: true }, () => {}); }); }); diff --git a/tsconfig.base.json b/tsconfig.base.json index 8b7590a8..6fb6afcd 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -51,7 +51,5 @@ }, "types": ["vitest/globals", "node"], "plugins": [{ "name": "@effect/language-service" }] - }, - "include": [], - "exclude": ["node_modules", "build", "lib"] + } } diff --git a/tsconfig.madge.json b/tsconfig.madge.json deleted file mode 100644 index 33c47ad4..00000000 --- a/tsconfig.madge.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilerOptions": { - "noEmit": true, - "allowJs": true, - "baseUrl": ".", - "paths": { - "@effect/platform/test/*": ["./packages/platform/build/test/*"], - "@effect/platform/examples/*": ["./packages/platform/build/examples/*"], - "@effect/platform/*": ["./packages/platform/build/esm/*"], - - "@effect/platform-bun/test/*": ["./packages/platform-bun/build/test/*"], - "@effect/platform-bun/examples/*": [ - "./packages/platform-bun/build/examples/*" - ], - "@effect/platform-bun/*": ["./packages/platform-bun/build/esm/*"], - - "@effect/platform-browser/test/*": [ - "./packages/platform-browser/build/test/*" - ], - "@effect/platform-browser/examples/*": [ - "./packages/platform-browser/build/examples/*" - ], - "@effect/platform-browser/*": ["./packages/platform-browser/build/esm/*"], - - "@effect/platform-node/test/*": ["./packages/platform-node/build/test/*"], - "@effect/platform-node/examples/*": [ - "./packages/platform-node/build/examples/*" - ], - "@effect/platform-node/*": ["./packages/platform-node/build/esm/*"] - } - }, - "include": [ - "./packages/platform/build/esm/**/*.js", - "./packages/platform/build/test/**/*.js", - "./packages/platform/build/examples/**/*.js", - - "./packages/platform-bun/build/esm/**/*.js", - "./packages/platform-bun/build/test/**/*.js", - "./packages/platform-bun/build/examples/**/*.js", - - "./packages/platform-browser/build/esm/**/*.js", - "./packages/platform-browser/build/test/**/*.js", - "./packages/platform-browser/build/examples/**/*.js", - - "./packages/platform-node/build/esm/**/*.js", - "./packages/platform-node/build/test/**/*.js", - "./packages/platform-node/build/examples/**/*.js" - ] -}