@codapult/cli 0.22.0 → 0.23.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![CI](https://github.com/codapult/codapult-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/codapult/codapult-cli/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/@codapult/cli?logo=npm)](https://www.npmjs.com/package/@codapult/cli)
5
5
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
- [![Node.js >=20.19](https://img.shields.io/badge/node-%3E%3D20.19-339933.svg?logo=node.js&logoColor=white)](package.json)
6
+ [![Node.js >=22.15](https://img.shields.io/badge/node-%3E%3D22.15-339933.svg?logo=node.js&logoColor=white)](package.json)
7
7
 
8
8
  `@codapult/cli` is the Next.js SaaS CLI for managing projects built with
9
9
  [Codapult](https://codapult.dev), a Next.js SaaS Boilerplate & Starter Kit for MVPs, team-based B2B products and AI-powered applications, with connected product workflows, modular architecture, built-in AI platform, billing and infrastructure. Use it to
@@ -1,7 +1,7 @@
1
1
  import { resolve } from 'node:path';
2
2
  import { checkProjectRoot, readJsonFile } from '../utils/project.js';
3
3
  import { ENV_FILE_NAME, loadProjectEnv } from '../utils/project-env.js';
4
- import { getAdapters, getAuthMethods, getFeatures, getOauthProviders, FEATURE_ENV, } from '../utils/env-config.js';
4
+ import { getAdapters, getAuthMethods, getFeatures, getOauthProviders, getFeatureEnv, } from '../utils/env-config.js';
5
5
  import { heading, success, info, dim, label } from '../utils/ui.js';
6
6
  import { collectAppConfigSummary } from '../utils/config-report.js';
7
7
  import { config } from '../utils/config.js';
@@ -54,7 +54,7 @@ export function configShowCommand(options = {}) {
54
54
  }
55
55
  // --- Adapters (from project env source) ---
56
56
  info('Adapters');
57
- const adapters = getAdapters(envContent);
57
+ const adapters = getAdapters(envContent, root);
58
58
  label(' Database', adapters.database);
59
59
  label(' Auth', adapters.auth);
60
60
  label(' Payments', adapters.payments);
@@ -66,19 +66,19 @@ export function configShowCommand(options = {}) {
66
66
  console.log();
67
67
  // --- Auth methods (from project env source) ---
68
68
  info('Auth methods');
69
- const authMethods = getAuthMethods(envContent);
69
+ const authMethods = getAuthMethods(envContent, root);
70
70
  label(' Magic Link', authMethods.magicLink ? 'enabled' : 'disabled');
71
71
  label(' Passkeys', authMethods.passkeys ? 'enabled' : 'disabled');
72
72
  label(' 2FA (TOTP)', authMethods.twoFactor ? 'enabled' : 'disabled');
73
- const oauth = getOauthProviders(envContent);
73
+ const oauth = getOauthProviders(envContent, root);
74
74
  label(' OAuth providers', oauth.length > 0 ? oauth.join(', ') : 'none');
75
75
  console.log();
76
76
  // --- Feature toggles (from project env source + ENABLE_* defaults) ---
77
77
  info('Features');
78
- const features = getFeatures(envContent);
79
- const featureKeys = Object.keys(FEATURE_ENV);
80
- const enabled = featureKeys.filter((k) => features[k]);
81
- const disabled = featureKeys.filter((k) => !features[k]);
78
+ const features = getFeatures(envContent, root);
79
+ const featureKeys = Object.keys(getFeatureEnv(root));
80
+ const enabled = featureKeys.filter((key) => features[key]);
81
+ const disabled = featureKeys.filter((key) => !features[key]);
82
82
  for (const f of enabled)
83
83
  success(f);
84
84
  for (const f of disabled)
@@ -73,14 +73,14 @@ export function mcpContractCheckCommand() {
73
73
  return;
74
74
  }
75
75
  fail(result.message);
76
- if (result.schemaOnly.length > 0) {
77
- info('Variables present in env-schema.ts but missing from the CLI contract:');
78
- for (const key of result.schemaOnly)
76
+ if (result.missingFromExample.length > 0) {
77
+ info('Variables present in env-schema.ts but missing from .env.example:');
78
+ for (const key of result.missingFromExample)
79
79
  dim(` + ${key}`);
80
80
  }
81
- if (result.mirrorOnly.length > 0) {
82
- info('Variables present in the CLI contract but missing from env-schema.ts:');
83
- for (const key of result.mirrorOnly)
81
+ if (result.missingFromSchema.length > 0) {
82
+ info('Variables present in .env.example but missing from env-schema.ts:');
83
+ for (const key of result.missingFromSchema)
84
84
  dim(` - ${key}`);
85
85
  }
86
86
  process.exitCode = 1;
@@ -90,8 +90,11 @@ export const RECIPES = {
90
90
  steps: ['setup --preset marketing', 'pnpm install', 'npx @codapult/cli doctor', 'pnpm dev'],
91
91
  },
92
92
  };
93
+ function isRecipeName(name) {
94
+ return Object.hasOwn(RECIPES, name);
95
+ }
93
96
  function getRecipe(name) {
94
- if (name in RECIPES)
97
+ if (isRecipeName(name))
95
98
  return RECIPES[name];
96
99
  fail(`Unknown recipe: "${name}". Available: ${Object.keys(RECIPES).join(', ')}`);
97
100
  process.exit(1);
@@ -21,7 +21,7 @@ export interface ProjectConfig {
21
21
  enableGraphQL: boolean;
22
22
  enableSSO: boolean;
23
23
  enableApiDocs: boolean;
24
- enableHelpCenter: boolean;
24
+ enableDocs: boolean;
25
25
  enableExperiments: boolean;
26
26
  enableFeatureRequests: boolean;
27
27
  enableCompare: boolean;
@@ -40,11 +40,134 @@ export interface ProjectConfig {
40
40
  enableBranding: boolean;
41
41
  enableTwoFactor: boolean;
42
42
  enablePlugins: boolean;
43
+ enablePromotions: boolean;
44
+ enableSeo: boolean;
43
45
  removeUnusedCode: boolean;
46
+ cleanPruneMarkers: boolean;
44
47
  }
48
+ declare const BUILT_IN_PRESETS: {
49
+ saas: {};
50
+ 'ai-saas': {
51
+ enableAI: true;
52
+ enableRAG: true;
53
+ enableAgents: true;
54
+ enableBatch: true;
55
+ enablePlayground: true;
56
+ };
57
+ 'b2b-saas': {
58
+ authProvider: "better-auth";
59
+ ssoProvider: "jackson";
60
+ enableAuth: true;
61
+ enableSSO: true;
62
+ enableTeams: true;
63
+ enableBranding: true;
64
+ enableAuditLog: true;
65
+ enableReports: true;
66
+ enableWebhooks: true;
67
+ };
68
+ 'ai-chatbot': {
69
+ enableAI: true;
70
+ enableAiChat: true;
71
+ enableRAG: false;
72
+ enableAgents: false;
73
+ enableBatch: false;
74
+ enablePlayground: false;
75
+ enableTeams: true;
76
+ enableAuditLog: true;
77
+ enableWebhooks: true;
78
+ };
79
+ marketplace: {
80
+ enableTeams: true;
81
+ enableConnect: true;
82
+ enableWebhooks: true;
83
+ enableAuditLog: true;
84
+ enableBranding: true;
85
+ };
86
+ 'internal-tool': {
87
+ enableAI: false;
88
+ enableBlog: false;
89
+ enableTeams: true;
90
+ enableConnect: false;
91
+ enableSSO: false;
92
+ enableWorkflows: true;
93
+ enableAnalytics: true;
94
+ enableWebhooks: true;
95
+ enableAuditLog: true;
96
+ enableReports: true;
97
+ enableBranding: true;
98
+ enableReferrals: false;
99
+ enableChangelog: false;
100
+ enableWaitlist: false;
101
+ enableFeatureRequests: false;
102
+ enableCompare: false;
103
+ removeUnusedCode: true;
104
+ };
105
+ 'content-saas': {
106
+ enableAI: false;
107
+ enableBlog: true;
108
+ enableTeams: false;
109
+ enableWorkflows: true;
110
+ enableAnalytics: true;
111
+ enableOnboarding: true;
112
+ enableReferrals: true;
113
+ enableChangelog: true;
114
+ enableWaitlist: true;
115
+ enableFeatureRequests: false;
116
+ enableCompare: false;
117
+ enableWebhooks: true;
118
+ enableAuditLog: true;
119
+ removeUnusedCode: true;
120
+ };
121
+ marketing: {
122
+ appMode: "landing";
123
+ authProvider: "none";
124
+ jobProvider: "none";
125
+ ssoProvider: "none";
126
+ enableAuth: false;
127
+ enableAI: false;
128
+ enableAiChat: false;
129
+ enableRAG: false;
130
+ enableAgents: false;
131
+ enableBatch: false;
132
+ enablePlayground: false;
133
+ enableTeams: false;
134
+ enableConnect: false;
135
+ enableSSO: false;
136
+ enableOnboarding: false;
137
+ enableWorkflows: false;
138
+ enableReferrals: false;
139
+ enableAnalytics: false;
140
+ enableExperiments: false;
141
+ enableEventStore: false;
142
+ enableOtel: false;
143
+ enableDripCampaigns: false;
144
+ enableApiDocs: false;
145
+ enableChangelog: false;
146
+ enableWaitlist: false;
147
+ enableFeatureRequests: false;
148
+ enableWebhooks: false;
149
+ enableAuditLog: false;
150
+ enableReports: false;
151
+ enableBranding: false;
152
+ enableTwoFactor: false;
153
+ enableGraphQL: false;
154
+ enablePlugins: false;
155
+ enableDocs: true;
156
+ enableBlog: true;
157
+ enablePromotions: true;
158
+ enableSeo: true;
159
+ enableCompare: true;
160
+ removeUnusedCode: true;
161
+ };
162
+ demo: {
163
+ appMode: "demo";
164
+ authProvider: "better-auth";
165
+ };
166
+ };
167
+ type BuiltInPresetName = keyof typeof BUILT_IN_PRESETS;
45
168
  export declare function resolvePreset(raw: string): ProjectConfig;
46
- export declare function getPresetNames(): string[];
47
- export declare function buildEnvContent(content: string, config: ProjectConfig): string;
169
+ export declare function getPresetNames(): BuiltInPresetName[];
170
+ export declare function buildEnvContent(content: string, config: ProjectConfig, root: string): string;
48
171
  interface SetupOptions extends Pick<ProjectEnvOptions, 'envFile'> {
49
172
  preset?: string;
50
173
  }