@angular-devkit/schematics 12.0.0-rc.0 → 12.0.0

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.
Files changed (138) hide show
  1. package/README.md +81 -61
  2. package/collection-schema.json +2 -7
  3. package/package.json +3 -3
  4. package/src/_golden-api.d.ts +1 -1
  5. package/src/_golden-api.js +1 -1
  6. package/src/engine/engine.d.ts +2 -2
  7. package/src/engine/engine.js +35 -22
  8. package/src/engine/index.d.ts +1 -1
  9. package/src/engine/index.js +7 -7
  10. package/src/engine/interface.d.ts +2 -2
  11. package/src/engine/interface.js +7 -0
  12. package/src/engine/schematic.d.ts +1 -1
  13. package/src/engine/schematic.js +13 -8
  14. package/src/exception/exception.d.ts +1 -1
  15. package/src/exception/exception.js +15 -7
  16. package/src/formats/format-validator.d.ts +1 -1
  17. package/src/formats/format-validator.js +4 -6
  18. package/src/formats/html-selector.d.ts +1 -1
  19. package/src/formats/html-selector.js +19 -12
  20. package/src/formats/index.d.ts +1 -1
  21. package/src/formats/index.js +3 -6
  22. package/src/formats/path.d.ts +1 -1
  23. package/src/formats/path.js +1 -1
  24. package/src/index.d.ts +3 -3
  25. package/src/index.js +20 -14
  26. package/src/rules/base.d.ts +7 -0
  27. package/src/rules/base.js +10 -10
  28. package/src/rules/call.d.ts +1 -1
  29. package/src/rules/call.js +7 -7
  30. package/src/rules/move.d.ts +7 -0
  31. package/src/rules/move.js +5 -5
  32. package/src/rules/random.d.ts +1 -1
  33. package/src/rules/random.js +17 -5
  34. package/src/rules/rename.d.ts +7 -0
  35. package/src/rules/rename.js +4 -4
  36. package/src/rules/schematic.d.ts +7 -0
  37. package/src/rules/schematic.js +5 -5
  38. package/src/rules/template.d.ts +1 -1
  39. package/src/rules/template.js +15 -9
  40. package/src/rules/url.d.ts +7 -0
  41. package/src/rules/url.js +3 -3
  42. package/src/sink/dryrun.d.ts +2 -2
  43. package/src/sink/dryrun.js +8 -8
  44. package/src/sink/host.d.ts +2 -2
  45. package/src/sink/host.js +8 -1
  46. package/src/sink/sink.d.ts +2 -2
  47. package/src/sink/sink.js +41 -29
  48. package/src/tree/action.d.ts +2 -2
  49. package/src/tree/action.js +24 -13
  50. package/src/tree/delegate.d.ts +2 -2
  51. package/src/tree/delegate.js +46 -13
  52. package/src/tree/empty.d.ts +1 -1
  53. package/src/tree/empty.js +6 -4
  54. package/src/tree/entry.d.ts +2 -2
  55. package/src/tree/entry.js +19 -4
  56. package/src/tree/host-tree.d.ts +2 -2
  57. package/src/tree/host-tree.js +18 -20
  58. package/src/tree/interface.d.ts +2 -2
  59. package/src/tree/interface.js +12 -3
  60. package/src/tree/null.d.ts +2 -2
  61. package/src/tree/null.js +22 -12
  62. package/src/tree/recorder.d.ts +7 -0
  63. package/src/tree/recorder.js +9 -7
  64. package/src/tree/scoped.d.ts +2 -2
  65. package/src/tree/scoped.js +31 -14
  66. package/src/tree/static.d.ts +7 -0
  67. package/src/tree/static.js +3 -3
  68. package/src/utility/linked-list.d.ts +1 -1
  69. package/src/utility/linked-list.js +4 -2
  70. package/src/utility/update-buffer.d.ts +2 -2
  71. package/src/utility/update-buffer.js +11 -11
  72. package/src/workflow/base.d.ts +1 -1
  73. package/src/workflow/base.js +16 -12
  74. package/src/workflow/index.d.ts +1 -1
  75. package/src/workflow/index.js +7 -7
  76. package/src/workflow/interface.d.ts +1 -1
  77. package/src/workflow/interface.js +7 -0
  78. package/tasks/index.d.ts +1 -1
  79. package/tasks/index.js +3 -3
  80. package/tasks/node/index.d.ts +1 -1
  81. package/tasks/node/index.js +11 -4
  82. package/tasks/package-manager/executor.d.ts +1 -1
  83. package/tasks/package-manager/executor.js +9 -7
  84. package/tasks/package-manager/install-task.d.ts +1 -1
  85. package/tasks/package-manager/install-task.js +7 -0
  86. package/tasks/package-manager/link-task.d.ts +1 -1
  87. package/tasks/package-manager/link-task.js +7 -0
  88. package/tasks/package-manager/options.d.ts +2 -1
  89. package/tasks/package-manager/options.js +3 -3
  90. package/tasks/repo-init/executor.d.ts +7 -0
  91. package/tasks/repo-init/executor.js +6 -11
  92. package/tasks/repo-init/init-task.d.ts +1 -1
  93. package/tasks/repo-init/init-task.js +7 -0
  94. package/tasks/repo-init/options.d.ts +1 -1
  95. package/tasks/repo-init/options.js +3 -3
  96. package/tasks/run-schematic/executor.d.ts +1 -1
  97. package/tasks/run-schematic/executor.js +7 -0
  98. package/tasks/run-schematic/options.d.ts +1 -1
  99. package/tasks/run-schematic/options.js +3 -3
  100. package/tasks/run-schematic/task.d.ts +1 -1
  101. package/tasks/run-schematic/task.js +7 -0
  102. package/tasks/tslint-fix/executor.d.ts +7 -0
  103. package/tasks/tslint-fix/executor.js +23 -19
  104. package/tasks/tslint-fix/options.d.ts +1 -1
  105. package/tasks/tslint-fix/options.js +7 -0
  106. package/tasks/tslint-fix/task.d.ts +1 -1
  107. package/tasks/tslint-fix/task.js +7 -0
  108. package/tasks/tslint-fix/test/custom-rule.d.ts +1 -1
  109. package/tasks/tslint-fix/test/custom-rule.js +8 -1
  110. package/tasks/tslint-fix/test/rules/customRuleRule.js +5 -5
  111. package/tasks/tslint-fix/test/run-task.d.ts +1 -1
  112. package/tasks/tslint-fix/test/run-task.js +8 -1
  113. package/testing/index.d.ts +1 -1
  114. package/testing/index.js +7 -7
  115. package/testing/schematic-test-runner.d.ts +1 -1
  116. package/testing/schematic-test-runner.js +21 -13
  117. package/tools/description.d.ts +1 -1
  118. package/tools/description.js +7 -0
  119. package/tools/export-ref.d.ts +7 -0
  120. package/tools/export-ref.js +12 -6
  121. package/tools/fallback-engine-host.d.ts +2 -3
  122. package/tools/fallback-engine-host.js +9 -12
  123. package/tools/file-system-engine-host-base.d.ts +2 -2
  124. package/tools/file-system-engine-host-base.js +23 -16
  125. package/tools/file-system-engine-host.d.ts +7 -0
  126. package/tools/file-system-engine-host.js +4 -4
  127. package/tools/file-system-utility.d.ts +1 -1
  128. package/tools/file-system-utility.js +6 -6
  129. package/tools/index.d.ts +1 -1
  130. package/tools/index.js +7 -7
  131. package/tools/node-module-engine-host.d.ts +1 -1
  132. package/tools/node-module-engine-host.js +5 -4
  133. package/tools/node-modules-test-engine-host.d.ts +1 -1
  134. package/tools/node-modules-test-engine-host.js +13 -2
  135. package/tools/schema-option-transform.d.ts +1 -1
  136. package/tools/schema-option-transform.js +4 -6
  137. package/tools/workflow/node-workflow.d.ts +2 -1
  138. package/tools/workflow/node-workflow.js +5 -4
@@ -1,2 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
package/tasks/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
package/tasks/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TslintFixTask = exports.RunSchematicTask = exports.RepositoryInitializerTask = exports.NodePackageLinkTask = exports.NodePackageInstallTask = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.TslintFixTask = exports.RunSchematicTask = exports.RepositoryInitializerTask = exports.NodePackageLinkTask = exports.NodePackageInstallTask = void 0;
11
11
  var install_task_1 = require("./package-manager/install-task");
12
12
  Object.defineProperty(exports, "NodePackageInstallTask", { enumerable: true, get: function () { return install_task_1.NodePackageInstallTask; } });
13
13
  var link_task_1 = require("./package-manager/link-task");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.BuiltinTaskExecutor = void 0;
4
11
  const options_1 = require("../package-manager/options");
@@ -10,18 +17,18 @@ class BuiltinTaskExecutor {
10
17
  exports.BuiltinTaskExecutor = BuiltinTaskExecutor;
11
18
  BuiltinTaskExecutor.NodePackage = {
12
19
  name: options_1.NodePackageName,
13
- create: (options) => Promise.resolve().then(() => require('../package-manager/executor')).then(mod => mod.default(options)),
20
+ create: (options) => Promise.resolve().then(() => require('../package-manager/executor')).then((mod) => mod.default(options)),
14
21
  };
15
22
  BuiltinTaskExecutor.RepositoryInitializer = {
16
23
  name: options_2.RepositoryInitializerName,
17
- create: (options) => Promise.resolve().then(() => require('../repo-init/executor')).then(mod => mod.default(options)),
24
+ create: (options) => Promise.resolve().then(() => require('../repo-init/executor')).then((mod) => mod.default(options)),
18
25
  };
19
26
  BuiltinTaskExecutor.RunSchematic = {
20
27
  name: options_3.RunSchematicName,
21
- create: () => Promise.resolve().then(() => require('../run-schematic/executor')).then(mod => mod.default()),
28
+ create: () => Promise.resolve().then(() => require('../run-schematic/executor')).then((mod) => mod.default()),
22
29
  };
23
30
  /** @deprecated since version 11. Use `ng lint --fix` directly instead. */
24
31
  BuiltinTaskExecutor.TslintFix = {
25
32
  name: options_4.TslintFixName,
26
- create: () => Promise.resolve().then(() => require('../tslint-fix/executor')).then(mod => mod.default()),
33
+ create: () => Promise.resolve().then(() => require('../tslint-fix/executor')).then((mod) => mod.default()),
27
34
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownPackageManagerException = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.UnknownPackageManagerException = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const child_process_1 = require("child_process");
13
13
  const ora = require("ora");
@@ -67,7 +67,7 @@ function default_1(factoryOptions = {}) {
67
67
  }
68
68
  const bufferedOutput = [];
69
69
  const spawnOptions = {
70
- stdio: !!options.hideOutput ? 'pipe' : 'inherit',
70
+ stdio: options.hideOutput ? 'pipe' : 'inherit',
71
71
  shell: true,
72
72
  cwd: path.join(rootDirectory, options.workingDirectory || ''),
73
73
  };
@@ -87,15 +87,17 @@ function default_1(factoryOptions = {}) {
87
87
  if (factoryOptions.registry) {
88
88
  args.push(`--registry="${factoryOptions.registry}"`);
89
89
  }
90
- return new rxjs_1.Observable(obs => {
90
+ if (factoryOptions.force) {
91
+ args.push('--force');
92
+ }
93
+ return new rxjs_1.Observable((obs) => {
91
94
  var _a, _b;
92
95
  const spinner = ora({
93
96
  text: `Installing packages (${taskPackageManagerName})...`,
94
97
  // Workaround for https://github.com/sindresorhus/ora/issues/136.
95
98
  discardStdin: process.platform != 'win32',
96
99
  }).start();
97
- const childProcess = child_process_1.spawn(taskPackageManagerName, args, spawnOptions)
98
- .on('close', (code) => {
100
+ const childProcess = child_process_1.spawn(taskPackageManagerName, args, spawnOptions).on('close', (code) => {
99
101
  if (code === 0) {
100
102
  spinner.succeed('Packages installed successfully.');
101
103
  spinner.stop();
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.NodePackageInstallTask = void 0;
4
11
  const options_1 = require("./options");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.NodePackageLinkTask = void 0;
4
11
  const options_1 = require("./options");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -11,6 +11,7 @@ export interface NodePackageTaskFactoryOptions {
11
11
  packageManager?: string;
12
12
  allowPackageManagerOverride?: boolean;
13
13
  registry?: string;
14
+ force?: boolean;
14
15
  }
15
16
  export interface NodePackageTaskOptions {
16
17
  command: string;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodePackageName = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.NodePackageName = void 0;
11
11
  exports.NodePackageName = 'node-package';
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
1
8
  import { TaskExecutor } from '../../src';
2
9
  import { RepositoryInitializerTaskFactoryOptions, RepositoryInitializerTaskOptions } from './options';
3
10
  export default function (factoryOptions?: RepositoryInitializerTaskFactoryOptions): TaskExecutor<RepositoryInitializerTaskOptions>;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
3
  * @license
5
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
6
5
  *
7
6
  * Use of this source code is governed by an MIT-style license that can be
8
7
  * found in the LICENSE file at https://angular.io/license
9
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const core_1 = require("@angular-devkit/core");
11
11
  const child_process_1 = require("child_process");
12
12
  const path = require("path");
@@ -24,17 +24,14 @@ function default_1(factoryOptions = {}) {
24
24
  cwd: path.join(rootDirectory, options.workingDirectory || ''),
25
25
  env: {
26
26
  ...process.env,
27
- ...(authorName
28
- ? { GIT_AUTHOR_NAME: authorName, GIT_COMMITTER_NAME: authorName }
29
- : {}),
27
+ ...(authorName ? { GIT_AUTHOR_NAME: authorName, GIT_COMMITTER_NAME: authorName } : {}),
30
28
  ...(authorEmail
31
29
  ? { GIT_AUTHOR_EMAIL: authorEmail, GIT_COMMITTER_EMAIL: authorEmail }
32
30
  : {}),
33
31
  },
34
32
  };
35
33
  return new Promise((resolve, reject) => {
36
- child_process_1.spawn('git', args, spawnOptions)
37
- .on('close', (code) => {
34
+ child_process_1.spawn('git', args, spawnOptions).on('close', (code) => {
38
35
  if (code === 0) {
39
36
  resolve();
40
37
  }
@@ -44,13 +41,11 @@ function default_1(factoryOptions = {}) {
44
41
  });
45
42
  });
46
43
  };
47
- const hasCommand = await execute(['--version'])
48
- .then(() => true, () => false);
44
+ const hasCommand = await execute(['--version']).then(() => true, () => false);
49
45
  if (!hasCommand) {
50
46
  return;
51
47
  }
52
- const insideRepo = await execute(['rev-parse', '--is-inside-work-tree'], true)
53
- .then(() => true, () => false);
48
+ const insideRepo = await execute(['rev-parse', '--is-inside-work-tree'], true).then(() => true, () => false);
54
49
  if (insideRepo) {
55
50
  context.logger.info(core_1.tags.oneLine `
56
51
  Directory is already under version control.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.RepositoryInitializerTask = void 0;
4
11
  const options_1 = require("./options");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RepositoryInitializerName = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.RepositoryInitializerName = void 0;
11
11
  exports.RepositoryInitializerName = 'repo-init';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  function default_1() {
4
11
  return (options, context) => {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RunSchematicName = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.RunSchematicName = void 0;
11
11
  exports.RunSchematicName = 'run-schematic';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.RunSchematicTask = void 0;
4
11
  const options_1 = require("./options");
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
1
8
  import { TaskExecutor } from '../../src';
2
9
  import { TslintFixTaskOptions } from './options';
3
10
  /** @deprecated since version 11. Use `ng lint --fix` directly instead. */
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
3
  * @license
5
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
6
5
  *
7
6
  * Use of this source code is governed by an MIT-style license that can be
8
7
  * found in the LICENSE file at https://angular.io/license
9
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const fs = require("fs");
11
11
  const path = require("path");
12
12
  function _loadConfiguration(Configuration, options, root, file) {
@@ -47,7 +47,7 @@ function _listAllFiles(root) {
47
47
  const result = [];
48
48
  function _recurse(location) {
49
49
  const dir = fs.readdirSync(path.join(root, location));
50
- dir.forEach(name => {
50
+ dir.forEach((name) => {
51
51
  const loc = path.join(location, name);
52
52
  if (fs.statSync(path.join(root, loc)).isDirectory()) {
53
53
  _recurse(loc);
@@ -64,13 +64,17 @@ function _listAllFiles(root) {
64
64
  function default_1() {
65
65
  return async (options = {}, context) => {
66
66
  const root = process.cwd();
67
- const tslint = await Promise.resolve().then(() => require('tslint')); // tslint:disable-line:no-implicit-dependencies
68
- const includes = (Array.isArray(options.includes)
67
+ const tslint = await Promise.resolve().then(() => require('tslint')); // eslint-disable-line import/no-extraneous-dependencies
68
+ const includes = Array.isArray(options.includes)
69
69
  ? options.includes
70
- : (options.includes ? [options.includes] : []));
71
- const files = (Array.isArray(options.files)
70
+ : options.includes
71
+ ? [options.includes]
72
+ : [];
73
+ const files = Array.isArray(options.files)
72
74
  ? options.files
73
- : (options.files ? [options.files] : []));
75
+ : options.files
76
+ ? [options.files]
77
+ : [];
74
78
  const Linter = tslint.Linter;
75
79
  const Configuration = tslint.Configuration;
76
80
  let program = undefined;
@@ -85,21 +89,21 @@ function default_1() {
85
89
  }
86
90
  if (includes.length > 0) {
87
91
  const allFilesRel = _listAllFiles(root);
88
- const pattern = '^('
89
- + includes
90
- .map(ex => '('
91
- + ex.split(/[\/\\]/g).map(f => f
92
+ const pattern = '^(' +
93
+ includes
94
+ .map((ex) => '(' +
95
+ ex
96
+ .split(/[\/\\]/g)
97
+ .map((f) => f
92
98
  .replace(/[\-\[\]{}()+?.^$|]/g, '\\$&')
93
99
  .replace(/^\*\*/g, '(.+?)?')
94
100
  .replace(/\*/g, '[^/\\\\]*'))
95
- .join('[\/\\\\]')
96
- + ')')
97
- .join('|')
98
- + ')($|/|\\\\)';
101
+ .join('[/\\\\]') +
102
+ ')')
103
+ .join('|') +
104
+ ')($|/|\\\\)';
99
105
  const re = new RegExp(pattern);
100
- filesToLint.push(...allFilesRel
101
- .filter(x => re.test(x))
102
- .map(x => path.join(root, x)));
106
+ filesToLint.push(...allFilesRel.filter((x) => re.test(x)).map((x) => path.join(root, x)));
103
107
  }
104
108
  const lintOptions = {
105
109
  fix: true,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.TslintFixName = void 0;
4
11
  /** @deprecated since version 11. Use `ng lint --fix` directly instead. */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.TslintFixTask = void 0;
4
11
  const options_1 = require("./options");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tasks_1 = require("@angular-devkit/schematics/tasks"); // tslint:disable-line:no-implicit-dependencies
10
+ const tasks_1 = require("@angular-devkit/schematics/tasks"); // eslint-disable-line import/no-extraneous-dependencies
4
11
  const path = require("path");
5
12
  function default_1(options) {
6
13
  return (_, context) => {
@@ -1,20 +1,20 @@
1
- "use strict";
1
+ 'use strict';
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const Lint = require('tslint');
11
9
 
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+ const Lint = require('tslint');
12
12
 
13
13
  class Rule extends Lint.Rules.AbstractRule {
14
14
  apply(sourceFile) {
15
15
  const shouldPass = this.getOptions().ruleArguments[0];
16
16
  if (!shouldPass) {
17
- return [ new Lint.RuleFailure(sourceFile, 0, 0, 'custom-rule fail', this.ruleName) ];
17
+ return [new Lint.RuleFailure(sourceFile, 0, 0, 'custom-rule fail', this.ruleName)];
18
18
  } else {
19
19
  return [];
20
20
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tasks_1 = require("@angular-devkit/schematics/tasks"); // tslint:disable-line:no-implicit-dependencies
10
+ const tasks_1 = require("@angular-devkit/schematics/tasks"); // eslint-disable-line import/no-extraneous-dependencies
4
11
  function default_1() {
5
12
  return (_, context) => {
6
13
  context.addTask(new tasks_1.TslintFixTask({
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
package/testing/index.js CHANGED
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
10
  if (k2 === undefined) k2 = k;
4
11
  Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
@@ -10,11 +17,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
17
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
18
  };
12
19
  Object.defineProperty(exports, "__esModule", { value: true });
13
- /**
14
- * @license
15
- * Copyright Google Inc. All Rights Reserved.
16
- *
17
- * Use of this source code is governed by an MIT-style license that can be
18
- * found in the LICENSE file at https://angular.io/license
19
- */
20
20
  __exportStar(require("./schematic-test-runner"), exports);