Skip to content

Commit 8919a90

Browse files
author
Angular Builds
committed
37a06a7c3 build: format all files
1 parent 07a6ce8 commit 8919a90

Some content is hidden

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

47 files changed

+510
-347
lines changed

README.md

Lines changed: 81 additions & 61 deletions
Large diffs are not rendered by default.

collection-schema.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,12 @@
5959
"description": "Whether or not this schematic can be called from an external schematic, or a tool. This implies hidden: true."
6060
}
6161
},
62-
"required": [
63-
"factory",
64-
"description"
65-
]
62+
"required": ["factory", "description"]
6663
}
6764
},
6865
"version": {
6966
"type": "string"
7067
}
7168
},
72-
"required": [
73-
"schematics"
74-
]
69+
"required": ["schematics"]
7570
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"schematics"
1919
],
2020
"dependencies": {
21-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#b9309c1d4",
21+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#37a06a7c3",
2222
"ora": "5.4.0",
2323
"rxjs": "6.6.7"
2424
},

src/engine/engine.js

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ const null_1 = require("../tree/null");
1616
const static_1 = require("../tree/static");
1717
const schematic_1 = require("./schematic");
1818
class UnknownUrlSourceProtocol extends core_1.BaseException {
19-
constructor(url) { super(`Unknown Protocol on url "${url}".`); }
19+
constructor(url) {
20+
super(`Unknown Protocol on url "${url}".`);
21+
}
2022
}
2123
exports.UnknownUrlSourceProtocol = UnknownUrlSourceProtocol;
2224
class UnknownCollectionException extends core_1.BaseException {
23-
constructor(name) { super(`Unknown collection "${name}".`); }
25+
constructor(name) {
26+
super(`Unknown collection "${name}".`);
27+
}
2428
}
2529
exports.UnknownCollectionException = UnknownCollectionException;
2630
class CircularCollectionException extends core_1.BaseException {
@@ -42,7 +46,9 @@ class PrivateSchematicException extends core_1.BaseException {
4246
}
4347
exports.PrivateSchematicException = PrivateSchematicException;
4448
class SchematicEngineConflictingException extends core_1.BaseException {
45-
constructor() { super(`A schematic was called from a different engine as its parent.`); }
49+
constructor() {
50+
super(`A schematic was called from a different engine as its parent.`);
51+
}
4652
}
4753
exports.SchematicEngineConflictingException = SchematicEngineConflictingException;
4854
class UnregisteredTaskException extends core_1.BaseException {
@@ -64,8 +70,12 @@ class CollectionImpl {
6470
this._engine = _engine;
6571
this.baseDescriptions = baseDescriptions;
6672
}
67-
get description() { return this._description; }
68-
get name() { return this.description.name || '<unknown>'; }
73+
get description() {
74+
return this._description;
75+
}
76+
get name() {
77+
return this.description.name || '<unknown>';
78+
}
6979
createSchematic(name, allowPrivate = false) {
7080
return this._engine.createSchematic(name, this, allowPrivate);
7181
}
@@ -91,7 +101,7 @@ class TaskScheduler {
91101
if (!dependencies) {
92102
return new Set();
93103
}
94-
const tasks = dependencies.map(dep => {
104+
const tasks = dependencies.map((dep) => {
95105
const task = this._taskIds.get(dep);
96106
if (!task) {
97107
throw new UnknownTaskDependencyException(dep);
@@ -131,8 +141,12 @@ class SchematicEngine {
131141
this._schematicCache = new WeakMap();
132142
this._taskSchedulers = new Array();
133143
}
134-
get workflow() { return this._workflow || null; }
135-
get defaultMergeStrategy() { return this._host.defaultMergeStrategy || interface_1.MergeStrategy.Default; }
144+
get workflow() {
145+
return this._workflow || null;
146+
}
147+
get defaultMergeStrategy() {
148+
return this._host.defaultMergeStrategy || interface_1.MergeStrategy.Default;
149+
}
136150
createCollection(name, requester) {
137151
let collection = this._collectionCache.get(name);
138152
if (collection) {
@@ -175,13 +189,12 @@ class SchematicEngine {
175189
interactive = parent.interactive;
176190
}
177191
let context = {
178-
debug: parent && parent.debug || false,
192+
debug: (parent && parent.debug) || false,
179193
engine: this,
180-
logger: (parent && parent.logger && parent.logger.createChild(schematic.description.name))
181-
|| new core_1.logging.NullLogger(),
194+
logger: (parent && parent.logger && parent.logger.createChild(schematic.description.name)) ||
195+
new core_1.logging.NullLogger(),
182196
schematic,
183-
strategy: (parent && parent.strategy !== undefined)
184-
? parent.strategy : this.defaultMergeStrategy,
197+
strategy: parent && parent.strategy !== undefined ? parent.strategy : this.defaultMergeStrategy,
185198
interactive,
186199
addTask,
187200
};
@@ -251,8 +264,10 @@ class SchematicEngine {
251264
}
252265
createSourceFromUrl(url, context) {
253266
switch (url.protocol) {
254-
case 'null:': return () => new null_1.NullTree();
255-
case 'empty:': return () => static_1.empty();
267+
case 'null:':
268+
return () => new null_1.NullTree();
269+
case 'empty:':
270+
return () => static_1.empty();
256271
default:
257272
const hostSource = this._host.createSourceFromUrl(url, context);
258273
if (!hostSource) {
@@ -263,15 +278,13 @@ class SchematicEngine {
263278
}
264279
executePostTasks() {
265280
const executors = new Map();
266-
const taskObservable = rxjs_1.from(this._taskSchedulers)
267-
.pipe(operators_1.concatMap(scheduler => scheduler.finalize()), operators_1.concatMap(task => {
281+
const taskObservable = rxjs_1.from(this._taskSchedulers).pipe(operators_1.concatMap((scheduler) => scheduler.finalize()), operators_1.concatMap((task) => {
268282
const { name, options } = task.configuration;
269283
const executor = executors.get(name);
270284
if (executor) {
271285
return executor(options, task.context);
272286
}
273-
return this._host.createTaskExecutor(name)
274-
.pipe(operators_1.concatMap(executor => {
287+
return this._host.createTaskExecutor(name).pipe(operators_1.concatMap((executor) => {
275288
executors.set(name, executor);
276289
return executor(options, task.context);
277290
}));

src/engine/schematic.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ class SchematicImpl {
2929
throw new InvalidSchematicsNameException(_description.name);
3030
}
3131
}
32-
get description() { return this._description; }
33-
get collection() { return this._collection; }
32+
get description() {
33+
return this._description;
34+
}
35+
get collection() {
36+
return this._collection;
37+
}
3438
call(options, host, parentContext, executionOptions) {
3539
const context = this._engine.createContext(this, parentContext, executionOptions);
36-
return host
37-
.pipe(operators_1.first(), operators_1.concatMap(tree => this._engine.transformOptions(this, options, context).pipe(operators_1.map(o => [tree, o]))), operators_1.concatMap(([tree, transformedOptions]) => {
40+
return host.pipe(operators_1.first(), operators_1.concatMap((tree) => this._engine
41+
.transformOptions(this, options, context)
42+
.pipe(operators_1.map((o) => [tree, o]))), operators_1.concatMap(([tree, transformedOptions]) => {
3843
let input;
3944
let scoped = false;
4045
if (executionOptions && executionOptions.scope) {
@@ -44,7 +49,7 @@ class SchematicImpl {
4449
else {
4550
input = tree;
4651
}
47-
return call_1.callRule(this._factory(transformedOptions), rxjs_1.of(input), context).pipe(operators_1.map(output => {
52+
return call_1.callRule(this._factory(transformedOptions), rxjs_1.of(input), context).pipe(operators_1.map((output) => {
4853
if (output === input) {
4954
return tree;
5055
}

src/exception/exception.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ class SchematicsException extends core_1.BaseException {
1515
exports.SchematicsException = SchematicsException;
1616
// Exceptions
1717
class FileDoesNotExistException extends core_1.BaseException {
18-
constructor(path) { super(`Path "${path}" does not exist.`); }
18+
constructor(path) {
19+
super(`Path "${path}" does not exist.`);
20+
}
1921
}
2022
exports.FileDoesNotExistException = FileDoesNotExistException;
2123
class FileAlreadyExistException extends core_1.BaseException {
22-
constructor(path) { super(`Path "${path}" already exist.`); }
24+
constructor(path) {
25+
super(`Path "${path}" already exist.`);
26+
}
2327
}
2428
exports.FileAlreadyExistException = FileAlreadyExistException;
2529
class ContentHasMutatedException extends core_1.BaseException {
@@ -29,7 +33,9 @@ class ContentHasMutatedException extends core_1.BaseException {
2933
}
3034
exports.ContentHasMutatedException = ContentHasMutatedException;
3135
class InvalidUpdateRecordException extends core_1.BaseException {
32-
constructor() { super(`Invalid record instance.`); }
36+
constructor() {
37+
super(`Invalid record instance.`);
38+
}
3339
}
3440
exports.InvalidUpdateRecordException = InvalidUpdateRecordException;
3541
class MergeConflictException extends core_1.BaseException {
@@ -45,6 +51,8 @@ class UnsuccessfulWorkflowExecution extends core_1.BaseException {
4551
}
4652
exports.UnsuccessfulWorkflowExecution = UnsuccessfulWorkflowExecution;
4753
class UnimplementedException extends core_1.BaseException {
48-
constructor() { super('This function is unimplemented.'); }
54+
constructor() {
55+
super('This function is unimplemented.');
56+
}
4957
}
5058
exports.UnimplementedException = UnimplementedException;

src/formats/format-validator.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ function formatValidator(data, dataSchema, formats) {
1515
for (const format of formats) {
1616
registry.addFormat(format);
1717
}
18-
return registry
19-
.compile(dataSchema)
20-
.pipe(operators_1.mergeMap(validator => validator(data)));
18+
return registry.compile(dataSchema).pipe(operators_1.mergeMap((validator) => validator(data)));
2119
}
2220
exports.formatValidator = formatValidator;

src/formats/html-selector.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ exports.htmlSelectorFormat = void 0;
1313
// * And an allowance for upper alpha characters
1414
// NOTE: This should eventually be broken out into two formats: full and partial (allows for prefix)
1515
const unicodeRanges = [
16-
[0xC0, 0xD6],
17-
[0xD8, 0xF6],
18-
[0xF8, 0x37D],
19-
[0x37F, 0x1FFF],
20-
[0x200C, 0x200D],
21-
[0x203F, 0x2040],
22-
[0x2070, 0x218F],
23-
[0x2C00, 0x2FEF],
24-
[0x3001, 0xD7FF],
25-
[0xF900, 0xFDCF],
26-
[0xFDF0, 0xFFFD],
27-
[0x10000, 0xEFFFF],
16+
[0xc0, 0xd6],
17+
[0xd8, 0xf6],
18+
[0xf8, 0x37d],
19+
[0x37f, 0x1fff],
20+
[0x200c, 0x200d],
21+
[0x203f, 0x2040],
22+
[0x2070, 0x218f],
23+
[0x2c00, 0x2fef],
24+
[0x3001, 0xd7ff],
25+
[0xf900, 0xfdcf],
26+
[0xfdf0, 0xfffd],
27+
[0x10000, 0xeffff],
2828
];
2929
function isValidElementName(name) {
3030
let regex = '^[a-zA-Z][';

src/formats/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@ Object.defineProperty(exports, "htmlSelectorFormat", { enumerable: true, get: fu
77
const path_1 = require("./path");
88
var path_2 = require("./path");
99
Object.defineProperty(exports, "pathFormat", { enumerable: true, get: function () { return path_2.pathFormat; } });
10-
exports.standardFormats = [
11-
html_selector_1.htmlSelectorFormat,
12-
path_1.pathFormat,
13-
];
10+
exports.standardFormats = [html_selector_1.htmlSelectorFormat, path_1.pathFormat];

src/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ exports.formats = formats;
4545
const workflow = require("./workflow/index");
4646
exports.workflow = workflow;
4747
exports.Tree = {
48-
empty() { return static_1.empty(); },
49-
branch(tree) { return static_1.branch(tree); },
48+
empty() {
49+
return static_1.empty();
50+
},
51+
branch(tree) {
52+
return static_1.branch(tree);
53+
},
5054
merge(tree, other, strategy = interface_1.MergeStrategy.Default) {
5155
return static_1.merge(tree, other, strategy);
5256
},
5357
partition(tree, predicate) {
5458
return static_1.partition(tree, predicate);
5559
},
56-
optimize(tree) { return tree; },
60+
optimize(tree) {
61+
return tree;
62+
},
5763
};

0 commit comments

Comments
 (0)