Skip to content

nestia/SDK issues: Invalid Types, and Incomplete API Generation #677

Open
@Val0429

Description

Summary

  • SDK Version: nestia@4.5.1, @nestia/sdk@2.0.4
  • Expected behavior:
    1. The types inside SDK api should all be valid.
    2. The CRUD input / output types should all be generated.
    3. The distribution package should be successfully generated.
    4. The "shared" type should be copy over into packages/api.
  • Actual behavior:
    1. There are type named "___type" which are not valid from the export location.
    2. In my example repository, only "Create" api is correctly generated. "Read" / "Update" / "Delete" is missing.
    3. The distribution package is missing the functional folder.
    4. 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.

image

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.

image
image

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.

image

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.

image

Metadata

Assignees

Labels

duplicateThis issue or pull request already existsenhancementNew feature or requestquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions