-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard fork node-parent-require #1239
Closed
Closed
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
296519e
Added ./suppert and ./test folder into the ./lib folder, need to conf…
RailonA e3a2a5c
Everything is working after testing a sample app, ran npx mkroosevelt
RailonA c777f0b
remove console.logs
RailonA ba9acce
Clean package.json
RailonA 3ac7f22
Run standard --fix
RailonA fcd3cdc
Made all the changes requested in the PR
RailonA 1697ea7
Add original auther information on top of ./parent-require.js, tried …
RailonA 096acb4
Moved parent-require.js into ./lib folder. Added original author info…
RailonA File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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 @@ | ||
module.exports = function (id) { | ||
let parent = module.parent | ||
for (; parent; parent = parent.parent) { | ||
try { | ||
return parent.require(id) | ||
} catch (ex) {} | ||
} | ||
throw new Error("Cannot find module '" + id + "' from parent") | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
BROWSERIFY ?= browserify | ||
kethinov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
BROWSERIFY_MAIN ?= index.js | ||
BROWSERIFY_OUT ?= build/bundle.js | ||
|
||
build-browserify: node_modules | ||
mkdir -p build | ||
$(BROWSERIFY) $(BROWSERIFY_MAIN) -o $(BROWSERIFY_OUT) | ||
|
||
|
||
.PHONY: build-browserify |
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,7 @@ | ||
COVERALLS ?= coveralls | ||
|
||
submit-istanbul-lcov-to-coveralls: | ||
cat $(ISTANBUL_LCOV_INFO_PATH) | $(COVERALLS) | ||
|
||
|
||
.PHONY: submit-istanbul-lcov-to-coveralls |
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,20 @@ | ||
ISTANBUL ?= istanbul | ||
ISTANBUL_OUT ?= ./reports/coverage | ||
ISTANBUL_REPORT ?= lcov | ||
ISTANBUL_HTML_REPORT_PATH ?= $(ISTANBUL_OUT)/lcov-report/index.html | ||
ISTANBUL_LCOV_INFO_PATH ?= $(ISTANBUL_OUT)/lcov.info | ||
|
||
|
||
test-istanbul-mocha: node_modules | ||
NODE_PATH=$(NODE_PATH_TEST) \ | ||
$(ISTANBUL) cover \ | ||
--dir $(ISTANBUL_OUT) --report $(ISTANBUL_REPORT) \ | ||
$(_MOCHA) -- \ | ||
--reporter $(MOCHA_REPORTER) \ | ||
--require $(MOCHA_REQUIRE) $(TESTS) | ||
|
||
view-istanbul-report: | ||
open $(ISTANBUL_HTML_REPORT_PATH) | ||
|
||
|
||
.PHONY: test-istanbul-mocha view-istanbul-report |
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,7 @@ | ||
JSHINT ?= jshint | ||
|
||
lint-jshint: | ||
$(JSHINT) $(SOURCES) | ||
|
||
|
||
.PHONY: lint-jshint |
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,13 @@ | ||
MOCHA ?= ./node_modules/.bin/mocha | ||
_MOCHA ?= ./node_modules/.bin/_mocha | ||
MOCHA_REPORTER ?= spec | ||
MOCHA_REQUIRE ?= ./test/bootstrap/node | ||
|
||
test-mocha: node_modules | ||
NODE_PATH=$(NODE_PATH_TEST) \ | ||
$(MOCHA) \ | ||
--reporter $(MOCHA_REPORTER) \ | ||
--require $(MOCHA_REQUIRE) $(TESTS) | ||
|
||
|
||
.PHONY: test-mocha |
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,8 @@ | ||
node_modules: | ||
npm install | ||
|
||
clobber-node: | ||
rm -rf node_modules | ||
|
||
|
||
.PHONY: clobber-node |
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,7 @@ | ||
NOTES ?= 'TODO|FIXME' | ||
|
||
notes: | ||
grep -Ern $(NOTES) $(SOURCES) $(TESTS) | ||
|
||
|
||
.PHONY: notes |
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,7 @@ | ||
TESTLING ?= testling | ||
|
||
test-testling: node_modules | ||
$(TESTLING) | ||
|
||
|
||
.PHONY: test-testling |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to
lib
and credit the original author https://github.com/jaredhanson/node-parent-requireThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be specific: credit him in a code comment at the top of the file