slicejs-cli 4.5.0 → 4.6.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.
Files changed (48) hide show
  1. package/client.js +162 -83
  2. package/commands/Print.js +158 -164
  3. package/commands/build/build.js +27 -1
  4. package/commands/buildProduction/buildProduction.js +42 -71
  5. package/commands/bundle/bundle.js +65 -60
  6. package/commands/docs/agents.js +260 -0
  7. package/commands/docs/events.js +365 -0
  8. package/commands/docs/index.js +123 -0
  9. package/commands/doctor/doctor.js +43 -9
  10. package/commands/export/checkExport.js +163 -0
  11. package/commands/export/clientRedirects.js +72 -0
  12. package/commands/export/copyDist.js +180 -0
  13. package/commands/export/export.js +236 -0
  14. package/commands/export/files.js +33 -0
  15. package/commands/export/hosts/cloudflare.js +48 -0
  16. package/commands/export/hosts/github.js +31 -0
  17. package/commands/export/hosts/index.js +69 -0
  18. package/commands/export/hosts/netlify.js +42 -0
  19. package/commands/export/hosts/nginx.js +73 -0
  20. package/commands/export/hosts/none.js +23 -0
  21. package/commands/export/hosts/s3.js +24 -0
  22. package/commands/export/hosts/shared.js +62 -0
  23. package/commands/export/hosts/vercel.js +69 -0
  24. package/commands/export/outDir.js +91 -0
  25. package/commands/export/prerender.js +121 -0
  26. package/commands/getComponent/getComponent.js +39 -34
  27. package/commands/init/init.js +32 -22
  28. package/commands/lint/lint.js +2 -2
  29. package/commands/lint/types.js +1 -1
  30. package/commands/listComponents/listComponents.js +205 -172
  31. package/commands/seo/check.js +1 -1
  32. package/commands/seo/images.js +1 -1
  33. package/commands/seo/sitemap.js +1 -1
  34. package/commands/setup/lint.js +1 -1
  35. package/commands/skill/skill.js +2 -2
  36. package/commands/startServer/startServer.js +60 -21
  37. package/commands/startServer/watchServer.js +3 -3
  38. package/commands/translator/check.js +1 -1
  39. package/commands/translator/init.js +1 -1
  40. package/commands/typecheck/typecheck.js +2 -2
  41. package/commands/types/types.js +22 -3
  42. package/commands/utils/VersionChecker.js +14 -14
  43. package/commands/utils/bundling/BundleGenerator.js +45 -27
  44. package/commands/utils/bundling/DependencyAnalyzer.js +38 -17
  45. package/commands/utils/componentCatalog.js +120 -0
  46. package/commands/utils/publicEnv.js +74 -0
  47. package/commands/utils/updateManager.js +12 -12
  48. package/package.json +22 -23
@@ -1,172 +1,205 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import Table from 'cli-table3';
4
- import chalk from 'chalk';
5
- import Print from '../Print.js';
6
- import { getSrcPath, getComponentsJsPath, getConfigPath } from '../utils/PathHelper.js';
7
-
8
- /**
9
- * Loads configuration from sliceConfig.json
10
- * @returns {object} - Configuration object
11
- */
12
- const loadConfig = () => {
13
- try {
14
- const configPath = getConfigPath(import.meta.url);
15
- if (!fs.existsSync(configPath)) {
16
- Print.error('sliceConfig.json not found');
17
- Print.info('Run "slice init" to initialize your project');
18
- return null;
19
- }
20
- const rawData = fs.readFileSync(configPath, 'utf-8');
21
- return JSON.parse(rawData);
22
- } catch (error) {
23
- Print.error(`Failed to load configuration: ${error.message}`);
24
- Print.info('Check that sliceConfig.json is valid JSON');
25
- return null;
26
- }
27
- };
28
-
29
- /**
30
- * Lists files in a given folder, filtering only .js files
31
- * @param {string} folderPath - Path of the folder to read
32
- * @returns {string[]} - List of found files
33
- */
34
- const listComponents = (folderPath) => {
35
- try {
36
- if (!fs.existsSync(folderPath)) {
37
- return [];
38
- }
39
- const result = fs.readdirSync(folderPath);
40
- return result;
41
- } catch (error) {
42
- Print.error(`Failed to read directory ${folderPath}: ${error.message}`);
43
- return [];
44
- }
45
- };
46
-
47
- /**
48
- * Counts files in a component directory
49
- */
50
- const countComponentFiles = (componentPath) => {
51
- try {
52
- if (!fs.existsSync(componentPath)) return 0;
53
- const files = fs.readdirSync(componentPath);
54
- return files.filter(f => fs.statSync(path.join(componentPath, f)).isFile()).length;
55
- } catch {
56
- return 0;
57
- }
58
- };
59
-
60
- /**
61
- * Gets components dynamically from sliceConfig.json
62
- * @returns {object} - Component mapping with their category
63
- */
64
- const getComponents = () => {
65
- const config = loadConfig();
66
- if (!config) return {};
67
-
68
- const folderSuffix = 'src'; // Always use 'src' for development
69
- const componentPaths = config.paths?.components || {};
70
- let allComponents = new Map();
71
-
72
- Object.entries(componentPaths).forEach(([category, { path: folderPath }]) => {
73
- const cleanFolderPath = folderPath ? folderPath.replace(/^[/\\]+/, '') : '';
74
- const fullPath = getSrcPath(import.meta.url, cleanFolderPath);
75
- const files = listComponents(fullPath);
76
-
77
- files.forEach(file => {
78
- const componentPath = path.join(fullPath, file);
79
- if (fs.statSync(componentPath).isDirectory()) {
80
- const fileCount = countComponentFiles(componentPath);
81
- allComponents.set(file, { category, files: fileCount });
82
- }
83
- });
84
- });
85
-
86
- return Object.fromEntries(allComponents);
87
- };
88
-
89
- function listComponentsReal() {
90
- try {
91
- // Get components dynamically
92
- const components = getComponents();
93
-
94
- if (Object.keys(components).length === 0) {
95
- Print.warning('No components found in your project');
96
- Print.info('Create your first component with "slice component create"');
97
- return;
98
- }
99
-
100
- // Create table with cli-table3
101
- const table = new Table({
102
- head: [
103
- chalk.cyan.bold('Component'),
104
- chalk.cyan.bold('Category'),
105
- chalk.cyan.bold('Files')
106
- ],
107
- colWidths: [30, 20, 10],
108
- style: {
109
- head: [],
110
- border: ['gray']
111
- }
112
- });
113
-
114
- // Group by category for better visualization
115
- const byCategory = {};
116
- Object.entries(components).forEach(([name, data]) => {
117
- if (!byCategory[data.category]) {
118
- byCategory[data.category] = [];
119
- }
120
- byCategory[data.category].push({ name, files: data.files });
121
- });
122
-
123
- // Add rows to the table
124
- Object.entries(byCategory).forEach(([category, comps]) => {
125
- comps.forEach((comp, index) => {
126
- if (index === 0) {
127
- // First row of the category
128
- table.push([
129
- chalk.bold(comp.name),
130
- chalk.yellow(category),
131
- comp.files.toString()
132
- ]);
133
- } else {
134
- // Rest of components in the category
135
- table.push([
136
- chalk.bold(comp.name),
137
- chalk.gray('â€ŗ'), // Ditto mark
138
- comp.files.toString()
139
- ]);
140
- }
141
- });
142
- });
143
-
144
- Print.newLine();
145
- Print.title('đŸ“Ļ Local Components');
146
- Print.newLine();
147
- console.log(table.toString());
148
- Print.newLine();
149
- Print.info(`Total: ${Object.keys(components).length} component${Object.keys(components).length !== 1 ? 's' : ''} found`);
150
-
151
- // Path where components.js will be generated
152
- const outputPath = getComponentsJsPath(import.meta.url);
153
-
154
- // Ensure the directory exists
155
- const outputDir = path.dirname(outputPath);
156
- if (!fs.existsSync(outputDir)) {
157
- fs.mkdirSync(outputDir, { recursive: true });
158
- }
159
-
160
- // Generate components.js file with detected components
161
- const componentsForExport = Object.fromEntries(
162
- Object.entries(components).map(([name, data]) => [name, data.category])
163
- );
164
- fs.writeFileSync(outputPath, `const components = ${JSON.stringify(componentsForExport, null, 2)};\n\nexport default components;\n`);
165
-
166
- } catch (error) {
167
- Print.error(`Failed to list components: ${error.message}`);
168
- Print.info('Make sure your project structure is correct');
169
- }
170
- }
171
-
172
- export default listComponentsReal;
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import chalk from 'chalk';
4
+ import Print from '../Print.js';
5
+ import { getSrcPath, getComponentsJsPath, getConfigPath } from '../utils/PathHelper.js';
6
+
7
+ /**
8
+ * Loads configuration from sliceConfig.json
9
+ * @returns {object|null}
10
+ */
11
+ const loadConfig = () => {
12
+ try {
13
+ const configPath = getConfigPath(import.meta.url);
14
+ if (!fs.existsSync(configPath)) {
15
+ Print.error('sliceConfig.json not found');
16
+ Print.info('Run "slice init" to initialize your project');
17
+ return null;
18
+ }
19
+ return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
20
+ } catch (error) {
21
+ Print.error(`Failed to load configuration: ${error.message}`);
22
+ Print.info('Check that sliceConfig.json is valid JSON');
23
+ return null;
24
+ }
25
+ };
26
+
27
+ const listDirectories = (folderPath) => {
28
+ try {
29
+ if (!fs.existsSync(folderPath)) return [];
30
+ return fs.readdirSync(folderPath);
31
+ } catch (error) {
32
+ Print.error(`Failed to read directory ${folderPath}: ${error.message}`);
33
+ return [];
34
+ }
35
+ };
36
+
37
+ const countFiles = (componentPath) => {
38
+ try {
39
+ if (!fs.existsSync(componentPath)) return 0;
40
+ return fs.readdirSync(componentPath).filter((file) =>
41
+ fs.statSync(path.join(componentPath, file)).isFile()
42
+ ).length;
43
+ } catch {
44
+ return 0;
45
+ }
46
+ };
47
+
48
+ /**
49
+ * Scans sliceConfig.paths.components and returns the live component catalog.
50
+ * @returns {Record<string, {category: string, files: number}>}
51
+ */
52
+ const getComponents = () => {
53
+ const config = loadConfig();
54
+ if (!config) return {};
55
+
56
+ const components = new Map();
57
+ for (const [category, meta] of Object.entries(config.paths?.components || {})) {
58
+ const cleanPath = meta?.path ? meta.path.replace(/^[/\\]+/, '') : '';
59
+ const fullPath = getSrcPath(import.meta.url, cleanPath);
60
+ for (const entry of listDirectories(fullPath)) {
61
+ const componentPath = path.join(fullPath, entry);
62
+ if (fs.existsSync(componentPath) && fs.statSync(componentPath).isDirectory()) {
63
+ components.set(entry, { category, files: countFiles(componentPath) });
64
+ }
65
+ }
66
+ }
67
+
68
+ return Object.fromEntries(
69
+ Object.entries(Object.fromEntries(components)).sort(([a], [b]) => a.localeCompare(b))
70
+ );
71
+ };
72
+
73
+ function writeRegistry(components) {
74
+ const outputPath = getComponentsJsPath(import.meta.url);
75
+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });
76
+ const registry = Object.fromEntries(
77
+ Object.entries(components).map(([name, data]) => [name, data.category])
78
+ );
79
+ fs.writeFileSync(
80
+ outputPath,
81
+ `const components = ${JSON.stringify(registry, null, 2)};\n\nexport default components;\n`
82
+ );
83
+ }
84
+
85
+ function groupByCategory(components) {
86
+ const grouped = new Map();
87
+ for (const [name, data] of Object.entries(components)) {
88
+ if (!grouped.has(data.category)) grouped.set(data.category, []);
89
+ grouped.get(data.category).push(name);
90
+ }
91
+ return new Map(
92
+ [...grouped.entries()]
93
+ .map(([category, names]) => [category, names.sort((a, b) => a.localeCompare(b))])
94
+ .sort(([a], [b]) => a.localeCompare(b))
95
+ );
96
+ }
97
+
98
+ function wrapNames(names, indent = ' ') {
99
+ const width = Math.max(40, (process.stdout.columns || 80) - indent.length);
100
+ const lines = [];
101
+ let current = '';
102
+ for (const name of names) {
103
+ const next = current ? `${current}, ${name}` : name;
104
+ if (next.length > width && current) {
105
+ lines.push(current);
106
+ current = name;
107
+ } else {
108
+ current = next;
109
+ }
110
+ }
111
+ if (current) lines.push(current);
112
+ return lines.map((line) => `${indent}${line}`);
113
+ }
114
+
115
+ function printCompact(components, grouped) {
116
+ const names = Object.keys(components);
117
+ if (names.length === 0) {
118
+ Print.warning('No components found in your project');
119
+ Print.info('Create your first component with "slice component create"');
120
+ return;
121
+ }
122
+
123
+ Print.newLine();
124
+ console.log(chalk.bold('Local components'));
125
+ Print.newLine();
126
+
127
+ for (const [category, categoryNames] of grouped) {
128
+ const sample = categoryNames.slice(0, 4).join(', ');
129
+ const more = categoryNames.length > 4 ? ` +${categoryNames.length - 4} more` : '';
130
+ console.log(
131
+ ` ${chalk.cyan.bold(category.padEnd(16))} ${chalk.gray(String(categoryNames.length).padStart(3))} ${chalk.white(sample)}${chalk.gray(more)}`
132
+ );
133
+ }
134
+
135
+ Print.newLine();
136
+ Print.info(`Total: ${names.length} component${names.length === 1 ? '' : 's'} in ${grouped.size} categor${grouped.size === 1 ? 'y' : 'ies'}`);
137
+ Print.info('Use "slice component list --all" for every component, or --category <name> to narrow it.');
138
+ }
139
+
140
+ function printAll(components, grouped) {
141
+ const names = Object.keys(components);
142
+ if (names.length === 0) {
143
+ Print.warning('No components found in your project');
144
+ Print.info('Create your first component with "slice component create"');
145
+ return;
146
+ }
147
+
148
+ Print.newLine();
149
+ console.log(chalk.bold('Local components'));
150
+ for (const [category, categoryNames] of grouped) {
151
+ Print.newLine();
152
+ console.log(` ${chalk.cyan.bold(category)} ${chalk.gray(`(${categoryNames.length})`)}`);
153
+ for (const line of wrapNames(categoryNames)) console.log(chalk.white(line));
154
+ }
155
+ Print.newLine();
156
+ Print.info(`Total: ${names.length} component${names.length === 1 ? '' : 's'} in ${grouped.size} categor${grouped.size === 1 ? 'y' : 'ies'}`);
157
+ }
158
+
159
+ function printJson(components, grouped) {
160
+ const payload = {
161
+ total: Object.keys(components).length,
162
+ categories: [...grouped.entries()].map(([name, componentsInCategory]) => ({
163
+ name,
164
+ count: componentsInCategory.length,
165
+ components: componentsInCategory,
166
+ })),
167
+ };
168
+ console.log(JSON.stringify(payload, null, 2));
169
+ }
170
+
171
+ /**
172
+ * Lists local components and rewrites components.js.
173
+ *
174
+ * Default output is a compact category summary; `--all` lists every component.
175
+ * The long cli-table is gone on purpose: real apps have dozens/hundreds of
176
+ * components and a table becomes noise.
177
+ *
178
+ * @param {{ all?: boolean, category?: string, json?: boolean }} [options]
179
+ */
180
+ function listComponentsReal(options = {}) {
181
+ try {
182
+ const components = getComponents();
183
+ writeRegistry(components);
184
+
185
+ const filter = options.category
186
+ ? Object.entries(components).filter(([, data]) => data.category.toLowerCase() === String(options.category).toLowerCase())
187
+ : Object.entries(components);
188
+ const filtered = Object.fromEntries(filter);
189
+ const grouped = groupByCategory(filtered);
190
+
191
+ if (options.json) {
192
+ printJson(filtered, grouped);
193
+ return;
194
+ }
195
+
196
+ if (options.all) printAll(filtered, grouped);
197
+ else printCompact(filtered, grouped);
198
+ } catch (error) {
199
+ Print.error(`Failed to list components: ${error.message}`);
200
+ Print.info('Make sure your project structure is correct');
201
+ }
202
+ }
203
+
204
+ export { getComponents };
205
+ export default listComponentsReal;
@@ -88,7 +88,7 @@ export default async function checkCommand(options = {}, projectRoot) {
88
88
  `SEO OK: sitemap ${result.sitemap}, ${result.routes} route(s) cross-checked.`
89
89
  );
90
90
  } catch (error) {
91
- Print.error('slice seo check failed:', error.message);
91
+ Print.error(`slice seo check failed: ${error.message}`);
92
92
  process.exitCode = 1;
93
93
  }
94
94
  }
@@ -635,7 +635,7 @@ export default async function imagesCommand(options = {}, projectRoot) {
635
635
  process.exitCode = 1;
636
636
  }
637
637
  } catch (error) {
638
- Print.error('slice seo images failed:', error.message);
638
+ Print.error(`slice seo images failed: ${error.message}`);
639
639
  process.exitCode = 1;
640
640
  }
641
641
  }
@@ -103,7 +103,7 @@ export default async function sitemapCommand(options = {}, projectRoot) {
103
103
  process.exitCode = 1;
104
104
  }
105
105
  } catch (error) {
106
- Print.error('slice seo sitemap failed:', error.message);
106
+ Print.error(`slice seo sitemap failed: ${error.message}`);
107
107
  process.exitCode = 1;
108
108
  }
109
109
  }
@@ -120,7 +120,7 @@ export default async function setupLintCommand(options = {}, projectRoot) {
120
120
  try {
121
121
  result = await setupLint({ projectRoot, dryRun, withTypes: Boolean(options.withTypes) });
122
122
  } catch (error) {
123
- Print.error('slice setup lint:', error.message);
123
+ Print.error(`slice setup lint: ${error.message}`);
124
124
  process.exitCode = 1;
125
125
  return false;
126
126
  }
@@ -180,7 +180,7 @@ async function addSkill(options = {}) {
180
180
  }
181
181
 
182
182
  Print.success(`Skill '${manifest.name}' v${manifest.version} installed at ${manifest.installPath}/`);
183
- Print.info("Reload Claude Code (or restart the session) to pick up the skill.");
183
+ Print.info("Reload your agent session (Claude Code, OpenCode, â€Ļ) to pick up the skill.");
184
184
  return true;
185
185
  }
186
186
 
@@ -213,7 +213,7 @@ async function statusSkill() {
213
213
  const installDir = path.join(projectRoot, manifest.installPath);
214
214
  const localVersion = readLocalVersion(installDir);
215
215
 
216
- Print.title("Slice.js Claude Code skill");
216
+ Print.title("Slice.js developer skill");
217
217
  console.log(` name: ${manifest.name}`);
218
218
  console.log(` latest: v${manifest.version} (targets ${manifest.targets})`);
219
219
  console.log(` installed: ${localVersion ? "v" + localVersion : "not installed"}`);
@@ -6,9 +6,11 @@ import { spawn } from 'child_process';
6
6
  import { createServer } from 'net';
7
7
  import setupWatcher, { stopWatcher } from './watchServer.js';
8
8
  import Print from '../Print.js';
9
- import { getApiPath, getSrcPath, getDistPath, getPath } from '../utils/PathHelper.js';
9
+ import { getApiPath, getSrcPath, getDistPath, getPath, getProjectRoot } from '../utils/PathHelper.js';
10
10
  import { loadConfigSync } from '../utils/loadConfig.js';
11
11
  import build from '../build/build.js';
12
+ import { generateDocs, hasDocumentationScaffold } from '../docs/index.js';
13
+ import { syncComponentsRegistry } from '../utils/componentCatalog.js';
12
14
 
13
15
  /**
14
16
  * Checks if a port is available
@@ -91,26 +93,46 @@ function startNodeServer(port, mode) {
91
93
  });
92
94
 
93
95
  let serverStarted = false;
94
- let outputBuffer = '';
96
+ let readyAnnounced = false;
97
+ let stdoutBuffer = '';
98
+
99
+ const isReadyLine = (line) =>
100
+ line.includes('Server running') ||
101
+ line.includes('listening on') ||
102
+ line.includes('Started on') ||
103
+ line.includes(`port ${port}`);
104
+
105
+ // The framework announces readiness on stdout. The CLI already prints the
106
+ // READY block, so the announcing line is consumed instead of forwarded;
107
+ // everything else the server logs still reaches the terminal.
108
+ const forwardLine = (line) => {
109
+ if (isReadyLine(line)) {
110
+ if (!readyAnnounced) {
111
+ readyAnnounced = true;
112
+ serverStarted = true;
113
+ Print.serverReady(port);
114
+ }
115
+ return;
116
+ }
117
+ process.stdout.write(line);
118
+ };
95
119
 
96
- // Capture output to detect when the server is ready
120
+ // Capture output line by line so a readiness message split across chunks is
121
+ // still detected and suppressed exactly once.
97
122
  serverProcess.stdout.on('data', (data) => {
98
- const output = data.toString();
99
- outputBuffer += output;
100
-
101
- // Detect common messages indicating the server has started
102
- if (!serverStarted && (
103
- output.includes('Server running') ||
104
- output.includes('listening on') ||
105
- output.includes('Started on') ||
106
- output.includes(`port ${port}`)
107
- )) {
108
- serverStarted = true;
109
- Print.serverReady(port);
123
+ stdoutBuffer += data.toString();
124
+ let newline;
125
+ while ((newline = stdoutBuffer.indexOf('\n')) !== -1) {
126
+ forwardLine(stdoutBuffer.slice(0, newline + 1));
127
+ stdoutBuffer = stdoutBuffer.slice(newline + 1);
110
128
  }
129
+ });
111
130
 
112
- // Display server output
113
- process.stdout.write(output);
131
+ serverProcess.stdout.on('end', () => {
132
+ if (stdoutBuffer) {
133
+ forwardLine(stdoutBuffer);
134
+ stdoutBuffer = '';
135
+ }
114
136
  });
115
137
 
116
138
  serverProcess.stderr.on('data', (data) => {
@@ -135,6 +157,7 @@ function startNodeServer(port, mode) {
135
157
  setTimeout(() => {
136
158
  if (!serverStarted) {
137
159
  serverStarted = true;
160
+ readyAnnounced = true;
138
161
  Print.serverReady(port);
139
162
  }
140
163
  resolve(serverProcess);
@@ -166,7 +189,7 @@ export default async function startServer(options = {}) {
166
189
  const { mode = 'development', port = defaultPort, watch = false } = options;
167
190
 
168
191
  try {
169
- Print.title(`🚀 Starting Slice.js ${mode} server...`);
192
+ Print.title(`Starting Slice.js ${mode} server`);
170
193
  Print.newLine();
171
194
 
172
195
  // Verify project structure
@@ -174,6 +197,22 @@ export default async function startServer(options = {}) {
174
197
  throw new Error('Project structure not found. Run "slice init" first.');
175
198
  }
176
199
 
200
+ // Keep the generated documentation current while developing. The build
201
+ // command checks it instead of writing, so CI catches a stale commit.
202
+ // Hand-written AGENTS.md files are left alone until the project opts in.
203
+ if (mode === 'development' && watch) {
204
+ const projectRoot = getProjectRoot(import.meta.url);
205
+ try {
206
+ // Keep components.js current without printing the component catalog.
207
+ await syncComponentsRegistry(projectRoot);
208
+ if (await hasDocumentationScaffold(projectRoot)) {
209
+ await generateDocs({ projectRoot, target: 'all' });
210
+ }
211
+ } catch (error) {
212
+ Print.warning(`Could not generate project docs: ${error.message}`);
213
+ }
214
+ }
215
+
177
216
  let actualPort = await isPortAvailable(port) ? port : port + 1; // Try one more port
178
217
  if(actualPort !== port) {
179
218
  // Check if the fallback is available
@@ -181,10 +220,10 @@ export default async function startServer(options = {}) {
181
220
  if(!fallbackAvailable) {
182
221
  throw new Error(`Ports ${port} and ${actualPort} are in use.`);
183
222
  }
184
- Print.info(`â„šī¸ Port ${port} in use, using ${actualPort} instead.`);
223
+ Print.info(`Port ${port} is busy; using ${actualPort}.`);
185
224
  }
186
225
 
187
- Print.serverStatus('checking', `Port ${actualPort} available ✓`);
226
+ Print.serverStatus('checking', `Port ${actualPort} available`);
188
227
  Print.newLine();
189
228
 
190
229
  if (mode === 'production') {
@@ -218,7 +257,7 @@ export default async function startServer(options = {}) {
218
257
  await new Promise(r => setTimeout(r, 500));
219
258
 
220
259
  try {
221
- Print.info('🔄 File changed. Restarting server...');
260
+ Print.info('File changed. Restarting server...');
222
261
 
223
262
  currentServerProcess = await startNodeServer(actualPort, mode);
224
263
  } catch (e) {
@@ -8,7 +8,7 @@ import Print from '../Print.js';
8
8
  * @returns {FSWatcher} - Chokidar watcher
9
9
  */
10
10
  export default function setupWatcher(serverProcess, onRestart) {
11
- Print.info('Watch mode enabled - monitoring file changes...');
11
+ Print.info('Watch mode enabled; monitoring changes');
12
12
  Print.newLine();
13
13
 
14
14
  const watcher = chokidar.watch(['api/**/*'], {
@@ -33,7 +33,7 @@ export default function setupWatcher(serverProcess, onRestart) {
33
33
  clearTimeout(reloadTimeout);
34
34
  reloadTimeout = setTimeout(() => {
35
35
  if (onRestart) {
36
- console.log(chalk.yellow('🔄 API change detected, restarting server...'));
36
+ console.log(chalk.yellow('API change detected. Restarting server...'));
37
37
  onRestart(changedPath);
38
38
  }
39
39
  }, 500);
@@ -47,7 +47,7 @@ export default function setupWatcher(serverProcess, onRestart) {
47
47
  Print.error(`Watcher error: ${error.message}`);
48
48
  })
49
49
  .on('ready', () => {
50
- console.log(chalk.gray('👀 Watching for file changes...'));
50
+ console.log(chalk.gray('Watching for changes...'));
51
51
  Print.newLine();
52
52
  });
53
53
 
@@ -26,7 +26,7 @@ export default async function checkCommand(options = {}, projectRoot) {
26
26
  `${result.contentCount ? `, ${result.contentCount} content document(s)` : ''}).`
27
27
  );
28
28
  } catch (error) {
29
- Print.error('slice translator check failed:', error.message);
29
+ Print.error(`slice translator check failed: ${error.message}`);
30
30
  process.exitCode = 1;
31
31
  }
32
32
  }
@@ -119,7 +119,7 @@ export default async function initCommand(options = {}, projectRoot) {
119
119
  Print.info('Dictionaries live in that folder; templates use data-t="key" and code uses slice.t("key").');
120
120
  Print.info('Next: `slice translator check`.');
121
121
  } catch (error) {
122
- Print.error('slice translator init failed:', error.message);
122
+ Print.error(`slice translator init failed: ${error.message}`);
123
123
  process.exitCode = 1;
124
124
  }
125
125
  }
@@ -42,7 +42,7 @@ export default async function typecheckCommand(options = {}, projectRoot) {
42
42
  const types = await runTypeRefresh(projectRoot, options);
43
43
  if (types) reportTypesRefresh(types, projectRoot);
44
44
  } catch (error) {
45
- Print.warning('Could not refresh the generated types:', error.message);
45
+ Print.warning(`Could not refresh the generated types: ${error.message}`);
46
46
  }
47
47
  }
48
48
 
@@ -69,7 +69,7 @@ export default async function typecheckCommand(options = {}, projectRoot) {
69
69
  });
70
70
 
71
71
  if (result.error) {
72
- Print.error('Could not run tsc:', result.error.message);
72
+ Print.error(`Could not run tsc: ${result.error.message}`);
73
73
  process.exitCode = 1;
74
74
  return false;
75
75
  }