diff --git a/examples/test-input/Component/{{Name}}.tsx b/examples/test-input/Component/{{pascalCase name}}.tsx similarity index 100% rename from examples/test-input/Component/{{Name}}.tsx rename to examples/test-input/Component/{{pascalCase name}}.tsx diff --git a/src/scaffold.ts b/src/scaffold.ts index 9415bb9..9d7f0a6 100644 --- a/src/scaffold.ts +++ b/src/scaffold.ts @@ -16,7 +16,7 @@ import { handleTemplateFile, } from "./file" import { LogLevel, MinimalConfig, Resolver, ScaffoldCmdConfig, ScaffoldConfig } from "./types" -import { defaultHelpers, registerHelpers } from "./parser" +import { registerHelpers } from "./parser" import { log, logInitStep, logInputFile } from "./logger" import { parseConfigFile } from "./config" @@ -57,7 +57,7 @@ export async function Scaffold(config: ScaffoldConfig): Promise { registerHelpers(config) try { - config.data = { name: config.name, Name: defaultHelpers.pascalCase(config.name ?? ""), ...config.data } + config.data = { name: config.name, ...config.data } logInitStep(config) for (let _template of config.templates) { try { @@ -109,7 +109,7 @@ export async function Scaffold(config: ScaffoldConfig): Promise { * @category Main * @return {Promise} A promise that resolves when the scaffold is complete */ -Scaffold.fromConfig = async function( +Scaffold.fromConfig = async function ( /** The path or URL to the config file */ pathOrUrl: string, /** Information needed before loading the config */ diff --git a/tests/scaffold.test.ts b/tests/scaffold.test.ts index 7e5e4c5..7b4dbd6 100644 --- a/tests/scaffold.test.ts +++ b/tests/scaffold.test.ts @@ -32,7 +32,7 @@ const fileStructWithData = { const fileStructNested = { input: { "{{name}}-1.txt": "This should be in root", - "{{Name}}": { + "{{pascalCase name}}": { "{{name}}-2.txt": "Hello, my value is {{value}}", moreNesting: { "{{name}}-3.txt": "Hi! My value is actually NOT {{value}}!", @@ -257,7 +257,7 @@ describe("Scaffold", () => { test("should allow override function", async () => { await Scaffold({ name: "app_name", - output: (fullPath, basedir, basename) => join("custom-output", `${basename.split(".")[0]}`), + output: (_, __, basename) => join("custom-output", `${basename.split(".")[0]}`), templates: ["input"], data: { value: "1" }, verbose: 0,