-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #878 from primer/release-12.7.0
Primer CSS 12.7.0
- Loading branch information
Showing
20 changed files
with
815 additions
and
197 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
Oops, something went wrong.
c406284
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully aliased the URL https://primer-css-hr0rd43ek.now.sh to the following aliases: