-
Notifications
You must be signed in to change notification settings - Fork 6.9k
chore(*): switch from bower
to npm
for frontend dependencies
#390
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
logs/* | ||
!.gitkeep | ||
node_modules/ | ||
bower_components/ | ||
app/lib/ | ||
tmp | ||
.DS_Store | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ dist: trusty | |
|
||
language: node_js | ||
node_js: | ||
- '4.5' | ||
- 6 | ||
|
||
install: | ||
- export DISPLAY=:99.0 | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,15 @@ | |
"description": "A starter project for AngularJS", | ||
"repository": "https://github.com/angular/angular-seed", | ||
"license": "MIT", | ||
"dependencies": { | ||
"angular": "^1.5.9", | ||
"angular-loader": "^1.5.9", | ||
"angular-route": "^1.5.9", | ||
"html5-boilerplate": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
"bower": "^1.7.7", | ||
"angular-mocks": "^1.5.9", | ||
"cpx": "^1.5.0", | ||
"http-server": "^0.9.0", | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^0.13.22", | ||
|
@@ -17,24 +24,19 @@ | |
"protractor": "^4.0.9" | ||
}, | ||
"scripts": { | ||
"postinstall": "bower install", | ||
|
||
"postinstall": "npm run copy-libs", | ||
"update-deps": "npm update", | ||
"postupdate-deps": "bower update", | ||
|
||
"postupdate-deps": "npm run copy-libs", | ||
"copy-libs": "cpx \"node_modules/{angular,angular-*,html5-boilerplate}/**/*\" app/lib -C", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems less than ideal to copy dependencies manually, having to update and maintain this inline script whenever a dependency is added, like bootstrap for instance. Perhaps it would be simpler to just go the route of using a build tool like webpack or brunch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that in any significant project you would end up with some tool like that, but for angular-seed we are trying to keep the complexity and number of tools to the minimum. |
||
"prestart": "npm install", | ||
"start": "http-server -a localhost -p 8000 -c-1 ./app", | ||
|
||
"pretest": "npm install", | ||
"test": "karma start karma.conf.js", | ||
"test-single-run": "karma start karma.conf.js --single-run", | ||
|
||
"preupdate-webdriver": "npm install", | ||
"update-webdriver": "webdriver-manager update", | ||
|
||
"preprotractor": "npm run update-webdriver", | ||
"protractor": "protractor e2e-tests/protractor.conf.js", | ||
|
||
"update-index-async": "node -e \"var fs=require('fs'),indexFile='app/index-async.html',loaderFile='app/bower_components/angular-loader/angular-loader.min.js',loaderText=fs.readFileSync(loaderFile,'utf-8').split(/sourceMappingURL=angular-loader.min.js.map/).join('sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map'),indexText=fs.readFileSync(indexFile,'utf-8').split(/\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/).join('//@@NG_LOADER_START@@\\n'+loaderText+' //@@NG_LOADER_END@@');fs.writeFileSync(indexFile,indexText);\"" | ||
"update-index-async": "node -e \"var fs=require('fs'),indexFile='app/index-async.html',loaderFile='app/lib/angular-loader/angular-loader.min.js',loaderText=fs.readFileSync(loaderFile,'utf-8').split(/sourceMappingURL=angular-loader.min.js.map/).join('sourceMappingURL=lib/angular-loader/angular-loader.min.js.map'),indexText=fs.readFileSync(indexFile,'utf-8').split(/\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/).join('//@@NG_LOADER_START@@\\n'+loaderText+' //@@NG_LOADER_END@@');fs.writeFileSync(indexFile,indexText);\"" | ||
} | ||
} |
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.
I wondered if we really need
update-deps
...Can we not just have a
postupdate
hook that copies the libs?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.
npm
does not runpostupdate
afternpm update
. From reading this, I would expect it runpostinstall
(after it runsnpm install
under the hood), but it doesn't.Another idea is to recommend using
npm install
even for updating in README.md.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.
I think
postinstall
only runs when a module is being installed as a dependency, rather than when one is installing the dependencies of the current module.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.
What I mean is, it does run when I execute
npm install
, but it doesn't when I executenpm update
(which is supposed to runnpm install <outdated deps>
under the hood) from the exact same project state.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.
oh right