diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 7d26c02182..0000000000 --- a/.github/main.workflow +++ /dev/null @@ -1,28 +0,0 @@ -workflow "lint, test, publish" { - on = "push" - resolves = ["lint", "test", "publish"] -} - -action "install" { - uses = "actions/npm@v2.0.0" - args = ["install", "--unsafe-perm"] -} - -action "lint" { - needs = "install" - uses = "actions/npm@v2.0.0" - args = ["--unsafe-perm", "run", "lint"] -} - -action "test" { - needs = "install" - uses = "actions/npm@v2.0.0" - args = ["--unsafe-perm", "test"] -} - -action "publish" { - needs = ["lint", "test"] - uses = "primer/publish@v1.0.0" - args = ["--", "--unsafe-perm"] - secrets = ["GITHUB_TOKEN", "NPM_AUTH_TOKEN"] -} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000000..76cf60c30b --- /dev/null +++ b/.github/workflows/push.yml @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index b87a5f3f41..3fb9c049a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/deprecations.js b/deprecations.js new file mode 100644 index 0000000000..c6f84a2d49 --- /dev/null +++ b/deprecations.js @@ -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} diff --git a/docs/content/components/dropdown.md b/docs/content/components/dropdown.md index f6235df687..c0c8a61155 100644 --- a/docs/content/components/dropdown.md +++ b/docs/content/components/dropdown.md @@ -1,34 +1,9 @@ --- title: Dropdown -path: components/dropdown -status: Stable -source: 'https://github.com/github/github/tree/master/app/assets/stylesheets/components/dropdown.scss' -symbols: - [ - active, - anim-scale-in, - btn-link, - dropdown, - dropdown-caret, - dropdown-divider, - dropdown-header, - dropdown-item, - dropdown-menu, - dropdown-menu-content, - dropdown-menu-e, - dropdown-menu-ne, - dropdown-menu-no-overflow, - dropdown-menu-s, - dropdown-menu-se, - dropdown-menu-sw, - dropdown-menu-w, - dropdown-signout, - octicon, - zeroclipboard-is-hover, - ] +status: New --- -Dropdowns are lightweight, JavaScript-powered context menus for housing navigation and actions. They're great for instances where you don't need the full power (and code) of the select menu. +Dropdowns are lightweight context menus for housing navigation and actions. They're great for instances where you don't need the full power (and code) of the select menu. ## Basic examples @@ -37,35 +12,39 @@ Dropdowns should be trigged by a `