mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
refactor: Migrate all lib packages to ESM
Convert all shared library packages from CommonJS to ESM for consistency with apps/server and modern JavaScript standards. Changes: - Add "type": "module" to package.json for all libs - Update tsconfig.json to use "NodeNext" module/moduleResolution - Add .js extensions to all relative imports Packages migrated: - @automaker/dependency-resolver (already ESM, added .js extension) - @automaker/git-utils (CommonJS → ESM) - @automaker/model-resolver (CommonJS → ESM) - @automaker/platform (CommonJS → ESM) - @automaker/utils (CommonJS → ESM) Benefits: ✅ Consistent module system across all packages ✅ Better tree-shaking and modern bundling support ✅ Native browser support (future-proof) ✅ Fixes E2E CI server startup issues All tests passing: 632/632 server tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "@automaker/git-utils",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"description": "Git operations utilities for AutoMaker",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -7,8 +7,8 @@ import fs from "fs/promises";
|
||||
import path from "path";
|
||||
import { exec } from "child_process";
|
||||
import { promisify } from "util";
|
||||
import { BINARY_EXTENSIONS, type FileStatus } from './types';
|
||||
import { isGitRepo, parseGitStatus } from './status';
|
||||
import { BINARY_EXTENSIONS, type FileStatus } from './types.js';
|
||||
import { isGitRepo, parseGitStatus } from './status.js';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
const logger = createLogger("GitUtils");
|
||||
|
||||
@@ -8,13 +8,13 @@ export {
|
||||
BINARY_EXTENSIONS,
|
||||
GIT_STATUS_MAP,
|
||||
type FileStatus,
|
||||
} from './types';
|
||||
} from './types.js';
|
||||
|
||||
// Export status utilities
|
||||
export {
|
||||
isGitRepo,
|
||||
parseGitStatus,
|
||||
} from './status';
|
||||
} from './status.js';
|
||||
|
||||
// Export diff utilities
|
||||
export {
|
||||
@@ -23,4 +23,4 @@ export {
|
||||
listAllFilesInDirectory,
|
||||
generateDiffsForNonGitDirectory,
|
||||
getGitRepositoryDiffs,
|
||||
} from './diff';
|
||||
} from './diff.js';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { exec } from "child_process";
|
||||
import { promisify } from "util";
|
||||
import { GIT_STATUS_MAP, type FileStatus } from './types';
|
||||
import { GIT_STATUS_MAP, type FileStatus } from './types.js';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
"rootDir": "./src",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
|
||||
Reference in New Issue
Block a user