@@ -61,7 +61,7 @@ export async function getConfig(): Promise<Config> {
6161 pluginName = await input ( {
6262 message : "What is the name of the plugin class? (use PascalCase)" ,
6363 required : false ,
64- default : generateDefaultPluginName ( name , location ) ,
64+ default : generateDefaultPluginName ( name , location , type ) ,
6565 validate : validatePluginName ,
6666 } ) ;
6767 } else {
@@ -97,8 +97,8 @@ export async function generateTemplate(config: Config) {
9797 packageJSONContent . description = config . description ;
9898 if ( type === "external" ) {
9999 // For external plugins, the main entry point is at index.js, instead of the default index.cjs
100- packageJSONContent . exports [ "." ] . import = "./dist/index.js" ;
101- packageJSONContent . module = "./dist/index.js" ;
100+ packageJSONContent . exports [ "." ] . require = "./dist/index.js" ;
101+ packageJSONContent . main = "./dist/index.js" ;
102102 }
103103 await fs . writeFile ( packageJSON , JSON . stringify ( packageJSONContent , null , 2 ) ) ;
104104
@@ -113,7 +113,10 @@ export async function generateTemplate(config: Config) {
113113 if ( pluginName ) {
114114 for await ( const file of fs . glob ( `${ bundlePath . replace ( pathlib . sep , "/" ) } /**/*.{ts,tsx}` ) ) {
115115 const content = await fs . readFile ( file , "utf-8" ) ;
116- const updatedContent = content . replace ( / P l u g i n N a m e / g, pluginName ) ;
116+ let updatedContent = content . replace ( / P l u g i n N a m e / g, pluginName ) ;
117+ if ( type === "external" ) {
118+ updatedContent = updatedContent . replace ( / a b s t r a c t / g, "" ) ;
119+ }
117120 await fs . writeFile ( file , updatedContent ) ;
118121 }
119122 }
0 commit comments