diff --git a/libs/@local/status/typescript/README.md b/libs/@local/status/typescript/README.md index fab1a370869..eb52767b484 100644 --- a/libs/@local/status/typescript/README.md +++ b/libs/@local/status/typescript/README.md @@ -84,9 +84,9 @@ This process works through code-generation using the [`quicktype`](https://githu This package is structured into two main areas: -- [`pkg`](./pkg) contains the TypeScript package that exports the `Status`, `StatusCode` types, and helper functions. - [`rust`](./rust) contains the Rust crate that defines the `Status` and `StatusCode` types. -- [`type-defs`](./type-defs) contains the plain type definitions for `Status`, `StatusCode`, and associated status payloads. These types are defined in TypeScript at the moment but could easily be represented in another schema format. +- [`typescript`](./src) contains the TypeScript package that exports the `Status`, `StatusCode` types, and helper functions. +- [`typescript/type-defs`](./type-defs) contains the plain type definitions for `Status`, `StatusCode`, and associated status payloads. These types are defined in TypeScript at the moment but could easily be represented in another schema format. Note: despite the `type-defs` being in TypeScript, we define them separately to keep a better separation of concerns, and to avoid `quicktype` breaking when it encounters non-type code (e.g. `const` definitions). diff --git a/libs/@local/status/typescript/package.json b/libs/@local/status/typescript/package.json index 33b875c97ec..8874e485b21 100644 --- a/libs/@local/status/typescript/package.json +++ b/libs/@local/status/typescript/package.json @@ -5,10 +5,10 @@ "license": "(MIT OR Apache-2.0)", "type": "module", "exports": { - ".": "./dist/pkg/src/main.js", + ".": "./dist/src/main.js", "./type-defs/*": "./dist/type-defs/*.js" }, - "types": "./dist/pkg/src/main.d.ts", + "types": "./dist/src/main.d.ts", "scripts": { "build": "rimraf dist && tsc --build tsconfig.build.json", "fix:eslint": "eslint --fix .", diff --git a/libs/@local/status/typescript/pkg/src/main.ts b/libs/@local/status/typescript/src/main.ts similarity index 87% rename from libs/@local/status/typescript/pkg/src/main.ts rename to libs/@local/status/typescript/src/main.ts index 4cfbd8bd692..ffc0d056921 100644 --- a/libs/@local/status/typescript/pkg/src/main.ts +++ b/libs/@local/status/typescript/src/main.ts @@ -3,10 +3,10 @@ * and RPC APIs. */ -import type { Status } from "../../type-defs/status.js"; +import type { Status } from "../type-defs/status.js"; import { StatusCode } from "./status-code.js"; -export type { Status } from "../../type-defs/status.js"; +export type { Status } from "../type-defs/status.js"; export { convertHttpCodeToStatusCode, convertStatusCodeToHttpCode, diff --git a/libs/@local/status/typescript/pkg/src/status-code.ts b/libs/@local/status/typescript/src/status-code.ts similarity index 98% rename from libs/@local/status/typescript/pkg/src/status-code.ts rename to libs/@local/status/typescript/src/status-code.ts index 05a0ac284cc..459ce488326 100644 --- a/libs/@local/status/typescript/pkg/src/status-code.ts +++ b/libs/@local/status/typescript/src/status-code.ts @@ -1,6 +1,6 @@ -import { StatusCode } from "../../type-defs/status-code.js"; +import { StatusCode } from "../type-defs/status-code.js"; -export { StatusCode } from "../../type-defs/status-code.js"; +export { StatusCode } from "../type-defs/status-code.js"; const STATUS_CODE_TO_HTTP_CODE: Record = { OK: 200, diff --git a/libs/@local/status/typescript/tsconfig.build.json b/libs/@local/status/typescript/tsconfig.build.json index df24c1073a1..21689d29105 100644 --- a/libs/@local/status/typescript/tsconfig.build.json +++ b/libs/@local/status/typescript/tsconfig.build.json @@ -1,6 +1,6 @@ { "extends": "./tsconfig.json", - "include": ["pkg", "type-defs"], + "include": ["src", "type-defs"], "compilerOptions": { "declaration": true, "outDir": "dist", diff --git a/libs/@local/status/typescript/tsconfig.json b/libs/@local/status/typescript/tsconfig.json index 57af11e8ed8..ea95ce498a8 100644 --- a/libs/@local/status/typescript/tsconfig.json +++ b/libs/@local/status/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json", - "include": ["./pkg/src/", "./scripts", "./type-defs"], + "include": ["./src/", "./scripts", "./type-defs"], "compilerOptions": { "module": "NodeNext", "moduleResolution": "NodeNext"