Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: snyk/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3b91ecafb4d4e6f7bd7c8dbe896cbd945efa7dd9
Choose a base ref
...
head repository: snyk/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b13e37134fe10d8f23cdd89b5f03938ec7d26a3a
Choose a head ref
Loading
Showing 2,957 changed files with 90,278 additions and 264,771 deletions.
252 changes: 252 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
version: 2.1

orbs:
win: circleci/windows@2.2.0

defaults: &defaults
parameters:
node_version:
type: string
default: ""
working_directory: ~/snyk

windows_defaults: &windows_defaults
environment:
npm_config_loglevel: silent
executor:
name: win/default

commands:
install_deps:
description: Install dependencies
steps:
- checkout
- run:
name: Use snyk-main npmjs user
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
- run:
name: Install dependencies
command: npm install
build_ts:
description: Build js files from ts
steps:
- checkout
- run:
name: Build
command: npm run build
- persist_to_workspace:
root: .
paths:
- dist/
install_maven_windows:
description: Install maven
steps:
- run: choco install maven
install_maven_unix:
description: Install maven
steps:
- run: sudo apt update
- run: sudo apt install -y maven
install_node_npm:
description: Install correct Node version
parameters:
node_version:
type: string
default: ""
steps:
- run:
name: Install correct version of Node
command: nvm install << parameters.node_version >>
- run:
name: Use correct version of Node
command: nvm use << parameters.node_version >>
show_node_version:
description: Log Node and npm version
steps:
- run:
name: Node version
command: node --version
- run:
name: NPM version
command: npm --version

jobs:
common:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
steps:
- show_node_version
- checkout
- attach_workspace:
at: ~/snyk
- install_deps
- build_ts
- run:
name: Run auth
command: npm run snyk-auth
- run:
name: Run tests
command: npm run test:common

danger:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
steps:
- checkout
- run:
name: Danger Zone
command: npx danger ci --failOnErrors

test-windows:
<<: *defaults
<<: *windows_defaults
steps:
- run: git config --global core.autocrlf false
- install_maven_windows
- install_node_npm:
node_version: << parameters.node_version >>
- show_node_version
- checkout
- attach_workspace:
at: ~/snyk
- install_deps
- build_ts
- run:
name: npm version
command: npm --version
- run:
name: Run auth
command: npm run snyk-auth-windows
- run:
name: Run tests
command: npm run test-windows

test-unix:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
steps:
- install_maven_unix
- show_node_version
- checkout
- attach_workspace:
at: ~/snyk
- install_deps
- build_ts
- run:
name: npm version
command: npm --version
- run:
name: Run auth
command: npm run snyk-auth
- run:
name: Run tests
command: npm test

release:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
resource_class: small
steps:
- install_deps
- run: sudo npm i -g semantic-release @semantic-release/exec pkg
- run:
name: Publish to GitHub
command: semantic-release

workflows:
version: 2
test_and_release:
jobs:
- common:
name: Common
context: nodejs-install
node_version: "8"
filters:
branches:
ignore:
- master
- danger:
name: Danger Zone
node_version: "8"
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v12 support
context: nodejs-install
node_version: "12.0.0"
requires:
- Common
- Danger Zone
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v10 support
context: nodejs-install
node_version: "10.0.0"
requires:
- Common
- Danger Zone
filters:
branches:
ignore:
- master
- test-windows:
name: Windows Tests for Node v8 support
context: nodejs-install
node_version: "8.17.0"
requires:
- Common
- Danger Zone
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v12 support
context: nodejs-install
node_version: "12.16.2"
requires:
- Common
- Danger Zone
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v10 support
context: nodejs-install
node_version: "10"
requires:
- Common
- Danger Zone
filters:
branches:
ignore:
- master
- test-unix:
name: Unix Tests for Node v8 support
context: nodejs-install
node_version: "8"
requires:
- Common
- Danger Zone
filters:
branches:
ignore:
- master
- release:
name: Release
context: nodejs-app-release
node_version: "10"
filters:
branches:
only:
- master
59 changes: 0 additions & 59 deletions .eslintrc

This file was deleted.

45 changes: 45 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parser": "@typescript-eslint/parser",
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/389
// parserOptions: {
// project: './tsconfig.json',
// },
"env": {
"node": true,
"es6": true,
"jest": true
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "warn",

// non-null assertions compromise the type safety somewhat, but many
// our types are still imprecisely defined and we don't use noImplicitAny
// anyway, so for the time being assertions are allowed
"@typescript-eslint/no-non-null-assertion": "warn",

"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-prototype-builtins": "off",
"require-atomic-updates": "off",
"no-buffer-constructor": "error"
},
"overrides": [
{
"files": ["*.ts"],
"rules": {
"id-blacklist": ["error", "exports"] // in TS, use "export" instead of Node's "module.exports"
}
}
]
}
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Snyk Boost will be required for a review on every PR
README.md @snyk/content @snyk/boost
help/ @snyk/content @snyk/boost
* @snyk/boost


17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

Loading