Skip to content

Commit cb64549

Browse files
committed
refactor: remove self-generated openapi-spec
Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent cee062e commit cb64549

Some content is hidden

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

57 files changed

+1290
-3644
lines changed

.github/workflows/oapi_spec.yaml

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

.github/workflows/pr-validation.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: 20
30+
registry-url: 'https://npm.pkg.github.com'
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Create .npmrc
35+
run: |
36+
echo "@trustification:registry=https://npm.pkg.github.com" >> .npmrc
3037
3138
- name: Install commitlint
3239
run: |

.github/workflows/pr.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828
with:
2929
node-version: ${{ matrix.node }}
3030
cache: npm
31+
registry-url: 'https://npm.pkg.github.com'
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Create .npmrc
36+
run: |
37+
echo "@trustification:registry=https://npm.pkg.github.com" >> .npmrc
3138
3239
- name: Enable Corepack
3340
run: corepack enable

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on:
1515
branches:
1616
- 'main'
1717
paths:
18-
- "generated/**"
1918
- "src/**"
2019
- "package-lock.json"
2120
- "package.json"
@@ -41,6 +40,12 @@ jobs:
4140
node-version: 18
4241
cache: npm
4342
registry-url: 'https://npm.pkg.github.com'
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Create .npmrc
47+
run: |
48+
echo "@trustification:registry=https://npm.pkg.github.com" >> .npmrc
4449
4550
- name: Configure git
4651
run: |

.github/workflows/stage.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ on:
1616
- main
1717

1818
paths:
19-
- "generated/**"
2019
- "src/**"
2120
- "test/**"
2221
- "package-lock.json"
@@ -45,6 +44,12 @@ jobs:
4544
node-version: 18
4645
cache: npm
4746
registry-url: 'https://npm.pkg.github.com'
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Create .npmrc
51+
run: |
52+
echo "@trustification:registry=https://npm.pkg.github.com" >> .npmrc
4853
4954
- name: Enable Corepack
5055
run: corepack enable

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ integration/**/package-lock.json
88
unit-tests-result.json
99
.gradle
1010
build
11-
target
11+
target
12+
.npmrc

CONTRIBUTING.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@
1717
* `npm run test` run unit tests,verify coverage, and print coverage info
1818
* `npm run tests` run unit tests (no coverage)
1919
* `npm run tests:rep` run unit tests and save the test results as _unit-tests-result.json_ (for ci)
20-
* `npm run gen:backend` generate the _Backend_ types from its _OpenAPI_ as _TS_ spec in the _generated/backend_ folder
2120

2221
### Good to know
2322

2423
* You can override the default backend url by setting another one in the _EXHORT_URL_ environment variable.
2524

2625
### OpenAPI Specifications
2726

28-
We use our [Backend's OpenAPI spec file][1] for generating types used for deserialization of the Backend's
29-
API responses.<br/>
30-
The generated classes files are _TypeScript_ files generated in the [generated/backend](generated/backend).
31-
Which is skipped when calculating coverage thresholds. **Avoid writing code in this folder.**<br/>
32-
When the [Backend's spec file][1] is modified, we need to **manually** run the `npm run gen:backend` script.
33-
We only generate types.
27+
The OpenAPI specification is located in the [`exhort-api-spec`](https://github.com/trustification/exhort-api-spec) where the Java and Javascript libraries are generated.
3428

3529
### Code Walkthrough
3630

@@ -53,7 +47,7 @@ We only generate types.
5347

5448
This code is meant to be used as an _ESM_ module for both _JavaScript_ and _TypeScript_. So make sure you add type
5549
declarations if needed.<br/>
56-
Note the [sources](src) are in _JavaScript_, and the [generated](generated/backend) _Backend_ types are in _TypeScript_.
50+
Note the [sources](src) are in _JavaScript_.
5751
Both will be compiled as an _ESM Module_ including declarations (_x.d.ts_) in the ignored _dist_ using the
5852
`npm run compile` script and the [tsconfig.json](tsconfig.json) configuration file. Also note the _TypeScript_ files are
5953
excluded from both linting and coverage.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Exhort JavaScript API<br/>![latest-no-snapshot][0] ![latest-snapshot][1]
22

3+
* Looking for the OpenAPI Spec? Try [Exhort API Spec](https://github.com/trustification/exhort-api-spec)
34
* Looking for our Java API? Try [Exhort Java API](https://github.com/trustification/exhort-java-api).
45
* Looking for our Backend implementation? Try [Exhort](https://github.com/trustification/exhort).
56

generated/backend/Analysis200Response.d.ts

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

generated/backend/Analysis200Response.js

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

0 commit comments

Comments
 (0)