diff --git a/packages/create-astro-ghostcms/package.json b/packages/create-astro-ghostcms/package.json index 8c676a8b..08c0f7f4 100644 --- a/packages/create-astro-ghostcms/package.json +++ b/packages/create-astro-ghostcms/package.json @@ -1,6 +1,6 @@ { "name": "@matthiesenxyz/create-astro-ghostcms", - "version": "0.0.3-testfix1", + "version": "0.0.3-testfix2", "description": "Utility to quickly get started with our Integration and astro", "type": "module", "main": "./create-astro-ghostcms.mjs", diff --git a/packages/create-astro-ghostcms/src/utils/exitPrompt.js b/packages/create-astro-ghostcms/src/utils/exitPrompt.js deleted file mode 100644 index da9b6c08..00000000 --- a/packages/create-astro-ghostcms/src/utils/exitPrompt.js +++ /dev/null @@ -1,10 +0,0 @@ -import * as p from "@clack/prompts"; -import c from "picocolors"; - -/** - * @returns {never} - */ -export function exitPrompt() { - p.cancel(c.red("Operation Cancelled")); - process.exit(0); -} \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/utils/getModulePaths.js b/packages/create-astro-ghostcms/src/utils/getModulePaths.js deleted file mode 100644 index d4905e22..00000000 --- a/packages/create-astro-ghostcms/src/utils/getModulePaths.js +++ /dev/null @@ -1,13 +0,0 @@ -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -/** - * @param {string} url - */ -export function getModulePaths(url) { - const pathname = fileURLToPath(url); - const parts = pathname.split("/"); - const basename = parts.pop(); - const dirname = parts.join(path.sep); - return { pathname, dirname, basename }; -} diff --git a/packages/create-astro-ghostcms/src/utils/index.js b/packages/create-astro-ghostcms/src/utils/index.js index 0f2476c4..4fdfe281 100644 --- a/packages/create-astro-ghostcms/src/utils/index.js +++ b/packages/create-astro-ghostcms/src/utils/index.js @@ -1,6 +1,61 @@ -export * from "./exitPrompt"; -export * from "./getModulePaths"; -export * from "./isPackageManager"; -export * from "./isPathname"; -export * from "./normalizePath"; -export * from "./wait"; +import * as p from "@clack/prompts"; +import c from "picocolors"; +import path from "node:path"; +import os from "node:os"; +import { fileURLToPath } from "node:url"; + +/** + * @returns {never} + */ +export function exitPrompt() { + p.cancel(c.red("Operation Cancelled")); + process.exit(0); +} + +/** + * @param {string} url + */ +export function getModulePaths(url) { + const pathname = fileURLToPath(url); + const parts = pathname.split("/"); + const basename = parts.pop(); + const dirname = parts.join(path.sep); + return { pathname, dirname, basename }; +} + +/** + * + * @param {string} str + * @returns {str is PackageManager} + */ +export function isPackageManager(str) { + return str === "npm" || str === "yarn" || str === "pnpm"; +} + +/** + * @typedef {import("../../types").PackageManager} PackageManager + */ + +/** + * @param {string} str + */ +export function isPathname(str) { + return str.includes(path.sep); +} + +/** + * @param {string} pathname + */ +export function normalizePath(pathname) { + if (os.platform() === "win32") { + return path.win32.normalize(pathname); + } + return path.normalize(pathname); +} + +/** + * @param {number} ms + */ +export async function wait(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} diff --git a/packages/create-astro-ghostcms/src/utils/isPackageManager.js b/packages/create-astro-ghostcms/src/utils/isPackageManager.js deleted file mode 100644 index 6c88b743..00000000 --- a/packages/create-astro-ghostcms/src/utils/isPackageManager.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * - * @param {string} str - * @returns {str is PackageManager} - */ -export function isPackageManager(str) { - return str === "npm" || str === "yarn" || str === "pnpm"; -} - -/** - * @typedef {import("../../types").PackageManager} PackageManager - */ \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/utils/isPathname.js b/packages/create-astro-ghostcms/src/utils/isPathname.js deleted file mode 100644 index eb30d4b3..00000000 --- a/packages/create-astro-ghostcms/src/utils/isPathname.js +++ /dev/null @@ -1,8 +0,0 @@ -import path from "node:path"; - -/** - * @param {string} str - */ -export function isPathname(str) { - return str.includes(path.sep); -} \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/utils/normalizePath.js b/packages/create-astro-ghostcms/src/utils/normalizePath.js deleted file mode 100644 index 6e499bfe..00000000 --- a/packages/create-astro-ghostcms/src/utils/normalizePath.js +++ /dev/null @@ -1,12 +0,0 @@ -import path from "node:path"; -import os from "node:os"; - -/** - * @param {string} pathname - */ -export function normalizePath(pathname) { - if (os.platform() === "win32") { - return path.win32.normalize(pathname); - } - return path.normalize(pathname); -} \ No newline at end of file diff --git a/packages/create-astro-ghostcms/src/utils/wait.js b/packages/create-astro-ghostcms/src/utils/wait.js deleted file mode 100644 index 91740b8b..00000000 --- a/packages/create-astro-ghostcms/src/utils/wait.js +++ /dev/null @@ -1,7 +0,0 @@ - -/** - * @param {number} ms - */ -export async function wait(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -}