Find here an overview of the steps taken to integrate the core code of vc-service in this project.
We install what we need to make a library with included CLI, written in Typescript, tested with vitest.
File tsconfig.json copied from vc-service/tsconfig.json, and applied following modifications:
- enabled
"declaration": true, - enabled
"declarationMap": true, - enabled
"sourceMap": true,
In package.json, latest versions of packages are used, except for:
- "typescript": "5.4.3": set to fixed version, because latest gives issues in vc-service code:
src/implementations/solid/controller/index.ts:261:28 - error TS2322: Type 'Buffer<ArrayBufferLike>' is not assignable to type 'BlobPart'..
Sources copied from vc-service/src are here in directory structure `src/implementations/solid.
Not copied:
vc-service/src/index.ts: that one implemented a web service.
Modifications to the copied sources:
- Changed
console.to// LOG console.to disable console output from deep in the implementation. Advice: to enable this console output temporarily, replace// LOG console.with/ LOG */ console.and do the inverse replacement when done. controller/index.ts: functionpreloadDocumentLoaderContexts()was removed. Actions are now in src/api-spec.ts:SolidApi.getPreloadedJdl().vcCore.ts:jdlis longer constructed here but in src/api-spec.ts, where it is also preloaded.
- src/api-spec.ts: the generic API specification
- src/cli.ts: a command line interface, meant to cover all implementations
- src/implementations/solid/api.ts: implementation of the generic API specification, for the Solid case
File test/library.test.ts is a Vitest test for all implementations as Typescript libraries. File test/bundle.test.js is a Vitest test for all implementations as Javascript browser bundles.