Skip to content

Commit 1c5a950

Browse files
authored
fix: cursor added the comments to every stencil block. (#20)
* fix: cursor added the comments to every stencil block. * Move comments outside the blocks * Fix build issue
1 parent e1b4d07 commit 1c5a950

File tree

10 files changed

+34
-0
lines changed

10 files changed

+34
-0
lines changed

.github/workflows/build-release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
contents: write
2727
actions: read
2828
steps:
29+
# Add CI secret/auth steps here (e.g. configure AWS, custom tokens).
2930
## <<Stencil::Block(getMoreCiSecrets)>>
3031

3132
## <</Stencil::Block>>
@@ -51,17 +52,20 @@ jobs:
5152
with:
5253
github-token: ${{ github.token }}
5354
version: "latest"
55+
# Add auth steps for build/test here (e.g. login to private registry).
5456
## <<Stencil::Block(buildtestauth)>>
5557
## <</Stencil::Block>>
5658
- name: Build Test repo
5759
run: mise run buildtest
5860
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
61+
# Add env vars for the Build Test repo step here.
5962
## <<Stencil::Block(buildTestEnvVars)>>
6063

6164
## <</Stencil::Block>>
6265
- name: Run Tests
6366
run: mise run runtest
6467
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
68+
# Add env vars for the Run Tests step here.
6569
## <<Stencil::Block(runTestEnvVars)>>
6670

6771
## <</Stencil::Block>>
@@ -71,13 +75,15 @@ jobs:
7175
run: mise run gentable
7276
env:
7377
# Fill in GH_TOKEN env with a different token here if you need a custom token to read module dependencies
78+
# Override token for README updates here. Default: GH_TOKEN from github.token.
7479
## <<Stencil::Block(readmeUpdateGhToken)>>
7580
GH_TOKEN: ${{ github.token }}
7681
## <</Stencil::Block>>
7782
- name: Commit back any changes
7883
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 #v5
7984
with:
8085
commit_message: Update README.md manifest options table
86+
# Add extra build/test steps here (run after standard build and test).
8187
## <<Stencil::Block(buildteststeps)>>
8288

8389
## <</Stencil::Block>>
@@ -116,6 +122,7 @@ jobs:
116122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117123
run: npx semantic-release
118124

125+
# Add additional workflow jobs here (alongside build-and-test and build-release).
119126
## <<Stencil::Block(extraActions)>>
120127

121128
## <</Stencil::Block>>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ tests/native/*
5454
!tests/template
5555
tests/template/*
5656
!tests/template/stencil.yaml
57+
# Add additional gitignore patterns here (e.g. "*.log", "custom-dir/").
5758
## <<Stencil::Block(ignores)>>
5859

5960
## <</Stencil::Block>>

.mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tools]
22
nodejs = "lts"
33
pnpm = "latest"
4+
# Add additional tool versions here (e.g. rust = "1.75"). Installed via mise alongside defaults.
45
## <<Stencil::Block(additionalTools)>>
56

67
## <</Stencil::Block>>
@@ -29,6 +30,7 @@ done
2930
[tasks.runtest]
3031
description = 'Run the tests'
3132
dir = "tests"
33+
# Customize test runner: override run command and/or add env vars for the runtest task.
3234
## <<Stencil::Block(runTests)>>
3335
run = """
3436
#!/usr/bin/env bash
@@ -43,6 +45,7 @@ mise run test
4345
description = 'Generate the README.md table of arguments'
4446
run = "node scripts/yamltotable.js"
4547

48+
# Add custom mise tasks here (e.g. [tasks.mytask] description = "...", run = "...").
4649
## <<Stencil::Block(tasks)>>
4750

4851
## <</Stencil::Block>>

manifest.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: github.com/udemy/stencil-module-base
22
type: templates
33
arguments:
4+
# Add custom Stencil module arguments here. Used in templates when generating projects.
45
## <<Stencil::Block(arguments)>>
56
nativeModule:
67
required: false
@@ -35,9 +36,11 @@ arguments:
3536
description: package.json scripts to add to the generated package.json (key/value map)
3637
## <</Stencil::Block>>
3738
modules:
39+
# Add additional Stencil modules to include. Loaded and available during project generation.
3840
## <<Stencil::Block(modules)>>
3941

4042
## <</Stencil::Block>>
43+
# Add extra manifest config here (e.g. postRunCommand, hooks).
4144
## <<Stencil::Block(extra)>>
4245
postRunCommand:
4346
- name: Install/Update pnpm deps to lockfile

templates/.github/workflows/build-release.yml.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
contents: write
3737
actions: read
3838
steps:
39+
# Add CI secret/auth steps here (e.g. configure AWS, custom tokens).
3940
## <<Stencil::Block(getMoreCiSecrets)>>
4041
{{ file.Block "getMoreCiSecrets" }}
4142
## <</Stencil::Block>>
@@ -79,6 +80,7 @@ jobs:
7980
run: mise run build
8081
- name: Run Go Tests
8182
run: go run gotest.tools/gotestsum@latest
83+
# Add env vars for Go tests here (e.g. TEST_DB_URL).
8284
## <<Stencil::Block(gotestvars)>>
8385
{{ file.Block "gotestvars" }}
8486
## <</Stencil::Block>>
@@ -89,18 +91,21 @@ jobs:
8991
with:
9092
github-token: {{ "${{ github.token }}" }}
9193
version: 'latest'
94+
# Add auth steps for build/test here (e.g. login to private registry).
9295
## <<Stencil::Block(buildtestauth)>>
9396
{{ file.Block "buildtestauth" }}
9497
## <</Stencil::Block>>
9598
- name: Build Test repo
9699
run: mise run buildtest
97100
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
101+
# Add env vars for the Build Test repo step here.
98102
## <<Stencil::Block(buildTestEnvVars)>>
99103
{{ file.Block "buildTestEnvVars" }}
100104
## <</Stencil::Block>>
101105
- name: Run Tests
102106
run: mise run runtest
103107
# Fill in env: -> GITHUB_TOKEN here if you need a custom token to read module dependencies
108+
# Add env vars for the Run Tests step here.
104109
## <<Stencil::Block(runTestEnvVars)>>
105110
{{ file.Block "runTestEnvVars" }}
106111
## <</Stencil::Block>>
@@ -110,6 +115,7 @@ jobs:
110115
run: mise run gentable
111116
env:
112117
# Fill in GH_TOKEN env with a different token here if you need a custom token to read module dependencies
118+
# Override token for README updates here. Default: GH_TOKEN from github.token.
113119
## <<Stencil::Block(readmeUpdateGhToken)>>
114120
{{- if empty (file.Block "readmeUpdateGhToken") }}
115121
GH_TOKEN: {{ "${{ github.token }}" }}
@@ -121,6 +127,7 @@ jobs:
121127
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 #v5
122128
with:
123129
commit_message: Update README.md manifest options table
130+
# Add extra build/test steps here (run after standard build and test).
124131
## <<Stencil::Block(buildteststeps)>>
125132
{{ file.Block "buildteststeps" }}
126133
## <</Stencil::Block>>
@@ -192,6 +199,7 @@ jobs:
192199
args: release --release-notes tempchangelog.md --clean
193200
env:
194201
GITHUB_TOKEN: {{ "${{ secrets.GITHUB_TOKEN }}" }}
202+
# Add env vars for goreleaser here (e.g. CUSTOM_VAR from secrets).
195203
## <<Stencil::Block(goreleaserEnvVars)>>
196204
{{ file.Block "goreleaserEnvVars" }}
197205
## <</Stencil::Block>>
@@ -204,6 +212,7 @@ jobs:
204212
run: npx semantic-release
205213
{{- end }}
206214

215+
# Add additional workflow jobs here (alongside build-and-test and build-release).
207216
## <<Stencil::Block(extraActions)>>
208217
{{ file.Block "extraActions" }}
209218
## <</Stencil::Block>>

templates/.gitignore.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ tests/{{ $entry.Name }}/*
5454
{{ end -}}
5555
{{ end -}}
5656
{{ end -}}
57+
# Add additional gitignore patterns here (e.g. "*.log", "custom-dir/").
5758
## <<Stencil::Block(ignores)>>
5859
{{ file.Block "ignores" }}
5960
## <</Stencil::Block>>

templates/.goreleaser.yaml.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ builds:
1414
ldflags:
1515
- -s
1616
- -w
17+
# Add extra linker flags for the plugin build (e.g. -X main.version=1.0.0).
1718
## <<Stencil::Block(pluginLdflags)>>
1819
{{ file.Block "pluginLdflags" }}
1920
## <</Stencil::Block>>
@@ -22,13 +23,15 @@ builds:
2223
goarch:
2324
- amd64
2425
- arm64
26+
# Add extra architectures to build (e.g. "386", "arm"). Defaults: amd64, arm64.
2527
## <<Stencil::Block(pluginExtraArch)>>
2628
{{ file.Block "pluginExtraArch" }}
2729
## <</Stencil::Block>>
2830
goos:
2931
- linux
3032
- darwin
3133
- windows
34+
# Add extra OS targets to build (e.g. "freebsd", "openbsd"). Defaults: linux, darwin, windows.
3235
## <<Stencil::Block(pluginExtraOS)>>
3336
{{ file.Block "pluginExtraOS" }}
3437
## <</Stencil::Block>>

templates/.mise.toml.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ goreleaser = "latest"
1010
"go:golang.org/x/tools/cmd/goimports" = "latest"
1111
"go:github.com/thenativeweb/get-next-version" = "latest"
1212
{{- end }}
13+
# Add additional tool versions here (e.g. rust = "1.75"). Installed via mise alongside defaults.
1314
## <<Stencil::Block(additionalTools)>>
1415
{{ file.Block "additionalTools" }}
1516
## <</Stencil::Block>>
@@ -75,6 +76,7 @@ done
7576
[tasks.runtest]
7677
description = 'Run the tests'
7778
dir = "tests"
79+
# Customize test runner: override run command and/or add env vars for the runtest task.
7880
## <<Stencil::Block(runTests)>>
7981
{{- if (empty (file.Block "runTests")) }}
8082
env = {ENV_VAR_NAME = 'hooray'} # env vars for the script
@@ -92,6 +94,7 @@ echo "Tests are running"
9294
description = 'Generate the README.md table of arguments'
9395
run = "node scripts/yamltotable.js"
9496

97+
# Add custom mise tasks here (e.g. [tasks.mytask] description = "...", run = "...").
9598
## <<Stencil::Block(tasks)>>
9699
{{ file.Block "tasks" }}
97100
## <</Stencil::Block>>

templates/go.mod.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module github.com/{{ stencil.Arg "githubOrg" }}/{{ .Config.Name }}
55

66
go 1.25
77

8+
// Add extra Go module dependencies here. If empty, default require block is used; if set, it replaces the default.
89
// <<Stencil::Block(requires)>>
910
{{- if empty (trim (file.Block "requires")) }}
1011
require (

templates/manifest.yaml.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ type: templates
99
{{- fail "Either templateModule or nativeModule must be true" }}
1010
{{- end }}
1111
arguments:
12+
# Add custom Stencil module arguments here. Used in templates when generating projects.
1213
## <<Stencil::Block(arguments)>>
1314
{{ file.Block "arguments" }}
1415
## <</Stencil::Block>>
1516
modules:
17+
# Add additional Stencil modules to include. Loaded and available during project generation.
1618
## <<Stencil::Block(modules)>>
1719
{{ file.Block "modules" }}
1820
## <</Stencil::Block>>
21+
# Add extra manifest config here (e.g. postRunCommand, hooks).
1922
## <<Stencil::Block(extra)>>
2023
{{ file.Block "extra" }}
2124
## <</Stencil::Block>>

0 commit comments

Comments
 (0)