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

@team-venture-company/backstage-plugin-scaffolder-backend-module-actions

v1.0.4

Published

The teamventureco-actions module for @backstage/plugin-scaffolder-backend

Downloads

5

Readme

backstage-plugin-scaffolder-backend-module-actions

Welcome to the Team Venture Co action repository for the Backstage scaffolder-backend.

This plugin contains a single action currently, but more will be added as time allows.

  • teamventureco:fetch

Getting started

You need to configure the actions in your backend:

From your Backstage root directory

# From your Backstage root directory
yarn --cwd packages/backend add @team-venture-company/backstage-plugin-scaffolder-backend-module-actions

Configure the actions (you can check the docs to see all options):

// packages/backend/src/index.ts
const backend = createBackend();

// ...

backend.add(
  import(
    '@team-venture-company/backstage-plugin-scaffolder-backend-module-actions'
  ),
);

The teamventureco:fetch custom action leverages the built-in fetchFile function from the @backstage/plugin-scaffolder-node package to streamline the process of retrieving files from external sources. The fetchFile function supports fetching content from a variety of URL types, including Git repositories and HTTP(S) endpoints, and seamlessly integrates with Backstage's URL reader service. This ensures robust handling of different SCM integrations and protocols, while also supporting authenticated requests via optional tokens. By using fetchFile, the action not only simplifies the retrieval of files but also provides safety mechanisms such as secure path resolution and compatibility with Backstage’s URL reading infrastructure.

Using the template

After loading and configuring the actions, you can use it in your template:

# template.yaml

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: example-template
  title: Example Template
  description: Show how to fetch multiple files and add them to a repository
spec:
  owner: teamventureco-c
  type: service

  parameters:
    - title: Application Destination
      required:
        - repoUrl
      properties:
        repoUrl:
          title: Repository Location
          type: string
          description: Location the files will be stored
          ui:field: RepoUrlPicker
          ui:options:
            allowedHosts:
              - github.com

  steps:
    - id: fetch
      name: Fetch Files
      action: teamventureco:fetch
      input:
        urls:
          # Put the file in the root of the project under a new name.
          - url: https://github.com/backstage/backstage/blob/master/.editorconfig
            targetPath: .editorconfig
          # Deeply nest the file.
          - url: https://github.com/backstage/backstage/blob/master/docs/publishing.md
            targetPath: docs/publishing.md
          # Can pass a token to the underlying private repo.
          - url: https://github.com/backstage/some/private/file.go
            targetPath: my/file.go
            token: ${{ secrets.USER_OAUTH_TOKEN }}

    - id: publish
      name: Publish
      action: publish:github
      input:
        allowedHosts: ['github.com']
        description: This is the description
        repoUrl: ${{ parameters.repoUrl }}
        defaultBranch: main

  output:
    links:
      - title: Repository
        url: ${{ steps['publish'].output.remoteUrl }}

You can find a list of all registered actions including their parameters at the /create/actions route in your Backstage application.