Skip to content

Commit e32a1cb

Browse files
Refactor project structure according to actual logical layers (#93)
This is not just a refactoring, but actually an enhancement in different areas of the project. With this changes we are seeing following improvements: - The LLM has become capable of properly understanding the project, reading, and writing code. Previously, it often introduced errors by modifying OpenAPI‑generated code, which required additional iterations. - The updated structure is simple and intuitive, especially for people more familiar to JavaScript projects. - A similar approach is used in other popular libraries that rely on OpenAPI generators, where generated code is isolated from SDK abstractions. For example, AWS JS SDK v3 (https://github.com/aws/aws-sdk-js-v3) and the Kubernetes JavaScript Client (https://github.com/kubernetes-client/javascript). The codebase itself remains unchanged for end users. The PR only includes file and folder renames, updated import/export statements, and moving types and helpers into separate files. It does not affect functionality, build process, or user‑facing behavior. List of changes: - All generated code now resides in src/open-api/generated, with manual rewrites, additions and export encapsulation control layered on top within src/open-api - a cohesive OpenAPI layer used as a single unit by the rest of the project. - SDK abstractions formerly under orkes, core, task, and common have been moved into sdk/clients, sdk/createConductorClient, sdk/generators, and sdk/builders. - The monolithic code was reorganized into helper modules and shared types located at appropriate levels based on reuse. - Updated related import/export statements (no changes affecting user‑facing behavior). - Test folder v5-only was removed and all tests were moved into their domain‑specific files without additional structural test separation. Related tests are now selected via environment variable, updated package.json test scripts according to this change.
1 parent f0c6daa commit e32a1cb

153 files changed

Lines changed: 1931 additions & 1738 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
node-version: [20, 22, 24]
26-
test: ["unit", "integration:v5", "integration:v4"]
26+
test: ["unit", "integration:orkes-v5", "integration:orkes-v4"]
2727
name: Node.js v${{ matrix.node-version }} - ${{ matrix.test }} tests
2828
steps:
2929
- name: Checkout
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
The client is generated using [this library](https://github.com/hey-api/openapi-ts). Generated code must not be modified directly.
1+
The open-api layer code is generated using [this library](https://github.com/hey-api/openapi-ts). Generated code (src/open-api/generated) must not be modified directly.
22

33
## Updating generated code
44

55
1. Copy OpenApi spec data from up to date cluster `({cluster_url}/api-docs)`
6-
2. Paste to `open-api-spec/spec.json`
6+
2. Paste to `src/open-api/spec/spec.json`
77
3. Prettify `spec.json`, run command: (todo: should be removed after OpenApi spec fix)
88

99
```text
10-
node open-api-spec/fix-additional-properties.ts
10+
node src/open-api/spec/fix-additional-properties.ts
1111
```
1212

1313
4. run command:

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export default defineConfig(
99
{
1010
ignores: [
1111
"dist/**",
12-
"src/common/open-api/**", // OpenAPI auto-generated code
12+
"src/open-api/generated/**", // OpenAPI auto-generated code
13+
"src/open-api/spec/**", // OpenAPI spec and fix script
1314
"docs/**",
1415
"node_modules/**",
1516
],

index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
export * from "./src/task/index";
2-
export * from "./src/common";
3-
export * from "./src/core";
4-
export * from "./src/orkes";
5-
1+
export * from "./src/sdk";
2+
export * from "./src/open-api";

integration-tests/common/MetadataClient.test.ts

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)