Skip to content

Commit

Permalink
remove pkg folder from @local/status/typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranMn committed Aug 26, 2024
1 parent 067cef9 commit 9ca8323
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libs/@local/status/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
4 changes: 2 additions & 2 deletions libs/@local/status/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 .",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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<StatusCode, number> = {
OK: 200,
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/status/typescript/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
"include": ["pkg", "type-defs"],
"include": ["src", "type-defs"],
"compilerOptions": {
"declaration": true,
"outDir": "dist",
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/status/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 9ca8323

Please sign in to comment.