Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
fix: transpile to support node 4.x
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #3
  • Loading branch information
jlegrone committed Nov 24, 2017
1 parent f4d5429 commit 6ed2d35
Show file tree
Hide file tree
Showing 19 changed files with 587 additions and 134 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
coverage
lib

**/generators/**/templates
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
coverage
lib

*-error.log
*-error.log
*-debug.log
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
language: node_js
node_js:
- 8
# - 6
# - 4
- 6
- 4
before_install:
- npm install -g yarn codecov
install:
- yarn install
- yarn install --ignore-engines
script:
- if [[ $(node --version) == v4* ]];
then echo "Running node 4; skipping commitlint.";
else ./node_modules/.bin/commitlint --from="$TRAVIS_BRANCH" --to="$TRAVIS_COMMIT";
fi
- yarn lint
- yarn test -- --verbose
- yarn build
- yarn test --verbose
after_script:
- codecov
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"private": true,
"scripts": {
"build": "lerna run --parallel build",
"lint": "eslint ./",
"test": "jest --forceExit",
"test:watch": "yarn test -- --watch --coverage false",
"prerelease": "yarn test",
"prerelease": "yarn test --no-cache",
"release": "lerna publish --conventional-commits --message \"chore(npm): publish\"",
"commit": "git-cz",
"commit:retry": "git-cz --retry",
Expand Down
13 changes: 13 additions & 0 deletions packages/create-semantic-module/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
["env", {
"targets": {
"node": "4.5.0"
}
}]
],
"ignore": [
"**/__tests__/**",
"**/__mocks__/**"
]
}
3 changes: 3 additions & 0 deletions packages/create-semantic-module/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/__mocks__/**
**/__tests__/**
src
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../')(process.argv.slice(2));
require('../lib')(process.argv.slice(2));
14 changes: 11 additions & 3 deletions packages/create-semantic-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "create-semantic-module",
"version": "0.0.0",
"description": "Initialize a project with conventional commits, commitizen, and commit linting.",
"main": "index.js",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/jlegrone/create-semantic-module.git"
Expand All @@ -17,16 +17,24 @@
"create-semantic-module": "./bin/create-semantic-module.js"
},
"scripts": {
"test": "jest"
"test": "jest",
"build": "rimraf lib && babel src -d lib",
"prepublish": "yarn run build"
},
"dependencies": {
"generator-semantic-module": "^0.0.0",
"yeoman-environment": "^2.0.2"
},
"devDependencies": {
"jest": "^21.2.1"
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"jest": "^21.2.1",
"rimraf": "^2.6.2"
},
"jest": {
"testEnvironment": "node"
},
"engines": {
"node": ">=4.5.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var yeoman = require('yeoman-environment');
import {createEnv} from 'yeoman-environment';

function createSemanticModule(args) {
var env = yeoman.createEnv();
const env = createEnv();

env.register(
require.resolve('generator-semantic-module'),
Expand Down
14 changes: 14 additions & 0 deletions packages/generator-semantic-module/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
["env", {
"targets": {
"node": "4.5.0"
}
}]
],
"ignore": [
"**/templates/**",
"**/__tests__/**",
"**/__mocks__/**"
]
}
3 changes: 3 additions & 0 deletions packages/generator-semantic-module/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/__mocks__/**
**/__tests__/**
src
15 changes: 10 additions & 5 deletions packages/generator-semantic-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
"url": "https://github.com/jlegrone/create-semantic-module/issues"
},
"homepage": "https://github.com/jlegrone/create-semantic-module#readme",
"files": [
"generators"
],
"main": "generators/app/index.js",
"main": "lib/generators/app/index.js",
"keywords": [
"conventional commits",
"commitizen",
"yeoman-generator"
],
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"jest": "^21.2.1",
"jest-cli": "^21.2.1",
"ncp": "^2.0.0",
"nsp": "^3.1.0",
"rimraf": "^2.6.2",
"yeoman-assert": "^3.0.0",
"yeoman-test": "^1.6.0"
},
Expand All @@ -37,7 +38,11 @@
"testEnvironment": "node"
},
"scripts": {
"prepublish": "nsp check",
"build": "rimraf lib && ncp src lib && rimraf lib/__tests__ && babel src -d lib",
"prepublish": "nsp check && yarn run build",
"test": "jest"
},
"engines": {
"node": ">=4.5.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const defaults = {
function getCLIOptions(optionsObj) {
const optionsKeys = Object.keys(options);
return Object.keys(optionsObj)
.filter(key => optionsKeys.includes(key))
.filter(key => optionsKeys.indexOf(key) !== -1)
.reduce((obj, key) => {
obj[key] = optionsObj[key];
return obj;
Expand Down
Loading

0 comments on commit 6ed2d35

Please sign in to comment.