Initial commit.

This commit is contained in:
Matt Swensen 2016-11-26 20:37:40 -07:00
commit e1d0cdfb04
6 changed files with 1736 additions and 0 deletions

3
.babelrc Normal file

@ -0,0 +1,3 @@
{
"presets": ["latest"]
}

10
.editorconfig Normal file

@ -0,0 +1,10 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

2
.gitignore vendored Normal file

@ -0,0 +1,2 @@
node_modules
lib

24
package.json Normal file

@ -0,0 +1,24 @@
{
"name": "themer-hyper",
"version": "1.0.0",
"description": "A Hyper.app plugin generator for themer.",
"main": "lib/index.js",
"repository": {
"url": "git@github.com:mjswensen/themer-hyper.git",
"type": "git"
},
"author": "mjswensen",
"license": "MIT",
"scripts": {
"build": "babel --out-dir lib src",
"start": "watch 'yarn run build' src"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-preset-latest": "^6.16.0",
"watch": "^1.0.1"
},
"dependencies": {
"color": "^0.11.4"
}
}

37
src/index.js Normal file

@ -0,0 +1,37 @@
import Color from 'color';
export const render = (colors, options) => {
return [{ name: 'dark', colors: colors.dark }, { name: 'light', colors: colors.light }]
.filter(colorSet => !!colorSet.colors)
.map(colorSet => {
const plugin = `
exports.decorateConfig = function(config) {
return Object.assign({}, config, {
cursorColor: '${Color(colorSet.colors.accent6).clearer(0.5).rgbString()}',
foregroundColor: '${colorSet.colors.shade6}',
backgroundColor: '${colorSet.colors.shade0}',
borderColor: '${colorSet.colors.shade0}',
colors: {
black: '${colorSet.colors.shade0}',
red: '${colorSet.colors.accent0}',
green: '${colorSet.colors.accent3}',
yellow: '${colorSet.colors.accent2}',
blue: '${colorSet.colors.accent5}',
magenta: '${colorSet.colors.accent7}',
cyan: '${colorSet.colors.accent4}',
white: '${colorSet.colors.shade6}',
lightBlack: '${colorSet.colors.shade1}',
lightRed: '${colorSet.colors.accent1}',
lightGreen: '${colorSet.colors.accent3}',
lightYellow: '${colorSet.colors.accent2}',
lightBlue: '${colorSet.colors.accent5}',
lightMagenta: '${colorSet.colors.accent7}',
lightCyan: '${colorSet.colors.accent4}',
lightWhite: '${colorSet.colors.shade7}',
},
});
};
`;
return Promise.resolve({ name: `themer-hyper-${colorSet.name}.js`, contents: new Buffer(plugin, 'utf-8') });
});
};

1660
yarn.lock Normal file

File diff suppressed because it is too large Load Diff