chore: generate sdk into packages/sdk

This commit is contained in:
adamdotdevin 2025-07-22 11:50:51 -05:00
parent 500cea5ce7
commit 10c8b49590
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
110 changed files with 12576 additions and 201 deletions

View file

@ -0,0 +1,17 @@
const fs = require('fs');
const path = require('path');
const indexJs =
process.env['DIST_PATH'] ?
path.resolve(process.env['DIST_PATH'], 'index.js')
: path.resolve(__dirname, '..', '..', 'dist', 'index.js');
let before = fs.readFileSync(indexJs, 'utf8');
let after = before.replace(
/^(\s*Object\.defineProperty\s*\(exports,\s*["']__esModule["'].+)$/m,
`exports = module.exports = function (...args) {
return new exports.default(...args)
}
$1`.replace(/^ /gm, ''),
);
fs.writeFileSync(indexJs, after, 'utf8');