Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.1.1 #48

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ const optionDefs = [
type: 'string',
title: 'Theme Repository URI',
description: 'The theme repository URI',
default: '[email protected]:example/wp-theme.git',
default: 'git+ssh://git@github.com:example/wp-theme.git',
isRequired: true,
isPrompted: true,
sanitize: (value => {
return zod.string().trim().safeParse(value).data || '';
return zod.string().trim().url().safeParse(value).data || '';
}),
},
{
Expand Down Expand Up @@ -560,6 +560,8 @@ function validate() {
}

async function runPrompt() {
// Prepare the relative theme path.
const relPath = path.relative(process.cwd(), themePath);
// Determine if any of the options should be prompted for by filtering
// the option definitions for those that are marked as `isPrompted`,
// and don't already have a value provided by the user.
Expand All @@ -573,7 +575,7 @@ async function runPrompt() {
if (promptedOptionDefs.length < 1) {
logInfo({
title: 'Creating theme',
description: `Creating "${options.themeName}" in ${path.relative(process.cwd(), themePath)}`,
description: `Creating "${options.themeName}" in ${relPath}`,
emoji: '⚡',
padding: 'bottom',
verbose: options.verbose,
Expand Down Expand Up @@ -614,7 +616,7 @@ async function runPrompt() {
// Confirm prompt completion and log the post-processed data for debugging.
logInfo({
title: 'Got it!',
description: `Creating "${options.themeName}" in ${path.relative(process.cwd(), themePath)}`,
description: `Creating "${options.themeName}" in ${relPath}`,
emoji: '👍',
padding: 'both',
verbose: options.verbose,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dreamsicle.io/create-wp-theme",
"version": "3.1.0",
"version": "3.1.1",
"type": "module",
"description": "A command line tool for creating modern, optimized WordPress themes.",
"main": "index.js",
Expand All @@ -10,9 +10,9 @@
},
"repository": {
"type": "git",
"url": "[email protected]:dreamsicle-io/create-wp-theme.git"
"url": "git+ssh://git@github.com/dreamsicle-io/create-wp-theme.git"
},
"homepage": "https://github.com/dreamsicle-io/create-wp-theme#readme",
"homepage": "https://github.com/dreamsicle-io/create-wp-theme",
"bugs": {
"url": "https://github.com/dreamsicle-io/create-wp-theme/issues"
},
Expand All @@ -39,7 +39,7 @@
"scripts": {
"test": "node index.js -p tests",
"lint": "eslint .",
"fix": "eslint --fix .",
"fix": "npm pkg fix && eslint --fix .",
"clean-tests": "rm -rf tests/**",
"clean-deps": "rm -rf node_modules/ package-lock.json",
"clean": "npm run clean-deps && npm run clean-tests"
Expand Down