From baf7534870460015c194281ad98e1fef99911ef1 Mon Sep 17 00:00:00 2001
From: amzrk2
Date: Tue, 14 Apr 2020 20:58:19 +0800
Subject: Remove redundant Primer CSS

---
 assets/sass/@primer/css/bin/primer-migrate | 86 ------------------------------
 1 file changed, 86 deletions(-)
 delete mode 100644 assets/sass/@primer/css/bin/primer-migrate

(limited to 'assets/sass/@primer/css/bin/primer-migrate')

diff --git a/assets/sass/@primer/css/bin/primer-migrate b/assets/sass/@primer/css/bin/primer-migrate
deleted file mode 100644
index fb250c1..0000000
--- a/assets/sass/@primer/css/bin/primer-migrate
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env node
-
-/**
- * XXX: we use Node.js native modules only here to avoid
- * requiring any runtime dependencies when folks install
- * @primer/css
- */
-
-const fs = require('fs')
-const {promisify} = require('util')
-const readFile = promisify(fs.readFile)
-const writeFile = promisify(fs.writeFile)
-const {dirname, join} = require('path')
-
-const IMPORT_PATTERN = /\@import\s+['"]([^'"]+)['"]/g
-const replacements = [
-  [/primer-marketing-(\w+)(\/lib)?/, '@primer/css/marketing/$1'],
-  [/primer-(\w+)(\/lib)?/, '@primer/css/$1'],
-  [/primer\b/, '@primer/css']
-]
-
-const paths = process.argv.slice(2)
-const warn = (...args) => console.warn(...args)
-
-if (paths.length) {
-  Promise.all(
-    paths.map(path => {
-      return migrate(path).then(reps => report(reps, path))
-    })
-  ).catch(die)
-} else {
-  readFile('/dev/stdin', 'utf8')
-    .then(input => {
-      const [output, reps] = replace(input)
-      report(reps, 'stdin')
-      process.stdout.write(output)
-    })
-    .catch(die)
-}
-
-function migrate(path) {
-  return readFile(path, 'utf8').then(input => {
-    if (!IMPORT_PATTERN.test(input)) {
-      warn(`No SCSS imports found in ${path}`)
-      return false
-    }
-
-    const [output, reps] = replace(input)
-    if (reps.length) {
-      return writeFile(path, output, 'utf8').then(() => reps)
-    } else {
-      return false
-    }
-  })
-}
-
-function replace(input) {
-  const reps = []
-  const output = input.replace(IMPORT_PATTERN, (str, path) => {
-    for (const [from, to] of replacements) {
-      if (from.test(path)) {
-        const replaced = str.replace(from, to)
-        reps.push([path, path.replace(from, to)])
-        return replaced
-      }
-    }
-    return str
-  })
-  return [output, reps]
-}
-
-function report(reps, path) {
-  if (reps.length) {
-    warn(`Replaced ${reps.length} imports in ${path}:`)
-    for (const [i, [from, to]] of Object.entries(reps)) {
-      warn(`  ${Number(i) + 1}. (${from}) -> (${to})`)
-    }
-  } else {
-    warn(`No legacy imports found in ${path}`)
-  }
-}
-
-function die(error) {
-  console.error(error)
-  process.exitCode = 1
-}
-- 
cgit v1.2.3