Skip to content

Commit

Permalink
fix: mandatory component selection on create (#265)
Browse files Browse the repository at this point in the history
* fix: mandatory component selection on create

Signed-off-by: Dennis Meister <[email protected]>


---------

Signed-off-by: Dennis Meister <[email protected]>
  • Loading branch information
dennismeister93 authored May 15, 2024
1 parent 1383f3d commit 1b4d855
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
7 changes: 6 additions & 1 deletion src/commands/create/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ export default class Create extends Command {
corePromptResult.appName,
corePromptResult.example,
appManifestInterfaceAttributes,
packageIndex.getMandatoryExtensionsByCoreId(corePromptResult.chosenCore.id).map((ext: ExtensionComponent) => ext.id),
[
...(corePromptResult.example
? packageIndex.getMandatoryExtensionsByExampleForCore(corePromptResult.chosenCore.id, corePromptResult.appName)
: []),
...packageIndex.getMandatoryExtensionsByCoreId(corePromptResult.chosenCore.id).map((ext: ExtensionComponent) => ext.id),
],
);
return createData;
}
Expand Down
13 changes: 12 additions & 1 deletion testbench/test-create/vehicle-app-template/package-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@
]
}
]
},
{
"id": "devcontainer-setup-java",
"type": "extension",
"name": "devContainer Setup uProtocol Java",
"description": "VSCode devContainer setup for uProtocol Java applications",
"mandatory": true,
"compatibleCores": [
"uprotocol-core-java"
],
"parameters": []
}
]
},
Expand Down Expand Up @@ -136,7 +147,7 @@
{
"id": "src",
"description": "URI or path to VSS json",
"default": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v3.0/vss_rel_3.0.json",
"default": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
"required": true,
"type": "string"
},
Expand Down
2 changes: 1 addition & 1 deletion testbench/test-exec/app/AppManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"type": "vehicle-signal-interface",
"config": {
"src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v3.0/vss_rel_3.0.json",
"src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
"datapoints": {
"required": [
{
Expand Down
8 changes: 4 additions & 4 deletions testbench/test-init/.velocitasLegacy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"packages": [
{
"repo": "devenv-runtimes",
"version": "v2.2.6"
"version": "v3.1.1"
},
{
"repo": "devenv-github-workflows",
"version": "v4.1.4"
"version": "v6.0.1"
},
{
"repo": "devenv-github-templates",
"version": "v1.0.3"
"version": "v1.0.5"
},
{
"repo": "devenv-devcontainer-setup",
"version": "v1.4.7"
"version": "v2.2.0"
}
],
"variables": {
Expand Down
10 changes: 5 additions & 5 deletions testbench/test-init/.velocitasNew.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"packages": {
"https://github.com/eclipse-velocitas/pkg-velocitas-main.git": "v0.0.2",
"https://github.com/eclipse-velocitas/devenv-devcontainer-setup.git": "v2.0.0",
"https://github.com/eclipse-velocitas/devenv-runtimes.git": "v3.0.0",
"https://github.com/eclipse-velocitas/devenv-github-templates.git": "v1.0.3",
"https://github.com/eclipse-velocitas/devenv-github-workflows.git": "v5.0.0"
"https://github.com/eclipse-velocitas/devenv-devcontainer-setup.git": "v2.2.0",
"https://github.com/eclipse-velocitas/devenv-runtimes.git": "v3.1.1",
"https://github.com/eclipse-velocitas/devenv-github-templates.git": "v1.0.5",
"https://github.com/eclipse-velocitas/devenv-github-workflows.git": "v6.0.1"
},
"components": [
"vapp-core-python",
Expand All @@ -22,5 +22,5 @@
"appManifestPath": "./app/AppManifest.json",
"githubRepoId": "<myrepo>"
},
"cliVersion": "v0.6.3"
"cliVersion": "v0.9.0"
}
2 changes: 1 addition & 1 deletion testbench/test-init/app/AppManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"type": "vehicle-signal-interface",
"config": {
"src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v3.0/vss_rel_3.0.json",
"src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
"datapoints": {
"required": [
{
Expand Down

0 comments on commit 1b4d855

Please sign in to comment.