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

[Bug?]: Generator fails if first character in [name] is '/' #11402

Open
1 task
pantheredeye opened this issue Aug 30, 2024 · 3 comments
Open
1 task

[Bug?]: Generator fails if first character in [name] is '/' #11402

pantheredeye opened this issue Aug 30, 2024 · 3 comments
Labels
bug/needs-info More information is needed for reproduction topic/cli topic/generators-&-scaffolds

Comments

@pantheredeye
Copy link
Collaborator

What's not working?

Related Closed Issue

The generator cli tool is not preventing using / at the beginning of the .

The generator cli should prevent using / at the beginning of the name. It should allow / after the first character to create nested pages.

from this comment and related issue:

I think we just need a check that the [name] positional argument to these generators can't start with a /. This would be used in any generator that creates a file:

cell
component
dataMigration
directive
function
layout
model
page
scaffold
script
sdl
service


Here is the current action:

$ yarn rw g page /test
← Reverted because: Unexpected token, expected "}" (15:27)
13 |       <p>
14 |         My default route is named <code>c:/programFiles/git/test</code>, link to me with `
15 |         <Link to={routes.c:/programFiles/git/test()}>CProgramFilesGitTest</Link>`
|                           ^
16 |       </p>
17 |     </>
18 |   )
◼ Updating routes file...
◼ Generating types...
◼ One more thing...

and

$ yarn rw g page /
← Reverted because: Unexpected token, expected "}" (15:27)
13 |       <p>
14 |         My default route is named <code>c:/programFiles/git/</code>, link to me with `
15 |         <Link to={routes.c:/programFiles/git/()}>CProgramFilesGit</Link>`
|                           ^
16 |       </p>
17 |     </>
18 |   )

How do we reproduce the bug?

run yarn rw g page /

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this
@pantheredeye pantheredeye added the bug/needs-info More information is needed for reproduction label Aug 30, 2024
@Tobbe
Copy link
Member

Tobbe commented Sep 2, 2024

@pantheredeye Can you please update the title/name of this issue to be more descriptive? Thanks! 🙏

@pantheredeye pantheredeye changed the title [Bug?]: [Bug?]: Generator fails if first character in [name] is '/' Sep 2, 2024
@pantheredeye
Copy link
Collaborator Author

Yep. Funny, I remember typing one out. Maybe I restarted the issue and forgot to write it the second time 🤷‍♂️ 🚀

@dthyresson
Copy link
Contributor

dthyresson commented Sep 3, 2024

@pantheredeye Could you share your Routes.tsx file and show what the route is actually named? And the generator command you uses to create a page? Your goal was to "to create nested pages"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/cli topic/generators-&-scaffolds
Projects
None yet
Development

No branches or pull requests

3 participants