@configjs/cli 1.1.18 → 1.1.19
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/dist/{angular-command-EOREU45Q.js → angular-command-HAJJ3AU4.js} +3 -3
- package/dist/{check-KAPRT4FM.js → check-SJ6EEYEM.js} +2 -2
- package/dist/{chunk-RIJNUJDC.js → chunk-FDB6YKMN.js} +1 -1
- package/dist/{chunk-FJLN62L4.js → chunk-ORIWNBOE.js} +2 -2
- package/dist/{chunk-D7IWYKUX.js → chunk-RWT2AFO5.js} +61 -0
- package/dist/cli.js +8 -8
- package/dist/{list-5T6VDDAO.js → list-7U2LCYT3.js} +1 -1
- package/dist/{nextjs-command-C6PM7A5C.js → nextjs-command-I744IPBX.js} +3 -3
- package/dist/{react-command-JMK6VM4Q.js → react-command-PLMHMFFB.js} +3 -3
- package/dist/{svelte-command-YUSD55NO.js → svelte-command-XH7PDSE3.js} +3 -3
- package/dist/{vue-command-3CYWLLFQ.js → vue-command-SZQJZQ6R.js} +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseFrameworkCommand,
|
|
3
3
|
getFrameworkMetadata
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ORIWNBOE.js";
|
|
5
|
+
import "./chunk-FDB6YKMN.js";
|
|
6
|
+
import "./chunk-RWT2AFO5.js";
|
|
7
7
|
import {
|
|
8
8
|
DetectionError,
|
|
9
9
|
detectContext
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompatibilityValidator,
|
|
3
3
|
allCompatibilityRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FDB6YKMN.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigSanitizer,
|
|
7
7
|
pluginRegistry
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RWT2AFO5.js";
|
|
9
9
|
import "./chunk-V2IBYLVH.js";
|
|
10
10
|
import {
|
|
11
11
|
getPathValidationErrorMessage,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompatibilityValidator,
|
|
3
3
|
allCompatibilityRules
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FDB6YKMN.js";
|
|
5
5
|
import {
|
|
6
6
|
BackupManager,
|
|
7
7
|
ConfigWriter,
|
|
8
8
|
getPluginsByCategory,
|
|
9
9
|
getRecommendedPlugins,
|
|
10
10
|
pluginRegistry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RWT2AFO5.js";
|
|
12
12
|
import {
|
|
13
13
|
PluginTracker
|
|
14
14
|
} from "./chunk-Y4XYC7QV.js";
|
|
@@ -7519,6 +7519,31 @@ var reduxToolkitPlugin = {
|
|
|
7519
7519
|
`Created App.${ctx.typescript ? "tsx" : "jsx"} with Provider`
|
|
7520
7520
|
);
|
|
7521
7521
|
}
|
|
7522
|
+
const viteConfigPath = join22(ctx.projectRoot, `vite.config.${extension}`);
|
|
7523
|
+
const viteConfigExists = await checkPathExists(
|
|
7524
|
+
viteConfigPath,
|
|
7525
|
+
ctx.fsAdapter
|
|
7526
|
+
);
|
|
7527
|
+
if (viteConfigExists) {
|
|
7528
|
+
const viteConfigContent = await readFileContent(
|
|
7529
|
+
viteConfigPath,
|
|
7530
|
+
"utf-8",
|
|
7531
|
+
ctx.fsAdapter
|
|
7532
|
+
);
|
|
7533
|
+
const updatedViteContent = updateViteConfigForRedux(viteConfigContent);
|
|
7534
|
+
if (updatedViteContent !== viteConfigContent) {
|
|
7535
|
+
await writer.writeFile(viteConfigPath, updatedViteContent, {
|
|
7536
|
+
backup: true
|
|
7537
|
+
});
|
|
7538
|
+
files.push({
|
|
7539
|
+
type: "modify",
|
|
7540
|
+
path: normalizePath(viteConfigPath),
|
|
7541
|
+
content: updatedViteContent,
|
|
7542
|
+
backup: true
|
|
7543
|
+
});
|
|
7544
|
+
logger25.info(`Updated vite.config.${extension} for Redux Toolkit`);
|
|
7545
|
+
}
|
|
7546
|
+
}
|
|
7522
7547
|
return {
|
|
7523
7548
|
files,
|
|
7524
7549
|
success: true,
|
|
@@ -7844,6 +7869,42 @@ export default App
|
|
|
7844
7869
|
}
|
|
7845
7870
|
return modifiedContent;
|
|
7846
7871
|
}
|
|
7872
|
+
function updateViteConfigForRedux(content) {
|
|
7873
|
+
if (content.includes("@reduxjs/toolkit")) {
|
|
7874
|
+
return content;
|
|
7875
|
+
}
|
|
7876
|
+
const defineConfigMatch = content.match(
|
|
7877
|
+
/export\s+default\s+defineConfig\s*\(/
|
|
7878
|
+
);
|
|
7879
|
+
const exportDefaultMatch = content.match(/export\s+default\s*\{/);
|
|
7880
|
+
if (!defineConfigMatch && !exportDefaultMatch) {
|
|
7881
|
+
return content;
|
|
7882
|
+
}
|
|
7883
|
+
if (defineConfigMatch) {
|
|
7884
|
+
const insertPos = content.lastIndexOf("})");
|
|
7885
|
+
if (insertPos === -1) return content;
|
|
7886
|
+
const beforeBrace = content.substring(0, insertPos);
|
|
7887
|
+
const afterBrace = content.substring(insertPos);
|
|
7888
|
+
if (!beforeBrace.includes("optimizeDeps")) {
|
|
7889
|
+
return beforeBrace + `,
|
|
7890
|
+
optimizeDeps: {
|
|
7891
|
+
include: ['@reduxjs/toolkit', 'react-redux'],
|
|
7892
|
+
}` + afterBrace;
|
|
7893
|
+
}
|
|
7894
|
+
} else if (exportDefaultMatch) {
|
|
7895
|
+
const insertPos = content.lastIndexOf("}");
|
|
7896
|
+
if (insertPos === -1) return content;
|
|
7897
|
+
const beforeBrace = content.substring(0, insertPos);
|
|
7898
|
+
const afterBrace = content.substring(insertPos);
|
|
7899
|
+
if (!beforeBrace.includes("optimizeDeps")) {
|
|
7900
|
+
return beforeBrace + `,
|
|
7901
|
+
optimizeDeps: {
|
|
7902
|
+
include: ['@reduxjs/toolkit', 'react-redux'],
|
|
7903
|
+
}` + afterBrace;
|
|
7904
|
+
}
|
|
7905
|
+
}
|
|
7906
|
+
return content;
|
|
7907
|
+
}
|
|
7847
7908
|
|
|
7848
7909
|
// src/plugins/state/zustand.ts
|
|
7849
7910
|
import { resolve as resolve16, join as join23 } from "path";
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import "./chunk-QGM4M3NI.js";
|
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
|
|
11
11
|
// package.json
|
|
12
|
-
var version = "1.1.
|
|
12
|
+
var version = "1.1.19";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
15
|
initializeCLILogging();
|
|
@@ -18,7 +18,7 @@ program.name("confjs").description("Configure your frontend stack, instantly").v
|
|
|
18
18
|
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(
|
|
19
19
|
async (options) => {
|
|
20
20
|
try {
|
|
21
|
-
const { ReactCommand } = await import("./react-command-
|
|
21
|
+
const { ReactCommand } = await import("./react-command-PLMHMFFB.js");
|
|
22
22
|
const command = new ReactCommand();
|
|
23
23
|
await command.execute(options);
|
|
24
24
|
} catch (error) {
|
|
@@ -31,7 +31,7 @@ program.command("react").description("Configure a React project").option("-y, --
|
|
|
31
31
|
program.command("nextjs").description("Configure a Next.js 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(
|
|
32
32
|
async (options) => {
|
|
33
33
|
try {
|
|
34
|
-
const { NextjsCommand } = await import("./nextjs-command-
|
|
34
|
+
const { NextjsCommand } = await import("./nextjs-command-I744IPBX.js");
|
|
35
35
|
const command = new NextjsCommand();
|
|
36
36
|
await command.execute(options);
|
|
37
37
|
} catch (error) {
|
|
@@ -44,7 +44,7 @@ program.command("nextjs").description("Configure a Next.js project").option("-y,
|
|
|
44
44
|
program.command("vue").description("Configure a Vue.js 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(
|
|
45
45
|
async (options) => {
|
|
46
46
|
try {
|
|
47
|
-
const { VueCommand } = await import("./vue-command-
|
|
47
|
+
const { VueCommand } = await import("./vue-command-SZQJZQ6R.js");
|
|
48
48
|
const command = new VueCommand();
|
|
49
49
|
await command.execute(options);
|
|
50
50
|
} catch (error) {
|
|
@@ -57,7 +57,7 @@ program.command("vue").description("Configure a Vue.js project").option("-y, --y
|
|
|
57
57
|
program.command("svelte").description("Configure a Svelte 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(
|
|
58
58
|
async (options) => {
|
|
59
59
|
try {
|
|
60
|
-
const { SvelteCommand } = await import("./svelte-command-
|
|
60
|
+
const { SvelteCommand } = await import("./svelte-command-XH7PDSE3.js");
|
|
61
61
|
const command = new SvelteCommand();
|
|
62
62
|
await command.execute(options);
|
|
63
63
|
} catch (error) {
|
|
@@ -70,7 +70,7 @@ program.command("svelte").description("Configure a Svelte project").option("-y,
|
|
|
70
70
|
program.command("angular").description("Configure an Angular 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(
|
|
71
71
|
async (options) => {
|
|
72
72
|
try {
|
|
73
|
-
const { AngularCommand } = await import("./angular-command-
|
|
73
|
+
const { AngularCommand } = await import("./angular-command-HAJJ3AU4.js");
|
|
74
74
|
const command = new AngularCommand();
|
|
75
75
|
await command.execute(options);
|
|
76
76
|
} catch (error) {
|
|
@@ -82,7 +82,7 @@ program.command("angular").description("Configure an Angular project").option("-
|
|
|
82
82
|
);
|
|
83
83
|
program.command("list").description("List available libraries").option("-c, --category <category>", "Filter by category").action(async (options) => {
|
|
84
84
|
try {
|
|
85
|
-
const { listLibraries } = await import("./list-
|
|
85
|
+
const { listLibraries } = await import("./list-7U2LCYT3.js");
|
|
86
86
|
listLibraries(options);
|
|
87
87
|
} catch (error) {
|
|
88
88
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -92,7 +92,7 @@ program.command("list").description("List available libraries").option("-c, --ca
|
|
|
92
92
|
});
|
|
93
93
|
program.command("check").description("Check compatibility without installing").option("-c, --config <file>", "Configuration file to check").action(async (options) => {
|
|
94
94
|
try {
|
|
95
|
-
const { checkCompatibility } = await import("./check-
|
|
95
|
+
const { checkCompatibility } = await import("./check-SJ6EEYEM.js");
|
|
96
96
|
await checkCompatibility(options);
|
|
97
97
|
} catch (error) {
|
|
98
98
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseFrameworkCommand,
|
|
3
3
|
getFrameworkMetadata
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ORIWNBOE.js";
|
|
5
|
+
import "./chunk-FDB6YKMN.js";
|
|
6
|
+
import "./chunk-RWT2AFO5.js";
|
|
7
7
|
import {
|
|
8
8
|
DetectionError,
|
|
9
9
|
detectContext
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseFrameworkCommand,
|
|
3
3
|
getFrameworkMetadata
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ORIWNBOE.js";
|
|
5
|
+
import "./chunk-FDB6YKMN.js";
|
|
6
|
+
import "./chunk-RWT2AFO5.js";
|
|
7
7
|
import {
|
|
8
8
|
DetectionError,
|
|
9
9
|
detectContext
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseFrameworkCommand,
|
|
3
3
|
getFrameworkMetadata
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ORIWNBOE.js";
|
|
5
|
+
import "./chunk-FDB6YKMN.js";
|
|
6
|
+
import "./chunk-RWT2AFO5.js";
|
|
7
7
|
import {
|
|
8
8
|
DetectionError,
|
|
9
9
|
detectContext
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseFrameworkCommand,
|
|
3
3
|
getFrameworkMetadata
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ORIWNBOE.js";
|
|
5
|
+
import "./chunk-FDB6YKMN.js";
|
|
6
|
+
import "./chunk-RWT2AFO5.js";
|
|
7
7
|
import {
|
|
8
8
|
DetectionError,
|
|
9
9
|
detectContext
|
package/package.json
CHANGED