@dotcms/create-app 1.2.5 → 1.2.6-next.1

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,78 +0,0 @@
1
- import { Result } from 'ts-results';
2
- import type { SupportedFrontEndFrameworks } from '../types';
3
- /**
4
- * Fetches a URL with retry logic for health checks and connection validation
5
- *
6
- * @param url - The URL to fetch
7
- * @param retries - Number of retry attempts (default: 5)
8
- * @param delay - Delay between retries in milliseconds (default: 5000)
9
- * @param requestTimeout - Per-request timeout in milliseconds (default: 10000)
10
- * @returns Promise resolving to axios response
11
- * @throws Error with detailed failure information after all retries exhausted
12
- *
13
- * @remarks
14
- * - Accepts any 2xx HTTP status code (200-299) as success
15
- * - Designed for health check endpoints that may return various success codes
16
- * - Provides detailed error messages including timeout configuration
17
- */
18
- export declare function fetchWithRetry(url: string, retries?: number, delay?: number, requestTimeout?: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
19
- export declare function getUVEConfigValue(frontEndUrl: string): string;
20
- export declare function getPortByFramework(framework: SupportedFrontEndFrameworks): string;
21
- export declare function getDotcmsApisByBaseUrl(baseUrl: string): {
22
- DOTCMS_HEALTH_API: string;
23
- DOTCMS_TOKEN_API: string;
24
- DOTCMS_EMA_CONFIG_API: string;
25
- DOTCMS_DEMO_SITE: string;
26
- };
27
- /** Utility to download a file using https */
28
- export declare function downloadFile(url: string, dest: string): Promise<void>;
29
- export declare function finalStepsForNextjs({ projectPath, urlDotCMSInstance, siteId, token }: {
30
- projectPath: string;
31
- urlDotCMSInstance: string;
32
- siteId: string;
33
- token: string;
34
- }): void;
35
- export declare function finalStepsForAstro({ projectPath, urlDotCMSInstance, siteId, token }: {
36
- projectPath: string;
37
- urlDotCMSInstance: string;
38
- siteId: string;
39
- token: string;
40
- }): void;
41
- export declare function finalStepsForAngularAndAngularSSR({ projectPath, urlDotCMSInstance, siteId, token }: {
42
- projectPath: string;
43
- urlDotCMSInstance: string;
44
- siteId: string;
45
- token: string;
46
- }): void;
47
- export declare function installDependenciesForProject(projectPath: string): Promise<Result<boolean, string>>;
48
- export declare function displayDependencies(selectedFrameWork: SupportedFrontEndFrameworks): string;
49
- /**
50
- * Checks if Docker is installed and running
51
- * @returns Result with true if available, or error message if not
52
- */
53
- export declare function checkDockerAvailability(): Promise<Result<true, string>>;
54
- /**
55
- * Checks if required dotCMS ports are available
56
- * @returns Result with true if all ports available, or error message with busy ports
57
- */
58
- export declare function checkPortsAvailability(): Promise<Result<true, string>>;
59
- /**
60
- * Gets comprehensive Docker diagnostics including container status and logs
61
- * @param directory - Optional directory where docker-compose was run
62
- * @returns Formatted diagnostic information string
63
- */
64
- export declare function getDockerDiagnostics(directory?: string): Promise<string>;
65
- /**
66
- * Returns a user-friendly display path for CLI output
67
- * Uses absolute path if cleaner, otherwise uses relative path
68
- *
69
- * @param targetPath - Absolute path to the target directory
70
- * @param cwd - Current working directory
71
- * @returns Formatted path string for display (relative or absolute)
72
- *
73
- * @remarks
74
- * - Uses absolute path when relative path would contain 3+ parent directory traversals (../)
75
- * - Uses relative path for simpler navigation (e.g., './my-project')
76
- * - Prevents confusing output like 'cd ../../../../tmp/test-dir'
77
- */
78
- export declare function getDisplayPath(targetPath: string, cwd: string): string;
@@ -1,461 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchWithRetry = fetchWithRetry;
4
- exports.getUVEConfigValue = getUVEConfigValue;
5
- exports.getPortByFramework = getPortByFramework;
6
- exports.getDotcmsApisByBaseUrl = getDotcmsApisByBaseUrl;
7
- exports.downloadFile = downloadFile;
8
- exports.finalStepsForNextjs = finalStepsForNextjs;
9
- exports.finalStepsForAstro = finalStepsForAstro;
10
- exports.finalStepsForAngularAndAngularSSR = finalStepsForAngularAndAngularSSR;
11
- exports.installDependenciesForProject = installDependenciesForProject;
12
- exports.displayDependencies = displayDependencies;
13
- exports.checkDockerAvailability = checkDockerAvailability;
14
- exports.checkPortsAvailability = checkPortsAvailability;
15
- exports.getDockerDiagnostics = getDockerDiagnostics;
16
- exports.getDisplayPath = getDisplayPath;
17
- const tslib_1 = require("tslib");
18
- const axios_1 = tslib_1.__importDefault(require("axios"));
19
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
20
- const execa_1 = require("execa");
21
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
22
- const ts_results_1 = require("ts-results");
23
- const https_1 = tslib_1.__importDefault(require("https"));
24
- const net_1 = tslib_1.__importDefault(require("net"));
25
- const path_1 = tslib_1.__importDefault(require("path"));
26
- const validation_1 = require("./validation");
27
- const constants_1 = require("../constants");
28
- /**
29
- * Fetches a URL with retry logic for health checks and connection validation
30
- *
31
- * @param url - The URL to fetch
32
- * @param retries - Number of retry attempts (default: 5)
33
- * @param delay - Delay between retries in milliseconds (default: 5000)
34
- * @param requestTimeout - Per-request timeout in milliseconds (default: 10000)
35
- * @returns Promise resolving to axios response
36
- * @throws Error with detailed failure information after all retries exhausted
37
- *
38
- * @remarks
39
- * - Accepts any 2xx HTTP status code (200-299) as success
40
- * - Designed for health check endpoints that may return various success codes
41
- * - Provides detailed error messages including timeout configuration
42
- */
43
- async function fetchWithRetry(url, retries = 5, delay = 5000, requestTimeout = 10000 // Per-request timeout in milliseconds
44
- ) {
45
- const errors = [];
46
- let lastError;
47
- for (let i = 0; i < retries; i++) {
48
- try {
49
- return await axios_1.default.get(url, {
50
- timeout: requestTimeout,
51
- // Accept any 2xx status code as success (health endpoints may return 200, 201, 204, etc.)
52
- validateStatus: (status) => status >= 200 && status < 300
53
- });
54
- }
55
- catch (err) {
56
- lastError = err;
57
- // Track error for debugging with more context
58
- let errorMsg = '';
59
- if (axios_1.default.isAxiosError(err)) {
60
- if (err.code === 'ECONNREFUSED') {
61
- errorMsg = 'Connection refused - service not accepting connections';
62
- }
63
- else if (err.code === 'ETIMEDOUT' || err.code === 'ECONNABORTED') {
64
- errorMsg = 'Connection timeout - service too slow or not responding';
65
- }
66
- else if (err.response) {
67
- errorMsg = `HTTP ${err.response.status}: ${err.response.statusText}`;
68
- }
69
- else {
70
- errorMsg = err.code || err.message;
71
- }
72
- }
73
- else {
74
- errorMsg = String(err);
75
- }
76
- errors.push(`Attempt ${i + 1}: ${errorMsg}`);
77
- if (i === retries - 1) {
78
- // Last attempt failed - provide comprehensive error
79
- const errorType = axios_1.default.isAxiosError(lastError) && lastError.code === 'ECONNREFUSED'
80
- ? 'Connection Refused'
81
- : axios_1.default.isAxiosError(lastError) &&
82
- (lastError.code === 'ETIMEDOUT' || lastError.code === 'ECONNABORTED')
83
- ? 'Timeout'
84
- : 'Connection Failed';
85
- throw new Error(chalk_1.default.red(`\nāŒ Failed to connect to dotCMS after ${retries} attempts (${errorType})\n\n`) +
86
- chalk_1.default.white(`URL: ${url}\n`) +
87
- chalk_1.default.gray(`Request timeout: ${requestTimeout}ms per attempt\n`) +
88
- chalk_1.default.gray(`Total retry window: ~${(retries * (delay + requestTimeout)) / 1000}s\n\n`) +
89
- chalk_1.default.yellow('Common causes:\n') +
90
- chalk_1.default.white(' • dotCMS is still starting up (may need more time)\n') +
91
- chalk_1.default.white(' • Container crashed or failed to start\n') +
92
- chalk_1.default.white(' • Port conflict (8082 already in use)\n') +
93
- chalk_1.default.white(' • Network/firewall blocking connection\n') +
94
- chalk_1.default.white(` • Request timeout too short (current: ${requestTimeout}ms)\n\n`) +
95
- chalk_1.default.gray('Detailed error history:\n' + errors.map((e) => ` • ${e}`).join('\n')));
96
- }
97
- console.log(chalk_1.default.yellow(`ā³ dotCMS not ready (attempt ${i + 1}/${retries})`) +
98
- chalk_1.default.gray(` - ${errorMsg}`) +
99
- chalk_1.default.gray(` - Retrying in ${delay / 1000}s...`));
100
- await new Promise((r) => setTimeout(r, delay));
101
- }
102
- }
103
- }
104
- function getUVEConfigValue(frontEndUrl) {
105
- return JSON.stringify({
106
- config: [
107
- {
108
- pattern: '.*',
109
- url: frontEndUrl
110
- }
111
- ]
112
- });
113
- }
114
- function getPortByFramework(framework) {
115
- switch (framework) {
116
- case 'angular':
117
- return '4200';
118
- case 'angular-ssr':
119
- return '4200';
120
- case 'nextjs':
121
- return '3000';
122
- case 'astro':
123
- return '4321';
124
- default:
125
- throw new Error(`Unsupported framework: ${framework}`);
126
- }
127
- }
128
- function getDotcmsApisByBaseUrl(baseUrl) {
129
- return {
130
- // Note: Using /appconfiguration instead of /probes/alive because the probe endpoints
131
- // have IP ACL restrictions that block requests from Docker host.
132
- // See: https://github.com/dotCMS/core/issues/34509
133
- DOTCMS_HEALTH_API: `${baseUrl}/api/v1/appconfiguration`,
134
- DOTCMS_TOKEN_API: `${baseUrl}/api/v1/authentication/api-token`,
135
- DOTCMS_EMA_CONFIG_API: `${baseUrl}/api/v1/apps/dotema-config-v2/`,
136
- DOTCMS_DEMO_SITE: `${baseUrl}/api/v1/site/`
137
- };
138
- }
139
- /** Utility to download a file using https */
140
- function downloadFile(url, dest) {
141
- return new Promise((resolve, reject) => {
142
- const file = fs_extra_1.default.createWriteStream(dest);
143
- https_1.default
144
- .get(url, (response) => {
145
- if (response.statusCode !== 200) {
146
- return reject(new Error(`Failed to download file: ${response.statusCode}`));
147
- }
148
- response.pipe(file);
149
- file.on('finish', () => file.close(() => resolve()));
150
- })
151
- .on('error', (err) => {
152
- fs_extra_1.default.unlink(dest);
153
- reject(err);
154
- });
155
- });
156
- }
157
- function finalStepsForNextjs({ projectPath, urlDotCMSInstance, siteId, token }) {
158
- console.log('\n');
159
- console.log(chalk_1.default.white('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
160
- console.log(chalk_1.default.greenBright('šŸ“‹ Next Steps:\n'));
161
- console.log(chalk_1.default.white('1. Navigate to your project:\n') +
162
- chalk_1.default.gray(` $ cd ${(0, validation_1.escapeShellPath)(projectPath)}\n`));
163
- console.log(chalk_1.default.white('2. Create your environment file:\n') + chalk_1.default.gray(' $ touch .env\n'));
164
- console.log(chalk_1.default.white('3. Add your dotCMS configuration to ') + chalk_1.default.green('.env') + ':\n');
165
- console.log(chalk_1.default.white('──────────────────────────────────────────────\n'));
166
- console.log(chalk_1.default.white(getEnvVariablesForNextJS(urlDotCMSInstance, siteId, token)));
167
- console.log(chalk_1.default.white('\n──────────────────────────────────────────────\n'));
168
- console.log(chalk_1.default.gray(' šŸ’” Tip: Copy the block above and paste into your .env file\n'));
169
- console.log(chalk_1.default.white('4. Start your development server:\n') + chalk_1.default.gray(' $ npm run dev\n'));
170
- console.log(chalk_1.default.white('5. Open your browser:\n') + chalk_1.default.gray(' → http://localhost:3000\n'));
171
- console.log(chalk_1.default.white('6. Edit your page content in dotCMS:\n') +
172
- chalk_1.default.gray(` → ${urlDotCMSInstance}/dotAdmin/#/edit-page?url=/index\n`));
173
- console.log(chalk_1.default.white('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
174
- console.log(chalk_1.default.blueBright('šŸ“– Documentation: ') + chalk_1.default.white('https://dev.dotcms.com'));
175
- console.log(chalk_1.default.blueBright('šŸ’¬ Community: ') + chalk_1.default.white('https://community.dotcms.com\n'));
176
- }
177
- function finalStepsForAstro({ projectPath, urlDotCMSInstance, siteId, token }) {
178
- console.log('\n');
179
- console.log(chalk_1.default.white('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
180
- console.log(chalk_1.default.greenBright('šŸ“‹ Next Steps:\n'));
181
- console.log(chalk_1.default.white('1. Navigate to your project:\n') +
182
- chalk_1.default.gray(` $ cd ${(0, validation_1.escapeShellPath)(projectPath)}\n`));
183
- console.log(chalk_1.default.white('2. Create your environment file:\n') + chalk_1.default.gray(' $ touch .env\n'));
184
- console.log(chalk_1.default.white('3. Add your dotCMS configuration to ') + chalk_1.default.green('.env') + ':\n');
185
- console.log(chalk_1.default.white('──────────────────────────────────────────────\n'));
186
- console.log(chalk_1.default.white(getEnvVariablesForAstro(urlDotCMSInstance, siteId, token)));
187
- console.log(chalk_1.default.white('\n──────────────────────────────────────────────\n'));
188
- console.log(chalk_1.default.gray(' šŸ’” Tip: Copy the block above and paste into your .env file\n'));
189
- console.log(chalk_1.default.white('4. Start your development server:\n') + chalk_1.default.gray(' $ npm run dev\n'));
190
- console.log(chalk_1.default.white('5. Open your browser:\n') + chalk_1.default.gray(' → http://localhost:3000\n'));
191
- console.log(chalk_1.default.white('6. Edit your page content in dotCMS:\n') +
192
- chalk_1.default.gray(` → ${urlDotCMSInstance}/dotAdmin/#/edit-page?url=/index\n`));
193
- console.log(chalk_1.default.white('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
194
- console.log(chalk_1.default.blueBright('šŸ“– Documentation: ') + chalk_1.default.white('https://dev.dotcms.com'));
195
- console.log(chalk_1.default.blueBright('šŸ’¬ Community: ') + chalk_1.default.white('https://community.dotcms.com\n'));
196
- }
197
- function finalStepsForAngularAndAngularSSR({ projectPath, urlDotCMSInstance, siteId, token }) {
198
- console.log('\n');
199
- console.log(chalk_1.default.white('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
200
- console.log(chalk_1.default.greenBright('šŸ“‹ Next Steps:\n'));
201
- console.log(chalk_1.default.white('1. Navigate to your environments directory:\n') +
202
- chalk_1.default.gray(` $ cd ${(0, validation_1.escapeShellPath)(projectPath)}/src/environments\n`));
203
- console.log(chalk_1.default.white('2. Update the environment files:\n') +
204
- chalk_1.default.gray(' Replace the contents of the following files:\n' +
205
- ' • environment.ts\n' +
206
- ' • environment.development.ts\n\n'));
207
- console.log(chalk_1.default.white('3. Add your dotCMS configuration:\n'));
208
- console.log(chalk_1.default.white('──────────────────────────────────────────────\n'));
209
- console.log(chalk_1.default.white(getEnvVariablesForAngular(urlDotCMSInstance, siteId, token)));
210
- console.log(chalk_1.default.white('\n──────────────────────────────────────────────\n'));
211
- console.log(chalk_1.default.gray(' šŸ’” Tip: Copy the block above and paste it into both environment files\n'));
212
- console.log(chalk_1.default.white('4. Start your development server:\n') + chalk_1.default.gray(' $ ng serve\n'));
213
- console.log(chalk_1.default.white('5. Open your browser:\n') + chalk_1.default.gray(' → http://localhost:4200\n'));
214
- console.log(chalk_1.default.white('6. Edit your page content in dotCMS:\n') +
215
- chalk_1.default.gray(` → ${urlDotCMSInstance}/dotAdmin/#/edit-page?url=/index\n`));
216
- console.log(chalk_1.default.white('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
217
- console.log(chalk_1.default.blueBright('šŸ“– Documentation: ') + chalk_1.default.white('https://dev.dotcms.com'));
218
- console.log(chalk_1.default.blueBright('šŸ’¬ Community: ') + chalk_1.default.white('https://community.dotcms.com\n'));
219
- }
220
- function getEnvVariablesForNextJS(host, siteId, token) {
221
- return `
222
- NEXT_PUBLIC_DOTCMS_AUTH_TOKEN=${token}
223
- NEXT_PUBLIC_DOTCMS_HOST=${host}
224
- NEXT_PUBLIC_DOTCMS_SITE_ID=${siteId}
225
- NEXT_PUBLIC_DOTCMS_MODE='production'
226
- `;
227
- }
228
- function getEnvVariablesForAstro(host, siteId, token) {
229
- return `
230
- PUBLIC_DOTCMS_AUTH_TOKEN=${token}
231
- PUBLIC_DOTCMS_HOST=${host}
232
- PUBLIC_DOTCMS_SITE_ID=${siteId}
233
- PUBLIC_EXPERIMENTS_API_KEY=analytic-api-key-from-dotcms-portlet
234
- PUBLIC_EXPERIMENTS_DEBUG=true
235
- `;
236
- }
237
- function getEnvVariablesForAngular(host, siteId, token) {
238
- return `
239
- export const environment = {
240
- dotcmsUrl: '${host}',
241
- authToken: '${token}',
242
- siteId: '${siteId}',
243
- };
244
- `;
245
- }
246
- async function installDependenciesForProject(projectPath) {
247
- try {
248
- await (0, execa_1.execa)('npm', ['install'], {
249
- cwd: projectPath
250
- // stdio: 'inherit', // optional: shows npm output in terminal
251
- });
252
- return (0, ts_results_1.Ok)(true);
253
- }
254
- catch {
255
- return (0, ts_results_1.Err)('Failed to install dependencies. Please make sure npm is installed');
256
- }
257
- }
258
- function displayDependencies(selectedFrameWork) {
259
- switch (selectedFrameWork) {
260
- case 'nextjs':
261
- return formatDependencies(constants_1.NEXTJS_DEPENDENCIES, constants_1.NEXTJS_DEPENDENCIES_DEV);
262
- case 'astro':
263
- return formatDependencies(constants_1.ASTRO_DEPENDENCIES, constants_1.ASTRO_DEPENDENCIES_DEV);
264
- case 'angular':
265
- return formatDependencies(constants_1.ANGULAR_DEPENDENCIES, constants_1.ANGULAR_DEPENDENCIES_DEV);
266
- case 'angular-ssr':
267
- return formatDependencies(constants_1.ANGULAR_SSR_DEPENDENCIES, constants_1.ANGULAR_SSR_DEPENDENCIES_DEV);
268
- default:
269
- return '';
270
- }
271
- }
272
- function formatDependencies(dependencies, devDependencies) {
273
- const lines = [];
274
- lines.push(chalk_1.default.white('Dependencies:'));
275
- dependencies.forEach((item) => lines.push(chalk_1.default.grey(`- ${item}`)));
276
- lines.push(''); // blank line
277
- lines.push(chalk_1.default.white('Dev Dependencies:'));
278
- devDependencies.forEach((item) => lines.push(chalk_1.default.grey(`- ${item}`)));
279
- return lines.join('\n');
280
- }
281
- /**
282
- * Checks if Docker is installed and running
283
- * @returns Result with true if available, or error message if not
284
- */
285
- async function checkDockerAvailability() {
286
- try {
287
- // Check if Docker is installed and running by executing 'docker info'
288
- await (0, execa_1.execa)('docker', ['info']);
289
- return (0, ts_results_1.Ok)(true);
290
- }
291
- catch {
292
- // Docker is either not installed or not running
293
- const errorMsg = chalk_1.default.red('\nāŒ Docker is not available\n\n') +
294
- chalk_1.default.white('Docker is required to run dotCMS locally.\n\n') +
295
- chalk_1.default.yellow('How to fix:\n') +
296
- chalk_1.default.white(' 1. Install Docker Desktop:\n') +
297
- chalk_1.default.cyan(' → https://www.docker.com/products/docker-desktop\n\n') +
298
- chalk_1.default.white(' 2. Start Docker Desktop\n') +
299
- chalk_1.default.white(' 3. Wait for Docker to be running (check the Docker icon in your system tray)\n') +
300
- chalk_1.default.white(' 4. Run this command again\n\n') +
301
- chalk_1.default.gray('Alternative: Use --url flag to connect to an existing dotCMS instance');
302
- return (0, ts_results_1.Err)(errorMsg);
303
- }
304
- }
305
- /**
306
- * Checks if a specific port is available
307
- * @param port - Port number to check
308
- * @returns Promise resolving to true if available, false if in use
309
- */
310
- function isPortAvailable(port) {
311
- return new Promise((resolve) => {
312
- const server = net_1.default.createServer();
313
- server.once('error', (err) => {
314
- if (err.code === 'EADDRINUSE') {
315
- resolve(false); // Port is in use
316
- }
317
- else {
318
- // Unexpected error while checking port; log and treat as unavailable
319
- console.warn(chalk_1.default.yellow(`Warning: Unexpected error while checking port ${port}: ${err.message}`));
320
- resolve(false); // Conservative: treat as unavailable
321
- }
322
- });
323
- server.once('listening', () => {
324
- server.close();
325
- resolve(true); // Port is available
326
- });
327
- server.listen(port, '0.0.0.0');
328
- });
329
- }
330
- /**
331
- * Checks if required dotCMS ports are available
332
- * @returns Result with true if all ports available, or error message with busy ports
333
- */
334
- async function checkPortsAvailability() {
335
- const requiredPorts = [
336
- { port: 8082, service: 'dotCMS HTTP' },
337
- { port: 8443, service: 'dotCMS HTTPS' },
338
- { port: 9200, service: 'Elasticsearch HTTP' },
339
- { port: 9600, service: 'Elasticsearch Transport' }
340
- ];
341
- const busyPorts = [];
342
- // Check all ports
343
- for (const { port, service } of requiredPorts) {
344
- const available = await isPortAvailable(port);
345
- if (!available) {
346
- busyPorts.push({ port, service });
347
- }
348
- }
349
- if (busyPorts.length > 0) {
350
- const errorMsg = chalk_1.default.red('\nāŒ Required ports are already in use\n\n') +
351
- chalk_1.default.white('The following ports are busy:\n') +
352
- busyPorts
353
- .map(({ port, service }) => chalk_1.default.yellow(` • Port ${port}`) + chalk_1.default.gray(` (${service})`))
354
- .join('\n') +
355
- '\n\n' +
356
- chalk_1.default.yellow('How to fix:\n') +
357
- chalk_1.default.white(' 1. Stop services using these ports:\n') +
358
- chalk_1.default.gray(" • Check what's using the ports: ") +
359
- chalk_1.default.cyan(process.platform === 'win32'
360
- ? `netstat -ano | findstr ":<port>"`
361
- : `lsof -i :<port>`) +
362
- '\n' +
363
- chalk_1.default.gray(' • Stop the conflicting service\n\n') +
364
- chalk_1.default.white(' 2. Or stop existing dotCMS containers:\n') +
365
- chalk_1.default.cyan(' $ docker compose down\n\n') +
366
- chalk_1.default.white(' 3. Run this command again\n\n') +
367
- chalk_1.default.gray('Alternative: Use --url flag to connect to an existing dotCMS instance');
368
- return (0, ts_results_1.Err)(errorMsg);
369
- }
370
- return (0, ts_results_1.Ok)(true);
371
- }
372
- /**
373
- * Gets comprehensive Docker diagnostics including container status and logs
374
- * @param directory - Optional directory where docker-compose was run
375
- * @returns Formatted diagnostic information string
376
- */
377
- async function getDockerDiagnostics(directory) {
378
- const diagnostics = [];
379
- // Reuse the Docker availability check
380
- const dockerAvailable = await checkDockerAvailability();
381
- if (!dockerAvailable.ok) {
382
- return dockerAvailable.val; // Return the detailed error message (Err value is string)
383
- }
384
- try {
385
- // Get container status
386
- const { stdout: psOutput } = await (0, execa_1.execa)('docker', ['ps', '-a', '--format', '{{.Names}}\t{{.Status}}\t{{.Ports}}'], { cwd: directory });
387
- if (!psOutput.trim()) {
388
- diagnostics.push(chalk_1.default.yellow('\nāš ļø No Docker containers found'));
389
- diagnostics.push(chalk_1.default.white('The docker-compose.yml may not have been started correctly\n'));
390
- return diagnostics.join('\n');
391
- }
392
- diagnostics.push(chalk_1.default.cyan('\nšŸ“‹ Container Status:'));
393
- const containers = psOutput.trim().split('\n');
394
- for (const container of containers) {
395
- const [name, status, ports] = container.split('\t');
396
- const isHealthy = status.includes('Up') && !status.includes('unhealthy');
397
- const icon = isHealthy ? 'āœ…' : 'āŒ';
398
- diagnostics.push(` ${icon} ${chalk_1.default.white(name)}: ${chalk_1.default.gray(status)}`);
399
- if (ports) {
400
- diagnostics.push(` ${chalk_1.default.gray('Ports:')} ${chalk_1.default.white(ports)}`);
401
- }
402
- }
403
- // Check for unhealthy containers and get their logs
404
- const unhealthyContainers = containers.filter((c) => !c.includes('Up') || c.includes('unhealthy') || c.includes('Exited'));
405
- if (unhealthyContainers.length > 0) {
406
- diagnostics.push(chalk_1.default.yellow('\nšŸ” Recent logs from problematic containers:\n'));
407
- for (const container of unhealthyContainers) {
408
- const name = container.split('\t')[0];
409
- try {
410
- const { stdout: logs } = await (0, execa_1.execa)('docker', ['logs', '--tail', '20', name], {
411
- cwd: directory,
412
- reject: false
413
- });
414
- diagnostics.push(chalk_1.default.white(`\n--- ${name} ---`));
415
- diagnostics.push(chalk_1.default.gray(logs.split('\n').slice(-10).join('\n')));
416
- }
417
- catch {
418
- diagnostics.push(chalk_1.default.gray(` Unable to fetch logs for ${name}`));
419
- }
420
- }
421
- }
422
- }
423
- catch (error) {
424
- diagnostics.push(chalk_1.default.red('\nāŒ Failed to get Docker diagnostics'));
425
- diagnostics.push(chalk_1.default.gray(String(error)));
426
- }
427
- diagnostics.push(chalk_1.default.yellow('\nšŸ’” Troubleshooting steps:'));
428
- diagnostics.push(chalk_1.default.white(' 1. Check if all containers are running:'));
429
- diagnostics.push(chalk_1.default.gray(' docker ps'));
430
- diagnostics.push(chalk_1.default.white(' 2. View logs for a specific container:'));
431
- diagnostics.push(chalk_1.default.gray(' docker logs <container-name>'));
432
- diagnostics.push(chalk_1.default.white(' 3. Restart the containers:'));
433
- diagnostics.push(chalk_1.default.gray(' docker compose down && docker compose up -d'));
434
- diagnostics.push(chalk_1.default.white(' 4. Check if ports 8082, 8443, 9200, and 9600 are available\n'));
435
- return diagnostics.join('\n');
436
- }
437
- /**
438
- * Returns a user-friendly display path for CLI output
439
- * Uses absolute path if cleaner, otherwise uses relative path
440
- *
441
- * @param targetPath - Absolute path to the target directory
442
- * @param cwd - Current working directory
443
- * @returns Formatted path string for display (relative or absolute)
444
- *
445
- * @remarks
446
- * - Uses absolute path when relative path would contain 3+ parent directory traversals (../)
447
- * - Uses relative path for simpler navigation (e.g., './my-project')
448
- * - Prevents confusing output like 'cd ../../../../tmp/test-dir'
449
- */
450
- function getDisplayPath(targetPath, cwd) {
451
- const relativePath = path_1.default.relative(cwd, targetPath);
452
- // Count the number of parent directory traversals in the relative path
453
- const parentDirCount = (relativePath.match(/\.\.\//g) || []).length;
454
- // If relative path has 3+ parent directories, use absolute path instead
455
- if (parentDirCount >= 3) {
456
- return targetPath;
457
- }
458
- // Otherwise use relative path (e.g., './my-project' or 'my-project')
459
- return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
460
- }
461
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/sdk/create-app/src/utils/index.ts"],"names":[],"mappings":";;AAwCA,wCA8EC;AAED,8CASC;AAED,gDAaC;AAED,wDAUC;AAGD,oCAkBC;AACD,kDAmDC;AAED,gDAmDC;AAED,8EAwDC;AA8BD,sEAaC;AAED,kDAaC;AAoBD,0DAsBC;AAsCD,wDAgDC;AAOD,oDA2EC;AAeD,wCAaC;;AA5nBD,0DAA0B;AAC1B,0DAA0B;AAC1B,iCAA8B;AAC9B,gEAA0B;AAC1B,2CAA6C;AAE7C,0DAA0B;AAC1B,sDAAsB;AACtB,wDAAwB;AAExB,6CAA+C;AAE/C,4CASsB;AAItB;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,cAAc,CAChC,GAAW,EACX,OAAO,GAAG,CAAC,EACX,KAAK,GAAG,IAAI,EACZ,cAAc,GAAG,KAAK,CAAC,sCAAsC;;IAE7D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,SAAkB,CAAC;IAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,IAAI,CAAC;YACD,OAAO,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE;gBACxB,OAAO,EAAE,cAAc;gBACvB,0FAA0F;gBAC1F,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,G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YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IAEpE,wEAAwE;IACxE,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,qEAAqE;IACrE,OAAO,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE,CAAC;AAC7E,CAAC"}
@@ -1,47 +0,0 @@
1
- import type { DotCmsCliOptions, SupportedFrontEndFrameworks } from '../types';
2
- /**
3
- * Validates and normalizes framework name
4
- * Supports case-insensitive matching and common aliases
5
- *
6
- * @param framework - The framework name from CLI flag
7
- * @returns Normalized framework name or undefined if not provided
8
- * @throws Error if framework is invalid
9
- */
10
- export declare function validateAndNormalizeFramework(framework: string | undefined): SupportedFrontEndFrameworks | undefined;
11
- /**
12
- * Normalizes a URL by removing trailing slashes
13
- * @param url - The URL to normalize
14
- * @returns URL without trailing slash
15
- */
16
- export declare function normalizeUrl(url: string): string;
17
- /**
18
- * Validates URL format
19
- * Checks for protocol, valid format, and hostname
20
- *
21
- * @param url - The URL from CLI flag
22
- * @throws Error if URL format is invalid
23
- */
24
- export declare function validateUrl(url: string | undefined): void;
25
- /**
26
- * Validates project name for filesystem safety and best practices
27
- *
28
- * @param projectName - The project name from CLI flag or prompt
29
- * @returns Validated project name (preserves original casing)
30
- * @throws Error if project name is invalid
31
- */
32
- export declare function validateProjectName(projectName: string | undefined): string | undefined;
33
- /**
34
- * Escapes a file path for safe use in shell commands across platforms
35
- * Handles spaces, special characters, and cross-platform compatibility
36
- *
37
- * @param filePath - The file path to escape
38
- * @returns Shell-safe escaped path
39
- */
40
- export declare function escapeShellPath(filePath: string): string;
41
- /**
42
- * Validates CLI options for conflicting parameters
43
- * Warns user when both local and cloud parameters are provided
44
- *
45
- * @param options - CLI options to validate
46
- */
47
- export declare function validateConflictingParameters(options: DotCmsCliOptions): void;