Skip to content

Commit

Permalink
Merge pull request #878 from primer/release-12.7.0
Browse files Browse the repository at this point in the history
Primer CSS 12.7.0
  • Loading branch information
simurai authored Sep 6, 2019
2 parents bba8f3b + 3e3613e commit c406284
Show file tree
Hide file tree
Showing 20 changed files with 815 additions and 197 deletions.
28 changes: 0 additions & 28 deletions .github/main.workflow

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "lint, test, publish"
on: [push]
jobs:
all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
version: 11
- name: install
run: npm --unsafe-perm install
- name: lint
run: npm --unsafe-perm run lint
- name: test
run: npm --unsafe-perm test
- name: prepublish
run: script/prepublish
- uses: primer/publish@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# 12.7.0

### :rocket: Enhancement
- Import Dropdown component; add dark variants for dropdown and text fields [#862](https://github.com/primer/css/pull/862)
- Add `.break-word` utility and improve word-break docs [#880](https://github.com/primer/css/pull/880)
- Publish deprecation data [#883](https://github.com/primer/css/pull/883)

### :memo: Documentation
- Fix mistake in flex-justify-start explanation [#877](https://github.com/primer/css/pull/877)

### :house: Internal
- Fix CSS bundle size report when adding bundles [#879](https://github.com/primer/css/pull/879)
- Migrate to GitHub Actions v2 [#881](https://github.com/primer/css/pull/881)

### Committers
- [@dcastil](https://github.com/dcastil)
- [@shawnbot](https://github.com/shawnbot)
- [@simurai](https://github.com/simurai)
- [@vdepizzol](https://github.com/vdepizzol)

# 12.6.2

### :nail_care: Polish
Expand Down
59 changes: 59 additions & 0 deletions deprecations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* This object's keys are (semver) version numbers, and the
* values are arrays of objects each with a "selectors"
* array and a "message" string.
*/
const versionDeprecations = {
'13.0.0': [
{
selectors: ['.btn-purple'],
message: `Please don't make purple buttons.`
},
{
selectors: ['.text-pending'],
message: `Please use the "text-yellow" class instead of "text-pending".`
},
{
selectors: ['.bg-pending'],
message: `Please use the "bg-yellow-dark" class instead of "bg-pending".`
},
{
selectors: [
'.columns',
'.column',
'.one-third',
'.two-thirds',
'.one-fourth',
'.one-half',
'.three-fourths',
'.one-fifth',
'.four-fifths'
],
message: `Please use [grid classes](https://primer.style/css/objects/grid).`
},
{
selectors: ['.centered'],
message: `You can use the "mx-auto" class to center any element.`
}
]
}

const {version: CURRENT_VERSION} = require('./package.json')
const semver = require('semver')

// map selectors to the version and message of their deprecation
const selectorDeprecations = new Map()
for (const [version, deps] of Object.entries(versionDeprecations)) {
for (const {selectors, message} of deps) {
for (const selector of selectors) {
selectorDeprecations.set(selector, {version, message})
}
}
}

function isSelectorDeprecated(selector, version = CURRENT_VERSION) {
const deprecation = selectorDeprecations.get(selector)
return deprecation ? semver.gte(deprecation.version, version) : false
}

module.exports = {versionDeprecations, selectorDeprecations, isSelectorDeprecated}
Loading

1 comment on commit c406284

@vercel
Copy link

@vercel vercel bot commented on c406284 Sep 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.