@creact-labs/creact 0.1.8 → 0.2.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/README.md +73 -22
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +88 -0
- package/dist/index.d.ts +19 -44
- package/dist/index.js +20 -68
- package/dist/jsx/index.d.ts +2 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx/jsx-dev-runtime.js +4 -0
- package/dist/jsx/jsx-runtime.d.ts +38 -0
- package/dist/jsx/jsx-runtime.js +38 -0
- package/dist/jsx/types.d.ts +12 -0
- package/dist/jsx/types.js +4 -0
- package/dist/primitives/context.d.ts +34 -0
- package/dist/primitives/context.js +63 -0
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +3 -0
- package/dist/primitives/instance.d.ts +72 -0
- package/dist/primitives/instance.js +235 -0
- package/dist/primitives/store.d.ts +22 -0
- package/dist/primitives/store.js +97 -0
- package/dist/provider/backend.d.ts +110 -0
- package/dist/provider/backend.js +37 -0
- package/dist/provider/interface.d.ts +48 -0
- package/dist/provider/interface.js +39 -0
- package/dist/reactive/effect.d.ts +11 -0
- package/dist/reactive/effect.js +42 -0
- package/dist/reactive/index.d.ts +3 -0
- package/dist/reactive/index.js +3 -0
- package/dist/reactive/signal.d.ts +32 -0
- package/dist/reactive/signal.js +60 -0
- package/dist/reactive/tracking.d.ts +41 -0
- package/dist/reactive/tracking.js +161 -0
- package/dist/runtime/fiber.d.ts +21 -0
- package/dist/runtime/fiber.js +16 -0
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/reconcile.d.ts +66 -0
- package/dist/runtime/reconcile.js +210 -0
- package/dist/runtime/render.d.ts +42 -0
- package/dist/runtime/render.js +231 -0
- package/dist/runtime/run.d.ts +119 -0
- package/dist/runtime/run.js +334 -0
- package/dist/runtime/state-machine.d.ts +95 -0
- package/dist/runtime/state-machine.js +209 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.js +4 -0
- package/package.json +11 -24
- package/dist/cli/commands/BuildCommand.d.ts +0 -40
- package/dist/cli/commands/BuildCommand.js +0 -151
- package/dist/cli/commands/DeployCommand.d.ts +0 -38
- package/dist/cli/commands/DeployCommand.js +0 -194
- package/dist/cli/commands/DevCommand.d.ts +0 -52
- package/dist/cli/commands/DevCommand.js +0 -394
- package/dist/cli/commands/PlanCommand.d.ts +0 -39
- package/dist/cli/commands/PlanCommand.js +0 -164
- package/dist/cli/commands/index.d.ts +0 -36
- package/dist/cli/commands/index.js +0 -43
- package/dist/cli/core/ArgumentParser.d.ts +0 -46
- package/dist/cli/core/ArgumentParser.js +0 -127
- package/dist/cli/core/BaseCommand.d.ts +0 -75
- package/dist/cli/core/BaseCommand.js +0 -95
- package/dist/cli/core/CLIContext.d.ts +0 -68
- package/dist/cli/core/CLIContext.js +0 -183
- package/dist/cli/core/CommandRegistry.d.ts +0 -64
- package/dist/cli/core/CommandRegistry.js +0 -89
- package/dist/cli/core/index.d.ts +0 -36
- package/dist/cli/core/index.js +0 -43
- package/dist/cli/index.d.ts +0 -35
- package/dist/cli/index.js +0 -100
- package/dist/cli/output.d.ts +0 -204
- package/dist/cli/output.js +0 -437
- package/dist/cli/utils.d.ts +0 -59
- package/dist/cli/utils.js +0 -76
- package/dist/context/createContext.d.ts +0 -90
- package/dist/context/createContext.js +0 -113
- package/dist/context/index.d.ts +0 -30
- package/dist/context/index.js +0 -35
- package/dist/core/CReact.d.ts +0 -409
- package/dist/core/CReact.js +0 -1151
- package/dist/core/CloudDOMBuilder.d.ts +0 -447
- package/dist/core/CloudDOMBuilder.js +0 -1234
- package/dist/core/ContextDependencyTracker.d.ts +0 -165
- package/dist/core/ContextDependencyTracker.js +0 -448
- package/dist/core/ErrorRecoveryManager.d.ts +0 -145
- package/dist/core/ErrorRecoveryManager.js +0 -443
- package/dist/core/EventBus.d.ts +0 -91
- package/dist/core/EventBus.js +0 -185
- package/dist/core/ProviderOutputTracker.d.ts +0 -211
- package/dist/core/ProviderOutputTracker.js +0 -476
- package/dist/core/ReactiveUpdateQueue.d.ts +0 -76
- package/dist/core/ReactiveUpdateQueue.js +0 -121
- package/dist/core/Reconciler.d.ts +0 -415
- package/dist/core/Reconciler.js +0 -1044
- package/dist/core/RenderScheduler.d.ts +0 -153
- package/dist/core/RenderScheduler.js +0 -519
- package/dist/core/Renderer.d.ts +0 -336
- package/dist/core/Renderer.js +0 -944
- package/dist/core/Runtime.d.ts +0 -246
- package/dist/core/Runtime.js +0 -640
- package/dist/core/StateBindingManager.d.ts +0 -121
- package/dist/core/StateBindingManager.js +0 -309
- package/dist/core/StateMachine.d.ts +0 -441
- package/dist/core/StateMachine.js +0 -883
- package/dist/core/StructuralChangeDetector.d.ts +0 -140
- package/dist/core/StructuralChangeDetector.js +0 -363
- package/dist/core/Validator.d.ts +0 -127
- package/dist/core/Validator.js +0 -279
- package/dist/core/errors.d.ts +0 -153
- package/dist/core/errors.js +0 -202
- package/dist/core/index.d.ts +0 -38
- package/dist/core/index.js +0 -64
- package/dist/core/types.d.ts +0 -265
- package/dist/core/types.js +0 -48
- package/dist/hooks/context.d.ts +0 -147
- package/dist/hooks/context.js +0 -334
- package/dist/hooks/useContext.d.ts +0 -113
- package/dist/hooks/useContext.js +0 -169
- package/dist/hooks/useEffect.d.ts +0 -105
- package/dist/hooks/useEffect.js +0 -540
- package/dist/hooks/useInstance.d.ts +0 -139
- package/dist/hooks/useInstance.js +0 -455
- package/dist/hooks/useState.d.ts +0 -120
- package/dist/hooks/useState.js +0 -298
- package/dist/jsx.d.ts +0 -143
- package/dist/jsx.js +0 -76
- package/dist/providers/DummyBackendProvider.d.ts +0 -193
- package/dist/providers/DummyBackendProvider.js +0 -189
- package/dist/providers/DummyCloudProvider.d.ts +0 -128
- package/dist/providers/DummyCloudProvider.js +0 -157
- package/dist/providers/IBackendProvider.d.ts +0 -177
- package/dist/providers/IBackendProvider.js +0 -31
- package/dist/providers/ICloudProvider.d.ts +0 -230
- package/dist/providers/ICloudProvider.js +0 -31
- package/dist/providers/index.d.ts +0 -31
- package/dist/providers/index.js +0 -31
- package/dist/test-event-callbacks.d.ts +0 -0
- package/dist/test-event-callbacks.js +0 -1
- package/dist/utils/Logger.d.ts +0 -144
- package/dist/utils/Logger.js +0 -220
- package/dist/utils/Output.d.ts +0 -161
- package/dist/utils/Output.js +0 -401
- package/dist/utils/deepEqual.d.ts +0 -71
- package/dist/utils/deepEqual.js +0 -276
- package/dist/utils/naming.d.ts +0 -241
- package/dist/utils/naming.js +0 -376
package/dist/utils/Output.js
DELETED
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
|
|
22
|
-
* See the License for the specific language governing permissions and
|
|
23
|
-
|
|
24
|
-
* limitations under the License.
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
* Copyright 2025 Daniel Coutinho Ribeiro
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.OutputManager = void 0;
|
|
36
|
-
exports.createOutputManager = createOutputManager;
|
|
37
|
-
/**
|
|
38
|
-
* Output Manager for User-Facing CLI Output
|
|
39
|
-
*
|
|
40
|
-
* Handles all user-facing output to stdout with support for:
|
|
41
|
-
* - Normal mode: Colored, formatted output with spinners
|
|
42
|
-
* - JSON mode: Structured JSON for programmatic consumption
|
|
43
|
-
* - Quiet mode: Minimal output (errors and critical info only)
|
|
44
|
-
*
|
|
45
|
-
* This is separate from Logger which handles internal debugging to stderr.
|
|
46
|
-
*/
|
|
47
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
48
|
-
/**
|
|
49
|
-
* Output Manager - Handles all user-facing CLI output
|
|
50
|
-
*/
|
|
51
|
-
class OutputManager {
|
|
52
|
-
constructor(options) {
|
|
53
|
-
this.mode = options.mode;
|
|
54
|
-
this.colors = options.colors ?? options.mode === 'normal';
|
|
55
|
-
this.verbose = options.verbose ?? false;
|
|
56
|
-
}
|
|
57
|
-
// ============================================================================
|
|
58
|
-
// General Output Methods
|
|
59
|
-
// ============================================================================
|
|
60
|
-
/**
|
|
61
|
-
* Show success message
|
|
62
|
-
*/
|
|
63
|
-
showSuccess(message) {
|
|
64
|
-
if (this.mode === 'quiet')
|
|
65
|
-
return;
|
|
66
|
-
if (this.mode === 'json') {
|
|
67
|
-
this.outputJson({ type: 'success', message });
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const formatted = this.colors ? chalk_1.default.green(message) : message;
|
|
71
|
-
console.log(formatted);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Show info message
|
|
75
|
-
*/
|
|
76
|
-
showInfo(message) {
|
|
77
|
-
if (this.mode === 'quiet')
|
|
78
|
-
return;
|
|
79
|
-
if (this.mode === 'json') {
|
|
80
|
-
this.outputJson({ type: 'info', message });
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
console.log(message);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Show warning message
|
|
87
|
-
*/
|
|
88
|
-
showWarning(message) {
|
|
89
|
-
if (this.mode === 'quiet')
|
|
90
|
-
return;
|
|
91
|
-
if (this.mode === 'json') {
|
|
92
|
-
this.outputJson({ type: 'warning', message });
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const formatted = this.colors ? chalk_1.default.yellow(message) : message;
|
|
96
|
-
console.log(formatted);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Show error message with optional context
|
|
100
|
-
*/
|
|
101
|
-
showError(message, context) {
|
|
102
|
-
// Always show errors, even in quiet mode
|
|
103
|
-
if (this.mode === 'json') {
|
|
104
|
-
this.outputJson({
|
|
105
|
-
type: 'error',
|
|
106
|
-
message,
|
|
107
|
-
resourceId: context?.resourceId,
|
|
108
|
-
cause: context?.cause,
|
|
109
|
-
stackTrace: this.verbose ? context?.stackTrace : undefined,
|
|
110
|
-
});
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
const formatted = this.colors ? chalk_1.default.red(`Error: ${message}`) : `Error: ${message}`;
|
|
114
|
-
console.error(formatted);
|
|
115
|
-
if (context?.resourceId) {
|
|
116
|
-
console.error(` Resource: ${context.resourceId}`);
|
|
117
|
-
}
|
|
118
|
-
if (context?.cause) {
|
|
119
|
-
console.error(` Cause: ${context.cause}`);
|
|
120
|
-
}
|
|
121
|
-
if (this.verbose && context?.stackTrace) {
|
|
122
|
-
console.error(`\nStack trace:\n${context.stackTrace}`);
|
|
123
|
-
}
|
|
124
|
-
else if (!this.verbose && context?.stackTrace) {
|
|
125
|
-
console.error('\n Run with --verbose for full stack trace.');
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// ============================================================================
|
|
129
|
-
// Plan Display Methods
|
|
130
|
-
// ============================================================================
|
|
131
|
-
/**
|
|
132
|
-
* Show plan header with stack name
|
|
133
|
-
*/
|
|
134
|
-
showPlanHeader(stackName) {
|
|
135
|
-
if (this.mode === 'quiet')
|
|
136
|
-
return;
|
|
137
|
-
if (this.mode === 'json') {
|
|
138
|
-
this.outputJson({ type: 'plan_header', stackName });
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const header = this.colors
|
|
142
|
-
? chalk_1.default.bold.cyan(`\nPlanning changes for stack: ${stackName}`)
|
|
143
|
-
: `\nPlanning changes for stack: ${stackName}`;
|
|
144
|
-
console.log(header);
|
|
145
|
-
console.log(this.colors ? chalk_1.default.dim('─'.repeat(50)) : '─'.repeat(50));
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Show planned changes with diff visualization
|
|
149
|
-
*/
|
|
150
|
-
showPlanChanges(changeSet) {
|
|
151
|
-
if (this.mode === 'quiet')
|
|
152
|
-
return;
|
|
153
|
-
if (this.mode === 'json') {
|
|
154
|
-
this.outputJson({
|
|
155
|
-
type: 'plan_changes',
|
|
156
|
-
creates: changeSet.creates.map((n) => this.nodeToJson(n)),
|
|
157
|
-
updates: changeSet.updates.map((n) => this.nodeToJson(n)),
|
|
158
|
-
deletes: changeSet.deletes.map((n) => this.nodeToJson(n)),
|
|
159
|
-
moves: changeSet.moves,
|
|
160
|
-
});
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
// Creates
|
|
164
|
-
if (changeSet.creates.length > 0) {
|
|
165
|
-
const header = this.colors
|
|
166
|
-
? chalk_1.default.green(`\n + ${changeSet.creates.length} to create`)
|
|
167
|
-
: `\n + ${changeSet.creates.length} to create`;
|
|
168
|
-
console.log(header);
|
|
169
|
-
changeSet.creates.forEach((node) => {
|
|
170
|
-
const line = ` + ${this.formatNodeId(node)}`;
|
|
171
|
-
console.log(this.colors ? chalk_1.default.green(line) : line);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
// Updates
|
|
175
|
-
if (changeSet.updates.length > 0) {
|
|
176
|
-
const header = this.colors
|
|
177
|
-
? chalk_1.default.yellow(`\n ~ ${changeSet.updates.length} to update`)
|
|
178
|
-
: `\n ~ ${changeSet.updates.length} to update`;
|
|
179
|
-
console.log(header);
|
|
180
|
-
changeSet.updates.forEach((node) => {
|
|
181
|
-
const line = ` ~ ${this.formatNodeId(node)}`;
|
|
182
|
-
console.log(this.colors ? chalk_1.default.yellow(line) : line);
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
// Deletes
|
|
186
|
-
if (changeSet.deletes.length > 0) {
|
|
187
|
-
const header = this.colors
|
|
188
|
-
? chalk_1.default.red(`\n - ${changeSet.deletes.length} to delete`)
|
|
189
|
-
: `\n - ${changeSet.deletes.length} to delete`;
|
|
190
|
-
console.log(header);
|
|
191
|
-
changeSet.deletes.forEach((node) => {
|
|
192
|
-
const line = ` - ${this.formatNodeId(node)}`;
|
|
193
|
-
console.log(this.colors ? chalk_1.default.red(line) : line);
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
// Moves
|
|
197
|
-
if (changeSet.moves && changeSet.moves.length > 0) {
|
|
198
|
-
const header = this.colors
|
|
199
|
-
? chalk_1.default.cyan(`\n → ${changeSet.moves.length} to move`)
|
|
200
|
-
: `\n → ${changeSet.moves.length} to move`;
|
|
201
|
-
console.log(header);
|
|
202
|
-
changeSet.moves.forEach((move) => {
|
|
203
|
-
const line = ` → ${move.from} → ${move.to}`;
|
|
204
|
-
console.log(this.colors ? chalk_1.default.cyan(line) : line);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Show plan summary with change counts
|
|
210
|
-
*/
|
|
211
|
-
showPlanSummary(changeSet) {
|
|
212
|
-
if (this.mode === 'quiet')
|
|
213
|
-
return;
|
|
214
|
-
const creates = changeSet.creates.length;
|
|
215
|
-
const updates = changeSet.updates.length;
|
|
216
|
-
const deletes = changeSet.deletes.length;
|
|
217
|
-
const moves = changeSet.moves?.length || 0;
|
|
218
|
-
const total = creates + updates + deletes + moves;
|
|
219
|
-
if (this.mode === 'json') {
|
|
220
|
-
this.outputJson({
|
|
221
|
-
type: 'plan_summary',
|
|
222
|
-
creates,
|
|
223
|
-
updates,
|
|
224
|
-
deletes,
|
|
225
|
-
moves,
|
|
226
|
-
total,
|
|
227
|
-
});
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
if (total === 0) {
|
|
231
|
-
const message = this.colors
|
|
232
|
-
? chalk_1.default.dim('\nNo changes. Infrastructure is up-to-date.')
|
|
233
|
-
: '\nNo changes. Infrastructure is up-to-date.';
|
|
234
|
-
console.log(message);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
const summary = `\nPlan: ${creates} to add, ${updates} to change, ${deletes} to destroy`;
|
|
238
|
-
console.log(this.colors ? chalk_1.default.bold(summary) : summary);
|
|
239
|
-
}
|
|
240
|
-
// ============================================================================
|
|
241
|
-
// Deployment Progress Methods
|
|
242
|
-
// ============================================================================
|
|
243
|
-
/**
|
|
244
|
-
* Show deployment header
|
|
245
|
-
*/
|
|
246
|
-
showDeployHeader() {
|
|
247
|
-
if (this.mode === 'quiet')
|
|
248
|
-
return;
|
|
249
|
-
if (this.mode === 'json') {
|
|
250
|
-
this.outputJson({ type: 'deploy_header' });
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
const header = this.colors ? chalk_1.default.bold.cyan('\nApplying changes...') : '\nApplying changes...';
|
|
254
|
-
console.log(header);
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Show resource deployment progress
|
|
258
|
-
*/
|
|
259
|
-
showResourceProgress(id, action) {
|
|
260
|
-
if (this.mode === 'quiet')
|
|
261
|
-
return;
|
|
262
|
-
if (this.mode === 'json') {
|
|
263
|
-
this.outputJson({ type: 'resource_progress', resourceId: id, action });
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
const spinner = this.colors ? chalk_1.default.cyan('⟳') : '⟳';
|
|
267
|
-
const message = `${spinner} ${id}: ${action}...`;
|
|
268
|
-
console.log(message);
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Show resource deployment completion
|
|
272
|
-
*/
|
|
273
|
-
showResourceComplete(id, action, duration) {
|
|
274
|
-
if (this.mode === 'quiet')
|
|
275
|
-
return;
|
|
276
|
-
if (this.mode === 'json') {
|
|
277
|
-
this.outputJson({ type: 'resource_complete', resourceId: id, action, duration });
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
const checkmark = this.colors ? chalk_1.default.green('✓') : '✓';
|
|
281
|
-
const durationStr = duration.toFixed(1);
|
|
282
|
-
const message = `${checkmark} ${id}: ${action} (${durationStr}s)`;
|
|
283
|
-
console.log(this.colors ? chalk_1.default.green(message) : message);
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Show deployment summary
|
|
287
|
-
*/
|
|
288
|
-
showDeploySummary(result) {
|
|
289
|
-
if (this.mode === 'quiet' && !result.errors?.length)
|
|
290
|
-
return;
|
|
291
|
-
if (this.mode === 'json') {
|
|
292
|
-
this.outputJson({ type: 'deploy_summary', ...result });
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
console.log('');
|
|
296
|
-
if (result.errors && result.errors.length > 0) {
|
|
297
|
-
const message = this.colors
|
|
298
|
-
? chalk_1.default.red(`Deployment failed with ${result.errors.length} error(s)`)
|
|
299
|
-
: `Deployment failed with ${result.errors.length} error(s)`;
|
|
300
|
-
console.log(message);
|
|
301
|
-
result.errors.forEach((err) => {
|
|
302
|
-
console.log(` - ${err.resourceId}: ${err.message}`);
|
|
303
|
-
});
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
const summary = `Apply complete! Resources: ${result.creates} added, ${result.updates} changed, ${result.deletes} destroyed`;
|
|
307
|
-
const duration = `Duration: ${result.duration.toFixed(1)}s`;
|
|
308
|
-
console.log(this.colors ? chalk_1.default.bold.green(summary) : summary);
|
|
309
|
-
console.log(this.colors ? chalk_1.default.dim(duration) : duration);
|
|
310
|
-
}
|
|
311
|
-
// ============================================================================
|
|
312
|
-
// Reactive Changes Methods
|
|
313
|
-
// ============================================================================
|
|
314
|
-
/**
|
|
315
|
-
* Show reactive changes detected notification
|
|
316
|
-
*/
|
|
317
|
-
showReactiveChangesDetected() {
|
|
318
|
-
if (this.mode === 'quiet')
|
|
319
|
-
return;
|
|
320
|
-
if (this.mode === 'json') {
|
|
321
|
-
this.outputJson({ type: 'reactive_changes_detected' });
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
const message = this.colors
|
|
325
|
-
? chalk_1.default.yellow('\nReactive changes detected')
|
|
326
|
-
: '\nReactive changes detected';
|
|
327
|
-
console.log(message);
|
|
328
|
-
}
|
|
329
|
-
// ============================================================================
|
|
330
|
-
// Hot Reload Methods
|
|
331
|
-
// ============================================================================
|
|
332
|
-
/**
|
|
333
|
-
* Show file changed notification
|
|
334
|
-
*/
|
|
335
|
-
showFileChanged(filename) {
|
|
336
|
-
if (this.mode === 'quiet')
|
|
337
|
-
return;
|
|
338
|
-
if (this.mode === 'json') {
|
|
339
|
-
this.outputJson({ type: 'file_changed', filename });
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
const message = `File changed: ${filename}`;
|
|
343
|
-
console.log(this.colors ? chalk_1.default.blue(message) : message);
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Show hot reload start notification
|
|
347
|
-
*/
|
|
348
|
-
showHotReloadStart() {
|
|
349
|
-
if (this.mode === 'quiet')
|
|
350
|
-
return;
|
|
351
|
-
if (this.mode === 'json') {
|
|
352
|
-
this.outputJson({ type: 'hot_reload_start' });
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
const message = this.colors ? chalk_1.default.cyan('Hot reloading...') : 'Hot reloading...';
|
|
356
|
-
console.log(message);
|
|
357
|
-
}
|
|
358
|
-
// ============================================================================
|
|
359
|
-
// Helper Methods
|
|
360
|
-
// ============================================================================
|
|
361
|
-
/**
|
|
362
|
-
* Output JSON to stdout
|
|
363
|
-
*/
|
|
364
|
-
outputJson(data) {
|
|
365
|
-
console.log(JSON.stringify({ ...data, timestamp: Date.now() }));
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Format node ID for display
|
|
369
|
-
*/
|
|
370
|
-
formatNodeId(node) {
|
|
371
|
-
const constructName = node.construct?.name || 'Unknown';
|
|
372
|
-
return `${constructName}.${node.id}`;
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Convert CloudDOM node to JSON representation
|
|
376
|
-
*/
|
|
377
|
-
nodeToJson(node) {
|
|
378
|
-
return {
|
|
379
|
-
id: node.id,
|
|
380
|
-
construct: node.construct?.name || 'Unknown',
|
|
381
|
-
path: node.path.join('.'),
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
exports.OutputManager = OutputManager;
|
|
386
|
-
/**
|
|
387
|
-
* Create an Output Manager from CLI flags
|
|
388
|
-
*/
|
|
389
|
-
function createOutputManager(flags) {
|
|
390
|
-
let mode = 'normal';
|
|
391
|
-
if (flags.json) {
|
|
392
|
-
mode = 'json';
|
|
393
|
-
}
|
|
394
|
-
else if (flags.quiet) {
|
|
395
|
-
mode = 'quiet';
|
|
396
|
-
}
|
|
397
|
-
return new OutputManager({
|
|
398
|
-
mode,
|
|
399
|
-
verbose: flags.verbose,
|
|
400
|
-
});
|
|
401
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
-
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
|
|
23
|
-
* limitations under the License.
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
* Copyright 2025 Daniel Coutinho Ribeiro
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Deep equality comparison with memoization
|
|
32
|
-
*
|
|
33
|
-
* Compares two values deeply, handling:
|
|
34
|
-
* - Primitives (string, number, boolean, null, undefined)
|
|
35
|
-
* - Arrays (order matters)
|
|
36
|
-
* - Objects (key order doesn't matter)
|
|
37
|
-
* - Nested structures
|
|
38
|
-
*
|
|
39
|
-
* Memoizes results for performance on large graphs.
|
|
40
|
-
*
|
|
41
|
-
* Note: Does not handle:
|
|
42
|
-
* - Functions (always considered unequal)
|
|
43
|
-
* - Symbols (always considered unequal)
|
|
44
|
-
* - Circular references (will throw)
|
|
45
|
-
* - Special objects (Date, RegExp, Map, Set) - uses JSON serialization
|
|
46
|
-
*
|
|
47
|
-
* @param a - First value
|
|
48
|
-
* @param b - Second value
|
|
49
|
-
* @param useMemoization - Enable memoization (default: true)
|
|
50
|
-
* @returns True if values are deeply equal
|
|
51
|
-
*/
|
|
52
|
-
export declare function deepEqual(a: any, b: any, useMemoization?: boolean): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Clear the memoization caches
|
|
55
|
-
*
|
|
56
|
-
* Useful for testing or when memory usage is a concern.
|
|
57
|
-
*/
|
|
58
|
-
export declare function clearEqualityCache(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Get cache statistics for monitoring and performance profiling
|
|
61
|
-
*
|
|
62
|
-
* @returns Cache size, hit rate, and performance metrics
|
|
63
|
-
*/
|
|
64
|
-
export declare function getEqualityCacheStats(): {
|
|
65
|
-
size: number;
|
|
66
|
-
maxSize: number;
|
|
67
|
-
hits: number;
|
|
68
|
-
misses: number;
|
|
69
|
-
hitRate: number;
|
|
70
|
-
primitiveSize: number;
|
|
71
|
-
};
|