diff --git a/.travis.yml b/.travis.yml index 8e551b7278b3..5df252650834 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,6 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CHROME_BIN=chromium-browser; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo "--no-sandbox" > ~/.config/chromium-flags.conf; fi - - if [[ "$TARGET" == "mobile" ]]; then export MOBILE_TEST=true; fi - npm install -g npm - npm config set spin false - npm config set progress false diff --git a/README.md b/README.md index 6dc870884b08..218d3b3b06e3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,6 @@ with NPM 3 or higher. * [Proxy To Backend](#proxy-to-backend) * [Deploying the App via GitHub Pages](#deploying-the-app-via-github-pages) * [Linting and formatting code](#linting-and-formatting-code) -* [Support for offline applications](#support-for-offline-applications) * [Commands autocompletion](#commands-autocompletion) * [Project assets](#project-assets) * [Global styles](#global-styles) @@ -277,12 +276,6 @@ This will use the `lint` npm script that in generated projects uses `tslint`. You can modify the these scripts in `package.json` to run whatever tool you prefer. -### Support for offline applications - -**The `--mobile` flag has been disabled temporarily. Sorry for the inconvenience.** - -~~Angular-CLI includes support for offline applications via the `--` flag on `ng new`. Support is experimental, please see the angular/mobile-toolkit project and https://mobile.angular.io/ for documentation on how to make use of this functionality.~~ - ### Commands autocompletion To turn on auto completion use the following commands: diff --git a/package.json b/package.json index ac5e082d34aa..521c7469277b 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "test": "npm-run-all -c test:packages test:cli test:deps", "e2e": "npm run test:e2e", "e2e:nightly": "node tests/run_e2e.js --nightly", - "mobile_test": "mocha tests/e2e/e2e_workflow.spec.js", "test:e2e": "node tests/run_e2e.js", "test:cli": "node tests/runner", "test:deps": "node scripts/publish/validate_dependencies.js", @@ -82,7 +81,6 @@ "node-modules-path": "^1.0.0", "node-sass": "^4.1.1", "nopt": "^3.0.1", - "offline-plugin": "^3.4.1", "opn": "4.0.1", "ora": "^0.2.0", "portfinder": "1.0.9", diff --git a/packages/@ngtools/json-schema/tests/serializer/schema3.json b/packages/@ngtools/json-schema/tests/serializer/schema3.json index c8626d1aac1d..cf863abc8506 100644 --- a/packages/@ngtools/json-schema/tests/serializer/schema3.json +++ b/packages/@ngtools/json-schema/tests/serializer/schema3.json @@ -65,9 +65,6 @@ "prefix": { "type": "string" }, - "mobile": { - "type": "boolean" - }, "styles": { "description": "Global styles to be included in the build.", "type": "array", diff --git a/packages/@ngtools/json-schema/tests/serializer/value3.json b/packages/@ngtools/json-schema/tests/serializer/value3.json index 8d79f3fc30f3..1ab96e50648d 100644 --- a/packages/@ngtools/json-schema/tests/serializer/value3.json +++ b/packages/@ngtools/json-schema/tests/serializer/value3.json @@ -16,7 +16,6 @@ "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "<%= prefix %>", - "mobile": true, "styles": [ "styles.<%= styleExt %>" ], diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-144x144.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-144x144.png deleted file mode 100644 index a64dd11b7475..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-144x144.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-192x192.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-192x192.png deleted file mode 100644 index 4ea56800c064..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-192x192.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-36x36.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-36x36.png deleted file mode 100644 index 0f8ba0b53ab1..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-36x36.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-48x48.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-48x48.png deleted file mode 100644 index 825857550f6f..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-48x48.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-72x72.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-72x72.png deleted file mode 100644 index f5f4daa4e51f..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-72x72.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-96x96.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-96x96.png deleted file mode 100644 index 36b43addc2f4..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/android-chrome-96x96.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-114x114.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-114x114.png deleted file mode 100644 index c30f9dbc7a4f..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-114x114.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-120x120.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-120x120.png deleted file mode 100644 index ee44ccff7fa9..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-120x120.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-144x144.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-144x144.png deleted file mode 100644 index 74ec622748bb..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-144x144.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-152x152.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-152x152.png deleted file mode 100644 index 38105cff2205..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-152x152.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-180x180.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-180x180.png deleted file mode 100644 index 3e4de71ecb3c..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-180x180.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-57x57.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-57x57.png deleted file mode 100644 index ef2963a08e83..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-57x57.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-60x60.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-60x60.png deleted file mode 100644 index 0db9f37c5af7..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-60x60.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-72x72.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-72x72.png deleted file mode 100644 index 565bc46ba7b7..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-72x72.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-76x76.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-76x76.png deleted file mode 100644 index 05f04aba19df..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-76x76.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-precomposed.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-precomposed.png deleted file mode 100644 index a4babe853d99..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon-precomposed.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon.png deleted file mode 100644 index 3e4de71ecb3c..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/apple-touch-icon.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-16x16.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-16x16.png deleted file mode 100644 index df3ce0d7e7e2..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-16x16.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-32x32.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-32x32.png deleted file mode 100644 index 93cf0641e5bc..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-32x32.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-96x96.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-96x96.png deleted file mode 100644 index 36b43addc2f4..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/favicon-96x96.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/icon.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/icon.png deleted file mode 100644 index 4dace951fab2..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/icon.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-144x144.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-144x144.png deleted file mode 100644 index 9ca91770760b..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-144x144.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-150x150.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-150x150.png deleted file mode 100644 index 444b3bf92572..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-150x150.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-310x150.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-310x150.png deleted file mode 100644 index 59e907107579..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-310x150.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-310x310.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-310x310.png deleted file mode 100644 index 143e9d67cb25..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-310x310.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-70x70.png b/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-70x70.png deleted file mode 100644 index 285924f08b7c..000000000000 Binary files a/packages/angular-cli/blueprints/mobile/files/__path__/icons/mstile-70x70.png and /dev/null differ diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/icons/safari-pinned-tab.svg b/packages/angular-cli/blueprints/mobile/files/__path__/icons/safari-pinned-tab.svg deleted file mode 100644 index 0d6f7ea39538..000000000000 --- a/packages/angular-cli/blueprints/mobile/files/__path__/icons/safari-pinned-tab.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - - - diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/main-app-shell.ts b/packages/angular-cli/blueprints/mobile/files/__path__/main-app-shell.ts deleted file mode 100644 index d3e009cb19c5..000000000000 --- a/packages/angular-cli/blueprints/mobile/files/__path__/main-app-shell.ts +++ /dev/null @@ -1,47 +0,0 @@ -import 'angular2-universal-polyfills'; -import { provide } from '@angular/core'; -import { APP_BASE_HREF } from '@angular/common'; -import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell'; -import { - REQUEST_URL, - ORIGIN_URL, - Bootloader, - BootloaderConfig, - AppConfig -} from 'angular2-universal'; -import { AppComponent } from './app/'; - -const bootloaderConfig: BootloaderConfig = { - platformProviders: [ - APP_SHELL_BUILD_PROVIDERS, - provide(ORIGIN_URL, { - useValue: 'http://localhost:4200' // full urls are needed for node xhr - }), - provide(APP_BASE_HREF, { useValue: '/' }), - ], - async: true, - preboot: false -} - -const appConfig: AppConfig = { - directives: [ - // The component that will become the main App Shell - AppComponent - ], - providers: [ - // What URL should Angular be treating the app as if navigating - provide(REQUEST_URL, { useValue: '/' }) - ] -} - -// The build system will call this function to get a bootloader -export function getBootloader() : Bootloader { - return new Bootloader(bootloaderConfig); -} - -// The build system will call this function with the bootloader from -// getBootloader and the contents of the index page -export function serialize(bootloader: Bootloader, template: string) : string { - appConfig.template = template; - return bootloader.serializeApplication(appConfig); -} \ No newline at end of file diff --git a/packages/angular-cli/blueprints/mobile/files/__path__/manifest.webapp b/packages/angular-cli/blueprints/mobile/files/__path__/manifest.webapp deleted file mode 100644 index 0c8bdd70ec23..000000000000 --- a/packages/angular-cli/blueprints/mobile/files/__path__/manifest.webapp +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "<%= fullAppName %>", - "short_name": "<%= fullAppName %>", - "icons": [ - { - "src": "icons/android-chrome-36x36.png", - "sizes": "36x36", - "type": "image/png" - }, - { - "src": "icons/android-chrome-48x48.png", - "sizes": "48x48", - "type": "image/png" - }, - { - "src": "icons/android-chrome-72x72.png", - "sizes": "72x72", - "type": "image/png" - }, - { - "src": "icons/android-chrome-96x96.png", - "sizes": "96x96", - "type": "image/png" - }, - { - "src": "icons/android-chrome-144x144.png", - "sizes": "144x144", - "type": "image/png" - }, - { - "src": "icons/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - } - ], - "theme_color": "#000000", - "background_color": "#e0e0e0", - "start_url": "/index.html", - "display": "standalone", - "orientation": "portrait" -} diff --git a/packages/angular-cli/blueprints/mobile/index.js b/packages/angular-cli/blueprints/mobile/index.js deleted file mode 100644 index 4776d04ff24d..000000000000 --- a/packages/angular-cli/blueprints/mobile/index.js +++ /dev/null @@ -1,32 +0,0 @@ -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; - } - }; - } -}; diff --git a/packages/angular-cli/blueprints/ng2/files/__path__/app/app.component.ts b/packages/angular-cli/blueprints/ng2/files/__path__/app/app.component.ts index f38d4c017945..a0b31d8e11b6 100644 --- a/packages/angular-cli/blueprints/ng2/files/__path__/app/app.component.ts +++ b/packages/angular-cli/blueprints/ng2/files/__path__/app/app.component.ts @@ -1,5 +1,4 @@ -import { Component } from '@angular/core';<% if (isMobile) { %> -import { APP_SHELL_DIRECTIVES } from '@angular/app-shell';<% } %> +import { Component } from '@angular/core'; @Component({ selector: '<%= prefix %>-root',<% if (inlineTemplate) { %> diff --git a/packages/angular-cli/blueprints/ng2/files/__path__/index.html b/packages/angular-cli/blueprints/ng2/files/__path__/index.html index 1f8c4ad70d2d..f4916b4ba356 100644 --- a/packages/angular-cli/blueprints/ng2/files/__path__/index.html +++ b/packages/angular-cli/blueprints/ng2/files/__path__/index.html @@ -6,22 +6,7 @@ - <% if (isMobile) { %> - - - - - - - - - - - - - - - <% } %> + <<%= prefix %>-root>Loading...-root> diff --git a/packages/angular-cli/blueprints/ng2/files/angular-cli.json b/packages/angular-cli/blueprints/ng2/files/angular-cli.json index 67e6dbeea657..3e7ec03e8d9d 100644 --- a/packages/angular-cli/blueprints/ng2/files/angular-cli.json +++ b/packages/angular-cli/blueprints/ng2/files/angular-cli.json @@ -16,7 +16,6 @@ "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "<%= prefix %>", - "mobile": <%= isMobile %>, "styles": [ "styles.<%= styleExt %>" ], diff --git a/packages/angular-cli/blueprints/ng2/index.js b/packages/angular-cli/blueprints/ng2/index.js index 49fca45ad622..c917ab1adae6 100644 --- a/packages/angular-cli/blueprints/ng2/index.js +++ b/packages/angular-cli/blueprints/ng2/index.js @@ -10,7 +10,6 @@ module.exports = { { name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, { name: 'prefix', type: String, default: 'app', aliases: ['p'] }, { name: 'style', type: String, default: 'css' }, - { name: 'mobile', type: Boolean, default: false }, { name: 'routing', type: Boolean, default: false }, { name: 'inline-style', type: Boolean, default: false, aliases: ['is'] }, { name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }, @@ -23,12 +22,6 @@ module.exports = { } }, - afterInstall: function (options) { - if (options.mobile) { - return Blueprint.load(path.join(__dirname, '../mobile')).install(options); - } - }, - locals: function(options) { this.styleExt = options.style; this.version = require(path.resolve(__dirname, '../../package.json')).version; @@ -41,12 +34,6 @@ module.exports = { .replace(/-(.)/g, (_, l) => ' ' + l.toUpperCase()) .replace(/^./, (l) => l.toUpperCase()); - // For mobile projects, force inline styles and templates. - if (options.mobile) { - options.inlineStyle = true; - options.inlineTemplate = true; - } - return { htmlComponentName: stringUtils.dasherize(options.entity.name), jsComponentName: stringUtils.classify(options.entity.name), @@ -56,7 +43,6 @@ module.exports = { prefix: options.prefix, styleExt: this.styleExt, relativeRootPath: relativeRootPath, - isMobile: options.mobile, routing: options.routing, inlineStyle: options.inlineStyle, inlineTemplate: options.inlineTemplate, diff --git a/packages/angular-cli/commands/generate.ts b/packages/angular-cli/commands/generate.ts index c183d99a68b4..3b03d3daa0f0 100644 --- a/packages/angular-cli/commands/generate.ts +++ b/packages/angular-cli/commands/generate.ts @@ -35,7 +35,6 @@ const GenerateCommand = EmberGenerateCommand.extend({ const blueprints = blueprintList .filter(bp => bp.indexOf('-test') === -1) .filter(bp => bp !== 'ng2') - .filter(bp => bp !== 'mobile') .map(bp => Blueprint.load(path.join(__dirname, '..', 'blueprints', bp))); let output = ''; diff --git a/packages/angular-cli/commands/init.run.ts b/packages/angular-cli/commands/init.run.ts index 0ef9f64bf2b1..40a7eedb9778 100644 --- a/packages/angular-cli/commands/init.run.ts +++ b/packages/angular-cli/commands/init.run.ts @@ -65,7 +65,6 @@ export default function initRun(commandOptions: any, rawArgs: string[]) { sourceDir: commandOptions.sourceDir, style: commandOptions.style, prefix: commandOptions.prefix, - mobile: commandOptions.mobile, routing: commandOptions.routing, inlineStyle: commandOptions.inlineStyle, inlineTemplate: commandOptions.inlineTemplate, @@ -79,13 +78,6 @@ export default function initRun(commandOptions: any, rawArgs: string[]) { new SilentError('We currently do not support a name of `' + packageName + '`.')); } - if (commandOptions.mobile) { - return Promise.reject(new SilentError( - 'The --mobile flag has been disabled temporarily while we await an update of ' + - 'angular-universal for supporting NgModule. Sorry for the inconvenience.' - )); - } - blueprintOpts.blueprint = normalizeBlueprint(blueprintOpts.blueprint); return installBlueprint.run(blueprintOpts) diff --git a/packages/angular-cli/commands/init.ts b/packages/angular-cli/commands/init.ts index de47429b9d88..566fc3013897 100644 --- a/packages/angular-cli/commands/init.ts +++ b/packages/angular-cli/commands/init.ts @@ -18,7 +18,6 @@ const InitCommand: any = Command.extend({ { name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, { name: 'style', type: String, default: 'css' }, { name: 'prefix', type: String, default: 'app', aliases: ['p'] }, - { name: 'mobile', type: Boolean, default: false }, { name: 'routing', type: Boolean, default: false }, { name: 'inline-style', type: Boolean, default: false, aliases: ['is'] }, { name: 'inline-template', type: Boolean, default: false, aliases: ['it'] } diff --git a/packages/angular-cli/commands/new.ts b/packages/angular-cli/commands/new.ts index a51cb8aeb15e..54abaf5dcb8c 100644 --- a/packages/angular-cli/commands/new.ts +++ b/packages/angular-cli/commands/new.ts @@ -40,7 +40,6 @@ const NewCommand = Command.extend({ { name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, { name: 'style', type: String, default: 'css' }, { name: 'prefix', type: String, default: 'app', aliases: ['p'] }, - { name: 'mobile', type: Boolean, default: false }, { name: 'routing', type: Boolean, default: false }, { name: 'inline-style', type: Boolean, default: false, aliases: ['is'] }, { name: 'inline-template', type: Boolean, default: false, aliases: ['it'] } @@ -84,13 +83,6 @@ const NewCommand = Command.extend({ new SilentError(`We currently do not support a name of "${packageName}".`)); } - if (commandOptions.mobile) { - return Promise.reject(new SilentError( - 'The --mobile flag has been disabled temporarily while we await an update of ' + - 'angular-universal for supporting NgModule. Sorry for the inconvenience.' - )); - } - if (!commandOptions.directory) { commandOptions.directory = packageName; } diff --git a/packages/angular-cli/lib/config/schema.json b/packages/angular-cli/lib/config/schema.json index 6f23d6c4e219..64c07bbd2b9a 100644 --- a/packages/angular-cli/lib/config/schema.json +++ b/packages/angular-cli/lib/config/schema.json @@ -66,7 +66,8 @@ "type": "string" }, "mobile": { - "type": "boolean" + "type": "boolean", + "default": false }, "styles": { "description": "Global styles to be included in the build.", diff --git a/packages/angular-cli/models/index.ts b/packages/angular-cli/models/index.ts index b4205cf32e91..0912f182b898 100644 --- a/packages/angular-cli/models/index.ts +++ b/packages/angular-cli/models/index.ts @@ -1,5 +1,4 @@ export * from './webpack-build-common'; export * from './webpack-build-production'; export * from './webpack-build-development'; -export * from './webpack-build-mobile'; export * from './webpack-build-utils'; diff --git a/packages/angular-cli/models/webpack-build-mobile.ts b/packages/angular-cli/models/webpack-build-mobile.ts deleted file mode 100644 index 27f7d3658827..000000000000 --- a/packages/angular-cli/models/webpack-build-mobile.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as path from 'path'; -const OfflinePlugin = require('offline-plugin'); -import { GlobCopyWebpackPlugin } from '../plugins/glob-copy-webpack-plugin'; -import { PrerenderWebpackPlugin } from '../utilities/prerender-webpack-plugin'; - -export const getWebpackMobileConfigPartial = function (projectRoot: string, appConfig: any) { - // Hardcoded files and paths here should be part of appConfig when - // reworking the mobile app functionality - return { - plugins: [ - new GlobCopyWebpackPlugin({ - patterns: [ 'icons', 'manifest.webapp'], - globOptions: {cwd: appConfig.root, dot: true, ignore: '**/.gitkeep'} - }), - new PrerenderWebpackPlugin({ - templatePath: 'index.html', - configPath: path.resolve(projectRoot, appConfig.root, 'main-app-shell.ts'), - appPath: path.resolve(projectRoot, appConfig.root) - }) - ] - }; -}; - -export const getWebpackMobileProdConfigPartial = function (projectRoot: string, appConfig: any) { - return { - entry: { - 'sw-install': path.resolve(__dirname, '../utilities/sw-install.js') - }, - plugins: [ - new OfflinePlugin() - ] - }; -}; diff --git a/packages/angular-cli/models/webpack-config.ts b/packages/angular-cli/models/webpack-config.ts index 893979274986..07134219e180 100644 --- a/packages/angular-cli/models/webpack-config.ts +++ b/packages/angular-cli/models/webpack-config.ts @@ -8,10 +8,6 @@ import { getWebpackCommonConfig } from './webpack-build-common'; import { getWebpackDevConfigPartial } from './webpack-build-development'; import { getWebpackProdConfigPartial } from './webpack-build-production'; import { getWebpackStylesConfig } from './webpack-build-styles'; -import { - getWebpackMobileConfigPartial, - getWebpackMobileProdConfigPartial -} from './webpack-build-mobile'; export class NgCliWebpackConfig { @@ -58,15 +54,6 @@ export class NgCliWebpackConfig { ); let targetConfigPartial = this.getTargetConfig(projectRoot, appConfig, sourcemap, verbose); - if (appConfig.mobile) { - let mobileConfigPartial = getWebpackMobileConfigPartial(projectRoot, appConfig); - let mobileProdConfigPartial = getWebpackMobileProdConfigPartial(projectRoot, appConfig); - baseConfig = webpackMerge(baseConfig, mobileConfigPartial); - if (this.target == 'production') { - targetConfigPartial = webpackMerge(targetConfigPartial, mobileProdConfigPartial); - } - } - let config = webpackMerge(baseConfig, targetConfigPartial); if (appConfig.main) { diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index dbae16a000f4..e8ae92db7040 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -68,7 +68,6 @@ "node-modules-path": "^1.0.0", "node-sass": "^4.1.1", "nopt": "^3.0.1", - "offline-plugin": "^3.4.1", "opn": "4.0.1", "ora": "^0.2.0", "portfinder": "1.0.9", diff --git a/packages/angular-cli/utilities/completion.sh b/packages/angular-cli/utilities/completion.sh index 3409e83e72e1..36751a31e8f9 100644 --- a/packages/angular-cli/utilities/completion.sh +++ b/packages/angular-cli/utilities/completion.sh @@ -12,8 +12,8 @@ build_opts='--aot --base-href --environment --i18n-file --i18n-format --locale - generate_opts='class component directive enum module pipe route service c cl d e m p r s --help' github_pages_deploy_opts='--base-href --environment --gh-token --gh-username --message --skip-build --target --user-page --custom-domain -cd -bh -e -t' help_opts='--json --verbose -v' -init_opts='--dry-run inline-style inline-template --link-cli --mobile --name --prefix --routing --skip-npm --source-dir --style --verbose -d -is -it -lc -n -p -sb -sd -sn -v' -new_opts='--directory --dry-run inline-style inline-template --link-cli --mobile --prefix --routing --skip-git --skip-npm --source-dir --style --verbose -d -dir -is -it -lc -p -sb -sd -sg -sn -v' +init_opts='--dry-run inline-style inline-template --link-cli --name --prefix --routing --skip-npm --source-dir --style --verbose -d -is -it -lc -n -p -sb -sd -sn -v' +new_opts='--directory --dry-run inline-style inline-template --link-cli --prefix --routing --skip-git --skip-npm --source-dir --style --verbose -d -dir -is -it -lc -p -sb -sd -sg -sn -v' serve_opts='--aot --environment --hmr --host --i18n-file --i18n-format --live-reload --live-reload-base-url --live-reload-host --live-reload-live-css --live-reload-port --locale --open --port --proxy-config --sourcemap --ssl --ssl-cert --ssl-key --target --watcher -H -e -lr -lrbu -lrh -lrp -o -p -pc -sm -t -w' set_opts='--global -g' test_opts='--browsers --build --code-coverage --colors --lint --log-level --port --reporters --single-run --sourcemap --watch -cc -l -sm -sr -w' diff --git a/packages/angular-cli/utilities/sw-install.js b/packages/angular-cli/utilities/sw-install.js deleted file mode 100644 index eadc268397fc..000000000000 --- a/packages/angular-cli/utilities/sw-install.js +++ /dev/null @@ -1,3 +0,0 @@ -// this file is used in ../models/webpack-build-mobile.ts to add -// service worker functionality to mobile projects -require('offline-plugin/runtime').install(); \ No newline at end of file diff --git a/tests/acceptance/init.spec.js b/tests/acceptance/init.spec.js index 9d70aad87168..4e02260cedd6 100644 --- a/tests/acceptance/init.spec.js +++ b/tests/acceptance/init.spec.js @@ -36,11 +36,10 @@ describe('Acceptance: ng init', function () { return tmp.teardown('./tmp'); }); - function confirmBlueprinted(isMobile, routing) { + function confirmBlueprinted(routing) { routing = !!routing; var blueprintPath = path.join(root, 'blueprints', 'ng2', 'files'); - var mobileBlueprintPath = path.join(root, 'blueprints', 'mobile', 'files'); - var expected = unique(walkSync(blueprintPath).concat(isMobile ? walkSync(mobileBlueprintPath) : []).sort()); + var expected = unique(walkSync(blueprintPath).sort()); var actual = walkSync('.').sort(); forEach(Blueprint.renamedFiles, function (destFile, srcFile) { @@ -53,11 +52,6 @@ describe('Acceptance: ng init', function () { expected[index] = expected[index].replace(/__path__/g, 'src'); }); - if (isMobile) { - expected = expected.filter(p => p.indexOf('app.component.html') < 0); - expected = expected.filter(p => p.indexOf('app.component.css') < 0); - } - if (!routing) { expected = expected.filter(p => p.indexOf('app-routing.module.ts') < 0); } @@ -107,10 +101,6 @@ describe('Acceptance: ng init', function () { ]).then(confirmBlueprinted); }); - it('ng init with mobile flag does throw exception', function () { - expect(ng(['init', '--mobile'])).to.throw; - }); - it('ng init can run in created folder', function () { return tmp.setup('./tmp/foo') .then(function () { diff --git a/tests/e2e/setup/500-create-project.ts b/tests/e2e/setup/500-create-project.ts index db7a6bd1bad1..4d343cfc9301 100644 --- a/tests/e2e/setup/500-create-project.ts +++ b/tests/e2e/setup/500-create-project.ts @@ -1,6 +1,5 @@ import {join} from 'path'; import {git, ng, silentNpm} from '../utils/process'; -import {isMobileTest} from '../utils/utils'; import {expectFileToExist} from '../utils/fs'; import {updateTsConfig, updateJsonFile} from '../utils/project'; import {gitClean, gitCommit} from '../utils/git'; @@ -25,7 +24,7 @@ export default function() { } else { // Otherwise create a project from scratch. createProject = Promise.resolve() - .then(() => ng('new', 'test-project', '--skip-npm', isMobileTest() ? '--mobile' : undefined)) + .then(() => ng('new', 'test-project', '--skip-npm')) .then(() => expectFileToExist(join(process.cwd(), 'test-project'))) .then(() => process.chdir('./test-project')); } diff --git a/tests/e2e/tests/build/prod-build.ts b/tests/e2e/tests/build/prod-build.ts index 0e9074a24dc0..8b2dd6fb0a66 100644 --- a/tests/e2e/tests/build/prod-build.ts +++ b/tests/e2e/tests/build/prod-build.ts @@ -1,32 +1,9 @@ import {join} from 'path'; -import {isMobileTest} from '../../utils/utils'; import {expectFileToExist, expectFileToMatch} from '../../utils/fs'; import {ng} from '../../utils/process'; import {expectGitToBeClean} from '../../utils/git'; - -function mobileOnlyChecks() { - if (!isMobileTest()) { - return; - } - - // Check for mobile-specific features in prod builds. - return Promise.resolve() - // Service Worker - .then(() => expectFileToExist('dist/sw.js')) - .then(() => expectFileToMatch('dist/index.html', /sw-install\.[0-9a-f]{20}\.bundle\.js/)) - - // App Manifest - .then(() => expectFileToExist('dist/manifest.webapp')) - .then(() => expectFileToMatch('dist/index.html', - '')) - - // Icons folder - .then(() => expectFileToExist('dist/icons')); -} - - export default function() { // Can't use the `ng` helper because somewhere the environment gets // stuck to the first build done @@ -37,6 +14,5 @@ export default function() { .then(() => expectFileToMatch('dist/index.html', /styles\.[0-9a-f]{20}\.bundle\.css/)) // Check that the process didn't change local files. - .then(() => expectGitToBeClean()) - .then(() => mobileOnlyChecks()); + .then(() => expectGitToBeClean()); } diff --git a/tests/e2e/tests/mobile/prod-features.ts b/tests/e2e/tests/mobile/prod-features.ts deleted file mode 100644 index e649c9a53f69..000000000000 --- a/tests/e2e/tests/mobile/prod-features.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {isMobileTest, expectToFail} from '../../utils/utils'; -import {expectFileToMatch, expectFileToExist} from '../../utils/fs'; - - -export default function() { - if (!isMobileTest()) { - return; - } - - return Promise.resolve() - // Service Worker - .then(() => expectToFail(() => expectFileToMatch('dist/index.html', - 'if (\'serviceWorker\' in navigator) {'))) - .then(() => expectToFail(() => expectFileToExist('dist/worker.js'))) - - // Asynchronous bundle - .then(() => expectToFail(() => expectFileToMatch('dist/index.html', - ''))) - .then(() => expectToFail(() => expectFileToExist('dist/app-concat.js'))); -} diff --git a/tests/e2e/utils/utils.ts b/tests/e2e/utils/utils.ts index 0e89816b07c1..8189ed771b4e 100644 --- a/tests/e2e/utils/utils.ts +++ b/tests/e2e/utils/utils.ts @@ -9,10 +9,6 @@ export function expectToFail(fn: () => Promise, errorMessage?: string): Pro }, () => { }); } -export function isMobileTest() { - return !!process.env['MOBILE_TEST']; -} - export function wait(msecs: number) { return new Promise((resolve) => { setTimeout(resolve, msecs);