crankscript 0.10.5 → 0.10.6
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,4 +1,5 @@
|
|
1
1
|
import { existsSync } from 'node:fs';
|
2
|
+
import { join } from 'node:path';
|
2
3
|
import open from 'open';
|
3
4
|
import { useMemo } from 'react';
|
4
5
|
import { isWindows } from '../../../utils/platform.js';
|
@@ -23,12 +24,13 @@ export const useCompileTasks = (pdcPath)=>{
|
|
23
24
|
runningDescription: 'Compiling lua code...',
|
24
25
|
finishedDescription: ()=>'Lua code compiled',
|
25
26
|
runner: async ()=>{
|
27
|
+
const currentDirectory = process.cwd();
|
26
28
|
await open('', {
|
27
29
|
app: {
|
28
30
|
name: pdcPath,
|
29
31
|
arguments: [
|
30
|
-
'Source',
|
31
|
-
'Game.pdx'
|
32
|
+
join(currentDirectory, 'Source'),
|
33
|
+
join(currentDirectory, 'Game.pdx')
|
32
34
|
]
|
33
35
|
}
|
34
36
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/CompileCommand/hooks/useCompileTasks.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport open from 'open';\nimport { useMemo } from 'react';\nimport { CheckListItem } from '@/cli/types.js';\nimport { isWindows } from '@/cli/utils/platform.js';\n\nexport const useCompileTasks = (pdcPath: string) => {\n return 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(pdcPath)) {\n throw new Error('Could not find pdc binary');\n }\n\n return pdcPath;\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 await open('', {\n app: {\n name: pdcPath,\n arguments: ['Source', 'Game.pdx'],\n },\n });\n\n if (isWindows) {\n // Wait for pdc.exe to compile\n // See https://github.com/sindresorhus/open/issues/298\n await new Promise((resolve) =>\n setTimeout(resolve, 1000)\n );\n }\n },\n ready: true,\n },\n ],\n []\n ) as CheckListItem<unknown>[];\n};\n"],"names":["existsSync","open","useMemo","isWindows","useCompileTasks","pdcPath","waitingDescription","errorDescription","runningDescription","finishedDescription","result","runner","Error","ready","app","name","arguments","Promise","resolve","setTimeout"],"rangeMappings":"
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/CompileCommand/hooks/useCompileTasks.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport open from 'open';\nimport { useMemo } from 'react';\nimport { CheckListItem } from '@/cli/types.js';\nimport { isWindows } from '@/cli/utils/platform.js';\n\nexport const useCompileTasks = (pdcPath: string) => {\n return 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(pdcPath)) {\n throw new Error('Could not find pdc binary');\n }\n\n return pdcPath;\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 const currentDirectory = process.cwd();\n\n await open('', {\n app: {\n name: pdcPath,\n arguments: [\n join(currentDirectory, 'Source'),\n join(currentDirectory, 'Game.pdx'),\n ],\n },\n });\n\n if (isWindows) {\n // Wait for pdc.exe to compile\n // See https://github.com/sindresorhus/open/issues/298\n await new Promise((resolve) =>\n setTimeout(resolve, 1000)\n );\n }\n },\n ready: true,\n },\n ],\n []\n ) as CheckListItem<unknown>[];\n};\n"],"names":["existsSync","join","open","useMemo","isWindows","useCompileTasks","pdcPath","waitingDescription","errorDescription","runningDescription","finishedDescription","result","runner","Error","ready","currentDirectory","process","cwd","app","name","arguments","Promise","resolve","setTimeout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,QAAQ,UAAU;AACrC,SAASC,IAAI,QAAQ,YAAY;AACjC,OAAOC,UAAU,OAAO;AACxB,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,OAAO,MAAMC,kBAAkB,CAACC;IAC5B,OAAOH,QACH,IAAM;YACF;gBACII,oBAAoB;gBACpBC,kBAAkB;gBAClBC,oBAAoB;gBACpBC,qBAAqB,CAACC,SAClB,CAAC,qBAAqB,EAAEA,OAAO,CAAC,CAAC;gBACrCC,QAAQ;oBACJ,IAAI,CAACZ,WAAWM,UAAU;wBACtB,MAAM,IAAIO,MAAM;oBACpB;oBAEA,OAAOP;gBACX;gBACAQ,OAAO;YACX;YACA;gBACIP,oBAAoB;gBACpBC,kBAAkB;gBAClBC,oBAAoB;gBACpBC,qBAAqB,IAAM;gBAC3BE,QAAQ;oBACJ,MAAMG,mBAAmBC,QAAQC,GAAG;oBAEpC,MAAMf,KAAK,IAAI;wBACXgB,KAAK;4BACDC,MAAMb;4BACNc,WAAW;gCACPnB,KAAKc,kBAAkB;gCACvBd,KAAKc,kBAAkB;6BAC1B;wBACL;oBACJ;oBAEA,IAAIX,WAAW;wBACX,8BAA8B;wBAC9B,sDAAsD;wBACtD,MAAM,IAAIiB,QAAQ,CAACC,UACfC,WAAWD,SAAS;oBAE5B;gBACJ;gBACAR,OAAO;YACX;SACH,EACD,EAAE;AAEV,EAAE"}
|