@pnp/cli-microsoft365-spfx-toolkit 1.6.0 → 1.8.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 (49) hide show
  1. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.22.0.js +23 -0
  2. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.22.1.js +23 -0
  3. package/dist/m365/spfx/commands/project/project-doctor/rules/FN002022_DEVDEP_typescript.js +14 -0
  4. package/dist/m365/spfx/commands/project/project-doctor.js +3 -1
  5. package/dist/m365/spfx/commands/project/project-model/SassJson.js +3 -0
  6. package/dist/m365/spfx/commands/project/project-upgrade/rules/DependencyRule.js +56 -14
  7. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002001_DEVDEP_microsoft_sp_build_web.js +2 -2
  8. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002004_DEVDEP_gulp.js +2 -2
  9. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002007_DEVDEP_ajv.js +2 -2
  10. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3.js +2 -2
  11. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js +14 -0
  12. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002031_DEVDEP_rushstack_heft.js +14 -0
  13. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002032_DEVDEP_typescript_eslint_parser.js +14 -0
  14. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002033_DEVDEP_css_loader.js +14 -0
  15. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js +14 -0
  16. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002035_DEVDEP_types_heft_jest.js +14 -0
  17. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010011_YORC_useGulp.js +45 -0
  18. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014003_CODE_launch.js +7 -44
  19. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015010_FILE_gulpfile_js.js +14 -0
  20. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015011_FILE_tsconfig_json.js +14 -0
  21. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015014_FILE_config_rig_json.js +14 -0
  22. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015015_FILE_config_typescript_json.js +14 -0
  23. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021004_PKG_scripts_build.js +49 -0
  24. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021005_PKG_scripts_test.js +59 -0
  25. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021006_PKG_scripts_clean.js +49 -0
  26. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021007_PKG_scripts_start.js +49 -0
  27. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021008_PKG_scripts_eject_webpack.js +49 -0
  28. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021009_PKG_overrides_rushstack_heft.js +49 -0
  29. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023003_GITIGNORE_libdts.js +40 -0
  30. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023004_GITIGNORE_libcommonjs.js +40 -0
  31. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023005_GITIGNORE_libesm.js +40 -0
  32. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023006_GITIGNORE_jestoutput.js +40 -0
  33. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025002_ESLINTRCJS_rushstack_import_requires_chunk_name.js +61 -0
  34. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025003_ESLINTRCJS_rushstack_pair_react_dom_render_unmount.js +61 -0
  35. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025004_ESLINTRCJS_microsoft_spfx_import_requires_chunk_name.js +54 -0
  36. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN025005_ESLINTRCJS_microsoft_spfx_pair_react_dom_render_unmount.js +54 -0
  37. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN026001_CFG_SASS_schema.js +44 -0
  38. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN026002_CFG_SASS_extends.js +44 -0
  39. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.22.0.js +168 -0
  40. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.22.1.js +57 -0
  41. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.3.4.js +42 -1
  42. package/dist/m365/spfx/commands/project/project-upgrade.js +3 -1
  43. package/dist/m365/spfx/commands/spfx-doctor.js +58 -1
  44. package/dist/m365/spo/commands/page/page-get.js +21 -6
  45. package/dist/m365/spo/commands/page/page-remove.js +34 -14
  46. package/dist/utils/stringUtil.js +7 -0
  47. package/npm-shrinkwrap.json +2 -2
  48. package/package.json +1 -1
  49. package/.eslintcache +0 -1
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const FN002021_DEVDEP_rushstack_eslint_config_1 = require("../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config");
4
+ const FN001008_DEP_react_1 = require("./rules/FN001008_DEP_react");
5
+ const FN001009_DEP_react_dom_1 = require("./rules/FN001009_DEP_react_dom");
6
+ const FN001035_DEP_fluentui_react_1 = require("./rules/FN001035_DEP_fluentui_react");
7
+ const FN002013_DEVDEP_types_webpack_env_1 = require("./rules/FN002013_DEVDEP_types_webpack_env");
8
+ const FN002015_DEVDEP_types_react_1 = require("./rules/FN002015_DEVDEP_types_react");
9
+ const FN002016_DEVDEP_types_react_dom_1 = require("./rules/FN002016_DEVDEP_types_react_dom");
10
+ const FN002022_DEVDEP_typescript_1 = require("./rules/FN002022_DEVDEP_typescript");
11
+ const FN021001_PKG_spfx_deps_versions_match_project_version_1 = require("./rules/FN021001_PKG_spfx_deps_versions_match_project_version");
12
+ module.exports = [
13
+ new FN001008_DEP_react_1.FN001008_DEP_react('17'),
14
+ new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('17'),
15
+ new FN001035_DEP_fluentui_react_1.FN001035_DEP_fluentui_react('^8.106.4'),
16
+ new FN002013_DEVDEP_types_webpack_env_1.FN002013_DEVDEP_types_webpack_env('~1.15.2'),
17
+ new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('17'),
18
+ new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('17'),
19
+ new FN002021_DEVDEP_rushstack_eslint_config_1.FN002021_DEVDEP_rushstack_eslint_config('4.5.2'),
20
+ new FN002022_DEVDEP_typescript_1.FN002022_DEVDEP_typescript('~5.8.0'),
21
+ new FN021001_PKG_spfx_deps_versions_match_project_version_1.FN021001_PKG_spfx_deps_versions_match_project_version(true)
22
+ ];
23
+ //# sourceMappingURL=doctor-1.22.0.js.map
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const FN002021_DEVDEP_rushstack_eslint_config_1 = require("../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config");
4
+ const FN001008_DEP_react_1 = require("./rules/FN001008_DEP_react");
5
+ const FN001009_DEP_react_dom_1 = require("./rules/FN001009_DEP_react_dom");
6
+ const FN001035_DEP_fluentui_react_1 = require("./rules/FN001035_DEP_fluentui_react");
7
+ const FN002013_DEVDEP_types_webpack_env_1 = require("./rules/FN002013_DEVDEP_types_webpack_env");
8
+ const FN002015_DEVDEP_types_react_1 = require("./rules/FN002015_DEVDEP_types_react");
9
+ const FN002016_DEVDEP_types_react_dom_1 = require("./rules/FN002016_DEVDEP_types_react_dom");
10
+ const FN002022_DEVDEP_typescript_1 = require("./rules/FN002022_DEVDEP_typescript");
11
+ const FN021001_PKG_spfx_deps_versions_match_project_version_1 = require("./rules/FN021001_PKG_spfx_deps_versions_match_project_version");
12
+ module.exports = [
13
+ new FN001008_DEP_react_1.FN001008_DEP_react('17'),
14
+ new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('17'),
15
+ new FN001035_DEP_fluentui_react_1.FN001035_DEP_fluentui_react('^8.106.4'),
16
+ new FN002013_DEVDEP_types_webpack_env_1.FN002013_DEVDEP_types_webpack_env('~1.15.2'),
17
+ new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('17'),
18
+ new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('17'),
19
+ new FN002021_DEVDEP_rushstack_eslint_config_1.FN002021_DEVDEP_rushstack_eslint_config('4.5.2'),
20
+ new FN002022_DEVDEP_typescript_1.FN002022_DEVDEP_typescript('~5.8.0'),
21
+ new FN021001_PKG_spfx_deps_versions_match_project_version_1.FN021001_PKG_spfx_deps_versions_match_project_version(true)
22
+ ];
23
+ //# sourceMappingURL=doctor-1.22.1.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002022_DEVDEP_typescript = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002022_DEVDEP_typescript extends DependencyRule_1.DependencyRule {
6
+ constructor(version) {
7
+ super('typescript', version, true);
8
+ }
9
+ get id() {
10
+ return 'FN002022';
11
+ }
12
+ }
13
+ exports.FN002022_DEVDEP_typescript = FN002022_DEVDEP_typescript;
14
+ //# sourceMappingURL=FN002022_DEVDEP_typescript.js.map
@@ -84,7 +84,9 @@ class SpfxProjectDoctorCommand extends base_project_command_1.BaseProjectCommand
84
84
  '1.19.0',
85
85
  '1.20.0',
86
86
  '1.21.0',
87
- '1.21.1'
87
+ '1.21.1',
88
+ '1.22.0',
89
+ '1.22.1'
88
90
  ];
89
91
  __classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
90
92
  __classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SassJson.js.map
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _DependencyRule_instances, _DependencyRule_needsUpdate, _DependencyRule_getMaxVersion;
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.DependencyRule = void 0;
4
- const semver_1 = require("semver");
10
+ const semver = require("semver");
5
11
  const JsonRule_1 = require("../../JsonRule");
6
12
  class DependencyRule extends JsonRule_1.JsonRule {
7
13
  constructor(packageName, packageVersion, isDevDep = false, isOptional = false, add = true) {
@@ -11,6 +17,7 @@ class DependencyRule extends JsonRule_1.JsonRule {
11
17
  this.isDevDep = isDevDep;
12
18
  this.isOptional = isOptional;
13
19
  this.add = add;
20
+ _DependencyRule_instances.add(this);
14
21
  }
15
22
  get title() {
16
23
  return this.packageName;
@@ -42,23 +49,13 @@ class DependencyRule extends JsonRule_1.JsonRule {
42
49
  }
43
50
  const projectDependencies = this.isDevDep ? project.packageJson.devDependencies : project.packageJson.dependencies;
44
51
  const versionEntry = projectDependencies ? projectDependencies[this.packageName] : '';
45
- const packageVersion = (0, semver_1.valid)(versionEntry);
46
- const versionRange = (0, semver_1.validRange)(versionEntry);
47
52
  if (this.add) {
48
53
  let jsonProperty = this.isDevDep ? 'devDependencies' : 'dependencies';
49
54
  if (versionEntry) {
50
55
  jsonProperty += `.${this.packageName}`;
51
- if (packageVersion) {
52
- if ((0, semver_1.lt)(packageVersion, this.packageVersion)) {
53
- const node = this.getAstNodeFromFile(project.packageJson, jsonProperty);
54
- this.addFindingWithPosition(findings, node);
55
- }
56
- }
57
- else {
58
- if (versionRange) {
59
- const node = this.getAstNodeFromFile(project.packageJson, jsonProperty);
60
- this.addFindingWithPosition(findings, node);
61
- }
56
+ if (__classPrivateFieldGet(this, _DependencyRule_instances, "m", _DependencyRule_needsUpdate).call(this, this.packageVersion, versionEntry)) {
57
+ const node = this.getAstNodeFromFile(project.packageJson, jsonProperty);
58
+ this.addFindingWithPosition(findings, node);
62
59
  }
63
60
  }
64
61
  else {
@@ -82,4 +79,49 @@ class DependencyRule extends JsonRule_1.JsonRule {
82
79
  }
83
80
  }
84
81
  exports.DependencyRule = DependencyRule;
82
+ _DependencyRule_instances = new WeakSet(), _DependencyRule_needsUpdate = function _DependencyRule_needsUpdate(ruleVersion, currentVersion) {
83
+ try {
84
+ // Get minimum versions for both
85
+ const ruleMin = semver.minVersion(ruleVersion);
86
+ const currentMin = semver.minVersion(currentVersion);
87
+ // Check if ranges overlap
88
+ const rangesOverlap = semver.intersects(ruleVersion, currentVersion);
89
+ if (rangesOverlap) {
90
+ // Even if they overlap, update if rule requires a higher minimum version
91
+ if (ruleMin && currentMin && semver.gt(ruleMin, currentMin)) {
92
+ return true;
93
+ }
94
+ return false;
95
+ }
96
+ // Ranges don't overlap - check if rule range is greater
97
+ // Get the maximum version that satisfies the current range
98
+ const currentMax = __classPrivateFieldGet(this, _DependencyRule_instances, "m", _DependencyRule_getMaxVersion).call(this, currentVersion);
99
+ // If rule's minimum is greater than current's maximum, update is needed
100
+ return !!(ruleMin && currentMax && semver.gt(ruleMin, currentMax));
101
+ }
102
+ catch (_a) {
103
+ return false;
104
+ }
105
+ }, _DependencyRule_getMaxVersion = function _DependencyRule_getMaxVersion(range) {
106
+ const rangeObj = new semver.Range(range);
107
+ // If it's a specific version (no range operators), return it
108
+ if (semver.valid(range)) {
109
+ return semver.parse(range);
110
+ }
111
+ // For ranges, get the highest version from the set
112
+ // Check the range set to find upper bounds
113
+ let maxVer = null;
114
+ for (const comparatorSet of rangeObj.set) {
115
+ for (const comparator of comparatorSet) {
116
+ if (comparator.operator === '<' || comparator.operator === '<=') {
117
+ const ver = comparator.semver;
118
+ if (!maxVer || semver.gt(ver, maxVer)) {
119
+ maxVer = ver;
120
+ }
121
+ }
122
+ }
123
+ }
124
+ // If no upper bound found, use minVersion as fallback
125
+ return maxVer || semver.minVersion(range);
126
+ };
85
127
  //# sourceMappingURL=DependencyRule.js.map
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FN002001_DEVDEP_microsoft_sp_build_web = void 0;
4
4
  const DependencyRule_1 = require("./DependencyRule");
5
5
  class FN002001_DEVDEP_microsoft_sp_build_web extends DependencyRule_1.DependencyRule {
6
- constructor(packageVersion) {
7
- super('@microsoft/sp-build-web', packageVersion, true);
6
+ constructor(packageVersion, add = true) {
7
+ super('@microsoft/sp-build-web', packageVersion, true, false, add);
8
8
  }
9
9
  get id() {
10
10
  return 'FN002001';
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FN002004_DEVDEP_gulp = void 0;
4
4
  const DependencyRule_1 = require("./DependencyRule");
5
5
  class FN002004_DEVDEP_gulp extends DependencyRule_1.DependencyRule {
6
- constructor(packageVersion) {
7
- super('gulp', packageVersion, true);
6
+ constructor(packageVersion, add = true) {
7
+ super('gulp', packageVersion, true, false, add);
8
8
  }
9
9
  get id() {
10
10
  return 'FN002004';
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FN002007_DEVDEP_ajv = void 0;
4
4
  const DependencyRule_1 = require("./DependencyRule");
5
5
  class FN002007_DEVDEP_ajv extends DependencyRule_1.DependencyRule {
6
- constructor(packageVersion) {
7
- super('ajv', packageVersion, true);
6
+ constructor(packageVersion, add = true) {
7
+ super('ajv', packageVersion, true, false, add);
8
8
  }
9
9
  get id() {
10
10
  return 'FN002007';
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3 = void 0;
4
4
  const DependencyRule_1 = require("./DependencyRule");
5
5
  class FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3 extends DependencyRule_1.DependencyRule {
6
- constructor(packageVersion) {
7
- super('@microsoft/rush-stack-compiler-5.3', packageVersion, true);
6
+ constructor(packageVersion, add = true) {
7
+ super('@microsoft/rush-stack-compiler-5.3', packageVersion, true, false, add);
8
8
  }
9
9
  get id() {
10
10
  return 'FN002029';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002030_DEVDEP_microsoft_spfx_web_build_rig = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002030_DEVDEP_microsoft_spfx_web_build_rig extends DependencyRule_1.DependencyRule {
6
+ constructor(packageVersion) {
7
+ super('@microsoft/spfx-web-build-rig', packageVersion, true);
8
+ }
9
+ get id() {
10
+ return 'FN002030';
11
+ }
12
+ }
13
+ exports.FN002030_DEVDEP_microsoft_spfx_web_build_rig = FN002030_DEVDEP_microsoft_spfx_web_build_rig;
14
+ //# sourceMappingURL=FN002030_DEVDEP_microsoft_spfx_web_build_rig.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002031_DEVDEP_rushstack_heft = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002031_DEVDEP_rushstack_heft extends DependencyRule_1.DependencyRule {
6
+ constructor(packageVersion) {
7
+ super('@rushstack/heft', packageVersion, true);
8
+ }
9
+ get id() {
10
+ return 'FN002031';
11
+ }
12
+ }
13
+ exports.FN002031_DEVDEP_rushstack_heft = FN002031_DEVDEP_rushstack_heft;
14
+ //# sourceMappingURL=FN002031_DEVDEP_rushstack_heft.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002032_DEVDEP_typescript_eslint_parser = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002032_DEVDEP_typescript_eslint_parser extends DependencyRule_1.DependencyRule {
6
+ constructor(packageVersion) {
7
+ super('@typescript-eslint/parser', packageVersion, true);
8
+ }
9
+ get id() {
10
+ return 'FN002032';
11
+ }
12
+ }
13
+ exports.FN002032_DEVDEP_typescript_eslint_parser = FN002032_DEVDEP_typescript_eslint_parser;
14
+ //# sourceMappingURL=FN002032_DEVDEP_typescript_eslint_parser.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002033_DEVDEP_css_loader = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002033_DEVDEP_css_loader extends DependencyRule_1.DependencyRule {
6
+ constructor(packageVersion) {
7
+ super('css-loader', packageVersion, true);
8
+ }
9
+ get id() {
10
+ return 'FN002033';
11
+ }
12
+ }
13
+ exports.FN002033_DEVDEP_css_loader = FN002033_DEVDEP_css_loader;
14
+ //# sourceMappingURL=FN002033_DEVDEP_css_loader.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002034_DEVDEP_microsoft_spfx_heft_plugins = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002034_DEVDEP_microsoft_spfx_heft_plugins extends DependencyRule_1.DependencyRule {
6
+ constructor(packageVersion) {
7
+ super('@microsoft/spfx-heft-plugins', packageVersion, true);
8
+ }
9
+ get id() {
10
+ return 'FN002034';
11
+ }
12
+ }
13
+ exports.FN002034_DEVDEP_microsoft_spfx_heft_plugins = FN002034_DEVDEP_microsoft_spfx_heft_plugins;
14
+ //# sourceMappingURL=FN002034_DEVDEP_microsoft_spfx_heft_plugins.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN002035_DEVDEP_types_heft_jest = void 0;
4
+ const DependencyRule_1 = require("./DependencyRule");
5
+ class FN002035_DEVDEP_types_heft_jest extends DependencyRule_1.DependencyRule {
6
+ constructor(packageVersion) {
7
+ super('@types/heft-jest', packageVersion, true);
8
+ }
9
+ get id() {
10
+ return 'FN002035';
11
+ }
12
+ }
13
+ exports.FN002035_DEVDEP_types_heft_jest = FN002035_DEVDEP_types_heft_jest;
14
+ //# sourceMappingURL=FN002035_DEVDEP_types_heft_jest.js.map
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN010011_YORC_useGulp = void 0;
4
+ const JsonRule_1 = require("../../JsonRule");
5
+ class FN010011_YORC_useGulp extends JsonRule_1.JsonRule {
6
+ constructor(useGulp) {
7
+ super();
8
+ this.useGulp = useGulp;
9
+ }
10
+ get id() {
11
+ return 'FN010011';
12
+ }
13
+ get title() {
14
+ return '.yo-rc.json useGulp';
15
+ }
16
+ get description() {
17
+ return `Update useGulp property in .yo-rc.json`;
18
+ }
19
+ get resolution() {
20
+ return `{
21
+ "useGulp": ${this.useGulp.toString()}
22
+ }`;
23
+ }
24
+ get resolutionType() {
25
+ return 'json';
26
+ }
27
+ get severity() {
28
+ return 'Recommended';
29
+ }
30
+ get file() {
31
+ return './.yo-rc.json';
32
+ }
33
+ visit(project, findings) {
34
+ var _a;
35
+ if (!project.yoRcJson) {
36
+ return;
37
+ }
38
+ if (((_a = project.yoRcJson["@microsoft/generator-sharepoint"]) === null || _a === void 0 ? void 0 : _a.useGulp) !== this.useGulp) {
39
+ const node = this.getAstNodeFromFile(project.yoRcJson, '@microsoft/generator-sharepoint.useGulp');
40
+ this.addFindingWithPosition(findings, node);
41
+ }
42
+ }
43
+ }
44
+ exports.FN010011_YORC_useGulp = FN010011_YORC_useGulp;
45
+ //# sourceMappingURL=FN010011_YORC_useGulp.js.map
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FN014003_CODE_launch = void 0;
4
4
  const Rule_1 = require("../../Rule");
5
+ const stringUtil_1 = require("../../../../../../utils/stringUtil");
5
6
  class FN014003_CODE_launch extends Rule_1.Rule {
6
- constructor() {
7
+ constructor(contents) {
7
8
  super();
9
+ this.contents = contents;
8
10
  }
9
11
  get id() {
10
12
  return 'FN014003';
@@ -16,48 +18,7 @@ class FN014003_CODE_launch extends Rule_1.Rule {
16
18
  return `In the .vscode folder, add the launch.json file`;
17
19
  }
18
20
  get resolution() {
19
- return `{
20
- /**
21
- Install Chrome Debugger Extension for Visual Studio Code
22
- to debug your components with the Chrome browser:
23
- https://aka.ms/spfx-debugger-extensions
24
- */
25
- "version": "0.2.0",
26
- "configurations": [{
27
- "name": "Local workbench",
28
- "type": "chrome",
29
- "request": "launch",
30
- "url": "https://localhost:4321/temp/workbench.html",
31
- "webRoot": "\${workspaceRoot}",
32
- "sourceMaps": true,
33
- "sourceMapPathOverrides": {
34
- "webpack:///../../../src/*": "\${webRoot}/src/*",
35
- "webpack:///../../../../src/*": "\${webRoot}/src/*",
36
- "webpack:///../../../../../src/*": "\${webRoot}/src/*"
37
- },
38
- "runtimeArgs": [
39
- "--remote-debugging-port=9222"
40
- ]
41
- },
42
- {
43
- "name": "Hosted workbench",
44
- "type": "chrome",
45
- "request": "launch",
46
- "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx",
47
- "webRoot": "\${workspaceRoot}",
48
- "sourceMaps": true,
49
- "sourceMapPathOverrides": {
50
- "webpack:///../../../src/*": "\${webRoot}/src/*",
51
- "webpack:///../../../../src/*": "\${webRoot}/src/*",
52
- "webpack:///../../../../../src/*": "\${webRoot}/src/*"
53
- },
54
- "runtimeArgs": [
55
- "--remote-debugging-port=9222",
56
- "-incognito"
57
- ]
58
- }
59
- ]
60
- }`;
21
+ return this.contents;
61
22
  }
62
23
  get resolutionType() {
63
24
  return 'json';
@@ -69,7 +30,9 @@ class FN014003_CODE_launch extends Rule_1.Rule {
69
30
  return '.vscode/launch.json';
70
31
  }
71
32
  visit(project, findings) {
72
- if (!project.vsCode || !project.vsCode.launchJson) {
33
+ if (!project.vsCode ||
34
+ !project.vsCode.launchJson ||
35
+ stringUtil_1.stringUtil.normalizeLineEndings(project.vsCode.launchJson.source) !== stringUtil_1.stringUtil.normalizeLineEndings(this.contents)) {
73
36
  this.addFinding(findings);
74
37
  }
75
38
  }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN015010_FILE_gulpfile_js = void 0;
4
+ const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
5
+ class FN015010_FILE_gulpfile_js extends FileAddRemoveRule_1.FileAddRemoveRule {
6
+ constructor(add) {
7
+ super('./gulpfile.js', add);
8
+ }
9
+ get id() {
10
+ return 'FN015010';
11
+ }
12
+ }
13
+ exports.FN015010_FILE_gulpfile_js = FN015010_FILE_gulpfile_js;
14
+ //# sourceMappingURL=FN015010_FILE_gulpfile_js.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN015011_FILE_tsconfig_json = void 0;
4
+ const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
5
+ class FN015011_FILE_tsconfig_json extends FileAddRemoveRule_1.FileAddRemoveRule {
6
+ constructor(add, contents) {
7
+ super('./tsconfig.json', add, contents);
8
+ }
9
+ get id() {
10
+ return 'FN015011';
11
+ }
12
+ }
13
+ exports.FN015011_FILE_tsconfig_json = FN015011_FILE_tsconfig_json;
14
+ //# sourceMappingURL=FN015011_FILE_tsconfig_json.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN015014_FILE_config_rig_json = void 0;
4
+ const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
5
+ class FN015014_FILE_config_rig_json extends FileAddRemoveRule_1.FileAddRemoveRule {
6
+ constructor(add, contents) {
7
+ super('./config/rig.json', add, contents);
8
+ }
9
+ get id() {
10
+ return 'FN015014';
11
+ }
12
+ }
13
+ exports.FN015014_FILE_config_rig_json = FN015014_FILE_config_rig_json;
14
+ //# sourceMappingURL=FN015014_FILE_config_rig_json.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN015015_FILE_config_typescript_json = void 0;
4
+ const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
5
+ class FN015015_FILE_config_typescript_json extends FileAddRemoveRule_1.FileAddRemoveRule {
6
+ constructor(add, contents) {
7
+ super('./config/typescript.json', add, contents);
8
+ }
9
+ get id() {
10
+ return 'FN015015';
11
+ }
12
+ }
13
+ exports.FN015015_FILE_config_typescript_json = FN015015_FILE_config_typescript_json;
14
+ //# sourceMappingURL=FN015015_FILE_config_typescript_json.js.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN021004_PKG_scripts_build = void 0;
4
+ const JsonRule_1 = require("../../JsonRule");
5
+ class FN021004_PKG_scripts_build extends JsonRule_1.JsonRule {
6
+ constructor(script) {
7
+ super();
8
+ this.script = script;
9
+ }
10
+ get id() {
11
+ return 'FN021004';
12
+ }
13
+ get title() {
14
+ return 'package.json scripts.build';
15
+ }
16
+ get description() {
17
+ return 'Update package.json scripts.build property';
18
+ }
19
+ get resolution() {
20
+ return `{
21
+ "scripts": {
22
+ "build": "${this.script}"
23
+ }
24
+ }`;
25
+ }
26
+ get resolutionType() {
27
+ return 'json';
28
+ }
29
+ get severity() {
30
+ return 'Required';
31
+ }
32
+ get file() {
33
+ return './package.json';
34
+ }
35
+ visit(project, findings) {
36
+ if (!project.packageJson) {
37
+ return;
38
+ }
39
+ if (!project.packageJson.scripts ||
40
+ typeof project.packageJson.scripts !== 'object' ||
41
+ !project.packageJson.scripts.build ||
42
+ project.packageJson.scripts.build !== this.script) {
43
+ const node = this.getAstNodeFromFile(project.packageJson, 'scripts.build');
44
+ this.addFindingWithPosition(findings, node);
45
+ }
46
+ }
47
+ }
48
+ exports.FN021004_PKG_scripts_build = FN021004_PKG_scripts_build;
49
+ //# sourceMappingURL=FN021004_PKG_scripts_build.js.map
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FN021005_PKG_scripts_test = void 0;
4
+ const JsonRule_1 = require("../../JsonRule");
5
+ class FN021005_PKG_scripts_test extends JsonRule_1.JsonRule {
6
+ constructor(script, add = true) {
7
+ super();
8
+ this.script = script;
9
+ this.add = add;
10
+ }
11
+ get id() {
12
+ return 'FN021005';
13
+ }
14
+ get title() {
15
+ return 'package.json scripts.test';
16
+ }
17
+ get description() {
18
+ return `${this.add ? 'Update' : 'Remove'} package.json scripts.test property`;
19
+ }
20
+ get resolution() {
21
+ return `{
22
+ "scripts": {
23
+ "test": ${this.add ? `"${this.script}"` : '""'}
24
+ }
25
+ }`;
26
+ }
27
+ get resolutionType() {
28
+ return 'json';
29
+ }
30
+ get severity() {
31
+ return 'Required';
32
+ }
33
+ get file() {
34
+ return './package.json';
35
+ }
36
+ visit(project, findings) {
37
+ var _a;
38
+ if (!project.packageJson) {
39
+ return;
40
+ }
41
+ if (this.add) {
42
+ if (!project.packageJson.scripts ||
43
+ typeof project.packageJson.scripts !== 'object' ||
44
+ !project.packageJson.scripts.test ||
45
+ project.packageJson.scripts.test !== this.script) {
46
+ const node = this.getAstNodeFromFile(project.packageJson, 'scripts.test');
47
+ this.addFindingWithPosition(findings, node);
48
+ }
49
+ }
50
+ else {
51
+ if (((_a = project.packageJson.scripts) === null || _a === void 0 ? void 0 : _a.test) === this.script) {
52
+ const node = this.getAstNodeFromFile(project.packageJson, 'scripts.test');
53
+ this.addFindingWithPosition(findings, node);
54
+ }
55
+ }
56
+ }
57
+ }
58
+ exports.FN021005_PKG_scripts_test = FN021005_PKG_scripts_test;
59
+ //# sourceMappingURL=FN021005_PKG_scripts_test.js.map