@codapult/cli 0.9.4 → 0.10.0
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/commands/setup.js +16 -13
- package/package.json +2 -2
package/dist/commands/setup.js
CHANGED
|
@@ -31,8 +31,7 @@ async function selectPrompt(iface, question, options) {
|
|
|
31
31
|
// Built-in presets for non-interactive (CI/CD) setup via --preset flag.
|
|
32
32
|
// ---------------------------------------------------------------------------
|
|
33
33
|
const BUILT_IN_PRESETS = {
|
|
34
|
-
// Showcase / marketing-only site
|
|
35
|
-
// `enableHelpCenter` stays true (powers /docs).
|
|
34
|
+
// Showcase / marketing-only site.
|
|
36
35
|
marketing: {
|
|
37
36
|
authProvider: 'none',
|
|
38
37
|
enableAuth: false,
|
|
@@ -51,17 +50,19 @@ const BUILT_IN_PRESETS = {
|
|
|
51
50
|
enableDripCampaigns: false,
|
|
52
51
|
enableApiDocs: false,
|
|
53
52
|
enableChangelog: false,
|
|
54
|
-
enableBlog: true,
|
|
55
53
|
enableWaitlist: false,
|
|
56
54
|
enableFeatureRequests: false,
|
|
57
|
-
enableCompare: true,
|
|
58
55
|
enableWebhooks: false,
|
|
59
56
|
enableAuditLog: false,
|
|
60
57
|
enableReports: false,
|
|
61
58
|
enableBranding: false,
|
|
62
59
|
enableTwoFactor: false,
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
enableGraphQL: false,
|
|
61
|
+
enableHelpCenter: true,
|
|
62
|
+
enableBlog: true,
|
|
63
|
+
enablePlugins: true,
|
|
64
|
+
enableCompare: true,
|
|
65
|
+
removeUnusedCode: true,
|
|
65
66
|
},
|
|
66
67
|
demo: {
|
|
67
68
|
authProvider: 'better-auth',
|
|
@@ -102,6 +103,7 @@ const DEFAULT_CONFIG = {
|
|
|
102
103
|
enableBranding: true,
|
|
103
104
|
enableTwoFactor: true,
|
|
104
105
|
enablePlugins: true,
|
|
106
|
+
removeUnusedCode: false,
|
|
105
107
|
};
|
|
106
108
|
function parsePresetValue(raw) {
|
|
107
109
|
const parts = raw
|
|
@@ -476,6 +478,8 @@ const FEATURE_ENV_VARS = {
|
|
|
476
478
|
enableTwoFactor: 'ENABLE_TWO_FACTOR',
|
|
477
479
|
enablePlugins: 'ENABLE_PLUGINS',
|
|
478
480
|
};
|
|
481
|
+
// codapult:prune:start {key}
|
|
482
|
+
// codapult:prune:end {key}
|
|
479
483
|
const PRUNE_MARKER_FILES = [
|
|
480
484
|
'src/app/sitemap.ts',
|
|
481
485
|
'src/app/sitemap.test.ts',
|
|
@@ -499,7 +503,6 @@ function generateEnvFile(root, config) {
|
|
|
499
503
|
PAYMENT_PROVIDER: config.paymentProvider,
|
|
500
504
|
STORAGE_PROVIDER: config.storageProvider,
|
|
501
505
|
JOB_PROVIDER: config.jobProvider,
|
|
502
|
-
...(config.enableAnalytics ? { NEXT_PUBLIC_ANALYTICS_ENABLED: 'true' } : {}),
|
|
503
506
|
};
|
|
504
507
|
for (const [cliKey, envVar] of Object.entries(FEATURE_ENV_VARS)) {
|
|
505
508
|
if (config[cliKey] === false) {
|
|
@@ -638,7 +641,7 @@ async function interactiveSetup() {
|
|
|
638
641
|
enableHelpCenter: await confirmPrompt(iface, 'Enable Documentation module?'),
|
|
639
642
|
enableExperiments: await confirmPrompt(iface, 'Enable A/B Testing?'),
|
|
640
643
|
enableFeatureRequests: await confirmPrompt(iface, 'Enable Feature Request board?'),
|
|
641
|
-
enableCompare: false,
|
|
644
|
+
enableCompare: await confirmPrompt(iface, 'Enable competitor comparison pages (/compare)?', false),
|
|
642
645
|
enableConnect: authEnabled && (await confirmPrompt(iface, 'Enable Stripe Connect (marketplace)?')),
|
|
643
646
|
enableEventStore: await confirmPrompt(iface, 'Enable Event Store (event sourcing)?'),
|
|
644
647
|
enableOtel: await confirmPrompt(iface, 'Enable OpenTelemetry tracing?'),
|
|
@@ -655,10 +658,8 @@ async function interactiveSetup() {
|
|
|
655
658
|
enableBranding: authEnabled && (await confirmPrompt(iface, 'Enable per-org branding (white-label)?')),
|
|
656
659
|
enableTwoFactor: authEnabled && (await confirmPrompt(iface, 'Enable two-factor authentication (TOTP)?')),
|
|
657
660
|
enablePlugins: await confirmPrompt(iface, 'Enable plugin marketplace (/plugins)?'),
|
|
661
|
+
removeUnusedCode: await confirmPrompt(iface, 'Remove unused module code?', false),
|
|
658
662
|
};
|
|
659
|
-
if (await confirmPrompt(iface, 'Remove unused module code?', false)) {
|
|
660
|
-
return config;
|
|
661
|
-
}
|
|
662
663
|
iface.close();
|
|
663
664
|
return config;
|
|
664
665
|
}
|
|
@@ -685,8 +686,10 @@ export async function setupCommand(options) {
|
|
|
685
686
|
else {
|
|
686
687
|
generateEnvFile(root, config);
|
|
687
688
|
}
|
|
688
|
-
|
|
689
|
-
|
|
689
|
+
if (config.removeUnusedCode) {
|
|
690
|
+
heading('Removing unused modules');
|
|
691
|
+
removeModules(root, config);
|
|
692
|
+
}
|
|
690
693
|
heading('Setting up MCP integration');
|
|
691
694
|
generateMcpConfig(root);
|
|
692
695
|
heading('Done!');
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codapult/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Codapult CLI — manage, update, and diagnose your Codapult SaaS project",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"packageManager": "pnpm@11.
|
|
6
|
+
"packageManager": "pnpm@11.6.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20.19.0"
|
|
9
9
|
},
|