Skip to content

Commit

Permalink
Merge pull request #208 from FoxxMD/vegaSchema
Browse files Browse the repository at this point in the history
fix: Replace typescript-json-schema with ts-json-schema-generator
  • Loading branch information
FoxxMD authored Oct 11, 2024
2 parents 601228a + 908d7d4 commit 5e95f60
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 11,012 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ RUN npm run docs:install && npm run build && rm -rf node_modules && rm -rf docsi

FROM base as app

COPY --chown=abc:abc package*.json ./
COPY --chown=abc:abc *.json *.js *.ts index.html ./
COPY --chown=abc:abc patches ./patches
COPY --from=build --chown=abc:abc /app/dist /app/dist
COPY --from=build --chown=abc:abc /app/src /app/src
Expand All @@ -106,8 +106,8 @@ ENV APP_VERSION=$APP_BUILD_VERSION
RUN npm ci --omit=dev \
&& npm cache clean --force \
&& chown -R abc:abc node_modules \
&& rm -rf node_modules/@types \
/root/.cache
&& rm -rf /root/.cache


ARG webPort=9078
ENV PORT=$webPort
Expand Down
301 changes: 150 additions & 151 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"type": "module",
"description": "scrobble plays from multiple sources to multiple clients",
"scripts": {
"schema": "npm run -s schema-aio & npm run -s schema-source & npm run -s schema-client & npm run -s schema-aiosource & npm run -s schema-aioclient",
"schema-client": "typescript-json-schema src/backend/tsconfig.json ClientConfig --out src/backend/common/schema/client.json --required --titles --tsNodeRegister --refs --validationKeywords deprecationMessage --constAsEnum",
"schema-source": "typescript-json-schema src/backend/tsconfig.json SourceConfig --out src/backend/common/schema/source.json --required --titles --tsNodeRegister --refs --validationKeywords deprecationMessage --constAsEnum",
"schema-aio": "typescript-json-schema src/backend/tsconfig.json AIOConfig --out src/backend/common/schema/aio.json --required --titles --tsNodeRegister --refs --validationKeywords deprecationMessage --constAsEnum",
"schema-aiosource": "typescript-json-schema src/backend/tsconfig.json AIOSourceConfig --out src/backend/common/schema/aio-source.json --titles --required --tsNodeRegister --refs --validationKeywords deprecationMessage --constAsEnum",
"schema-aioclient": "typescript-json-schema src/backend/tsconfig.json AIOClientConfig --out src/backend/common/schema/aio-client.json --titles --required --tsNodeRegister --refs --validationKeywords deprecationMessage --constAsEnum",
"schema": "tsx src/backend/utils/SchemaStaticUtil.ts",
"circular": "madge --circular --extensions ts src/index.ts",
"test": "npm run -s test:backend",
"test:backend": "mocha --reporter spec",
Expand Down Expand Up @@ -62,6 +57,7 @@
"@react-nano/use-event-source": "^0.13.0",
"@reduxjs/toolkit": "^1.9.5",
"@supercharge/promise-pool": "^3.0.0",
"@types/express-serve-static-core": "^4.19.6",
"address": "^1.2.2",
"ajv": "^8.12.0",
"autoprefixer": "^10.4.17",
Expand Down Expand Up @@ -109,8 +105,8 @@
"superagent": "^8.0.9",
"tailwindcss": "^3.4.4",
"toad-scheduler": "^3.0.0",
"ts-json-schema-generator": "^2.3.0",
"tsx": "^4.7.0",
"typescript-json-schema": "^0.61.0",
"vite-express": "^0.16.0",
"vlc-client": "^1.1.1",
"xml2js": "0.6.0",
Expand Down
26 changes: 26 additions & 0 deletions patches/ts-json-schema-generator+2.3.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/node_modules/ts-json-schema-generator/dist/src/AnnotationsReader/ExtendedAnnotationsReader.js b/node_modules/ts-json-schema-generator/dist/src/AnnotationsReader/ExtendedAnnotationsReader.js
index 107dc62..6b7c311 100644
--- a/node_modules/ts-json-schema-generator/dist/src/AnnotationsReader/ExtendedAnnotationsReader.js
+++ b/node_modules/ts-json-schema-generator/dist/src/AnnotationsReader/ExtendedAnnotationsReader.js
@@ -49,7 +49,7 @@ class ExtendedAnnotationsReader extends BasicAnnotationsReader_js_1.BasicAnnotat
.replace(/\r/g, "")
.trim();
const description = markdownDescription.replace(/(?<=[^\n])\n(?=[^\n*-])/g, " ").trim();
- return this.markdownDescription ? { description, markdownDescription } : { description };
+ return this.markdownDescription ? { description: markdownDescription } : { description };
}
getTypeAnnotation(node) {
const symbol = (0, symbolAtNode_js_1.symbolAtNode)(node);
diff --git a/node_modules/ts-json-schema-generator/src/AnnotationsReader/ExtendedAnnotationsReader.ts b/node_modules/ts-json-schema-generator/src/AnnotationsReader/ExtendedAnnotationsReader.ts
index ba8fd57..806396c 100644
--- a/node_modules/ts-json-schema-generator/src/AnnotationsReader/ExtendedAnnotationsReader.ts
+++ b/node_modules/ts-json-schema-generator/src/AnnotationsReader/ExtendedAnnotationsReader.ts
@@ -57,7 +57,7 @@ export class ExtendedAnnotationsReader extends BasicAnnotationsReader {

const description = markdownDescription.replace(/(?<=[^\n])\n(?=[^\n*-])/g, " ").trim();

- return this.markdownDescription ? { description, markdownDescription } : { description };
+ return this.markdownDescription ? { description: markdownDescription } : { description };
}
private getTypeAnnotation(node: ts.Node): Annotations | undefined {
const symbol = symbolAtNode(node);
13 changes: 0 additions & 13 deletions patches/typescript-json-schema+0.61.0.patch

This file was deleted.

Loading

0 comments on commit 5e95f60

Please sign in to comment.