const fs = require('fs');
const path = require('path');

const projectRoot = path.join(__dirname, '..', '..');
const mainPackage = require(path.join(projectRoot, 'package.json'));
const distDir = path.join(projectRoot, 'dist');

const newPackage = {
  name: mainPackage.name,
  version: mainPackage.version,
  description: mainPackage.description,
  main: mainPackage.main,
  dependencies: mainPackage.dependencies,
};

fs.writeFileSync(path.join(distDir, 'package.json'), JSON.stringify(newPackage, null, 2));

fs.copyFileSync(path.join(projectRoot, 'package-lock.json'), path.join(distDir, 'package-lock.json'));

console.log('Production package.json and package-lock.json created in dist/'); 