emigrate/packages/plugin-generate-js/src/index.ts
Joakim Carlstein 9f5abf727d refactor: simplify plugin interfaces by getting rid of the "type" property
This is to prepare for having packages that contains multiple different plugins in the same file.
2023-11-15 14:11:06 +01:00

13 lines
397 B
TypeScript

import { getTimestampPrefix, sanitizeMigrationName } from '@emigrate/plugin-tools';
import { type GenerateMigrationFunction } from '@emigrate/plugin-tools/types';
export const generateMigration: GenerateMigrationFunction = async (name) => {
return {
filename: `${getTimestampPrefix()}_${sanitizeMigrationName(name)}.js`,
content: `// ${name}
export default async () => {
};
`,
};
};