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 solid-start routes command #609

Merged
merged 1 commit into from
Dec 31, 2022
Merged

Conversation

nirtamir2
Copy link
Contributor

@nirtamir2 nirtamir2 commented Dec 30, 2022

This PR creates routes command in solid-start cli.
This is similar to remix cli route --json command.
https://github.com/remix-run/remix/blob/main/packages/remix-dev/cli/run.ts#LL26C8-L26C8

It allows you to see the generated page routes.

In an example run of solid-start routes of some solid-start project with simple routes, The printed result can be

[
  {
    id: '/index',
    path: '/',
    componentPath: 'src/routes/index.tsx',
    dataPath: 'src/routes/index.tsx?data'
  },
  { id: '/test', path: '/test', componentPath: 'src/routes/test.tsx' },
  {
    id: '/api/something/(other)',
    path: '/api/something',
    componentPath: 'src/routes/api/something/(other).tsx'
  },
  {
    id: '/api/something/[id]',
    path: '/api/something/:id',
    componentPath: 'src/routes/api/something/[id].tsx'
  }
]

NOTICE:

I'm not sure it's useful.
I created a PR because it may be useful and I wanted it in order to create a plugin for routes-gen
to create type-safe page routes (without manually cloning solid-start page regexes).

See sandulat/routes-gen#29
Also - see #588

TODO

  • Edit docs with this command (if approved)

@ryansolid ryansolid merged commit 31ad96c into solidjs:main Dec 31, 2022
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.

None yet

2 participants