feature: port from python client lib

This commit is contained in:
Alpha Nerd 2026-01-17 12:02:08 +01:00
parent 129c6cd004
commit fd1a3b50cb
29 changed files with 3141 additions and 2 deletions

41
rollup.config.js Normal file
View file

@ -0,0 +1,41 @@
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
const target = process.env.TARGET || 'node';
const config = {
input: target === 'browser' ? 'src/browser.ts' : 'src/node.ts',
plugins: [
resolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
declaration: false,
declarationDir: undefined
})
]
};
if (target === 'node') {
config.output = [
{
file: 'dist/node/index.js',
format: 'cjs',
exports: 'named'
},
{
file: 'dist/esm/index.js',
format: 'es'
}
];
config.external = ['crypto', 'https', 'fs', 'path'];
} else if (target === 'browser') {
config.output = {
file: 'dist/browser/index.js',
format: 'es',
name: 'Nomyo'
};
}
export default config;