npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@qtorque/backstage-plugin-torque-backend

v0.1.5

Published

`@qtorque/backstage-plugin-torque-backend` is a plugin for the Backstage backend app. It provides a route that `@qtorque/backstage-plugin-torque` is using to communicate with Torque API and scaffolder action to create a service and all needed infrastructi

Downloads

2

Readme

@qtorque/backstage-plugin-torque-backend

@qtorque/backstage-plugin-torque-backend is a plugin for the Backstage backend app. It provides a route that @qtorque/backstage-plugin-torque is using to communicate with Torque API and scaffolder action to create a service and all needed infrastruction with Torque.

Installation

  1. Install @qtorque/backstage-plugin-torque-backend plugin with,
yarn workspace backend add @qtorque/backstage-plugin-torque-backend
  1. Create ./packages/backend/src/plugins/torque.ts with the following content,
import { createRouter } from '@qtorque/backstage-plugin-torque-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  return await createRouter({
    logger: env.logger,
    config: env.config,
  });
}
  1. Add torque api route to ./packages/backend/src/index.ts.
import search from './plugins/search';
+ import torque from './plugins/torque';

const searchEnv = useHotMemoize(module, () => createEnv('search'));
+ const torqueEnv = useHotMemoize(module, () => createEnv('torque'));

const apiRouter = Router();
apiRouter.use('/catalog', await catalog(catalogEnv));
+ apiRouter.use('/torque', await torque(torqueEnv));
  1. Add configuration to app-config.yaml
torque:
  token: ${TORQUE_TOKEN} # without Bearer
  executionHost: ${TORQUE_AGENT_NAME} # the name of agent registered in Torque
  serverUrl: ${TORQUE_URL} # default is https://portal.qtorque.io
  ghAccessToken: ${GITHUB_TOKEN} # github token

Scaffolder Actions

This plugin provides the following scaffolder actions:

create-app

create-app will prepare an infrastructure in Torque and create an environment for service.

Installation

To make this action available, you can add it to your scaffolder plugin configuration in ./packages/backend/src/plugins/scaffolder.ts

# import createTorqueApp action
+ import { createTorqueApp } from "@qtorque/backstage-plugin-torque-backend";

# register the action
  const actions = [
    ...builtInActions,
    createTorqueApp({
+      token: config.getString('torque.token'),
+      executionHost: config.getString('torque.executionHost'),
+      ghAccessToken: config.getString('torque.ghAccessToken'),
+      serverUrl: config.getOptionalString('torque.serverUrl')
    })
  ];

Usage

Add the action to your template,

    - name: Deploy with Torque
      id: torque-app-id
      action: torque:create-app
      input:
        serviceName: ${{ parameters.componentName }} # The name of service that will be created in Torque. 
        # Will be used as space, assets repo, blueprint repo and grain names
        assetRepo: ${{ steps.publish.output.remoteUrl }} # The asset repo that will be connected to Torque
        blueprintRepo: ${{ steps.publish.output.remoteUrl }} # The blueprints repo that will be connected to Torque
        serviceAccount: 'default' # A k8s service account to assign to agent
        namespace: default # A k8s namespace to assign to agent
        blueprintName: ${{ parameters.componentName }} # The name of a blueprint you that will be a source for sandbox environment