meltano / hub

The single source of truth for all Meltano plugins, including all available Singer Taps and Targets: https://hub.meltano.com
https://hub.meltano.com
50 stars 68 forks source link

change(gridsome): add redirects from deprecated singer-specific detail pages #795

Closed aaronsteers closed 2 years ago

aaronsteers commented 2 years ago

We previously hosted Singer-specific detail pages for extractors and loaders.

We can redirect all of these endpoints to the generic plugin endpoints.

E.g.

rwfeather commented 2 years ago

Pasting from another comment I made:

@rwfeather - Is there a simple means to add these redirects?

  // Create default variant pages
  api.createPages(async ({ createPage, graphql }) => {
    const defaultPlugins = await graphql(`...`)

    Object.keys(defaultPlugins.data).forEach((query) => {
      // For each default plugin we create an extra page one-level up
      defaultPlugins.data[query].edges.forEach(({ node }) => {
        createPage({
          // Remove the variant part of the path
          path: node.path.split("--")[0],
          // And send it to the same rendering template
          component: `./src/templates/Plugins.vue`,
          context: {
            id: node.id,
            // This is the path given to the `page-query` to do the lookup
            path: node.path,
            name: node.name,
          },
        });
      });
    });

For the second method, If there's any conditional rendering we want to do on the plugin page, it'll be possible to add something like an isSinger to the context object.

First method will be a lot lower-code and easier.

aaronsteers commented 2 years ago

As noted in https://github.com/meltano/hub/issues/793#issuecomment-1254240358:

@rwfeather - We are approved to remove these:

  1. The JSON API endpoints for taps and targets. (Users will be recommended to use the newer API which covers all meltano plugin types.)
  2. The Singer tap/target index and detail pages. (Redirect to 'extractor'/'loader' equivalents.)

rwfeather commented 2 years ago

Resolved in #824