Skip to content

Commit

Permalink
fix: installations
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed Jan 20, 2024
1 parent d0a3d73 commit 26c836f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 34 deletions.
Binary file modified .DS_Store
Binary file not shown.
33 changes: 27 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,39 @@ async function main() {
]);
tremorSpinner.succeed();

const dependenciesSpinner = ora(
`Installing Tailwind CSS dependency...`
const headlessUiSpinner = ora(`Installing @headlessui/react...`).start();
await execa(packageManager, [
packageManager === "npm" ? "install" : "add",
"@headlessui/react",
]);
headlessUiSpinner.succeed();

const headlessUiTailwindCssSpinner = ora(
`Installing @headlessui/tailwindcss...`
).start();
await execa(packageManager, [
packageManager === "npm" ? "install" : "add",
"@headlessui/tailwindcss",
]);
headlessUiSpinner.succeed();

const tailwindFormsSpinner = ora(
`Installing @tailwindcss/forms as a dev dependency...`
).start();
await execa(packageManager, [
packageManager === "npm" ? "install" : "add",
"-D @tailwindcss/forms",
"@tailwindcss/forms",
packageManager === "npm" ? "--save-dev" : "--dev",
]);
dependenciesSpinner.succeed();
tailwindFormsSpinner.succeed();

// Check the kind of project (TypeScript/JavaScript)
const isTypeScriptProject = fs.existsSync("tsconfig.json");

// Infer the name of the tailwind config file accordingly
const tailwindConfigFileName = isTypeScriptProject ? "tailwind.config.ts" : "tailwind.config.js";
const tailwindConfigFileName = isTypeScriptProject
? "tailwind.config.ts"
: "tailwind.config.js";
const tailwindDestination = `./${tailwindConfigFileName}`;

// Check if the tailwind config file already exists
Expand All @@ -120,7 +139,9 @@ async function main() {
// }

// Write the tailwind config file
const tailwindSpinner = ora(`Configuring ${tailwindConfigFileName}...`).start();
const tailwindSpinner = ora(
`Configuring ${tailwindConfigFileName}...`
).start();
await fs.writeFile(
tailwindDestination,
getTailwindConfig(frameworkConfigType),
Expand Down
56 changes: 28 additions & 28 deletions src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,34 @@ export const CONTENT_REFINE = `[
]`;

export const SAFELIST = `[
{
pattern:
/^(bg-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
variants: ["hover", "ui-selected"],
},
{
pattern:
/^(text-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
variants: ["hover", "ui-selected"],
},
{
pattern:
/^(border-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
variants: ["hover", "ui-selected"],
},
{
pattern:
/^(ring-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
},
{
pattern:
/^(stroke-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
},
{
pattern:
/^(fill-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
},
]`;
{
pattern:
/^(bg-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
variants: ["hover", "ui-selected"],
},
{
pattern:
/^(text-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
variants: ["hover", "ui-selected"],
},
{
pattern:
/^(border-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
variants: ["hover", "ui-selected"],
},
{
pattern:
/^(ring-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
},
{
pattern:
/^(stroke-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
},
{
pattern:
/^(fill-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
},
],`;

export const THEME = `{
transparent: "transparent",
Expand Down

0 comments on commit 26c836f

Please sign in to comment.