@happytiptoe/ape
Advanced tools
Comparing version 0.0.3 to 0.0.4
#!/usr/bin/env node | ||
import s from"fs-extra";import{dim as l,white as d}from"kolorist";import r from"node:path";import{fileURLToPath as n}from"node:url";import{addDevDependency as u}from"nypm";var i="0.0.3";import{red as c}from"kolorist";function o(t){throw new Error(c(`\u2716 ${t}`))}console.log(`Initialising ${l("@happytiptoe/")}${d("ape")} (${i})...`);async function g(){let t=["astro.config.js","astro.config.mjs","astro.config.cjs","astro.config.ts"],e=r.resolve(n(import.meta.url),".");for(let p of t)if(!await s.exists(`${e}/${p}`))return!1;return!0}async function m(){let t=["@typescript-eslint/parser","eslint","eslint-plugin-astro","eslint-plugin-jsx-a11y","prettier","prettier-plugin-astro"];console.log("\u203A Installing dependencies...");for(let e of t)await u(e);console.log("\u203A Dependencies installed!")}async function f(){if(!await g()){o("ape must be ran inside an Astro project.");return}await m(),console.log("\u203A Copying file stubs...");let e=r.resolve(n(import.meta.url),"../../stubs");await s.copy(`${e}/eslint`,"./.eslintrc.cjs"),await s.copy(`${e}/prettier`,"./.prettierrc"),console.log("\u203A Stubs copied!"),console.clear(),console.log("\u2728 ESLint and Prettier are all good to go - happy coding!")}f().catch(t=>{console.error(t.message)}); | ||
import s from"fs-extra";import{dim as l,white as d}from"kolorist";import r from"node:path";import{fileURLToPath as n}from"node:url";import{addDevDependency as u}from"nypm";var i="0.0.4";import{red as c}from"kolorist";function o(t){throw new Error(c(`\u2716 ${t}`))}console.log(`Initialising ${l("@happytiptoe/")}${d("ape")} (${i})...`);async function g(){let t=["astro.config.js","astro.config.mjs","astro.config.cjs","astro.config.ts"],e=r.resolve(n(import.meta.url),".");console.log(e);for(let p of t)if(!await s.exists(`${e}/${p}`))return!1;return!0}async function m(){let t=["@typescript-eslint/parser","eslint","eslint-plugin-astro","eslint-plugin-jsx-a11y","prettier","prettier-plugin-astro"];console.log("\u203A Installing dependencies...");for(let e of t)await u(e);console.log("\u203A Dependencies installed!")}async function f(){if(!await g()){o("ape must be ran inside an Astro project.");return}await m(),console.log("\u203A Copying file stubs...");let e=r.resolve(n(import.meta.url),"../../stubs");await s.copy(`${e}/eslint`,"./.eslintrc.cjs"),await s.copy(`${e}/prettier`,"./.prettierrc"),console.log("\u203A Stubs copied!"),console.clear(),console.log("\u2728 ESLint and Prettier are all good to go - happy coding!")}f().catch(t=>{console.error(t.message)}); |
{ | ||
"name": "@happytiptoe/ape", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Adds Prettier and ESLint to Astro Projects", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5206