Skip to content

Commit a32c299

Browse files
authored
fix: compiler plugin docs & add yangonkit plugin to community plugins (#614)
* fix: compiler plugin docs & add yangonkit plugin to community plugins * add back example plugin
1 parent 3d618d1 commit a32c299

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

apps/website/docs/guide/06-community-plugins.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ check out the following guides:
2020

2121
:::
2222

23+
### [YangonKit](https://github.com/retrouser955/yangonkit)
24+
25+
YangonKit is a compiler plugin for CommandKit that further reduces the
26+
boilerplate of creating a CommandKit application by providing svelte-like
27+
syntax for defining commands, and options.
28+
29+
- [Documentation](https://github.com/retrouser955/yangonkit#readme)
30+
- [GitHub repository](https://github.com/retrouser955/yangonkit)
31+
- [npm package](https://www.npmjs.com/package/yangonkit)
32+
2333
### [Example plugin](#)
2434

2535
This is a short placeholder description to help with the structure of
2636
this list, and future pull requests.
2737

2838
- [Documentation](#)
2939
- [GitHub repository](#)
30-
- [npm package](#)
40+
- [npm package](#)

apps/website/docs/guide/07-creating-plugins/02-creating-compiler-plugin.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ import {
2727
TransformedResult,
2828
} from 'commandkit';
2929

30-
export class MyPlugin extends CompilerPlugin {
30+
export interface MyPluginOptions {
31+
// you can define any options you want for your plugin here
32+
// these options can be accessed via `this.options` inside the plugin class
33+
}
34+
35+
export class MyPlugin extends CompilerPlugin<MyPluginOptions> {
3136
// this is the name of the plugin
3237
public readonly name = 'my-plugin';
3338

@@ -52,8 +57,8 @@ export class MyPlugin extends CompilerPlugin {
5257

5358
// return the transformed contents
5459
return {
55-
contents: result,
56-
loader: params.loader,
60+
code: transformedContents,
61+
map: null, // you can also return a source map if you want
5762
};
5863
}
5964
}

0 commit comments

Comments
 (0)