Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate variables in 14.0.0 #973

Merged
merged 7 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const versionDeprecations = {
variables: ['$status-pending'],
message: `This variable is deprecated.`
},
{
variables: ['$highlight-yellow'],
message: `This variable is deprecated.`
},
{
variables: ['$repo-private-text', '$repo-private-bg', '$repo-private-icon'],
message: `These variables are deprecated.`
Expand Down
8 changes: 6 additions & 2 deletions script/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ if (require.main === module) {

function writeVariableData() {
const analyzeVariables = require('./analyze-variables')
return analyzeVariables('src/support/index.scss').then(data =>
return Promise.all([
analyzeVariables('src/support/index.scss'),
analyzeVariables('src/marketing/support/index.scss')
]).then(([support, marketing]) => {
const data = Object.assign({}, support, marketing)
writeFile(join(outDir, 'variables.json'), JSON.stringify(data, null, 2))
)
})
}
20 changes: 12 additions & 8 deletions script/test-deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ async function checkSelectorDeprecations(options = {}) {
for (const {selectors = []} of deprecations) {
for (const selector of selectors) {
if (!removed.includes(selector)) {
const error = `"${selector}" deprecated, but not removed`
errors.push(error)
errors.push(`"${selector}" deprecated, but not removed`)
} else {
console.log(`${V} selector "${selector}" is officially deprecated`)
}
Expand All @@ -87,8 +86,9 @@ async function checkSelectorDeprecations(options = {}) {

for (const removedSelector of removed) {
if (!deprecatedSelectors.includes(removedSelector)) {
const error = `"${removedSelector}" has been removed, but was not listed in versionDeprecations['${currentVersion}']`
errors.push(error)
errors.push(
`"${removedSelector}" has been removed, but was not listed in versionDeprecations['${currentVersion}']`
)
} else {
// console.log(`${V} "${removedSelector}" removed and deprecated!`)
}
Expand Down Expand Up @@ -128,8 +128,11 @@ async function checkVariableDeprecations(options = {}) {
for (const {variables = []} of deprecations) {
for (const variable of variables) {
if (!removed.includes(variable)) {
const error = `variable "${variable}" deprecated, but not removed`
errors.push(error)
if (remote[variable]) {
errors.push(`variable "${variable}" deprecated, but not removed`)
} else {
console.log(`${I} variable "${variable}" doesn't exist in data for version: ${version}`)
}
} else {
console.log(`${V} variable "${variable}" is officially deprecated`)
}
Expand All @@ -139,8 +142,9 @@ async function checkVariableDeprecations(options = {}) {

for (const removedVariable of removed) {
if (!deprecatedVariables.includes(removedVariable)) {
const error = `"${removedVariable}" has been removed, but was not listed in versionDeprecations['${currentVersion}']`
errors.push(error)
errors.push(
`"${removedVariable}" has been removed, but was not listed in versionDeprecations['${currentVersion}']`
)
} else {
// console.log(`${V} "${removedVariable}" removed and deprecated!`)
}
Expand Down
5 changes: 0 additions & 5 deletions src/marketing/support/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ $spacer-10: $spacer * 12 !default; // 96px
$spacer-11: $spacer * 14 !default; // 112px
$spacer-12: $spacer * 16 !default; // 128px

// TODO@14.0.0: remove $marketingSpacers (unused)
$marketingSpacers: $spacer-7, $spacer-8, $spacer-9, $spacer-10, $spacer-11, $spacer-12 !default;
// TODO@14.0.0: remove $allSpacers (unused)
$allSpacers: $spacer-1, $spacer-2, $spacer-3, $spacer-4, $spacer-5, $spacer-6, $spacer-7, $spacer-8, $spacer-9, $spacer-10, $spacer-11, $spacer-12 !default;

$marketing-spacers: (
7: $spacer-7,
8: $spacer-8,
Expand Down
15 changes: 0 additions & 15 deletions src/support/variables/colors.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
@import "color-system.scss";
// Color variables

// State indicators.
// TODO@14.0.0: remove $status-pending (unused)
$status-pending: desaturate($yellow-700, 15%) !default;

// Repository type colors
// Should be able to deprecate these in future
// TODO@14.0.0: remove $repo-private-text, $repo-private-bg, and $repo-private-icon
$repo-private-text: $black-fade-70 !default;
$repo-private-bg: $yellow-000 !default;
$repo-private-icon: rgba($yellow-900, 0.5) !default;

// Highlight used for things like search
// TODO@14.0.0: remove $highlight-yellow (unused)
$highlight-yellow: rgba(255, 247, 140, 0.5) !default;

// Border colors
$border-white: $white !default;
$border-black-fade: $black-fade-15 !default;
Expand Down
16 changes: 0 additions & 16 deletions src/support/variables/misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,3 @@ $tooltip-background-color: $black !default;
$tooltip-text-color: $white !default;
$tooltip-delay: 0.4s !default;
$tooltip-duration: 0.1s !default;

// Custom explore grid border
// TODO@14.0.0: move $exploregrid-item-border-radius to github/github
$exploregrid-item-border-radius: 4px !default;

// TODO@14.0.0: remove $stats-switcher-py (unused)
$stats-switcher-py: 10px !default;
// Future proof this `height` value by finding the computed line-height, then
// adding the total value of the vertical padding. This var is used to toggle
// between the stats bar and language breakdown.
// TODO@14.0.0: remove $stats-viewport-height (unused)
$stats-viewport-height: ($body-font-size * $body-line-height) + ($stats-switcher-py * 2) !default;

// TODO@14.0.0: move $min_tab_size, $max_tab_size to github/github
$min_tab_size: 1 !default;
$max_tab_size: 12 !default;