@uxf/scripts 11.64.2 → 11.69.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.
- package/bin/uxf-claude-sync.js +1 -1
- package/bin/uxf-lunch.js +1 -1
- package/bin/uxf-packages-check.js +8 -0
- package/bin/uxf-release.js +1 -1
- package/bin/uxf-sitemap-check.js +1 -1
- package/bin/uxf-sitemap-meta-export.js +1 -1
- package/package.json +3 -1
- package/src/GitLab.js +17 -15
- package/src/Logger.js +4 -4
- package/src/Sitemap.js +17 -16
- package/src/uxf-audit/manager/yarn-1.js +3 -3
- package/src/uxf-audit/manager/yarn-4.js +2 -2
- package/src/uxf-claude-sync/cli.js +1 -4
- package/src/uxf-claude-sync/index.js +26 -24
- package/src/uxf-dependencies-check/cli.js +32 -0
- package/src/uxf-dependencies-check/index.js +105 -0
- package/src/uxf-dependencies-check/uxf-dependencies-check.test.js +74 -0
- package/src/uxf-lunch/cli.js +1 -1
- package/src/uxf-lunch/index.js +3 -4
- package/src/uxf-merge-requests-notifier/index.js +2 -2
- package/src/uxf-release/index.js +10 -13
- package/src/uxf-sitemap-check/index.js +4 -5
- package/src/uxf-sitemap-meta-export/cli.js +1 -1
- package/src/uxf-sitemap-meta-export/index.js +14 -15
package/bin/uxf-claude-sync.js
CHANGED
package/bin/uxf-lunch.js
CHANGED
package/bin/uxf-release.js
CHANGED
package/bin/uxf-sitemap-check.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/scripts",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.69.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"uxf-audit": "bin/uxf-audit.js",
|
|
8
8
|
"uxf-claude-sync": "bin/uxf-claude-sync.js",
|
|
9
9
|
"uxf-lunch": "bin/uxf-lunch.js",
|
|
10
|
+
"uxf-dependencies-check": "bin/uxf-dependencies-check.js",
|
|
10
11
|
"uxf-push-notifier": "bin/uxf-push-notifier.js",
|
|
11
12
|
"uxf-release": "bin/uxf-release.js",
|
|
12
13
|
"uxf-sitemap-check": "bin/uxf-sitemap-check.js",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"got": "14.4.7",
|
|
37
38
|
"madge": "8.0.0",
|
|
38
39
|
"robots-txt-parser": "2.0.3",
|
|
40
|
+
"yaml": "2.8.0",
|
|
39
41
|
"yargs": "17.7.2"
|
|
40
42
|
}
|
|
41
43
|
}
|
package/src/GitLab.js
CHANGED
|
@@ -58,20 +58,22 @@ async function findMigrationFiles(commits) {
|
|
|
58
58
|
|
|
59
59
|
// Paralelní načtení diffů pro každý commit
|
|
60
60
|
const migrationFiles = new Set();
|
|
61
|
-
await Promise.all(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
await Promise.all(
|
|
62
|
+
commits.map(async (commit) => {
|
|
63
|
+
try {
|
|
64
|
+
const { data: diffs } = await axios.get(
|
|
65
|
+
`/projects/${env.CI_PROJECT_ID}/repository/commits/${commit.id}/diff`,
|
|
66
|
+
);
|
|
67
|
+
diffs.forEach(({ new_path }) => {
|
|
68
|
+
if (/^api\/migrations\/Version.*\.php$/.test(new_path)) {
|
|
69
|
+
migrationFiles.add(new_path);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.error(`Chyba při kontrole commitu ${commit.id}: ${err.message}`);
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
);
|
|
75
77
|
|
|
76
78
|
const migrationList = Array.from(migrationFiles);
|
|
77
79
|
console.log(`Nalezeno ${migrationList.length} migračních souborů.`);
|
|
@@ -141,4 +143,4 @@ module.exports = {
|
|
|
141
143
|
getAllProjects,
|
|
142
144
|
getSingleMergeRequestChanges,
|
|
143
145
|
findMigrationFiles,
|
|
144
|
-
};
|
|
146
|
+
};
|
package/src/Logger.js
CHANGED
package/src/Sitemap.js
CHANGED
|
@@ -34,22 +34,23 @@ const axios = create({
|
|
|
34
34
|
timeout: 20000,
|
|
35
35
|
httpsAgent: agent,
|
|
36
36
|
headers: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
"User-Agent":
|
|
38
|
+
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
|
|
39
|
+
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
|
40
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
41
|
+
"Accept-Language": "en-US,en;q=0.9,cs-CZ;q=0.8,cs;q=0.7,de;q=0.6",
|
|
42
|
+
"Cache-Control": "no-cache",
|
|
43
|
+
Connection: "keep-alive",
|
|
44
|
+
Pragma: "no-cache",
|
|
45
|
+
"Sec-Ch-Ua": '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
|
|
46
|
+
"Sec-Ch-Ua-Arch": '"x86"',
|
|
47
|
+
"Sec-Ch-Ua-Mobile": "?0",
|
|
48
|
+
"Sec-Ch-Ua-Platform": '"Windows"',
|
|
49
|
+
"Sec-Fetch-Dest": "document",
|
|
50
|
+
"Sec-Fetch-Mode": "navigate",
|
|
51
|
+
"Sec-Fetch-Site": "cross-site",
|
|
52
|
+
"Sec-Fetch-User": "?1",
|
|
53
|
+
"Sec-Fetch-User-Agent": "?1",
|
|
53
54
|
},
|
|
54
55
|
});
|
|
55
56
|
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const https = require(
|
|
3
|
-
const http = require(
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const https = require("https");
|
|
3
|
+
const http = require("http");
|
|
4
4
|
|
|
5
|
-
const header =
|
|
5
|
+
const header = "# Global guidelines";
|
|
6
6
|
|
|
7
7
|
// Funkce pro stažení obsahu z URL
|
|
8
8
|
function downloadContent(url) {
|
|
9
9
|
return new Promise((resolve, reject) => {
|
|
10
|
-
const protocol = url.startsWith(
|
|
10
|
+
const protocol = url.startsWith("https") ? https : http;
|
|
11
11
|
|
|
12
|
-
protocol
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
protocol
|
|
13
|
+
.get(url, (response) => {
|
|
14
|
+
if (response.statusCode !== 200) {
|
|
15
|
+
reject(new Error(`Chyba při stahování: HTTP status ${response.statusCode}`));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
let data = "";
|
|
20
|
+
response.on("data", (chunk) => {
|
|
21
|
+
data += chunk;
|
|
22
|
+
});
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
response.on("end", () => {
|
|
25
|
+
resolve(data);
|
|
26
|
+
});
|
|
27
|
+
})
|
|
28
|
+
.on("error", (error) => {
|
|
29
|
+
reject(error);
|
|
25
30
|
});
|
|
26
|
-
}).on('error', (error) => {
|
|
27
|
-
reject(error);
|
|
28
|
-
});
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -33,9 +35,9 @@ function downloadContent(url) {
|
|
|
33
35
|
function processFile(content, fileName = "CLAUDE.md") {
|
|
34
36
|
try {
|
|
35
37
|
// Kontrola, zda soubor existuje
|
|
36
|
-
let fileContent =
|
|
38
|
+
let fileContent = "";
|
|
37
39
|
try {
|
|
38
|
-
fileContent = fs.readFileSync(fileName,
|
|
40
|
+
fileContent = fs.readFileSync(fileName, "utf8");
|
|
39
41
|
} catch (error) {
|
|
40
42
|
// Soubor neexistuje, vytvoříme nový
|
|
41
43
|
console.log(`Soubor ${fileName} neexistuje, vytvářím nový...`);
|
|
@@ -49,7 +51,7 @@ function processFile(content, fileName = "CLAUDE.md") {
|
|
|
49
51
|
console.log(`Nadpis '${header}' nalezen v souboru, nahrazuji obsah pod ním...`);
|
|
50
52
|
|
|
51
53
|
const parts = fileContent.split(header);
|
|
52
|
-
let newContent = parts[0] + header +
|
|
54
|
+
let newContent = parts[0] + header + "\n\n" + content;
|
|
53
55
|
|
|
54
56
|
fs.writeFileSync(fileName, newContent);
|
|
55
57
|
console.log(`Hotovo! Obsah pod nadpisem '${header}' byl nahrazen.`);
|
|
@@ -64,7 +66,7 @@ function processFile(content, fileName = "CLAUDE.md") {
|
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
module.exports =
|
|
69
|
+
module.exports = async function (url, fileName) {
|
|
68
70
|
console.log(`Stahuji obsah z ${url}...`);
|
|
69
71
|
|
|
70
72
|
try {
|
|
@@ -74,4 +76,4 @@ module.exports = async function(url, fileName) {
|
|
|
74
76
|
console.error(`Chyba: ${error.message}`);
|
|
75
77
|
process.exit(1);
|
|
76
78
|
}
|
|
77
|
-
}
|
|
79
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const { checkUxfDependencies } = require("./index");
|
|
2
|
+
const { argv } = require("process");
|
|
3
|
+
|
|
4
|
+
module.exports = async () => {
|
|
5
|
+
const cli = require("yargs")
|
|
6
|
+
.command("$0", "UXF Dependencies Check", (yargs) => {
|
|
7
|
+
yargs.demandCommand(0, 0).usage(`
|
|
8
|
+
Usage:
|
|
9
|
+
uxf-dependencies-check [options]`);
|
|
10
|
+
})
|
|
11
|
+
.option("e", {
|
|
12
|
+
alias: "exclude",
|
|
13
|
+
array: true,
|
|
14
|
+
default: [],
|
|
15
|
+
describe: "Seznam balíčků, které budou ignorovány",
|
|
16
|
+
})
|
|
17
|
+
.strict(false)
|
|
18
|
+
.exitProcess(false);
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
const { help, exclude } = cli.parse(argv.slice(2));
|
|
22
|
+
|
|
23
|
+
if (Boolean(help)) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
await checkUxfDependencies(new Set(exclude));
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.error(e);
|
|
30
|
+
return 1;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
const yarnLockPath = path.resolve(__dirname, "yarn.lock");
|
|
5
|
+
const packageJsonPath = path.resolve(__dirname, "package.json");
|
|
6
|
+
|
|
7
|
+
function parseLockFile() {
|
|
8
|
+
(async () => {
|
|
9
|
+
const YAML = await import("yaml");
|
|
10
|
+
|
|
11
|
+
const content = fs.readFileSync(yarnLockPath, "utf8");
|
|
12
|
+
return YAML.parse(content);
|
|
13
|
+
})();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function parsePackageJson() {
|
|
17
|
+
const content = fs.readFileSync(packageJsonPath, "utf8");
|
|
18
|
+
return JSON.parse(content);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function extractPackageName(key) {
|
|
22
|
+
const match = key.match(/^(@[^/]+\/[^@]+|[^@]+)@/);
|
|
23
|
+
return match ? match[1] : null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function findUxfPackagesInDependencies(lockData, packageJson) {
|
|
27
|
+
const declaredDependencies = new Set(Object.keys(packageJson.dependencies || {}));
|
|
28
|
+
|
|
29
|
+
const uxfPackages = [];
|
|
30
|
+
|
|
31
|
+
for (const key of Object.keys(lockData)) {
|
|
32
|
+
const name = extractPackageName(key);
|
|
33
|
+
if (name?.startsWith("@uxf/") && declaredDependencies.has(name)) {
|
|
34
|
+
uxfPackages.push(key);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return uxfPackages;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function collectDirectDependencies(packageKeys, lockData) {
|
|
42
|
+
const found = {};
|
|
43
|
+
|
|
44
|
+
for (const key of packageKeys) {
|
|
45
|
+
const entry = lockData[key];
|
|
46
|
+
if (!entry) continue;
|
|
47
|
+
|
|
48
|
+
const dependencies = entry.dependencies || {};
|
|
49
|
+
|
|
50
|
+
for (const depName in dependencies) {
|
|
51
|
+
const matchingKeys = Object.keys(lockData).filter((lockKey) => extractPackageName(lockKey) === depName);
|
|
52
|
+
|
|
53
|
+
for (const matchKey of matchingKeys) {
|
|
54
|
+
const depEntry = lockData[matchKey];
|
|
55
|
+
if (!depEntry || !depEntry.version) continue;
|
|
56
|
+
|
|
57
|
+
if (!found[depName]) {
|
|
58
|
+
found[depName] = new Set();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
found[depName].add(depEntry.version);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return found;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function checkMultipleVersions(dependencyMap, excludedPackages = new Set()) {
|
|
70
|
+
const conflicts = [];
|
|
71
|
+
|
|
72
|
+
for (const [name, versions] of Object.entries(dependencyMap)) {
|
|
73
|
+
if (excludedPackages.has(name)) continue;
|
|
74
|
+
if (versions.size > 1) {
|
|
75
|
+
conflicts.push({ name, versions: Array.from(versions) });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return conflicts;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function checkUxfDependencies(excludedPackages = new Set()) {
|
|
83
|
+
const lockData = await parseLockFile;
|
|
84
|
+
const packageJson = parsePackageJson();
|
|
85
|
+
|
|
86
|
+
const uxfPackages = findUxfPackagesInDependencies(lockData, packageJson);
|
|
87
|
+
const dependencies = collectDirectDependencies(uxfPackages, lockData);
|
|
88
|
+
|
|
89
|
+
const conflicts = checkMultipleVersions(dependencies, excludedPackages);
|
|
90
|
+
|
|
91
|
+
if (conflicts.length > 0) {
|
|
92
|
+
console.log("Následující balíčky mají více verzí v závislostech UXF balíčků:");
|
|
93
|
+
for (const { name, versions } of conflicts) {
|
|
94
|
+
console.log(`- ${name}: ${versions.join(", ")}`);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
console.log("Všechny závislosti UXF balíčků mají jednotnou verzi.");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = {
|
|
102
|
+
findUxfPackagesInDependencies,
|
|
103
|
+
collectDirectDependencies,
|
|
104
|
+
checkUxfDependencies,
|
|
105
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const { findUxfPackagesInDependencies, collectDirectDependencies } = require("./index"); // Adjust the path if needed
|
|
2
|
+
|
|
3
|
+
describe("findUxfPackagesInDependencies", () => {
|
|
4
|
+
const lockData = {
|
|
5
|
+
"@uxf/button@^1.0.0": {},
|
|
6
|
+
"@uxf/form@^2.1.0": {},
|
|
7
|
+
"react@^17.0.0": {},
|
|
8
|
+
"lodash@^4.17.0": {},
|
|
9
|
+
"classnames@^2.3.1": {},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const packageJson = {
|
|
13
|
+
dependencies: {
|
|
14
|
+
"@uxf/button": "^1.0.0",
|
|
15
|
+
"@uxf/form": "^2.1.0",
|
|
16
|
+
react: "^17.0.0",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
it("returns @uxf/* packages that are in package.json dependencies", () => {
|
|
21
|
+
const result = findUxfPackagesInDependencies(lockData, packageJson);
|
|
22
|
+
expect(result).toEqual(["@uxf/button@^1.0.0", "@uxf/form@^2.1.0"]);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("collectDirectDependencies", () => {
|
|
27
|
+
const lockData = {
|
|
28
|
+
"@uxf/button@^1.0.0": {
|
|
29
|
+
dependencies: {
|
|
30
|
+
react: "^17.0.0",
|
|
31
|
+
lodash: "^4.17.0",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
"@uxf/form@^2.1.0": {
|
|
35
|
+
dependencies: {
|
|
36
|
+
react: "^17.0.1", // different version range
|
|
37
|
+
classnames: "^2.3.1",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
"react@^17.0.0": {
|
|
41
|
+
version: "17.0.2",
|
|
42
|
+
},
|
|
43
|
+
"react@^17.0.1": {
|
|
44
|
+
version: "17.0.1",
|
|
45
|
+
},
|
|
46
|
+
"lodash@^4.17.0": {
|
|
47
|
+
version: "4.17.21",
|
|
48
|
+
},
|
|
49
|
+
"classnames@^2.3.1": {
|
|
50
|
+
version: "2.3.1",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const packageKeys = ["@uxf/button@^1.0.0", "@uxf/form@^2.1.0"];
|
|
55
|
+
|
|
56
|
+
it("collects direct dependencies of multiple UXF packages with shared and unique deps", () => {
|
|
57
|
+
const result = collectDirectDependencies(packageKeys, lockData);
|
|
58
|
+
|
|
59
|
+
expect(result).toEqual({
|
|
60
|
+
react: new Set(["17.0.2", "17.0.1"]),
|
|
61
|
+
lodash: new Set(["4.17.21"]),
|
|
62
|
+
classnames: new Set(["2.3.1"]),
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("handles empty dependencies gracefully", () => {
|
|
67
|
+
const lockData = {
|
|
68
|
+
"@uxf/empty@1.0.0": {},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const result = collectDirectDependencies(["@uxf/empty@1.0.0"], lockData);
|
|
72
|
+
expect(result).toEqual({});
|
|
73
|
+
});
|
|
74
|
+
});
|
package/src/uxf-lunch/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ const { argv, env } = require("process");
|
|
|
2
2
|
|
|
3
3
|
module.exports = async () => {
|
|
4
4
|
const cli = require("yargs")
|
|
5
|
-
.command("$0", "UXF release helper", yargs => {
|
|
5
|
+
.command("$0", "UXF release helper", (yargs) => {
|
|
6
6
|
yargs.demandCommand(0, 0).usage(`UXF lunch
|
|
7
7
|
Usage:
|
|
8
8
|
uxf-lunch [options]
|
package/src/uxf-lunch/index.js
CHANGED
|
@@ -4,10 +4,10 @@ const Slack = require("../Slack");
|
|
|
4
4
|
const numbers = [":keycap_star:", ":one:", ":two:", ":three:", ":four:", ":five:", ":six:", ":seven:"];
|
|
5
5
|
const paymentsUrl = "https://gitlab.uxf.cz/Vejvoda/obedy/-/wikis/%C4%8C%C3%ADsla-%C3%BA%C4%8Dt%C5%AF";
|
|
6
6
|
|
|
7
|
-
module.exports = async slackChannel => {
|
|
7
|
+
module.exports = async (slackChannel) => {
|
|
8
8
|
const { data } = await get("https://hotel.servispc-liberec.cz/server/api/data-jidelak");
|
|
9
9
|
|
|
10
|
-
const menu = data.ListekPolozky.filter(({ druh }) => druh === "1").map(v => ({
|
|
10
|
+
const menu = data.ListekPolozky.filter(({ druh }) => druh === "1").map((v) => ({
|
|
11
11
|
...v,
|
|
12
12
|
cena: Number.parseInt(v.cena),
|
|
13
13
|
}));
|
|
@@ -41,8 +41,7 @@ module.exports = async slackChannel => {
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
type: "mrkdwn",
|
|
44
|
-
text:
|
|
45
|
-
":bulb: Objednávky ideálně formou přidání reakce :keycap_star:, :one:, :two:, ... Ať objednávající nemusí sčítat :-)",
|
|
44
|
+
text: ":bulb: Objednávky ideálně formou přidání reakce :keycap_star:, :one:, :two:, ... Ať objednávající nemusí sčítat :-)",
|
|
46
45
|
},
|
|
47
46
|
],
|
|
48
47
|
});
|
|
@@ -30,7 +30,7 @@ function mapMergeRequests(mrs, projects) {
|
|
|
30
30
|
function getChatPostMessage(resultsCount, variant) {
|
|
31
31
|
switch (variant) {
|
|
32
32
|
case "CR":
|
|
33
|
-
return `🔥🔥🔥 ${inflect(resultsCount, "MR čekající na code review", "MR čekající na code review", "MR čekajících na code review"
|
|
33
|
+
return `🔥🔥🔥 ${inflect(resultsCount, "MR čekající na code review", "MR čekající na code review", "MR čekajících na code review")}`;
|
|
34
34
|
case "STALE":
|
|
35
35
|
return `❗❗❗ ${inflect(resultsCount, "MR starší než měsíc", "MR starší než měsíc", "MR starších než měsíc")}`;
|
|
36
36
|
}
|
|
@@ -52,7 +52,7 @@ module.exports = async function run(variant) {
|
|
|
52
52
|
result = result.filter((mr) => mr.reviewers.length === 0);
|
|
53
53
|
break;
|
|
54
54
|
case "STALE":
|
|
55
|
-
result = result.filter(mr => dayjs().diff(mr.updatedAt, "days") > 30);
|
|
55
|
+
result = result.filter((mr) => dayjs().diff(mr.updatedAt, "days") > 30);
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
58
|
|
package/src/uxf-release/index.js
CHANGED
|
@@ -85,39 +85,36 @@ function generateReleaseCommitMessage(commit) {
|
|
|
85
85
|
function generateMigrationWarning(migrationFiles = []) {
|
|
86
86
|
if (migrationFiles.length === 0) return "";
|
|
87
87
|
|
|
88
|
-
const migrations = migrationFiles.map(f => `- ${f}`).join(
|
|
89
|
-
return
|
|
90
|
-
`⚠️ VAROVÁNÍ: Součástí této verze jsou i změny v databázi.\n\n` +
|
|
91
|
-
`Seznam migrací:\n${migrations}\n`
|
|
92
|
-
);
|
|
88
|
+
const migrations = migrationFiles.map((f) => `- ${f}`).join("\n");
|
|
89
|
+
return `⚠️ VAROVÁNÍ: Součástí této verze jsou i změny v databázi.\n\n` + `Seznam migrací:\n${migrations}\n`;
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
module.exports = async (dryRun, channel, messageTitle) => {
|
|
96
93
|
const lastTag = await GitLab.getLastTag();
|
|
97
94
|
const commits = await GitLab.loadCommits(lastTag ? lastTag.commit.committed_date : null);
|
|
98
95
|
const migrationFiles = await GitLab.findMigrationFiles(commits);
|
|
99
|
-
|
|
96
|
+
|
|
100
97
|
const migrationWarning = generateMigrationWarning(migrationFiles);
|
|
101
|
-
|
|
98
|
+
|
|
102
99
|
// Add migration warning to Slack message if needed
|
|
103
100
|
const slackMessage = generateSlackMessage(commits, messageTitle);
|
|
104
101
|
if (migrationWarning) {
|
|
105
102
|
slackMessage.text = `${slackMessage.text}\n\n${migrationWarning}`;
|
|
106
103
|
}
|
|
107
|
-
|
|
104
|
+
|
|
108
105
|
await Slack.chatPostMessage(channel, { text: slackMessage.text }, dryRun);
|
|
109
|
-
|
|
106
|
+
|
|
110
107
|
// Add migration warning to Google Chat message if needed
|
|
111
108
|
const googleMessage = generateGoogleMessage(commits, messageTitle);
|
|
112
109
|
if (migrationWarning) {
|
|
113
110
|
googleMessage.text = `${googleMessage.text}\n\n${migrationWarning}`;
|
|
114
111
|
}
|
|
115
|
-
|
|
112
|
+
|
|
116
113
|
await GoogleChat.chatPostMessage(googleMessage, { dryRun });
|
|
117
|
-
|
|
114
|
+
|
|
118
115
|
// Add migration warning to release notes if needed
|
|
119
116
|
const releaseNotes = commits.map(generateReleaseCommitMessage).join("\n");
|
|
120
117
|
const fullReleaseNotes = migrationWarning + releaseNotes;
|
|
121
|
-
|
|
118
|
+
|
|
122
119
|
await GitLab.createRelease(fullReleaseNotes, dryRun);
|
|
123
|
-
};
|
|
120
|
+
};
|
|
@@ -57,9 +57,8 @@ function getUrlOrigin(url) {
|
|
|
57
57
|
function fetcher(url, options) {
|
|
58
58
|
const shouldUseBasicAuth = !options.isExternal && HTTP_USERNAME && HTTP_PASSWORD;
|
|
59
59
|
|
|
60
|
-
const headers =
|
|
61
|
-
"User-Agent":
|
|
62
|
-
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
|
|
60
|
+
const headers = {
|
|
61
|
+
"User-Agent": "got",
|
|
63
62
|
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
|
64
63
|
"Accept-Language": "en-US,en;q=0.9,cs-CZ;q=0.8,cs;q=0.7,de;q=0.6",
|
|
65
64
|
"Cache-Control": "no-cache",
|
|
@@ -74,7 +73,7 @@ function fetcher(url, options) {
|
|
|
74
73
|
"Sec-Fetch-Site": "cross-site",
|
|
75
74
|
"Sec-Fetch-User": "?1",
|
|
76
75
|
"Sec-Fetch-User-Agent": "?1",
|
|
77
|
-
}
|
|
76
|
+
};
|
|
78
77
|
|
|
79
78
|
return got(url, {
|
|
80
79
|
throwHttpErrors: false,
|
|
@@ -272,7 +271,7 @@ async function fetchUrl(url, webUrl, parentUrl = undefined, ttl = 1) {
|
|
|
272
271
|
try {
|
|
273
272
|
const response = await fetcher(url, { redirect: !!parentUrl, isExternal: !url.includes(webUrl) });
|
|
274
273
|
|
|
275
|
-
if (response.statusCode === 403 && response.headers["server"]
|
|
274
|
+
if (response.statusCode === 403 && ["cloudflare"].includes(response.headers["server"])) {
|
|
276
275
|
return {
|
|
277
276
|
url,
|
|
278
277
|
parentUrl,
|
|
@@ -2,7 +2,7 @@ const { argv, env } = require("process");
|
|
|
2
2
|
|
|
3
3
|
module.exports = async () => {
|
|
4
4
|
const cli = require("yargs")
|
|
5
|
-
.command("$0", "UXF sitemap meta exporter", yargs => {
|
|
5
|
+
.command("$0", "UXF sitemap meta exporter", (yargs) => {
|
|
6
6
|
yargs.demandCommand(0, 0).usage(`UXF sitemap meta exporter
|
|
7
7
|
Usage:
|
|
8
8
|
sitemap-meta-export [options]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const Sitemap = require("../Sitemap");
|
|
2
2
|
const cheerio = require("cheerio");
|
|
3
|
-
const fs = require(
|
|
3
|
+
const fs = require("fs");
|
|
4
4
|
|
|
5
5
|
module.exports = async function run() {
|
|
6
6
|
if (!process.env.SITEMAP_URL) {
|
|
@@ -12,7 +12,7 @@ module.exports = async function run() {
|
|
|
12
12
|
const urls = await Sitemap.getSitemap(process.env.SITEMAP_URL);
|
|
13
13
|
|
|
14
14
|
let i = 0;
|
|
15
|
-
const lines = [[
|
|
15
|
+
const lines = [["url", "title", "og:title", "description", "og:description"].join(";")];
|
|
16
16
|
|
|
17
17
|
for (const url of urls) {
|
|
18
18
|
process.stdout.write(`${++i} / ${urls.length} ${url} \n`);
|
|
@@ -21,34 +21,33 @@ module.exports = async function run() {
|
|
|
21
21
|
|
|
22
22
|
const $ = cheerio.load(response.data, { xmlMode: true, decodeEntities: false });
|
|
23
23
|
|
|
24
|
-
let title =
|
|
25
|
-
let ogTitle =
|
|
26
|
-
let description =
|
|
27
|
-
let ogDescription =
|
|
24
|
+
let title = "";
|
|
25
|
+
let ogTitle = "";
|
|
26
|
+
let description = "";
|
|
27
|
+
let ogDescription = "";
|
|
28
28
|
$('meta[property="og:title"]').each(function () {
|
|
29
|
-
|
|
30
|
-
ogTitle=$(this).attr('content');
|
|
29
|
+
ogTitle = $(this).attr("content");
|
|
31
30
|
});
|
|
32
31
|
$('meta[property="og:description"]').each(function () {
|
|
33
|
-
ogDescription
|
|
32
|
+
ogDescription = $(this).attr("content");
|
|
34
33
|
});
|
|
35
34
|
$('meta[name="description"]').each(function () {
|
|
36
|
-
description
|
|
35
|
+
description = $(this).attr("content");
|
|
37
36
|
});
|
|
38
|
-
$(
|
|
39
|
-
title
|
|
37
|
+
$("head title").each(function () {
|
|
38
|
+
title = $(this).html();
|
|
40
39
|
});
|
|
41
40
|
|
|
42
|
-
lines.push([url, title, ogTitle, description, ogDescription].join(
|
|
41
|
+
lines.push([url, title, ogTitle, description, ogDescription].join(";"));
|
|
43
42
|
} catch (e) {
|
|
44
43
|
console.log(e);
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
try {
|
|
49
|
-
fs.writeFileSync(
|
|
48
|
+
fs.writeFileSync("export.csv", lines.join("\n"));
|
|
50
49
|
} catch (e) {
|
|
51
|
-
console.log(
|
|
50
|
+
console.log("ERROR", e);
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
process.exit(0);
|