This is an advanced seed project for Angular 2 apps based on Minko Gechev's angular2-seed that expands on all of its great features to include core support for:
write_key here| The zen of multiple platforms. Chrome, Android and iPhone all running the same code. |
| Programming Nirvana. Mac and Windows desktop both running the same code. |
frameworks:
app: your shared application architecture codecore: foundation layer (decorators and low-level services)analytics: analytics provided by Segment
i18n: internationalization featureselectron: Electron specific codetest: test specific code providing conveniences to make testing your code easier and fastertslint options like "no-unused-variable": true as the api hangs off a plain Object instead of globals
iit or ddescribe but didn't import those or vice versa, used iit leaving an unused it now in your tests? yeah, tslint will be all over you :/unused variable warnings altogether in tests since you are always using a valid key from the shorthand ObjectAdvice: If your project is intended to target a single platform (i.e, web only), then angular2-seed is likely more than suitable for your needs. However if your project goals are to target multiple platforms (web, native mobile and native desktop), with powerful out of the box library support and highly configurable/flexible testing options, then you might want to keep reading.
node v5.x.x or higher and npm 3 or higher.
To run the NativeScript app:
npm install -g nativescript
npm install -g typescript
git clone --depth 1 https://github.com/NathanWalker/angular2-seed-advanced.git
cd angular2-seed-advanced
# install the project's dependencies
npm install
# watches your files and uses livereload by default
npm start
# api document for the app
npm run serve.docs
# dev build
npm run build.dev
# prod build
npm run build.prod
npm install -g nativescript
You can make changes to files in src/client or nativescript folders. A symbolic link exists between the web src/client and the nativescript folder so changes in either location are mirrored because they are the same directory inside.
Create .tns.html and .tns.css NativeScript view files for every web component view file you have. You will see an example of the app.component.html as a NativeScript view file here.
iOS: npm run start.ios
iOS (livesync emulator): npm run start.livesync.ios
iOS (livesync device): npm run start.livesync.ios.device
// or...
Android: npm run start.android
Android (livesync emulator): npm run start.livesync.android
Android (livesync device): npm run start.livesync.android.device
Mac: npm run start.desktop
Windows: npm run start.desktop.windows
Mac: npm run start.livesync.desktop
Windows: npm run start.livesync.desktop.windows
Mac: npm run build.desktop.mac
Windows: npm run build.desktop.windows
Linux: npm run build.desktop.linux
npm test
# Debug - In two different shell windows
npm run build.test.watch # 1st window
npm run karma.start # 2nd window
# code coverage (istanbul)
# auto-generated at the end of `npm test`
# view coverage report:
npm run serve.coverage
# 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
You can learn more about Protractor Interactive Mode here
src/client/assets/i18n/
[language code].json (copy existing one and adapt the translation strings)src/client/app/frameworks/app/services/app-config.service.spec.ts
src/client/app/frameworks/app/services/app-config.service.ts
SUPPORTED_LANGUAGESsrc/client/app/frameworks/i18n/components/lang-switcher.component.spec.ts
upstream/master
Default application server configuration
var PORT = 5555;
var LIVE_RELOAD_PORT = 4002;
var DOCS_PORT = 4003;
var APP_BASE = '/';
Configure at runtime
npm start -- --port 8080 --reload-port 4000 --base /my-app/
Please Note: The seed uses Angular's ChangeDetectionStrategy.OnPush by default which requires some understanding of immutability and one-way data flows. Please check out the following resources to learn more:
If you experience issues with changes not occuring in your views, you can disable this by commenting out these lines. The seed uses OnPush by default because it provides optimal performance and if you decide to turn it off while developing your application, you can always turn it back on when you're ready to refactor your data services to utilize OnPush properly.
Several branches exist with certain features integrated:
npm run git.setup - This will initialize git as well as setup upstream properly.git remote add origin ...your private repo...npm run git.prepare - This will prepare git to handle the mergenpm run git.merge - This will fetch upstream and run the first merge (*Important)upstream and your first commit) added.git add .; git commit -m'ready'. Yes, you will be committing all those conflicts, which actually are not a problem in this 1 time case.git setup and ready to develop your application as well as merge in upstream changes in the future.npm install (and all other usage docs in this README apply)framework for your application in src/client/app/frameworks to build your codebase out. Say your app is called AwesomeApp, then create awesomeapp and start building out all your components and services in there. Create other frameworks as you see fit to organize.i18n, remove ng2-translate as dependency root package.json and nativescript/package.json. Then remove any references to i18n throughout.You can read more about configuring a remote for a fork here
npm run git.merge.preview - This will fetch upstream and show you how the merge would looknpm run git.merge - This will actually do the mergeYou can read more about syncing a fork here.
If you have any suggestions to this workflow, please post here.
Please see the CONTRIBUTING file for guidelines.
Content type
Image
Digest
Size
375.6 MB
Last updated
about 10 years ago
docker pull chnoumis/angular2-base