pr-checkmate 1.0.19 → 1.0.20

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/README.md CHANGED
@@ -10,6 +10,9 @@
10
10
  * ✅ Checks `package.json` / `package-lock.json` for dependency changes.
11
11
  * ✅ Spellcheck for code, documentation, and JSON files.
12
12
 
13
+ <br>
14
+ > ⚠️ **Note:** Currently, PR CheckMate only supports **Node.js projects**.
15
+
13
16
 
14
17
  ## 🛠 How It Works
15
18
  ### 1. Install
package/dist/init.js CHANGED
@@ -14,28 +14,55 @@ exports.CONFIG_FILE = path_1.default.resolve(process.cwd(), 'pr-checkmate.json')
14
14
  * Initialize pr-checkmate configuration file.
15
15
  */
16
16
  async function init() {
17
- if (fs_1.default.existsSync(exports.CONFIG_FILE)) {
17
+ if (!fs_1.default.existsSync(exports.CONFIG_FILE)) {
18
+ const answers = await inquirer_1.default.prompt([
19
+ {
20
+ type: 'list',
21
+ name: 'sourcePath',
22
+ message: 'Where is your project source code?',
23
+ choices: ['src', 'app', 'Enter manually'],
24
+ },
25
+ {
26
+ type: 'input',
27
+ name: 'manualPath',
28
+ message: 'Enter path:',
29
+ when: (a) => a.sourcePath === 'Enter manually',
30
+ validate: (input) => input.trim().length > 0 || 'Cannot be empty',
31
+ },
32
+ ]);
33
+ const config = {
34
+ sourcePath: answers.sourcePath === 'Enter manually' ? answers.manualPath : answers.sourcePath,
35
+ };
36
+ fs_1.default.writeFileSync(exports.CONFIG_FILE, JSON.stringify(config, null, 2));
37
+ utils_1.logger.info('✅ Created pr-checkmate.json');
38
+ }
39
+ else {
18
40
  utils_1.logger.info('⚡ pr-checkmate.json already exists.');
19
- return;
20
41
  }
21
- const answers = await inquirer_1.default.prompt([
22
- {
23
- type: 'list',
24
- name: 'sourcePath',
25
- message: 'Where is your project source code?',
26
- choices: ['src', 'app', 'Enter manually'],
27
- },
28
- {
29
- type: 'input',
30
- name: 'manualPath',
31
- message: 'Enter path:',
32
- when: (a) => a.sourcePath === 'Enter manually',
33
- validate: (input) => input.trim().length > 0 || 'Cannot be empty',
34
- },
35
- ]);
36
- const config = {
37
- sourcePath: answers.sourcePath === 'Enter manually' ? answers.manualPath : answers.sourcePath,
38
- };
39
- fs_1.default.writeFileSync(exports.CONFIG_FILE, JSON.stringify(config, null, 2));
40
- utils_1.logger.info('✅ Created pr-checkmate.json');
42
+ const root = process.cwd();
43
+ const tsconfigPath = path_1.default.join(root, 'tsconfig.json');
44
+ if (!fs_1.default.existsSync(tsconfigPath)) {
45
+ const defaultTsConfig = {
46
+ compilerOptions: {
47
+ target: 'ES2020',
48
+ module: 'NodeNext',
49
+ outDir: 'dist',
50
+ strict: true,
51
+ rootDir: 'src',
52
+ moduleResolution: 'NodeNext',
53
+ esModuleInterop: true,
54
+ resolveJsonModule: true,
55
+ forceConsistentCasingInFileNames: true,
56
+ skipLibCheck: true,
57
+ types: ['node'],
58
+ },
59
+ include: ['src/**/*.ts'],
60
+ exclude: ['node_modules', 'dist'],
61
+ };
62
+ fs_1.default.writeFileSync(tsconfigPath, JSON.stringify(defaultTsConfig, null, 2));
63
+ utils_1.logger.info('✅ Created default tsconfig.json');
64
+ }
65
+ else {
66
+ utils_1.logger.info('⚡ tsconfig.json already exists.');
67
+ }
41
68
  }
@@ -11,6 +11,7 @@ const configFiles = [
11
11
  { source: 'src/config/eslint.config.mjs', dest: 'eslint.config.mjs' },
12
12
  { source: 'src/config/.prettierrc', dest: '.prettierrc' },
13
13
  { source: 'src/config/cspell.json', dest: 'cspell.json' },
14
+ { source: 'tsconfig.json', dest: 'tsconfig.json' },
14
15
  ];
15
16
  function copyConfigs() {
16
17
  const root = node_path_1.default.resolve(__dirname, '../..'); // root of package
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-checkmate",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -23,6 +23,7 @@
23
23
  "eslint.config.mjs",
24
24
  ".prettierrc",
25
25
  "cspell.json",
26
+ "tsconfig.json",
26
27
  "LICENSE"
27
28
  ],
28
29
  "scripts": {
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "NodeNext",
5
+ "outDir": "dist",
6
+ "strict": true,
7
+ "rootDir": "src",
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "moduleResolution": "NodeNext",
11
+ "resolveJsonModule": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "types": ["node"]
14
+ },
15
+ "include": ["src/**/*.ts"],
16
+ "exclude": ["node_modules", "dist"]
17
+ }