Description
Summary
- SDK Version: nestia@4.5.1, @nestia/sdk@2.0.4
- Expected behavior:
- The types inside SDK api should all be valid.
- The CRUD input / output types should all be generated.
- The distribution package should be successfully generated.
- The "shared" type should be copy over into
packages/api
.
- Actual behavior:
- There are type named "___type" which are not valid from the export location.
- In my example repository, only "Create" api is correctly generated. "Read" / "Update" / "Delete" is missing.
- The distribution package is missing the functional folder.
- In the packages/api directory, designed for npm distribution, the "shared" type remains in relative directories. It should be copied over to the distribution folder for proper npm distribution.
Detail
I have created a GitHub repository to replicate these issues. You can find it here
To make it work, you can simply run npm i
and then npx nestia sdk
.
Issue 1: Invalid Types Named "___type"
There are multiple "__type" imports from locations where they are not valid.
Issue 2: Incomplete API Generation
This issue is closely related to the first one. For example, the "Read" API is not functioning properly due to Primitive<__type & __type>
. Additionally, TypeScript warns about "ES2015 module syntax" being preferred over namespaces.
Issue 3: The distribution package functional
folder is missing.
The functional
folder exists inside src/api
but is missing from the packages/api
directory, which is set up for distribution.
Issue 4: "Shared" Type Location for NPM Distribution
There are relative path imports in the "distribution" directory, which may cause complications when publishing to npm. To resolve this, it's advisable to copy them into the distribution folder.