@configjs/cli 1.0.0 → 1.0.2

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.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  CompatibilityValidator,
3
3
  compatibilityRules
4
- } from "./chunk-PQLKGF6I.js";
4
+ } from "./chunk-SCNFVSYD.js";
5
5
  import {
6
6
  logger,
7
7
  pluginRegistry
8
- } from "./chunk-5T664O5A.js";
8
+ } from "./chunk-7ZLAP62L.js";
9
9
 
10
10
  // src/cli/commands/check.ts
11
11
  import { readFile } from "fs/promises";
@@ -75,26 +75,18 @@ var Category = /* @__PURE__ */ ((Category2) => {
75
75
  import { resolve as resolve2, dirname as dirname2 } from "path";
76
76
 
77
77
  // src/utils/fs-helpers.ts
78
- import {
79
- readFile,
80
- writeFile,
81
- pathExists,
82
- ensureDir,
83
- copyFile as fsCopyFile,
84
- readJson,
85
- writeJson
86
- } from "fs-extra";
78
+ import fs from "fs-extra";
87
79
  import { resolve, dirname, extname } from "path";
88
80
  function normalizePath(path) {
89
81
  return path.replace(/\\/g, "/");
90
82
  }
91
83
  async function readPackageJson(root) {
92
84
  const packageJsonPath = resolve(root, "package.json");
93
- if (!await pathExists(packageJsonPath)) {
85
+ if (!await fs.pathExists(packageJsonPath)) {
94
86
  throw new Error(`package.json not found at ${packageJsonPath}`);
95
87
  }
96
88
  try {
97
- const pkg = await readJson(packageJsonPath);
89
+ const pkg = await fs.readJson(packageJsonPath);
98
90
  logger.debug(`Read package.json from ${packageJsonPath}`);
99
91
  return pkg;
100
92
  } catch (error) {
@@ -107,7 +99,7 @@ async function readPackageJson(root) {
107
99
  async function writePackageJson(root, pkg) {
108
100
  const packageJsonPath = resolve(root, "package.json");
109
101
  try {
110
- await writeJson(packageJsonPath, pkg, {
102
+ await fs.writeJson(packageJsonPath, pkg, {
111
103
  spaces: 2,
112
104
  EOL: "\n"
113
105
  });
@@ -124,9 +116,9 @@ async function readTsConfig(root) {
124
116
  resolve(root, "tsconfig.node.json")
125
117
  ];
126
118
  for (const tsconfigPath of possiblePaths) {
127
- if (await pathExists(tsconfigPath)) {
119
+ if (await fs.pathExists(tsconfigPath)) {
128
120
  try {
129
- const config = await readJson(tsconfigPath);
121
+ const config = await fs.readJson(tsconfigPath);
130
122
  logger.debug(`Read tsconfig.json from ${tsconfigPath}`);
131
123
  return config;
132
124
  } catch (error) {
@@ -143,12 +135,12 @@ async function readTsConfig(root) {
143
135
  }
144
136
  async function checkPathExists(path) {
145
137
  const fullPath = resolve(path);
146
- return pathExists(fullPath);
138
+ return fs.pathExists(fullPath);
147
139
  }
148
140
  async function ensureDirectory(path) {
149
141
  const fullPath = resolve(path);
150
142
  try {
151
- await ensureDir(fullPath);
143
+ await fs.ensureDir(fullPath);
152
144
  logger.debug(`Ensured directory exists: ${fullPath}`);
153
145
  } catch (error) {
154
146
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -157,11 +149,11 @@ async function ensureDirectory(path) {
157
149
  }
158
150
  async function readFileContent(filePath, encoding = "utf-8") {
159
151
  const fullPath = resolve(filePath);
160
- if (!await pathExists(fullPath)) {
152
+ if (!await fs.pathExists(fullPath)) {
161
153
  throw new Error(`File not found: ${fullPath}`);
162
154
  }
163
155
  try {
164
- const content = await readFile(fullPath, encoding);
156
+ const content = await fs.readFile(fullPath, encoding);
165
157
  logger.debug(`Read file: ${fullPath}`);
166
158
  return content;
167
159
  } catch (error) {
@@ -174,7 +166,7 @@ async function writeFileContent(filePath, content, encoding = "utf-8") {
174
166
  const parentDir = dirname(fullPath);
175
167
  await ensureDirectory(parentDir);
176
168
  try {
177
- await writeFile(fullPath, content, encoding);
169
+ await fs.writeFile(fullPath, content, encoding);
178
170
  logger.debug(`Wrote file: ${fullPath}`);
179
171
  } catch (error) {
180
172
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -625,7 +617,7 @@ import { resolve as resolve5, join as join2 } from "path";
625
617
 
626
618
  // src/utils/package-manager.ts
627
619
  import { execa } from "execa";
628
- import { pathExists as pathExists2 } from "fs-extra";
620
+ import fs2 from "fs-extra";
629
621
  import { resolve as resolve4, join } from "path";
630
622
  async function detectPackageManager(projectRoot) {
631
623
  const root = resolve4(projectRoot);
@@ -637,7 +629,7 @@ async function detectPackageManager(projectRoot) {
637
629
  ];
638
630
  for (const { file, manager } of lockfiles) {
639
631
  const lockfilePath = join(root, file);
640
- if (await pathExists2(lockfilePath)) {
632
+ if (await fs2.pathExists(lockfilePath)) {
641
633
  logger.debug(`Detected package manager: ${manager} (found ${file})`);
642
634
  return manager;
643
635
  }
@@ -3577,23 +3569,21 @@ var tailwindcssPlugin = {
3577
3569
  };
3578
3570
  function getViteConfigContentTS() {
3579
3571
  return `import { defineConfig } from 'vite'
3572
+ import react from '@vitejs/plugin-react'
3580
3573
  import tailwindcss from '@tailwindcss/vite'
3581
3574
 
3582
3575
  export default defineConfig({
3583
- plugins: [
3584
- tailwindcss(),
3585
- ],
3576
+ plugins: [react(), tailwindcss()],
3586
3577
  })
3587
3578
  `;
3588
3579
  }
3589
3580
  function getViteConfigContentJS() {
3590
3581
  return `import { defineConfig } from 'vite'
3582
+ import react from '@vitejs/plugin-react'
3591
3583
  import tailwindcss from '@tailwindcss/vite'
3592
3584
 
3593
3585
  export default defineConfig({
3594
- plugins: [
3595
- tailwindcss(),
3596
- ],
3586
+ plugins: [react(), tailwindcss()],
3597
3587
  })
3598
3588
  `;
3599
3589
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-5T664O5A.js";
3
+ } from "./chunk-7ZLAP62L.js";
4
4
 
5
5
  // src/core/validator.ts
6
6
  var CompatibilityValidator = class {
@@ -198,14 +198,16 @@ var compatibilityRules = [
198
198
  severity: "warning",
199
199
  allowOverride: true
200
200
  },
201
- // Dépendances - TailwindCSS
201
+ // Dépendances - TailwindCSS v4
202
+ // Note: TailwindCSS v4 avec @tailwindcss/vite ne nécessite plus postcss/autoprefixer
203
+ // Voir: https://tailwindcss.com/docs/installation/using-vite
202
204
  {
203
205
  type: "REQUIRES",
204
206
  plugin: "tailwindcss",
205
- requires: ["postcss", "autoprefixer"],
206
- reason: "PostCSS et Autoprefixer sont n\xE9cessaires pour TailwindCSS",
207
+ requires: ["@tailwindcss/vite"],
208
+ reason: "@tailwindcss/vite est n\xE9cessaire pour utiliser TailwindCSS v4 avec Vite",
207
209
  severity: "error",
208
- autoInstall: true,
210
+ autoInstall: false,
209
211
  allowOverride: false
210
212
  },
211
213
  // Recommandations - React Router
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { Command } from "commander";
5
5
 
6
6
  // package.json
7
- var version = "1.0.0";
7
+ var version = "1.0.2";
8
8
 
9
9
  // src/cli.ts
10
10
  var program = new Command();
@@ -12,7 +12,7 @@ program.name("confjs").description("Configure your frontend stack, instantly").v
12
12
  program.command("react").description("Configure a React project").option("-y, --yes", "Accept all defaults").option("-d, --dry-run", "Simulate without writing to disk").option("-s, --silent", "Non-interactive mode").option("--debug", "Enable debug logs").option("-c, --config <file>", "Use configuration file").option("-f, --force", "Force installation (overwrite configs)").option("--no-install", "Generate configs only, skip package installation").action(
13
13
  async (options) => {
14
14
  try {
15
- const { installReact } = await import("./install-X7G2IXXX.js");
15
+ const { installReact } = await import("./install-FNUEIZQ2.js");
16
16
  await installReact(options);
17
17
  } catch (error) {
18
18
  console.error("Error:", error);
@@ -22,7 +22,7 @@ program.command("react").description("Configure a React project").option("-y, --
22
22
  );
23
23
  program.command("list").description("List available libraries").option("-c, --category <category>", "Filter by category").action(async (options) => {
24
24
  try {
25
- const { listLibraries } = await import("./list-J4E7JFII.js");
25
+ const { listLibraries } = await import("./list-CBEUUZUI.js");
26
26
  listLibraries(options);
27
27
  } catch (error) {
28
28
  console.error("Error:", error);
@@ -31,7 +31,7 @@ program.command("list").description("List available libraries").option("-c, --ca
31
31
  });
32
32
  program.command("check").description("Check compatibility without installing").option("-c, --config <file>", "Configuration file to check").action(async (options) => {
33
33
  try {
34
- const { checkCompatibility } = await import("./check-JF56SNQC.js");
34
+ const { checkCompatibility } = await import("./check-KGNJBAPL.js");
35
35
  await checkCompatibility(options);
36
36
  } catch (error) {
37
37
  console.error("Error:", error);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CompatibilityValidator,
3
3
  compatibilityRules
4
- } from "./chunk-PQLKGF6I.js";
4
+ } from "./chunk-SCNFVSYD.js";
5
5
  import {
6
6
  BackupManager,
7
7
  ConfigWriter,
@@ -13,7 +13,7 @@ import {
13
13
  pluginRegistry,
14
14
  readPackageJson,
15
15
  readTsConfig
16
- } from "./chunk-5T664O5A.js";
16
+ } from "./chunk-7ZLAP62L.js";
17
17
 
18
18
  // src/core/detector.ts
19
19
  import { resolve, join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginRegistry
3
- } from "./chunk-5T664O5A.js";
3
+ } from "./chunk-7ZLAP62L.js";
4
4
 
5
5
  // src/cli/commands/list.ts
6
6
  function listLibraries(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configjs/cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "Configure your frontend stack, instantly - Utilitaire CLI d'installation modulaire de bibliothèques frontend",
6
6
  "keywords": [