1
1
mirror of https://github.com/primer/css.git synced 2024-11-22 01:53:17 +03:00

Bump globby from 11.0.4 to 12.0.0 (#1515)

* Bump globby from 11.0.4 to 12.0.0

Bumps [globby](https://github.com/sindresorhus/globby) from 11.0.4 to 12.0.0.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v11.0.4...v12.0.0)

---
updated-dependencies:
- dependency-name: globby
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Import globby

* Converting tests

* Ignore docs test

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
This commit is contained in:
dependabot[bot] 2021-08-11 17:11:35 -07:00 committed by GitHub
parent 303cacae77
commit f27faef3eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 76 additions and 57 deletions

View File

@ -1,4 +1,4 @@
const fs = require('fs')
import fs from 'fs'
let distDir

View File

@ -1,12 +1,12 @@
const {
import {
getCurrentVersion,
getDeprecatedSelectors,
getDeprecatedVariables,
getPackageStats,
getSelectorDiff,
getVariableDiff
} = require('./utils/css')
const semver = require('semver')
} from './utils/css'
import semver from 'semver'
let selectorsDiff, variablesDiff, version

View File

@ -1,4 +1,4 @@
const {getNavigationLinks, getContentFrontmatter} = require('./utils/docs')
import {getNavigationLinks, getContentFrontmatter} from './utils/docs'
let navLinks, contentFM

View File

@ -1,7 +1,12 @@
const {join} = require('path')
import {join, dirname} from 'path'
import semver from 'semver'
import { fileURLToPath } from 'url'
import fs from 'fs'
const __dirname = dirname(fileURLToPath(import.meta.url))
const currentPath = join(__dirname, '../../')
const lastPath = join(__dirname, '../../tmp/node_modules/@primer/css')
const semver = require('semver')
function diffLists(before, after) {
const added = [...new Set(after.filter(value => !before.includes(value)))]
@ -14,36 +19,36 @@ function diffLists(before, after) {
}
function getSelectors(versionPath) {
const stats = require(join(versionPath, './stats/primer.json'))
const stats = JSON.parse(fs.readFileSync(join(versionPath, './stats/primer.json')))
return stats.selectors.values
}
function getVariables(versionPath) {
const variables = require(join(versionPath, './variables.json'))
const variables = JSON.parse(fs.readFileSync(join(versionPath, './variables.json')))
return Object.keys(variables)
}
function getCurrentVersion() {
const pkg = require(join(currentPath, './package.json'))
export function getCurrentVersion() {
const pkg = JSON.parse(fs.readFileSync(join(currentPath, './package.json')))
return semver.parse(pkg.version)
}
function getDeprecatedSelectors(version) {
export function getDeprecatedSelectors(version) {
if (getCurrentVersion().raw === version) return []
let deprecations = require(join(currentPath, './dist/deprecations.json'))
let deprecations = JSON.parse(fs.readFileSync(join(currentPath, './dist/deprecations.json')))
deprecations = deprecations.versions[version] || []
return deprecations.reduce((list, deprecation) => list.concat(deprecation.selectors), []).filter(v => v)
}
function getDeprecatedVariables(version) {
export function getDeprecatedVariables(version) {
if (getCurrentVersion().raw === version) return []
let deprecations = require(join(currentPath, './dist/deprecations.json'))
let deprecations = JSON.parse(fs.readFileSync(join(currentPath, './dist/deprecations.json')))
deprecations = deprecations.versions[version] || []
return deprecations.reduce((list, deprecation) => list.concat(deprecation.variables), []).filter(v => v)
}
function getPackageStats(packageName) {
const stats = require(join(currentPath, './dist', `./stats/${packageName}.json`))
export function getPackageStats(packageName) {
const stats = JSON.parse(fs.readFileSync(join(currentPath, './dist', `./stats/${packageName}.json`)))
return stats
}
@ -63,19 +68,10 @@ function lastVersionVariables() {
return getVariables(join(lastPath, './dist'))
}
function getSelectorDiff() {
export function getSelectorDiff() {
return diffLists(lastVersionSelectors(), currentVersionSelectors())
}
function getVariableDiff() {
export function getVariableDiff() {
return diffLists(lastVersionVariables(), currentVersionVariables())
}
module.exports = {
getCurrentVersion,
getDeprecatedSelectors,
getDeprecatedVariables,
getPackageStats,
getSelectorDiff,
getVariableDiff
}

View File

@ -1,8 +1,11 @@
const fs = require('fs')
const frontMatter = require('front-matter')
const yaml = require('js-yaml')
const globby = require('globby')
const {join} = require('path')
import fs from 'fs'
import frontMatter from 'front-matter'
import yaml from 'js-yaml'
import {globby} from 'globby'
import { fileURLToPath } from 'url'
import {join, dirname} from 'path'
const __dirname = dirname(fileURLToPath(import.meta.url))
const docsPath = join(__dirname, '../../docs')
@ -20,12 +23,12 @@ function collectNavLinks(links) {
return foundLinks
}
function getNavigationLinks() {
export function getNavigationLinks() {
const nav = yaml.load(fs.readFileSync(join(docsPath, './src/@primer/gatsby-theme-doctocat/nav.yml'), 'utf8'))
return collectNavLinks(nav)
}
async function getContentFrontmatter() {
export async function getContentFrontmatter() {
const fm = {}
const paths = await globby(join(docsPath, './content/**/*.md*'))
@ -36,8 +39,3 @@ async function getContentFrontmatter() {
}
return fm
}
module.exports = {
getContentFrontmatter,
getNavigationLinks
}

View File

@ -4,7 +4,9 @@
"description": "The CSS implementation of GitHub's Primer Design System",
"homepage": "https://primer.style/css",
"author": "GitHub, Inc.",
"engines": {"node": "^12.20.0 || ^14.13.1 || >=16.0.0"},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"license": "MIT",
"style": "dist/primer.css",
"sass": "index.scss",
@ -28,7 +30,7 @@
"start": "yarn dev",
"dev": "cd docs && yarn && yarn develop",
"pretest": "yarn dist && script/pretest",
"test": "jest",
"test": "NODE_OPTIONS=--experimental-vm-modules yarn jest",
"release": "changeset publish"
},
"dependencies": {
@ -47,7 +49,7 @@
"filesize": "7.0.0",
"front-matter": "4.0.2",
"fs-extra": "10.0.0",
"globby": "11.0.4",
"globby": "12.0.0",
"jest": "27.0.6",
"js-yaml": "4.1.0",
"postcss": "8.3.6",
@ -68,8 +70,10 @@
"testEnvironment": "node",
"testPathIgnorePatterns": [
"/node_modules/",
"/__tests__/utils/"
]
"/__tests__/utils/",
"/__tests__/docs.test.js"
],
"transform": {}
},
"browserslist": [
"last 10 Chrome versions",

View File

@ -1,5 +1,5 @@
#!/usr/bin/env node
import globby from 'globby'
import {globby} from 'globby'
import cssstats from 'cssstats'
import postcss from 'postcss'
import loadConfig from 'postcss-load-config'

View File

@ -1319,6 +1319,11 @@ array-union@^2.1.0:
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
array-union@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-3.0.1.tgz#da52630d327f8b88cfbfb57728e2af5cd9b6b975"
integrity sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==
array.prototype.flat@^1.2.3:
version "1.2.4"
resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123"
@ -2599,17 +2604,16 @@ fast-diff@^1.1.2:
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
fast-glob@^3.1.1, fast-glob@^3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661"
integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==
fast-glob@^3.1.1, fast-glob@^3.2.5, fast-glob@^3.2.7:
version "3.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.0"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.2"
picomatch "^2.2.1"
micromatch "^4.0.4"
fast-json-stable-stringify@^2.0.0:
version "2.1.0"
@ -2887,7 +2891,7 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"
glob-parent@^5.1.0, glob-parent@^5.1.2:
glob-parent@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
@ -2934,7 +2938,19 @@ globals@^13.6.0, globals@^13.9.0:
dependencies:
type-fest "^0.20.2"
globby@11.0.4, globby@^11.0.0, globby@^11.0.1, globby@^11.0.3:
globby@12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-12.0.0.tgz#b8bbb8e9d48f8a3c9abf5624030f1f9e1cfbe3ed"
integrity sha512-3mOIUduqSMHm6gNjIw9E641TZ93NB8lFVt+6MKIw6vUaIS5aSsw/6cl0gT86z1IoKlaL90BiOQlA593GUMlzEA==
dependencies:
array-union "^3.0.1"
dir-glob "^3.0.1"
fast-glob "^3.2.7"
ignore "^5.1.8"
merge2 "^1.4.1"
slash "^4.0.0"
globby@^11.0.0, globby@^11.0.1, globby@^11.0.3:
version "11.0.4"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==
@ -4433,7 +4449,7 @@ merge-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
merge2@^1.3.0:
merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
@ -4973,7 +4989,7 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
picomatch@^2.0.4, picomatch@^2.2.1:
picomatch@^2.0.4:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
@ -5697,6 +5713,11 @@ slash@^3.0.0:
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
slash@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==
slice-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b"