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

Commit 6e1827d

Browse files
committed
refactor: use .txt extension for defining templates
1 parent 546e1a1 commit 6e1827d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tasks/copyTemplates.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import { TaskFn } from '../src/contracts'
1515
import { packages } from '../src/boilerplate/packages'
1616

1717
const templates = [
18-
'server.ts',
19-
'start/app.ts',
20-
'start/kernel.ts',
21-
'start/routes.ts',
22-
'app/Exceptions/Handler.ts',
23-
'providers/AppProvider.ts',
18+
'server.txt',
19+
'start/app.txt',
20+
'start/kernel.txt',
21+
'start/routes.txt',
22+
'app/Exceptions/Handler.txt',
23+
'providers/AppProvider.txt',
2424
]
2525

2626
/**
@@ -38,7 +38,7 @@ const task: TaskFn = (absPath, _app, state) => {
3838
/**
3939
* Defining providers for the `start/app` file
4040
*/
41-
if (template === 'start/app.ts') {
41+
if (template === 'start/app.txt') {
4242
data.providers = []
4343
Object.keys(boilerPlatePackages).forEach((name) => {
4444
if (boilerPlatePackages[name].providers.length) {
@@ -52,16 +52,16 @@ const task: TaskFn = (absPath, _app, state) => {
5252
/**
5353
* Middleware based upon the type of project
5454
*/
55-
if (template === 'start/kernel.ts') {
55+
if (template === 'start/kernel.txt') {
5656
data.middleware = state.boilerplate === 'api'
5757
? [`'App/Middleware/SpoofAccept',`, `'Adonis/Addons/BodyParserMiddleware',`]
5858
: [`'Adonis/Addons/BodyParserMiddleware',`]
5959
}
6060

6161
new TemplateFile(
6262
absPath,
63-
template,
64-
join(__dirname, '..', 'templates', template.replace(/\.ts$/, '.txt')),
63+
template.replace(/\.txt$/, '.ts'),
64+
join(__dirname, '..', 'templates', template),
6565
)
6666
.apply(data)
6767
.commit()

0 commit comments

Comments
 (0)