Skip to content

Commit

Permalink
refactor(transpile): use semver-try-require instead of internal tryRe…
Browse files Browse the repository at this point in the history
…quire
  • Loading branch information
sverweij committed Jan 21, 2018
1 parent eb3d3ad commit d36cfd8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 94 deletions.
22 changes: 6 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,13 @@ src/extract/transpile/meta.js: \
src/extract/transpile/typeScriptWrap.js

src/extract/transpile/coffeeWrap.js: \
package.json \
src/extract/transpile/tryRequire.js
package.json

src/extract/transpile/liveScriptWrap.js: \
package.json \
src/extract/transpile/tryRequire.js
package.json

src/extract/transpile/typeScriptWrap.js: \
package.json \
src/extract/transpile/tryRequire.js
package.json

src/extract/transpile/index.js: \
src/extract/transpile/meta.js
Expand Down Expand Up @@ -254,7 +251,6 @@ ALL_SRC=src/main/index.js \
src/extract/transpile/javaScriptWrap.js \
src/extract/transpile/liveScriptWrap.js \
src/extract/transpile/meta.js \
src/extract/transpile/tryRequire.js \
src/extract/transpile/typeScriptWrap.js \
src/main/options/defaults.json \
src/main/options/normalize.js \
Expand Down Expand Up @@ -343,16 +339,13 @@ src/extract/transpile/meta.js: \
src/extract/transpile/typeScriptWrap.js

src/extract/transpile/coffeeWrap.js: \
package.json \
src/extract/transpile/tryRequire.js
package.json

src/extract/transpile/liveScriptWrap.js: \
package.json \
src/extract/transpile/tryRequire.js
package.json

src/extract/transpile/typeScriptWrap.js: \
package.json \
src/extract/transpile/tryRequire.js
package.json

src/extract/transpile/index.js: \
src/extract/transpile/meta.js
Expand Down Expand Up @@ -449,9 +442,6 @@ test/extract/transpile/meta.spec.js: \
src/extract/transpile/liveScriptWrap.js \
src/extract/transpile/meta.js

test/extract/transpile/tryRequire.spec.js: \
src/extract/transpile/tryRequire.js

test/extract/transpile/typeScriptWrap.spec.js: \
src/extract/transpile/typeScriptWrap.js

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"normalize-newline": "3.0.0",
"resolve": "1.5.0",
"safe-regex": "1.1.0",
"semver": "5.5.0"
"semver": "5.5.0",
"semver-try-require": "1.0.5"
},
"engines": {
"node": ">=4"
Expand Down
2 changes: 1 addition & 1 deletion src/extract/transpile/coffeeWrap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
const tryRequire = require("./tryRequire");
const tryRequire = require("semver-try-require");
const $package = require("../../../package.json");

/*
Expand Down
2 changes: 1 addition & 1 deletion src/extract/transpile/liveScriptWrap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const tryRequire = require("./tryRequire");
const tryRequire = require("semver-try-require");
const livescript = tryRequire(
"livescript",
require("../../../package.json").supportedTranspilers.livescript
Expand Down
42 changes: 0 additions & 42 deletions src/extract/transpile/tryRequire.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/extract/transpile/typeScriptWrap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
const tryRequire = require("./tryRequire");
const tryRequire = require("semver-try-require");
const typescript = tryRequire(
"typescript",
require("../../../package.json").supportedTranspilers.typescript
Expand Down
32 changes: 0 additions & 32 deletions test/extract/transpile/tryRequire.spec.js

This file was deleted.

0 comments on commit d36cfd8

Please sign in to comment.