@angular-devkit/core 13.0.0-next.4 → 13.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/cli-logger.js +1 -1
- package/node/experimental/jobs/job-registry.js +3 -3
- package/node/fs.js +2 -2
- package/node/host.js +41 -41
- package/node/testing/index.js +4 -4
- package/package.json +2 -2
- package/src/experimental/jobs/create-job-handler.js +7 -7
- package/src/experimental/jobs/dispatcher.js +1 -1
- package/src/experimental/jobs/fallback-registry.js +1 -1
- package/src/experimental/jobs/simple-registry.js +3 -3
- package/src/experimental/jobs/simple-scheduler.js +32 -32
- package/src/experimental/jobs/strategy.js +7 -7
- package/src/json/schema/registry.js +13 -13
- package/src/json/schema/schema.js +1 -1
- package/src/json/schema/transforms.js +10 -10
- package/src/json/schema/utility.js +2 -2
- package/src/json/schema/visitor.js +14 -14
- package/src/logger/indent.js +1 -1
- package/src/logger/logger.js +1 -1
- package/src/virtual-fs/host/alias.js +3 -3
- package/src/virtual-fs/host/empty.js +6 -6
- package/src/virtual-fs/host/memory.js +13 -13
- package/src/virtual-fs/host/record.js +27 -27
- package/src/virtual-fs/host/safe.js +4 -4
- package/src/virtual-fs/host/scoped.js +1 -1
- package/src/virtual-fs/host/test.js +9 -9
- package/src/workspace/core.js +5 -5
- package/src/workspace/host.js +4 -4
- package/src/workspace/json/reader.js +7 -7
- package/src/workspace/json/writer.js +1 -1
|
@@ -21,7 +21,7 @@ var test;
|
|
|
21
21
|
this._records = [];
|
|
22
22
|
this._sync = null;
|
|
23
23
|
for (const filePath of Object.getOwnPropertyNames(map)) {
|
|
24
|
-
this._write(path_1.normalize(filePath), buffer_1.stringToFileBuffer(map[filePath]));
|
|
24
|
+
this._write((0, path_1.normalize)(filePath), (0, buffer_1.stringToFileBuffer)(map[filePath]));
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
get records() {
|
|
@@ -35,7 +35,7 @@ var test;
|
|
|
35
35
|
function _visit(p) {
|
|
36
36
|
return sync
|
|
37
37
|
.list(p)
|
|
38
|
-
.map((fragment) => path_1.join(p, fragment))
|
|
38
|
+
.map((fragment) => (0, path_1.join)(p, fragment))
|
|
39
39
|
.reduce((files, path) => {
|
|
40
40
|
if (sync.isDirectory(path)) {
|
|
41
41
|
return files.concat(_visit(path));
|
|
@@ -45,7 +45,7 @@ var test;
|
|
|
45
45
|
}
|
|
46
46
|
}, []);
|
|
47
47
|
}
|
|
48
|
-
return _visit(path_1.normalize('/'));
|
|
48
|
+
return _visit((0, path_1.normalize)('/'));
|
|
49
49
|
}
|
|
50
50
|
get sync() {
|
|
51
51
|
if (!this._sync) {
|
|
@@ -100,22 +100,22 @@ var test;
|
|
|
100
100
|
return super._watch(path, options);
|
|
101
101
|
}
|
|
102
102
|
$write(path, content) {
|
|
103
|
-
return super._write(path_1.normalize(path), buffer_1.stringToFileBuffer(content));
|
|
103
|
+
return super._write((0, path_1.normalize)(path), (0, buffer_1.stringToFileBuffer)(content));
|
|
104
104
|
}
|
|
105
105
|
$read(path) {
|
|
106
|
-
return buffer_1.fileBufferToString(super._read(path_1.normalize(path)));
|
|
106
|
+
return (0, buffer_1.fileBufferToString)(super._read((0, path_1.normalize)(path)));
|
|
107
107
|
}
|
|
108
108
|
$list(path) {
|
|
109
|
-
return super._list(path_1.normalize(path));
|
|
109
|
+
return super._list((0, path_1.normalize)(path));
|
|
110
110
|
}
|
|
111
111
|
$exists(path) {
|
|
112
|
-
return super._exists(path_1.normalize(path));
|
|
112
|
+
return super._exists((0, path_1.normalize)(path));
|
|
113
113
|
}
|
|
114
114
|
$isDirectory(path) {
|
|
115
|
-
return super._isDirectory(path_1.normalize(path));
|
|
115
|
+
return super._isDirectory((0, path_1.normalize)(path));
|
|
116
116
|
}
|
|
117
117
|
$isFile(path) {
|
|
118
|
-
return super._isFile(path_1.normalize(path));
|
|
118
|
+
return super._isFile((0, path_1.normalize)(path));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
test.TestHost = TestHost;
|
package/src/workspace/core.js
CHANGED
|
@@ -57,13 +57,13 @@ const workspaceFiles = {
|
|
|
57
57
|
async function readWorkspace(path, host, format) {
|
|
58
58
|
if (await host.isDirectory(path)) {
|
|
59
59
|
// TODO: Warn if multiple found (requires diagnostics support)
|
|
60
|
-
const directory = virtual_fs_1.normalize(path);
|
|
60
|
+
const directory = (0, virtual_fs_1.normalize)(path);
|
|
61
61
|
let found = false;
|
|
62
62
|
for (const [name, nameFormat] of Object.entries(workspaceFiles)) {
|
|
63
63
|
if (format !== undefined && format !== nameFormat) {
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
|
-
const potential = virtual_fs_1.getSystemPath(virtual_fs_1.join(directory, name));
|
|
66
|
+
const potential = (0, virtual_fs_1.getSystemPath)((0, virtual_fs_1.join)(directory, name));
|
|
67
67
|
if (await host.isFile(potential)) {
|
|
68
68
|
path = potential;
|
|
69
69
|
format = nameFormat;
|
|
@@ -76,7 +76,7 @@ async function readWorkspace(path, host, format) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
else if (format === undefined) {
|
|
79
|
-
const filename = virtual_fs_1.basename(virtual_fs_1.normalize(path));
|
|
79
|
+
const filename = (0, virtual_fs_1.basename)((0, virtual_fs_1.normalize)(path));
|
|
80
80
|
if (filename in workspaceFiles) {
|
|
81
81
|
format = workspaceFiles[filename];
|
|
82
82
|
}
|
|
@@ -87,7 +87,7 @@ async function readWorkspace(path, host, format) {
|
|
|
87
87
|
let workspace;
|
|
88
88
|
switch (format) {
|
|
89
89
|
case WorkspaceFormat.JSON:
|
|
90
|
-
workspace = await reader_1.readJsonWorkspace(path, host);
|
|
90
|
+
workspace = await (0, reader_1.readJsonWorkspace)(path, host);
|
|
91
91
|
break;
|
|
92
92
|
default:
|
|
93
93
|
throw new Error('Unsupported workspace format.');
|
|
@@ -123,7 +123,7 @@ async function writeWorkspace(workspace, host, path, format) {
|
|
|
123
123
|
}
|
|
124
124
|
switch (format) {
|
|
125
125
|
case WorkspaceFormat.JSON:
|
|
126
|
-
return writer_1.writeJsonWorkspace(workspace, host, path);
|
|
126
|
+
return (0, writer_1.writeJsonWorkspace)(workspace, host, path);
|
|
127
127
|
default:
|
|
128
128
|
throw new Error('Unsupported workspace format.');
|
|
129
129
|
}
|
package/src/workspace/host.js
CHANGED
|
@@ -12,15 +12,15 @@ const virtual_fs_1 = require("../virtual-fs");
|
|
|
12
12
|
function createWorkspaceHost(host) {
|
|
13
13
|
const workspaceHost = {
|
|
14
14
|
async readFile(path) {
|
|
15
|
-
const data = await host.read(virtual_fs_1.normalize(path)).toPromise();
|
|
15
|
+
const data = await host.read((0, virtual_fs_1.normalize)(path)).toPromise();
|
|
16
16
|
return virtual_fs_1.virtualFs.fileBufferToString(data);
|
|
17
17
|
},
|
|
18
18
|
async writeFile(path, data) {
|
|
19
|
-
return host.write(virtual_fs_1.normalize(path), virtual_fs_1.virtualFs.stringToFileBuffer(data)).toPromise();
|
|
19
|
+
return host.write((0, virtual_fs_1.normalize)(path), virtual_fs_1.virtualFs.stringToFileBuffer(data)).toPromise();
|
|
20
20
|
},
|
|
21
21
|
async isDirectory(path) {
|
|
22
22
|
try {
|
|
23
|
-
return await host.isDirectory(virtual_fs_1.normalize(path)).toPromise();
|
|
23
|
+
return await host.isDirectory((0, virtual_fs_1.normalize)(path)).toPromise();
|
|
24
24
|
}
|
|
25
25
|
catch {
|
|
26
26
|
// some hosts throw if path does not exist
|
|
@@ -29,7 +29,7 @@ function createWorkspaceHost(host) {
|
|
|
29
29
|
},
|
|
30
30
|
async isFile(path) {
|
|
31
31
|
try {
|
|
32
|
-
return await host.isFile(virtual_fs_1.normalize(path)).toPromise();
|
|
32
|
+
return await host.isFile((0, virtual_fs_1.normalize)(path)).toPromise();
|
|
33
33
|
}
|
|
34
34
|
catch {
|
|
35
35
|
// some hosts throw if path does not exist
|
|
@@ -17,7 +17,7 @@ async function readJsonWorkspace(path, host) {
|
|
|
17
17
|
if (raw === undefined) {
|
|
18
18
|
throw new Error('Unable to read workspace file.');
|
|
19
19
|
}
|
|
20
|
-
const ast = parser_1.parseJsonAst(raw, parser_1.JsonParseMode.Loose);
|
|
20
|
+
const ast = (0, parser_1.parseJsonAst)(raw, parser_1.JsonParseMode.Loose);
|
|
21
21
|
if (ast.kind !== 'object') {
|
|
22
22
|
throw new Error('Invalid workspace file - expected JSON object.');
|
|
23
23
|
}
|
|
@@ -82,7 +82,7 @@ function parseWorkspace(workspaceNode, context) {
|
|
|
82
82
|
if (context.trackChanges && projectsNode) {
|
|
83
83
|
const parentNode = projectsNode;
|
|
84
84
|
collectionListener = (name, action, newValue) => {
|
|
85
|
-
jsonMetadata.addChange(action, `/projects/${utilities_1.escapeKey(name)}`, parentNode, newValue, 'project');
|
|
85
|
+
jsonMetadata.addChange(action, `/projects/${(0, utilities_1.escapeKey)(name)}`, parentNode, newValue, 'project');
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
const projectCollection = new definitions_1.ProjectDefinitionCollection(projects, collectionListener);
|
|
@@ -92,7 +92,7 @@ function parseWorkspace(workspaceNode, context) {
|
|
|
92
92
|
// If not tracking changes the `extensions` variable will contain the parsed
|
|
93
93
|
// values. Otherwise the extensions are tracked via a virtual AST object.
|
|
94
94
|
extensions: extensions ||
|
|
95
|
-
utilities_1.createVirtualAstObject(workspaceNode, {
|
|
95
|
+
(0, utilities_1.createVirtualAstObject)(workspaceNode, {
|
|
96
96
|
exclude: ['$schema', 'version', 'projects'],
|
|
97
97
|
listener(op, path, node, value) {
|
|
98
98
|
jsonMetadata.addChange(op, path, node, value);
|
|
@@ -160,7 +160,7 @@ function parseProject(projectName, projectNode, context) {
|
|
|
160
160
|
if (targetsNode) {
|
|
161
161
|
const parentNode = targetsNode;
|
|
162
162
|
collectionListener = (name, action, newValue) => {
|
|
163
|
-
jsonMetadata.addChange(action, `/projects/${projectName}/targets/${utilities_1.escapeKey(name)}`, parentNode, newValue, 'target');
|
|
163
|
+
jsonMetadata.addChange(action, `/projects/${projectName}/targets/${(0, utilities_1.escapeKey)(name)}`, parentNode, newValue, 'target');
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
else {
|
|
@@ -179,7 +179,7 @@ function parseProject(projectName, projectNode, context) {
|
|
|
179
179
|
// If not tracking changes the `extensions` variable will contain the parsed
|
|
180
180
|
// values. Otherwise the extensions are tracked via a virtual AST object.
|
|
181
181
|
extensions: extensions ||
|
|
182
|
-
utilities_1.createVirtualAstObject(projectNode, {
|
|
182
|
+
(0, utilities_1.createVirtualAstObject)(projectNode, {
|
|
183
183
|
exclude: ['architect', 'prefix', 'root', 'sourceRoot', 'targets'],
|
|
184
184
|
listener(op, path, node, value) {
|
|
185
185
|
jsonMetadata.addChange(op, `/projects/${projectName}${path}`, node, value);
|
|
@@ -188,7 +188,7 @@ function parseProject(projectName, projectNode, context) {
|
|
|
188
188
|
};
|
|
189
189
|
let project;
|
|
190
190
|
if (context.trackChanges) {
|
|
191
|
-
project = utilities_1.createVirtualAstObject(projectNode, {
|
|
191
|
+
project = (0, utilities_1.createVirtualAstObject)(projectNode, {
|
|
192
192
|
base,
|
|
193
193
|
include: ['prefix', 'root', 'sourceRoot'],
|
|
194
194
|
listener(op, path, node, value) {
|
|
@@ -214,7 +214,7 @@ function parseTargetsObject(projectName, targetsNode, context) {
|
|
|
214
214
|
}
|
|
215
215
|
const name = key.value;
|
|
216
216
|
if (context.trackChanges) {
|
|
217
|
-
targets[name] = utilities_1.createVirtualAstObject(value, {
|
|
217
|
+
targets[name] = (0, utilities_1.createVirtualAstObject)(value, {
|
|
218
218
|
include: ['builder', 'options', 'configurations', 'defaultConfiguration'],
|
|
219
219
|
listener(op, path, node, value) {
|
|
220
220
|
jsonMetadata.addChange(op, `/projects/${projectName}/targets/${name}${path}`, node, value);
|
|
@@ -163,7 +163,7 @@ function updateJsonWorkspace(metadata) {
|
|
|
163
163
|
const multiline = node.start.line !== node.end.line || type !== 'json';
|
|
164
164
|
const pathSegments = path.split('/');
|
|
165
165
|
const depth = pathSegments.length - 1; // TODO: more complete analysis
|
|
166
|
-
const propertyOrIndex = utilities_1.unescapeKey(pathSegments[depth]);
|
|
166
|
+
const propertyOrIndex = (0, utilities_1.unescapeKey)(pathSegments[depth]);
|
|
167
167
|
const jsonValue = normalizeValue(value, type);
|
|
168
168
|
if (op === 'add' && jsonValue === undefined) {
|
|
169
169
|
continue;
|