Skip to content

Commit c42c562

Browse files
Refactor decorator configuration in migrator
1 parent 3393e87 commit c42c562

File tree

3 files changed

+3902
-2
lines changed

3 files changed

+3902
-2
lines changed

src/migrator/config.ts

+5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ export const vueSpecialMethods = [
1919
'destroyed',
2020
]; // Vue methods that won't be included under methods: {...}, they go to the root.
2121

22+
export const customsDecorators = [
23+
'Apollo',
24+
];
25+
2226
export const supportedDecorators = [
2327
...vuexDecorators,
2428
...vueClassPropertyDecorators,
29+
...customsDecorators,
2530
]; // Class Property decorators

src/migrator/migrator.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ const migrateTsFile = async (project: Project, sourceFile: SourceFile): Promise<
2323
migrateVueClassProperties(migrationManager);
2424
migrateVuexDecorators(migrationManager);
2525
} catch (error) {
26-
await outFile.deleteImmediately();
26+
// await outFile.deleteImmediately();
27+
logger.error(`Error migrating ${sourceFile.getFilePath()}`);
2728
throw error;
2829
}
29-
return outFile.moveImmediately(sourceFile.getFilePath(), { overwrite: true });
30+
const out = await Promise.all([
31+
outFile.copyImmediately(sourceFile.getFilePath(), { overwrite: true }),
32+
outFile.deleteImmediately(),
33+
]);
34+
return out[0];
3035
};
3136

3237
const migrateVueFile = async (project: Project, vueSourceFile: SourceFile) => {

0 commit comments

Comments
 (0)