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

advanced-build-conditions

v3.0.0-8

Published

Набор инструментов для выставления статуса сборки

Downloads

80

Readme

advanced build conditions

Решение для выставление статусов сборки ct(continues test) на основе дополнительных проверок, основанных на результатах проверок unit тестов, линтеров и т.д.


Flow Flow Flow

Установка

npm i advanced-build-conditions@^2.0.2-beta --save-dev

Требования

  • NodeJs 8+
  • npm5
  • linux(желательно)

Использование

nodejs module

const buildFailedConditions = require('buildFailedConditions'),
procCwd = process.cwd(),
// for use that npm install eslint-teamcity --save
eslintTeamcity = require('eslint-teamcity'),
// for use that npm install eslint --save
eslintCodeframe = require('eslint/lib/formatters/codeframe');
let config = {eslint: {}, teamcity: {}};
config.eslint = {
  masterPath: `checkoutDir/advanced-build-conditions`
  masterJSON: `checkoutDir/advanced-build-conditions/spec/fixtures/masterJSON.json`,
  currentJSON: `checkoutDir/advanced-build-conditions/spec/fixtures/currentJSON.json`
  resultJSON: 'checkoutDir/advanced-build-conditions/spec/fixtures/resultJSON.json'
};
config.teamcity = {
  login: testUsername,
  pass: testPassword,
  host: testHost,
  buildTypeId: testBuildTypeId,
  masterBranch: testMasterBranch
};
config.local = !process.env.TEAMCITY_VERSION;
console.log(buildFailedConditions(config));

Описание:

config.eslint.masterPath - путь к базовой директории,директории в которую происходит чекаут(локально) config.eslint.masterJSON - путь к json с сервера, json с результатами проверки мастер ветки. Если параметр отстутсвует, то json будет скачан с сервера на основании конфигурации config.teamcity. config.eslint.currentJSON - путь к текущему json, полученному как результат проверки eslint с форматтером json и выводом по указанному пути config.eslint.resultJSON - путь, по которому будет сохранён JSON с новыми ошибками.

Конфигурация teamcity

Для использования получения config.eslint.masterJSON с сервера с использованием модуля teamcity необходимо:

  • на вкладке General Settings настроек проекта сборки выставить Build number format: в значение %teamcity.build.branch%.
  • заполнить/дополнить поле Artifact paths: таким образом, что-бы папка, указанная как путь к resultJSON в конфигурации

Grunt таск

Скоро... есть прототип, заведена задача #13

Модули

Teamcity

Позволяет взаимодействовать с teamcity по REST и teamcity service messages.

Eslint

Умеет сравнивать 2 результата проверок codestyle и выявляет униклаьные

Участие в разработке

Задачи и обсуждения заводятся в issue. Проверка codestyle и запуск юнит-тестов выполняется автоматически по PR в репозиторий. Для локального запуска тестов и проверок codestyle необходимо запустить соответственно npm test и npm codestyle

Внимание - известные ограничения

Если в путях присутствуют пробелы, то модуль работать не будет!

Полезные ссылки

TODO:

  • убрать:
    • убрать лишние параметры:
      • config.eslint.masterPath на ci можно узнать из переменной окружения, локльно поиском package/.git
    • переделать api главного модуля: {onMetricChange, onCommandExecuteFail, onCustomFunctionExecuteResultFail} = require('advanced-build-conditions');
      • onMetricChange может принимать что-то вроде
      eslintViolations:{
        compare: [>|<|=|!=],
        with: ['local'|'master'|'function']
      }
      или eslintViolations > master/eslintViolations != master/karmaCoverage < master
    • использовать lib @XFree/grunt-eslint-differ