crankscript 0.9.10 → 0.9.11
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/package.json
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
import { exec } from 'node:child_process';
|
2
2
|
import { existsSync } from 'node:fs';
|
3
3
|
import { join } from 'node:path';
|
4
|
+
import process from 'node:process';
|
5
|
+
import { promisify } from 'node:util';
|
4
6
|
import React, { useMemo } from 'react';
|
5
7
|
import { CheckList } from '../../../components/CheckList/index.js';
|
6
8
|
import { useQuitOnCtrlC } from '../../../hooks/useQuitOnCtrlC.js';
|
9
|
+
const promisifiedExec = promisify(exec);
|
7
10
|
export const Compile = ({ environment, watch = false })=>{
|
8
11
|
useQuitOnCtrlC();
|
9
12
|
const path = join(environment.sdkPath.path, 'bin', 'pdc');
|
@@ -27,7 +30,7 @@ export const Compile = ({ environment, watch = false })=>{
|
|
27
30
|
runningDescription: 'Compiling lua code...',
|
28
31
|
finishedDescription: ()=>'Lua code compiled',
|
29
32
|
runner: async ()=>{
|
30
|
-
|
33
|
+
return promisifiedExec(`${path} Source`);
|
31
34
|
},
|
32
35
|
ready: true
|
33
36
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/CompileCommand/components/Compile.tsx"],"sourcesContent":["import { exec } from 'node:child_process';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport React, { useMemo } from 'react';\nimport { CheckList } from '@/cli/components/CheckList/index.js';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { useQuitOnCtrlC } from '@/cli/hooks/useQuitOnCtrlC.js';\nimport { CheckListItem } from '@/cli/types.js';\n\ninterface Props {\n environment: Environment;\n watch?: boolean;\n}\n\nexport const Compile = ({ environment, watch = false }: Props) => {\n useQuitOnCtrlC();\n\n const path = join(environment.sdkPath.path, 'bin', 'pdc');\n const items = useMemo(\n () => [\n {\n waitingDescription: 'Waiting to check for pdc binary...',\n errorDescription: 'Could not find pdc binary',\n runningDescription: 'Checking for pdc binary...',\n finishedDescription: (result) =>\n `Found pdc binary at \"${result}\"`,\n runner: async () => {\n if (!existsSync(path)) {\n throw new Error('Could not find pdc binary');\n }\n\n return path;\n },\n ready: true,\n } satisfies CheckListItem<string>,\n {\n waitingDescription: 'Waiting for pdc binary path...',\n errorDescription: 'Could not compile lua code',\n runningDescription: 'Compiling lua code...',\n finishedDescription: () => 'Lua code compiled',\n runner: async () => {\n
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/CompileCommand/components/Compile.tsx"],"sourcesContent":["import { exec } from 'node:child_process';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport process from 'node:process';\nimport { promisify } from 'node:util';\nimport React, { useMemo } from 'react';\nimport { CheckList } from '@/cli/components/CheckList/index.js';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { useQuitOnCtrlC } from '@/cli/hooks/useQuitOnCtrlC.js';\nimport { CheckListItem } from '@/cli/types.js';\n\ninterface Props {\n environment: Environment;\n watch?: boolean;\n}\n\nconst promisifiedExec = promisify(exec);\n\nexport const Compile = ({ environment, watch = false }: Props) => {\n useQuitOnCtrlC();\n\n const path = join(environment.sdkPath.path, 'bin', 'pdc');\n const items = useMemo(\n () => [\n {\n waitingDescription: 'Waiting to check for pdc binary...',\n errorDescription: 'Could not find pdc binary',\n runningDescription: 'Checking for pdc binary...',\n finishedDescription: (result) =>\n `Found pdc binary at \"${result}\"`,\n runner: async () => {\n if (!existsSync(path)) {\n throw new Error('Could not find pdc binary');\n }\n\n return path;\n },\n ready: true,\n } satisfies CheckListItem<string>,\n {\n waitingDescription: 'Waiting for pdc binary path...',\n errorDescription: 'Could not compile lua code',\n runningDescription: 'Compiling lua code...',\n finishedDescription: () => 'Lua code compiled',\n runner: async () => {\n return promisifiedExec(`${path} Source`);\n },\n ready: true,\n },\n ],\n []\n ) as CheckListItem<unknown>[];\n\n return <CheckList items={items} onFinish={process.exit} />;\n};\n"],"names":["exec","existsSync","join","process","promisify","React","useMemo","CheckList","useQuitOnCtrlC","promisifiedExec","Compile","environment","watch","path","sdkPath","items","waitingDescription","errorDescription","runningDescription","finishedDescription","result","runner","Error","ready","onFinish","exit"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,IAAI,QAAQ,YAAY;AACjC,OAAOC,aAAa,eAAe;AACnC,SAASC,SAAS,QAAQ,YAAY;AACtC,OAAOC,SAASC,OAAO,QAAQ,QAAQ;AACvC,SAASC,SAAS,QAAQ,sCAAsC;AAEhE,SAASC,cAAc,QAAQ,gCAAgC;AAQ/D,MAAMC,kBAAkBL,UAAUJ;AAElC,OAAO,MAAMU,UAAU,CAAC,EAAEC,WAAW,EAAEC,QAAQ,KAAK,EAAS;IACzDJ;IAEA,MAAMK,OAAOX,KAAKS,YAAYG,OAAO,CAACD,IAAI,EAAE,OAAO;IACnD,MAAME,QAAQT,QACV,IAAM;YACF;gBACIU,oBAAoB;gBACpBC,kBAAkB;gBAClBC,oBAAoB;gBACpBC,qBAAqB,CAACC,SAClB,CAAC,qBAAqB,EAAEA,OAAO,CAAC,CAAC;gBACrCC,QAAQ;oBACJ,IAAI,CAACpB,WAAWY,OAAO;wBACnB,MAAM,IAAIS,MAAM;oBACpB;oBAEA,OAAOT;gBACX;gBACAU,OAAO;YACX;YACA;gBACIP,oBAAoB;gBACpBC,kBAAkB;gBAClBC,oBAAoB;gBACpBC,qBAAqB,IAAM;gBAC3BE,QAAQ;oBACJ,OAAOZ,gBAAgB,CAAC,EAAEI,KAAK,OAAO,CAAC;gBAC3C;gBACAU,OAAO;YACX;SACH,EACD,EAAE;IAGN,qBAAO,oBAAChB;QAAUQ,OAAOA;QAAOS,UAAUrB,QAAQsB,IAAI;;AAC1D,EAAE"}
|