Skip to content

Commit

Permalink
Change change-case import & deprecated paramCase (#163)
Browse files Browse the repository at this point in the history
* Change change-case import & deprecated paramCase

* Update changeCase usage
  • Loading branch information
pierregradelet authored Nov 9, 2023
1 parent 7a5904d commit 348f59f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cli/tasks/scaffold-component/scaffold-component.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Inquirer from "inquirer"
import changeCase from "change-case"
import * as changeCase from "change-case"
import createFile from "../../helpers/create-file.js"
import config from "../../config.js"
import logs from "../../helpers/logger.js"
Expand Down
6 changes: 3 additions & 3 deletions cli/tasks/scaffold-wp/builders/block.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logs from "../../../helpers/logger.js"
import config from "../../../config.js"
import Inquirer from "inquirer"
import changeCase from "change-case"
import * as changeCase from "change-case"
import * as mfs from "@cher-ami/mfs"
import createFile from "../../../helpers/create-file.js"

Expand Down Expand Up @@ -61,7 +61,7 @@ const buildBlock = async () => {
let blockName = "",
blockTitle = ""
await _askBlockName().then((answer) => {
blockName = changeCase.paramCase(answer.blockName)
blockName = changeCase.trainCase(answer.blockName)
blockTitle = answer.blockTitle
})

Expand Down Expand Up @@ -138,7 +138,7 @@ const buildBlockType = async () => {
const formatedBlocks = blockFolder.map((block) => {
const blockName = block.substring(block.lastIndexOf("/") + 1)
return {
name: changeCase.paramCase(blockName),
name: changeCase.trainCase(blockName),
upperCaseBlockName: changeCase.constantCase(blockName),
pasclaCaseName: blockName,
}
Expand Down
4 changes: 2 additions & 2 deletions cli/tasks/scaffold-wp/builders/option-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import logs from "../../../helpers/logger.js"
import config from "../../../config.js"
import createFile from "../../../helpers/create-file.js"
import Inquirer from "inquirer"
import changeCase from "change-case"
import * as changeCase from "change-case"

const _askOptionName = () => {
return Inquirer.prompt([
Expand Down Expand Up @@ -59,7 +59,7 @@ const buildOptionPage = () => {
let pageName = "",
pageTitle = ""
await _askOptionName().then((answer) => {
pageName = changeCase.paramCase(answer.pageName)
pageName = changeCase.trainCase(answer.pageName)
pageTitle = answer.pageTitle
})

Expand Down
4 changes: 2 additions & 2 deletions cli/tasks/scaffold-wp/builders/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logs from "../../../helpers/logger.js"
import config from "../../../config.js"
import Inquirer from "inquirer"
import changeCase from "change-case"
import * as changeCase from "change-case"
import createFile from "../../../helpers/create-file.js"

const _askPageName = () => {
Expand Down Expand Up @@ -70,7 +70,7 @@ const buildPage = () => {
let createTemplate;

await _askPageName().then((answer) => {
pageName = changeCase.paramCase(answer.pageName)
pageName = changeCase.trainCase(answer.pageName)
})

await _askIfTemplate().then((answer) => {
Expand Down
4 changes: 2 additions & 2 deletions cli/tasks/scaffold-wp/builders/post-type.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logs from "../../../helpers/logger.js"
import config from "../../../config.js"
import Inquirer from "inquirer"
import changeCase from "change-case"
import * as changeCase from "change-case"
import createFile from "../../../helpers/create-file.js"

const _askPostTypeName = () => {
Expand Down Expand Up @@ -93,7 +93,7 @@ const buildPostType = async () => {
upperSingularPostTypeName = "",
upperPluralPostTypeName = ""
await _askPostTypeName().then((answer) => {
postTypeName = changeCase.paramCase(answer.postTypeName)
postTypeName = changeCase.trainCase(answer.postTypeName)
upperSingularPostTypeName = answer.upperSingularPostTypeName
upperPluralPostTypeName = answer.upperPluralPostTypeName
})
Expand Down
4 changes: 2 additions & 2 deletions cli/tasks/setup/modules/setup-package-json.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Inquirer from "inquirer"
import changeCase from "change-case"
import * as changeCase from "change-case"
import * as mfs from "@cher-ami/mfs"
import logs from "../../../helpers/logger.js"
import path from "path"
Expand Down Expand Up @@ -42,7 +42,7 @@ export default async ({ packageJson, defaultProjectName, fakeMode } = {}) => {
type: "input",
message: "What's the project name? (dash-case)",
name: "projectName",
}).then((answer) => (projectName = changeCase.paramCase(answer.projectName)))
}).then((answer) => (projectName = changeCase.trainCase(answer.projectName)))
log("> new project name:", projectName)

// Ask user for author
Expand Down

0 comments on commit 348f59f

Please sign in to comment.