File tree Expand file tree Collapse file tree 5 files changed +9
-6
lines changed Expand file tree Collapse file tree 5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export class PluginInstance implements IContainerPlugin {
1010 }
1111
1212 async init ( ) : Promise < void > {
13- // add your plugin initialization here
13+ // add your plugin initialization here, replace the empty promise
14+ return await Promise . resolve ( ) ;
1415 }
1516}
Original file line number Diff line number Diff line change @@ -20,14 +20,16 @@ class Plugin implements IPlugin {
2020
2121 loadOptions ( _options : Options , _source ?: ISourceOptions ) : void {
2222 if ( ! this . needsPlugin ( ) ) {
23+ // ignore plugin options when not needed
24+
2325 return ;
2426 }
2527
2628 // Load your options here
2729 }
2830
2931 needsPlugin ( _options ?: ISourceOptions ) : boolean {
30- return true ; // add your condition here
32+ return true ; // add your condition here, replace true with condition if needed
3133 }
3234}
3335
Original file line number Diff line number Diff line change 11import { loadTemplatePreset } from "." ;
22import { tsParticles } from "@tsparticles/engine" ;
33
4- loadTemplatePreset ( tsParticles ) ;
4+ void loadTemplatePreset ( tsParticles ) ;
55
66export { loadTemplatePreset , tsParticles } ;
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import { options } from "./options";
55 *
66 * @param engine - the engine instance to load the preset into
77 */
8- export function loadTemplatePreset ( engine : Engine ) : void {
8+ export async function loadTemplatePreset ( engine : Engine ) : Promise < void > {
99 // TODO: additional modules must be loaded here
1010
1111 // Adds the preset to the engine, with the given options
12- engine . addPreset ( "#template#" , options ) ;
12+ await engine . addPreset ( "#template#" , options ) ;
1313}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { createPresetTemplate } from "../src/create/preset/create-preset";
44import path from "path" ;
55import fs from "fs-extra" ;
66
7- describe ( "create-plugin " , async ( ) => {
7+ describe ( "create-preset " , async ( ) => {
88 it ( "should have created the preset project" , async ( ) => {
99 const destDir = path . resolve ( path . join ( __dirname , "tmp-files" , "foo-preset" ) ) ;
1010
You can’t perform that action at this time.
0 commit comments