mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-06-26 23:30:04 +00:00

- Optimize session creation to use timestamp naming by default without requiring modal input - Improve UI layout to display titles and descriptions more effectively in both list and detail views - Apply code formatting improvements across the codebase for better readability - Fix linting issues in scripts and component files
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
// commitlint.config.js
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
// read subdirectories of the directory
|
|
function getSubdirectories(dir) {
|
|
if (!fs.existsSync(dir)) return [];
|
|
|
|
return fs
|
|
.readdirSync(dir, {
|
|
withFileTypes: true,
|
|
})
|
|
.filter((dirent) => dirent.isDirectory())
|
|
.map((dirent) => dirent.name);
|
|
}
|
|
|
|
// get subdirectories of the directory
|
|
const appsScopes = getSubdirectories(path.join(__dirname, 'apps'));
|
|
const packagesScopes = getSubdirectories(path.join(__dirname, 'packages'));
|
|
|
|
// merge all scopes and remove duplicates
|
|
const allScopes = [
|
|
// basic scopes
|
|
'workflow',
|
|
'llm',
|
|
'playwright',
|
|
'puppeteer',
|
|
'mcp',
|
|
'blog',
|
|
'bridge',
|
|
'record',
|
|
// automatically added scopes
|
|
...appsScopes,
|
|
...packagesScopes,
|
|
];
|
|
|
|
// remove duplicates
|
|
const uniqueScopes = [...new Set(allScopes)];
|
|
|
|
module.exports = {
|
|
extends: ['@commitlint/config-conventional'],
|
|
rules: {
|
|
'scope-enum': [
|
|
2, // Level: Error
|
|
'always', // Apply rule always
|
|
uniqueScopes,
|
|
],
|
|
// Add rule to disallow empty scopes
|
|
'scope-empty': [2, 'never'],
|
|
},
|
|
};
|