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

add experimental codes for plop #1217

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

seiya0914
Copy link
Collaborator

@seiya0914 seiya0914 commented Mar 19, 2024

Pull Request Checklist

  • I have checked that this pull request is not a duplicate of a pre-existing pull request
  • I have self-reviewed my changes
    • There are no spelling mistakes
    • There are no remaining debug log prints (i.e. console.log())
    • Comments were written for complex code
  • I have checked that all tests are passing (for bug fixes and enhancements)
    • CLI Test (npm run test:cli)
    • Unit Test (npm run test:modules)
    • E2E Test (npm run e2e)
  • I have added and/or modified relevant tests for my changes (for bug fixes and enhancements)
  • I have added and/or modified relevant documentations for my changes (if necessary)

Description

This PR is to share the basic usage for plop.js.
Related Issue #1190

2024-03-19.18.44.47.mov

Copy link

changeset-bot bot commented Mar 19, 2024

⚠️ No Changeset found

Latest commit: 1618fef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@seiya0914
Copy link
Collaborator Author

I can't see the picture of the goal...
I'd like to create visualized picture to clarify what we want to achieve with plop.

@seiya0914
Copy link
Collaborator Author

@seiya0914 cc: @jinmayamashita

  • Try to implement a generator using plop API, not plop CLI.
  • create sample.ts and generate sample route or whatever.

sample script

// sample.ts

plop.generateCode({ generator: '../path/plopfile.js'})

@seiya0914
Copy link
Collaborator Author

@jinmayamashita
1618fef
I found out that we can run plopfile through node.js. I added sample code.

2024-03-25.17.30.07.mov

@jinmayamashita
Copy link
Collaborator

jinmayamashita commented Mar 25, 2024

#1217 (comment)

@seiya0914 Nice! Is it possible to generate a file without going through the plop prompt?

ml-frontend/plopfile.js

Lines 9 to 13 in 1618fef

prompts: [{
type: 'input',
name: 'name',
message: 'Component name?',
}],

(Can we use "bypass" for that?) https://plopjs.com/documentation/#3rd-party-prompt-bypass

@jinmayamashita
Copy link
Collaborator

jinmayamashita commented Apr 18, 2024

it possible to generate a file without going through the plop prompt?

FYI @ptrkdan @seiya0914
It looks like we can use the actions without utilizing Plop's prompts, by using a different CLI instead. 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants