@eldrforge/kodrdriv 1.2.29 → 1.2.123
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/dist/application.js +16 -13
- package/dist/application.js.map +1 -1
- package/dist/arguments.js +5 -5
- package/dist/arguments.js.map +1 -1
- package/dist/commands/audio-review.js +2 -5
- package/dist/commands/audio-review.js.map +1 -1
- package/dist/commands/clean.js +2 -4
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/commit.js +3 -6
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/development.js +7 -7
- package/dist/commands/development.js.map +1 -1
- package/dist/commands/link.js +3 -7
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/precommit.js +99 -0
- package/dist/commands/precommit.js.map +1 -0
- package/dist/commands/publish.js +47 -32
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +3 -7
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/review.js +4 -6
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/tree.js +213 -84
- package/dist/commands/tree.js.map +1 -1
- package/dist/commands/unlink.js +3 -7
- package/dist/commands/unlink.js.map +1 -1
- package/dist/commands/updates.js +2 -4
- package/dist/commands/updates.js.map +1 -1
- package/dist/commands/versions.js +3 -7
- package/dist/commands/versions.js.map +1 -1
- package/dist/constants.js +4 -2
- package/dist/constants.js.map +1 -1
- package/dist/content/files.js +2 -4
- package/dist/content/files.js.map +1 -1
- package/dist/execution/CommandValidator.js +33 -1
- package/dist/execution/CommandValidator.js.map +1 -1
- package/dist/execution/ResourceMonitor.js +26 -1
- package/dist/execution/ResourceMonitor.js.map +1 -1
- package/dist/execution/TreeExecutionAdapter.js +2 -2
- package/dist/execution/TreeExecutionAdapter.js.map +1 -1
- package/dist/util/checkpointManager.js +2 -4
- package/dist/util/checkpointManager.js.map +1 -1
- package/dist/util/dependencyGraph.js +2 -4
- package/dist/util/dependencyGraph.js.map +1 -1
- package/dist/util/general.js +7 -107
- package/dist/util/general.js.map +1 -1
- package/dist/util/gitMutex.js +63 -18
- package/dist/util/gitMutex.js.map +1 -1
- package/dist/util/precommitOptimizations.js +310 -0
- package/dist/util/precommitOptimizations.js.map +1 -0
- package/dist/util/storageAdapter.js +2 -6
- package/dist/util/storageAdapter.js.map +1 -1
- package/dist/utils/branchState.js +178 -45
- package/dist/utils/branchState.js.map +1 -1
- package/package.json +6 -5
- package/AI-FRIENDLY-LOGGING-GUIDE.md +0 -237
- package/AI-LOGGING-MIGRATION-COMPLETE.md +0 -371
- package/ALREADY-PUBLISHED-PACKAGES-FIX.md +0 -264
- package/AUDIT-BRANCHES-PROGRESS-FIX.md +0 -90
- package/AUDIT-EXAMPLE-OUTPUT.md +0 -113
- package/CHECKPOINT-RECOVERY-FIX.md +0 -450
- package/LOGGING-MIGRATION-STATUS.md +0 -186
- package/MONOREPO-PUBLISH-IMPROVEMENTS.md +0 -281
- package/PARALLEL-EXECUTION-FIXES.md +0 -132
- package/PARALLEL-PUBLISH-DEBUGGING-GUIDE.md +0 -441
- package/PARALLEL-PUBLISH-FIXES-IMPLEMENTED.md +0 -405
- package/PARALLEL-PUBLISH-IMPROVEMENTS-IMPLEMENTED.md +0 -439
- package/PARALLEL-PUBLISH-LOGGING-FIXES.md +0 -274
- package/PARALLEL-PUBLISH-QUICK-REFERENCE.md +0 -375
- package/PARALLEL_EXECUTION_FIX.md +0 -146
- package/PUBLISH_IMPROVEMENTS_IMPLEMENTED.md +0 -294
- package/RECOVERY-FIXES.md +0 -72
- package/SUBMODULE-LOCK-FIX.md +0 -132
- package/VERSION-AUDIT-FIX.md +0 -333
- package/WORKFLOW-PRECHECK-IMPLEMENTATION.md +0 -239
- package/WORKFLOW-SKIP-SUMMARY.md +0 -121
- package/dist/util/safety.js +0 -166
- package/dist/util/safety.js.map +0 -1
- package/dist/util/stdin.js +0 -133
- package/dist/util/stdin.js.map +0 -1
- package/dist/util/storage.js +0 -187
- package/dist/util/storage.js.map +0 -1
package/dist/commands/publish.js
CHANGED
|
@@ -3,10 +3,10 @@ import { execute as execute$2 } from './commit.js';
|
|
|
3
3
|
import { hasStagedChanges } from '../content/diff.js';
|
|
4
4
|
import { execute as execute$1 } from './release.js';
|
|
5
5
|
import { getDryRunLogger, getLogger } from '../logging.js';
|
|
6
|
-
import { run, localBranchExists, runSecure, runWithDryRunSupport, safeJsonParse, validatePackageJson, validateGitRef, safeSyncBranchWithRemote, isBranchInSyncWithRemote } from '@eldrforge/git-tools';
|
|
6
|
+
import { run, localBranchExists, remoteBranchExists, runSecure, runWithDryRunSupport, safeJsonParse, validatePackageJson, validateGitRef, safeSyncBranchWithRemote, isBranchInSyncWithRemote } from '@eldrforge/git-tools';
|
|
7
7
|
import * as GitHub from '@eldrforge/github-tools';
|
|
8
|
-
import {
|
|
9
|
-
import { calculateBranchDependentVersion,
|
|
8
|
+
import { createStorage, calculateTargetVersion } from '@eldrforge/shared';
|
|
9
|
+
import { calculateBranchDependentVersion, checkIfTagExists, confirmVersionInteractively, getOutputPath } from '../util/general.js';
|
|
10
10
|
import { DEFAULT_OUTPUT_DIRECTORY, KODRDRIV_DEFAULTS } from '../constants.js';
|
|
11
11
|
import fs from 'fs/promises';
|
|
12
12
|
import { runGitWithLock } from '../util/gitMutex.js';
|
|
@@ -129,9 +129,7 @@ const runPrechecks = async (runConfig, targetBranch)=>{
|
|
|
129
129
|
var _runConfig_publish, _runConfig_publish1;
|
|
130
130
|
const isDryRun = runConfig.dryRun || false;
|
|
131
131
|
const logger = getDryRunLogger(isDryRun);
|
|
132
|
-
const storage =
|
|
133
|
-
log: logger.info
|
|
134
|
-
});
|
|
132
|
+
const storage = createStorage();
|
|
135
133
|
logger.info('PRECHECK_STARTING: Executing publish prechecks | Phase: validation | Target: ' + (targetBranch || 'default'));
|
|
136
134
|
// Check if we're in a git repository
|
|
137
135
|
try {
|
|
@@ -413,9 +411,7 @@ const execute = async (runConfig)=>{
|
|
|
413
411
|
var _runConfig_publish, _runConfig_publish1, _runConfig_publish2, _runConfig_publish3;
|
|
414
412
|
const isDryRun = runConfig.dryRun || false;
|
|
415
413
|
const logger = getDryRunLogger(isDryRun);
|
|
416
|
-
const storage =
|
|
417
|
-
log: logger.info
|
|
418
|
-
});
|
|
414
|
+
const storage = createStorage();
|
|
419
415
|
// Get current branch for branch-dependent targeting
|
|
420
416
|
let currentBranch;
|
|
421
417
|
if (isDryRun) {
|
|
@@ -438,7 +434,7 @@ const execute = async (runConfig)=>{
|
|
|
438
434
|
// Use explicit fetch+merge instead of pull to avoid git config conflicts
|
|
439
435
|
await runGitWithLock(process.cwd(), async ()=>{
|
|
440
436
|
await run(`git fetch origin ${currentBranch}`);
|
|
441
|
-
await run(`git merge origin/${currentBranch} --no-
|
|
437
|
+
await run(`git merge origin/${currentBranch} --no-edit`);
|
|
442
438
|
}, `sync ${currentBranch}`);
|
|
443
439
|
logger.info(`CURRENT_BRANCH_SYNCED: Successfully synchronized current branch with remote | Branch: ${currentBranch} | Remote: origin/${currentBranch} | Status: in-sync`);
|
|
444
440
|
} else {
|
|
@@ -494,27 +490,46 @@ const execute = async (runConfig)=>{
|
|
|
494
490
|
} else {
|
|
495
491
|
const targetBranchExists = await localBranchExists(targetBranch);
|
|
496
492
|
if (!targetBranchExists) {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
await
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
493
|
+
// Check if it exists on remote
|
|
494
|
+
const remoteExists = await remoteBranchExists(targetBranch);
|
|
495
|
+
if (remoteExists) {
|
|
496
|
+
logger.info(`TARGET_BRANCH_TRACKING: Target branch exists on remote but not locally, tracking origin/${targetBranch} | Branch: ${targetBranch}`);
|
|
497
|
+
try {
|
|
498
|
+
await runGitWithLock(process.cwd(), async ()=>{
|
|
499
|
+
// Create local branch tracking remote
|
|
500
|
+
await runSecure('git', [
|
|
501
|
+
'branch',
|
|
502
|
+
targetBranch,
|
|
503
|
+
`origin/${targetBranch}`
|
|
504
|
+
]);
|
|
505
|
+
logger.info(`TARGET_BRANCH_CREATED: Successfully created local tracking branch | Branch: ${targetBranch} | Source: origin/${targetBranch}`);
|
|
506
|
+
}, `track target branch ${targetBranch}`);
|
|
507
|
+
} catch (error) {
|
|
508
|
+
throw new Error(`Failed to track target branch '${targetBranch}': ${error.message}`);
|
|
509
|
+
}
|
|
510
|
+
} else {
|
|
511
|
+
logger.info(`TARGET_BRANCH_CREATING: Target branch does not exist locally or on remote, creating from current branch | Branch: ${targetBranch} | Source: HEAD | Remote: origin`);
|
|
512
|
+
try {
|
|
513
|
+
// Wrap git branch and push operations with lock
|
|
514
|
+
await runGitWithLock(process.cwd(), async ()=>{
|
|
515
|
+
// Create the target branch from the current HEAD
|
|
516
|
+
await runSecure('git', [
|
|
517
|
+
'branch',
|
|
518
|
+
targetBranch,
|
|
519
|
+
'HEAD'
|
|
520
|
+
]);
|
|
521
|
+
logger.info(`TARGET_BRANCH_CREATED: Successfully created target branch locally | Branch: ${targetBranch} | Source: HEAD`);
|
|
522
|
+
// Push the new branch to origin
|
|
523
|
+
await runSecure('git', [
|
|
524
|
+
'push',
|
|
525
|
+
'origin',
|
|
526
|
+
targetBranch
|
|
527
|
+
]);
|
|
528
|
+
logger.info(`TARGET_BRANCH_PUSHED: Successfully pushed new target branch to remote | Branch: ${targetBranch} | Remote: origin/${targetBranch}`);
|
|
529
|
+
}, `create and push target branch ${targetBranch}`);
|
|
530
|
+
} catch (error) {
|
|
531
|
+
throw new Error(`Failed to create target branch '${targetBranch}': ${error.message}`);
|
|
532
|
+
}
|
|
518
533
|
}
|
|
519
534
|
} else {
|
|
520
535
|
logger.info(`TARGET_BRANCH_EXISTS: Target branch already exists locally | Branch: ${targetBranch} | Status: ready`);
|
|
@@ -1026,7 +1041,7 @@ const execute = async (runConfig)=>{
|
|
|
1026
1041
|
if (remoteExists) {
|
|
1027
1042
|
await runGitWithLock(process.cwd(), async ()=>{
|
|
1028
1043
|
await run(`git fetch origin ${targetBranch}`);
|
|
1029
|
-
await run(`git merge origin/${targetBranch} --no-
|
|
1044
|
+
await run(`git merge origin/${targetBranch} --no-edit`);
|
|
1030
1045
|
}, `sync ${targetBranch}`);
|
|
1031
1046
|
logger.info(`PUBLISH_TARGET_SYNCED: Successfully synced target with remote | Branch: ${targetBranch} | Remote: origin | Status: in-sync`);
|
|
1032
1047
|
} else {
|