Running with a project that uses yarn
creates a package-lock.json
file #560
Open
Description
It seems like this script does not respect projects that use yarn
and instead will always create a package-lock
file. Here is the outcome from running it on my project:
➜ npx api install @basiq/v3.0#73eilabzsv3b
✔ What language would you like to generate an SDK for? › TypeScript
✔ Fetching your API
✔ Generating your SDK
✔ Saving your SDK into your codebase
⚠ This generator requires some packages to be installed alongside it:
› api: Required for the `api/dist/core` library that the codegen''d SDK uses for making requests. https://npm.im/api
› json-schema-to-ts: Required for TypeScript type handling. https://npm.im/json-schema-to-ts
› oas: Used within `api/dist/core` and is also loaded for TypeScript types. https://npm.im/oas
✔ OK to proceed with package installation? … yes
✔ Installing required packages
🚀 All done!
➜ git status
On branch basiq-connect
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: yarn.lock
Untracked files:
(use "git add <file>..." to include in what will be committed)
.api/
package-lock.json
no changes added to commit (use "git add" and/or "git commit -a")
I am not sure why the package-lock.json
file is there at all - I don't think it will do anything since I am using yarn
.
Furthermore I also am not sure how I would go about importing the downloaded SDK. I can see the files under ./.api
but there is nothing in the documentation instructing me on how to consume them. Do I need to add a local file entry to package.json
?
➜ tree -L 3 .api
.api
├── api.json
└── apis
└── basiq
├── index.ts
├── node_modules
├── openapi.json
├── package-lock.json
├── package.json
├── schemas.ts
└── types.ts