Skip to content

generate routes.json file from compute file #362

Description

@veeramarni
  • 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": {}
    }
  }
]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions