-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add simple plugin template #615
feat: add simple plugin template #615
Conversation
Warning Review failedThe pull request is closed. WalkthroughThe Changes
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range and nitpick comments (3)
packages/engine-cli/template/plugin/README.md (1)
Line range hint
4-4
: Remove multiple consecutive blank lines.There are multiple consecutive blank lines which should be reduced to a single blank line for better readability.
- - +Tools
Markdownlint
3-3: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
packages/engine-cli/README.md (1)
Line range hint
3-3
: Fix grammatical issue.The phrase "for create new designer/plugin/..." should be corrected to "for creating new designers/plugins/..." for better readability.
- tiny-engine cli for create new designer/plugin/... + tiny-engine cli for creating new designers/plugins/...packages/engine-cli/src/commands/create.js (1)
[!TIP]
Codebase VerificationMissing template directories
The directories
template/designer
andtemplate/plugin
do not exist in the repository. This will cause thecreatePlatform
andcreatePlugin
functions to fail when attempting to copy the template files. Please ensure that these directories and their contents are added to the repository.
template/designer
directory is missing.template/plugin
directory is missing.Analysis chain
Line range hint
18-36
: LGTM!The functions
createPlatform
andcreatePlugin
are straightforward and correctly handle file copying and logging.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the paths and commands in createPlatform and createPlugin functions. # Test: Check if the template directories exist and contain necessary files. # Expect: Directories and files should exist. fd --type d 'template/designer' --exec ls fd --type d 'template/plugin' --exec lsLength of output: 81
Script:
#!/bin/bash # Description: Re-verify the existence of the template directories and list their contents. # Check if the 'template/designer' directory exists and list its contents fd --type d 'template/designer' # Check if the 'template/plugin' directory exists and list its contents fd --type d 'template/plugin' # List files inside 'template/designer' if it exists if [ -d "template/designer" ]; then echo "Contents of template/designer:" ls template/designer else echo "Directory template/designer does not exist." fi # List files inside 'template/plugin' if it exists if [ -d "template/plugin" ]; then echo "Contents of template/plugin:" ls template/plugin else echo "Directory template/plugin does not exist." fiLength of output: 311
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- packages/design-core/index.js (1 hunks)
- packages/engine-cli/README.md (1 hunks)
- packages/engine-cli/README.zh-CN.md (1 hunks)
- packages/engine-cli/package.json (1 hunks)
- packages/engine-cli/src/commands/create.js (2 hunks)
- packages/engine-cli/src/index.js (1 hunks)
- packages/engine-cli/template/plugin/README.md (1 hunks)
- packages/engine-cli/template/plugin/index.js (1 hunks)
- packages/engine-cli/template/plugin/meta.js (1 hunks)
- packages/engine-cli/template/plugin/package.json (1 hunks)
- packages/engine-cli/template/plugin/src/Main.vue (1 hunks)
- packages/engine-cli/template/plugin/src/composable/index.js (1 hunks)
- packages/engine-cli/template/plugin/src/composable/usePluginDemo.js (1 hunks)
- packages/engine-cli/template/plugin/vite.config.js (1 hunks)
Files skipped from review due to trivial changes (4)
- packages/engine-cli/README.zh-CN.md
- packages/engine-cli/template/plugin/meta.js
- packages/engine-cli/template/plugin/package.json
- packages/engine-cli/template/plugin/src/composable/usePluginDemo.js
Additional context used
Markdownlint
packages/engine-cli/template/plugin/README.md
3-3: Expected: 1; Actual: 2
Multiple consecutive blank lines(MD012, no-multiple-blanks)
4-4: Expected: 1; Actual: 3
Multiple consecutive blank lines(MD012, no-multiple-blanks)
LanguageTool
packages/engine-cli/README.md
[uncategorized] ~3-~3: This verb may not be in the correct form. Consider using a different form for this context.
Context: # engine-cli tiny-engine cli for create new designer/plugin/... ## dev ```sh ...(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
Additional comments not posted (10)
packages/engine-cli/template/plugin/src/Main.vue (1)
1-13
: LGTM!The Vue component is well-structured and correctly uses the
PluginPanel
component with scoped slots for header and content.packages/engine-cli/template/plugin/src/composable/index.js (1)
15-19
: LGTM!The
PluginDemoService
is well-defined and correctly imports the necessary dependencies.packages/engine-cli/template/plugin/index.js (1)
1-28
: LGTM!The default export object is well-structured, including metadata, API, UI entry, and plugin services.
packages/engine-cli/package.json (1)
13-36
: LGTM!The package configuration updates are straightforward and include necessary dependencies and repository information.
packages/engine-cli/template/plugin/vite.config.js (1)
1-36
: LGTM!The Vite configuration is standard and includes necessary plugins and build options.
packages/engine-cli/src/index.js (4)
13-14
: LGTM!The import statements for
input
,select
,createPlatform
, andcreatePlugin
are correct.
19-23
: LGTM!The
create-platform
command is well-defined with a clear description in both English and Chinese.
25-30
: LGTM!The
create-plugin
command is well-defined with a clear description in both English and Chinese.
32-68
: LGTM!The
create
command is well-defined and prompts the user for input to create either a platform or a plugin. The descriptions and validation are clear and include both English and Chinese. The use oftypeMapper
to map the selected type to the corresponding function is a good practice.packages/design-core/index.js (1)
36-36
: LGTM!The export statement correctly adds
PluginPanel
to the exports, enabling its use in other modules.
* feat: add simple plugin template * fix: change by code review * fix: includes template and bind file to npm
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Documentation
engine-cli
tool's README to clarify and improve usage instructions for creating platforms and plugins.New Features
Dependencies
package.json
to include new dependencies (esbuild
,@inquirer/prompts
) and updated existing ones (chalk
,commander
). AddedpublishConfig
for public access and updated repository details.