@next-core/dev-dependencies 1.16.99 → 1.17.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.
@@ -1,11 +1,11 @@
1
1
  <?xml version="1.0" ?>
2
2
  <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
3
- <coverage lines-valid="388" lines-covered="380" line-rate="0.9793000000000001" branches-valid="141" branches-covered="132" branch-rate="0.9361" timestamp="1685355631902" complexity="0" version="0.1">
3
+ <coverage lines-valid="396" lines-covered="388" line-rate="0.9797" branches-valid="145" branches-covered="136" branch-rate="0.9379000000000001" timestamp="1685413336735" complexity="0" version="0.1">
4
4
  <sources>
5
5
  <source>/home/runner/work/next-core/next-core/packages/dev-dependencies</source>
6
6
  </sources>
7
7
  <packages>
8
- <package name="main" line-rate="0.9793000000000001" branch-rate="0.9361">
8
+ <package name="main" line-rate="0.9797" branch-rate="0.9379000000000001">
9
9
  <classes>
10
10
  <class name="addMocksForBrickIcons.js" filename="patches/addMocksForBrickIcons.js" line-rate="1" branch-rate="1">
11
11
  <methods>
@@ -812,6 +812,25 @@
812
812
  <line number="26" hits="1" branch="false"/>
813
813
  </lines>
814
814
  </class>
815
+ <class name="updateRenovateForV2.js" filename="patches/updateRenovateForV2.js" line-rate="1" branch-rate="1">
816
+ <methods>
817
+ <method name="updateRenovateForV2" hits="2" signature="()V">
818
+ <lines>
819
+ <line number="4" hits="2"/>
820
+ </lines>
821
+ </method>
822
+ </methods>
823
+ <lines>
824
+ <line number="1" hits="1" branch="false"/>
825
+ <line number="2" hits="1" branch="false"/>
826
+ <line number="5" hits="2" branch="false"/>
827
+ <line number="6" hits="2" branch="false"/>
828
+ <line number="7" hits="2" branch="false"/>
829
+ <line number="9" hits="2" branch="false"/>
830
+ <line number="46" hits="2" branch="false"/>
831
+ <line number="49" hits="1" branch="false"/>
832
+ </lines>
833
+ </class>
815
834
  <class name="updateResolutions.js" filename="patches/updateResolutions.js" line-rate="1" branch-rate="1">
816
835
  <methods>
817
836
  <method name="updateResolutions" hits="4" signature="()V">
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.17.0](https://github.com/easyops-cn/next-core/compare/@next-core/dev-dependencies@1.16.99...@next-core/dev-dependencies@1.17.0) (2023-05-30)
7
+
8
+
9
+ ### Features
10
+
11
+ * update renovate for v2: only enable @next-core/* and @next-libs/* ([062d719](https://github.com/easyops-cn/next-core/commit/062d719d2622a7652b80929f6453fc21da8a65ec))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.16.99](https://github.com/easyops-cn/next-core/compare/@next-core/dev-dependencies@1.16.98...@next-core/dev-dependencies@1.16.99) (2023-05-29)
7
18
 
8
19
  **Note:** Version bump only for package @next-core/dev-dependencies
package/extract.js CHANGED
@@ -131,22 +131,5 @@ module.exports = function extract() {
131
131
 
132
132
  writeJsonFile(rootPackageJsonPath, rootPackageJson);
133
133
 
134
- // 同时更新 Renovate 配置,DLL 的依赖由 DLL 带动更新,不需要自动更新
135
- const renovateJsonPath = path.resolve("renovate.json");
136
- const renovateJson = readJson(renovateJsonPath);
137
- if (renovateJson.enabled !== false) {
138
- const disabledRule = renovateJson.packageRules.find(
139
- (item) => item.enabled === false
140
- );
141
- const disabledPackageNames = new Set(disabledRule.matchPackageNames);
142
-
143
- for (const pkg of toBeExtracted.keys()) {
144
- disabledPackageNames.add(pkg);
145
- }
146
- disabledRule.matchPackageNames = Array.from(disabledPackageNames).sort();
147
-
148
- writeJsonFile(renovateJsonPath, renovateJson);
149
- }
150
-
151
134
  return patch();
152
135
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/dev-dependencies",
3
- "version": "1.16.99",
3
+ "version": "1.17.0",
4
4
  "description": "Dev dependencies for brick-next related packages",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/dev-dependencies",
6
6
  "license": "GPL-3.0",
@@ -85,5 +85,5 @@
85
85
  "enzyme": "^3.11.0",
86
86
  "lolex": "^5.1.2"
87
87
  },
88
- "gitHead": "1fe49d118813d92ad8360ec0ac263f867fb73b9b"
88
+ "gitHead": "c0926a724a764fceb55996e22d4f94cc1fdcf7bb"
89
89
  }
package/patch.js CHANGED
@@ -28,6 +28,7 @@ const {
28
28
  migrateLazyBricksWithJest,
29
29
  onlyAutoMergePatchVersions,
30
30
  enableLernaWithNx,
31
+ updateRenovateForV2,
31
32
  } = require("./patches");
32
33
 
33
34
  function initAndGetDevDependenciesVersion() {
@@ -199,6 +200,10 @@ module.exports = async function patch() {
199
200
  enableLernaWithNx();
200
201
  }
201
202
 
203
+ if (semver.lt(currentRenewVersion, "1.17.0")) {
204
+ updateRenovateForV2();
205
+ }
206
+
202
207
  updateDevDependenciesVersion();
203
208
  };
204
209
 
package/patches/index.js CHANGED
@@ -21,3 +21,4 @@ exports.removeRenovateLegacyBaseBranches = require("./removeRenovateLegacyBaseBr
21
21
  exports.migrateLazyBricksWithJest = require("./migrateLazyBricksWithJest");
22
22
  exports.onlyAutoMergePatchVersions = require("./onlyAutoMergePatchVersions");
23
23
  exports.enableLernaWithNx = require("./enableLernaWithNx");
24
+ exports.updateRenovateForV2 = require("./updateRenovateForV2");
@@ -0,0 +1,49 @@
1
+ const path = require("path");
2
+ const { readJson, writeJsonFile, readSelfJson } = require("../utils");
3
+
4
+ function updateRenovateForV2() {
5
+ const selfJson = readSelfJson();
6
+ const renovateJsonPath = path.resolve("renovate.json");
7
+ const renovateJson = readJson(renovateJsonPath);
8
+
9
+ renovateJson.packageRules = [
10
+ {
11
+ excludePackagePatterns: ["^@next-core/", "^@next-libs/"],
12
+ enabled: false,
13
+ },
14
+ {
15
+ groupName: "next-core packages",
16
+ matchPackagePatterns: ["^@next-core/"],
17
+ matchUpdateTypes: ["minor", "patch"],
18
+ postUpgradeTasks:
19
+ selfJson.homepage && selfJson.homepage.includes("github.com")
20
+ ? undefined
21
+ : {
22
+ commands: [
23
+ "yarn renew",
24
+ "yarn extract",
25
+ "./node_modules/.bin/prettier --write package.json",
26
+ "yarn-deduplicate yarn.lock",
27
+ "yarn",
28
+ ],
29
+ fileFilters: [
30
+ "**/*",
31
+ ".gitignore",
32
+ ".gitlab/**/*",
33
+ ".huskyrc",
34
+ ".husky/.gitignore",
35
+ ".husky/**/*",
36
+ ],
37
+ },
38
+ },
39
+ {
40
+ groupName: "next-libs packages",
41
+ matchPackagePatterns: ["^@next-libs/"],
42
+ separateMajorMinor: false,
43
+ },
44
+ ];
45
+
46
+ writeJsonFile(renovateJsonPath, renovateJson);
47
+ }
48
+
49
+ module.exports = updateRenovateForV2;
@@ -0,0 +1,92 @@
1
+ const updateRenovateForV2 = require("./updateRenovateForV2");
2
+ const { writeJsonFile, readJson, readSelfJson } = require("../utils");
3
+
4
+ jest.mock("../utils");
5
+
6
+ describe("updateRenovateForV2", () => {
7
+ afterEach(() => {
8
+ jest.clearAllMocks();
9
+ });
10
+
11
+ it("should update v2 for repo on github", () => {
12
+ readSelfJson.mockReturnValueOnce({
13
+ homepage: "https://github.com/easyops-cn/next-basics",
14
+ });
15
+ readJson.mockReturnValueOnce({
16
+ extends: ["config:base"],
17
+ packageRules: [{}],
18
+ });
19
+ updateRenovateForV2();
20
+ expect(writeJsonFile).toBeCalledWith(
21
+ expect.stringContaining("renovate.json"),
22
+ {
23
+ extends: ["config:base"],
24
+ packageRules: [
25
+ {
26
+ excludePackagePatterns: ["^@next-core/", "^@next-libs/"],
27
+ enabled: false,
28
+ },
29
+ {
30
+ groupName: "next-core packages",
31
+ matchPackagePatterns: ["^@next-core/"],
32
+ matchUpdateTypes: ["minor", "patch"],
33
+ },
34
+ {
35
+ groupName: "next-libs packages",
36
+ matchPackagePatterns: ["^@next-libs/"],
37
+ separateMajorMinor: false,
38
+ },
39
+ ],
40
+ }
41
+ );
42
+ });
43
+
44
+ it("should update v2 for repo on gitlab", () => {
45
+ readSelfJson.mockReturnValueOnce({
46
+ homepage: "https://git.easyops.local/easyops-cn/next-basics",
47
+ });
48
+ readJson.mockReturnValueOnce({
49
+ extends: ["config:base"],
50
+ });
51
+ updateRenovateForV2();
52
+ expect(writeJsonFile).toBeCalledWith(
53
+ expect.stringContaining("renovate.json"),
54
+ {
55
+ extends: ["config:base"],
56
+ packageRules: [
57
+ {
58
+ excludePackagePatterns: ["^@next-core/", "^@next-libs/"],
59
+ enabled: false,
60
+ },
61
+ {
62
+ groupName: "next-core packages",
63
+ matchPackagePatterns: ["^@next-core/"],
64
+ matchUpdateTypes: ["minor", "patch"],
65
+ postUpgradeTasks: {
66
+ commands: [
67
+ "yarn renew",
68
+ "yarn extract",
69
+ "./node_modules/.bin/prettier --write package.json",
70
+ "yarn-deduplicate yarn.lock",
71
+ "yarn",
72
+ ],
73
+ fileFilters: [
74
+ "**/*",
75
+ ".gitignore",
76
+ ".gitlab/**/*",
77
+ ".huskyrc",
78
+ ".husky/.gitignore",
79
+ ".husky/**/*",
80
+ ],
81
+ },
82
+ },
83
+ {
84
+ groupName: "next-libs packages",
85
+ matchPackagePatterns: ["^@next-libs/"],
86
+ separateMajorMinor: false,
87
+ },
88
+ ],
89
+ }
90
+ );
91
+ });
92
+ });