-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
feature: better frameworks like cli #115
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4c549d9:
|
Regarding #89 , templates only contain necessary files it does not include folders like node_modules etc. Well if you run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One big issue for me is now we have to maintain both examples and templates.
As we are adding the "build" process, we should copy files from examples folder, instead of copying them.
Yes, create-vue generates a |
contrib/create-waku/cli.js
Outdated
let targetDir; | ||
let defaultProjectName = 'waku-project' | ||
|
||
const CHOICES = fs.readdirSync(path.resolve(cwd, '../../examples')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work as we don't publish examples dir.
We have two options.
- add build step to copy examples dir
- download from github
Eventually, we should go with 1 because it fixes #81, but for now 2 is also fine.
If we were to go with 1, we would like to make the code in TypeScript and transpile with SWC in the build step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work as we don't publish examples dir.
We have two options.
- add build step to copy examples dir
- download from github
Eventually, we should go with 1 because it fixes #81, but for now 2 is also fine. If we were to go with 1, we would like to make the code in TypeScript and transpile with SWC in the build step.
Using esbuild,
- If we
npm run build:esbuild
anout.js
file generated. - Running
npm run build:estemplate
generates ancopy.js
file. - If we run
node copy.js
templates copied fromexample
dir and atemplate
folder generated. - Finally, running
node cli.js
works fine.
Problem with transpiling with swr
,
- If we transpiling files with
swr
then theimports
in output files are not working ex,
import { renderTemplate } from './renderTemplate'
This import statement would not be able to resolve the file.
Is, I'm missing something about this swr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I don't mind using esbuild for now. I just thought SWC might work better and we also use it in waku
. We can try that later.
Can you move TS files into ./src
folder please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure we can look around it in the near future.
Please check CI errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check CI errors again.
"dist", | ||
"template" | ||
], | ||
"type": "commonjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future TODO: make type=module and use swc instead of esbuild.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will take look into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge it. Feel free to work on improvements later.
https://www.npmjs.com/package/create-waku/v/0.5.1 is published. |
Method like other frameworks use(mainly vue).
Cli including,
Should try to commit in #52 but I messed up and also thought it's a completely new strategy so I raised this PR instead.