@gewis/sudosos-client 1.36.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  Auto-generated TypeScript-Axios client for the SudoSOS API. Published on npm as [`@gewis/sudosos-client`](https://www.npmjs.com/package/@gewis/sudosos-client).
4
4
 
5
- This package lives inside the [SudoSOS Backend](https://github.com/GEWIS/sudosos-backend/tree/develop/client) monorepo (`client/`) and is generated from the backend's Swagger/OpenAPI spec.
5
+ This package lives at `packages/sudosos-client/` in the [GEWIS/sudosos](https://github.com/GEWIS/sudosos)
6
+ monorepo and is generated from the backend's Swagger/OpenAPI spec. The frontend apps in this same repo
7
+ consume it directly as a `workspace:*` dependency, not via the npm-published version.
6
8
 
7
9
  ---
8
10
 
@@ -61,7 +63,7 @@ balanceApi.getBalances().then((res) => {
61
63
  });
62
64
  ```
63
65
 
64
- For a more complete integration example, see [sudosos-frontend-common](https://github.com/GEWIS/sudosos-frontend-common).
66
+ For a more complete integration example, see [`frontend/lib/common`](../../frontend/lib/common) in this repo.
65
67
 
66
68
  ---
67
69
 
@@ -72,39 +74,43 @@ The client is generated from the OpenAPI spec that the backend emits at build ti
72
74
  ### Prerequisites
73
75
 
74
76
  - Node.js 22+
75
- - Java runtime (required by `openapi-generator-cli`)
76
- - The backend's Swagger output must exist at `../out/swagger.json` run `npm run swagger` from the backend root first
77
+ - Java 11+ runtime (required by `openapi-generator-cli`) — only needed to *regenerate* the client;
78
+ the generated `src/` is committed, so day-to-day frontend work never needs Java.
79
+ - The backend's Swagger output must exist at `../../backend/out/swagger.json` — run `pnpm backend:swagger`
80
+ from the repo root first (or `pnpm swagger` from `backend/`).
77
81
 
78
82
  ### Common commands
79
83
 
84
+ Run from this directory (`packages/sudosos-client/`) once the monorepo workspace is installed, or via
85
+ `pnpm --filter @gewis/sudosos-client <script>` from anywhere in the repo:
86
+
80
87
  | Command | Description |
81
88
  |---|---|
82
- | `npm run gen` | Generate TypeScript source from `../out/swagger.json` into `src/` |
83
- | `npm run build` | Compile `src/` to `dist/` |
84
- | `npm run genbuild` | Run `gen` then `build` (full regeneration) |
85
- | `npm run clean` | Remove `src/` and `dist/` |
89
+ | `pnpm gen` | Generate TypeScript source from `../../backend/out/swagger.json` into `src/` |
90
+ | `pnpm build` | Compile `src/` to `dist/` (CJS) and `dist/esm/` (ESM, for bundler consumers) |
91
+ | `pnpm genbuild` | Run `gen` then `build` (full regeneration) |
92
+ | `pnpm clean` | Remove `src/` and `dist/` |
86
93
 
87
94
  ### Regenerating after a backend change
88
95
 
89
- ```bash
90
- # From the backend root — generate the OpenAPI spec first
91
- npm run swagger # produces out/swagger.json
96
+ One-shot, from the repo root:
92
97
 
93
- # Then regenerate the client
94
- cd client
95
- npm run genbuild
98
+ ```bash
99
+ pnpm generate:client # runs backend swagger, then this package's genbuild
96
100
  ```
97
101
 
98
- Or use the one-shot helper from the backend root:
102
+ Or step by step:
99
103
 
100
104
  ```bash
101
- npm run client:gen # runs npm run swagger, then cd client && npm install && npm run genbuild
105
+ pnpm backend:swagger # produces backend/out/swagger.json
106
+ pnpm --filter @gewis/sudosos-client run genbuild # regenerate + rebuild the client
102
107
  ```
103
108
 
104
109
  ---
105
110
 
106
111
  ## Contributing
107
112
 
108
- This package is generated — do not edit files under `src/` by hand; they will be overwritten on the next `npm run gen`. To change the client's output, update the backend API and regenerate.
113
+ This package is generated — do not edit files under `src/` by hand; they will be overwritten on the next
114
+ `pnpm gen`. To change the client's output, update the backend API and regenerate.
109
115
 
110
- Issues and contributions go through the [SudoSOS Backend issue tracker](https://github.com/GEWIS/sudosos-backend/issues).
116
+ Issues and contributions go through the [GEWIS/sudosos issue tracker](https://github.com/GEWIS/sudosos/issues).
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * sudosos-back-end
2
+ * sudosos-backend
3
3
  * SudoSOS
4
4
  *
5
5
  * The version of the OpenAPI document: 0.1.0
package/dist/api.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /**
5
- * sudosos-back-end
5
+ * sudosos-backend
6
6
  * SudoSOS
7
7
  *
8
8
  * The version of the OpenAPI document: 0.1.0
package/dist/base.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * sudosos-back-end
2
+ * sudosos-backend
3
3
  * SudoSOS
4
4
  *
5
5
  * The version of the OpenAPI document: 0.1.0
package/dist/base.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /**
5
- * sudosos-back-end
5
+ * sudosos-backend
6
6
  * SudoSOS
7
7
  *
8
8
  * The version of the OpenAPI document: 0.1.0
package/dist/common.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * sudosos-back-end
2
+ * sudosos-backend
3
3
  * SudoSOS
4
4
  *
5
5
  * The version of the OpenAPI document: 0.1.0
package/dist/common.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /**
5
- * sudosos-back-end
5
+ * sudosos-backend
6
6
  * SudoSOS
7
7
  *
8
8
  * The version of the OpenAPI document: 0.1.0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * sudosos-back-end
2
+ * sudosos-backend
3
3
  * SudoSOS
4
4
  *
5
5
  * The version of the OpenAPI document: 0.1.0
@@ -2,7 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /**
5
- * sudosos-back-end
5
+ * sudosos-backend
6
6
  * SudoSOS
7
7
  *
8
8
  * The version of the OpenAPI document: 0.1.0