Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hashicorp/platform-tools

Package Overview
Dependencies
Maintainers
33
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashicorp/platform-tools

A collection of tools and utilities for use throughout our projects.

  • 0.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.1K
increased by15.44%
Maintainers
33
Weekly downloads
 
Created
Source

@hashicorp/platform-tools

A collection of tools and utilities intended for use throughout our applications. Also includes an out-of-the-box script runner which can execute arbitrary TypeScript scripts. This is useful for writing local scripts without introducing ts-node and additional configuration. Things that might live here:

  • One-off scripts needed for use across applications
  • Codemods

Installation & Usage

npm install @hashicorp/platform-tools

Once installed, the runner can be used to execute a packaged script, or an arbitrary script in your current working directory. Running script without any arguments will return a list of the packaged scripts:

$ npx hc-tools

Expected a script name to be passed, available scripts:
  - add-deploy-preview-script

Additional arguments beyond the script name will be passed to the executed script:

$ npx hc-tools add-deploy-preview-script waypoint

# Executes the add-deploy-preview script with the argument "waypoint"

Local scripts

hc-tools can be used to run scripts defined locally in your project, for example:

$ hc-tools ./scripts/my-script.ts

As part of this, hc-tools will also load environment variables defined in .env using the same loading strategy as Next.js.

Options

  • --project [path to tsconfig] - If specified, loads the tsconfig from the specified path
  • --resolve-paths [true|false] - Controls whether or not to resolve paths based on local tsconfig settings (default: true)

Included scripts

add-deploy-preview-script

$ hc-tools add-deploy-preview-script <product>

Adds a shell script in ./scripts/website-build.sh, which is used to build deploy previews from hashicorp/dev-portal within a product repository so contributors can continue to preview their docs changes.

next-build-webpack-only

$ hc-tools next-build-webpack-only

Executes next build and short-circuits the process before static generation occurs. Helpful for more performant builds if all we care about is the compilation output (for bundle analysis, for example).

capture-build-metrics

$ hc-tools capture-build-metrics <appName>

Captures the build metrics emitted by Next during the build process and sends them to Datadog. appName should be the name of the repo.

FAQs

Package last updated on 18 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc