How to use the uikit/package.json.version function in uikit

To help you get started, we’ve selected a few uikit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stipsan / uikit-react / guard.js View on Github external
const data = require('uikit/package.json')
const semver = require('semver')
const semverTruncate = require('semver-truncate')

const semverRange = '<=2'
const pr = process.env.TRAVIS_PULL_REQUEST_BRANCH
const branch = process.env.TRAVIS_BRANCH

console.log('TRAVIS_PULL_REQUEST_BRANCH', process.env.TRAVIS_PULL_REQUEST_BRANCH, 'TRAVIS_BRANCH', process.env.TRAVIS_BRANCH)

if (pr && branch === 'master' && !semver.satisfies(semverTruncate(data.version, 'patch'), semverRange)) {
  const err = new Error(`uikit ${data.version} doesn't satisfy the version requirement of ${semverRange}`)
  err.name = 'InvalidUikitVersion'
  throw err
}
github stipsan / uikit-react / guard.js View on Github external
const data = require('uikit/package.json')
const semver = require('semver')
const semverTruncate = require('semver-truncate')

const semverRange = '<=2'
const pr = process.env.TRAVIS_PULL_REQUEST_BRANCH
const branch = process.env.TRAVIS_BRANCH

console.log('TRAVIS_PULL_REQUEST_BRANCH', process.env.TRAVIS_PULL_REQUEST_BRANCH, 'TRAVIS_BRANCH', process.env.TRAVIS_BRANCH)

if (pr && branch === 'master' && !semver.satisfies(semverTruncate(data.version, 'patch'), semverRange)) {
  const err = new Error(`uikit ${data.version} doesn't satisfy the version requirement of ${semverRange}`)
  err.name = 'InvalidUikitVersion'
  throw err
}