spawn-term 0.1.1 → 0.1.2

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.
@@ -72,7 +72,9 @@ function createApp() {
72
72
  list = [];
73
73
  inkApp = (0, _ink.render)(/*#__PURE__*/ _react.default.createElement(_App.default, {
74
74
  list: list
75
- }));
75
+ }), {
76
+ patchConsole: false
77
+ });
76
78
  },
77
79
  release: function release() {
78
80
  if (--refCount > 0) return;
@@ -80,6 +82,7 @@ function createApp() {
80
82
  inkApp.unmount();
81
83
  inkApp = null;
82
84
  list = null;
85
+ process.stdout.write('\x1b[?25h'); // show cursor
83
86
  }
84
87
  };
85
88
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/createApp.tsx"],"sourcesContent":["import uuid from 'lil-uuid';\nimport React from 'react';\nimport App from './components/App';\n// @ts-ignore\nimport { type Instance, render } from './ink.mjs';\nimport type { ChildProcess } from './types';\n\nexport default function createApp() {\n let refCount = 0;\n let list: ChildProcess[] | null = null;\n let inkApp: Instance | null = null;\n\n return {\n addItem(data: Partial<ChildProcess>) {\n if (!list) throw new Error('Expecting list');\n const item = { id: uuid(), title: '', state: 'pending', lines: [], ...data } as ChildProcess;\n list.push(item);\n return item;\n },\n rerender() {\n if (inkApp) inkApp.rerender(<App list={list} />);\n },\n retain() {\n if (++refCount > 1) return;\n if (inkApp) throw new Error('Not expecting app');\n list = [];\n inkApp = render(<App list={list} />);\n },\n release() {\n if (--refCount > 0) return;\n if (!inkApp) throw new Error('Expecting app');\n inkApp.unmount();\n inkApp = null;\n list = null;\n },\n };\n}\n"],"names":["createApp","refCount","list","inkApp","addItem","data","Error","item","id","uuid","title","state","lines","push","rerender","App","retain","render","release","unmount"],"mappings":";;;;+BAOA;;;eAAwBA;;;8DAPP;4DACC;0DACF;mBAEsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGvB,SAASA;IACtB,IAAIC,WAAW;IACf,IAAIC,OAA8B;IAClC,IAAIC,SAA0B;IAE9B,OAAO;QACLC,SAAAA,SAAAA,QAAQC,IAA2B;YACjC,IAAI,CAACH,MAAM,MAAM,IAAII,MAAM;YAC3B,IAAMC,OAAO;gBAAEC,IAAIC,IAAAA,gBAAI;gBAAIC,OAAO;gBAAIC,OAAO;gBAAWC,OAAO,EAAE;eAAKP;YACtEH,KAAKW,IAAI,CAACN;YACV,OAAOA;QACT;QACAO,UAAAA,SAAAA;YACE,IAAIX,QAAQA,OAAOW,QAAQ,eAAC,6BAACC,YAAG;gBAACb,MAAMA;;QACzC;QACAc,QAAAA,SAAAA;YACE,IAAI,EAAEf,WAAW,GAAG;YACpB,IAAIE,QAAQ,MAAM,IAAIG,MAAM;YAC5BJ,OAAO,EAAE;YACTC,SAASc,IAAAA,WAAM,gBAAC,6BAACF,YAAG;gBAACb,MAAMA;;QAC7B;QACAgB,SAAAA,SAAAA;YACE,IAAI,EAAEjB,WAAW,GAAG;YACpB,IAAI,CAACE,QAAQ,MAAM,IAAIG,MAAM;YAC7BH,OAAOgB,OAAO;YACdhB,SAAS;YACTD,OAAO;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/createApp.tsx"],"sourcesContent":["import uuid from 'lil-uuid';\nimport React from 'react';\nimport App from './components/App';\n// @ts-ignore\nimport { type Instance, render } from './ink.mjs';\nimport type { ChildProcess } from './types';\n\nexport default function createApp() {\n let refCount = 0;\n let list: ChildProcess[] | null = null;\n let inkApp: Instance | null = null;\n\n return {\n addItem(data: Partial<ChildProcess>) {\n if (!list) throw new Error('Expecting list');\n const item = { id: uuid(), title: '', state: 'pending', lines: [], ...data } as ChildProcess;\n list.push(item);\n return item;\n },\n rerender() {\n if (inkApp) inkApp.rerender(<App list={list} />);\n },\n retain() {\n if (++refCount > 1) return;\n if (inkApp) throw new Error('Not expecting app');\n list = [];\n inkApp = render(<App list={list} />, { patchConsole: false });\n },\n release() {\n if (--refCount > 0) return;\n if (!inkApp) throw new Error('Expecting app');\n inkApp.unmount();\n inkApp = null;\n list = null;\n process.stdout.write('\\x1b[?25h'); // show cursor\n },\n };\n}\n"],"names":["createApp","refCount","list","inkApp","addItem","data","Error","item","id","uuid","title","state","lines","push","rerender","App","retain","render","patchConsole","release","unmount","process","stdout","write"],"mappings":";;;;+BAOA;;;eAAwBA;;;8DAPP;4DACC;0DACF;mBAEsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGvB,SAASA;IACtB,IAAIC,WAAW;IACf,IAAIC,OAA8B;IAClC,IAAIC,SAA0B;IAE9B,OAAO;QACLC,SAAAA,SAAAA,QAAQC,IAA2B;YACjC,IAAI,CAACH,MAAM,MAAM,IAAII,MAAM;YAC3B,IAAMC,OAAO;gBAAEC,IAAIC,IAAAA,gBAAI;gBAAIC,OAAO;gBAAIC,OAAO;gBAAWC,OAAO,EAAE;eAAKP;YACtEH,KAAKW,IAAI,CAACN;YACV,OAAOA;QACT;QACAO,UAAAA,SAAAA;YACE,IAAIX,QAAQA,OAAOW,QAAQ,eAAC,6BAACC,YAAG;gBAACb,MAAMA;;QACzC;QACAc,QAAAA,SAAAA;YACE,IAAI,EAAEf,WAAW,GAAG;YACpB,IAAIE,QAAQ,MAAM,IAAIG,MAAM;YAC5BJ,OAAO,EAAE;YACTC,SAASc,IAAAA,WAAM,gBAAC,6BAACF,YAAG;gBAACb,MAAMA;gBAAU;gBAAEgB,cAAc;YAAM;QAC7D;QACAC,SAAAA,SAAAA;YACE,IAAI,EAAElB,WAAW,GAAG;YACpB,IAAI,CAACE,QAAQ,MAAM,IAAIG,MAAM;YAC7BH,OAAOiB,OAAO;YACdjB,SAAS;YACTD,OAAO;YACPmB,QAAQC,MAAM,CAACC,KAAK,CAAC,cAAc,cAAc;QACnD;IACF;AACF"}
@@ -58,7 +58,9 @@ export default function createApp() {
58
58
  list = [];
59
59
  inkApp = render(/*#__PURE__*/ React.createElement(App, {
60
60
  list: list
61
- }));
61
+ }), {
62
+ patchConsole: false
63
+ });
62
64
  },
63
65
  release () {
64
66
  if (--refCount > 0) return;
@@ -66,6 +68,7 @@ export default function createApp() {
66
68
  inkApp.unmount();
67
69
  inkApp = null;
68
70
  list = null;
71
+ process.stdout.write('\x1b[?25h'); // show cursor
69
72
  }
70
73
  };
71
74
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/createApp.tsx"],"sourcesContent":["import uuid from 'lil-uuid';\nimport React from 'react';\nimport App from './components/App';\n// @ts-ignore\nimport { type Instance, render } from './ink.mjs';\nimport type { ChildProcess } from './types';\n\nexport default function createApp() {\n let refCount = 0;\n let list: ChildProcess[] | null = null;\n let inkApp: Instance | null = null;\n\n return {\n addItem(data: Partial<ChildProcess>) {\n if (!list) throw new Error('Expecting list');\n const item = { id: uuid(), title: '', state: 'pending', lines: [], ...data } as ChildProcess;\n list.push(item);\n return item;\n },\n rerender() {\n if (inkApp) inkApp.rerender(<App list={list} />);\n },\n retain() {\n if (++refCount > 1) return;\n if (inkApp) throw new Error('Not expecting app');\n list = [];\n inkApp = render(<App list={list} />);\n },\n release() {\n if (--refCount > 0) return;\n if (!inkApp) throw new Error('Expecting app');\n inkApp.unmount();\n inkApp = null;\n list = null;\n },\n };\n}\n"],"names":["uuid","React","App","render","createApp","refCount","list","inkApp","addItem","data","Error","item","id","title","state","lines","push","rerender","retain","release","unmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,UAAU,WAAW;AAC5B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,mBAAmB;AACnC,aAAa;AACb,SAAwBC,MAAM,QAAQ,YAAY;AAGlD,eAAe,SAASC;IACtB,IAAIC,WAAW;IACf,IAAIC,OAA8B;IAClC,IAAIC,SAA0B;IAE9B,OAAO;QACLC,SAAQC,IAA2B;YACjC,IAAI,CAACH,MAAM,MAAM,IAAII,MAAM;YAC3B,MAAMC,OAAO;gBAAEC,IAAIZ;gBAAQa,OAAO;gBAAIC,OAAO;gBAAWC,OAAO,EAAE;eAAKN;YACtEH,KAAKU,IAAI,CAACL;YACV,OAAOA;QACT;QACAM;YACE,IAAIV,QAAQA,OAAOU,QAAQ,eAAC,oBAACf;gBAAII,MAAMA;;QACzC;QACAY;YACE,IAAI,EAAEb,WAAW,GAAG;YACpB,IAAIE,QAAQ,MAAM,IAAIG,MAAM;YAC5BJ,OAAO,EAAE;YACTC,SAASJ,qBAAO,oBAACD;gBAAII,MAAMA;;QAC7B;QACAa;YACE,IAAI,EAAEd,WAAW,GAAG;YACpB,IAAI,CAACE,QAAQ,MAAM,IAAIG,MAAM;YAC7BH,OAAOa,OAAO;YACdb,SAAS;YACTD,OAAO;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/spawn-term/src/createApp.tsx"],"sourcesContent":["import uuid from 'lil-uuid';\nimport React from 'react';\nimport App from './components/App';\n// @ts-ignore\nimport { type Instance, render } from './ink.mjs';\nimport type { ChildProcess } from './types';\n\nexport default function createApp() {\n let refCount = 0;\n let list: ChildProcess[] | null = null;\n let inkApp: Instance | null = null;\n\n return {\n addItem(data: Partial<ChildProcess>) {\n if (!list) throw new Error('Expecting list');\n const item = { id: uuid(), title: '', state: 'pending', lines: [], ...data } as ChildProcess;\n list.push(item);\n return item;\n },\n rerender() {\n if (inkApp) inkApp.rerender(<App list={list} />);\n },\n retain() {\n if (++refCount > 1) return;\n if (inkApp) throw new Error('Not expecting app');\n list = [];\n inkApp = render(<App list={list} />, { patchConsole: false });\n },\n release() {\n if (--refCount > 0) return;\n if (!inkApp) throw new Error('Expecting app');\n inkApp.unmount();\n inkApp = null;\n list = null;\n process.stdout.write('\\x1b[?25h'); // show cursor\n },\n };\n}\n"],"names":["uuid","React","App","render","createApp","refCount","list","inkApp","addItem","data","Error","item","id","title","state","lines","push","rerender","retain","patchConsole","release","unmount","process","stdout","write"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,UAAU,WAAW;AAC5B,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,SAAS,mBAAmB;AACnC,aAAa;AACb,SAAwBC,MAAM,QAAQ,YAAY;AAGlD,eAAe,SAASC;IACtB,IAAIC,WAAW;IACf,IAAIC,OAA8B;IAClC,IAAIC,SAA0B;IAE9B,OAAO;QACLC,SAAQC,IAA2B;YACjC,IAAI,CAACH,MAAM,MAAM,IAAII,MAAM;YAC3B,MAAMC,OAAO;gBAAEC,IAAIZ;gBAAQa,OAAO;gBAAIC,OAAO;gBAAWC,OAAO,EAAE;eAAKN;YACtEH,KAAKU,IAAI,CAACL;YACV,OAAOA;QACT;QACAM;YACE,IAAIV,QAAQA,OAAOU,QAAQ,eAAC,oBAACf;gBAAII,MAAMA;;QACzC;QACAY;YACE,IAAI,EAAEb,WAAW,GAAG;YACpB,IAAIE,QAAQ,MAAM,IAAIG,MAAM;YAC5BJ,OAAO,EAAE;YACTC,SAASJ,qBAAO,oBAACD;gBAAII,MAAMA;gBAAU;gBAAEa,cAAc;YAAM;QAC7D;QACAC;YACE,IAAI,EAAEf,WAAW,GAAG;YACpB,IAAI,CAACE,QAAQ,MAAM,IAAIG,MAAM;YAC7BH,OAAOc,OAAO;YACdd,SAAS;YACTD,OAAO;YACPgB,QAAQC,MAAM,CAACC,KAAK,CAAC,cAAc,cAAc;QACnD;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawn-term",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Formats spawn with for terminal grouping",
5
5
  "keywords": [
6
6
  "spawn",