message: Update logic for create app
diff: @@ -68,16 +68,12 @@ const sortObjectByKeys = (obj: { [name in string]: string }) => {
  const capitalize = (str: string): string =>
  str.charAt(0).toUpperCase() + str.slice(1);
  -const addExportStatement = async (
  - file: string,
  - importStatement: string,
  - exportStatement: string,
  -) => {
  +const addExportStatement = async (file: string, exportStatement: string) => {
  const newContents = fs
  .readFileSync(file, 'utf8')
  .split('\n')
  .filter(Boolean) // get rid of empty lines
  - .concat([importStatement, exportStatement])
  + .concat([exportStatement])
  .concat(['']) // newline at end of file
  .join('\n');
  @@ -122,19 +118,16 @@ export async function addPluginToApp(rootDir: string, pluginName: string) {
  .split('-')
  .map(name => capitalize(name))
  .join('');
  - const pluginImport = `import { plugin as ${pluginNameCapitalized} } from '${pluginPackage}';`;
  - const pluginExport = `export { ${pluginNameCapitalized} };`;
  + const pluginExport = `export { plugin as ${pluginNameCapitalized} } from '${pluginPackage}';`;
  const pluginsFilePath = 'packages/app/src/plugins.ts';
  const pluginsFile = resolvePath(rootDir, pluginsFilePath);
  await Task.forItem('processing', pluginsFilePath, async () => {
  - await addExportStatement(pluginsFile, pluginImport, pluginExport).catch(
  - error => {
  + await addExportStatement(pluginsFile, pluginExport).catch(error => {
  throw new Error(
  `Failed to import plugin in app: ${pluginsFile}: ${error.message}`,
  );
  - },
  - );
  + });
  });
  }
  