File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 "tsx" : " ^4.7.3" ,
1515 "ink" : " ^4.4.1" ,
1616 "@inkjs/ui" : " ^1.0.0" ,
17- "react" : " ^18.3.1" ,
18- "eventemitter2" : " ^6.4.9"
17+ "react" : " ^18.3.1"
1918 },
2019 "description" : " Codify is a set up as code tool for developers" ,
2120 "devDependencies" : {
Original file line number Diff line number Diff line change 11import { EventEmitter } from 'node:events' ;
22
3-
43export enum Event {
54 STDOUT = 'stdout' ,
65 STDERR = 'stderr' ,
@@ -39,7 +38,11 @@ export const ctx = new class {
3938 }
4039
4140 debug ( ...args : unknown [ ] ) {
42- // Add filtering here to only allow debug events when in debug mode
41+ const debug = process . env . DEBUG ;
42+ if ( ! debug ?. toLowerCase ( ) . includes ( 'codify' ) && ! debug ?. includes ( '*' ) ) {
43+ return ;
44+ }
45+
4346 this . emitter . emit ( Event . DEBUG , ...args ) ;
4447 }
4548
Original file line number Diff line number Diff line change 11import { PlanResponseData } from 'codify-schemas' ;
22
33import { Project } from '../entities/project.js' ;
4+ import { ctx } from '../events/context.js' ;
45import { Parser } from '../parser/index.js' ;
56import { PluginCollection } from '../plugins/plugin-collection.js' ;
6- import { ctx } from './context.js' ;
77
88interface PlanOchestratorResponse {
99 plan : PlanResponseData [ ] ,
@@ -12,11 +12,11 @@ interface PlanOchestratorResponse {
1212}
1313
1414export enum PlanStatus {
15- PLAN = 'plan' ,
16- PARSE = 'parse' ,
15+ GENERATE_PLAN = 'generate_plan' ,
1716 INITIALIZE_PLUGINS = 'initalize_plugins' ,
17+ PARSE = 'parse' ,
18+ PLAN = 'plan' ,
1819 VALIDATE = 'validate' ,
19- GENERATE_PLAN = 'generate_plan' ,
2020}
2121
2222export const PlanOrchestrator = {
Original file line number Diff line number Diff line change 11import { IpcMessage , IpcMessageSchema } from 'codify-schemas' ;
22import { ChildProcess , fork } from 'node:child_process' ;
33
4- import { ctx } from '../orchestrators /context.js' ;
4+ import { ctx } from '../events /context.js' ;
55import { ajv } from '../utils/ajv.js' ;
66import { PluginMessage } from './message.js' ;
77
Original file line number Diff line number Diff line change @@ -47,10 +47,5 @@ export function PlanComponent({ eventTarget }: { eventTarget: EventEmitter }) {
4747 </ Box >
4848 ) ?? [ ]
4949 }
50- {
51- staticOutput . flatMap ( ( arr ) => arr . split ( '\n' ) ) . slice ( - 5 ) . map ( ( item , i ) =>
52- < Text key = { i } > { item } </ Text >
53- )
54- }
5550 </ Box >
5651}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { render } from 'ink';
22import { EventEmitter } from 'node:events' ;
33import React from 'react' ;
44
5- import { ctx , Event } from '../../orchestrators /context.js' ;
5+ import { ctx , Event } from '../../events /context.js' ;
66import { PlanComponent } from '../components/plan-component.js' ;
77import { Reporter } from './reporter.js' ;
88
Original file line number Diff line number Diff line change 1- import { ctx , Event } from '../../orchestrators /context.js' ;
1+ import { ctx , Event } from '../../events /context.js' ;
22import { Reporter } from './reporter.js' ;
33
44export class PlainReporter implements Reporter {
You can’t perform that action at this time.
0 commit comments