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

@atomist/tslint-automation

v0.2.4

Published

Run tslint on commits to projects that support it

Downloads

9

Readme

@atomist/tslint-automation

npm version Build Status

This repository contains a development automation that automatically runs TSLint on every push of a TypeScript project. In doing so, it provides a central, convenient way for you to ensure all TypeScript projects in your organization are properly linted. This automation used the Atomist automation API.

The project uses the @atomist/automation-client node module to implement a local client that connects to the Atomist API.

Prerequisites

Below are brief instructions on how to get started running this project yourself. If you just want to use the core functionality of Atomist, see the Atomist documentation. For more detailed information on developing automations, see the Atomist Developer Guide.

GitHub account

You must have a GitHub account, either GitHub.com or GitHub Enterprise (GHE). If you want to use Atomist with GHE, please contact Atomist. The remainder of these instructions assume you have a GitHub.com account. If you do not already have a GitHub.com account, you can create one.

To run automations, you will need a GitHub personal access token with "read:org" scope. You can create one yourself or use the Atomist CLI to do it for you (see below).

Atomist workspace

You also need to sign up with Atomist and create a workspace. Once you have a GitHub.com account, you can sign up with Atomist at https://app.atomist.com/. Once you are registered with Atomist, you can create an Atomist workspace and add your GitHub user and/or organizations to that workspace.

Once you have created your Atomist workspace, take note of your Atomist workspace/team ID. You can always find your Atomist workspace ID on the workspace's settings page or, if you have added the Atomist app to Slack, you can send the Atomist bot the message team and it will tell you the workspace/team ID.

Slack

Atomist has a powerful Slack application, allowing you to see and act on your development activity right in Slack. Slack is not a requirement for using Atomist, but if you try it, you'll probably like it. If you do not have access to a Slack team, it is easy to create your own.

In your Slack team, install the Atomist app in Slack, click the button below.

Once installed, the Atomist bot will guide you through connecting Atomist, Slack, and GitHub.

Configuration

Once you have GitHub and Atomist set up, install the Atomist CLI and configure your local environment.

$ npm install -g @atomist/automation-client
$ atomist config

The second command does two things: records what Atomist workspace/team you want your automations running in and creates a GitHub personal access token with "repo" and "read:org" scopes.

The script will prompt you for your Atomist workspace/team ID, or you can supply it using the --team TEAM_ID command-line option. You can get your Atomist team ID from the settings page for your Atomist workspace or by typing team in a DM to the Atomist bot.

The script will prompt you for your GitHub credentials. It needs them to create the GitHub personal access token. Atomist does not store your credentials and only writes the generated token to your local machine.

The Atomist API client authenticates using a GitHub personal access token. The Atomist API uses the token to confirm you are who you say you are and are in a GitHub organization connected to the Slack team in which you are running the automations. In addition, it uses the token when performing any operations that access the GitHub API.

Running

You can run this automation using its Docker container, e.g., in Kubernetes, or locally.

Docker and Kubernetes

To download and run the Docker image of this project, run the following command

$ docker run --rm -e ATOMIST_TOKEN=YOUR_TOKEN -e ATOMIST_TEAMS=TEAM_ID \
    atomist/tslint-automation:VERSION

replacing YOUR_TOKEN and TEAM_ID with the token and team ID from your ~/.atomist/client.config.json created above by the atomist config command and VERSION with the latest release of this repo. Note that this will not be running any code from your local machine but the code in the Docker image.

To run the Docker image in a Kubernetes cluster, you can use the deployment spec from this repository as a starting point. Before creating the deployment resource, you will need to create a secret with the following command, replacing TOKEN and TEAM_ID as above.

$ kubectl create secret generic automation --from-file=$HOME/.atomist/client.config.json
$ kubectl create -f assets/kube/deployment.yaml

Locally

You will need to have Node.js installed. To verify that the right versions are installed, run:

$ node -v
v9.7.1
$ npm -v
5.6.0

The node version should be 8 or greater and the npm version should be 5 or greater.

Cloning the repository and installing dependencies

To get started run the following commands to clone the project, install its dependencies, and build the project:

$ git clone [email protected]:atomist/tslint-automation.git
$ cd tslint-automation
$ npm install
$ npm run build

Starting up the automation-client

You can run this repository locally, allowing you to change the source code of this project and immediately see the effects in your environment with the following command

$ npm run autostart

To run in a more traditional manner, build the project and then simple start it.

$ npm start

Using

This automation should run on every push in all of the GitHub organizations linked to your Atomist workspace.

Support

General support questions should be discussed in the #support channel in our community Slack team at atomist-community.slack.com.

If you find a problem, please create an issue.

Development

You will need to install node to build and test this project.

Build and Test

Command | Reason ------- | ------ npm install | install all the required packages npm run build | lint, compile, and test npm start | start the Atomist automation client npm run autostart | run the client, refreshing when files change npm run lint | run tslint against the TypeScript npm run compile | compile all TypeScript into JavaScript npm test | run tests and ensure everything is working npm run autotest | run tests continuously npm run clean | remove stray compiled JavaScript files and build directory

Release

To create a new release of the project, update the version in package.json and then push a tag for the version. The version must be of the form M.N.P where M, N, and P are integers that form the next appropriate semantic version for release. The version in the package.json must be the same as the tag. For example:

$ npm version 1.2.3
$ git tag -a -m 'The ABC release' 1.2.3
$ git push origin 1.2.3

The Travis CI build (see badge at the top of this page) will publish the NPM module and automatically create a GitHub release using the tag name for the release and the comment provided on the annotated tag as the contents of the release notes.


Created by Atomist. Need Help? Join our Slack team.