From 1c57f39f4da867564a9c0d85bb78a47fba67a0ef Mon Sep 17 00:00:00 2001 From: Noah Mason Date: Wed, 5 Jun 2024 15:43:53 -0400 Subject: [PATCH 1/3] Fixes repository url in package.json and adds `npm pkg fix` to fix script. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e8e2f71..007ee76 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ }, "repository": { "type": "git", - "url": "git@github.com: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" }, @@ -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" From b0c7f5b6c2bdbdfc7152aa98bb538115f220dcb1 Mon Sep 17 00:00:00 2001 From: Noah Mason Date: Wed, 5 Jun 2024 15:47:50 -0400 Subject: [PATCH 2/3] Parses repo uri option with `zod.url()`, adds the git+ssh protocol to the default repo uri option def. --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 1958b23..fdcc4cd 100644 --- a/index.js +++ b/index.js @@ -194,11 +194,11 @@ const optionDefs = [ type: 'string', title: 'Theme Repository URI', description: 'The theme repository URI', - default: 'git@github.com: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 || ''; }), }, { @@ -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. @@ -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, @@ -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, From a155c65afba735339228050d36270be8c21ced5f Mon Sep 17 00:00:00 2001 From: Noah Mason Date: Wed, 5 Jun 2024 15:48:09 -0400 Subject: [PATCH 3/3] 3.1.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3e2d10..d2f5c12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dreamsicle.io/create-wp-theme", - "version": "3.1.0", + "version": "3.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dreamsicle.io/create-wp-theme", - "version": "3.1.0", + "version": "3.1.1", "license": "GPL-3.0", "dependencies": { "chalk": "~4.1.2", diff --git a/package.json b/package.json index 007ee76..f071802 100644 --- a/package.json +++ b/package.json @@ -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",