fix: correct globals.d.ts reference path in build output
Some checks failed
armco-org/node-starter-kit/pipeline/head There was a failure building this commit

This commit is contained in:
2026-01-18 21:01:03 +05:30
parent 22739c64a4
commit ceb8fb9e59

View File

@@ -103,6 +103,19 @@ import pkg from "./package.json";
fs.copyFileSync("./v2/globals.d.ts", "./dist/globals.d.ts");
}
// Fix globals.d.ts reference path in index.d.ts
// TypeScript outputs "../v2/globals.d.ts" but we need "./globals.d.ts"
logger.info('🔧 Fixing globals.d.ts reference path...');
const indexDtsPath = "./dist/index.d.ts";
if (fs.existsSync(indexDtsPath)) {
let indexDts = fs.readFileSync(indexDtsPath, 'utf8');
indexDts = indexDts.replace(
/\/\/\/ <reference path="\.\.\/v2\/globals\.d\.ts" \/>/,
'/// <reference path="./globals.d.ts" />'
);
fs.writeFileSync(indexDtsPath, indexDts);
}
logger.info('✅ Build completed successfully!');
logger.info('📦 Package ready in ./dist folder');
} catch (err) {