Skip to content

Commit 5b716ff

Browse files
filipesilvaMRHarrison
authored andcommitted
refactor(mobile): remove unused mobile code (angular#4143)
The mobile flag hasn't worked for a while. When/if it is added again, it's code would need to be done from scratch since the CLI has undergone a lot of changes since it last worked and was tested. Fix angular#4141
1 parent b103e50 commit 5b716ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+10
-325
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ before_install:
5353
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi
5454
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CHROME_BIN=chromium-browser; fi
5555
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo "--no-sandbox" > ~/.config/chromium-flags.conf; fi
56-
- if [[ "$TARGET" == "mobile" ]]; then export MOBILE_TEST=true; fi
5756
- npm install -g npm
5857
- npm config set spin false
5958
- npm config set progress false

README.md

-7

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"test": "npm-run-all -c test:packages test:cli test:deps",
1616
"e2e": "npm run test:e2e",
1717
"e2e:nightly": "node tests/run_e2e.js --nightly",
18-
"mobile_test": "mocha tests/e2e/e2e_workflow.spec.js",
1918
"test:e2e": "node tests/run_e2e.js",
2019
"test:cli": "node tests/runner",
2120
"test:deps": "node scripts/publish/validate_dependencies.js",
@@ -82,7 +81,6 @@
8281
"node-modules-path": "^1.0.0",
8382
"node-sass": "^4.1.1",
8483
"nopt": "^3.0.1",
85-
"offline-plugin": "^3.4.1",
8684
"opn": "4.0.1",
8785
"ora": "^0.2.0",
8886
"portfinder": "1.0.9",

packages/@ngtools/json-schema/tests/serializer/schema3.json

-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@
6565
"prefix": {
6666
"type": "string"
6767
},
68-
"mobile": {
69-
"type": "boolean"
70-
},
7168
"styles": {
7269
"description": "Global styles to be included in the build.",
7370
"type": "array",

packages/@ngtools/json-schema/tests/serializer/value3.json

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"test": "test.ts",
1717
"tsconfig": "tsconfig.json",
1818
"prefix": "<%= prefix %>",
19-
"mobile": true,
2019
"styles": [
2120
"styles.<%= styleExt %>"
2221
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

packages/angular-cli/blueprints/mobile/files/__path__/icons/safari-pinned-tab.svg

-23
This file was deleted.

packages/angular-cli/blueprints/mobile/files/__path__/main-app-shell.ts

-47
This file was deleted.

packages/angular-cli/blueprints/mobile/files/__path__/manifest.webapp

-41
This file was deleted.

packages/angular-cli/blueprints/mobile/index.js

-32
This file was deleted.

packages/angular-cli/blueprints/ng2/files/__path__/app/app.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Component } from '@angular/core';<% if (isMobile) { %>
2-
import { APP_SHELL_DIRECTIVES } from '@angular/app-shell';<% } %>
1+
import { Component } from '@angular/core';
32

43
@Component({
54
selector: '<%= prefix %>-root',<% if (inlineTemplate) { %>

packages/angular-cli/blueprints/ng2/files/__path__/index.html

+1-16
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@
66
<base href="/">
77

88
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<link rel="icon" type="image/x-icon" href="favicon.ico"><% if (isMobile) { %>
10-
<meta name="apple-mobile-web-app-capable" content="yes">
11-
<meta name="theme-color" content="#000000">
12-
<link rel="manifest" href="/manifest.webapp">
13-
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
14-
<link rel="apple-touch-icon" sizes="57x57" href="/icons/apple-touch-icon-57x57.png">
15-
<link rel="apple-touch-icon" sizes="60x60" href="/icons/apple-touch-icon-60x60.png">
16-
<link rel="apple-touch-icon" sizes="72x72" href="/icons/apple-touch-icon-72x72.png">
17-
<link rel="apple-touch-icon" sizes="76x76" href="/icons/apple-touch-icon-76x76.png">
18-
<link rel="apple-touch-icon" sizes="114x114" href="/icons/apple-touch-icon-114x114.png">
19-
<link rel="apple-touch-icon" sizes="120x120" href="/icons/apple-touch-icon-120x120.png">
20-
<link rel="apple-touch-icon" sizes="144x144" href="/icons/apple-touch-icon-144x144.png">
21-
<link rel="apple-touch-icon" sizes="152x152" href="/icons/apple-touch-icon-152x152.png">
22-
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon-180x180.png">
23-
<link rel="apple-touch-startup-image" href="/icons/apple-touch-icon-180x180.png">
24-
<% } %>
9+
<link rel="icon" type="image/x-icon" href="favicon.ico">
2510
</head>
2611
<body>
2712
<<%= prefix %>-root>Loading...</<%= prefix %>-root>

packages/angular-cli/blueprints/ng2/files/angular-cli.json

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"test": "test.ts",
1717
"tsconfig": "tsconfig.json",
1818
"prefix": "<%= prefix %>",
19-
"mobile": <%= isMobile %>,
2019
"styles": [
2120
"styles.<%= styleExt %>"
2221
],

packages/angular-cli/blueprints/ng2/index.js

-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module.exports = {
1010
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
1111
{ name: 'prefix', type: String, default: 'app', aliases: ['p'] },
1212
{ name: 'style', type: String, default: 'css' },
13-
{ name: 'mobile', type: Boolean, default: false },
1413
{ name: 'routing', type: Boolean, default: false },
1514
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
1615
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] },
@@ -23,12 +22,6 @@ module.exports = {
2322
}
2423
},
2524

26-
afterInstall: function (options) {
27-
if (options.mobile) {
28-
return Blueprint.load(path.join(__dirname, '../mobile')).install(options);
29-
}
30-
},
31-
3225
locals: function(options) {
3326
this.styleExt = options.style;
3427
this.version = require(path.resolve(__dirname, '../../package.json')).version;
@@ -41,12 +34,6 @@ module.exports = {
4134
.replace(/-(.)/g, (_, l) => ' ' + l.toUpperCase())
4235
.replace(/^./, (l) => l.toUpperCase());
4336

44-
// For mobile projects, force inline styles and templates.
45-
if (options.mobile) {
46-
options.inlineStyle = true;
47-
options.inlineTemplate = true;
48-
}
49-
5037
return {
5138
htmlComponentName: stringUtils.dasherize(options.entity.name),
5239
jsComponentName: stringUtils.classify(options.entity.name),
@@ -56,7 +43,6 @@ module.exports = {
5643
prefix: options.prefix,
5744
styleExt: this.styleExt,
5845
relativeRootPath: relativeRootPath,
59-
isMobile: options.mobile,
6046
routing: options.routing,
6147
inlineStyle: options.inlineStyle,
6248
inlineTemplate: options.inlineTemplate,

packages/angular-cli/commands/generate.ts

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const GenerateCommand = EmberGenerateCommand.extend({
3535
const blueprints = blueprintList
3636
.filter(bp => bp.indexOf('-test') === -1)
3737
.filter(bp => bp !== 'ng2')
38-
.filter(bp => bp !== 'mobile')
3938
.map(bp => Blueprint.load(path.join(__dirname, '..', 'blueprints', bp)));
4039

4140
let output = '';

packages/angular-cli/commands/init.run.ts

-8
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export default function initRun(commandOptions: any, rawArgs: string[]) {
6565
sourceDir: commandOptions.sourceDir,
6666
style: commandOptions.style,
6767
prefix: commandOptions.prefix,
68-
mobile: commandOptions.mobile,
6968
routing: commandOptions.routing,
7069
inlineStyle: commandOptions.inlineStyle,
7170
inlineTemplate: commandOptions.inlineTemplate,
@@ -79,13 +78,6 @@ export default function initRun(commandOptions: any, rawArgs: string[]) {
7978
new SilentError('We currently do not support a name of `' + packageName + '`.'));
8079
}
8180

82-
if (commandOptions.mobile) {
83-
return Promise.reject(new SilentError(
84-
'The --mobile flag has been disabled temporarily while we await an update of ' +
85-
'angular-universal for supporting NgModule. Sorry for the inconvenience.'
86-
));
87-
}
88-
8981
blueprintOpts.blueprint = normalizeBlueprint(blueprintOpts.blueprint);
9082

9183
return installBlueprint.run(blueprintOpts)

packages/angular-cli/commands/init.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const InitCommand: any = Command.extend({
1818
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
1919
{ name: 'style', type: String, default: 'css' },
2020
{ name: 'prefix', type: String, default: 'app', aliases: ['p'] },
21-
{ name: 'mobile', type: Boolean, default: false },
2221
{ name: 'routing', type: Boolean, default: false },
2322
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
2423
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }

packages/angular-cli/commands/new.ts

-8
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const NewCommand = Command.extend({
4040
{ name: 'source-dir', type: String, default: 'src', aliases: ['sd'] },
4141
{ name: 'style', type: String, default: 'css' },
4242
{ name: 'prefix', type: String, default: 'app', aliases: ['p'] },
43-
{ name: 'mobile', type: Boolean, default: false },
4443
{ name: 'routing', type: Boolean, default: false },
4544
{ name: 'inline-style', type: Boolean, default: false, aliases: ['is'] },
4645
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }
@@ -84,13 +83,6 @@ const NewCommand = Command.extend({
8483
new SilentError(`We currently do not support a name of "${packageName}".`));
8584
}
8685

87-
if (commandOptions.mobile) {
88-
return Promise.reject(new SilentError(
89-
'The --mobile flag has been disabled temporarily while we await an update of ' +
90-
'angular-universal for supporting NgModule. Sorry for the inconvenience.'
91-
));
92-
}
93-
9486
if (!commandOptions.directory) {
9587
commandOptions.directory = packageName;
9688
}

packages/angular-cli/lib/config/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"type": "string"
6767
},
6868
"mobile": {
69-
"type": "boolean"
69+
"type": "boolean",
70+
"default": false
7071
},
7172
"styles": {
7273
"description": "Global styles to be included in the build.",

packages/angular-cli/models/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './webpack-build-common';
22
export * from './webpack-build-production';
33
export * from './webpack-build-development';
4-
export * from './webpack-build-mobile';
54
export * from './webpack-build-utils';

0 commit comments

Comments
 (0)