Giter Site home page Giter Site logo

Comments (1)

samchon avatar samchon commented on August 20, 2024

nestia/test/script.sh

Lines 1 to 37 in 8087e58

#-------------------------------------------------------
# EXPERIMENTAL PROJECTS
#-------------------------------------------------------
# ALIAS WITHOUT "TSCONFIG-PATHS" IS POSSIBLE, BECAUSE SCALABILITY OF THE CODES IS SMALL
cd alias@api
npx rimraf src/api/functional
npx ts-node ../../src/bin/nestia sdk "src/controllers" --out "src/api"
# ALIAS WITOUT "TSCONFIG-PATHS" OCCURES "MODULE-NOT-FOUND" ERROR
# IT'S BECAUSE SCALABILITY OF THE CODES IS HUGE
# HOWEVER, THE "TSCONFIG-PATHS" ENFORCES "TSCONFIG.JSON" WITH "BASEURL" OPTION
cd ../alias@src
npx rimraf src/api/functional
npx ts-node -r tsconfig-paths/register ../../src/bin/nestia sdk "src/controllers" --out "src/api"
#-------------------------------------------------------
# NORMAL PROJECTS
#-------------------------------------------------------
cd ../default
npx rimraf src/api/functional
npx ts-node ../../src/bin/nestia sdk "src/controllers" --out "src/api"
cd ../tsconfig.json
npx rimraf src/api/functional
npx ts-node ../../src/bin/nestia sdk "src/controllers" --out "src/api"
cd ../nestia.config.ts
npx rimraf src/api/functional
npx ts-node ../../src/bin/nestia sdk
cd ../exclude
npx rimraf src/api/functional
npx ts-node ../../src/bin/nestia sdk "src/controllers" --exclude "src/controllers/**/throw_error.ts" --out "src/api"
cd ../reference
npx rimraf src/api/functional
npx ts-node ../../src/bin/nestia sdk "src/**/*.controller.ts" --out "src/api"

When running below script, alias@src occurs the MODULE_NOT_FOUND error. However, the alias@api does not occur any error and it succeeded to generating the SDK library. To research differences between two projects alias@src and alias@api, I used another huge backend project and configured the alias @api. By the research, I understood that the MODULE_NOT_FOUND error depdens on scalability of the project. It may origin error of the TypeScript and ts-node.

To sovle the problem, I tried to use tsconfig-paths and it was successfull. However, to utilize the tsconfig-paths, target project must have the tsconfig.json and compilerOptions.baseUrl props at the same time. If the target project does not have tsconfig.json or the compilerOptions.baseUrl, the tsconfig-paths occures its domain error.

Therefore, I've to separate the Nestia SDK generator programs to be incompatible for two cases; whether tsconfig-paths is required or not.

from nestia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.