Skip to content
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

Fix all the things #100

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
78e9b9d
[REFACTOR] stubs now gets imports provided via set, rather than extra…
stefanpenner Sep 13, 2016
eae97f3
first pass of import/export identifier mangling
stefanpenner Sep 13, 2016
c388ac6
more ember-cli 1.x related removals
stefanpenner Sep 13, 2016
b4e6a04
allow StubGenerator -> CachingBrowserify to overwrite output from app.
stefanpenner Sep 13, 2016
b0387a9
remove more ember-cli 1.x stuff
stefanpenner Sep 13, 2016
d29a10e
StubGenerator output needs to be merged into tree
stefanpenner Sep 13, 2016
1532cac
resolve actual versions
stefanpenner Sep 14, 2016
9a81644
refactor tests (split up concerns)
stefanpenner Sep 14, 2016
71ab74f
Fixed test for multiple input rewrites.
nathanhammond Sep 14, 2016
cdf0067
add jshinting to tests
stefanpenner Sep 14, 2016
831f464
fix hinting
stefanpenner Sep 14, 2016
ee94775
fixup spacing
stefanpenner Sep 14, 2016
d30025b
use chai-files
stefanpenner Sep 14, 2016
b3f7faa
tidy up test files
stefanpenner Sep 14, 2016
75f48c1
more cleanup
stefanpenner Sep 14, 2016
6548bfa
Add in Ember Addon boilerplate.
nathanhammond Sep 14, 2016
0683633
Fix CI.
nathanhammond Sep 14, 2016
f02b3a5
Add in VS Code debug profile for mocha.
nathanhammond Sep 14, 2016
8fa1b0d
Use string positions to handle replacement.
nathanhammond Sep 15, 2016
2ef155c
Extract rewrite-imports.
nathanhammond Sep 15, 2016
74ab985
Alphabetize package.json
nathanhammond Sep 15, 2016
b65c162
npm fixtures
nathanhammond Sep 15, 2016
a7f4b5d
Set up top-level addon fixtures.
nathanhammond Sep 15, 2016
0850b99
Make sure caching-browserify (a legacy plugin) toStrings helpfully, s…
stefanpenner Sep 16, 2016
d25ff36
add a very simple/basic scenario (that works)
stefanpenner Sep 16, 2016
a60d9f9
remove unused file
stefanpenner Sep 16, 2016
e5f3e89
lazily require browserify, only injuring its load cost when used.
stefanpenner Sep 16, 2016
1f44127
only include the part of lodash we use.
stefanpenner Sep 16, 2016
47055a5
update dependency to be more accurate
stefanpenner Sep 16, 2016
8f250bb
fix lodash usage
stefanpenner Sep 16, 2016
555d137
update example to more closely match what works
stefanpenner Sep 16, 2016
f605a3b
cross platform setup script
stefanpenner Sep 16, 2016
062f674
remove trailing whitespace
stefanpenner Sep 16, 2016
e3c8b59
update example to work with in-repo addons
stefanpenner Sep 16, 2016
2c686a0
update symlink/junction hack to work in more cases
stefanpenner Sep 16, 2016
f3e0231
Rework tests, add reexports scenario.
nathanhammond Sep 16, 2016
59004b2
Properly set on prepublish.
nathanhammond Sep 16, 2016
69cc443
Revert "add a very simple/basic scenario (that works)"
nathanhammond Sep 18, 2016
772c859
Structure for doing the right thing in the vendor hook.
nathanhammond Sep 18, 2016
80b0caf
Merge pull request #106 from nathanhammond/fix-all-the-things
stefanpenner Sep 18, 2016
0ef7aa4
Partial rewrite of preprocessor approach.
nathanhammond Sep 19, 2016
b6f11dc
Move away from postprocessTree.
nathanhammond Sep 19, 2016
80597f7
Properly set basedir per target.
nathanhammond Sep 19, 2016
0f5a959
Merge pull request #109 from nathanhammond/fix-all-the-things
nathanhammond Sep 19, 2016
03c9c95
add comments, making it easier to understand where stuff is actually …
stefanpenner Sep 20, 2016
f5908b9
only rewrite if rewriting is required
stefanpenner Sep 20, 2016
a70c006
remove optimization for now. Bring back with tests.
stefanpenner Sep 20, 2016
e314119
Use the proper hook for setting up the registry.
nathanhammond Sep 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/stub-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ StubGenerator.prototype.build = function() {

var content = fs.readFileSync(fullInputPath, 'UTF8');
var imports = importsFor(content, fullInputPath);
var needsImportsReWritten = false;

Object.keys(imports).forEach(function(name) {
needsImportsReWritten = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to try comparing the imports object across runs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, i'll fix in the work im about todo.

imports[name].version = versionForModuleName(name, this.basedir);
}, this);

// TODO: only add files that required rewriting
fs.writeFileSync(fullOutputPath, rewriteImports(content, imports));
if (needsImportsReWritten) {
fs.writeFileSync(fullOutputPath, rewriteImports(content, imports));
} else {
fs.writeFileSync(fullOutputPath, content);
}

this.stubs.set(fullInputPath, imports);

Expand Down