Skip to content

Commit 6a283c8

Browse files
committed
moving files around
1 parent 6251be6 commit 6a283c8

File tree

156 files changed

+403
-49
lines changed

Some content is hidden

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

156 files changed

+403
-49
lines changed

addon/ng2/package.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

bin/ng

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,4 @@ const packageJson = require('../package.json');
1010
const Leek = require('leek');
1111

1212
require('../lib/bootstrap-local');
13-
14-
15-
resolve('angular-cli', { basedir: process.cwd() },
16-
function (error, projectLocalCli) {
17-
var cli;
18-
if (error) {
19-
// If there is an error, resolve could not find the ng-cli
20-
// library from a package.json. Instead, include it from a relative
21-
// path to this script file (which is likely a globally installed
22-
// npm package). Most common cause for hitting this is `ng new`
23-
cli = require('../lib/cli');
24-
} else {
25-
// No error implies a projectLocalCli, which will load whatever
26-
// version of ng-cli you have installed in a local package.json
27-
cli = require(projectLocalCli);
28-
}
29-
30-
if ('default' in cli) {
31-
cli = cli['default'];
32-
}
33-
34-
cli({
35-
cliArgs: process.argv.slice(2),
36-
inputStream: process.stdin,
37-
outputStream: process.stdout,
38-
Leek: CustomLeek
39-
}).then(function (result) {
40-
var exitCode = typeof result === 'object' ? result.exitCode : result;
41-
exit(exitCode);
42-
});
43-
44-
function CustomLeek(options) {
45-
options.trackingCode = packageJson.trackingCode;
46-
options.globalName = packageJson.name;
47-
options.name = packageJson.name;
48-
options.version = packageJson.version;
49-
return new Leek(options);
50-
}
51-
});
13+
require('../packages/angular-cli/bin/ng');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-cli",
3-
"version": "1.0.0-beta.11-webpack.8",
3+
"version": "0.0.0",
44
"description": "CLI tool for Angular",
55
"main": "lib/cli/index.js",
66
"trackingCode": "UA-8594346-19",
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/angular-cli/bin/ng

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
// Provide a title to the process in `ps`
5+
process.title = 'angular-cli';
6+
7+
const resolve = require('resolve');
8+
const exit = require('exit');
9+
const packageJson = require('../package.json');
10+
const Leek = require('leek');
11+
12+
13+
resolve('angular-cli', { basedir: process.cwd() },
14+
function (error, projectLocalCli) {
15+
var cli;
16+
if (error) {
17+
// If there is an error, resolve could not find the ng-cli
18+
// library from a package.json. Instead, include it from a relative
19+
// path to this script file (which is likely a globally installed
20+
// npm package). Most common cause for hitting this is `ng new`
21+
cli = require('../lib/cli');
22+
} else {
23+
// No error implies a projectLocalCli, which will load whatever
24+
// version of ng-cli you have installed in a local package.json
25+
cli = require(projectLocalCli);
26+
}
27+
28+
if ('default' in cli) {
29+
cli = cli['default'];
30+
}
31+
32+
cli({
33+
cliArgs: process.argv.slice(2),
34+
inputStream: process.stdin,
35+
outputStream: process.stdout,
36+
Leek: CustomLeek
37+
}).then(function (result) {
38+
var exitCode = typeof result === 'object' ? result.exitCode : result;
39+
exit(exitCode);
40+
});
41+
42+
function CustomLeek(options) {
43+
options.trackingCode = packageJson.trackingCode;
44+
options.globalName = packageJson.name;
45+
options.name = packageJson.name;
46+
options.version = packageJson.version;
47+
return new Leek(options);
48+
}
49+
});

packages/angular-cli/lib/cli/index.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*eslint-disable no-console */
2+
3+
// This file hooks up on require calls to transpile TypeScript.
4+
const cli = require('ember-cli/lib/cli');
5+
const path = require('path');
6+
7+
8+
module.exports = function(options) {
9+
const oldStdoutWrite = process.stdout.write;
10+
process.stdout.write = function (line) {
11+
line = line.toString();
12+
if (line.match(/version:|WARNING:/)) {
13+
return;
14+
}
15+
if (line.match(/ember-cli-(inject-)?live-reload/)) {
16+
// don't replace 'ember-cli-live-reload' on ng init diffs
17+
return oldStdoutWrite.apply(process.stdout, arguments);
18+
}
19+
line = line.replace(/ember-cli(?!.com)/g, 'angular-cli')
20+
.replace(/\bember\b(?!-cli.com)/g, 'ng');
21+
return oldStdoutWrite.apply(process.stdout, arguments);
22+
};
23+
24+
const oldStderrWrite = process.stderr.write;
25+
process.stderr.write = function (line) {
26+
line = line.toString()
27+
.replace(/ember-cli(?!.com)/g, 'angular-cli')
28+
.replace(/\bember\b(?!-cli.com)/g, 'ng');
29+
return oldStderrWrite.apply(process.stdout, arguments);
30+
};
31+
32+
options.cli = {
33+
name: 'ng',
34+
root: path.join(__dirname, '..', '..'),
35+
npmPackage: 'angular-cli'
36+
};
37+
38+
// ensure the environemnt variable for dynamic paths
39+
process.env.PWD = process.env.PWD || process.cwd();
40+
41+
42+
process.env.CLI_ROOT = process.env.CLI_ROOT || path.resolve(__dirname, '..', '..');
43+
44+
return cli(options);
45+
};
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
export interface CliConfig {
2+
/**
3+
* The global configuration of the project.
4+
*/
5+
project?: {
6+
version?: string;
7+
name?: string;
8+
};
9+
/**
10+
* Properties of the different applications in this project.
11+
*/
12+
apps?: {
13+
root?: string;
14+
outDir?: string;
15+
assets?: string;
16+
index?: string;
17+
main?: string;
18+
test?: string;
19+
tsconfig?: string;
20+
prefix?: string;
21+
mobile?: boolean;
22+
/**
23+
* Global styles to be included in the build.
24+
*/
25+
styles?: string[];
26+
/**
27+
* Global scripts to be included in the build.
28+
*/
29+
scripts?: string[];
30+
/**
31+
* Name and corresponding file for environment config.
32+
*/
33+
environments?: {
34+
[name: string]: any;
35+
};
36+
}[];
37+
/**
38+
* Configuration reserved for installed third party addons.
39+
*/
40+
addons?: {
41+
[name: string]: any;
42+
}[];
43+
/**
44+
* Configuration reserved for installed third party packages.
45+
*/
46+
packages?: {
47+
[name: string]: any;
48+
}[];
49+
e2e?: {
50+
protractor?: {
51+
config?: string;
52+
};
53+
};
54+
test?: {
55+
karma?: {
56+
config?: string;
57+
};
58+
};
59+
defaults?: {
60+
styleExt?: string;
61+
prefixInterfaces?: boolean;
62+
};
63+
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"$comment": "Please run `npm run build-config-interface` after changing this file. Thanks!",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"id": "CliConfig",
5+
"title": "Angular CLI Config Schema",
6+
"type": "object",
7+
"properties": {
8+
"project": {
9+
"description": "The global configuration of the project.",
10+
"type": "object",
11+
"properties": {
12+
"version": {
13+
"type": "string"
14+
},
15+
"name": {
16+
"type": "string"
17+
}
18+
},
19+
"additionalProperties": false
20+
},
21+
"apps": {
22+
"description": "Properties of the different applications in this project.",
23+
"type": "array",
24+
"items": {
25+
"type": "object",
26+
"properties": {
27+
"root": {
28+
"type": "string"
29+
},
30+
"outDir": {
31+
"type": "string",
32+
"default": "dist/"
33+
},
34+
"assets": {
35+
"type": "string"
36+
},
37+
"index": {
38+
"type": "string",
39+
"default": "index.html"
40+
},
41+
"main": {
42+
"type": "string"
43+
},
44+
"test": {
45+
"type": "string"
46+
},
47+
"tsconfig": {
48+
"type": "string"
49+
},
50+
"prefix": {
51+
"type": "string"
52+
},
53+
"mobile": {
54+
"type": "boolean"
55+
},
56+
"styles": {
57+
"description": "Global styles to be included in the build.",
58+
"type": "array",
59+
"items": {
60+
"type": "string"
61+
},
62+
"additionalProperties": false
63+
},
64+
"scripts": {
65+
"description": "Global scripts to be included in the build.",
66+
"type": "array",
67+
"items": {
68+
"type": "string"
69+
},
70+
"additionalProperties": false
71+
},
72+
"environments": {
73+
"description": "Name and corresponding file for environment config.",
74+
"type": "object",
75+
"additionalProperties": true
76+
}
77+
},
78+
"additionalProperties": false
79+
},
80+
"additionalProperties": false
81+
},
82+
"addons": {
83+
"description": "Configuration reserved for installed third party addons.",
84+
"type": "array",
85+
"items": {
86+
"type": "object",
87+
"properties": {},
88+
"additionalProperties": true
89+
}
90+
},
91+
"packages": {
92+
"description": "Configuration reserved for installed third party packages.",
93+
"type": "array",
94+
"items": {
95+
"type": "object",
96+
"properties": {},
97+
"additionalProperties": true
98+
}
99+
},
100+
"e2e": {
101+
"type": "object",
102+
"properties": {
103+
"protractor": {
104+
"type": "object",
105+
"properties": {
106+
"config": {
107+
"type": "string"
108+
}
109+
},
110+
"additionalProperties": false
111+
}
112+
},
113+
"additionalProperties": false
114+
},
115+
"test": {
116+
"type": "object",
117+
"properties": {
118+
"karma": {
119+
"type": "object",
120+
"properties": {
121+
"config": {
122+
"type": "string"
123+
}
124+
},
125+
"additionalProperties": false
126+
}
127+
},
128+
"additionalProperties": false
129+
},
130+
"defaults": {
131+
"type": "object",
132+
"properties": {
133+
"styleExt": {
134+
"type": "string"
135+
},
136+
"prefixInterfaces": {
137+
"type": "boolean"
138+
}
139+
},
140+
"additionalProperties": false
141+
}
142+
},
143+
"additionalProperties": false
144+
}

0 commit comments

Comments
 (0)