@eldrforge/kodrdriv 0.0.33 → 0.0.37
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 +46 -69
- package/dist/application.js +146 -0
- package/dist/application.js.map +1 -0
- package/dist/arguments.js +22 -21
- package/dist/arguments.js.map +1 -1
- package/dist/commands/audio-commit.js +43 -21
- package/dist/commands/audio-commit.js.map +1 -1
- package/dist/commands/audio-review.js +46 -38
- package/dist/commands/audio-review.js.map +1 -1
- package/dist/commands/clean.js +28 -12
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/commit.js +132 -39
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/link.js +177 -159
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/publish-tree.js +19 -6
- package/dist/commands/publish-tree.js.map +1 -1
- package/dist/commands/publish.js +152 -82
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +21 -16
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/review.js +286 -60
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/select-audio.js +25 -8
- package/dist/commands/select-audio.js.map +1 -1
- package/dist/commands/unlink.js +349 -159
- package/dist/commands/unlink.js.map +1 -1
- package/dist/constants.js +14 -5
- package/dist/constants.js.map +1 -1
- package/dist/content/diff.js +7 -5
- package/dist/content/diff.js.map +1 -1
- package/dist/content/log.js +4 -1
- package/dist/content/log.js.map +1 -1
- package/dist/error/CancellationError.js +9 -0
- package/dist/error/CancellationError.js.map +1 -0
- package/dist/error/CommandErrors.js +120 -0
- package/dist/error/CommandErrors.js.map +1 -0
- package/dist/logging.js +55 -12
- package/dist/logging.js.map +1 -1
- package/dist/main.js +6 -131
- package/dist/main.js.map +1 -1
- package/dist/prompt/commit.js +4 -0
- package/dist/prompt/commit.js.map +1 -1
- package/dist/prompt/instructions/commit.md +33 -24
- package/dist/prompt/instructions/release.md +39 -5
- package/dist/prompt/release.js +41 -1
- package/dist/prompt/release.js.map +1 -1
- package/dist/types.js +9 -2
- package/dist/types.js.map +1 -1
- package/dist/util/github.js +71 -4
- package/dist/util/github.js.map +1 -1
- package/dist/util/npmOptimizations.js +174 -0
- package/dist/util/npmOptimizations.js.map +1 -0
- package/dist/util/openai.js +4 -2
- package/dist/util/openai.js.map +1 -1
- package/dist/util/performance.js +202 -0
- package/dist/util/performance.js.map +1 -0
- package/dist/util/safety.js +166 -0
- package/dist/util/safety.js.map +1 -0
- package/dist/util/storage.js +10 -0
- package/dist/util/storage.js.map +1 -1
- package/dist/util/validation.js +81 -0
- package/dist/util/validation.js.map +1 -0
- package/package.json +19 -18
- package/packages/components/package.json +4 -0
- package/packages/tools/package.json +4 -0
- package/packages/utils/package.json +4 -0
- package/scripts/pre-commit-hook.sh +52 -0
- package/test-project/package.json +1 -0
package/README.md
CHANGED
|
@@ -1,115 +1,92 @@
|
|
|
1
1
|
# KodrDriv
|
|
2
2
|
|
|
3
|
-
KodrDriv is
|
|
4
|
-
|
|
5
|
-
## What is KodrDriv?
|
|
6
|
-
|
|
7
|
-
KodrDriv is an AI-powered Git workflow automation tool designed to solve the common problem of writing meaningful commit messages and release notes. It provides a unified way to:
|
|
8
|
-
|
|
9
|
-
- **Generate intelligent commit messages** from your code changes
|
|
10
|
-
- **Create comprehensive release notes** automatically from Git history
|
|
11
|
-
- **Automate the entire release process** with pull request and GitHub integration
|
|
12
|
-
- **Manage workspace dependencies** for monorepo and multi-package development
|
|
13
|
-
- **Maintain consistent documentation** with minimal manual effort
|
|
3
|
+
KodrDriv is an AI-powered Git workflow automation tool that generates intelligent commit messages and release notes from your code changes. It analyzes your repository to create meaningful documentation while automating the entire release process.
|
|
14
4
|
|
|
15
5
|
## Why KodrDriv?
|
|
16
6
|
|
|
17
|
-
Writing good commit messages and release notes is time-consuming and often done when you're least in the mood for reflection. **KodrDriv was created specifically to solve the "context switch" problem that happens when you've been deep in code and Git asks you to summarize what you've done
|
|
18
|
-
|
|
19
|
-
Without KodrDriv, you need to manually:
|
|
20
|
-
- Stop your flow to write commit messages
|
|
21
|
-
- Remember all the changes you made across multiple files
|
|
22
|
-
- Craft meaningful release notes from scattered commit messages
|
|
23
|
-
- Coordinate complex release workflows with multiple steps
|
|
7
|
+
Writing good commit messages and release notes is time-consuming and often done when you're least in the mood for reflection. **KodrDriv was created specifically to solve the "context switch" problem** that happens when you've been deep in code and Git asks you to summarize what you've done.
|
|
24
8
|
|
|
25
9
|
KodrDriv reads your code changes and Git history to automatically generate contextual, meaningful documentation that reflects your actual work.
|
|
26
10
|
|
|
27
11
|
## Installation
|
|
28
12
|
|
|
29
|
-
Install KodrDriv globally using npm:
|
|
30
|
-
|
|
31
13
|
```bash
|
|
32
14
|
npm install -g @eldrforge/kodrdriv
|
|
33
15
|
```
|
|
34
16
|
|
|
35
|
-
This will make the `kodrdriv` command available globally on your system.
|
|
36
17
|
|
|
37
18
|
## Quick Start
|
|
38
19
|
|
|
39
|
-
Here's how to get started with KodrDriv:
|
|
40
|
-
|
|
41
20
|
### Generate a Commit Message
|
|
42
|
-
|
|
43
21
|
```bash
|
|
44
|
-
# Make some changes to your code
|
|
45
22
|
git add .
|
|
46
23
|
kodrdriv commit
|
|
47
24
|
```
|
|
48
25
|
|
|
49
26
|
### Generate Release Notes
|
|
50
|
-
|
|
51
27
|
```bash
|
|
52
|
-
# Generate release notes from your recent changes
|
|
53
28
|
kodrdriv release
|
|
54
29
|
```
|
|
55
30
|
|
|
56
31
|
### Automate Your Release Process
|
|
57
|
-
|
|
58
32
|
```bash
|
|
59
|
-
# Fully automated release with dependency updates, PR creation, and GitHub release
|
|
60
33
|
kodrdriv publish
|
|
61
34
|
```
|
|
62
35
|
|
|
63
|
-
###
|
|
64
|
-
|
|
36
|
+
### Audio-Driven Development
|
|
65
37
|
```bash
|
|
66
|
-
#
|
|
67
|
-
kodrdriv
|
|
38
|
+
kodrdriv select-audio # Configure microphone (one-time setup)
|
|
39
|
+
kodrdriv audio-commit # Record audio to generate commit messages
|
|
68
40
|
```
|
|
69
41
|
|
|
70
42
|
## Key Features
|
|
71
43
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
44
|
+
- **AI-Powered Analysis** - Uses OpenAI models to understand your code changes
|
|
45
|
+
- **Comprehensive Release Automation** - Handles dependency updates, version bumping, PR creation, and GitHub releases
|
|
46
|
+
- **Audio-Driven Workflows** - Record audio to provide context for commits and reviews
|
|
47
|
+
- **Intelligent Workspace Management** - Automatically discovers and links related packages in monorepos
|
|
48
|
+
- **Flexible Configuration** - Hierarchical configuration with command-line overrides
|
|
77
49
|
|
|
78
|
-
|
|
79
|
-
Automatically discovers and links related packages in monorepos and multi-package projects.
|
|
50
|
+
## Configuration
|
|
80
51
|
|
|
81
|
-
|
|
82
|
-
|
|
52
|
+
Set up your environment variables:
|
|
53
|
+
```bash
|
|
54
|
+
export OPENAI_API_KEY="your-openai-api-key"
|
|
55
|
+
export GITHUB_TOKEN="your-github-token" # Required for publish command
|
|
56
|
+
```
|
|
83
57
|
|
|
84
|
-
|
|
85
|
-
|
|
58
|
+
Initialize configuration files:
|
|
59
|
+
```bash
|
|
60
|
+
kodrdriv --init-config
|
|
61
|
+
kodrdriv --check-config
|
|
62
|
+
```
|
|
86
63
|
|
|
87
64
|
## Documentation
|
|
88
65
|
|
|
89
|
-
📚 **
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- [Commands](docs/public/commands.md) -
|
|
93
|
-
- [
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
66
|
+
📚 **Comprehensive Documentation**
|
|
67
|
+
|
|
68
|
+
### Commands
|
|
69
|
+
- **[All Commands Overview](docs/public/commands.md)** - Complete command reference with examples
|
|
70
|
+
- **[commit](docs/public/commands/commit.md)** - Generate intelligent commit messages
|
|
71
|
+
- **[audio-commit](docs/public/commands/audio-commit.md)** - Record audio for commit context
|
|
72
|
+
- **[review](docs/public/commands/review.md)** - Analyze review notes and create GitHub issues
|
|
73
|
+
- **[audio-review](docs/public/commands/audio-review.md)** - Record audio for review analysis
|
|
74
|
+
- **[release](docs/public/commands/release.md)** - Generate comprehensive release notes
|
|
75
|
+
- **[publish](docs/public/commands/publish.md)** - Automate the entire release process
|
|
76
|
+
- **[publish-tree](docs/public/commands/publish-tree.md)** - Manage multi-package workspace publishing
|
|
77
|
+
- **[link](docs/public/commands/link.md)** - Link local packages for development
|
|
78
|
+
- **[unlink](docs/public/commands/unlink.md)** - Remove workspace links
|
|
79
|
+
- **[clean](docs/public/commands/clean.md)** - Clean generated files
|
|
80
|
+
- **[select-audio](docs/public/commands/select-audio.md)** - Configure audio device
|
|
81
|
+
|
|
82
|
+
### Configuration & Customization
|
|
83
|
+
- **[Configuration](docs/public/configuration.md)** - All configuration options and environment variables
|
|
84
|
+
- **[Customization](docs/public/customization.md)** - Custom instructions, personas, and override structures
|
|
85
|
+
- **[Examples](docs/public/examples.md)** - Practical usage examples and common workflows
|
|
86
|
+
|
|
87
|
+
### Technical Details
|
|
88
|
+
- **[Architecture](docs/public/architecture.md)** - Technical architecture and design
|
|
89
|
+
- **[Assumptions](docs/public/assumptions.md)** - Development assumptions and conventions
|
|
113
90
|
|
|
114
91
|
## Contributing
|
|
115
92
|
|
|
@@ -121,4 +98,4 @@ Apache-2.0 - see [LICENSE](LICENSE) file for details.
|
|
|
121
98
|
|
|
122
99
|
## About the Name
|
|
123
100
|
|
|
124
|
-
Like Thor's hammer, this tool smashes through your repetitive coding tasks. But unlike Mjölnir, it won't make you worthy — it'll just make you faster. Strike through commits, forge releases, and channel the lightning of AI to automate your workflow. Because sometimes you need a hammer, and sometimes you need a tool that actually works. Pirate.
|
|
101
|
+
Like Thor's hammer, this tool smashes through your repetitive coding tasks. But unlike Mjölnir, it won't make you worthy — it'll just make you faster. Strike through commits, forge releases, and channel the lightning of AI to automate your workflow. Because sometimes you need a hammer, and sometimes you need a tool that actually works. Pirate.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as Cardigantime from '@theunwalked/cardigantime';
|
|
2
|
+
import 'dotenv/config';
|
|
3
|
+
import { configure } from './arguments.js';
|
|
4
|
+
import { execute as execute$1 } from './commands/audio-commit.js';
|
|
5
|
+
import { execute as execute$7 } from './commands/audio-review.js';
|
|
6
|
+
import { execute as execute$8 } from './commands/clean.js';
|
|
7
|
+
import { execute } from './commands/commit.js';
|
|
8
|
+
import { execute as execute$5 } from './commands/link.js';
|
|
9
|
+
import { execute as execute$3 } from './commands/publish.js';
|
|
10
|
+
import { execute as execute$4 } from './commands/publish-tree.js';
|
|
11
|
+
import { execute as execute$2 } from './commands/release.js';
|
|
12
|
+
import { execute as execute$9 } from './commands/review.js';
|
|
13
|
+
import { execute as execute$a } from './commands/select-audio.js';
|
|
14
|
+
import { execute as execute$6 } from './commands/unlink.js';
|
|
15
|
+
import { DEFAULT_CONFIG_DIR, COMMAND_CHECK_CONFIG, COMMAND_INIT_CONFIG, COMMAND_COMMIT, COMMAND_AUDIO_COMMIT, COMMAND_RELEASE, COMMAND_PUBLISH, COMMAND_PUBLISH_TREE, COMMAND_LINK, COMMAND_UNLINK, COMMAND_AUDIO_REVIEW, COMMAND_CLEAN, COMMAND_REVIEW, COMMAND_SELECT_AUDIO } from './constants.js';
|
|
16
|
+
import { getLogger, setLogLevel } from './logging.js';
|
|
17
|
+
import { ConfigSchema } from './types.js';
|
|
18
|
+
import { UserCancellationError } from './error/CommandErrors.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Configure early logging based on command line flags.
|
|
22
|
+
*
|
|
23
|
+
* Hey we need this because we need to be able to debug CardiganTime.
|
|
24
|
+
* This method checks for --verbose and --debug flags early in the process
|
|
25
|
+
* before CardiganTime is configured, allowing us to capture debug output
|
|
26
|
+
* from the CardiganTime initialization itself.
|
|
27
|
+
*/ function configureEarlyLogging() {
|
|
28
|
+
const hasVerbose = process.argv.includes('--verbose');
|
|
29
|
+
const hasDebug = process.argv.includes('--debug');
|
|
30
|
+
// Set log level based on early flag detection
|
|
31
|
+
if (hasDebug) {
|
|
32
|
+
setLogLevel('debug');
|
|
33
|
+
} else if (hasVerbose) {
|
|
34
|
+
setLogLevel('verbose');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function runApplication() {
|
|
38
|
+
// Configure logging early, before CardiganTime initialization
|
|
39
|
+
configureEarlyLogging();
|
|
40
|
+
// Cast create to `any` to avoid excessive type instantiation issues in TS compiler
|
|
41
|
+
const createCardigantime = Cardigantime.create;
|
|
42
|
+
const cardigantime = createCardigantime({
|
|
43
|
+
defaults: {
|
|
44
|
+
configDirectory: DEFAULT_CONFIG_DIR,
|
|
45
|
+
// Move pathResolution INSIDE defaults
|
|
46
|
+
pathResolution: {
|
|
47
|
+
resolvePathArray: [
|
|
48
|
+
'contextDirectories'
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
// Use fieldOverlaps instead of mergeStrategy, INSIDE defaults
|
|
52
|
+
fieldOverlaps: {
|
|
53
|
+
'contextDirectories': 'prepend'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
features: [
|
|
57
|
+
'config',
|
|
58
|
+
'hierarchical'
|
|
59
|
+
],
|
|
60
|
+
configShape: ConfigSchema.shape,
|
|
61
|
+
logger: getLogger()
|
|
62
|
+
}); // No need for 'as any' at the end
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
|
+
const [runConfig, secureConfig, commandConfig] = await configure(cardigantime); // Pass cardigantime instance
|
|
65
|
+
// Set log level based on verbose flag
|
|
66
|
+
if (runConfig.verbose) {
|
|
67
|
+
setLogLevel('verbose');
|
|
68
|
+
}
|
|
69
|
+
if (runConfig.debug) {
|
|
70
|
+
setLogLevel('debug');
|
|
71
|
+
}
|
|
72
|
+
const logger = getLogger();
|
|
73
|
+
cardigantime.setLogger(logger);
|
|
74
|
+
// Handle check-config command first
|
|
75
|
+
if (commandConfig.commandName === COMMAND_CHECK_CONFIG) {
|
|
76
|
+
// CardiganTime's checkConfig has already been called in Arguments.configure()
|
|
77
|
+
// No additional processing needed here
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Handle init-config command
|
|
81
|
+
if (commandConfig.commandName === COMMAND_INIT_CONFIG) {
|
|
82
|
+
// CardiganTime's initConfig has already been called in Arguments.configure()
|
|
83
|
+
// No additional processing needed here
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// Get the command from Commander
|
|
87
|
+
const command = process.argv[2];
|
|
88
|
+
let commandName = commandConfig.commandName;
|
|
89
|
+
// If we have a specific command argument, use that
|
|
90
|
+
if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'publish-tree' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio') {
|
|
91
|
+
commandName = command;
|
|
92
|
+
}
|
|
93
|
+
let summary = '';
|
|
94
|
+
try {
|
|
95
|
+
if (commandName === COMMAND_COMMIT) {
|
|
96
|
+
summary = await execute(runConfig);
|
|
97
|
+
} else if (commandName === COMMAND_AUDIO_COMMIT) {
|
|
98
|
+
summary = await execute$1(runConfig);
|
|
99
|
+
} else if (commandName === COMMAND_RELEASE) {
|
|
100
|
+
const releaseSummary = await execute$2(runConfig);
|
|
101
|
+
summary = `${releaseSummary.title}\n\n${releaseSummary.body}`;
|
|
102
|
+
} else if (commandName === COMMAND_PUBLISH) {
|
|
103
|
+
await execute$3(runConfig);
|
|
104
|
+
} else if (commandName === COMMAND_PUBLISH_TREE) {
|
|
105
|
+
var _runConfig_audioReview, _runConfig_publishTree, _runConfig_publishTree1;
|
|
106
|
+
// Handle publishTree directory mapping from command-specific arguments
|
|
107
|
+
if (((_runConfig_audioReview = runConfig.audioReview) === null || _runConfig_audioReview === void 0 ? void 0 : _runConfig_audioReview.directory) && !((_runConfig_publishTree = runConfig.publishTree) === null || _runConfig_publishTree === void 0 ? void 0 : _runConfig_publishTree.directory)) {
|
|
108
|
+
runConfig.publishTree = runConfig.publishTree || {};
|
|
109
|
+
runConfig.publishTree.directory = runConfig.audioReview.directory;
|
|
110
|
+
}
|
|
111
|
+
// Handle publishTree exclusion patterns - use global excludedPatterns for publish-tree
|
|
112
|
+
if (runConfig.excludedPatterns && !((_runConfig_publishTree1 = runConfig.publishTree) === null || _runConfig_publishTree1 === void 0 ? void 0 : _runConfig_publishTree1.excludedPatterns)) {
|
|
113
|
+
runConfig.publishTree = runConfig.publishTree || {};
|
|
114
|
+
runConfig.publishTree.excludedPatterns = runConfig.excludedPatterns;
|
|
115
|
+
}
|
|
116
|
+
summary = await execute$4(runConfig);
|
|
117
|
+
} else if (commandName === COMMAND_LINK) {
|
|
118
|
+
summary = await execute$5(runConfig);
|
|
119
|
+
} else if (commandName === COMMAND_UNLINK) {
|
|
120
|
+
summary = await execute$6(runConfig);
|
|
121
|
+
} else if (commandName === COMMAND_AUDIO_REVIEW) {
|
|
122
|
+
summary = await execute$7(runConfig);
|
|
123
|
+
} else if (commandName === COMMAND_CLEAN) {
|
|
124
|
+
await execute$8(runConfig);
|
|
125
|
+
summary = 'Output directory cleaned successfully.';
|
|
126
|
+
} else if (commandName === COMMAND_REVIEW) {
|
|
127
|
+
summary = await execute$9(runConfig);
|
|
128
|
+
} else if (commandName === COMMAND_SELECT_AUDIO) {
|
|
129
|
+
await execute$a(runConfig);
|
|
130
|
+
summary = 'Audio selection completed successfully.';
|
|
131
|
+
}
|
|
132
|
+
// eslint-disable-next-line no-console
|
|
133
|
+
console.log(`\n\n${summary}\n\n`);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
// Handle user cancellation gracefully
|
|
136
|
+
if (error instanceof UserCancellationError) {
|
|
137
|
+
logger.info(error.message);
|
|
138
|
+
process.exit(0);
|
|
139
|
+
}
|
|
140
|
+
// Re-throw other errors to be handled by main.ts
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { configureEarlyLogging, runApplication };
|
|
146
|
+
//# sourceMappingURL=application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.js","sources":["../src/application.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport 'dotenv/config';\nimport { CommandConfig } from 'types';\nimport * as Arguments from './arguments';\nimport * as AudioCommit from './commands/audio-commit';\nimport * as AudioReview from './commands/audio-review';\nimport * as Clean from './commands/clean';\nimport * as Commit from './commands/commit';\nimport * as Link from './commands/link';\nimport * as Publish from './commands/publish';\nimport * as PublishTree from './commands/publish-tree';\nimport * as Release from './commands/release';\nimport * as Review from './commands/review';\nimport * as SelectAudio from './commands/select-audio';\nimport * as Unlink from './commands/unlink';\nimport { COMMAND_AUDIO_COMMIT, COMMAND_AUDIO_REVIEW, COMMAND_CHECK_CONFIG, COMMAND_CLEAN, COMMAND_COMMIT, COMMAND_INIT_CONFIG, COMMAND_LINK, COMMAND_PUBLISH, COMMAND_PUBLISH_TREE, COMMAND_RELEASE, COMMAND_REVIEW, COMMAND_SELECT_AUDIO, COMMAND_UNLINK, DEFAULT_CONFIG_DIR } from './constants';\nimport { getLogger, setLogLevel } from './logging';\nimport { Config, ConfigSchema, SecureConfig } from './types';\nimport { UserCancellationError } from './error/CommandErrors';\n\n/**\n * Configure early logging based on command line flags.\n *\n * Hey we need this because we need to be able to debug CardiganTime.\n * This method checks for --verbose and --debug flags early in the process\n * before CardiganTime is configured, allowing us to capture debug output\n * from the CardiganTime initialization itself.\n */\nexport function configureEarlyLogging(): void {\n const hasVerbose = process.argv.includes('--verbose');\n const hasDebug = process.argv.includes('--debug');\n\n // Set log level based on early flag detection\n if (hasDebug) {\n setLogLevel('debug');\n } else if (hasVerbose) {\n setLogLevel('verbose');\n }\n}\n\nexport async function runApplication(): Promise<void> {\n // Configure logging early, before CardiganTime initialization\n configureEarlyLogging();\n\n // Cast create to `any` to avoid excessive type instantiation issues in TS compiler\n const createCardigantime: any = (Cardigantime as unknown as { create: unknown }).create as any;\n\n const cardigantime = createCardigantime({\n defaults: {\n configDirectory: DEFAULT_CONFIG_DIR,\n // Move pathResolution INSIDE defaults\n pathResolution: {\n resolvePathArray: ['contextDirectories'], // Resolve contextDirectories array elements as paths\n },\n // Use fieldOverlaps instead of mergeStrategy, INSIDE defaults\n fieldOverlaps: {\n 'contextDirectories': 'prepend', // Use prepend strategy for contextDirectories array\n // Add other field overlap configurations as needed\n },\n },\n features: ['config', 'hierarchical'],\n configShape: ConfigSchema.shape, // No need for 'as any' now\n logger: getLogger(),\n }); // No need for 'as any' at the end\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [runConfig, secureConfig, commandConfig]: [Config, SecureConfig, CommandConfig] = await Arguments.configure(cardigantime); // Pass cardigantime instance\n\n // Set log level based on verbose flag\n if (runConfig.verbose) {\n setLogLevel('verbose');\n }\n if (runConfig.debug) {\n setLogLevel('debug');\n }\n\n const logger = getLogger();\n cardigantime.setLogger(logger);\n\n // Handle check-config command first\n if (commandConfig.commandName === COMMAND_CHECK_CONFIG) {\n // CardiganTime's checkConfig has already been called in Arguments.configure()\n // No additional processing needed here\n return;\n }\n\n // Handle init-config command\n if (commandConfig.commandName === COMMAND_INIT_CONFIG) {\n // CardiganTime's initConfig has already been called in Arguments.configure()\n // No additional processing needed here\n return;\n }\n\n // Get the command from Commander\n const command = process.argv[2];\n let commandName = commandConfig.commandName;\n\n // If we have a specific command argument, use that\n if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'publish-tree' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio') {\n commandName = command;\n }\n\n let summary: string = '';\n\n try {\n if (commandName === COMMAND_COMMIT) {\n summary = await Commit.execute(runConfig);\n } else if (commandName === COMMAND_AUDIO_COMMIT) {\n summary = await AudioCommit.execute(runConfig);\n } else if (commandName === COMMAND_RELEASE) {\n const releaseSummary = await Release.execute(runConfig);\n summary = `${releaseSummary.title}\\n\\n${releaseSummary.body}`;\n } else if (commandName === COMMAND_PUBLISH) {\n await Publish.execute(runConfig);\n } else if (commandName === COMMAND_PUBLISH_TREE) {\n // Handle publishTree directory mapping from command-specific arguments\n if (runConfig.audioReview?.directory && !runConfig.publishTree?.directory) {\n runConfig.publishTree = runConfig.publishTree || {};\n runConfig.publishTree.directory = runConfig.audioReview.directory;\n }\n // Handle publishTree exclusion patterns - use global excludedPatterns for publish-tree\n if (runConfig.excludedPatterns && !runConfig.publishTree?.excludedPatterns) {\n runConfig.publishTree = runConfig.publishTree || {};\n runConfig.publishTree.excludedPatterns = runConfig.excludedPatterns;\n }\n summary = await PublishTree.execute(runConfig);\n } else if (commandName === COMMAND_LINK) {\n summary = await Link.execute(runConfig);\n } else if (commandName === COMMAND_UNLINK) {\n summary = await Unlink.execute(runConfig);\n } else if (commandName === COMMAND_AUDIO_REVIEW) {\n summary = await AudioReview.execute(runConfig);\n } else if (commandName === COMMAND_CLEAN) {\n await Clean.execute(runConfig);\n summary = 'Output directory cleaned successfully.';\n } else if (commandName === COMMAND_REVIEW) {\n summary = await Review.execute(runConfig);\n } else if (commandName === COMMAND_SELECT_AUDIO) {\n await SelectAudio.execute(runConfig);\n summary = 'Audio selection completed successfully.';\n }\n\n // eslint-disable-next-line no-console\n console.log(`\\n\\n${summary}\\n\\n`);\n } catch (error: any) {\n // Handle user cancellation gracefully\n if (error instanceof UserCancellationError) {\n logger.info(error.message);\n process.exit(0);\n }\n\n // Re-throw other errors to be handled by main.ts\n throw error;\n }\n}\n"],"names":["configureEarlyLogging","hasVerbose","process","argv","includes","hasDebug","setLogLevel","runApplication","createCardigantime","Cardigantime","create","cardigantime","defaults","configDirectory","DEFAULT_CONFIG_DIR","pathResolution","resolvePathArray","fieldOverlaps","features","configShape","ConfigSchema","shape","logger","getLogger","runConfig","secureConfig","commandConfig","Arguments","verbose","debug","setLogger","commandName","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","command","summary","COMMAND_COMMIT","Commit","COMMAND_AUDIO_COMMIT","AudioCommit","COMMAND_RELEASE","releaseSummary","Release","title","body","COMMAND_PUBLISH","Publish","COMMAND_PUBLISH_TREE","audioReview","directory","publishTree","excludedPatterns","PublishTree","COMMAND_LINK","Link","COMMAND_UNLINK","Unlink","COMMAND_AUDIO_REVIEW","AudioReview","COMMAND_CLEAN","Clean","COMMAND_REVIEW","Review","COMMAND_SELECT_AUDIO","SelectAudio","console","log","error","UserCancellationError","info","message","exit"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;AAOC,IACM,SAASA,qBAAAA,GAAAA;AACZ,IAAA,MAAMC,UAAAA,GAAaC,OAAAA,CAAQC,IAAI,CAACC,QAAQ,CAAC,WAAA,CAAA;AACzC,IAAA,MAAMC,QAAAA,GAAWH,OAAAA,CAAQC,IAAI,CAACC,QAAQ,CAAC,SAAA,CAAA;;AAGvC,IAAA,IAAIC,QAAAA,EAAU;QACVC,WAAAA,CAAY,OAAA,CAAA;AAChB,IAAA,CAAA,MAAO,IAAIL,UAAAA,EAAY;QACnBK,WAAAA,CAAY,SAAA,CAAA;AAChB,IAAA;AACJ;AAEO,eAAeC,cAAAA,GAAAA;;AAElBP,IAAAA,qBAAAA,EAAAA;;IAGA,MAAMQ,kBAAAA,GAA0B,YAACC,CAAgDC,MAAM;AAEvF,IAAA,MAAMC,eAAeH,kBAAAA,CAAmB;QACpCI,QAAAA,EAAU;YACNC,eAAAA,EAAiBC,kBAAAA;;YAEjBC,cAAAA,EAAgB;gBACZC,gBAAAA,EAAkB;AAAC,oBAAA;AAAqB;AAC5C,aAAA;;YAEAC,aAAAA,EAAe;gBACX,oBAAA,EAAsB;AAE1B;AACJ,SAAA;QACAC,QAAAA,EAAU;AAAC,YAAA,QAAA;AAAU,Y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A,MAAMJ,KAAAA;AACV,IAAA;AACJ;;;;"}
|
package/dist/arguments.js
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { PROGRAM_NAME, VERSION, KODRDRIV_DEFAULTS, ALLOWED_COMMANDS, DEFAULT_COMMAND } from './constants.js';
|
|
4
4
|
import { getLogger } from './logging.js';
|
|
5
5
|
import { create } from './util/storage.js';
|
|
6
|
+
import { safeJsonParse } from './util/validation.js';
|
|
6
7
|
import { readStdin } from './util/stdin.js';
|
|
7
8
|
|
|
8
9
|
z.object({
|
|
@@ -28,13 +29,13 @@ z.object({
|
|
|
28
29
|
note: z.string().optional(),
|
|
29
30
|
direction: z.string().optional(),
|
|
30
31
|
messageLimit: z.number().optional(),
|
|
32
|
+
skipFileCheck: z.boolean().optional(),
|
|
31
33
|
mergeMethod: z.enum([
|
|
32
34
|
'merge',
|
|
33
35
|
'squash',
|
|
34
36
|
'rebase'
|
|
35
37
|
]).optional(),
|
|
36
38
|
scopeRoots: z.string().optional(),
|
|
37
|
-
workspaceFile: z.string().optional(),
|
|
38
39
|
startFrom: z.string().optional(),
|
|
39
40
|
script: z.string().optional(),
|
|
40
41
|
cmd: z.string().optional(),
|
|
@@ -68,7 +69,7 @@ const transformCliArgs = (finalCliArgs)=>{
|
|
|
68
69
|
// Map preferencesDir (CLI) to preferencesDirectory (Config standard)
|
|
69
70
|
if (finalCliArgs.preferencesDir !== undefined) transformedCliArgs.preferencesDirectory = finalCliArgs.preferencesDir;
|
|
70
71
|
// Nested mappings for 'commit' options
|
|
71
|
-
if (finalCliArgs.cached !== undefined || finalCliArgs.sendit !== undefined || finalCliArgs.add !== undefined) {
|
|
72
|
+
if (finalCliArgs.cached !== undefined || finalCliArgs.sendit !== undefined || finalCliArgs.add !== undefined || finalCliArgs.skipFileCheck !== undefined) {
|
|
72
73
|
transformedCliArgs.commit = {};
|
|
73
74
|
if (finalCliArgs.add !== undefined) transformedCliArgs.commit.add = finalCliArgs.add;
|
|
74
75
|
if (finalCliArgs.cached !== undefined) transformedCliArgs.commit.cached = finalCliArgs.cached;
|
|
@@ -76,6 +77,7 @@ const transformCliArgs = (finalCliArgs)=>{
|
|
|
76
77
|
if (finalCliArgs.messageLimit !== undefined) transformedCliArgs.commit.messageLimit = finalCliArgs.messageLimit;
|
|
77
78
|
if (finalCliArgs.context !== undefined) transformedCliArgs.commit.context = finalCliArgs.context;
|
|
78
79
|
if (finalCliArgs.direction !== undefined) transformedCliArgs.commit.direction = finalCliArgs.direction;
|
|
80
|
+
if (finalCliArgs.skipFileCheck !== undefined) transformedCliArgs.commit.skipFileCheck = finalCliArgs.skipFileCheck;
|
|
79
81
|
}
|
|
80
82
|
// Nested mappings for 'audioCommit' options
|
|
81
83
|
if (finalCliArgs.file !== undefined || finalCliArgs.keepTemp !== undefined) {
|
|
@@ -97,16 +99,15 @@ const transformCliArgs = (finalCliArgs)=>{
|
|
|
97
99
|
if (finalCliArgs.mergeMethod !== undefined) transformedCliArgs.publish.mergeMethod = finalCliArgs.mergeMethod;
|
|
98
100
|
}
|
|
99
101
|
// Nested mappings for 'link' and 'unlink' options (both use the same configuration)
|
|
100
|
-
if (finalCliArgs.scopeRoots !== undefined
|
|
102
|
+
if (finalCliArgs.scopeRoots !== undefined) {
|
|
101
103
|
transformedCliArgs.link = {};
|
|
102
104
|
if (finalCliArgs.scopeRoots !== undefined) {
|
|
103
105
|
try {
|
|
104
|
-
transformedCliArgs.link.scopeRoots =
|
|
106
|
+
transformedCliArgs.link.scopeRoots = safeJsonParse(finalCliArgs.scopeRoots, 'scopeRoots CLI argument');
|
|
105
107
|
} catch (error) {
|
|
106
108
|
throw new Error(`Invalid JSON for scope-roots: ${finalCliArgs.scopeRoots}`);
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
|
-
if (finalCliArgs.workspaceFile !== undefined) transformedCliArgs.link.workspaceFile = finalCliArgs.workspaceFile;
|
|
110
111
|
}
|
|
111
112
|
// Nested mappings for 'audio-review' options
|
|
112
113
|
if (finalCliArgs.includeCommitHistory !== undefined || finalCliArgs.includeRecentDiffs !== undefined || finalCliArgs.includeReleaseNotes !== undefined || finalCliArgs.includeGithubIssues !== undefined || finalCliArgs.commitHistoryLimit !== undefined || finalCliArgs.diffHistoryLimit !== undefined || finalCliArgs.releaseNotesLimit !== undefined || finalCliArgs.githubIssuesLimit !== undefined || finalCliArgs.file !== undefined || finalCliArgs.directory !== undefined || finalCliArgs.keepTemp !== undefined) {
|
|
@@ -267,7 +268,7 @@ async function getCliConfig(program) {
|
|
|
267
268
|
// Add global options to the main program
|
|
268
269
|
// (cardigantime already adds most global options like --verbose, --debug, --config-dir)
|
|
269
270
|
// Add subcommands
|
|
270
|
-
const commitCommand = program.command('commit').argument('[direction]', 'direction or guidance for the commit message').description('Generate commit notes').option('--context <context>', 'context for the commit message').option('--cached', 'use cached diff').option('--add', 'add all changes before committing').option('--sendit', 'Commit with the message generated. No review.').option('--message-limit <messageLimit>', 'limit the number of messages to generate');
|
|
271
|
+
const commitCommand = program.command('commit').argument('[direction]', 'direction or guidance for the commit message').description('Generate commit notes').option('--context <context>', 'context for the commit message').option('--cached', 'use cached diff').option('--add', 'add all changes before committing').option('--sendit', 'Commit with the message generated. No review.').option('--message-limit <messageLimit>', 'limit the number of messages to generate').option('--skip-file-check', 'skip check for file: dependencies before committing');
|
|
271
272
|
// Add shared options to commit command
|
|
272
273
|
addSharedOptions(commitCommand);
|
|
273
274
|
// Customize help output for commit command
|
|
@@ -349,13 +350,13 @@ async function getCliConfig(program) {
|
|
|
349
350
|
addSharedOptions(releaseCommand);
|
|
350
351
|
const publishCommand = program.command('publish').option('--merge-method <method>', 'method to merge PR (merge, squash, rebase)', 'squash').option('--sendit', 'skip all confirmation prompts and proceed automatically').description('Publish a release');
|
|
351
352
|
addSharedOptions(publishCommand);
|
|
352
|
-
const publishTreeCommand = program.command('publish-tree').option('--directory <directory>', 'target directory containing multiple packages (defaults to current directory)').option('--start-from <startFrom>', 'resume build order from this package directory name (useful for restarting failed builds)').option('--script <script>', 'script command to execute in each package directory (e.g., "npm run build")').option('--cmd <cmd>', 'shell command to execute in each package directory (e.g., "git add -A")').option('--publish', 'execute kodrdriv publish command in each package directory').description('Analyze package dependencies in workspace and determine publish order');
|
|
353
|
+
const publishTreeCommand = program.command('publish-tree').option('--directory <directory>', 'target directory containing multiple packages (defaults to current directory)').option('--start-from <startFrom>', 'resume build order from this package directory name (useful for restarting failed builds)').option('--script <script>', 'script command to execute in each package directory (e.g., "npm run build")').option('--cmd <cmd>', 'shell command to execute in each package directory (e.g., "git add -A")').option('--publish', 'execute kodrdriv publish command in each package directory').option('--excluded-patterns [excludedPatterns...]', 'patterns to exclude packages from processing (e.g., "**/node_modules/**", "dist/*")').description('Analyze package dependencies in workspace and determine publish order');
|
|
353
354
|
addSharedOptions(publishTreeCommand);
|
|
354
|
-
const linkCommand = program.command('link').option('--scope-roots <scopeRoots>', 'JSON mapping of scopes to root directories (e.g., \'{"@company": "../"}\')').
|
|
355
|
+
const linkCommand = program.command('link').option('--scope-roots <scopeRoots>', 'JSON mapping of scopes to root directories (e.g., \'{"@company": "../"}\')').description('Create npm file: dependencies for local development');
|
|
355
356
|
addSharedOptions(linkCommand);
|
|
356
|
-
const unlinkCommand = program.command('unlink').option('--scope-roots <scopeRoots>', 'JSON mapping of scopes to root directories (e.g., \'{"@company": "../"}\')').
|
|
357
|
+
const unlinkCommand = program.command('unlink').option('--scope-roots <scopeRoots>', 'JSON mapping of scopes to root directories (e.g., \'{"@company": "../"}\')').description('Restore original dependencies and rebuild node_modules');
|
|
357
358
|
addSharedOptions(unlinkCommand);
|
|
358
|
-
const audioReviewCommand = program.command('audio-review').option('--include-commit-history', 'include recent commit log messages in context (default: true)').option('--no-include-commit-history', 'exclude commit log messages from context').option('--include-recent-diffs', 'include recent commit diffs in context (default: true)').option('--no-include-recent-diffs', 'exclude recent diffs from context').option('--include-release-notes', 'include recent release notes in context (default: false)').option('--no-include-release-notes', 'exclude release notes from context').option('--include-github-issues', 'include open GitHub issues in context (default: true)').option('--no-include-github-issues', 'exclude GitHub issues from context').option('--commit-history-limit <limit>', 'number of recent commits to include', parseInt).option('--diff-history-limit <limit>', 'number of recent commit diffs to include', parseInt).option('--release-notes-limit <limit>', 'number of recent release notes to include', parseInt).option('--github-issues-limit <limit>', 'number of open GitHub issues to include (max 20)', parseInt).option('--context <context>', 'additional context for the audio review').option('--file <file>', 'audio file path').option('--directory <directory>', 'directory containing audio files to process').description('Record audio, transcribe with Whisper, and analyze for project issues using AI');
|
|
359
|
+
const audioReviewCommand = program.command('audio-review').option('--include-commit-history', 'include recent commit log messages in context (default: true)').option('--no-include-commit-history', 'exclude commit log messages from context').option('--include-recent-diffs', 'include recent commit diffs in context (default: true)').option('--no-include-recent-diffs', 'exclude recent diffs from context').option('--include-release-notes', 'include recent release notes in context (default: false)').option('--no-include-release-notes', 'exclude release notes from context').option('--include-github-issues', 'include open GitHub issues in context (default: true)').option('--no-include-github-issues', 'exclude GitHub issues from context').option('--commit-history-limit <limit>', 'number of recent commits to include', parseInt).option('--diff-history-limit <limit>', 'number of recent commit diffs to include', parseInt).option('--release-notes-limit <limit>', 'number of recent release notes to include', parseInt).option('--github-issues-limit <limit>', 'number of open GitHub issues to include (max 20)', parseInt).option('--context <context>', 'additional context for the audio review').option('--file <file>', 'audio file path').option('--directory <directory>', 'directory containing audio files to process').option('--max-recording-time <time>', 'maximum recording time in seconds', parseInt).option('--sendit', 'Create GitHub issues automatically without confirmation').description('Record audio, transcribe with Whisper, and analyze for project issues using AI');
|
|
359
360
|
addSharedOptions(audioReviewCommand);
|
|
360
361
|
const reviewCommand = program.command('review').argument('[note]', 'review note to analyze for project issues').option('--include-commit-history', 'include recent commit log messages in context (default: true)').option('--no-include-commit-history', 'exclude commit log messages from context').option('--include-recent-diffs', 'include recent commit diffs in context (default: true)').option('--no-include-recent-diffs', 'exclude recent diffs from context').option('--include-release-notes', 'include recent release notes in context (default: false)').option('--no-include-release-notes', 'exclude release notes from context').option('--include-github-issues', 'include open GitHub issues in context (default: true)').option('--no-include-github-issues', 'exclude GitHub issues from context').option('--commit-history-limit <limit>', 'number of recent commits to include', parseInt).option('--diff-history-limit <limit>', 'number of recent commit diffs to include', parseInt).option('--release-notes-limit <limit>', 'number of recent release notes to include', parseInt).option('--github-issues-limit <limit>', 'number of open GitHub issues to include (max 20)', parseInt).option('--context <context>', 'additional context for the review').option('--sendit', 'Create GitHub issues automatically without confirmation').description('Analyze review note for project issues using AI');
|
|
361
362
|
addSharedOptions(reviewCommand);
|
|
@@ -568,10 +569,10 @@ async function validateAndProcessSecureOptions() {
|
|
|
568
569
|
}
|
|
569
570
|
// Renamed validation function to reflect its broader role
|
|
570
571
|
async function validateAndProcessOptions(options) {
|
|
571
|
-
var _options_commit, _options_commit1, _options_commit2, _options_commit3, _options_commit4, _options_commit5, _options_audioCommit, _options_audioCommit1, _options_audioCommit2, _options_audioCommit3, _options_release, _options_release1, _options_release2, _options_release3, _options_audioReview, _options_audioReview1, _options_audioReview2, _options_audioReview3, _options_audioReview4, _options_audioReview5, _options_audioReview6, _options_audioReview7, _options_audioReview8, _options_audioReview9, _options_audioReview10, _options_audioReview11, _options_audioReview12, _options_audioReview13, _options_audioReview14, _options_review, _options_review1, _options_review2, _options_review3, _options_review4, _options_review5, _options_review6, _options_review7, _options_review8, _options_review9, _options_review10, _options_publish, _options_publish1, _options_publish2, _options_publish3, _options_publish4, _options_publish5, _options_link, _options_link1,
|
|
572
|
+
var _options_commit, _options_commit1, _options_commit2, _options_commit3, _options_commit4, _options_commit5, _options_commit6, _options_audioCommit, _options_audioCommit1, _options_audioCommit2, _options_audioCommit3, _options_release, _options_release1, _options_release2, _options_release3, _options_audioReview, _options_audioReview1, _options_audioReview2, _options_audioReview3, _options_audioReview4, _options_audioReview5, _options_audioReview6, _options_audioReview7, _options_audioReview8, _options_audioReview9, _options_audioReview10, _options_audioReview11, _options_audioReview12, _options_audioReview13, _options_audioReview14, _options_review, _options_review1, _options_review2, _options_review3, _options_review4, _options_review5, _options_review6, _options_review7, _options_review8, _options_review9, _options_review10, _options_publish, _options_publish1, _options_publish2, _options_publish3, _options_publish4, _options_publish5, _options_link, _options_link1, _options_publishTree, _options_publishTree1, _options_publishTree2, _options_publishTree3, _options_publishTree4, _options_publishTree5;
|
|
572
573
|
const contextDirectories = await validateContextDirectories(options.contextDirectories || KODRDRIV_DEFAULTS.contextDirectories);
|
|
573
574
|
const configDir = options.configDirectory || KODRDRIV_DEFAULTS.configDirectory;
|
|
574
|
-
var _options_dryRun, _options_verbose, _options_debug, _options_overrides, _options_model, _options_outputDirectory, _options_preferencesDirectory, _options_discoveredConfigDirs, _options_resolvedConfigDirs, _options_commit_add, _options_commit_cached, _options_commit_sendit, _options_commit_messageLimit, _options_audioCommit_maxRecordingTime, _options_audioCommit_audioDevice, _options_release_from, _options_release_to, _options_release_messageLimit, _options_audioReview_includeCommitHistory, _options_audioReview_includeRecentDiffs, _options_audioReview_includeReleaseNotes, _options_audioReview_includeGithubIssues, _options_audioReview_commitHistoryLimit, _options_audioReview_diffHistoryLimit, _options_audioReview_releaseNotesLimit, _options_audioReview_githubIssuesLimit, _options_audioReview_sendit, _options_audioReview_maxRecordingTime, _options_audioReview_audioDevice, _options_review_includeCommitHistory, _options_review_includeRecentDiffs, _options_review_includeReleaseNotes, _options_review_includeGithubIssues, _options_review_commitHistoryLimit, _options_review_diffHistoryLimit, _options_review_releaseNotesLimit, _options_review_githubIssuesLimit, _options_review_sendit, _options_publish_mergeMethod, _options_publish_requiredEnvVars, _options_publish_linkWorkspacePackages, _options_publish_unlinkWorkspacePackages, _options_publish_sendit, _options_link_scopeRoots,
|
|
575
|
+
var _options_dryRun, _options_verbose, _options_debug, _options_overrides, _options_model, _options_outputDirectory, _options_preferencesDirectory, _options_discoveredConfigDirs, _options_resolvedConfigDirs, _options_commit_add, _options_commit_cached, _options_commit_sendit, _options_commit_messageLimit, _options_commit_skipFileCheck, _options_audioCommit_maxRecordingTime, _options_audioCommit_audioDevice, _options_release_from, _options_release_to, _options_release_messageLimit, _options_audioReview_includeCommitHistory, _options_audioReview_includeRecentDiffs, _options_audioReview_includeReleaseNotes, _options_audioReview_includeGithubIssues, _options_audioReview_commitHistoryLimit, _options_audioReview_diffHistoryLimit, _options_audioReview_releaseNotesLimit, _options_audioReview_githubIssuesLimit, _options_audioReview_sendit, _options_audioReview_maxRecordingTime, _options_audioReview_audioDevice, _options_review_includeCommitHistory, _options_review_includeRecentDiffs, _options_review_includeReleaseNotes, _options_review_includeGithubIssues, _options_review_commitHistoryLimit, _options_review_diffHistoryLimit, _options_review_releaseNotesLimit, _options_review_githubIssuesLimit, _options_review_sendit, _options_publish_mergeMethod, _options_publish_requiredEnvVars, _options_publish_linkWorkspacePackages, _options_publish_unlinkWorkspacePackages, _options_publish_sendit, _options_link_scopeRoots, _options_link_dryRun, _options_publishTree_directory, _options_publishTree_excludedPatterns, _options_publishTree_startFrom, _options_publishTree_script, _options_publishTree_cmd, _options_publishTree_publish, _options_excludedPatterns;
|
|
575
576
|
// Skip config directory validation since Cardigantime handles hierarchical lookup
|
|
576
577
|
// Ensure all required fields are present and have correct types after merging
|
|
577
578
|
const finalConfig = {
|
|
@@ -594,7 +595,8 @@ async function validateAndProcessOptions(options) {
|
|
|
594
595
|
sendit: (_options_commit_sendit = (_options_commit2 = options.commit) === null || _options_commit2 === void 0 ? void 0 : _options_commit2.sendit) !== null && _options_commit_sendit !== void 0 ? _options_commit_sendit : KODRDRIV_DEFAULTS.commit.sendit,
|
|
595
596
|
messageLimit: (_options_commit_messageLimit = (_options_commit3 = options.commit) === null || _options_commit3 === void 0 ? void 0 : _options_commit3.messageLimit) !== null && _options_commit_messageLimit !== void 0 ? _options_commit_messageLimit : KODRDRIV_DEFAULTS.commit.messageLimit,
|
|
596
597
|
context: (_options_commit4 = options.commit) === null || _options_commit4 === void 0 ? void 0 : _options_commit4.context,
|
|
597
|
-
direction: (_options_commit5 = options.commit) === null || _options_commit5 === void 0 ? void 0 : _options_commit5.direction
|
|
598
|
+
direction: (_options_commit5 = options.commit) === null || _options_commit5 === void 0 ? void 0 : _options_commit5.direction,
|
|
599
|
+
skipFileCheck: (_options_commit_skipFileCheck = (_options_commit6 = options.commit) === null || _options_commit6 === void 0 ? void 0 : _options_commit6.skipFileCheck) !== null && _options_commit_skipFileCheck !== void 0 ? _options_commit_skipFileCheck : KODRDRIV_DEFAULTS.commit.skipFileCheck
|
|
598
600
|
},
|
|
599
601
|
audioCommit: {
|
|
600
602
|
maxRecordingTime: (_options_audioCommit_maxRecordingTime = (_options_audioCommit = options.audioCommit) === null || _options_audioCommit === void 0 ? void 0 : _options_audioCommit.maxRecordingTime) !== null && _options_audioCommit_maxRecordingTime !== void 0 ? _options_audioCommit_maxRecordingTime : KODRDRIV_DEFAULTS.audioCommit.maxRecordingTime,
|
|
@@ -648,16 +650,15 @@ async function validateAndProcessOptions(options) {
|
|
|
648
650
|
},
|
|
649
651
|
link: {
|
|
650
652
|
scopeRoots: (_options_link_scopeRoots = (_options_link = options.link) === null || _options_link === void 0 ? void 0 : _options_link.scopeRoots) !== null && _options_link_scopeRoots !== void 0 ? _options_link_scopeRoots : KODRDRIV_DEFAULTS.link.scopeRoots,
|
|
651
|
-
|
|
652
|
-
dryRun: (_options_link_dryRun = (_options_link2 = options.link) === null || _options_link2 === void 0 ? void 0 : _options_link2.dryRun) !== null && _options_link_dryRun !== void 0 ? _options_link_dryRun : KODRDRIV_DEFAULTS.link.dryRun
|
|
653
|
+
dryRun: (_options_link_dryRun = (_options_link1 = options.link) === null || _options_link1 === void 0 ? void 0 : _options_link1.dryRun) !== null && _options_link_dryRun !== void 0 ? _options_link_dryRun : KODRDRIV_DEFAULTS.link.dryRun
|
|
653
654
|
},
|
|
654
655
|
publishTree: {
|
|
655
|
-
directory: (_options_publishTree = options.publishTree) === null || _options_publishTree === void 0 ? void 0 : _options_publishTree.directory,
|
|
656
|
-
excludedPatterns: (_options_publishTree1 = options.publishTree) === null || _options_publishTree1 === void 0 ? void 0 : _options_publishTree1.excludedPatterns,
|
|
657
|
-
startFrom: (_options_publishTree2 = options.publishTree) === null || _options_publishTree2 === void 0 ? void 0 : _options_publishTree2.startFrom,
|
|
658
|
-
script: (_options_publishTree3 = options.publishTree) === null || _options_publishTree3 === void 0 ? void 0 : _options_publishTree3.script,
|
|
659
|
-
cmd: (_options_publishTree4 = options.publishTree) === null || _options_publishTree4 === void 0 ? void 0 : _options_publishTree4.cmd,
|
|
660
|
-
publish: (_options_publishTree5 = options.publishTree) === null || _options_publishTree5 === void 0 ? void 0 : _options_publishTree5.publish
|
|
656
|
+
directory: (_options_publishTree_directory = (_options_publishTree = options.publishTree) === null || _options_publishTree === void 0 ? void 0 : _options_publishTree.directory) !== null && _options_publishTree_directory !== void 0 ? _options_publishTree_directory : KODRDRIV_DEFAULTS.publishTree.directory,
|
|
657
|
+
excludedPatterns: (_options_publishTree_excludedPatterns = (_options_publishTree1 = options.publishTree) === null || _options_publishTree1 === void 0 ? void 0 : _options_publishTree1.excludedPatterns) !== null && _options_publishTree_excludedPatterns !== void 0 ? _options_publishTree_excludedPatterns : KODRDRIV_DEFAULTS.publishTree.excludedPatterns,
|
|
658
|
+
startFrom: (_options_publishTree_startFrom = (_options_publishTree2 = options.publishTree) === null || _options_publishTree2 === void 0 ? void 0 : _options_publishTree2.startFrom) !== null && _options_publishTree_startFrom !== void 0 ? _options_publishTree_startFrom : KODRDRIV_DEFAULTS.publishTree.startFrom,
|
|
659
|
+
script: (_options_publishTree_script = (_options_publishTree3 = options.publishTree) === null || _options_publishTree3 === void 0 ? void 0 : _options_publishTree3.script) !== null && _options_publishTree_script !== void 0 ? _options_publishTree_script : KODRDRIV_DEFAULTS.publishTree.script,
|
|
660
|
+
cmd: (_options_publishTree_cmd = (_options_publishTree4 = options.publishTree) === null || _options_publishTree4 === void 0 ? void 0 : _options_publishTree4.cmd) !== null && _options_publishTree_cmd !== void 0 ? _options_publishTree_cmd : KODRDRIV_DEFAULTS.publishTree.cmd,
|
|
661
|
+
publish: (_options_publishTree_publish = (_options_publishTree5 = options.publishTree) === null || _options_publishTree5 === void 0 ? void 0 : _options_publishTree5.publish) !== null && _options_publishTree_publish !== void 0 ? _options_publishTree_publish : KODRDRIV_DEFAULTS.publishTree.publish
|
|
661
662
|
},
|
|
662
663
|
excludedPatterns: (_options_excludedPatterns = options.excludedPatterns) !== null && _options_excludedPatterns !== void 0 ? _options_excludedPatterns : KODRDRIV_DEFAULTS.excludedPatterns
|
|
663
664
|
};
|