Skip to content

Commit 0bb282c

Browse files
committed
chore!: remove Name from default data
1 parent b57be8e commit 0bb282c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
File renamed without changes.

src/scaffold.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
handleTemplateFile,
1717
} from "./file"
1818
import { LogLevel, MinimalConfig, Resolver, ScaffoldCmdConfig, ScaffoldConfig } from "./types"
19-
import { defaultHelpers, registerHelpers } from "./parser"
19+
import { registerHelpers } from "./parser"
2020
import { log, logInitStep, logInputFile } from "./logger"
2121
import { parseConfigFile } from "./config"
2222

@@ -57,7 +57,7 @@ export async function Scaffold(config: ScaffoldConfig): Promise<void> {
5757

5858
registerHelpers(config)
5959
try {
60-
config.data = { name: config.name, Name: defaultHelpers.pascalCase(config.name ?? ""), ...config.data }
60+
config.data = { name: config.name, ...config.data }
6161
logInitStep(config)
6262
for (let _template of config.templates) {
6363
try {
@@ -109,7 +109,7 @@ export async function Scaffold(config: ScaffoldConfig): Promise<void> {
109109
* @category Main
110110
* @return {Promise<void>} A promise that resolves when the scaffold is complete
111111
*/
112-
Scaffold.fromConfig = async function(
112+
Scaffold.fromConfig = async function (
113113
/** The path or URL to the config file */
114114
pathOrUrl: string,
115115
/** Information needed before loading the config */

tests/scaffold.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const fileStructWithData = {
3232
const fileStructNested = {
3333
input: {
3434
"{{name}}-1.txt": "This should be in root",
35-
"{{Name}}": {
35+
"{{pascalCase name}}": {
3636
"{{name}}-2.txt": "Hello, my value is {{value}}",
3737
moreNesting: {
3838
"{{name}}-3.txt": "Hi! My value is actually NOT {{value}}!",
@@ -257,7 +257,7 @@ describe("Scaffold", () => {
257257
test("should allow override function", async () => {
258258
await Scaffold({
259259
name: "app_name",
260-
output: (fullPath, basedir, basename) => join("custom-output", `${basename.split(".")[0]}`),
260+
output: (_, __, basename) => join("custom-output", `${basename.split(".")[0]}`),
261261
templates: ["input"],
262262
data: { value: "1" },
263263
verbose: 0,

0 commit comments

Comments
 (0)