pr-checkmate 1.0.13 â 1.0.17
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.
|
@@ -7,44 +7,26 @@ exports.copyConfigs = copyConfigs;
|
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
|
-
/**
|
|
11
|
-
* Safe way to detect package root even when running from dist/
|
|
12
|
-
*/
|
|
13
|
-
function findPackageRoot() {
|
|
14
|
-
let dir = __dirname;
|
|
15
|
-
while (!node_fs_1.default.existsSync(node_path_1.default.join(dir, 'package.json'))) {
|
|
16
|
-
const parent = node_path_1.default.resolve(dir, '..');
|
|
17
|
-
if (parent === dir)
|
|
18
|
-
break; // reached filesystem root
|
|
19
|
-
dir = parent;
|
|
20
|
-
}
|
|
21
|
-
return dir;
|
|
22
|
-
}
|
|
23
10
|
const configFiles = [
|
|
24
11
|
{ source: 'src/config/eslint.config.mjs', dest: 'eslint.config.mjs' },
|
|
25
12
|
{ source: 'src/config/.prettierrc', dest: '.prettierrc' },
|
|
26
13
|
{ source: 'src/config/cspell.json', dest: 'cspell.json' },
|
|
27
14
|
];
|
|
28
15
|
function copyConfigs() {
|
|
29
|
-
const root =
|
|
30
|
-
|
|
31
|
-
utils_1.logger.log('đŚ Copying configuration files...\n');
|
|
16
|
+
const root = node_path_1.default.resolve(__dirname, '../..'); // root of package
|
|
17
|
+
utils_1.logger.log('đŚ Copying config files to package root...\n');
|
|
32
18
|
configFiles.forEach(({ source, dest }) => {
|
|
33
19
|
const srcPath = node_path_1.default.join(root, source);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
node_fs_1.default.copyFileSync(srcPath, destDist);
|
|
39
|
-
utils_1.logger.log(`â
Copied: ${dest}`);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
utils_1.logger.warn(`â ď¸ Missing file: ${source}`);
|
|
20
|
+
const destPath = node_path_1.default.join(root, dest); // đĄ now root, not dist/
|
|
21
|
+
if (!node_fs_1.default.existsSync(srcPath)) {
|
|
22
|
+
utils_1.logger.warn(`â ď¸ Source not found: ${source}`);
|
|
23
|
+
return;
|
|
43
24
|
}
|
|
25
|
+
node_fs_1.default.copyFileSync(srcPath, destPath);
|
|
26
|
+
utils_1.logger.log(`â
Copied ${dest}`);
|
|
44
27
|
});
|
|
45
|
-
utils_1.logger.info('\nâ¨
|
|
28
|
+
utils_1.logger.info('\n⨠Configs successfully copied to root!\n');
|
|
46
29
|
}
|
|
47
|
-
// Execute if run directly
|
|
48
30
|
if (require.main === module) {
|
|
49
31
|
copyConfigs();
|
|
50
32
|
}
|
|
@@ -28,7 +28,7 @@ function cleanupTempIgnoreFile(filePath) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
catch (err) {
|
|
31
|
-
utils_1.logger.warn(`â ď¸ Failed to cleanup temp file: ${filePath}`);
|
|
31
|
+
utils_1.logger.warn(`â ď¸ Failed to cleanup temp file: ${filePath}\n${err}`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
async function runPrettier() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-checkmate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-actions",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"LICENSE"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
+
"copy-configs": "ts-node src/scripts/copy-configs.ts",
|
|
27
|
+
"build": "npm run clean && npm run copy-configs && tsc && chmod +x dist/cli.js",
|
|
26
28
|
"check": "npm run build && npm run lint && npm run prettier && npm run spellcheck",
|
|
27
|
-
"build": "npm run clean && tsc && npm run copy-configs && chmod +x dist/cli.js",
|
|
28
|
-
"copy-configs": "node dist/scripts/copy-configs.js",
|
|
29
29
|
"prepublishOnly": "npm run build",
|
|
30
30
|
"lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
|
|
31
31
|
"prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
|
package/dist/.prettierrc
DELETED
package/dist/cspell.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2",
|
|
3
|
-
"language": "en",
|
|
4
|
-
"words": [
|
|
5
|
-
"checkmate",
|
|
6
|
-
"eslint",
|
|
7
|
-
"prettier",
|
|
8
|
-
"cspell",
|
|
9
|
-
"typescript",
|
|
10
|
-
"execa",
|
|
11
|
-
"playwright",
|
|
12
|
-
"pytest"
|
|
13
|
-
],
|
|
14
|
-
"ignorePaths": [
|
|
15
|
-
"**/node_modules/**",
|
|
16
|
-
"**/dist/**",
|
|
17
|
-
"**/.git/**",
|
|
18
|
-
"**/build/**",
|
|
19
|
-
"**/coverage/**",
|
|
20
|
-
"**/.next/**",
|
|
21
|
-
"**/.nuxt/**",
|
|
22
|
-
"**/out/**",
|
|
23
|
-
"**/__pycache__/**",
|
|
24
|
-
"**/.pytest_cache/**",
|
|
25
|
-
"**/.venv/**",
|
|
26
|
-
"**/venv/**",
|
|
27
|
-
"**/package-lock.json",
|
|
28
|
-
"**/yarn.lock",
|
|
29
|
-
"**/pnpm-lock.yaml",
|
|
30
|
-
"**/*.min.js",
|
|
31
|
-
"**/*.min.css"
|
|
32
|
-
],
|
|
33
|
-
"enableFiletypes": ["typescript", "javascript", "markdown", "json"],
|
|
34
|
-
"ignoreRegExpList": ["/https?:\\/\\/[^\\s]+/g", "/\\b[0-9a-f]{7,40}\\b/gi"]
|
|
35
|
-
}
|
package/dist/eslint.config.mjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
2
|
-
import tsParser from '@typescript-eslint/parser';
|
|
3
|
-
import prettierPlugin from 'eslint-plugin-prettier';
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
{
|
|
7
|
-
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
8
|
-
ignores: [
|
|
9
|
-
'**/node_modules/**',
|
|
10
|
-
'**/dist/**',
|
|
11
|
-
'**/.git/**',
|
|
12
|
-
'**/build/**',
|
|
13
|
-
'**/coverage/**',
|
|
14
|
-
'**/.next/**',
|
|
15
|
-
'**/.nuxt/**',
|
|
16
|
-
'**/out/**',
|
|
17
|
-
],
|
|
18
|
-
languageOptions: {
|
|
19
|
-
parser: tsParser,
|
|
20
|
-
parserOptions: {
|
|
21
|
-
ecmaVersion: 2020,
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
project: './tsconfig.json',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
plugins: {
|
|
28
|
-
'@typescript-eslint': tsPlugin,
|
|
29
|
-
prettier: prettierPlugin,
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
rules: {
|
|
33
|
-
'no-console': 'warn',
|
|
34
|
-
'no-debugger': 'error',
|
|
35
|
-
'prefer-const': 'error',
|
|
36
|
-
eqeqeq: ['error', 'always'],
|
|
37
|
-
'@typescript-eslint/no-unused-vars': [
|
|
38
|
-
'error',
|
|
39
|
-
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
40
|
-
],
|
|
41
|
-
'@typescript-eslint/explicit-function-return-type': ['warn'],
|
|
42
|
-
'@typescript-eslint/no-explicit-any': ['warn'],
|
|
43
|
-
'@typescript-eslint/no-floating-promises': ['error'],
|
|
44
|
-
'space-before-function-paren': 'off',
|
|
45
|
-
'operator-linebreak': 'off',
|
|
46
|
-
'max-len': ['warn', { code: 100 }],
|
|
47
|
-
|
|
48
|
-
// Formatting / Style Rules
|
|
49
|
-
semi: ['error', 'always'],
|
|
50
|
-
quotes: ['error', 'single', { avoidEscape: true }],
|
|
51
|
-
'object-curly-spacing': ['error', 'always'],
|
|
52
|
-
'space-infix-ops': 'error',
|
|
53
|
-
'keyword-spacing': ['error', { before: true, after: true }],
|
|
54
|
-
'padding-line-between-statements': [
|
|
55
|
-
'error',
|
|
56
|
-
{ blankLine: 'always', prev: 'block', next: '*' },
|
|
57
|
-
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
58
|
-
],
|
|
59
|
-
|
|
60
|
-
// Prettier integration
|
|
61
|
-
'prettier/prettier': [
|
|
62
|
-
'error',
|
|
63
|
-
{
|
|
64
|
-
semi: true,
|
|
65
|
-
singleQuote: true,
|
|
66
|
-
bracketSpacing: true,
|
|
67
|
-
arrowParens: 'avoid',
|
|
68
|
-
printWidth: 100,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
];
|