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

generate routes.json file from compute file #362

Open
1 of 3 tasks
veeramarni opened this issue Mar 26, 2024 · 0 comments
Open
1 of 3 tasks

generate routes.json file from compute file #362

veeramarni opened this issue Mar 26, 2024 · 0 comments

Comments

@veeramarni
Copy link
Collaborator

veeramarni commented Mar 26, 2024

  • 1. Generate <package>/lib/routes.json file for each browser package. We added a rollup plugin which generates this by reading through all compute.tsx from the lib directory.

  • 2. We need to also add file: reference in the object pointing to the location of the component. (right now it is not working).
    Changes are in this branch Feat/generate routes #361

  • 3. After this sorted, next we need to create a plugin in vite to gather all the <packages>/lib/routes.json and generate react-router v6 compatible configuration file which can be used in remix.

generated routes.json

[
  {
    "/apollo-server-n-client": {
      "exact": false,
      "icon": "export",
      "key": "dashboard",
      "tab": "Apollo Server",
      "position": "MIDDLE",
      "name": "Apollo Server",
      "path": "/apollo-server-n-client",
      "file": {}
    }
  },
  {
    "/apollo-server-n-client/counter": {
      "key": "counter",
      "name": "Counter",
      "icon": "appstore-o",
      "position": "MIDDLE",
      "path": "/apollo-server-n-client/counter"
    }
  },
  {
    "/": {
      "path": "/",
      "key": "home",
      "exact": true,
      "name": "Home",
      "position": "MIDDLE",
      "file": {}
    }
  },
  {
    "/emotion": {
      "tab": "Emotion Styling",
      "key": "emotion",
      "position": "MIDDLE",
      "name": "Emotion Styling",
      "path": "/emotion",
      "file": {}
    }
  },
  {
    "/redux-first-history": {
      "exact": false,
      "icon": "export",
      "position": "MIDDLE",
      "name": "Redux First History",
      "key": "/redux-first-history",
      "path": "/redux-first-history",
      "file": {}
    }
  },
  {
    "/redux-first-history/hello": {
      "exact": true,
      "icon": "export",
      "name": "Hello",
      "position": "MIDDLE",
      "key": "/redux-first-history/hello",
      "path": "/redux-first-history/hello",
      "file": {}
    }
  },
  {
    "/redux-first-history/counter": {
      "exact": true,
      "icon": "export",
      "name": "Counter",
      "position": "MIDDLE",
      "key": "/redux-first-history/counter",
      "path": "/redux-first-history/counter",
      "file": {}
    }
  }
]
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

No branches or pull requests

1 participant