Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit b968a2a

Browse files
authored
feat: add version to module docs (#122)
1 parent 5b3edd9 commit b968a2a

File tree

26 files changed

+271
-207
lines changed

26 files changed

+271
-207
lines changed

.sample/README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ tags: [helper]
1313

1414
```hcl
1515
module "MODULE_NAME" {
16-
source = "https://registry.coder.com/modules/MODULE_NAME"
16+
source = "registry.coder.com/modules/MODULE_NAME/coder"
17+
version = "1.0.0"
1718
}
1819
```
1920

@@ -27,11 +28,12 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
2728

2829
```hcl
2930
module "MODULE_NAME" {
30-
source = "https://registry.coder.com/modules/MODULE_NAME"
31-
agent_id = coder_agent.example.id
32-
extensions = [
33-
"dracula-theme.theme-dracula"
34-
]
31+
source = "registry.coder.com/modules/MODULE_NAME/coder"
32+
version = "1.0.0"
33+
agent_id = coder_agent.example.id
34+
extensions = [
35+
"dracula-theme.theme-dracula"
36+
]
3537
}
3638
```
3739

@@ -43,12 +45,13 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
4345

4446
```hcl
4547
module "MODULE_NAME" {
46-
source = "https://registry.coder.com/modules/MODULE_NAME"
47-
agent_id = coder_agent.example.id
48-
extensions = [ "dracula-theme.theme-dracula" ]
49-
settings = {
50-
"workbench.colorTheme" = "Dracula"
51-
}
48+
source = "registry.coder.com/modules/MODULE_NAME/coder"
49+
version = "1.0.0"
50+
agent_id = coder_agent.example.id
51+
extensions = [ "dracula-theme.theme-dracula" ]
52+
settings = {
53+
"workbench.colorTheme" = "Dracula"
54+
}
5255
}
5356
```
5457

@@ -58,8 +61,9 @@ Run code-server in the background, don't fetch it from GitHub:
5861

5962
```hcl
6063
module "MODULE_NAME" {
61-
source = "https://registry.coder.com/modules/MODULE_NAME"
62-
agent_id = coder_agent.example.id
63-
offline = true
64+
source = "registry.coder.com/modules/MODULE_NAME/coder"
65+
version = "1.0.0"
66+
agent_id = coder_agent.example.id
67+
offline = true
6468
}
6569
```

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ $ bun test -t '<module>'
2020
You can test a module locally by updating the source as follows
2121

2222
```hcl
23-
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>"
23+
module "example" {
24+
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>"
25+
}
2426
```
2527

2628
> **Note:** This is the responsibility of the module author to implement tests for their module. and test the module locally before submitting a PR.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ e.g.
1616

1717
```hcl
1818
module "code-server" {
19-
source = "https://registry.coder.com/modules/code-server"
20-
agent_id = coder_agent.main.id
19+
source = "registry.coder.com/modules/code-server/coder"
20+
version = "1.0.0"
21+
agent_id = coder_agent.main.id
2122
}
2223
```
2324

aws-region/README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ Customize the preselected parameter value:
1616

1717
```hcl
1818
module "aws-region" {
19-
source = "https://registry.coder.com/modules/aws-region"
20-
default = "us-east-1"
19+
source = "registry.coder.com/modules/aws-region/coder"
20+
version = "1.0.0"
21+
default = "us-east-1"
2122
}
2223
2324
provider "aws" {
24-
region = module.aws_region.value
25+
region = module.aws_region.value
2526
}
2627
```
2728

@@ -35,18 +36,19 @@ Change the display name and icon for a region using the corresponding maps:
3536

3637
```hcl
3738
module "aws-region" {
38-
source = "https://registry.coder.com/modules/aws-region"
39-
default = "ap-south-1"
40-
custom_names = {
41-
"ap-south-1": "Awesome Mumbai!"
42-
}
43-
custom_icons = {
44-
"ap-south-1": "/emojis/1f33a.png"
45-
}
39+
source = "registry.coder.com/modules/aws-region/coder"
40+
version = "1.0.0"
41+
default = "ap-south-1"
42+
custom_names = {
43+
"ap-south-1": "Awesome Mumbai!"
44+
}
45+
custom_icons = {
46+
"ap-south-1": "/emojis/1f33a.png"
47+
}
4648
}
4749
4850
provider "aws" {
49-
region = module.aws_region.value
51+
region = module.aws_region.value
5052
}
5153
```
5254

@@ -58,12 +60,13 @@ Hide the Asia Pacific regions Seoul and Osaka:
5860

5961
```hcl
6062
module "aws-region" {
61-
source = "https://registry.coder.com/modules/aws-region"
62-
exclude = [ "ap-northeast-2", "ap-northeast-3" ]
63+
source = "registry.coder.com/modules/aws-region/coder"
64+
version = "1.0.0"
65+
exclude = [ "ap-northeast-2", "ap-northeast-3" ]
6366
}
6467
6568
provider "aws" {
66-
region = module.aws_region.value
69+
region = module.aws_region.value
6770
}
6871
```
6972

azure-region/README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ This module adds a parameter with all Azure regions, allowing developers to sele
1313

1414
```hcl
1515
module "azure_region" {
16-
source = "https://registry.coder.com/modules/azure-region"
17-
default = "eastus"
16+
source = "registry.coder.com/modules/azure-region/coder"
17+
version = "1.0.0"
18+
default = "eastus"
1819
}
1920
2021
resource "azurem_resource_group" "example" {
21-
location = module.azure_region.value
22+
location = module.azure_region.value
2223
}
2324
```
2425

@@ -32,17 +33,18 @@ Change the display name and icon for a region using the corresponding maps:
3233

3334
```hcl
3435
module "azure-region" {
35-
source = "https://registry.coder.com/modules/azure-region"
36-
custom_names = {
37-
"australia": "Go Australia!"
38-
}
39-
custom_icons = {
40-
"australia": "/icons/smiley.svg"
41-
}
36+
source = "registry.coder.com/modules/azure-region/coder"
37+
version = "1.0.0"
38+
custom_names = {
39+
"australia": "Go Australia!"
40+
}
41+
custom_icons = {
42+
"australia": "/icons/smiley.svg"
43+
}
4244
}
4345
4446
resource "azurerm_resource_group" "example" {
45-
location = module.azure_region.value
47+
location = module.azure_region.value
4648
}
4749
```
4850

@@ -54,17 +56,18 @@ Hide all regions in Australia except australiacentral:
5456

5557
```hcl
5658
module "azure-region" {
57-
source = "https://registry.coder.com/modules/azure-region"
58-
exclude = [
59-
"australia",
60-
"australiacentral2",
61-
"australiaeast",
62-
"australiasoutheast"
63-
]
59+
source = "registry.coder.com/modules/azure-region/coder"
60+
version = "1.0.0"
61+
exclude = [
62+
"australia",
63+
"australiacentral2",
64+
"australiaeast",
65+
"australiasoutheast"
66+
]
6467
}
6568
6669
resource "azurerm_resource_group" "example" {
67-
location = module.azure_region.value
70+
location = module.azure_region.value
6871
}
6972
```
7073

code-server/README.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
1313

1414
```hcl
1515
module "code-server" {
16-
source = "https://registry.coder.com/modules/code-server"
17-
agent_id = coder_agent.example.id
16+
source = "registry.coder.com/modules/code-server/coder"
17+
version = "1.0.0"
18+
agent_id = coder_agent.example.id
1819
}
1920
```
2021

@@ -26,7 +27,8 @@ module "code-server" {
2627

2728
```hcl
2829
module "code-server" {
29-
source = "https://registry.coder.com/modules/code-server"
30+
source = "registry.coder.com/modules/code-server/coder"
31+
version = "1.0.0"
3032
agent_id = coder_agent.example.id
3133
install_version = "4.8.3"
3234
}
@@ -38,11 +40,12 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
3840

3941
```hcl
4042
module "code-server" {
41-
source = "https://registry.coder.com/modules/code-server"
42-
agent_id = coder_agent.example.id
43-
extensions = [
44-
"dracula-theme.theme-dracula"
45-
]
43+
source = "registry.coder.com/modules/code-server/coder"
44+
version = "1.0.0"
45+
agent_id = coder_agent.example.id
46+
extensions = [
47+
"dracula-theme.theme-dracula"
48+
]
4649
}
4750
```
4851

@@ -54,12 +57,13 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
5457

5558
```hcl
5659
module "settings" {
57-
source = "https://registry.coder.com/modules/code-server"
58-
agent_id = coder_agent.example.id
59-
extensions = [ "dracula-theme.theme-dracula" ]
60-
settings = {
61-
"workbench.colorTheme" = "Dracula"
62-
}
60+
source = "registry.coder.com/modules/code-server/coder"
61+
version = "1.0.0"
62+
agent_id = coder_agent.example.id
63+
extensions = [ "dracula-theme.theme-dracula" ]
64+
settings = {
65+
"workbench.colorTheme" = "Dracula"
66+
}
6367
}
6468
```
6569

@@ -69,9 +73,10 @@ Just run code-server in the background, don't fetch it from GitHub:
6973

7074
```hcl
7175
module "settings" {
72-
source = "https://registry.coder.com/modules/code-server"
73-
agent_id = coder_agent.example.id
74-
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ]
76+
source = "registry.coder.com/modules/code-server/coder"
77+
version = "1.0.0"
78+
agent_id = coder_agent.example.id
79+
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ]
7580
}
7681
```
7782

@@ -81,8 +86,9 @@ Just run code-server in the background, don't fetch it from GitHub:
8186

8287
```hcl
8388
module "settings" {
84-
source = "https://registry.coder.com/modules/code-server"
85-
agent_id = coder_agent.example.id
86-
offline = true
89+
source = "registry.coder.com/modules/code-server/coder"
90+
version = "1.0.0"
91+
agent_id = coder_agent.example.id
92+
offline = true
8793
}
8894
```

coder-login/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Automatically logs the user into Coder when creating their workspace.
1313

1414
```hcl
1515
module "coder-login" {
16-
source = "https://registry.coder.com/modules/coder-login"
17-
agent_id = coder_agent.example.id
16+
source = "registry.coder.com/modules/coder-login/coder"
17+
version = "1.0.0"
18+
agent_id = coder_agent.example.id
1819
}
1920
```
2021

dotfiles/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Allow developers to optionally bring their own [dotfiles repository](https://dot
1313

1414
```hcl
1515
module "dotfiles" {
16-
source = "https://registry.coder.com/modules/dotfiles"
16+
source = "registry.coder.com/modules/dotfiles/coder"
17+
version = "1.0.0"
1718
agent_id = coder_agent.example.id
1819
}
1920
```

exoscale-instance-type/README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Customize the preselected parameter value:
1616

1717
```hcl
1818
module "exoscale-instance-type" {
19-
source = "https://registry.coder.com/modules/exoscale-instance-type"
20-
default = "standard.medium"
19+
source = "registry.coder.com/modules/exoscale-instance-type/coder"
20+
version = "1.0.0"
21+
default = "standard.medium"
2122
}
2223
2324
resource "exoscale_compute_instance" "instance" {
@@ -43,14 +44,15 @@ Change the display name a type using the corresponding maps:
4344

4445
```hcl
4546
module "exoscale-instance-type" {
46-
source = "https://registry.coder.com/modules/exoscale-instance-type"
47-
default = "standard.medium"
48-
custom_names = {
49-
"standard.medium": "Mittlere Instanz" # German translation
50-
}
51-
custom_descriptions = {
52-
"standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation
53-
}
47+
source = "registry.coder.com/modules/exoscale-instance-type/coder"
48+
version = "1.0.0"
49+
default = "standard.medium"
50+
custom_names = {
51+
"standard.medium": "Mittlere Instanz" # German translation
52+
}
53+
custom_descriptions = {
54+
"standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation
55+
}
5456
}
5557
5658
resource "exoscale_compute_instance" "instance" {
@@ -74,19 +76,20 @@ Show only gpu1 types
7476

7577
```hcl
7678
module "exoscale-instance-type" {
77-
source = "https://registry.coder.com/modules/exoscale-instance-type"
78-
default = "gpu.large"
79-
type_category = ["gpu"]
80-
exclude = [
81-
"gpu2.small",
82-
"gpu2.medium",
83-
"gpu2.large",
84-
"gpu2.huge",
85-
"gpu3.small",
86-
"gpu3.medium",
87-
"gpu3.large",
88-
"gpu3.huge"
89-
]
79+
source = "registry.coder.com/modules/exoscale-instance-type/coder"
80+
version = "1.0.0"
81+
default = "gpu.large"
82+
type_category = ["gpu"]
83+
exclude = [
84+
"gpu2.small",
85+
"gpu2.medium",
86+
"gpu2.large",
87+
"gpu2.huge",
88+
"gpu3.small",
89+
"gpu3.medium",
90+
"gpu3.large",
91+
"gpu3.huge"
92+
]
9093
}
9194
9295
resource "exoscale_compute_instance" "instance" {

0 commit comments

Comments
 (0)