Skip to content

Commit

Permalink
Merge pull request #53 from tjoskar/feature/pre-compile
Browse files Browse the repository at this point in the history
feat(compile): Precompile ES6 code
  • Loading branch information
jimthedev committed Nov 1, 2015
2 parents 8651dd4 + 7912c7c commit 1a2ab15
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
.tmp/
coverage/
artifacts/
npm-debug.log
/dist
npm-debug.log
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/meta
/src
/test
5 changes: 1 addition & 4 deletions bin/commitizen
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env node

require("babel/register")({
ignore: /node_modules\/(?!commitizen)/
});
require('./commitizen.js');
require('./commitizen.js');
2 changes: 1 addition & 1 deletion bin/commitizen.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

require('../src/cli/commitizen.js').bootstrap();
require('../dist/cli/commitizen.js').bootstrap();
5 changes: 1 addition & 4 deletions bin/git-cz
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env node

require("babel/register")({
ignore: /node_modules\/(?!commitizen)/
});
require('./git-cz.js');
require('./git-cz.js');
5 changes: 2 additions & 3 deletions bin/git-cz.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require("babel/register");
var path = require('path');
require('../src/cli/git-cz.js').bootstrap({
require('../dist/cli/git-cz.js').bootstrap({
cliPath: path.join(__dirname, '../')
});
});
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"scripts": {
"check-coverage": "istanbul check-coverage --statements 80 --branches 80 --functions 80 --lines 80 ",
"commit": "git-cz",
"build": "babel src --out-dir dist",
"build:watch": "babel --watch src --out-dir dist",
"prepublish": "npm run build",
"report-coverage": "cat ./coverage/lcov.info | codecov",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"start": "npm run test:watch",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/parsers/commitizen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import minimist from 'minimist';

import { isString, isArray } from '../../../common/util';
import { isString, isArray } from '../../common/util';

export {
parse
Expand Down
2 changes: 1 addition & 1 deletion src/cli/parsers/git-cz.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import minimist from 'minimist';

import { isString, isArray } from '../../../common/util';
import { isString, isArray } from '../../common/util';

export {
parse
Expand Down
2 changes: 1 addition & 1 deletion src/cli/strategies/git-cz.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import sh from 'shelljs';
import inquirer from 'inquirer';
import {getParsedPackageJsonFromPath} from '../../../common/util';
import {getParsedPackageJsonFromPath} from '../../common/util';
import {gitCz as gitCzParser, commitizen as commitizenParser} from '../parsers';
import {commit, staging, adapter} from '../../commitizen';
import {addPath} from '../../git';
Expand Down
2 changes: 1 addition & 1 deletion src/commitizen/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import fs from 'fs';
import findNodeModules from 'find-node-modules';

import {isFunction} from '../../common/util';
import {isFunction} from '../common/util';

export {
addPathToAdapterConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/commitizen/init.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import * as configLoader from './configLoader';
import {executeShellCommand} from '../../common/util';
import {executeShellCommand} from '../common/util';
import * as adapter from './adapter';

let {
Expand Down
2 changes: 1 addition & 1 deletion src/commitizen/staging.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import git from 'gulp-git';
import {isString} from '../../common/util';
import {isString} from '../common/util';

export {isClean};

Expand Down
7 changes: 3 additions & 4 deletions common/util.js → src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export {
*/
function executeShellCommand(sh, path, installCommand) {
sh.cd(path);
sh.exec(installCommand);
sh.exec(installCommand);
}

/**
Expand Down Expand Up @@ -53,7 +53,7 @@ function isArray(arr) {
}

/**
* Test if the passed argument is a function
* Test if the passed argument is a function
*/
function isFunction(functionToCheck) {
if(typeof functionToCheck === "undefined")
Expand All @@ -63,7 +63,7 @@ function isFunction(functionToCheck) {
return false;
} else {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
}
}

Expand All @@ -80,4 +80,3 @@ function isString(str) {
return Object.prototype.toString.call(str) == '[object String]';
}
}

2 changes: 1 addition & 1 deletion src/git/commit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import git from 'gulp-git';
import gulp from 'gulp';
import dedent from 'dedent';
import {isString} from '../../common/util';
import {isString} from '../common/util';

export { commit };

Expand Down
2 changes: 1 addition & 1 deletion test/tester.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as repo from './tools/repo';
import * as clean from './tools/clean';
import * as files from './tools/files';
import * as util from '../common/util';
import * as util from '../src/common/util';
import {config as userConfig} from './config';
import * as sh from 'shelljs'; // local instance
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import fs from 'fs';
// in the short term
import {adapter, init as commitizenInit} from '../../src/commitizen';

import {isFunction} from '../../common/util';
import {isFunction} from '../../src/common/util';

// Bootstrap our tester
import {bootstrap} from '../tester';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from 'chai';
import {isArray, isFunction, isString} from '../../common/util';
import {isArray, isFunction, isString} from '../../src/common/util';

describe('common util', function() {

Expand Down

0 comments on commit 1a2ab15

Please sign in to comment.