@next-core/build-config-factory 2.26.7 → 2.26.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/build-config-factory",
|
|
3
|
-
"version": "2.26.
|
|
3
|
+
"version": "2.26.8",
|
|
4
4
|
"description": "build config factory",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/build-config-factory",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@next-core/brick-utils": "^2.52.6",
|
|
19
19
|
"@next-core/repo-config": "^0.2.5",
|
|
20
20
|
"@next-core/typedoc-plugin-filter-inherit": "^1.2.5",
|
|
21
|
-
"@next-core/webpack-config-factory": "^2.25.
|
|
21
|
+
"@next-core/webpack-config-factory": "^2.25.1",
|
|
22
22
|
"change-case": "^4.1.2",
|
|
23
23
|
"chokidar": "^3.5.3",
|
|
24
24
|
"fs-extra": "^10.1.0",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"typedoc": "^0.19.2",
|
|
35
35
|
"typedoc-plugin-no-inherit": "^1.2.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7adc814bfe85e376604433588331af0517de1275"
|
|
38
38
|
}
|
|
@@ -8,6 +8,10 @@ const {
|
|
|
8
8
|
bricks: { webpackContractsFactory },
|
|
9
9
|
} = require("@next-core/webpack-config-factory");
|
|
10
10
|
|
|
11
|
+
const globalContractRegExp =
|
|
12
|
+
/(?<=@contract\s+)(?:<source=(?:[^>]+)>\s+)?(?:[\w.]+)(?:@[\d.]+)?(?=\s+)/g;
|
|
13
|
+
const singleContractRegExp = /^(?:<source=([^>]+)>\s+)?([\w.]+)(?:@([\d.]+))?$/;
|
|
14
|
+
|
|
11
15
|
module.exports = function generateBrickContracts(dir, isProviderBricks) {
|
|
12
16
|
console.log("Analyzing brick contracts...");
|
|
13
17
|
const startTime = Date.now();
|
|
@@ -43,7 +47,7 @@ module.exports = function generateBrickContracts(dir, isProviderBricks) {
|
|
|
43
47
|
const contractFiles = await globby(
|
|
44
48
|
path.posix.join(dir, "contracts.log/*/*.contracts")
|
|
45
49
|
);
|
|
46
|
-
const contractRegExp =
|
|
50
|
+
const contractRegExp = globalContractRegExp;
|
|
47
51
|
await Promise.all(
|
|
48
52
|
contractFiles.map(async (filePath) => {
|
|
49
53
|
const source = await fs.readFile(filePath, "utf-8");
|
|
@@ -51,7 +55,8 @@ module.exports = function generateBrickContracts(dir, isProviderBricks) {
|
|
|
51
55
|
if (isProviderBricks) {
|
|
52
56
|
if (contracts) {
|
|
53
57
|
for (const item of contracts) {
|
|
54
|
-
const [contract, version] =
|
|
58
|
+
const [_full, source, contract, version] =
|
|
59
|
+
item.match(singleContractRegExp);
|
|
55
60
|
depsMap.set(
|
|
56
61
|
`${pkgLastName}.${contract
|
|
57
62
|
.split(".")
|
|
@@ -60,6 +65,7 @@ module.exports = function generateBrickContracts(dir, isProviderBricks) {
|
|
|
60
65
|
.join("-api-")}`,
|
|
61
66
|
{
|
|
62
67
|
type: "contract",
|
|
68
|
+
source: source || "sdk",
|
|
63
69
|
contract,
|
|
64
70
|
version: version || "*",
|
|
65
71
|
}
|
|
@@ -72,9 +78,11 @@ module.exports = function generateBrickContracts(dir, isProviderBricks) {
|
|
|
72
78
|
depsMap.set(
|
|
73
79
|
brick,
|
|
74
80
|
contracts.map((item) => {
|
|
75
|
-
const [contract, version] =
|
|
81
|
+
const [_full, source, contract, version] =
|
|
82
|
+
item.match(singleContractRegExp);
|
|
76
83
|
return {
|
|
77
84
|
type: "contract",
|
|
85
|
+
source: source || "sdk",
|
|
78
86
|
contract,
|
|
79
87
|
version: version || "*",
|
|
80
88
|
};
|