-
Notifications
You must be signed in to change notification settings - Fork 12k
Add App Shell and Service Worker to --mobile flag #711
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f717bde
feat(mobile): add blueprint for app manifest and icons
jeffbcross cb1270f
feat(mobile): add support for generating App Shell in index.html
jeffbcross 51569ce
feat(mobile): add prod build step to concatenate scripts
jeffbcross 04593eb
feat(mobile): add ServiceWorker generation to build process and index
jeffbcross 192bf87
test(config): disable config spec
jeffbcross 7c0ba39
test(e2e_workflow): disable flaky tests
jeffbcross File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+5.46 KB
addon/ng2/blueprints/mobile/files/__path__/icons/android-chrome-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.5 KB
addon/ng2/blueprints/mobile/files/__path__/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.63 KB
addon/ng2/blueprints/mobile/files/__path__/icons/android-chrome-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.06 KB
addon/ng2/blueprints/mobile/files/__path__/icons/android-chrome-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.87 KB
addon/ng2/blueprints/mobile/files/__path__/icons/android-chrome-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.71 KB
addon/ng2/blueprints/mobile/files/__path__/icons/android-chrome-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.38 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.57 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.46 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.87 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.99 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.36 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.49 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.87 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.05 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.98 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.99 KB
addon/ng2/blueprints/mobile/files/__path__/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
addon/ng2/blueprints/mobile/files/__path__/icons/safari-pinned-tab.svg
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts
This file contains hidden or 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,27 @@ | ||
import {provide} from '@angular/core'; | ||
import {APP_BASE_HREF} from '@angular/common'; | ||
import {<%= jsComponentName %>AppComponent} from './app/'; | ||
import { | ||
REQUEST_URL, | ||
ORIGIN_URL | ||
} from 'angular2-universal'; | ||
|
||
export const options = { | ||
directives: [ | ||
// The component that will become the main App Shell | ||
<%= jsComponentName %>AppComponent | ||
], | ||
platformProviders: [ | ||
provide(ORIGIN_URL, { | ||
useValue: '' | ||
}) | ||
], | ||
providers: [ | ||
// What URL should Angular be treating the app as if navigating | ||
provide(APP_BASE_HREF, {useValue: '/'}), | ||
provide(REQUEST_URL, {useValue: '/'}) | ||
], | ||
async: true, | ||
preboot: false | ||
}; | ||
|
47 changes: 47 additions & 0 deletions
47
addon/ng2/blueprints/mobile/files/__path__/manifest.webapp
This file contains hidden or 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,47 @@ | ||
{ | ||
"name": "<%= fullAppName %>", | ||
"short_name": "<%= fullAppName %>", | ||
"icons": [ | ||
{ | ||
"src": "/android-chrome-36x36.png", | ||
"sizes": "36x36", | ||
"type": "image/png", | ||
"density": 0.75 | ||
}, | ||
{ | ||
"src": "/android-chrome-48x48.png", | ||
"sizes": "48x48", | ||
"type": "image/png", | ||
"density": 1 | ||
}, | ||
{ | ||
"src": "/android-chrome-72x72.png", | ||
"sizes": "72x72", | ||
"type": "image/png", | ||
"density": 1.5 | ||
}, | ||
{ | ||
"src": "/android-chrome-96x96.png", | ||
"sizes": "96x96", | ||
"type": "image/png", | ||
"density": 2 | ||
}, | ||
{ | ||
"src": "/android-chrome-144x144.png", | ||
"sizes": "144x144", | ||
"type": "image/png", | ||
"density": 3 | ||
}, | ||
{ | ||
"src": "/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"density": 4 | ||
} | ||
], | ||
"theme_color": "#000000", | ||
"background_color": "#e0e0e0", | ||
"start_url": "/index.html", | ||
"display": "standalone", | ||
"orientation": "portrait" | ||
} |
This file contains hidden or 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,3 @@ | ||
System.import('system-config.js').then(function () { | ||
System.import('main'); | ||
}).catch(console.error.bind(console)); |
This file contains hidden or 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,32 @@ | ||
const stringUtils = require('ember-cli-string-utils'); | ||
|
||
module.exports = { | ||
description: '', | ||
|
||
availableOptions: [ | ||
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, | ||
{ name: 'prefix', type: String, default: 'app', aliases: ['p'] }, | ||
{ name: 'mobile', type: Boolean, default: false } | ||
], | ||
|
||
locals: function (options) { | ||
const fullAppName = stringUtils.dasherize(options.entity.name) | ||
.replace(/-(.)/g, (_, l) => ' ' + l.toUpperCase()) | ||
.replace(/^./, (l) => l.toUpperCase()); | ||
|
||
return { | ||
jsComponentName: stringUtils.classify(options.entity.name), | ||
fullAppName: fullAppName, | ||
sourceDir: options.sourceDir | ||
}; | ||
}, | ||
|
||
fileMapTokens: function (options) { | ||
// Return custom template variables here. | ||
return { | ||
__path__: () => { | ||
return options.locals.sourceDir; | ||
} | ||
}; | ||
} | ||
}; |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
}, | ||
|
||
"files": [ | ||
"main.ts", | ||
"main.ts",<% if (isMobile) { %> | ||
"main-app-shell.ts",<% } %> | ||
"typings.d.ts" | ||
] | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
/// <reference path="<%= refToTypings %>/typings/browser.d.ts" /> | ||
|
||
declare var module: { id: string }; | ||
<% if(!isMobile) { %>declare var module: { id: string };<% } %> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
needed?
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.
Yep