-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from abouthiroppy/feature/support-node-4
support node4
- Loading branch information
Showing
13 changed files
with
2,284 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"presets": [ | ||
["@babel/preset-env", { | ||
"targets": { | ||
"node": "4" | ||
} | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
before_install: | ||
- npm i -g npm@^5.4.0 | ||
git: | ||
depth: 10 | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '8' | ||
- '6' | ||
- '4' | ||
|
||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions
16
src/__tests__/packageData.test.js → __tests__/packageData.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/__tests__/upgradeConfig.test.js → __tests__/upgradeConfig.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
const path = require('path'); | ||
const { isAcceptedNodeVersion, writePackageJSON, writeBabelRC } = require("../src"); | ||
const globby = require('globby'); | ||
const cwd = process.cwd(); | ||
|
||
if (!isAcceptedNodeVersion()) { | ||
throw new Error("Babel 7 will only support Node 4 and higher"); | ||
} | ||
|
||
// TOOD: allow passing a specific path | ||
(async () => { | ||
// account for nested babelrc's | ||
const paths = await globby(['**/.babelrc', '!./node_modules/**']); | ||
const packages = await globby(['**/package.json', '!./node_modules/**']); | ||
|
||
// if not a monorepo | ||
if (packages.length === 1) { | ||
if (paths.length > 1) { | ||
console.log("We suggest using the new 'overrides' option instead of nested .babelrc's, can check out http://new.babeljs.io/docs/en/next/babelrc.html#overrides"); | ||
} | ||
paths.forEach(p => writeBabelRC(p)); | ||
} | ||
})(); | ||
|
||
// TOOD: allow passing a specific path | ||
writePackageJSON(); | ||
// TODO: just do this automatically | ||
console.log("You'll need to re-run yarn or npm install"); | ||
require('@babel/polyfill'); | ||
require('../lib/bin'); |
Oops, something went wrong.