Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Typescript #8

Open
fayzzzm opened this issue Jul 15, 2020 · 3 comments
Open

Migrate to Typescript #8

fayzzzm opened this issue Jul 15, 2020 · 3 comments
Assignees
Labels
🔮 Future factory Update on next time
Milestone

Comments

@fayzzzm
Copy link

fayzzzm commented Jul 15, 2020

Hey, pro-js team, hope you are doing well,
It is good that you are writing such a good lib, but you are making serious mistakes of the node module resolution. Here is the thing, when you have a project and you wrote all of the code with ESNEXT (ES6+) and you expect your code should work, but node requires from you what, require() resolving of modules.

What you should do, you can migrate to typescript and write exact good tsconfig for you lib and using Makefile commands such as $(OUT_DIR)/node_modules: mkdir -p $@ ln -s ../lib $@/lib you can create node_modules folder inside of your dist | build folder and then put aliases of your lib folder to node_modules, so each require() will search for nearest node_modules.

NOTE: This type of config is used when your tsconfig has path aliases. The example, you say for every './lib/' should be replaced by 'lib' and when you build this lib stays by not changing it to the previous state as './lib/', cause of that require('lib') searches from nearest node_modules lib. If you are not using the path, then you don't need Makefile config, just write your lib with TS and build it.

Also, you can achieve the same result with webpack.

I hope, I helped you with something.

@jinnatul
Copy link
Member

@fayzzzm Hi, thanks for your opinion. We try to support ES6+ & Typescript in our library. As soon as, we publish our next version with this & some special methods. :)

@jinnatul jinnatul added the 🔮 Future factory Update on next time label Jul 15, 2020
@jinnatul jinnatul modified the milestones: 3 days, 5 days Jul 15, 2020
@fayzzzm
Copy link
Author

fayzzzm commented Jul 15, 2020

If I can help with something, I will glad.

@jinnatul
Copy link
Member

jinnatul commented Jul 16, 2020

hi @fayzzzm, if you are interested to add something new please share your idea.

Thanks
math-pro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 Future factory Update on next time
Projects
None yet
Development

No branches or pull requests

3 participants