@creact-labs/creact 0.1.8 → 0.2.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.
- package/README.md +85 -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 +29 -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
|
@@ -1,89 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.CommandRegistry = void 0;
|
|
33
|
-
const commands_1 = require("../commands");
|
|
34
|
-
/**
|
|
35
|
-
* Registry of available CLI commands
|
|
36
|
-
*/
|
|
37
|
-
class CommandRegistry {
|
|
38
|
-
/**
|
|
39
|
-
* Get all available command names
|
|
40
|
-
*/
|
|
41
|
-
static getCommandNames() {
|
|
42
|
-
return Array.from(this.commands.keys());
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Check if command exists
|
|
46
|
-
*/
|
|
47
|
-
static hasCommand(name) {
|
|
48
|
-
return this.commands.has(name);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Create command instance
|
|
52
|
-
*/
|
|
53
|
-
static createCommand(name, context) {
|
|
54
|
-
const CommandClass = this.commands.get(name);
|
|
55
|
-
if (!CommandClass) {
|
|
56
|
-
throw new Error(`Unknown command: ${name}`);
|
|
57
|
-
}
|
|
58
|
-
return new CommandClass(context);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Register a new command
|
|
62
|
-
*/
|
|
63
|
-
static registerCommand(name, commandClass) {
|
|
64
|
-
this.commands.set(name, commandClass);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Get command help information
|
|
68
|
-
*/
|
|
69
|
-
static getCommandHelp() {
|
|
70
|
-
const help = [];
|
|
71
|
-
for (const [name, CommandClass] of this.commands.entries()) {
|
|
72
|
-
// Create temporary instance to get description
|
|
73
|
-
const tempContext = { args: [], flags: {} };
|
|
74
|
-
const instance = new CommandClass(tempContext);
|
|
75
|
-
help.push({
|
|
76
|
-
name,
|
|
77
|
-
description: instance.getDescription(),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return help;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.CommandRegistry = CommandRegistry;
|
|
84
|
-
CommandRegistry.commands = new Map([
|
|
85
|
-
['build', commands_1.BuildCommand],
|
|
86
|
-
['plan', commands_1.PlanCommand],
|
|
87
|
-
['deploy', commands_1.DeployCommand],
|
|
88
|
-
['dev', commands_1.DevCommand],
|
|
89
|
-
]);
|
package/dist/cli/core/index.d.ts
DELETED
|
@@ -1,36 +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
|
-
* CLI Core exports
|
|
32
|
-
*/
|
|
33
|
-
export { BaseCommand, CommandResult } from './BaseCommand';
|
|
34
|
-
export { CLIContext, CLIFlags, CLIContextManager } from './CLIContext';
|
|
35
|
-
export { CommandRegistry } from './CommandRegistry';
|
|
36
|
-
export { ArgumentParser } from './ArgumentParser';
|
package/dist/cli/core/index.js
DELETED
|
@@ -1,43 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.ArgumentParser = exports.CommandRegistry = exports.CLIContextManager = exports.BaseCommand = void 0;
|
|
33
|
-
/**
|
|
34
|
-
* CLI Core exports
|
|
35
|
-
*/
|
|
36
|
-
var BaseCommand_1 = require("./BaseCommand");
|
|
37
|
-
Object.defineProperty(exports, "BaseCommand", { enumerable: true, get: function () { return BaseCommand_1.BaseCommand; } });
|
|
38
|
-
var CLIContext_1 = require("./CLIContext");
|
|
39
|
-
Object.defineProperty(exports, "CLIContextManager", { enumerable: true, get: function () { return CLIContext_1.CLIContextManager; } });
|
|
40
|
-
var CommandRegistry_1 = require("./CommandRegistry");
|
|
41
|
-
Object.defineProperty(exports, "CommandRegistry", { enumerable: true, get: function () { return CommandRegistry_1.CommandRegistry; } });
|
|
42
|
-
var ArgumentParser_1 = require("./ArgumentParser");
|
|
43
|
-
Object.defineProperty(exports, "ArgumentParser", { enumerable: true, get: function () { return ArgumentParser_1.ArgumentParser; } });
|
package/dist/cli/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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
|
-
/**
|
|
32
|
-
* Main CLI entry point
|
|
33
|
-
*/
|
|
34
|
-
declare function main(): Promise<void>;
|
|
35
|
-
export { main };
|
package/dist/cli/index.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
|
|
21
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
|
|
23
|
-
* See the License for the specific language governing permissions and
|
|
24
|
-
|
|
25
|
-
* limitations under the License.
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
* Copyright 2025 Daniel Coutinho Ribeiro
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.main = main;
|
|
34
|
-
/**
|
|
35
|
-
* CReact CLI Entry Point - Clean modular architecture
|
|
36
|
-
*
|
|
37
|
-
* This is the main entry point for the CReact CLI.
|
|
38
|
-
* It uses a clean, modular architecture with:
|
|
39
|
-
* - Separate command classes
|
|
40
|
-
* - Dependency injection through CLIContext
|
|
41
|
-
* - Proper error handling
|
|
42
|
-
* - Consistent output formatting
|
|
43
|
-
*/
|
|
44
|
-
const core_1 = require("./core");
|
|
45
|
-
const Logger_1 = require("../utils/Logger");
|
|
46
|
-
const logger = Logger_1.LoggerFactory.getLogger('cli');
|
|
47
|
-
const VERSION = '0.1.0';
|
|
48
|
-
/**
|
|
49
|
-
* Main CLI entry point
|
|
50
|
-
*/
|
|
51
|
-
async function main() {
|
|
52
|
-
try {
|
|
53
|
-
// Parse command line arguments
|
|
54
|
-
const context = core_1.ArgumentParser.parse(process.argv);
|
|
55
|
-
const commandName = context.args[0];
|
|
56
|
-
// Handle help and version flags
|
|
57
|
-
if (context.flags.help || context.flags.h) {
|
|
58
|
-
core_1.ArgumentParser.showHelp();
|
|
59
|
-
process.exit(0);
|
|
60
|
-
}
|
|
61
|
-
if (context.flags.version || context.flags.V) {
|
|
62
|
-
logger.info(`CReact CLI v${VERSION}`);
|
|
63
|
-
process.exit(0);
|
|
64
|
-
}
|
|
65
|
-
// Validate command exists
|
|
66
|
-
if (!core_1.CommandRegistry.hasCommand(commandName)) {
|
|
67
|
-
logger.error(`Error: Unknown command '${commandName}'`);
|
|
68
|
-
logger.error('');
|
|
69
|
-
core_1.ArgumentParser.showHelp();
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
// Create and execute command
|
|
73
|
-
const command = core_1.CommandRegistry.createCommand(commandName, context);
|
|
74
|
-
const result = await command.execute();
|
|
75
|
-
// Exit with appropriate code
|
|
76
|
-
process.exit(result.exitCode);
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
// Handle unexpected errors
|
|
80
|
-
logger.error(`Fatal error: ${error.message}`);
|
|
81
|
-
if (process.env.CREACT_DEBUG === 'true') {
|
|
82
|
-
logger.error(error.stack || '');
|
|
83
|
-
}
|
|
84
|
-
process.exit(1);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
// Handle unhandled promise rejections
|
|
88
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
89
|
-
logger.error('Unhandled promise rejection:', reason);
|
|
90
|
-
process.exit(1);
|
|
91
|
-
});
|
|
92
|
-
// Handle uncaught exceptions
|
|
93
|
-
process.on('uncaughtException', (error) => {
|
|
94
|
-
logger.error('Uncaught exception:', error);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
});
|
|
97
|
-
// Run CLI
|
|
98
|
-
if (require.main === module) {
|
|
99
|
-
main();
|
|
100
|
-
}
|
package/dist/cli/output.d.ts
DELETED
|
@@ -1,204 +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
|
-
* CLI Output Utilities
|
|
32
|
-
*
|
|
33
|
-
* DEPRECATED: Most functions in this file are deprecated in favor of OutputManager.
|
|
34
|
-
* Use OutputManager (src/utils/Output.ts) for user-facing output instead.
|
|
35
|
-
*
|
|
36
|
-
* This file now only contains:
|
|
37
|
-
* - Color utilities (colors object)
|
|
38
|
-
* - Spinner, ProgressBar, MultiProgressBar classes (for backward compatibility)
|
|
39
|
-
*
|
|
40
|
-
* Deprecated functions (use OutputManager instead):
|
|
41
|
-
* - printSuccess() -> output.showSuccess()
|
|
42
|
-
* - printError() -> output.showError()
|
|
43
|
-
* - printInfo() -> output.showInfo()
|
|
44
|
-
* - printWarning() -> output.showWarning()
|
|
45
|
-
* - formatDiff() -> output.showPlanChanges()
|
|
46
|
-
*/
|
|
47
|
-
import chalk from 'chalk';
|
|
48
|
-
/**
|
|
49
|
-
* Color utilities for consistent CLI output
|
|
50
|
-
*/
|
|
51
|
-
export declare const colors: {
|
|
52
|
-
success: chalk.Chalk;
|
|
53
|
-
error: chalk.Chalk;
|
|
54
|
-
warning: chalk.Chalk;
|
|
55
|
-
info: chalk.Chalk;
|
|
56
|
-
create: chalk.Chalk;
|
|
57
|
-
update: chalk.Chalk;
|
|
58
|
-
delete: chalk.Chalk;
|
|
59
|
-
move: chalk.Chalk;
|
|
60
|
-
primary: chalk.Chalk;
|
|
61
|
-
secondary: chalk.Chalk;
|
|
62
|
-
highlight: chalk.Chalk;
|
|
63
|
-
dim: chalk.Chalk;
|
|
64
|
-
resource: chalk.Chalk;
|
|
65
|
-
output: chalk.Chalk;
|
|
66
|
-
checkmark: string;
|
|
67
|
-
cross: string;
|
|
68
|
-
arrow: string;
|
|
69
|
-
bullet: string;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Spinner manager for long-running operations
|
|
73
|
-
*/
|
|
74
|
-
export declare class Spinner {
|
|
75
|
-
private spinner;
|
|
76
|
-
private isJsonMode;
|
|
77
|
-
constructor(isJsonMode?: boolean);
|
|
78
|
-
/**
|
|
79
|
-
* Start spinner with message
|
|
80
|
-
*/
|
|
81
|
-
start(message: string): void;
|
|
82
|
-
/**
|
|
83
|
-
* Update spinner text
|
|
84
|
-
*/
|
|
85
|
-
update(message: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* Mark spinner as successful
|
|
88
|
-
*/
|
|
89
|
-
succeed(message?: string): void;
|
|
90
|
-
/**
|
|
91
|
-
* Mark spinner as failed
|
|
92
|
-
*/
|
|
93
|
-
fail(message?: string): void;
|
|
94
|
-
/**
|
|
95
|
-
* Mark spinner as warning
|
|
96
|
-
*/
|
|
97
|
-
warn(message?: string): void;
|
|
98
|
-
/**
|
|
99
|
-
* Stop spinner without status
|
|
100
|
-
*/
|
|
101
|
-
stop(): void;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Progress bar for batch operations
|
|
105
|
-
*/
|
|
106
|
-
export declare class ProgressBar {
|
|
107
|
-
private bar;
|
|
108
|
-
private isJsonMode;
|
|
109
|
-
private total;
|
|
110
|
-
private current;
|
|
111
|
-
constructor(isJsonMode?: boolean);
|
|
112
|
-
/**
|
|
113
|
-
* Start progress bar
|
|
114
|
-
*/
|
|
115
|
-
start(total: number, startValue?: number, message?: string): void;
|
|
116
|
-
/**
|
|
117
|
-
* Update progress
|
|
118
|
-
*/
|
|
119
|
-
update(value: number, status?: string): void;
|
|
120
|
-
/**
|
|
121
|
-
* Increment progress by 1
|
|
122
|
-
*/
|
|
123
|
-
increment(status?: string): void;
|
|
124
|
-
/**
|
|
125
|
-
* Stop progress bar
|
|
126
|
-
*/
|
|
127
|
-
stop(): void;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Multi-bar progress for parallel operations
|
|
131
|
-
*/
|
|
132
|
-
export declare class MultiProgressBar {
|
|
133
|
-
private multibar;
|
|
134
|
-
private bars;
|
|
135
|
-
private isJsonMode;
|
|
136
|
-
constructor(isJsonMode?: boolean);
|
|
137
|
-
/**
|
|
138
|
-
* Add a new progress bar
|
|
139
|
-
*/
|
|
140
|
-
add(name: string, total: number, startValue?: number): void;
|
|
141
|
-
/**
|
|
142
|
-
* Update a specific progress bar
|
|
143
|
-
*/
|
|
144
|
-
update(name: string, value: number): void;
|
|
145
|
-
/**
|
|
146
|
-
* Increment a specific progress bar
|
|
147
|
-
*/
|
|
148
|
-
increment(name: string): void;
|
|
149
|
-
/**
|
|
150
|
-
* Stop all progress bars
|
|
151
|
-
*/
|
|
152
|
-
stop(): void;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Format diff output with colors
|
|
156
|
-
* @deprecated Use OutputManager.showPlanChanges() and showPlanSummary() instead
|
|
157
|
-
*/
|
|
158
|
-
export declare function formatDiff(changeSet: {
|
|
159
|
-
creates: any[];
|
|
160
|
-
updates: any[];
|
|
161
|
-
deletes: any[];
|
|
162
|
-
moves?: Array<{
|
|
163
|
-
from: string;
|
|
164
|
-
to: string;
|
|
165
|
-
}>;
|
|
166
|
-
}): string;
|
|
167
|
-
/**
|
|
168
|
-
* Format deployment status with colors
|
|
169
|
-
*/
|
|
170
|
-
export declare function formatDeploymentStatus(status: string): string;
|
|
171
|
-
/**
|
|
172
|
-
* Format resource output
|
|
173
|
-
*/
|
|
174
|
-
export declare function formatResource(construct: string, id: string, status?: string): string;
|
|
175
|
-
/**
|
|
176
|
-
* Print success message
|
|
177
|
-
* @deprecated Use OutputManager.showSuccess() instead
|
|
178
|
-
*/
|
|
179
|
-
export declare function printSuccess(message: string): void;
|
|
180
|
-
/**
|
|
181
|
-
* Print error message
|
|
182
|
-
* @deprecated Use OutputManager.showError() instead
|
|
183
|
-
*/
|
|
184
|
-
export declare function printError(message: string): void;
|
|
185
|
-
/**
|
|
186
|
-
* Print warning message
|
|
187
|
-
* @deprecated Use OutputManager.showWarning() instead
|
|
188
|
-
*/
|
|
189
|
-
export declare function printWarning(message: string): void;
|
|
190
|
-
/**
|
|
191
|
-
* Print info message
|
|
192
|
-
* @deprecated Use OutputManager.showInfo() instead
|
|
193
|
-
*/
|
|
194
|
-
export declare function printInfo(message: string): void;
|
|
195
|
-
/**
|
|
196
|
-
* Print section header
|
|
197
|
-
* @deprecated Use OutputManager methods instead
|
|
198
|
-
*/
|
|
199
|
-
export declare function printHeader(message: string): void;
|
|
200
|
-
/**
|
|
201
|
-
* Print table
|
|
202
|
-
* @deprecated Use OutputManager methods instead
|
|
203
|
-
*/
|
|
204
|
-
export declare function printTable(headers: string[], rows: string[][]): void;
|