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

@knapsack-pro/core

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knapsack-pro/core

Knapsack Pro Core library splits tests across CI nodes and makes sure that tests will run in optimal time on each CI node. This library gives core features like communication with KnapsackPro.com API. This library is a dependency for other projects specif

  • 1.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54K
increased by1.98%
Maintainers
2
Weekly downloads
 
Created
Source

@knapsack-pro/core

CircleCI

@knapsack-pro/core is JS npm package with core features for Knapsack Pro API. Learn how to run your tests faster with optimal test suite parallelisation using Knapsack Pro.

This package is the dependency of Knapsack Pro clients in JavaScript.

Table of Contents

FAQ

How to change log level?

You can set log level with environment variable KNAPSACK_PRO_LOG_LEVEL. The default level is info.

Available log levels (from most important to least important):

  • error - shows only critical errors
  • warn - shows warnings (e.g. Fallback Mode has started)
  • info - shows Knapsack Pro API request response body
  • verbose
  • debug - shows Knapsack Pro API request headers and body
  • silly

What happens when Knapsack Pro API is not available? How Fallback Mode works?

When Knapsack Pro API is not available or temporarily unreachable due to network problems then Fallback Mode will be started and you will see a log warning in the output.

In Fallback Mode your tests will be executed and split based on test file names across CI nodes. If in the meantime other CI nodes were able to connect to Knapsack Pro API then you may notice that some of the test files were executed twice across CI nodes. Fallback Mode guarantees each of test files is run at least once as a part of CI build.

If during CI build runtime connection to Knapsack Pro API is lost, Fallback Mode would run tests except those executed so far.

Development

Setup

  1. Install dependencies:

    $ npm install
    
  2. Compile TypeScript code to lib directory by running:

    $ npm start
    
  3. Register @knapsack-pro/core package globally in your local system. This way we will be able to develop other npm packages dependent on it:

    $ npm link
    
  4. Set up your IDE:

    • WebStorm / PhpStorm

      • Install the following plugins:

      • Go to File > Settings > Languages & Frameworks > JavaScript > Code Quality Tools > ESLint

        Turn on Enable checkbox.

      • Go to File > Settings > Languages & Frameworks > TypeScript > TSLint

        Turn on Enable checkbox.

      • Go to File > Settings > Tools > File Watchers

        Click Import button and select watchers.xml file from the repository.

    • Visual Studio Code

    From now on every change in code base will be automatically formatted by Prettier. ESLint and TSLint errors will be also automatically fixed on every file save.

  5. Write some code.

Publishing

  1. Sign in to npm registry with command:

    $ npm adduser
    
  2. Before releasing a new version of package please update CHANGELOG.md with github_changelog_generator:

    $ gem install github_changelog_generator
    
    # generate CHANGELOG.md
    $ github_changelog_generator KnapsackPro/knapsack-pro-core-js
    $ git commit -am "Update CHANGELOG.md"
    $ git push origin master
    
  3. If you have added new files to the repository and they should be part of the released npm package then please ensure they are included in files array in package.json.

  4. If you have changed any headers in README.md please refresh table of contents with:

    $ npm run doctoc
    
  5. Compile project:

    $ npm run build
    
  6. In order to bump version of the package run below command. It will also create a version commit and tag for the release:

    # bump patch version 0.0.x
    $ npm version patch
    
    # bump minor version 0.x.0
    $ npm version minor
    
  7. Push to git repository created commit and tag:

    $ git push origin master --tags
    
  8. Now when git tag is on Github you can update CHANGELOG.md again.

    $ github_changelog_generator KnapsackPro/knapsack-pro-core-js
    $ git commit -am "Update CHANGELOG.md"
    $ git push origin master
    
  9. Now you can publish package to npm registry:

    $ npm publish
    

Keywords

FAQs

Package last updated on 04 Sep 2019

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