Skip to content

Commit 1a2ab15

Browse files
committed
Merge pull request #53 from tjoskar/feature/pre-compile
feat(compile): Precompile ES6 code
2 parents 8651dd4 + 7912c7c commit 1a2ab15

File tree

18 files changed

+26
-27
lines changed

18 files changed

+26
-27
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules/
22
.tmp/
33
coverage/
44
artifacts/
5-
npm-debug.log
5+
/dist
6+
npm-debug.log

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/meta
2+
/src
3+
/test

bin/commitizen

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#!/usr/bin/env node
22

3-
require("babel/register")({
4-
ignore: /node_modules\/(?!commitizen)/
5-
});
6-
require('./commitizen.js');
3+
require('./commitizen.js');

bin/commitizen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
require('../src/cli/commitizen.js').bootstrap();
2+
require('../dist/cli/commitizen.js').bootstrap();

bin/git-cz

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#!/usr/bin/env node
22

3-
require("babel/register")({
4-
ignore: /node_modules\/(?!commitizen)/
5-
});
6-
require('./git-cz.js');
3+
require('./git-cz.js');

bin/git-cz.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require("babel/register");
21
var path = require('path');
3-
require('../src/cli/git-cz.js').bootstrap({
2+
require('../dist/cli/git-cz.js').bootstrap({
43
cliPath: path.join(__dirname, '../')
5-
});
4+
});

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"scripts": {
77
"check-coverage": "istanbul check-coverage --statements 80 --branches 80 --functions 80 --lines 80 ",
88
"commit": "git-cz",
9+
"build": "babel src --out-dir dist",
10+
"build:watch": "babel --watch src --out-dir dist",
11+
"prepublish": "npm run build",
912
"report-coverage": "cat ./coverage/lcov.info | codecov",
1013
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
1114
"start": "npm run test:watch",

src/cli/parsers/commitizen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import minimist from 'minimist';
22

3-
import { isString, isArray } from '../../../common/util';
3+
import { isString, isArray } from '../../common/util';
44

55
export {
66
parse

src/cli/parsers/git-cz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import minimist from 'minimist';
22

3-
import { isString, isArray } from '../../../common/util';
3+
import { isString, isArray } from '../../common/util';
44

55
export {
66
parse

src/cli/strategies/git-cz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs';
22
import path from 'path';
33
import sh from 'shelljs';
44
import inquirer from 'inquirer';
5-
import {getParsedPackageJsonFromPath} from '../../../common/util';
5+
import {getParsedPackageJsonFromPath} from '../../common/util';
66
import {gitCz as gitCzParser, commitizen as commitizenParser} from '../parsers';
77
import {commit, staging, adapter} from '../../commitizen';
88
import {addPath} from '../../git';

src/commitizen/adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path';
22
import fs from 'fs';
33
import findNodeModules from 'find-node-modules';
44

5-
import {isFunction} from '../../common/util';
5+
import {isFunction} from '../common/util';
66

77
export {
88
addPathToAdapterConfig,

src/commitizen/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path';
22
import * as configLoader from './configLoader';
3-
import {executeShellCommand} from '../../common/util';
3+
import {executeShellCommand} from '../common/util';
44
import * as adapter from './adapter';
55

66
let {

src/commitizen/staging.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import git from 'gulp-git';
2-
import {isString} from '../../common/util';
2+
import {isString} from '../common/util';
33

44
export {isClean};
55

common/util.js renamed to src/common/util.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export {
1616
*/
1717
function executeShellCommand(sh, path, installCommand) {
1818
sh.cd(path);
19-
sh.exec(installCommand);
19+
sh.exec(installCommand);
2020
}
2121

2222
/**
@@ -53,7 +53,7 @@ function isArray(arr) {
5353
}
5454

5555
/**
56-
* Test if the passed argument is a function
56+
* Test if the passed argument is a function
5757
*/
5858
function isFunction(functionToCheck) {
5959
if(typeof functionToCheck === "undefined")
@@ -63,7 +63,7 @@ function isFunction(functionToCheck) {
6363
return false;
6464
} else {
6565
var getType = {};
66-
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
66+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
6767
}
6868
}
6969

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

src/git/commit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import git from 'gulp-git';
22
import gulp from 'gulp';
33
import dedent from 'dedent';
4-
import {isString} from '../../common/util';
4+
import {isString} from '../common/util';
55

66
export { commit };
77

test/tester.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as repo from './tools/repo';
22
import * as clean from './tools/clean';
33
import * as files from './tools/files';
4-
import * as util from '../common/util';
4+
import * as util from '../src/common/util';
55
import {config as userConfig} from './config';
66
import * as sh from 'shelljs'; // local instance
77
import _ from 'lodash';

test/tests/adapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import fs from 'fs';
77
// in the short term
88
import {adapter, init as commitizenInit} from '../../src/commitizen';
99

10-
import {isFunction} from '../../common/util';
10+
import {isFunction} from '../../src/common/util';
1111

1212
// Bootstrap our tester
1313
import {bootstrap} from '../tester';

test/tests/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {expect} from 'chai';
2-
import {isArray, isFunction, isString} from '../../common/util';
2+
import {isArray, isFunction, isString} from '../../src/common/util';
33

44
describe('common util', function() {
55

0 commit comments

Comments
 (0)