Skip to content

Commit

Permalink
Merge pull request #1 from kevin-smets/feature/cleanup
Browse files Browse the repository at this point in the history
Serious cleanup of dependencies and conversion to yarn
  • Loading branch information
kevin-smets authored Oct 18, 2016
2 parents b4801d6 + 5d645df commit dfcea5a
Show file tree
Hide file tree
Showing 6 changed files with 454 additions and 61 deletions.
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# OS X
*DS_Store

# temp download folders look like 1447763160867-317919785855338
# npm-debug.log
*-*

# IntelliJ
npm-debug.log
.idea

# Other
download
dist
node_modules
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ The resulting files can be found over at [kevin-smets/iterm2colors](https://gith
### Install dependencies

```
npm i
yarn install
```

### Download and convert

```
npm run all
yarn run all
```

Or you can run them separately:

```
npm run abstract
yarn run abstract
```

or

```
npm run functional
yarn run functional
```

The resulting files are stored in `./dist`
Expand Down
26 changes: 8 additions & 18 deletions convert.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const useFunctionalVarNames = require('yargs').argv.functional;
const fs = require('fs');
const fse = require('fs-extra');
const fs = require('fs-extra');
const json2scss = require('json2scss');
const path = require('path');
const Promise = require('promise');

const functionalColorMap = [
{asIs: "ansi-0-color", functional: "black-normal"},
Expand Down Expand Up @@ -120,11 +118,11 @@ var parse = function (file) {
distFolder = path.join(__dirname, "dist/functional");
}

fse.ensureDirSync(path.join(distFolder, "json"));
fse.ensureDirSync(path.join(distFolder, "scss"));
fse.ensureDirSync(path.join(distFolder, "less"));
fse.ensureDirSync(path.join(distFolder, "sass"));
fse.ensureDirSync(path.join(distFolder, "stylus"));
fs.ensureDirSync(path.join(distFolder, "json"));
fs.ensureDirSync(path.join(distFolder, "scss"));
fs.ensureDirSync(path.join(distFolder, "less"));
fs.ensureDirSync(path.join(distFolder, "sass"));
fs.ensureDirSync(path.join(distFolder, "stylus"));

// Generate JSON
fs.writeFileSync(path.join(distFolder, "json") + '/' + file + '.json', jsonString);
Expand All @@ -134,27 +132,20 @@ var parse = function (file) {
var stylus = sass.replace(/:/g,"");
var less = scss.replace(/\$/g,"@");

// Generate Scss
fs.writeFileSync(path.join(distFolder, "scss") + '/' + file + '.scss', scss);

// Generate Sass
fs.writeFileSync(path.join(distFolder, "sass") + '/' + file + '.sass', sass);

// Generate Stylus
fs.writeFileSync(path.join(distFolder, "stylus") + '/' + file + '.styl', stylus);

// Generate Less
fs.writeFileSync(path.join(distFolder, "less") + '/' + file + '.less', less);

resolve();
});

fs.createReadStream('download/schemes/' + file + '.itermcolors')
fs.createReadStream(path.join(`./node_modules/iterm2-color-schemes/schemes`, file + '.itermcolors'))
.pipe(saxStream);
});
};

fs.readdir('./download/schemes', function (err, files) {
fs.readdir(`./node_modules/iterm2-color-schemes/schemes`, function (err, files) {
if (err) return;
files.forEach(function (f) {
var fileBaseName = path.basename(f, '.itermcolors');
Expand All @@ -163,4 +154,3 @@ fs.readdir('./download/schemes', function (err, files) {
parse(fileBaseName);
});
});

24 changes: 0 additions & 24 deletions download.js

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "Converts the iTerm2 color schemes to JSON, Sass / Scss, Stylus and Less.",
"main": "convert.js",
"scripts": {
"abstract": "node download && node convert",
"all": "node download && node convert && node convert --functional",
"functional": "node download && node convert --functional"
"clean": "rm -rf dist",
"abstract": "npm run clean && node convert",
"all": "npm run clean && node convert && node convert --functional",
"functional": "npm run clean && node convert --functional"
},
"repository": {
"type": "git",
Expand All @@ -26,14 +27,13 @@
"bugs": {
"url": "https://github.com/kevin-smets/iterm2-colors-converter/issues"
},
"private": true,
"homepage": "https://github.com/kevin-smets/iterm2-colors-converter#readme",
"devDependencies": {
"del": "^2.2.0",
"fs-extra": "^0.30.0",
"github-download": "^0.5.0",
"json2sass": "^0.2.0",
"iterm2-color-schemes": "github:kevin-smets/iTerm2-Color-Schemes#a736141",
"json2scss": "0.0.2",
"promise": "^7.1.1",
"rgb-to-hex": "0.0.0",
"sax": "^1.1.4",
"yargs": "^6.2.0"
Expand Down
Loading

0 comments on commit dfcea5a

Please sign in to comment.