@alignui/cli 0.0.1-alpha.3 → 0.0.1-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alignui/cli",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.5",
4
4
  "description": "A command line interface to setup AlignUI",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@ import {
32
32
  import { prettierFormat } from '@/src/utils/prettier';
33
33
  import { formatHslColor, formatRgbColor } from '@/src/utils/color-helpers';
34
34
 
35
- const PROJECT_DEPENDENCIES = ['-D tailwindcss-animate'];
35
+ const PROJECT_DEV_DEPENDENCIES = ['tailwindcss-animate'];
36
36
  const highlight = (text: string) => chalk.hex('#8c71f6')(text);
37
37
 
38
38
  const tailwindInitOptionsSchema = z.object({
@@ -72,7 +72,7 @@ export const initTailwind = new Command()
72
72
  logger.break();
73
73
  logger.white(`Installed the following packages:
74
74
 
75
- ${PROJECT_DEPENDENCIES.map((pkg) => ` - ${pkg}`).join('\n')}`);
75
+ ${PROJECT_DEV_DEPENDENCIES.map((pkg) => ` - ${pkg}`).join('\n')}`);
76
76
  logger.break();
77
77
  } catch (error) {
78
78
  handleError(error);
@@ -259,7 +259,11 @@ async function runInit(cwd: string, config: Config) {
259
259
 
260
260
  await execa(
261
261
  packageManager,
262
- [packageManager === 'npm' ? 'i' : 'add', ...PROJECT_DEPENDENCIES],
262
+ [
263
+ packageManager === 'npm' ? 'i' : 'add',
264
+ packageManager === 'npm' ? '--save-dev' : '-D',
265
+ ...PROJECT_DEV_DEPENDENCIES,
266
+ ],
263
267
  {
264
268
  cwd,
265
269
  },
@@ -460,24 +460,28 @@ export const tailwindColorsHex = {
460
460
  };
461
461
 
462
462
  export const tailwindColorsRgb = Object.fromEntries(
463
- Object.entries(tailwindColorsHex).map(([colorName, shades]) => [
463
+ Object.entries(tailwindColorsHex).map(([colorName, shadesOrString]) => [
464
464
  colorName,
465
- Object.fromEntries(
466
- Object.entries(shades).map(([shade, channel]) => {
467
- return [shade, `rgb(${channel})`];
468
- }),
469
- ),
465
+ typeof shadesOrString === 'object'
466
+ ? Object.fromEntries(
467
+ Object.entries(shadesOrString).map(([shade, channel]) => {
468
+ return [shade, `rgb(${channel})`];
469
+ }),
470
+ )
471
+ : shadesOrString,
470
472
  ]),
471
473
  );
472
474
 
473
475
  export const tailwindColorsHsl = Object.fromEntries(
474
- Object.entries(tailwindColorsHex).map(([colorName, shades]) => [
476
+ Object.entries(tailwindColorsHex).map(([colorName, shadesOrString]) => [
475
477
  colorName,
476
- Object.fromEntries(
477
- Object.entries(shades).map(([shade, channel]) => {
478
- return [shade, `hsl(${channel})`];
479
- }),
480
- ),
478
+ typeof shadesOrString === 'object'
479
+ ? Object.fromEntries(
480
+ Object.entries(shadesOrString).map(([shade, channel]) => {
481
+ return [shade, `hsl(${channel})`];
482
+ }),
483
+ )
484
+ : shadesOrString,
481
485
  ]),
482
486
  );
483
487