pr-checkmate 1.0.10 → 1.0.13

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.
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // import fs from 'node:fs';
3
+ // import path from 'node:path';
4
+ // import { logger } from '../utils';
5
+ // interface ConfigFile {
6
+ // source: string;
7
+ // dest: string;
8
+ // }
9
+ // const configFiles: ConfigFile[] = [
10
+ // {
11
+ // source: 'src/config/eslint.config.mjs',
12
+ // dest: 'eslint.config.mjs',
13
+ // },
14
+ // {
15
+ // source: 'src/config/.prettierrc',
16
+ // dest: '.prettierrc',
17
+ // },
18
+ // {
19
+ // source: 'src/config/cspell.json',
20
+ // dest: 'cspell.json',
21
+ // },
22
+ // ];
23
+ // /**
24
+ // * Copy configuration files from src/config to dist/
25
+ // */
26
+ // function copyConfigs(): void {
27
+ // const projectRoot = path.resolve(__dirname, '../..');
28
+ // const distDir = path.join(projectRoot, 'dist');
29
+ // if (!fs.existsSync(distDir)) {
30
+ // fs.mkdirSync(distDir, { recursive: true });
31
+ // }
32
+ // logger.log('📦 Copying configuration files...\n');
33
+ // configFiles.forEach(({ source, dest }) => {
34
+ // const srcPath = path.join(projectRoot, source);
35
+ // const destPath = path.join(distDir, dest);
36
+ // if (fs.existsSync(srcPath)) {
37
+ // fs.copyFileSync(srcPath, destPath);
38
+ // logger.log(`✅ Copied ${dest}`);
39
+ // } else {
40
+ // logger.warn(`⚠️ File not found: ${source}`);
41
+ // }
42
+ // });
43
+ // logger.info('\n✨ Config files copied successfully!\n');
44
+ // }
45
+ // // Run if called directly
46
+ // if (require.main === module) {
47
+ // copyConfigs();
48
+ // }
49
+ // export { copyConfigs };
@@ -7,44 +7,44 @@ 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
- const configFiles = [
11
- {
12
- source: 'src/config/eslint.config.mjs',
13
- dest: 'eslint.config.mjs',
14
- },
15
- {
16
- source: 'src/config/.prettierrc',
17
- dest: '.prettierrc',
18
- },
19
- {
20
- source: 'src/config/cspell.json',
21
- dest: 'cspell.json',
22
- },
23
- ];
24
10
  /**
25
- * Copy configuration files from src/config to dist/
11
+ * Safe way to detect package root even when running from dist/
26
12
  */
27
- function copyConfigs() {
28
- const projectRoot = node_path_1.default.resolve(__dirname, '../..');
29
- const distDir = node_path_1.default.join(projectRoot, 'dist');
30
- if (!node_fs_1.default.existsSync(distDir)) {
31
- node_fs_1.default.mkdirSync(distDir, { recursive: true });
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;
32
20
  }
21
+ return dir;
22
+ }
23
+ const configFiles = [
24
+ { source: 'src/config/eslint.config.mjs', dest: 'eslint.config.mjs' },
25
+ { source: 'src/config/.prettierrc', dest: '.prettierrc' },
26
+ { source: 'src/config/cspell.json', dest: 'cspell.json' },
27
+ ];
28
+ function copyConfigs() {
29
+ const root = findPackageRoot();
30
+ const distDir = node_path_1.default.join(root, 'dist');
33
31
  utils_1.logger.log('📦 Copying configuration files...\n');
34
32
  configFiles.forEach(({ source, dest }) => {
35
- const srcPath = node_path_1.default.join(projectRoot, source);
36
- const destPath = node_path_1.default.join(distDir, dest);
33
+ const srcPath = node_path_1.default.join(root, source);
34
+ const destRoot = node_path_1.default.join(root, dest);
35
+ const destDist = node_path_1.default.join(distDir, dest);
37
36
  if (node_fs_1.default.existsSync(srcPath)) {
38
- node_fs_1.default.copyFileSync(srcPath, destPath);
39
- utils_1.logger.log(`✅ Copied ${dest}`);
37
+ node_fs_1.default.copyFileSync(srcPath, destRoot);
38
+ node_fs_1.default.copyFileSync(srcPath, destDist);
39
+ utils_1.logger.log(`✅ Copied: ${dest}`);
40
40
  }
41
41
  else {
42
- utils_1.logger.warn(`⚠️ File not found: ${source}`);
42
+ utils_1.logger.warn(`⚠️ Missing file: ${source}`);
43
43
  }
44
44
  });
45
- utils_1.logger.info('\n✨ Config files copied successfully!\n');
45
+ utils_1.logger.info('\n✨ Config files copied!\n');
46
46
  }
47
- // Run if called directly
47
+ // Execute if run directly
48
48
  if (require.main === module) {
49
49
  copyConfigs();
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-checkmate",
3
- "version": "1.0.10",
3
+ "version": "1.0.13",
4
4
  "description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -31,7 +31,8 @@
31
31
  "prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
32
32
  "spellcheck": "cspell '**/*.{ts,tsx,js,jsx,md,json}' --no-progress",
33
33
  "test": "echo 'Tests coming soon'",
34
- "clean": "rm -rf dist"
34
+ "clean": "rm -rf dist",
35
+ "release": "standard-version"
35
36
  },
36
37
  "engines": {
37
38
  "node": ">=18.0.0",
@@ -63,7 +64,8 @@
63
64
  "@typescript-eslint/parser": "^8.47.0",
64
65
  "eslint-config-prettier": "^9.1.2",
65
66
  "eslint-plugin-import": "^2.29.0",
66
- "eslint-plugin-prettier": "^5.5.4"
67
+ "eslint-plugin-prettier": "^5.5.4",
68
+ "standard-version": "^9.5.0"
67
69
  },
68
70
  "peerDependencies": {
69
71
  "eslint": ">=8.0.0",