Ripped out the code no longer needed

This commit is contained in:
Matt Stypa 2019-03-14 20:24:31 -05:00
parent e0cad52c57
commit 7ec4b11d73
7 changed files with 1 additions and 130 deletions

View File

@ -43,9 +43,7 @@ describe('cli', () => {
it('creates a full Tailwind config file', () => {
return cli(['init', '--full']).then(() => {
expect(utils.writeFile.mock.calls[0][1]).toEqual(
utils.replaceAll(defaultConfigFixture, constants.replacements)
)
expect(utils.writeFile.mock.calls[0][1]).toEqual(defaultConfigFixture)
})
})
})

View File

@ -109,30 +109,4 @@ describe('cli utils', () => {
expect(result).toEqual(expect.stringContaining('__comment_docblock_important__'))
})
})
describe('replaceAll', () => {
it('replaces strings', () => {
const result = utils.replaceAll('test', [['test', 'pass']])
expect(result).toEqual('pass')
})
it('replaces regex patterns', () => {
const result = utils.replaceAll('TEST', [[/test/i, 'pass']])
expect(result).toEqual('pass')
})
it('replaces all matches', () => {
const result = utils.replaceAll('test test', [['test', 'pass']])
expect(result).toEqual('pass pass')
})
it('replaces all multiple patterns', () => {
const result = utils.replaceAll('hello world', [['hello', 'greetings'], ['world', 'earth']])
expect(result).toEqual('greetings earth')
})
})
})

View File

@ -1,79 +0,0 @@
const defaultTheme = require('./defaultTheme')()
module.exports = {
prefix: '',
important: false,
separator: ':',
theme: defaultTheme,
variants: {
appearance: ['responsive'],
backgroundAttachment: ['responsive'],
backgroundColor: ['responsive', 'hover', 'focus'],
backgroundPosition: ['responsive'],
backgroundRepeat: ['responsive'],
backgroundSize: ['responsive'],
borderCollapse: [],
borderColor: ['responsive', 'hover', 'focus'],
borderRadius: ['responsive'],
borderStyle: ['responsive'],
borderWidth: ['responsive'],
cursor: ['responsive'],
display: ['responsive'],
flexDirection: ['responsive'],
flexWrap: ['responsive'],
alignItems: ['responsive'],
alignSelf: ['responsive'],
justifyContent: ['responsive'],
alignContent: ['responsive'],
flex: ['responsive'],
flexGrow: ['responsive'],
flexShrink: ['responsive'],
float: ['responsive'],
fontFamily: ['responsive'],
fontWeight: ['responsive', 'hover', 'focus'],
height: ['responsive'],
lineHeight: ['responsive'],
listStyle: ['responsive'],
margin: ['responsive'],
maxHeight: ['responsive'],
maxWidth: ['responsive'],
minHeight: ['responsive'],
minWidth: ['responsive'],
negativeMargin: ['responsive'],
objectFit: ['responsive'],
objectPosition: ['responsive'],
opacity: ['responsive'],
outline: ['focus'],
overflow: ['responsive'],
padding: ['responsive'],
pointerEvents: ['responsive'],
position: ['responsive'],
resize: ['responsive'],
boxShadow: ['responsive', 'hover', 'focus'],
fill: [],
stroke: [],
tableLayout: ['responsive'],
textAlign: ['responsive'],
textColor: ['responsive', 'hover', 'focus'],
fontSize: ['responsive'],
fontStyle: ['responsive'],
textTransform: ['responsive'],
textDecoration: ['responsive', 'hover', 'focus'],
fontSmoothing: ['responsive'],
letterSpacing: ['responsive'],
userSelect: ['responsive'],
verticalAlign: ['responsive'],
visibility: ['responsive'],
whitespace: ['responsive'],
width: ['responsive'],
zIndex: ['responsive'],
},
corePlugins: {
},
plugins: [
require('./plugins/container')({
// center: true,
// padding: '1rem',
}),
],
}

View File

@ -71,9 +71,6 @@
]
},
"jest": {
"moduleNameMapper": {
"lib/plugins/container": "<rootDir>/src/plugins/container"
},
"setupFilesAfterEnv": [
"<rootDir>/jest/customMatchers.js"
],

View File

@ -44,7 +44,6 @@ export function run(cliParams, cliOptions) {
const stubFile = full ? constants.defaultConfigStubFile : constants.simpleConfigStubFile
let stub = utils.readFile(stubFile)
stub = utils.replaceAll(stub, constants.replacements)
noComments && (stub = utils.stripBlockComments(stub))
utils.writeFile(file, stub)

View File

@ -4,7 +4,3 @@ export const cli = 'tailwind'
export const defaultConfigFile = 'tailwind.js'
export const defaultConfigStubFile = path.resolve(__dirname, '../../stubs/defaultConfig.stub.js')
export const simpleConfigStubFile = path.resolve(__dirname, '../../stubs/simpleConfig.stub.js')
export const replacements = [
["require('../plugins/container')", "require('tailwindcss/plugins/container')"],
]

View File

@ -136,17 +136,3 @@ export function stripBlockComments(input) {
.trim()
.concat('\n')
}
/**
* Performs string replacement for multiple patterns.
*
* @param {string} input
* @param {array} replacements
* @return {string}
*/
export function replaceAll(input, replacements) {
return replacements.reduce(
(str, [pattern, replacement]) => str.split(pattern).join(replacement),
input
)
}