@eldrforge/kodrdriv 1.2.7 → 1.2.8
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/.kodrdriv-example-branch-targeting.yaml +71 -0
- package/dist/application.js +7 -3
- package/dist/application.js.map +1 -1
- package/dist/arguments.js +47 -7
- package/dist/arguments.js.map +1 -1
- package/dist/commands/development.js +246 -227
- package/dist/commands/development.js.map +1 -1
- package/dist/commands/link.js +64 -4
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/publish.js +199 -47
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/tree.js +149 -7
- package/dist/commands/tree.js.map +1 -1
- package/dist/commands/updates.js +56 -0
- package/dist/commands/updates.js.map +1 -0
- package/dist/constants.js +27 -4
- package/dist/constants.js.map +1 -1
- package/dist/util/general.js +199 -2
- package/dist/util/general.js.map +1 -1
- package/dist/util/github.js +1 -107
- package/dist/util/github.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Example KodrDriv Configuration for Branch-Dependent Targeting
|
|
2
|
+
# This demonstrates how to set up automated CI/CD pipeline targeting
|
|
3
|
+
# Using the NEW branches configuration format
|
|
4
|
+
|
|
5
|
+
# Global settings
|
|
6
|
+
model: gpt-4o-mini
|
|
7
|
+
verbose: true
|
|
8
|
+
|
|
9
|
+
# Branch-dependent targeting configuration
|
|
10
|
+
branches:
|
|
11
|
+
working:
|
|
12
|
+
targetBranch: "development"
|
|
13
|
+
developmentBranch: true # Mark this as the active development branch
|
|
14
|
+
version:
|
|
15
|
+
type: "prerelease"
|
|
16
|
+
increment: true
|
|
17
|
+
incrementLevel: "patch" # Increment patch version when going back to working
|
|
18
|
+
tag: "dev"
|
|
19
|
+
|
|
20
|
+
development:
|
|
21
|
+
targetBranch: "test"
|
|
22
|
+
version:
|
|
23
|
+
type: "prerelease"
|
|
24
|
+
increment: false
|
|
25
|
+
tag: "development"
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
targetBranch: "main"
|
|
29
|
+
version:
|
|
30
|
+
type: "prerelease"
|
|
31
|
+
increment: false
|
|
32
|
+
tag: "test"
|
|
33
|
+
|
|
34
|
+
main:
|
|
35
|
+
version:
|
|
36
|
+
type: "release"
|
|
37
|
+
|
|
38
|
+
# Publish configuration (applies to all branches unless overridden by targets)
|
|
39
|
+
publish:
|
|
40
|
+
mergeMethod: "squash"
|
|
41
|
+
checksTimeout: 1800000 # 30 minutes for complex CI/CD workflows
|
|
42
|
+
waitForReleaseWorkflows: true
|
|
43
|
+
sendit: true # Auto-commit and merge without prompts
|
|
44
|
+
|
|
45
|
+
# Commit configuration
|
|
46
|
+
commit:
|
|
47
|
+
add: true
|
|
48
|
+
sendit: true
|
|
49
|
+
push: true
|
|
50
|
+
|
|
51
|
+
# Note: The 'development' command will automatically navigate to whichever
|
|
52
|
+
# branch is marked with 'developmentBranch: true' (in this case, 'working')
|
|
53
|
+
#
|
|
54
|
+
# Example workflow commands:
|
|
55
|
+
# kodrdriv tree checkout working # Switch entire workspace to working branch
|
|
56
|
+
# kodrdriv tree publish # Publish working → development
|
|
57
|
+
# kodrdriv tree checkout development # Switch to development to test
|
|
58
|
+
# kodrdriv tree publish # Publish development → test
|
|
59
|
+
# kodrdriv development # Back to working for more coding
|
|
60
|
+
|
|
61
|
+
# Optional: workspace linking for local development
|
|
62
|
+
link:
|
|
63
|
+
scopeRoots:
|
|
64
|
+
"@yourcompany": "../"
|
|
65
|
+
|
|
66
|
+
# File exclusions
|
|
67
|
+
excludedPatterns:
|
|
68
|
+
- node_modules
|
|
69
|
+
- dist
|
|
70
|
+
- "*.log"
|
|
71
|
+
- coverage
|
package/dist/application.js
CHANGED
|
@@ -13,8 +13,9 @@ import { execute as execute$9 } from './commands/review.js';
|
|
|
13
13
|
import { execute as execute$a } from './commands/select-audio.js';
|
|
14
14
|
import { execute as execute$4 } from './commands/tree.js';
|
|
15
15
|
import { execute as execute$6 } from './commands/unlink.js';
|
|
16
|
+
import { execute as execute$d } from './commands/updates.js';
|
|
16
17
|
import { execute as execute$c } from './commands/versions.js';
|
|
17
|
-
import { DEFAULT_CONFIG_DIR, VERSION, COMMAND_CHECK_CONFIG, COMMAND_INIT_CONFIG, COMMAND_COMMIT, COMMAND_AUDIO_COMMIT, COMMAND_RELEASE, COMMAND_PUBLISH, COMMAND_TREE, COMMAND_LINK, COMMAND_UNLINK, COMMAND_AUDIO_REVIEW, COMMAND_CLEAN, COMMAND_REVIEW, COMMAND_SELECT_AUDIO, COMMAND_DEVELOPMENT, COMMAND_VERSIONS } from './constants.js';
|
|
18
|
+
import { DEFAULT_CONFIG_DIR, VERSION, COMMAND_CHECK_CONFIG, COMMAND_INIT_CONFIG, COMMAND_COMMIT, COMMAND_AUDIO_COMMIT, COMMAND_RELEASE, COMMAND_PUBLISH, COMMAND_TREE, COMMAND_LINK, COMMAND_UNLINK, COMMAND_AUDIO_REVIEW, COMMAND_CLEAN, COMMAND_REVIEW, COMMAND_SELECT_AUDIO, COMMAND_DEVELOPMENT, COMMAND_VERSIONS, COMMAND_UPDATES } from './constants.js';
|
|
18
19
|
import { UserCancellationError } from './error/CommandErrors.js';
|
|
19
20
|
import { getLogger, setLogLevel } from './logging.js';
|
|
20
21
|
|
|
@@ -97,7 +98,8 @@ async function runApplication() {
|
|
|
97
98
|
'publish',
|
|
98
99
|
'link',
|
|
99
100
|
'unlink',
|
|
100
|
-
'development'
|
|
101
|
+
'development',
|
|
102
|
+
'updates'
|
|
101
103
|
];
|
|
102
104
|
if (supportedBuiltInCommands.includes(treeBuiltInCommand)) {
|
|
103
105
|
// This is a tree command with built-in command, keep commandName as 'tree'
|
|
@@ -106,7 +108,7 @@ async function runApplication() {
|
|
|
106
108
|
// Unknown tree argument, let it fail naturally in tree.ts
|
|
107
109
|
commandName = 'tree';
|
|
108
110
|
}
|
|
109
|
-
} else if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'tree' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio' || command === 'development' || command === 'versions') {
|
|
111
|
+
} else if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'tree' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio' || command === 'development' || command === 'versions' || command === 'updates') {
|
|
110
112
|
commandName = command;
|
|
111
113
|
}
|
|
112
114
|
let summary = '';
|
|
@@ -157,6 +159,8 @@ async function runApplication() {
|
|
|
157
159
|
summary = await execute$b(runConfig);
|
|
158
160
|
} else if (commandName === COMMAND_VERSIONS) {
|
|
159
161
|
summary = await execute$c(runConfig);
|
|
162
|
+
} else if (commandName === COMMAND_UPDATES) {
|
|
163
|
+
summary = await execute$d(runConfig);
|
|
160
164
|
}
|
|
161
165
|
// eslint-disable-next-line no-console
|
|
162
166
|
console.log(`\n\n${summary}\n\n`);
|
package/dist/application.js.map
CHANGED
|
@@ -1 +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 Development from './commands/development';\nimport * as Link from './commands/link';\nimport * as Publish from './commands/publish';\nimport * as Release from './commands/release';\nimport * as Review from './commands/review';\nimport * as SelectAudio from './commands/select-audio';\nimport * as Tree from './commands/tree';\nimport * as Unlink from './commands/unlink';\nimport * as Versions from './commands/versions';\nimport { COMMAND_AUDIO_COMMIT, COMMAND_AUDIO_REVIEW, COMMAND_CHECK_CONFIG, COMMAND_CLEAN, COMMAND_COMMIT, COMMAND_DEVELOPMENT, COMMAND_INIT_CONFIG, COMMAND_LINK, COMMAND_PUBLISH, COMMAND_RELEASE, COMMAND_REVIEW, COMMAND_SELECT_AUDIO, COMMAND_TREE, COMMAND_UNLINK, COMMAND_VERSIONS, DEFAULT_CONFIG_DIR, VERSION } from './constants';\nimport { UserCancellationError } from './error/CommandErrors';\nimport { getLogger, setLogLevel } from './logging';\nimport { Config, SecureConfig } from './types';\n\n/**\n * Print debug information about the command being executed when debug flag is enabled.\n */\nfunction printDebugCommandInfo(commandName: string, runConfig: Config): void {\n if (runConfig.debug) {\n const logger = getLogger();\n logger.info('=== KODRDRIV DEBUG INFO ===');\n logger.info('Command: %s', commandName);\n logger.info('Version: %s', VERSION);\n logger.info('===========================');\n }\n}\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 // Use proper typing for CardiganTime create function\n interface CardigantimeCreateParams {\n defaults?: any;\n features?: string[];\n configShape?: any;\n logger?: any;\n }\n\n interface CardigantimeInstance {\n read: (args: any) => Promise<any>;\n checkConfig: () => Promise<void>;\n generateConfig: (dir: string) => Promise<void>;\n setLogger: (logger: any) => void;\n }\n\n const cardigantimeModule = Cardigantime as any;\n const createCardigantime = cardigantimeModule.create as (params: CardigantimeCreateParams) => CardigantimeInstance;\n\n const cardigantime = createCardigantime({\n defaults: {\n configDirectory: DEFAULT_CONFIG_DIR,\n },\n features: ['config', 'hierarchical'],\n logger: getLogger(),\n });\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 // Display version information\n logger.info('🚀 kodrdriv %s', VERSION);\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 // Handle special case for tree command with built-in command argument\n if (command === 'tree' && process.argv[3]) {\n const treeBuiltInCommand = process.argv[3];\n const supportedBuiltInCommands = ['commit', 'publish', 'link', 'unlink', 'development'];\n if (supportedBuiltInCommands.includes(treeBuiltInCommand)) {\n // This is a tree command with built-in command, keep commandName as 'tree'\n commandName = 'tree';\n } else {\n // Unknown tree argument, let it fail naturally in tree.ts\n commandName = 'tree';\n }\n }\n // If we have a specific command argument, use that\n else if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'tree' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio' || command === 'development' || command === 'versions') {\n commandName = command;\n }\n\n let summary: string = '';\n\n try {\n // Print debug info at the start of command execution\n if (commandName) {\n printDebugCommandInfo(commandName, runConfig);\n }\n\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_TREE) {\n // Handle tree directories mapping from command-specific arguments\n if (runConfig.audioReview?.directory && !runConfig.tree?.directories) {\n runConfig.tree = runConfig.tree || {};\n runConfig.tree.directories = [runConfig.audioReview.directory];\n }\n // Handle tree exclusion patterns - use global excludedPatterns for tree\n if (runConfig.excludedPatterns && !runConfig.tree?.exclude) {\n runConfig.tree = runConfig.tree || {};\n runConfig.tree.exclude = runConfig.excludedPatterns;\n }\n summary = await Tree.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 } else if (commandName === COMMAND_DEVELOPMENT) {\n summary = await Development.execute(runConfig);\n } else if (commandName === COMMAND_VERSIONS) {\n summary = await Versions.execute(runConfig);\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":["printDebugCommandInfo","commandName","runConfig","debug","logger","getLogger","info","VERSION","configureEarlyLogging","hasVerbose","process","argv","includes","hasDebug","setLogLevel","runApplication","cardigantimeModule","Cardigantime","createCardigantime","create","cardigantime","defaults","configDirectory","DEFAULT_CONFIG_DIR","features","secureConfig","commandConfig","Arguments","verbose","setLogger","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","command","treeBuiltInCommand","supportedBuiltInCommands","summary","COMMAND_COMMIT","Commit","COMMAND_AUDIO_COMMIT","AudioCommit","COMMAND_RELEASE","releaseSummary","Release","title","body","COMMAND_PUBLISH","Publish","COMMAND_TREE","audioReview","directory","tree","directories","excludedPatterns","exclude","Tree","COMMAND_LINK","Link","COMMAND_UNLINK","Unlink","COMMAND_AUDIO_REVIEW","AudioReview","COMMAND_CLEAN","Clean","COMMAND_REVIEW","Review","COMMAND_SELECT_AUDIO","SelectAudio","COMMAND_DEVELOPMENT","Development","COMMAND_VERSIONS","Versions","console","log","error","UserCancellationError","message","exit"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA;;AAEC,IACD,SAASA,qBAAAA,CAAsBC,WAAmB,EAAEC,SAAiB,EAAA;IACjE,IAAIA,SAAAA,CAAUC,KAAK,EAAE;AACjB,QAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AACfD,QAAAA,MAAAA,CAAOE,IAAI,CAAC,6BAAA,CAAA;QACZF,MAAAA,CAAOE,IAAI,CAAC,aAAA,EAAeL,WAAAA,CAAAA;QAC3BG,MAAAA,CAAOE,IAAI,CAAC,aAAA,EAAeC,OAAAA,CAAAA;AAC3BH,QAAAA,MAAAA,CAAOE,IAAI,CAAC,6BAAA,CAAA;AAChB,IAAA;AACJ;AAEA;;;;;;;AAOC,IACM,SAASE,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;AAiBA,IAAA,MAAMQ,kBAAAA,GAAqBC,YAAAA;IAC3B,MAAMC,kBAAAA,GAAqB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AAMuB,SAAc,CAACxD,SAAAA,CAAAA;QACnC,CAAA,MAAO,IAAID,gBAAgB0D,oBAAAA,EAAsB;YAC7CxB,OAAAA,GAAU,MAAMyB,SAAmB,CAAC1D,SAAAA,CAAAA;QACxC,CAAA,MAAO,IAAID,gBAAgB4D,aAAAA,EAAe;YACtC,MAAMC,SAAa,CAAC5D,SAAAA,CAAAA;YACpBiC,OAAAA,GAAU,wCAAA;QACd,CAAA,MAAO,IAAIlC,gBAAgB8D,cAAAA,EAAgB;YACvC5B,OAAAA,GAAU,MAAM6B,SAAc,CAAC9D,SAAAA,CAAAA;QACnC,CAAA,MAAO,IAAID,gBAAgBgE,oBAAAA,EAAsB;YAC7C,MAAMC,SAAmB,CAAChE,SAAAA,CAAAA;YAC1BiC,OAAAA,GAAU,yCAAA;QACd,CAAA,MAAO,IAAIlC,gBAAgBkE,mBAAAA,EAAqB;YAC5ChC,OAAAA,GAAU,MAAMiC,SAAmB,CAAClE,SAAAA,CAAAA;QACxC,CAAA,MAAO,IAAID,gBAAgBoE,gBAAAA,EAAkB;YACzClC,OAAAA,GAAU,MAAMmC,SAAgB,CAACpE,SAAAA,CAAAA;AACrC,QAAA;;AAGAqE,QAAAA,OAAAA,CAAQC,GAAG,CAAC,CAAC,IAAI,EAAErC,OAAAA,CAAQ,IAAI,CAAC,CAAA;AACpC,IAAA,CAAA,CAAE,OAAOsC,KAAAA,EAAY;;AAEjB,QAAA,IAAIA,iBAAiBC,qBAAAA,EAAuB;YACxCtE,MAAAA,CAAOE,IAAI,CAACmE,KAAAA,CAAME,OAAO,CAAA;AACzBjE,YAAAA,OAAAA,CAAQkE,IAAI,CAAC,CAAA,CAAA;AACjB,QAAA;;QAGA,MAAMH,KAAAA;AACV,IAAA;AACJ;;;;"}
|
|
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 Development from './commands/development';\nimport * as Link from './commands/link';\nimport * as Publish from './commands/publish';\nimport * as Release from './commands/release';\nimport * as Review from './commands/review';\nimport * as SelectAudio from './commands/select-audio';\nimport * as Tree from './commands/tree';\nimport * as Unlink from './commands/unlink';\nimport * as Updates from './commands/updates';\nimport * as Versions from './commands/versions';\nimport { COMMAND_AUDIO_COMMIT, COMMAND_AUDIO_REVIEW, COMMAND_CHECK_CONFIG, COMMAND_CLEAN, COMMAND_COMMIT, COMMAND_DEVELOPMENT, COMMAND_INIT_CONFIG, COMMAND_LINK, COMMAND_PUBLISH, COMMAND_RELEASE, COMMAND_REVIEW, COMMAND_SELECT_AUDIO, COMMAND_TREE, COMMAND_UNLINK, COMMAND_UPDATES, COMMAND_VERSIONS, DEFAULT_CONFIG_DIR, VERSION } from './constants';\nimport { UserCancellationError } from './error/CommandErrors';\nimport { getLogger, setLogLevel } from './logging';\nimport { Config, SecureConfig } from './types';\n\n/**\n * Print debug information about the command being executed when debug flag is enabled.\n */\nfunction printDebugCommandInfo(commandName: string, runConfig: Config): void {\n if (runConfig.debug) {\n const logger = getLogger();\n logger.info('=== KODRDRIV DEBUG INFO ===');\n logger.info('Command: %s', commandName);\n logger.info('Version: %s', VERSION);\n logger.info('===========================');\n }\n}\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 // Use proper typing for CardiganTime create function\n interface CardigantimeCreateParams {\n defaults?: any;\n features?: string[];\n configShape?: any;\n logger?: any;\n }\n\n interface CardigantimeInstance {\n read: (args: any) => Promise<any>;\n checkConfig: () => Promise<void>;\n generateConfig: (dir: string) => Promise<void>;\n setLogger: (logger: any) => void;\n }\n\n const cardigantimeModule = Cardigantime as any;\n const createCardigantime = cardigantimeModule.create as (params: CardigantimeCreateParams) => CardigantimeInstance;\n\n const cardigantime = createCardigantime({\n defaults: {\n configDirectory: DEFAULT_CONFIG_DIR,\n },\n features: ['config', 'hierarchical'],\n logger: getLogger(),\n });\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 // Display version information\n logger.info('🚀 kodrdriv %s', VERSION);\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 // Handle special case for tree command with built-in command argument\n if (command === 'tree' && process.argv[3]) {\n const treeBuiltInCommand = process.argv[3];\n const supportedBuiltInCommands = ['commit', 'publish', 'link', 'unlink', 'development', 'updates'];\n if (supportedBuiltInCommands.includes(treeBuiltInCommand)) {\n // This is a tree command with built-in command, keep commandName as 'tree'\n commandName = 'tree';\n } else {\n // Unknown tree argument, let it fail naturally in tree.ts\n commandName = 'tree';\n }\n }\n // If we have a specific command argument, use that\n else if (command === 'commit' || command === 'audio-commit' || command === 'release' || command === 'publish' || command === 'tree' || command === 'link' || command === 'unlink' || command === 'audio-review' || command === 'clean' || command === 'review' || command === 'select-audio' || command === 'development' || command === 'versions' || command === 'updates') {\n commandName = command;\n }\n\n let summary: string = '';\n\n try {\n // Print debug info at the start of command execution\n if (commandName) {\n printDebugCommandInfo(commandName, runConfig);\n }\n\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_TREE) {\n // Handle tree directories mapping from command-specific arguments\n if (runConfig.audioReview?.directory && !runConfig.tree?.directories) {\n runConfig.tree = runConfig.tree || {};\n runConfig.tree.directories = [runConfig.audioReview.directory];\n }\n // Handle tree exclusion patterns - use global excludedPatterns for tree\n if (runConfig.excludedPatterns && !runConfig.tree?.exclude) {\n runConfig.tree = runConfig.tree || {};\n runConfig.tree.exclude = runConfig.excludedPatterns;\n }\n summary = await Tree.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 } else if (commandName === COMMAND_DEVELOPMENT) {\n summary = await Development.execute(runConfig);\n } else if (commandName === COMMAND_VERSIONS) {\n summary = await Versions.execute(runConfig);\n } else if (commandName === COMMAND_UPDATES) {\n summary = await Updates.execute(runConfig);\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":["printDebugCommandInfo","commandName","runConfig","debug","logger","getLogger","info","VERSION","configureEarlyLogging","hasVerbose","process","argv","includes","hasDebug","setLogLevel","runApplication","cardigantimeModule","Cardigantime","createCardigantime","create","cardigantime","defaults","configDirectory","DEFAULT_CONFIG_DIR","features","secureConfig","commandConfig","Arguments","verbose","setLogger","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","command","treeBuiltInCommand","supportedBuiltInCommands","summary","COMMAND_COMMIT","Commit","COMMAND_AUDIO_COMMIT","AudioCommit","COMMAND_RELEASE","releaseSummary","Release","title","body","COMMAND_PUBLISH","Publish","COMMAND_TREE","audioReview","directory","tree","directories","excludedPatterns","exclude","Tree","COMMAND_LINK","Link","COMMAND_UNLINK","Unlink","COMMAND_AUDIO_REVIEW","AudioReview","COMMAND_CLEAN","Clean","COMMAND_REVIEW","Review","COMMAND_SELECT_AUDIO","SelectAudio","COMMAND_DEVELOPMENT","Development","COMMAND_VERSIONS","Versions","COMMAND_UPDATES","Updates","console","log","error","UserCancellationError","message","exit"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA;;AAEC,IACD,SAASA,qBAAAA,CAAsBC,WAAmB,EAAEC,SAAiB,EAAA;IACjE,IAAIA,SAAAA,CAAUC,KAAK,EAAE;AACjB,QAAA,MAAMC,MAAAA,GAASC,SAAAA,EAAAA;AACfD,QAAAA,MAAAA,CAAOE,IAAI,CAAC,6BAAA,CAAA;QACZF,MAAAA,CAAOE,IAAI,CAAC,aAAA,EAAeL,WAAAA,CAAAA;QAC3BG,MAAAA,CAAOE,IAAI,CAAC,a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AAAA,GAAU,MAAMiC,SAAmB,CAAClE,SAAAA,CAAAA;QACxC,CAAA,MAAO,IAAID,gBAAgBoE,gBAAAA,EAAkB;YACzClC,OAAAA,GAAU,MAAMmC,SAAgB,CAACpE,SAAAA,CAAAA;QACrC,CAAA,MAAO,IAAID,gBAAgBsE,eAAAA,EAAiB;YACxCpC,OAAAA,GAAU,MAAMqC,SAAe,CAACtE,SAAAA,CAAAA;AACpC,QAAA;;AAGAuE,QAAAA,OAAAA,CAAQC,GAAG,CAAC,CAAC,IAAI,EAAEvC,OAAAA,CAAQ,IAAI,CAAC,CAAA;AACpC,IAAA,CAAA,CAAE,OAAOwC,KAAAA,EAAY;;AAEjB,QAAA,IAAIA,iBAAiBC,qBAAAA,EAAuB;YACxCxE,MAAAA,CAAOE,IAAI,CAACqE,KAAAA,CAAME,OAAO,CAAA;AACzBnE,YAAAA,OAAAA,CAAQoE,IAAI,CAAC,CAAA,CAAA;AACjB,QAAA;;QAGA,MAAMH,KAAAA;AACV,IAAA;AACJ;;;;"}
|
package/dist/arguments.js
CHANGED
|
@@ -74,7 +74,8 @@ z.object({
|
|
|
74
74
|
externals: z.array(z.string()).optional(),
|
|
75
75
|
keepTemp: z.boolean().optional(),
|
|
76
76
|
noMilestones: z.boolean().optional(),
|
|
77
|
-
subcommand: z.string().optional()
|
|
77
|
+
subcommand: z.string().optional(),
|
|
78
|
+
scope: z.string().optional()
|
|
78
79
|
});
|
|
79
80
|
// Function to transform flat CLI args into nested Config structure
|
|
80
81
|
const transformCliArgs = (finalCliArgs, commandName)=>{
|
|
@@ -270,6 +271,12 @@ const transformCliArgs = (finalCliArgs, commandName)=>{
|
|
|
270
271
|
if (finalCliArgs.subcommand !== undefined) transformedCliArgs.versions.subcommand = finalCliArgs.subcommand;
|
|
271
272
|
if (finalCliArgs.directories !== undefined) transformedCliArgs.versions.directories = finalCliArgs.directories;
|
|
272
273
|
}
|
|
274
|
+
// Nested mappings for 'updates' options
|
|
275
|
+
if (commandName === 'updates' && (finalCliArgs.scope !== undefined || finalCliArgs.directories !== undefined)) {
|
|
276
|
+
transformedCliArgs.updates = {};
|
|
277
|
+
if (finalCliArgs.scope !== undefined) transformedCliArgs.updates.scope = finalCliArgs.scope;
|
|
278
|
+
if (finalCliArgs.directories !== undefined) transformedCliArgs.updates.directories = finalCliArgs.directories;
|
|
279
|
+
}
|
|
273
280
|
// Handle excluded patterns (Commander.js converts --excluded-paths to excludedPaths)
|
|
274
281
|
// Also handle exclude as alias for excludedPatterns
|
|
275
282
|
const excludedPatterns = finalCliArgs.excludedPatterns || finalCliArgs.exclude || finalCliArgs.excludedPaths;
|
|
@@ -412,6 +419,21 @@ const configure = async (cardigantime)=>{
|
|
|
412
419
|
...fileValues.tree,
|
|
413
420
|
...transformedCliArgs.tree
|
|
414
421
|
};
|
|
422
|
+
const mergedBranches = {
|
|
423
|
+
...KODRDRIV_DEFAULTS.branches || {},
|
|
424
|
+
...fileValues.branches || {},
|
|
425
|
+
...transformedCliArgs.branches || {}
|
|
426
|
+
};
|
|
427
|
+
const mergedVersions = {
|
|
428
|
+
...KODRDRIV_DEFAULTS.versions,
|
|
429
|
+
...fileValues.versions,
|
|
430
|
+
...transformedCliArgs.versions
|
|
431
|
+
};
|
|
432
|
+
const mergedUpdates = {
|
|
433
|
+
...KODRDRIV_DEFAULTS.updates,
|
|
434
|
+
...fileValues.updates,
|
|
435
|
+
...transformedCliArgs.updates
|
|
436
|
+
};
|
|
415
437
|
const partialConfig = {
|
|
416
438
|
...KODRDRIV_DEFAULTS,
|
|
417
439
|
...fileValues,
|
|
@@ -424,7 +446,10 @@ const configure = async (cardigantime)=>{
|
|
|
424
446
|
audioCommit: mergedAudioCommit,
|
|
425
447
|
audioReview: mergedAudioReview,
|
|
426
448
|
review: mergedReview,
|
|
427
|
-
tree: mergedTree
|
|
449
|
+
tree: mergedTree,
|
|
450
|
+
branches: mergedBranches,
|
|
451
|
+
versions: mergedVersions,
|
|
452
|
+
updates: mergedUpdates
|
|
428
453
|
}; // Cast to Partial<Config> initially
|
|
429
454
|
// Specific validation and processing after merge
|
|
430
455
|
const config = await validateAndProcessOptions(partialConfig);
|
|
@@ -564,7 +589,7 @@ async function getCliConfig(program, commands) {
|
|
|
564
589
|
addSharedOptions(releaseCommand);
|
|
565
590
|
const publishCommand = program.command('publish').option('--merge-method <method>', 'method to merge PR (merge, squash, rebase)', 'squash').option('--from <from>', 'branch/tag to generate release notes from (default: previous release tag)').option('--target-version <targetVersion>', 'target version for release (explicit version like "4.30.0" or semantic bump: "patch", "minor", "major")').option('--interactive', 'present release notes for interactive review and editing').option('--sendit', 'skip all confirmation prompts and proceed automatically').option('--sync-target', 'attempt to automatically sync target branch with remote before publishing').option('--no-milestones', 'disable GitHub milestone integration').option('--from-main', 'force comparison against main branch instead of previous release tag').description('Publish a release');
|
|
566
591
|
addSharedOptions(publishCommand);
|
|
567
|
-
const treeCommand = program.command('tree [command] [packageArgument]').option('--directory <directory>', 'target directory containing multiple packages (defaults to current directory)').option('--directories [directories...]', 'target directories containing multiple packages (defaults to current directory)').option('--start-from <startFrom>', 'resume execution from this package directory name (useful for restarting failed builds)').option('--stop-at <stopAt>', 'stop execution at this package directory name (the specified package will not be executed)').option('--cmd <cmd>', 'shell command to execute in each package directory (e.g., "npm install", "git status")').option('--parallel', 'execute packages in parallel when dependencies allow (packages with no interdependencies run simultaneously)').option('--excluded-patterns [excludedPatterns...]', 'patterns to exclude packages from processing (e.g., "**/node_modules/**", "dist/*")').option('--continue', 'continue from previous tree publish execution').option('--status', 'check status of running tree publish processes').option('--promote <packageName>', 'mark a package as completed in the execution context (useful for recovery after timeouts)').option('--clean-node-modules', 'for unlink command: remove node_modules and package-lock.json, then reinstall dependencies').description('Analyze package dependencies in workspace and execute commands in dependency order. Supports built-in commands: commit, publish, link, unlink, development, branches, run');
|
|
592
|
+
const treeCommand = program.command('tree [command] [packageArgument]').option('--directory <directory>', 'target directory containing multiple packages (defaults to current directory)').option('--directories [directories...]', 'target directories containing multiple packages (defaults to current directory)').option('--start-from <startFrom>', 'resume execution from this package directory name (useful for restarting failed builds)').option('--stop-at <stopAt>', 'stop execution at this package directory name (the specified package will not be executed)').option('--cmd <cmd>', 'shell command to execute in each package directory (e.g., "npm install", "git status")').option('--parallel', 'execute packages in parallel when dependencies allow (packages with no interdependencies run simultaneously)').option('--excluded-patterns [excludedPatterns...]', 'patterns to exclude packages from processing (e.g., "**/node_modules/**", "dist/*")').option('--continue', 'continue from previous tree publish execution').option('--status', 'check status of running tree publish processes').option('--promote <packageName>', 'mark a package as completed in the execution context (useful for recovery after timeouts)').option('--clean-node-modules', 'for unlink command: remove node_modules and package-lock.json, then reinstall dependencies').description('Analyze package dependencies in workspace and execute commands in dependency order. Supports built-in commands: commit, publish, link, unlink, development, branches, run, checkout');
|
|
568
593
|
addSharedOptions(treeCommand);
|
|
569
594
|
const linkCommand = program.command('link [packageArgument]').option('--scope-roots <scopeRoots>', 'JSON mapping of scopes to root directories (e.g., \'{"@company": "../"}\')').description('Create npm file: dependencies for local development');
|
|
570
595
|
addSharedOptions(linkCommand);
|
|
@@ -717,6 +742,8 @@ async function getCliConfig(program, commands) {
|
|
|
717
742
|
addSharedOptions(developmentCommand);
|
|
718
743
|
const versionsCommand = program.command('versions <subcommand>').option('--directories [directories...]', 'directories to scan for packages (defaults to current directory)').description('Update dependency versions across packages. Subcommands: minor');
|
|
719
744
|
addSharedOptions(versionsCommand);
|
|
745
|
+
const updatesCommand = program.command('updates <scope>').option('--directories [directories...]', 'directories to scan for packages (tree mode, defaults to current directory)').description('Update dependencies matching a specific scope using npm-check-updates (e.g., kodrdriv updates @fjell)');
|
|
746
|
+
addSharedOptions(updatesCommand);
|
|
720
747
|
const selectAudioCommand = program.command('select-audio').description('Interactively select and save audio device for recording');
|
|
721
748
|
addSharedOptions(selectAudioCommand);
|
|
722
749
|
program.parse();
|
|
@@ -730,7 +757,7 @@ async function getCliConfig(program, commands) {
|
|
|
730
757
|
}
|
|
731
758
|
// Only proceed with command-specific options if validation passed
|
|
732
759
|
if (ALLOWED_COMMANDS.includes(commandName)) {
|
|
733
|
-
var _chosen_commitCommand, _chosen_commit, _chosen_audioCommitCommand, _chosen_releaseCommand, _chosen_publishCommand, _chosen_treeCommand, _chosen_linkCommand, _chosen_unlinkCommand, _chosen_audioReviewCommand, _chosen_reviewCommand, _chosen_review, _chosen_cleanCommand, _chosen_developmentCommand, _chosen_versionsCommand, _chosen_selectAudioCommand;
|
|
760
|
+
var _chosen_commitCommand, _chosen_commit, _chosen_audioCommitCommand, _chosen_releaseCommand, _chosen_publishCommand, _chosen_treeCommand, _chosen_linkCommand, _chosen_unlinkCommand, _chosen_audioReviewCommand, _chosen_reviewCommand, _chosen_review, _chosen_cleanCommand, _chosen_developmentCommand, _chosen_versionsCommand, _chosen_updatesCommand, _chosen_selectAudioCommand;
|
|
734
761
|
const chosen = {
|
|
735
762
|
commitCommand,
|
|
736
763
|
audioCommitCommand,
|
|
@@ -744,6 +771,7 @@ async function getCliConfig(program, commands) {
|
|
|
744
771
|
cleanCommand,
|
|
745
772
|
developmentCommand,
|
|
746
773
|
versionsCommand,
|
|
774
|
+
updatesCommand,
|
|
747
775
|
selectAudioCommand
|
|
748
776
|
};
|
|
749
777
|
if (commandName === 'commit' && (chosen === null || chosen === void 0 ? void 0 : (_chosen_commitCommand = chosen.commitCommand) === null || _chosen_commitCommand === void 0 ? void 0 : _chosen_commitCommand.opts)) {
|
|
@@ -822,7 +850,7 @@ async function getCliConfig(program, commands) {
|
|
|
822
850
|
const firstTruthyArg = args.find((arg)=>arg);
|
|
823
851
|
if (firstTruthyArg) {
|
|
824
852
|
commandOptions.builtInCommand = firstTruthyArg;
|
|
825
|
-
if ((firstTruthyArg === 'link' || firstTruthyArg === 'unlink' || firstTruthyArg === 'run') && args.length > 1) {
|
|
853
|
+
if ((firstTruthyArg === 'link' || firstTruthyArg === 'unlink' || firstTruthyArg === 'run' || firstTruthyArg === 'checkout' || firstTruthyArg === 'updates') && args.length > 1) {
|
|
826
854
|
const secondTruthyArg = args.slice(1).find((arg)=>arg);
|
|
827
855
|
if (secondTruthyArg) {
|
|
828
856
|
commandOptions.packageArgument = secondTruthyArg;
|
|
@@ -920,6 +948,13 @@ async function getCliConfig(program, commands) {
|
|
|
920
948
|
if (args && args.length > 0 && args[0]) {
|
|
921
949
|
commandOptions.subcommand = args[0];
|
|
922
950
|
}
|
|
951
|
+
} else if (commandName === 'updates' && (chosen === null || chosen === void 0 ? void 0 : (_chosen_updatesCommand = chosen.updatesCommand) === null || _chosen_updatesCommand === void 0 ? void 0 : _chosen_updatesCommand.opts)) {
|
|
952
|
+
const updatesCmd = chosen.updatesCommand;
|
|
953
|
+
commandOptions = updatesCmd.opts();
|
|
954
|
+
const args = updatesCmd.args;
|
|
955
|
+
if (args && args.length > 0 && args[0]) {
|
|
956
|
+
commandOptions.scope = args[0];
|
|
957
|
+
}
|
|
923
958
|
} else if (commandName === 'select-audio' && (chosen === null || chosen === void 0 ? void 0 : (_chosen_selectAudioCommand = chosen.selectAudioCommand) === null || _chosen_selectAudioCommand === void 0 ? void 0 : _chosen_selectAudioCommand.opts)) {
|
|
924
959
|
const selectAudioCmd = chosen.selectAudioCommand;
|
|
925
960
|
commandOptions = selectAudioCmd.opts();
|
|
@@ -978,7 +1013,7 @@ async function validateAndProcessSecureOptions() {
|
|
|
978
1013
|
async function validateAndProcessOptions(options) {
|
|
979
1014
|
const contextDirectories = await validateContextDirectories(options.contextDirectories || KODRDRIV_DEFAULTS.contextDirectories);
|
|
980
1015
|
const configDir = options.configDirectory || KODRDRIV_DEFAULTS.configDirectory;
|
|
981
|
-
var _options_dryRun, _options_verbose, _options_debug, _options_overrides, _options_model, _options_openaiReasoning, _options_openaiMaxOutputTokens, _options_outputDirectory, _options_preferencesDirectory, _options_discoveredConfigDirs, _options_resolvedConfigDirs, _options_excludedPatterns;
|
|
1016
|
+
var _options_dryRun, _options_verbose, _options_debug, _options_overrides, _options_model, _options_openaiReasoning, _options_openaiMaxOutputTokens, _options_outputDirectory, _options_preferencesDirectory, _options_discoveredConfigDirs, _options_resolvedConfigDirs, _options_excludedPatterns, _options_branches;
|
|
982
1017
|
// Skip config directory validation since Cardigantime handles hierarchical lookup
|
|
983
1018
|
// Ensure all required fields are present and have correct types after merging
|
|
984
1019
|
const finalConfig = {
|
|
@@ -1041,7 +1076,12 @@ async function validateAndProcessOptions(options) {
|
|
|
1041
1076
|
...KODRDRIV_DEFAULTS.versions,
|
|
1042
1077
|
...Object.fromEntries(Object.entries(options.versions || {}).filter(([_, v])=>v !== undefined))
|
|
1043
1078
|
},
|
|
1044
|
-
|
|
1079
|
+
updates: {
|
|
1080
|
+
...KODRDRIV_DEFAULTS.updates,
|
|
1081
|
+
...Object.fromEntries(Object.entries(options.updates || {}).filter(([_, v])=>v !== undefined))
|
|
1082
|
+
},
|
|
1083
|
+
excludedPatterns: (_options_excludedPatterns = options.excludedPatterns) !== null && _options_excludedPatterns !== void 0 ? _options_excludedPatterns : KODRDRIV_DEFAULTS.excludedPatterns,
|
|
1084
|
+
branches: (_options_branches = options.branches) !== null && _options_branches !== void 0 ? _options_branches : KODRDRIV_DEFAULTS.branches
|
|
1045
1085
|
};
|
|
1046
1086
|
// Final validation against the MainConfig shape (optional, cardigantime might handle it)
|
|
1047
1087
|
// You could potentially use ConfigShape.parse(finalConfig) here if needed
|