@eldrforge/kodrdriv 1.2.19 → 1.2.21

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.
Files changed (56) hide show
  1. package/GITHUB-TOOLS-INTEGRATION.md +323 -0
  2. package/INTEGRATION-SUMMARY.md +232 -0
  3. package/TEST-STATUS.md +168 -0
  4. package/dist/application.js +7 -0
  5. package/dist/application.js.map +1 -1
  6. package/dist/arguments.js +1 -1
  7. package/dist/arguments.js.map +1 -1
  8. package/dist/commands/commit.js +3 -3
  9. package/dist/commands/commit.js.map +1 -1
  10. package/dist/commands/development.js +1 -2
  11. package/dist/commands/development.js.map +1 -1
  12. package/dist/commands/link.js +1 -2
  13. package/dist/commands/link.js.map +1 -1
  14. package/dist/commands/publish.js +15 -17
  15. package/dist/commands/publish.js.map +1 -1
  16. package/dist/commands/release.js +4 -4
  17. package/dist/commands/release.js.map +1 -1
  18. package/dist/commands/review.js +3 -4
  19. package/dist/commands/review.js.map +1 -1
  20. package/dist/commands/tree.js +38 -10
  21. package/dist/commands/tree.js.map +1 -1
  22. package/dist/commands/unlink.js +1 -2
  23. package/dist/commands/unlink.js.map +1 -1
  24. package/dist/commands/updates.js +1 -1
  25. package/dist/commands/updates.js.map +1 -1
  26. package/dist/commands/versions.js +1 -1
  27. package/dist/commands/versions.js.map +1 -1
  28. package/dist/constants.js +1 -1
  29. package/dist/content/diff.js +1 -1
  30. package/dist/content/diff.js.map +1 -1
  31. package/dist/content/log.js +1 -1
  32. package/dist/content/log.js.map +1 -1
  33. package/dist/error/CommandErrors.js +1 -65
  34. package/dist/error/CommandErrors.js.map +1 -1
  35. package/dist/util/general.js +2 -3
  36. package/dist/util/general.js.map +1 -1
  37. package/dist/util/openai.js +1 -1
  38. package/dist/util/openai.js.map +1 -1
  39. package/dist/util/performance.js +1 -1
  40. package/dist/util/performance.js.map +1 -1
  41. package/dist/util/safety.js +1 -1
  42. package/dist/util/safety.js.map +1 -1
  43. package/dist/util/validation.js +4 -39
  44. package/dist/util/validation.js.map +1 -1
  45. package/package.json +4 -2
  46. package/test_output.txt +3 -3
  47. package/dist/content/issues.js +0 -331
  48. package/dist/content/issues.js.map +0 -1
  49. package/dist/content/releaseNotes.js +0 -90
  50. package/dist/content/releaseNotes.js.map +0 -1
  51. package/dist/util/child.js +0 -174
  52. package/dist/util/child.js.map +0 -1
  53. package/dist/util/git.js +0 -836
  54. package/dist/util/git.js.map +0 -1
  55. package/dist/util/github.js +0 -1071
  56. package/dist/util/github.js.map +0 -1
@@ -2,17 +2,15 @@
2
2
  import path__default from 'path';
3
3
  import fs__default from 'fs/promises';
4
4
  import { exec } from 'child_process';
5
- import { runSecure } from '../util/child.js';
5
+ import { safeJsonParse, validatePackageJson, getGloballyLinkedPackages, getGitStatusSummary, getLinkedDependencies, getLinkCompatibilityProblems, runSecure, run } from '@eldrforge/git-tools';
6
6
  import util from 'util';
7
7
  import { getLogger } from '../logging.js';
8
8
  import { create } from '../util/storage.js';
9
- import { safeJsonParse, validatePackageJson } from '../util/validation.js';
10
9
  import { getOutputPath } from '../util/general.js';
11
10
  import { DEFAULT_OUTPUT_DIRECTORY } from '../constants.js';
12
11
  import { execute as execute$3 } from './commit.js';
13
12
  import { execute as execute$1 } from './link.js';
14
13
  import { execute as execute$2 } from './unlink.js';
15
- import { getGloballyLinkedPackages, getGitStatusSummary, getLinkedDependencies, getLinkCompatibilityProblems } from '../util/git.js';
16
14
 
17
15
  function _define_property(obj, key, value) {
18
16
  if (key in obj) {
@@ -115,15 +113,16 @@ const updateInterProjectDependencies = async (packageDir, publishedVersions, all
115
113
  ];
116
114
  for (const publishedVersion of publishedVersions){
117
115
  const { packageName, version } = publishedVersion;
118
- // Do not propagate prerelease versions to consumers (often not available on registry)
119
- if (typeof version === 'string' && version.includes('-')) {
120
- packageLogger.verbose(`Skipping prerelease version for ${packageName}: ${version}`);
121
- continue;
122
- }
123
116
  // Only update if this is an inter-project dependency (exists in our build tree)
124
117
  if (!allPackageNames.has(packageName)) {
125
118
  continue;
126
119
  }
120
+ // Skip prerelease versions (e.g., 1.0.0-beta.1, 2.0.0-alpha.3)
121
+ // Prerelease versions should not be automatically propagated to consumers
122
+ if (version.includes('-')) {
123
+ packageLogger.verbose(`Skipping prerelease version ${packageName}@${version} - not updating dependencies`);
124
+ continue;
125
+ }
127
126
  // Update the dependency in all relevant sections
128
127
  for (const section of sectionsToUpdate){
129
128
  const deps = packageJson[section];
@@ -306,19 +305,48 @@ const validateScripts = async (packages, scripts)=>{
306
305
  missingScripts
307
306
  };
308
307
  };
309
- // Extract published version from package.json after successful publish
308
+ // Extract published version from git tags after successful publish
309
+ // After kodrdriv publish, the release version is captured in the git tag,
310
+ // while package.json contains the next dev version
310
311
  const extractPublishedVersion = async (packageDir, packageLogger)=>{
311
312
  const storage = create({
312
313
  log: packageLogger.info
313
314
  });
314
315
  const packageJsonPath = path__default.join(packageDir, 'package.json');
315
316
  try {
317
+ // Get package name from package.json
316
318
  const packageJsonContent = await storage.readFile(packageJsonPath, 'utf-8');
317
319
  const parsed = safeJsonParse(packageJsonContent, packageJsonPath);
318
320
  const packageJson = validatePackageJson(parsed, packageJsonPath);
321
+ // Get the most recently created tag (by creation date, not version number)
322
+ // This ensures we get the tag that was just created by the publish, not an older tag with a higher version
323
+ const { stdout: tagOutput } = await run('git tag --sort=-creatordate', {
324
+ cwd: packageDir
325
+ });
326
+ const tags = tagOutput.trim().split('\n').filter(Boolean);
327
+ if (tags.length === 0) {
328
+ packageLogger.warn('No git tags found after publish');
329
+ return null;
330
+ }
331
+ // Get the most recently created tag (first in the list)
332
+ const latestTag = tags[0];
333
+ // Extract version from tag, handling various formats:
334
+ // - v1.2.3 -> 1.2.3
335
+ // - working/v1.2.3 -> 1.2.3
336
+ // - main/v1.2.3 -> 1.2.3
337
+ let version = latestTag;
338
+ // If tag contains a slash (branch prefix), extract everything after it
339
+ if (version.includes('/')) {
340
+ version = version.split('/').pop() || version;
341
+ }
342
+ // Remove 'v' prefix if present
343
+ if (version.startsWith('v')) {
344
+ version = version.substring(1);
345
+ }
346
+ packageLogger.verbose(`Extracted published version from tag: ${latestTag} -> ${version}`);
319
347
  return {
320
348
  packageName: packageJson.name,
321
- version: packageJson.version,
349
+ version: version,
322
350
  publishTime: new Date()
323
351
  };
324
352
  } catch (error) {