@happytiptoe/ape
Advanced tools
Comparing version 0.1.1 to 0.2.0
#!/usr/bin/env node | ||
import i from"fs-extra";import{dim as l,white as d}from"kolorist";import u from"node:path";import{fileURLToPath as g}from"node:url";import{addDevDependency as f}from"nypm";var o="0.1.1";import{red as a}from"kolorist";function n(t){throw new Error(a(`\u2716 ${t}`))}console.log(`Initialising ${l("@happytiptoe/")}${d("ape")} (${o})...`);async function m(){let t=["astro.config.js","astro.config.mjs","astro.config.cjs","astro.config.ts"],e=process.cwd(),s=!1;for(let r of t){let p=await i.exists(`${e}/${r}`);s=s||p}return s}async function y(){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 f(e,{silent:!0}),console.log(`\u203A ${e} installed successfully!`);console.log("\u203A Dependencies installed!")}async function h(){if(!await m()){n("ape must be ran inside an Astro project.");return}await y(),console.log("\u203A Copying file stubs...");let e=u.resolve(g(import.meta.url),"../../stubs");await i.copy(`${e}/eslint`,"./.eslintrc.cjs"),await i.copy(`${e}/prettier`,"./.prettierrc"),console.log("\u203A Stubs copied!"),console.clear(),console.log("\u{1F412} ESLint and Prettier are all good to go - happy coding!")}h().catch(t=>{console.error(t.message)}); | ||
import i from"fs-extra";import{dim as l,white as d}from"kolorist";import u from"node:path";import{fileURLToPath as g}from"node:url";import{addDevDependency as f}from"nypm";var o="0.2.0";import{red as a}from"kolorist";function n(t){throw new Error(a(`\u2716 ${t}`))}console.log(`Initialising ${l("@happytiptoe/")}${d("ape")} (${o})...`);async function m(){let t=["astro.config.js","astro.config.mjs","astro.config.cjs","astro.config.ts"],e=process.cwd(),s=!1;for(let r of t){let p=await i.exists(`${e}/${r}`);s=s||p}return s}async function y(){let t=["@typescript-eslint/eslint-plugin","@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 f(e,{silent:!0}),console.log(`\u203A ${e} installed successfully!`);console.log("\u203A Dependencies installed!")}async function h(){if(!await m()){n("ape must be ran inside an Astro project.");return}await y(),console.log("\u203A Copying file stubs...");let e=u.resolve(g(import.meta.url),"../../stubs");await i.copy(`${e}/eslint`,"./.eslintrc.cjs"),await i.copy(`${e}/prettier`,"./.prettierrc"),console.log("\u203A Stubs copied!"),console.clear(),console.log("\u{1F412} ESLint and Prettier are all good to go - happy coding!")}h().catch(t=>{console.error(t.message)}); |
{ | ||
"name": "@happytiptoe/ape", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Adds Prettier and ESLint to Astro Projects", |
Sorry, the diff of this file is not supported yet
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
5738