refactor: remove copy-object and type definitions; migrate to new S3 structure
- Deleted copy-object.ts and type.ts files as part of the refactor. - Updated index.ts to export from new S3 core and type files. - Refactored OssBase class in core.ts to handle file uploads and object management. - Enhanced error handling for object retrieval and metadata management. - Introduced new methods for handling object streams and metadata filtering. - Updated download utility functions to align with new structure.
This commit is contained in:
@@ -1,18 +1,23 @@
|
||||
import glob from 'fast-glob';
|
||||
import dts from 'bun-plugin-dts';
|
||||
import { resolvePath } from '@kevisual/use-config';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
const services = await glob('src/services/*.ts');
|
||||
const buildFn = async (opts: { entry?: string, naming?: string }) => {
|
||||
const entry = opts.entry || 'src/index.ts';
|
||||
const naming = opts.naming || 'app';
|
||||
const external: string[] = ["bun"];
|
||||
await Bun.build({
|
||||
target: 'node',
|
||||
format: 'esm',
|
||||
entrypoints: [resolvePath(entry, { meta: import.meta })],
|
||||
outdir: resolvePath('./dist', { meta: import.meta }),
|
||||
naming: {
|
||||
entry: `${naming}.js`,
|
||||
},
|
||||
external,
|
||||
});
|
||||
const cmd = `dts -i ${entry} -o ${naming}.d.ts`;
|
||||
execSync(cmd);
|
||||
};
|
||||
|
||||
await Bun.build({
|
||||
entrypoints: ['src/index.ts', ...services],
|
||||
outdir: './dist',
|
||||
target: 'node',
|
||||
format: 'esm',
|
||||
splitting: false,
|
||||
sourcemap: 'none',
|
||||
minify: false,
|
||||
external: ['minio'],
|
||||
plugins: [dts()],
|
||||
});
|
||||
|
||||
console.log('Build completed!');
|
||||
await buildFn({ naming: 'index', entry: 'src/index.ts' });
|
||||
await buildFn({ naming: 'services', entry: 'src/services/index.ts' });
|
||||
Reference in New Issue
Block a user