Compare commits
5 Commits
7238275835
...
87e05ff637
Author | SHA1 | Date | |
---|---|---|---|
87e05ff637 | |||
03a778c24f | |||
ef2bc38a63 | |||
26d518fb8e | |||
087371b3ce |
20
README.md
20
README.md
@ -5,7 +5,25 @@ The official library for the LfK [backend server](https://git.odit.services/lfk/
|
|||||||
Automagicly™ generated by [openapi-typescript-codegen](https://www.npmjs.com/package/openapi-typescript-codegen)
|
Automagicly™ generated by [openapi-typescript-codegen](https://www.npmjs.com/package/openapi-typescript-codegen)
|
||||||
|
|
||||||
## 🛠 Building
|
## 🛠 Building
|
||||||
Get's automagicly™ build by drone for every new backend release.
|
|
||||||
|
### Setup ⬇️
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://git.odit.services/lfk/lfk-client-js.git
|
||||||
|
cd lfk-client-js
|
||||||
|
pnpm i
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build 🔨
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm update:openapi # Update the openapi.json file
|
||||||
|
pnpm build # Build the project
|
||||||
|
pnpm release # Bump and release to npm
|
||||||
|
|
||||||
|
# Or just do it all in one command
|
||||||
|
pnpm update:auto
|
||||||
|
```
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
|
22
package.json
22
package.json
@ -25,7 +25,10 @@
|
|||||||
"build:prepare": "rimraf ./lib ./dist",
|
"build:prepare": "rimraf ./lib ./dist",
|
||||||
"build:lib": "openapi --input ./openapi.json --output ./lib --client fetch",
|
"build:lib": "openapi --input ./openapi.json --output ./lib --client fetch",
|
||||||
"build:compile": "tsc",
|
"build:compile": "tsc",
|
||||||
"build:cleanup": "rimraf ./lib"
|
"build:cleanup": "rimraf ./lib",
|
||||||
|
"update:openapi": "rimraf ./openapi.json && node ./scripts/getliveopenapi.js",
|
||||||
|
"update:auto": "npm run update:openapi && npm run build && npm run release",
|
||||||
|
"release": "release-it"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://git.odit.services/lfk/lfk-client-js/issues"
|
"url": "https://git.odit.services/lfk/lfk-client-js/issues"
|
||||||
@ -33,7 +36,22 @@
|
|||||||
"homepage": "https://git.odit.services/lfk/lfk-client-js/",
|
"homepage": "https://git.odit.services/lfk/lfk-client-js/",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"openapi-typescript-codegen": "0.7.0",
|
"openapi-typescript-codegen": "0.7.0",
|
||||||
|
"release-it": "17.10.0",
|
||||||
"rimraf": "6.0.1",
|
"rimraf": "6.0.1",
|
||||||
"typescript": "4.9.5"
|
"typescript": "4.9.5"
|
||||||
|
},
|
||||||
|
"release-it": {
|
||||||
|
"git": {
|
||||||
|
"commit": true,
|
||||||
|
"requireCleanWorkingDir": false,
|
||||||
|
"commitMessage": "chore(release): ${version}",
|
||||||
|
"push": true,
|
||||||
|
"tag": true,
|
||||||
|
"tagName": "${version}",
|
||||||
|
"tagAnnotation": "${version}"
|
||||||
|
},
|
||||||
|
"npm": {
|
||||||
|
"publish": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
1835
pnpm-lock.yaml
generated
1835
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
27
scripts/getliveopenapi.js
Normal file
27
scripts/getliveopenapi.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
const https = require('https');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const url = 'https://run.lauf-fuer-kaya.de/api/docs/openapi.json';
|
||||||
|
const output = 'openapi.json';
|
||||||
|
|
||||||
|
https.get(url, (res) => {
|
||||||
|
if (res.statusCode !== 200) {
|
||||||
|
console.error(`Request Failed. Status Code: ${res.statusCode}`);
|
||||||
|
res.resume();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = '';
|
||||||
|
res.on('data', chunk => data += chunk);
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.writeFile(output, data, (err) => {
|
||||||
|
if (err) {
|
||||||
|
console.error('Error writing file:', err);
|
||||||
|
} else {
|
||||||
|
console.log(`Saved latest OpenAPI JSON to ${output}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).on('error', (e) => {
|
||||||
|
console.error(`Got error: ${e.message}`);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user