Skip to content

Commit 3e1792c

Browse files
authored
fix: add suffix to template files (#362)
Add `.hbs` as a suffix to all Handlebars template files.
1 parent ebb48ec commit 3e1792c

Some content is hidden

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

44 files changed

+92
-98
lines changed

.eslintrc.local.json

-6
This file was deleted.

README.md

+11-11
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/content/_job-matrix.yml renamed to lib/content/_job-matrix-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ defaults:
2626
run:
2727
shell: $\{{ matrix.platform.shell }}
2828
steps:
29-
{{> stepsSetup jobIsMatrix=true }}
29+
{{> stepsSetupYml jobIsMatrix=true }}

lib/content/_job-release-integration.yml renamed to lib/content/_job-release-integration-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ defaults:
2929
run:
3030
shell: bash
3131
steps:
32-
{{> stepNode lockfile=false }}
32+
{{> stepNodeYml lockfile=false }}
3333
- name: View in Registry
3434
run: |
3535
EXIT_CODE=0

lib/content/_job.yml renamed to lib/content/_job-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ defaults:
55
run:
66
shell: bash
77
steps:
8-
{{> stepsSetup }}
8+
{{> stepsSetupYml }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/content/_steps-setup-yml.hbs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{~#if jobCheck}}{{> stepChecksYml }}{{/if}}
2+
{{~#unless jobSkipSetup}}
3+
{{> stepGitYml }}
4+
{{> stepNodeYml }}
5+
{{> stepDepsYml }}
6+
{{/unless}}

lib/content/_steps-setup.yml

-6
This file was deleted.

lib/content/audit.yml renamed to lib/content/audit-yml.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ on:
88

99
jobs:
1010
audit:
11-
{{> job jobName="Audit Dependencies" jobDepFlags="--package-lock" }}
12-
{{> stepAudit }}
11+
{{> jobYml jobName="Audit Dependencies" jobDepFlags="--package-lock" }}
12+
{{> stepAuditYml }}
File renamed without changes.

lib/content/ci-release.yml renamed to lib/content/ci-release-yml.hbs

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ on:
1919

2020
jobs:
2121
lint-all:
22-
{{> job
22+
{{> jobYml
2323
jobName="Lint All"
2424
jobCheck=(obj sha="inputs.check-sha")
2525
jobCheckout=(obj ref="${{ inputs.ref }}")
2626
}}
27-
{{> stepLint jobRunFlags=allFlags }}
28-
{{> stepChecks jobCheck=true }}
27+
{{> stepLintYml jobRunFlags=allFlags }}
28+
{{> stepChecksYml jobCheck=true }}
2929

3030
test-all:
31-
{{> jobMatrix
31+
{{> jobMatrixYml
3232
jobName="Test All"
3333
jobCheck=(obj sha="inputs.check-sha")
3434
jobCheckout=(obj ref="${{ inputs.ref }}")
3535
}}
36-
{{> stepTest jobRunFlags=allFlags }}
37-
{{> stepChecks jobCheck=true }}
36+
{{> stepTestYml jobRunFlags=allFlags }}
37+
{{> stepChecksYml jobCheck=true }}

lib/content/ci-yml.hbs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI {{~#if isWorkspace}} - {{ pkgName }}{{/if}}
2+
3+
on:
4+
{{> onCiYml }}
5+
6+
jobs:
7+
lint:
8+
{{> jobYml jobName="Lint" }}
9+
{{> stepLintYml jobRunFlags=pkgFlags }}
10+
11+
test:
12+
{{> jobMatrixYml jobName="Test" }}
13+
{{> stepTestYml jobRunFlags=pkgFlags }}

lib/content/ci.yml

-13
This file was deleted.

lib/content/codeql-analysis.yml renamed to lib/content/codeql-analysis-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
contents: read
2525
security-events: write
2626
steps:
27-
{{> stepGit }}
27+
{{> stepGitYml }}
2828
- name: Initialize CodeQL
2929
uses: github/codeql-action/init@v2
3030
with:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/content/index.js

+26-26
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,46 @@ const isPublic = (p) => p.config.isPublic
55
const sharedRootAdd = (name) => ({
66
// release
77
'.github/workflows/release.yml': {
8-
file: 'release.yml',
8+
file: 'release-yml.hbs',
99
filter: isPublic,
1010
},
1111
'.github/workflows/ci-release.yml': {
12-
file: 'ci-release.yml',
12+
file: 'ci-release-yml.hbs',
1313
filter: isPublic,
1414
},
1515
'.release-please-manifest.json': {
16-
file: 'release-please-manifest.json',
16+
file: 'release-please-manifest-json.hbs',
1717
filter: isPublic,
1818
parser: (p) => class extends p.JsonMerge {
1919
comment = null
2020
},
2121
},
2222
'release-please-config.json': {
23-
file: 'release-please-config.json',
23+
file: 'release-please-config-json.hbs',
2424
filter: isPublic,
2525
parser: (p) => class extends p.JsonMerge {
2626
comment = null
2727
},
2828
},
2929
// this lint commits which is only necessary for releases
3030
'.github/workflows/pull-request.yml': {
31-
file: 'pull-request.yml',
31+
file: 'pull-request-yml.hbs',
3232
filter: isPublic,
3333
},
3434
// ci
35-
'.github/matchers/tap.json': 'tap.json',
36-
[`.github/workflows/ci${name ? `-${name}` : ''}.yml`]: 'ci.yml',
35+
'.github/matchers/tap.json': 'tap-json.hbs',
36+
[`.github/workflows/ci${name ? `-${name}` : ''}.yml`]: 'ci-yml.hbs',
3737
// dependabot
3838
'.github/dependabot.yml': {
39-
file: 'dependabot.yml',
39+
file: 'dependabot-yml.hbs',
4040
filter: (p) => p.config.dependabot,
4141
},
4242
'.github/workflows/post-dependabot.yml': {
43-
file: 'post-dependabot.yml',
43+
file: 'post-dependabot-yml.hbs',
4444
filter: (p) => p.config.dependabot,
4545
},
4646
'.github/settings.yml': {
47-
file: 'settings.yml',
47+
file: 'settings-yml.hbs',
4848
filter: (p) => !p.config.isReleaseBranch,
4949
},
5050
})
@@ -61,12 +61,12 @@ const sharedRootRm = () => ({
6161
// Changes applied to the root of the repo
6262
const rootRepo = {
6363
add: {
64-
'.commitlintrc.js': 'commitlintrc.js',
65-
'.github/ISSUE_TEMPLATE/bug.yml': 'bug.yml',
66-
'.github/ISSUE_TEMPLATE/config.yml': 'config.yml',
67-
'.github/CODEOWNERS': 'CODEOWNERS',
68-
'.github/workflows/audit.yml': 'audit.yml',
69-
'.github/workflows/codeql-analysis.yml': 'codeql-analysis.yml',
64+
'.commitlintrc.js': 'commitlintrc-js.hbs',
65+
'.github/ISSUE_TEMPLATE/bug.yml': 'bug-yml.hbs',
66+
'.github/ISSUE_TEMPLATE/config.yml': 'config-yml.hbs',
67+
'.github/CODEOWNERS': 'CODEOWNERS.hbs',
68+
'.github/workflows/audit.yml': 'audit-yml.hbs',
69+
'.github/workflows/codeql-analysis.yml': 'codeql-analysis-yml.hbs',
7070
...sharedRootAdd(),
7171
},
7272
rm: {
@@ -84,15 +84,15 @@ const rootRepo = {
8484
const rootModule = {
8585
add: {
8686
'.eslintrc.js': {
87-
file: 'eslintrc.js',
87+
file: 'eslintrc-js.hbs',
8888
filter: (p) => p.config.eslint,
8989
},
90-
'.gitignore': 'gitignore',
91-
'.npmrc': 'npmrc',
92-
'SECURITY.md': 'SECURITY.md',
93-
'CODE_OF_CONDUCT.md': 'CODE_OF_CONDUCT.md',
94-
'CONTRIBUTING.md': 'CONTRIBUTING.md',
95-
'package.json': 'pkg.json',
90+
'.gitignore': 'gitignore.hbs',
91+
'.npmrc': 'npmrc.hbs',
92+
'SECURITY.md': 'SECURITY-md.hbs',
93+
'CODE_OF_CONDUCT.md': 'CODE_OF_CONDUCT-md.hbs',
94+
'CONTRIBUTING.md': 'CONTRIBUTING-md.hbs',
95+
'package.json': 'package-json.hbs',
9696
},
9797
rm: [
9898
'.eslintrc.!(js|local.*)',
@@ -115,11 +115,11 @@ const workspaceRepo = {
115115
const workspaceModule = {
116116
add: {
117117
'.eslintrc.js': {
118-
file: 'eslintrc.js',
118+
file: 'eslintrc-js.hbs',
119119
filter: (p) => p.config.eslint,
120120
},
121-
'.gitignore': 'gitignore',
122-
'package.json': 'pkg.json',
121+
'.gitignore': 'gitignore.hbs',
122+
'package.json': 'package-json.hbs',
123123
},
124124
rm: [
125125
'.npmrc',
File renamed without changes.
File renamed without changes.

lib/content/post-dependabot.yml renamed to lib/content/post-dependabot-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88

99
jobs:
1010
template-oss:
11-
{{> job
11+
{{> jobYml
1212
jobName="template-oss"
1313
jobIf="github.actor == 'dependabot[bot]'"
1414
jobCheckout=(obj ref="${{ github.event.pull_request.head.ref }}")

lib/content/pull-request.yml renamed to lib/content/pull-request-yml.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
commitlint:
13-
{{> job jobName="Lint Commits" jobCheckout=(obj fetch-depth=0) }}
13+
{{> jobYml jobName="Lint Commits" jobCheckout=(obj fetch-depth=0) }}
1414
- name: Run Commitlint on Commits
1515
id: commit
1616
continue-on-error: true

lib/content/release.yml renamed to lib/content/release-yml.hbs

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
pr-number: $\{{ steps.release.outputs.pr-number }}
2828
comment-id: $\{{ steps.pr-comment.outputs.result }}
2929
check-id: $\{{ steps.check.outputs.check_id }}
30-
{{> job jobName="Release" }}
30+
{{> jobYml jobName="Release" }}
3131
- name: Release Please
3232
id: release
3333
env:
@@ -66,14 +66,14 @@ jobs:
6666
}
6767

6868
return commentId
69-
{{> stepChecks jobCheck=(obj name="Release" sha="steps.release.outputs.pr-sha") }}
69+
{{> stepChecksYml jobCheck=(obj name="Release" sha="steps.release.outputs.pr-sha") }}
7070

7171
update:
7272
needs: release
7373
outputs:
7474
sha: $\{{ steps.commit.outputs.sha }}
7575
check-id: $\{{ steps.check.outputs.check_id }}
76-
{{> job
76+
{{> jobYml
7777
jobName="Update - Release"
7878
jobIf="needs.release.outputs.pr"
7979
jobCheckout=(obj ref="${{ needs.release.outputs.branch }}" fetch-depth=0)
@@ -94,8 +94,8 @@ jobs:
9494
git commit --all --amend --no-edit || true
9595
git push --force-with-lease
9696
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
97-
{{> stepChecks jobName="Update - Release" jobCheck=(obj sha="steps.commit.outputs.sha" name="Release" )}}
98-
{{> stepChecks jobCheck=(obj id="needs.release.outputs.check-id" )}}
97+
{{> stepChecksYml jobName="Update - Release" jobCheck=(obj sha="steps.commit.outputs.sha" name="Release" )}}
98+
{{> stepChecksYml jobCheck=(obj id="needs.release.outputs.check-id" )}}
9999

100100
ci:
101101
name: CI - Release
@@ -108,7 +108,7 @@ jobs:
108108

109109
post-ci:
110110
needs: [release, update, ci]
111-
{{> job jobName="Post CI - Release" jobIf="needs.release.outputs.pr && always()" jobSkipSetup=true }}
111+
{{> jobYml jobName="Post CI - Release" jobIf="needs.release.outputs.pr && always()" jobSkipSetup=true }}
112112
- name: Get Needs Result
113113
id: needs-result
114114
run: |
@@ -121,11 +121,11 @@ jobs:
121121
result="success"
122122
fi
123123
echo "result=$result" >> $GITHUB_OUTPUT
124-
{{> stepChecks jobCheck=(obj id="needs.update.outputs.check-id" status="steps.needs-result.outputs.result") }}
124+
{{> stepChecksYml jobCheck=(obj id="needs.update.outputs.check-id" status="steps.needs-result.outputs.result") }}
125125

126126
post-release:
127127
needs: release
128-
{{> job jobName="Post Release - Release" jobIf="needs.release.outputs.releases" jobSkipSetup=true }}
128+
{{> jobYml jobName="Post Release - Release" jobIf="needs.release.outputs.releases" jobSkipSetup=true }}
129129
- name: Create Release PR Comment
130130
uses: actions/github-script@v6
131131
env:
@@ -163,11 +163,11 @@ jobs:
163163
needs: release
164164
name: Release Integration
165165
if: needs.release.outputs.release
166-
{{> jobReleaseIntegration }}
166+
{{> jobReleaseIntegrationYml }}
167167

168168
post-release-integration:
169169
needs: [release, release-integration]
170-
{{> job jobName="Post Release Integration - Release" jobIf="needs.release.outputs.release && always()" jobSkipSetup=true }}
170+
{{> jobYml jobName="Post Release Integration - Release" jobIf="needs.release.outputs.release && always()" jobSkipSetup=true }}
171171
- name: Get Needs Result
172172
id: needs-result
173173
run: |
File renamed without changes.
File renamed without changes.

test/apply/allow-paths.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ t.test('works with custom content', async (t) => {
3434
},
3535
testdir: {
3636
content_dir: {
37-
'paths.json': '{{{json allowPaths}}}',
38-
'index.js': 'module.exports={rootRepo:{add:{"paths.json":"paths.json"}}}',
37+
'paths-json.hbs': '{{{json allowPaths}}}',
38+
'index.js': 'module.exports={rootRepo:{add:{"paths.json":"paths-json.hbs"}}}',
3939
},
4040
},
4141
})

0 commit comments

Comments
 (0)