Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Invalid nodeModulePath when creating a custom plugin #7692

Closed
Tracked by #7210
ishantiw opened this issue Oct 25, 2022 · 0 comments · Fixed by #7841
Closed
Tracked by #7210

Invalid nodeModulePath when creating a custom plugin #7692

ishantiw opened this issue Oct 25, 2022 · 0 comments · Fixed by #7841

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Oct 25, 2022

Expected behavior

lisk generate:plugin customPlugin should generate a custom plugin without error.

Actual behavior

When we run lisk generate:plugin customPlugin then it creates a file <plugin_name>_plugin.ts where nodeModulePath returns a path in invalid string format like below without double or single quotes,
/lisk-sdk/commander/dist/bootstrapping/templates/lisk-template-ts/templates/plugin/src/app/plugins/plugin.t
it should be,
__filename

Additionally, the following function is generated, but plugins don't emit events anymore afaik:

public get events(): string[] {
	return [
		// 'block:created',
		// 'block:missed'
	];
}

Also, this is how the load function is generated, I think channel is outdated as well.

public async load(_: BaseChannel): Promise<void> {
	// this._channel = channel;
	// this._channel.once('app:ready', () => {});
}

Probably the plugin generation needs to be generally aligned to new plugin structure for v6

Steps to reproduce

Run lisk generate:plugin customPlugin

Which version(s) does this affect? (Environment, OS, etc...)

6.0.0-alpha.4

@Incede Incede self-assigned this Dec 1, 2022
shuse2 pushed a commit that referenced this issue Dec 2, 2022
### What was the problem?

This PR resolves #7692 

### How was it solved?

Fix template per the requirements

### How was it tested?

Output checked manually

Co-authored-by: !shan <[email protected]>
@shuse2 shuse2 modified the milestones: Sprint 84, Sprint 83 Dec 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants