-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add create-yorkie-app #643
Conversation
Any ideas on this issue @chacha912 @mojosoeun @blurfx? |
@se030 also, please sign your CLA! |
Can you give us more details on how to reproduce that issue? it doesn't seem to me to be a problem. I followed these steps:
|
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.
Thank you for great work! but I think we should discuss project structure now. Technically, create-yorkie-app is not part of the js sdk and it sharing a hoisted dependency, which is causing a dependency conflict. And even if we resolve the dependency issue, there could be ghost dependency problem.
So I think we should configuring it to monorepo(workspace) like examples. what do you think? @yorkie-team/maintainers @yorkie-team/mentors @se030
@blurfx Thanks for the suggestion. I also agree with you. It would be good to move |
@blurfx Sorry for the late reply. Does the output file For the workspace issue, I'll move these sources to |
It seems okay to me. this is part of build output of mine, and there is Could you try remove // ...
console.log(`\nScaffolding project in ${root}...`);
const templateDir = external_node_path_default().resolve((0,external_node_url_namespaceObject.fileURLToPath)(import.meta.url), `../examples/${template}`);
// ... |
Thanks for your comment. |
@se030 I think ghost dependency issue causes this problem. Setting a workspace can solve this problem. I accidentally closed the PR. I just reopened it. Sorry! |
- add build script for create-yorkie-app - webpack.config) remove unnecessary output.library option and clarify output type as module
c6cecc8
to
460cabb
Compare
By Create tools/ npm workspace and move create-yorkie-app under it commit there are two workspaces in yorkie-js-sdk. create-yorkie-app is closely tied to the example apps and its build script copies the whole This way we can remove (tiny but) unnecessary copy process and users/contributors may also recognize what does Any opinions on this suggestion? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #643 +/- ##
==========================================
+ Coverage 67.92% 67.94% +0.02%
==========================================
Files 58 58
Lines 8747 8783 +36
Branches 788 795 +7
==========================================
+ Hits 5941 5968 +27
- Misses 2547 2555 +8
- Partials 259 260 +1 ☔ View full report in Codecov by Sentry. |
First, there's something we need to know: For example, the file tree and example code section on the left side of profile stack example page are statically generated from So my opinion is: FYI: |
so that create-yorkie-app users do not need to configure local Yorkie server
06fe482
to
a430de3
Compare
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.
Thank you. I've left a couple of comments.
a9325d6
to
7baa69f
Compare
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.
Thank you for your contribution. Great work 👍
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.
Thanks for your contribution.
I left comments about how to use it and how to test it.
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.
LGTM. Thank you for your contribution :)
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.
LGTM. 👍
This commit introduces CLI starter kit, enabling users to easily scaffold Yorkie-based cooperative applications. The goal is to provide a convenient way for users to kickstart their projects using Yorkie. All source codes related to this pull request have been organized within the tools/create-yorkie-app directory.
I merged the PR to test the Additionally, We need to think about version policies considered with yorkie-js-sdk version and its dependencies in the scaffolding. @blurfx @se030 Can you help us create a branch in the origin repository rather than the forked repository? We can easily fix the problems together. |
@hackerwins Do you mean creating a branch for testing in this repository? |
@blurfx Yes. |
I've created |
@se030 Could you explain the dependency between examples in JS SDK and create-yorkie-app? I think I can understand by knowing the way to fetch examples in create-yorkie-app. If it has dependencies the version should match both, if it is not, it is ok that create-yorkie-app has its own version. |
], | ||
"scripts": { | ||
"build": "webpack --config ./webpack.config.js && npm run build:copy-assets", | ||
"build:copy-assets": "cp -r ../../examples ./dist && cp ./.env ./dist/.env", |
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.
Could you explain the dependency between examples in JS SDK and create-yorkie-app? I think I can understand by knowing the way to fetch examples in create-yorkie-app.
@hackerwins As you can see in this build script, the bundled package shd include examples directory to provide functionality from npm registry (like npx create-yorkie-app
). So updating the source codes of example projects would require version update of the package.
Since updating yorkie-js-sdk version for examples/
projects is instructed to be done manually, the following version update should also be done manually (seems nice to add this instruction to MAINTAINING.md).
If it has dependencies the version should match both, if it is not, it is ok that create-yorkie-app has its own version.
Can you give more explanations about this? I'm not sure if information above is enough.
@blurfx By the way, I found this build:copy-assets
script and .env file under create-yorkie-app directory are no longer used. We can remove the .env file and modify package.json as:
"scripts": {
"build": "webpack --config ./webpack.config.js && cp -r ../../examples",
"start": "npm run build && node dist/create-yorkie-app.mjs"
},
Sorry that I haven't cleaned up well. I tried to add commits to #690 but permission was denied. Could you please reflect these changes?
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.
Now that you have permission, could you push commits to #690?
What this PR does / why we need it?
Any background context you want to provide?
All source codes related to this PR are put in the
tools/create-yorkie-app
directorycreate-yorkie-app
package needs to be bundled to be published as a binary script package (to be used like npx create-yorkie-app)used webpack bundler which is already used and installed on this project
The output bundle includes
This chunk of work needs to be npm-published independently
Referred to
create-vite
What are the relevant tickets?
create-yorkie-app
#558Checklist