-
Notifications
You must be signed in to change notification settings - Fork 261
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: engine-cli support create platform with params #626
base: refactor/develop
Are you sure you want to change the base?
feat: engine-cli support create platform with params #626
Conversation
WalkthroughThe changes consolidate engine configuration into dedicated files for better modularity and flexibility. Engine configurations like themes, materials, and scripts are now externalized to an Changes
Sequence DiagramsOverall Flow for Platform Creation with Enhanced OptionssequenceDiagram
User->>CLI: Run create-platform with options
CLI->>createPlatform: Pass name and options
createPlatform->>FileSystem: Check for existing folders
FileSystem-->>createPlatform: Response
createPlatform->>ConfigGenerator: Merge options and generate configuration
ConfigGenerator-->>createPlatform: Return config and package.json content
createPlatform->>FileSystem: Write config and package.json files
createPlatform->>Template: Copy templates
createPlatform-->>CLI: Creation completed
CLI-->>User: Notify creation success
Poem
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: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- designer-demo/engine.config.js (1 hunks)
- designer-demo/registry.js (2 hunks)
- packages/common/js/preview.js (1 hunks)
- packages/engine-cli/src/commands/create.js (2 hunks)
- packages/engine-cli/src/commands/generateConfig.js (1 hunks)
- packages/engine-cli/src/index.js (1 hunks)
- packages/engine-cli/template/designer/engine.config.js (1 hunks)
- packages/engine-cli/template/designer/registry.js (1 hunks)
Files skipped from review due to trivial changes (2)
- designer-demo/engine.config.js
- packages/engine-cli/template/designer/engine.config.js
Additional comments not posted (10)
packages/engine-cli/template/designer/registry.js (1)
49-49
: LGTM!The import of
engineConfig
and its usage in the exported configuration object look good.designer-demo/registry.js (1)
49-49
: LGTM!The import of
engineConfig
and its usage in the exported configuration object look good.packages/common/js/preview.js (1)
29-29
: LGTM!The update from
resState
tomaterialState
in the destructuring assignment looks good.packages/engine-cli/src/commands/create.js (1)
58-61
: LGTM!The
createPlugin
function looks good.packages/engine-cli/src/index.js (6)
21-21
: LGTM! The--theme
option is correctly implemented.The
--theme
option allows customization of the platform theme with a default value of 'light'.
22-22
: LGTM! The--platformId
option is correctly implemented.The
--platformId
option allows specifying a unique platform ID with a default value of '918'.
23-23
: LGTM! The--material
option is correctly implemented.The
--material
option allows specifying one or more material addresses with a default value of['/mock/bundle.json']
.
24-24
: LGTM! The--scripts
option is correctly implemented.The
--scripts
option allows specifying one or more scripts with a default value of an empty array.
25-25
: LGTM! The--styles
option is correctly implemented.The
--styles
option allows specifying one or more styles with a default value of an empty array.
26-27
: LGTM! ThecreatePlatform
function call is correctly implemented.The
createPlatform
function is called with the provided options, ensuring that the new options are utilized.However, ensure that all function calls to
createPlatform
match the new signature.
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/engine-cli/src/index.js (2 hunks)
- packages/engine-cli/template/designer/registry.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/engine-cli/src/index.js
Additional comments not posted (2)
packages/engine-cli/template/designer/registry.js (2)
47-47
: Verify the usage ofGenerateCodeService
.The addition of
GenerateCodeService
looks good.However, ensure that
GenerateCodeService
is correctly used within the file and the rest of the codebase.
49-49
: Verify the usage ofengineConfig
.The addition of
engineConfig
import looks good.However, ensure that
engineConfig
is correctly used within the file and the rest of the codebase.Verification successful
The
engineConfig
import and its usage are correctly implemented.The addition of
engineConfig
import inpackages/engine-cli/template/designer/registry.js
is appropriate and it is used consistently within the file and the rest of the codebase.
designer-demo/registry.js
:
import engineConfig from './engine.config'
config: engineConfig,
packages/engine-cli/template/designer/registry.js
:
import engineConfig from './engine.config'
config: engineConfig,
packages/build/vite-config/src/default-config.js
:
- Various functions utilizing
engineConfig
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `engineConfig` in the codebase. # Test: Search for the usage of `engineConfig`. Expect: Relevant usage in the codebase. rg --type javascript 'engineConfig'Length of output: 70
Script:
#!/bin/bash # Description: Verify the usage of `engineConfig` in the codebase. # Test: Search for the usage of `engineConfig` in JavaScript files. Expect: Relevant usage in the codebase. rg 'engineConfig' --glob '*.js'Length of output: 1072
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
New Features
create-platform
command to accept options for theme, platform ID, material address, scripts, and styles.Refactor
Bug Fixes