-
Notifications
You must be signed in to change notification settings - Fork 1.4k
(WIP) Implement application decoupling #926
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
(WIP) Implement application decoupling #926
Conversation
Implements the application decoupling as discussed in #913.
@@ -47,7 +47,7 @@ module.exports = function(config) { | |||
// suppress annoying 404 warnings for resources, images, etc. | |||
{ pattern: 'dist/dev/assets/**/*', watched: false, included: false, served: true }, | |||
|
|||
'test-main.js' | |||
'src/browser/test-main.js' |
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.
Currently test-main.js
gets copied over to dist/dev/test-main.js
. Should that be? Or should it be excluded from the copy task (Don't know right now, which task does the copying)
Question: Should it point to the copied test-main.js
in dist/dev
or the source test-main.js
in src/browser
?
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.
Should not be copied because it is not used there. We should use the version in src/browser
.
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.
Thanks for the info! I updated the build task accordingly with the commit 0129dac
@TheDonDope awesome job! |
Excludes karma.conf.js, protractor.conf.js and test-main.js from the copy build task, so that those files will not be copied over to /dist/** directory. Furthermore also excludes the tsconfig.json from this copy process, as it was copied over before too.
@Shyam-Chen I already tried that, but it did not have an effect. I think there is another change neccessary in https://github.com/mgechev/angular2-seed/blob/master/package.json#L16 Currently, if you run |
e2e has two parts, one is CI, the other is a local |
see #837 |
@Shyam-Chen yes thank you i found that one too through the history of "e2e": "protractor", for the local protractor run. Shouldnt this command needed to be update to something like: "e2e": "gulp build.e2e --color && gulp build.js.e2e --color && gulp e2e --color", |
@Shyam-Chen "scripts": {
[...]
"e2e": "protractor",
"e2e.live": "protractor --elementExplorer",
[...]
"e2e.ci": "gulp build.prod --color && gulp build.js.e2e --color && gulp e2e --color",
"tests.all": "npm test && npm run e2e.ci",
[...]
}, According to the # e2e (aka. end-to-end, integration) - In three different shell windows
# Make sure you don't have a global instance of Protractor
# npm run webdriver-update <- You will need to run this the first time
npm run webdriver-start
npm run serve.e2e
npm run e2e
# e2e live mode - Protractor interactive mode
# Instead of last command above, you can use:
npm run e2e.live Is this still correct? If it is correct, then the gulp script So, since we do have a dedicated gulp task To sum it up: If i understood everything correctly, my guessed solution to the problem would be the following: In "scripts": {
[...]
"e2e": "gulp build.prod --color && gulp build.js.e2e --color && gulp e2e --color",
[...]
"tests.all": "npm test && npm run e2e",
[...]
},
What do you think? |
|
rename |
Updates the protractor configuration and associated gulp task.
🎉 Alright, from my side i'm finished, looking forward for a code review :) |
LGMT. I'll take a better look in the afternoon and merge. Guys great job! |
"e2e.live": "protractor --elementExplorer", | ||
"e2e": "protractor src/browser/protractor.conf.js", | ||
"e2e.live": "protractor src/browser/protractor.conf.js --elementExplorer", | ||
"e2e.singleRun": "gulp build.prod --color && gulp build.js.e2e --color && gulp e2e --color", | ||
"gulp": "gulp", | ||
"karma": "karma", |
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.
Is it going to change?
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.
Hey @Shyam-Chen, what do you mean?
About "e2e"
-> I had to add the src/browser/protractror.conf.js
to it, since it has been moved to src/browser
. The same for "e2e.live"
.
About "e2e.singleRun"
i renamed "e2e.cli"
as you suggested to "e2e.singleRun"
and sorted it alphabetically under "e2e.live"
(since all other scripts are also in alphabetical order)
@mgechev Thanks! :) I just wanted to update the |
add new task? // gulpfile.ts
gulp.task('e2e.singleRun', (done: any) =>
runSequence('build.prod',
'build.js.e2e',
'e2e',
done)); "e2e.singleRun": "gulp e2e.singleRun --color", // package.json |
Adds a e2e.singleRun gulp task to the gulpfile to leave the script in the package.json more compact. Also updates the README to include the new folder and file structure.
@Shyam-Chen Thanks for the suggestion, i updated it and added this with the commit 8ad5161 :) |
Awesome guys. |
Hey @ludohenin what about the |
@ludohenin Oh sh**, i just had another look at the original proposal of #913, and you are totally right! There was a separate |
In @mgechev's proposal, the client platform app comes with its own package.json file. |
@ludohenin I guess it will not be as easy as to just transfer the browser app specific dependencies to the |
Also: Would this mean that in consequence that there would be a separete |
Hahah, I agree about the 🍺, and about the changes that need to be made. The build needs to be changed to create |
🚑 Alright, i hereby call for help on the last necessary changes: 🚑
Any snippets / commits / fork branches are welcome :) Thanks guys! |
I'll put this in my schedule for the next week/during the weekend. |
Continued in #959 which has this commits pushed to the |
Hey guys,
i went ahead and started working on implementing the application decoupling as discussed in #913.
The PR is still a a work in progress:
src/client
tosrc/browser
<- IFbrowser
is now fine for everyone :D I could change it if you wantkarma.conf.js
tosrc/browser/karma.conf.js
test-main.js
tosrc/browser/test-main.js
protractor.conf.js
tosrc/browser/protractor.conf.js
$ npm start
is still running fine (updateseed.config.ts
)$ npm test
is still running fine (updating the paths inkarma.start.ts
,karma.conf.js
andtest-main.js
karma.conf.js
,protractor.conf.js
andtest-main.js
from the copy process todist/**
$ npm run webdriver-start && $ npm run serve.e2e && $ npm run e2e
still runs fine should work now with the updates of commit 4b2ca0bpackage.json
insrc/browser
dist/browser/dev|prod|test|tmp
directoriesAny feedback/help/change requests are welcome as always :)
Have a nice day!
// cc @mgechev @ludohenin @d3viant0ne @NathanWalker @Shyam-Chen