Skip to content

Commit 3adb74e

Browse files
committed
Add template with both DBA and XAPI
1 parent 000e795 commit 3adb74e

File tree

64 files changed

+3600
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3600
-25
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
dotnet new -i ./artifacts/${{ env.NUGET_NAME }}
8686
8787
- name: Create new module solution from template
88-
run: dotnet new vc-module-dba
88+
run: dotnet new vc-module-dba-xapi
8989

9090
- name: New module test build
9191
run: |

README.md

+22-24
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This repository contains `dotnet new` templates for Virto Commerce Modules.
44

55
## Templates
6+
* vc-module-dba-xapi - Creates a new Virto Commerce module with DB Agnostic and XAPI support.
67
* vc-module-dba - Creates a new Virto Commerce module with DB Agnostic support.
78
* vc-module-xapi - Creates a new Virto Commerce module with XAPI support.
89

@@ -12,78 +13,75 @@ This repository contains `dotnet new` templates for Virto Commerce Modules.
1213

1314
To get started, first install the templates:
1415

15-
```PowerShell
16+
```powershell
1617
dotnet new install VirtoCommerce.Module.Template
1718
```
1819

1920
### How to create a new module from template
2021

21-
* Open Windows PowerShell CMD
22+
* Open Windows PowerShell console
2223
* Navigate to your sources folder
23-
* Run command
24+
* Run one of the following commands depending on the type of module you want to create:
25+
26+
```powershell
27+
dotnet new vc-module-dba-xapi --ModuleName CustomerReviews --Author "Jon Doe" --CompanyName VirtoCommerce
28+
```
2429

25-
```PowerShell
30+
```powershell
2631
dotnet new vc-module-dba --ModuleName CustomerReviews --Author "Jon Doe" --CompanyName VirtoCommerce
2732
```
2833

29-
where `--ModuleName` is your module name, `--Author` is your name, and `--CompanyName` is your company name
34+
```powershell
35+
dotnet new vc-module-xapi --ModuleName CustomerReviews --Author "Jon Doe" --CompanyName VirtoCommerce
36+
```
37+
38+
where `--ModuleName` is your module name, `--Author` is your name, and `--CompanyName` is your company name.
3039

3140
* `vc-module-customer-reviews` folder with module solution will be created
3241
* You can pass PlatformVersion attribute to create a new module for specific version of Virto Commerce.
3342

34-
### How to create a new XAPI module from template
35-
There is a separate template named `vc-module-xapi` for an XAPI module.
36-
37-
* Open Windows PowerShell CMD
38-
* Navigate to your sources folder
39-
* Run command
40-
41-
```PowerShell
42-
dotnet new vc-module-xapi --ModuleName QuoteExperienceApi --Author "Jon Doe" --CompanyName VirtoCommerce
43-
```
44-
45-
## Parameters description
46-
47-
Default values based on latest [Stable 10 Release](https://www.virtocommerce.org/t/virtos-release-notes-december-2024/747#p-1340-platform-stable-bundle-10httpsgithubcomvirtocommercevc-modulesblobmasterbundlesv10packagejson-1)
43+
### Parameters description
4844

4945
| Options | Description | Type | Required | Default value |
5046
|--------|-------------|------|----------|---------------|
5147
| --Author (or -A) | Your name | string | Optional| John Doe |
5248
| --CompanyName (or -C) | Your company name| string | Optional | VirtoCommerce |
5349
| --ModuleName (or -M) | Your module name | string | Optional | NewModule |
50+
| --ModuleVersion | Your module version | string | Optional | 3.800.0 |
5451
| --PlatformVersion (or -P) | Virto Commerce platform version | string | Optional | 3.876.0 |
52+
| --CoreVersion | Virto Commerce Core module version | string | Optional | 3.800.0 |
5553
| --XapiVersion (or -X) | XAPI module version | string | Optional | 3.901.0 |
5654

5755
## How to uninstall
5856

5957
Run dotnet to uninstall templates
6058

61-
```PowerShell
59+
```powershell
6260
dotnet new uninstall VirtoCommerce.Module.Template
6361
```
6462

6563
## How to contribute
6664

6765
### Install templates locally
6866

69-
* Open Windows PowerShell CMD
67+
* Open Windows PowerShell console
7068
* Clone repository
7169

72-
```PowerShell
70+
```powershell
7371
git clone https://github.com/VirtoCommerce/vc-cli-module-template
7472
```
7573

7674
* Install downloaded templates
7775

78-
```PowerShell
76+
```powershell
7977
dotnet new install vc-cli-module-template\templates
8078
```
8179

8280
### How to uninstall locally installed templates
8381

8482
* Run command
8583

86-
```PowerShell
84+
```powershell
8785
dotnet new uninstall <full or relative path to the templates directory>
8886
```
8987

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"$schema": "http://json.schemastore.org/template",
3+
"author": "VirtoWay",
4+
"classifications": [ "ecommerce", "platform", "virtocommerce", "virto", "commerce", "experience", "api", "xapi" ],
5+
"identity": "VirtoCommerce3.Module.DBA.XAPI",
6+
"name": "Virto Commerce 3.x Database Agnostic and XAPI Module Template",
7+
"shortName": "vc-module-dba-xapi",
8+
"guids": [
9+
"11111111-1111-1111-1111-111111111111",
10+
"22222222-2222-2222-2222-222222222222",
11+
"33333333-3333-3333-3333-333333333333",
12+
"44444444-4444-4444-4444-444444444444",
13+
"55555555-5555-5555-5555-555555555555",
14+
"66666666-6666-6666-6666-666666666666",
15+
"77777777-7777-7777-7777-777777777777",
16+
"88888888-8888-8888-8888-888888888888",
17+
"99999999-9999-9999-9999-999999999999",
18+
"AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA",
19+
"BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB",
20+
"CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC"
21+
],
22+
"tags": {
23+
"language": "C#",
24+
"type": "project"
25+
},
26+
"symbols": {
27+
"Author": {
28+
"type": "parameter",
29+
"dataType": "string",
30+
"description": "Your name",
31+
"defaultValue": "John Doe",
32+
"replaces": "{Author}"
33+
},
34+
"CompanyName": {
35+
"type": "parameter",
36+
"dataType": "string",
37+
"description": "Your company name",
38+
"defaultValue": "VirtoCommerce",
39+
"replaces": "{CompanyName}"
40+
},
41+
"ModuleName": {
42+
"type": "parameter",
43+
"dataType": "string",
44+
"description": "Your module name",
45+
"defaultValue": "NewModule",
46+
"replaces": "{ModuleName}",
47+
"fileRename": "{ModuleName}"
48+
},
49+
"ModuleVersion": {
50+
"type": "parameter",
51+
"dataType": "string",
52+
"description": "Your module version",
53+
"defaultValue": "3.800.0",
54+
"replaces": "{ModuleVersion}"
55+
},
56+
"PlatformVersion": {
57+
"type": "parameter",
58+
"dataType": "string",
59+
"description": "Required Platform Version",
60+
"defaultValue": "3.876.0",
61+
"replaces": "{PlatformVersion}"
62+
},
63+
"CoreVersion": {
64+
"type": "parameter",
65+
"dataType": "string",
66+
"description": "Required Core module Version",
67+
"defaultValue": "3.800.0",
68+
"replaces": "{CoreVersion}"
69+
},
70+
"XapiVersion": {
71+
"type": "parameter",
72+
"dataType": "string",
73+
"description": "Required XAPI module Version",
74+
"defaultValue": "3.901.0",
75+
"replaces": "{XapiVersion}"
76+
},
77+
"KebabModuleName": {
78+
"type": "derived",
79+
"valueSource": "ModuleName",
80+
"valueTransform": "kebab",
81+
"replaces": "{KebabModuleName}",
82+
"fileRename": "{KebabModuleName}"
83+
},
84+
"copyrightYear": {
85+
"type": "generated",
86+
"generator": "now",
87+
"parameters": {
88+
"format": "yyyy"
89+
},
90+
"replaces": "{Year}"
91+
},
92+
"joinedModuleTitle": {
93+
"type": "generated",
94+
"generator": "join",
95+
"parameters": {
96+
"symbols": [
97+
{
98+
"type": "ref",
99+
"value": "CompanyName"
100+
},
101+
{
102+
"type": "ref",
103+
"value": "ModuleName"
104+
},
105+
{
106+
"type": "const",
107+
"value": "module"
108+
}
109+
],
110+
"separator": " "
111+
},
112+
"replaces": "{ModuleTitle}"
113+
},
114+
"joinedNamespace": {
115+
"type": "generated",
116+
"generator": "join",
117+
"parameters": {
118+
"symbols": [
119+
{
120+
"type": "ref",
121+
"value": "CompanyName"
122+
},
123+
{
124+
"type": "ref",
125+
"value": "ModuleName"
126+
}
127+
],
128+
"separator": "."
129+
},
130+
"fileRename": "{Namespace}",
131+
"replaces": "{Namespace}"
132+
}
133+
},
134+
"forms": {
135+
"kebab": {
136+
"identifier": "kebabCase"
137+
}
138+
}
139+
}

0 commit comments

Comments
 (0)