xmliszt / easy-next

A convenient TypeScript template for Next13 development, integrated with TailwindCSS, UI Libraries, linters and formatters, PWA, SEO, and many more features! Written in Typescript.
https://www.npmjs.com/package/easy-next
MIT License
9 stars 3 forks source link

Adding Support for Javascript #5

Open 0xprasanth opened 11 months ago

0xprasanth commented 11 months ago

Draft pull request for issue #3

Hi, I have create two directories like template-js and template-ts , however I'm getting this error after running node index.js

Error: ENOENT: no such file or directory, lstat '../easy-next/template/config/next-pwa.config.js'
Something is wrong! Please try again!
0xprasanth commented 11 months ago

Draft pull request for issue #3

Hi, I have create two directories like template-js and template-ts , however I'm getting this error after running node index.js

Error: ENOENT: no such file or directory, lstat '../easy-next/template/config/next-pwa.config.js'
Something is wrong! Please try again!

I think I'm missing to add the new directory name but I couldn't find it how to add it

xmliszt commented 11 months ago

Draft pull request for issue #3

Hi, I have create two directories like template-js and template-ts , however I'm getting this error after running node index.js

Error: ENOENT: no such file or directory, lstat '../easy-next/template/config/next-pwa.config.js'
Something is wrong! Please try again!

I think I'm missing to add the new directory name but I couldn't find it how to add it

Hi you're right, since we change the directory names, we need to change the reference. You can find it in index.js line 160:

 const templateDir = path.resolve(__dirname, "template");

You can use the same way in index.js to ask user for choosing Typescript or Javascript (default to typescript), and based on their selection, use template-ts or template-js as the directory name. You can use the constants in constants.js -> K.js and K.ts for the display name

0xprasanth commented 11 months ago

Thanks :) It was helpful, I'll start working on it