testfix
This commit is contained in:
parent
c4335adc91
commit
8f51cf3fd1
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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 };
|
||||
}
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
|
@ -1,8 +0,0 @@
|
|||
import path from "node:path";
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
*/
|
||||
export function isPathname(str) {
|
||||
return str.includes(path.sep);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
/**
|
||||
* @param {number} ms
|
||||
*/
|
||||
export async function wait(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
Loading…
Reference in New Issue