Skip to content

Commit 578371a

Browse files
committed
feat: change file names from PascalCase to camelCase
1 parent 7752008 commit 578371a

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/templates/exportModel.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{#if imports}}
44

55
{{#each imports}}
6-
import type { {{{this}}} } from './{{{this}}}{{#if ../additionalModelFileExtension}}.models{{/if}}';
6+
import type { {{{this}}} } from './{{camelCase this}}{{#if ../additionalModelFileExtension}}.models{{/if}}';
77
{{/each}}
88
{{/if}}
99

src/templates/exportSaddlebackService.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{{#if imports}}
44
{{#each imports}}
5-
import type { {{{this}}} } from '../models/{{{this}}}{{#if ../additionalModelFileExtension}}.models{{/if}}';
5+
import type { {{{this}}} } from '../models/{{camelCase this}}{{#if ../additionalModelFileExtension}}.models{{/if}}';
66
{{/each}}
77
{{/if}}
88
import axios, {

src/utils/writeClientModels.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import camelCase from 'camelcase';
12
import { resolve } from 'path';
23

34
import type { Model } from '../client/interfaces/Model';
@@ -30,7 +31,7 @@ export const writeClientModels = async (
3031
additionalServiceFileExtension: boolean
3132
): Promise<void> => {
3233
for (const model of models) {
33-
const file = resolve(outputPath, `${model.name}${additionalModelFileExtension ? '.models' : ''}.ts`);
34+
const file = resolve(outputPath, `${camelCase(model.name)}${additionalModelFileExtension ? '.models' : ''}.ts`);
3435
const templateResult = templates.exports.model({
3536
...model,
3637
httpClient,

src/utils/writeSaddlebackClientServices.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import camelCase from 'camelcase';
12
import { resolve } from 'path';
23

34
import type { Service } from '../client/interfaces/Service';
@@ -39,7 +40,7 @@ export const writeSaddlebackClientServices = async (
3940
for (const service of services) {
4041
const file = resolve(
4142
outputPath,
42-
`${service.name}${postfix}${additionalServiceFileExtension ? '.service' : ''}.ts`
43+
`${camelCase(service.name)}${postfix}${additionalServiceFileExtension ? '.service' : ''}.ts`
4344
);
4445
const templateResult = templates.exports.saddlebackService({
4546
...service,

0 commit comments

Comments
 (0)