crankscript 0.4.0 → 0.5.0
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 +25 -26
- package/src/commands/DoctorCommand.js +2 -2
- package/src/commands/DoctorCommand.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.d.ts +2 -2
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js +4 -4
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.d.ts +3 -3
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js +16 -22
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js.map +1 -1
- package/src/commands/GenerateTypes/GenerateTypesCommand.d.ts +4 -4
- package/src/commands/GenerateTypes/GenerateTypesCommand.js +15 -9
- package/src/commands/GenerateTypes/GenerateTypesCommand.js.map +1 -1
- package/src/commands/GenerateTypes/components/GenerateTypes.d.ts +4 -3
- package/src/commands/GenerateTypes/components/GenerateTypes.js +12 -8
- package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -1
- package/src/commands/GenerateTypes/fn/generateNamespace.d.ts +3 -0
- package/src/commands/GenerateTypes/fn/generateNamespace.js +33 -0
- package/src/commands/GenerateTypes/fn/generateNamespace.js.map +1 -0
- package/src/commands/GenerateTypes/fn/getApiDefinitions.d.ts +14 -0
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js +58 -0
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js.map +1 -0
- package/src/commands/GenerateTypes/fn/getFunctionDescriptionsFromHtml.d.ts +2 -0
- package/src/commands/GenerateTypes/fn/getFunctionDescriptionsFromHtml.js +37 -0
- package/src/commands/GenerateTypes/fn/getFunctionDescriptionsFromHtml.js.map +1 -0
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.d.ts +10 -0
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +24 -0
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -0
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js +1 -1
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.d.ts +2 -1
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +29 -9
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +2 -2
- package/src/commands/GenerateTypes/hooks/useGetVersion.js +2 -2
- package/src/commands/GenerateTypes/hooks/useGetVersion.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.d.ts +25 -0
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js +33 -0
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js.map +1 -0
- package/src/commands/GenerateTypes/utils/playdateConstants.d.ts +9 -0
- package/src/commands/GenerateTypes/utils/playdateConstants.js +134 -0
- package/src/commands/GenerateTypes/utils/playdateConstants.js.map +1 -0
- package/src/components/CheckList/CheckList.d.ts +1 -1
- package/src/components/CheckList/Item.d.ts +1 -1
- package/src/constants.d.ts +1 -0
- package/src/constants.js +5 -0
- package/src/constants.js.map +1 -1
- package/src/environment/createEnvironment.js +8 -24
- package/src/environment/createEnvironment.js.map +1 -1
- package/src/environment/dto/Environment.d.ts +1 -4
- package/src/environment/dto/Environment.js +1 -2
- package/src/environment/dto/Environment.js.map +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +4 -4
- package/src/index.js.map +1 -1
- package/src/types.d.ts +44 -10
- package/src/types.js +6 -12
- package/src/types.js.map +1 -1
- package/src/environment/configuration/ConfigurationSchema.d.ts +0 -9
- package/src/environment/configuration/ConfigurationSchema.js +0 -9
- package/src/environment/configuration/ConfigurationSchema.js.map +0 -1
- package/src/environment/configuration/dto/Configuration.d.ts +0 -4
- package/src/environment/configuration/dto/Configuration.js +0 -7
- package/src/environment/configuration/dto/Configuration.js.map +0 -1
- package/src/environment/configuration/error/ConfigurationFileNotFoundError.d.ts +0 -4
- package/src/environment/configuration/error/ConfigurationFileNotFoundError.js +0 -8
- package/src/environment/configuration/error/ConfigurationFileNotFoundError.js.map +0 -1
- package/src/environment/configuration/error/ConfigurationFileValidationError.d.ts +0 -5
- package/src/environment/configuration/error/ConfigurationFileValidationError.js +0 -8
- package/src/environment/configuration/error/ConfigurationFileValidationError.js.map +0 -1
- package/src/environment/configuration/getConfiguration.d.ts +0 -4
- package/src/environment/configuration/getConfiguration.js +0 -31
- package/src/environment/configuration/getConfiguration.js.map +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useMemo, useState } from 'react';
|
2
|
-
import { getHtmlForVersion } from '
|
2
|
+
import { getHtmlForVersion } from '@/cli/commands/GenerateTypes/fn/getHtmlForVersion.js';
|
3
3
|
export const useFetchHtml = (version)=>{
|
4
4
|
const [html, setHtml] = useState(null);
|
5
5
|
const fetchHtml = useMemo(()=>{
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
import { ApiDefinitions } from '@/cli/types.js';
|
2
|
+
export declare const useGenerateTypeFile: (path: string, definitions: ApiDefinitions | null) => {
|
2
3
|
generateTypeFile: {
|
3
4
|
waitingDescription: string;
|
4
5
|
errorDescription: string;
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { join } from 'node:path';
|
2
|
-
import { load } from 'cheerio';
|
3
1
|
import { useMemo } from 'react';
|
4
2
|
import { Project } from 'ts-morph';
|
5
|
-
|
3
|
+
import { generateNamespace } from '@/cli/commands/GenerateTypes/fn/generateNamespace.js';
|
4
|
+
export const useGenerateTypeFile = (path, definitions)=>{
|
6
5
|
const generateTypeFile = useMemo(()=>{
|
7
6
|
return {
|
8
7
|
waitingDescription: 'Waiting to generate the type file...',
|
@@ -10,21 +9,42 @@ export const useGenerateTypeFile = (path, html)=>{
|
|
10
9
|
finishedDescription: ()=>'Type file generated',
|
11
10
|
runningDescription: 'Generating the type file...',
|
12
11
|
runner: async ()=>{
|
13
|
-
if (!
|
14
|
-
throw new Error('
|
12
|
+
if (!definitions) {
|
13
|
+
throw new Error('Definitions are not set');
|
15
14
|
}
|
16
15
|
const project = new Project();
|
17
|
-
const typeFile = project.createSourceFile(
|
16
|
+
const typeFile = project.createSourceFile(path, '', {
|
18
17
|
overwrite: true
|
19
18
|
});
|
20
19
|
typeFile.addStatements('/// <reference types="lua-types/5.4" />');
|
21
|
-
const
|
20
|
+
for (const constantDefinition of definitions.constants){
|
21
|
+
typeFile.addEnum({
|
22
|
+
name: constantDefinition.name,
|
23
|
+
docs: [
|
24
|
+
constantDefinition.docs
|
25
|
+
],
|
26
|
+
isConst: true,
|
27
|
+
isExported: true,
|
28
|
+
members: constantDefinition.values.map((value)=>({
|
29
|
+
name: value.name,
|
30
|
+
docs: [
|
31
|
+
value.docs
|
32
|
+
],
|
33
|
+
value: value.value
|
34
|
+
}))
|
35
|
+
});
|
36
|
+
}
|
37
|
+
Object.keys(definitions.namespaces).forEach((namespace)=>{
|
38
|
+
const namespaceDescription = definitions.namespaces[namespace];
|
39
|
+
const namespaces = namespace.split('.');
|
40
|
+
generateNamespace(typeFile, namespaces[0], namespaceDescription, namespaces.slice(1));
|
41
|
+
});
|
22
42
|
typeFile.saveSync();
|
23
43
|
},
|
24
|
-
ready:
|
44
|
+
ready: definitions !== null
|
25
45
|
};
|
26
46
|
}, [
|
27
|
-
|
47
|
+
definitions
|
28
48
|
]);
|
29
49
|
return {
|
30
50
|
generateTypeFile
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useGenerateTypeFile.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useGenerateTypeFile.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { Project } from 'ts-morph';\nimport { generateNamespace } from '@/cli/commands/GenerateTypes/fn/generateNamespace.js';\nimport { CheckListItem, ApiDefinitions } from '@/cli/types.js';\n\nexport const useGenerateTypeFile = (\n path: string,\n definitions: ApiDefinitions | null\n) => {\n const generateTypeFile = useMemo(() => {\n return {\n waitingDescription: 'Waiting to generate the type file...',\n errorDescription: 'Failed to generate the type file',\n finishedDescription: () => 'Type file generated',\n runningDescription: 'Generating the type file...',\n runner: async () => {\n if (!definitions) {\n throw new Error('Definitions are not set');\n }\n\n const project = new Project();\n const typeFile = project.createSourceFile(path, '', {\n overwrite: true,\n });\n\n typeFile.addStatements(\n '/// <reference types=\"lua-types/5.4\" />'\n );\n\n for (const constantDefinition of definitions.constants) {\n typeFile.addEnum({\n name: constantDefinition.name,\n docs: [constantDefinition.docs],\n isConst: true,\n isExported: true,\n members: constantDefinition.values.map((value) => ({\n name: value.name,\n docs: [value.docs],\n value: value.value,\n })),\n });\n }\n\n Object.keys(definitions.namespaces).forEach((namespace) => {\n const namespaceDescription =\n definitions.namespaces[namespace];\n const namespaces = namespace.split('.');\n generateNamespace(\n typeFile,\n namespaces[0],\n namespaceDescription,\n namespaces.slice(1)\n );\n });\n\n typeFile.saveSync();\n },\n ready: definitions !== null,\n } satisfies CheckListItem<void>;\n }, [definitions]);\n\n return {\n generateTypeFile,\n };\n};\n"],"names":["useMemo","Project","generateNamespace","useGenerateTypeFile","path","definitions","generateTypeFile","waitingDescription","errorDescription","finishedDescription","runningDescription","runner","Error","project","typeFile","createSourceFile","overwrite","addStatements","constantDefinition","constants","addEnum","name","docs","isConst","isExported","members","values","map","value","Object","keys","namespaces","forEach","namespace","namespaceDescription","split","slice","saveSync","ready"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,OAAO,QAAQ,QAAQ;AAChC,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASC,iBAAiB,QAAQ,uDAAuD;AAGzF,OAAO,MAAMC,sBAAsB,CAC/BC,MACAC;IAEA,MAAMC,mBAAmBN,QAAQ;QAC7B,OAAO;YACHO,oBAAoB;YACpBC,kBAAkB;YAClBC,qBAAqB,IAAM;YAC3BC,oBAAoB;YACpBC,QAAQ;gBACJ,IAAI,CAACN,aAAa;oBACd,MAAM,IAAIO,MAAM;gBACpB;gBAEA,MAAMC,UAAU,IAAIZ;gBACpB,MAAMa,WAAWD,QAAQE,gBAAgB,CAACX,MAAM,IAAI;oBAChDY,WAAW;gBACf;gBAEAF,SAASG,aAAa,CAClB;gBAGJ,KAAK,MAAMC,sBAAsBb,YAAYc,SAAS,CAAE;oBACpDL,SAASM,OAAO,CAAC;wBACbC,MAAMH,mBAAmBG,IAAI;wBAC7BC,MAAM;4BAACJ,mBAAmBI,IAAI;yBAAC;wBAC/BC,SAAS;wBACTC,YAAY;wBACZC,SAASP,mBAAmBQ,MAAM,CAACC,GAAG,CAAC,CAACC,QAAW,CAAA;gCAC/CP,MAAMO,MAAMP,IAAI;gCAChBC,MAAM;oCAACM,MAAMN,IAAI;iCAAC;gCAClBM,OAAOA,MAAMA,KAAK;4BACtB,CAAA;oBACJ;gBACJ;gBAEAC,OAAOC,IAAI,CAACzB,YAAY0B,UAAU,EAAEC,OAAO,CAAC,CAACC;oBACzC,MAAMC,uBACF7B,YAAY0B,UAAU,CAACE,UAAU;oBACrC,MAAMF,aAAaE,UAAUE,KAAK,CAAC;oBACnCjC,kBACIY,UACAiB,UAAU,CAAC,EAAE,EACbG,sBACAH,WAAWK,KAAK,CAAC;gBAEzB;gBAEAtB,SAASuB,QAAQ;YACrB;YACAC,OAAOjC,gBAAgB;QAC3B;IACJ,GAAG;QAACA;KAAY;IAEhB,OAAO;QACHC;IACJ;AACJ,EAAE"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export declare const useGetVersion: (version:
|
1
|
+
import { PlaydateSdkVersion } from '@/cli/types.js';
|
2
|
+
export declare const useGetVersion: (version: PlaydateSdkVersion) => {
|
3
3
|
fetchedVersion: string | null;
|
4
4
|
getVersion: {
|
5
5
|
waitingDescription: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useCallback, useMemo, useState } from 'react';
|
2
|
-
import { PlaydateSdkUrl } from '
|
3
|
-
import { PlaydateSdkVersionIdentifier } from '
|
2
|
+
import { PlaydateSdkUrl } from '@/cli/commands/GenerateTypes/constants.js';
|
3
|
+
import { PlaydateSdkVersionIdentifier } from '@/cli/types.js';
|
4
4
|
export const useGetVersion = (version)=>{
|
5
5
|
const [result, setResult] = useState(null);
|
6
6
|
const fetchLastVersion = useCallback(async ()=>{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useGetVersion.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport { PlaydateSdkUrl } from '@/cli/commands/GenerateTypes/constants.js';\nimport {
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useGetVersion.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport { PlaydateSdkUrl } from '@/cli/commands/GenerateTypes/constants.js';\nimport {\n CheckListItem,\n PlaydateSdkVersion,\n PlaydateSdkVersionIdentifier,\n} from '@/cli/types.js';\n\nexport const useGetVersion = (version: PlaydateSdkVersion) => {\n const [result, setResult] = useState<string | null>(null);\n const fetchLastVersion = useCallback(async () => {\n const response = await fetch(PlaydateSdkUrl);\n const url = response.url;\n\n const regex = /https:\\/\\/sdk.play.date\\/([0-9]+\\.[0-9]+\\.[0-9]+)\\//;\n const match = url.match(regex);\n\n if (!match || match.length < 2) {\n throw new Error('Could not find version in URL');\n }\n\n return match[1];\n }, []);\n const validateVersion = useCallback(async (version: string) => {\n const response = await fetch(`https://sdk.play.date/${version}/`);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch version ${version}`);\n }\n\n return true;\n }, []);\n\n const getVersion = useMemo(() => {\n return {\n waitingDescription: `Waiting to fetch version`,\n runningDescription: 'Fetching version...',\n errorDescription: 'Failed to fetch version',\n finishedDescription: (result) => `Fetched version ${result}`,\n runner: async () => {\n let versionLiteral = version;\n\n if (version === PlaydateSdkVersionIdentifier.Latest) {\n versionLiteral = await fetchLastVersion();\n }\n\n await validateVersion(versionLiteral);\n\n return versionLiteral;\n },\n onFinish: (result) => {\n setResult(result);\n },\n } satisfies CheckListItem<string>;\n }, []);\n\n return {\n fetchedVersion: result,\n getVersion,\n };\n};\n"],"names":["useCallback","useMemo","useState","PlaydateSdkUrl","PlaydateSdkVersionIdentifier","useGetVersion","version","result","setResult","fetchLastVersion","response","fetch","url","regex","match","length","Error","validateVersion","ok","getVersion","waitingDescription","runningDescription","errorDescription","finishedDescription","runner","versionLiteral","Latest","onFinish","fetchedVersion"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AACvD,SAASC,cAAc,QAAQ,4CAA4C;AAC3E,SAGIC,4BAA4B,QACzB,iBAAiB;AAExB,OAAO,MAAMC,gBAAgB,CAACC;IAC1B,MAAM,CAACC,QAAQC,UAAU,GAAGN,SAAwB;IACpD,MAAMO,mBAAmBT,YAAY;QACjC,MAAMU,WAAW,MAAMC,MAAMR;QAC7B,MAAMS,MAAMF,SAASE,GAAG;QAExB,MAAMC,QAAQ;QACd,MAAMC,QAAQF,IAAIE,KAAK,CAACD;QAExB,IAAI,CAACC,SAASA,MAAMC,MAAM,GAAG,GAAG;YAC5B,MAAM,IAAIC,MAAM;QACpB;QAEA,OAAOF,KAAK,CAAC,EAAE;IACnB,GAAG,EAAE;IACL,MAAMG,kBAAkBjB,YAAY,OAAOM;QACvC,MAAMI,WAAW,MAAMC,MAAM,CAAC,sBAAsB,EAAEL,QAAQ,CAAC,CAAC;QAEhE,IAAI,CAACI,SAASQ,EAAE,EAAE;YACd,MAAM,IAAIF,MAAM,CAAC,wBAAwB,EAAEV,QAAQ,CAAC;QACxD;QAEA,OAAO;IACX,GAAG,EAAE;IAEL,MAAMa,aAAalB,QAAQ;QACvB,OAAO;YACHmB,oBAAoB,CAAC,wBAAwB,CAAC;YAC9CC,oBAAoB;YACpBC,kBAAkB;YAClBC,qBAAqB,CAAChB,SAAW,CAAC,gBAAgB,EAAEA,OAAO,CAAC;YAC5DiB,QAAQ;gBACJ,IAAIC,iBAAiBnB;gBAErB,IAAIA,YAAYF,6BAA6BsB,MAAM,EAAE;oBACjDD,iBAAiB,MAAMhB;gBAC3B;gBAEA,MAAMQ,gBAAgBQ;gBAEtB,OAAOA;YACX;YACAE,UAAU,CAACpB;gBACPC,UAAUD;YACd;QACJ;IACJ,GAAG,EAAE;IAEL,OAAO;QACHqB,gBAAgBrB;QAChBY;IACJ;AACJ,EAAE"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ApiDefinitions } from '@/cli/types.js';
|
2
|
+
export declare const useParseDocumentation: (html: string | null, version: string) => {
|
3
|
+
definitions: ApiDefinitions | null;
|
4
|
+
parseDocumentation: {
|
5
|
+
waitingDescription: string;
|
6
|
+
errorDescription: string;
|
7
|
+
finishedDescription: () => string;
|
8
|
+
runningDescription: string;
|
9
|
+
runner: () => Promise<{
|
10
|
+
namespaces: Record<string, import("@/cli/types.js").PlaydateNamespace>;
|
11
|
+
types: Record<string, import("@/cli/types.js").PlaydateType>;
|
12
|
+
constants: {
|
13
|
+
name: string;
|
14
|
+
values: {
|
15
|
+
name: string;
|
16
|
+
value: number;
|
17
|
+
docs: string;
|
18
|
+
}[];
|
19
|
+
docs: string;
|
20
|
+
}[];
|
21
|
+
}>;
|
22
|
+
onFinish: (result: ApiDefinitions) => void;
|
23
|
+
ready: boolean;
|
24
|
+
};
|
25
|
+
};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { useMemo, useState } from 'react';
|
2
|
+
import { getApiDefinitions } from '@/cli/commands/GenerateTypes/fn/getApiDefinitions.js';
|
3
|
+
import { getFunctionDescriptionsFromHtml } from '@/cli/commands/GenerateTypes/fn/getFunctionDescriptionsFromHtml.js';
|
4
|
+
export const useParseDocumentation = (html, version)=>{
|
5
|
+
const [result, setResult] = useState(null);
|
6
|
+
const parseDocumentation = useMemo(()=>{
|
7
|
+
return {
|
8
|
+
waitingDescription: 'Waiting to parse the documentation...',
|
9
|
+
errorDescription: 'Failed to parse the documentation',
|
10
|
+
finishedDescription: ()=>'Documentation parsed',
|
11
|
+
runningDescription: 'Parsing the documentation...',
|
12
|
+
runner: async ()=>{
|
13
|
+
if (!html) {
|
14
|
+
throw new Error('HTML is not set');
|
15
|
+
}
|
16
|
+
const functions = getFunctionDescriptionsFromHtml(html, version);
|
17
|
+
return getApiDefinitions(functions);
|
18
|
+
},
|
19
|
+
onFinish: (result)=>{
|
20
|
+
setResult(result);
|
21
|
+
},
|
22
|
+
ready: html !== null
|
23
|
+
};
|
24
|
+
}, [
|
25
|
+
html
|
26
|
+
]);
|
27
|
+
return {
|
28
|
+
definitions: result,
|
29
|
+
parseDocumentation
|
30
|
+
};
|
31
|
+
};
|
32
|
+
|
33
|
+
//# sourceMappingURL=useParseDocumentation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useParseDocumentation.ts"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { getApiDefinitions } from '@/cli/commands/GenerateTypes/fn/getApiDefinitions.js';\nimport { getFunctionDescriptionsFromHtml } from '@/cli/commands/GenerateTypes/fn/getFunctionDescriptionsFromHtml.js';\nimport { CheckListItem, ApiDefinitions } from '@/cli/types.js';\n\nexport const useParseDocumentation = (html: string | null, version: string) => {\n const [result, setResult] = useState<ApiDefinitions | null>(null);\n\n const parseDocumentation = useMemo(() => {\n return {\n waitingDescription: 'Waiting to parse the documentation...',\n errorDescription: 'Failed to parse the documentation',\n finishedDescription: () => 'Documentation parsed',\n runningDescription: 'Parsing the documentation...',\n runner: async () => {\n if (!html) {\n throw new Error('HTML is not set');\n }\n\n const functions = getFunctionDescriptionsFromHtml(\n html,\n version\n );\n\n return getApiDefinitions(functions);\n },\n onFinish: (result) => {\n setResult(result);\n },\n ready: html !== null,\n } satisfies CheckListItem<ApiDefinitions>;\n }, [html]);\n\n return {\n definitions: result,\n parseDocumentation,\n };\n};\n"],"names":["useMemo","useState","getApiDefinitions","getFunctionDescriptionsFromHtml","useParseDocumentation","html","version","result","setResult","parseDocumentation","waitingDescription","errorDescription","finishedDescription","runningDescription","runner","Error","functions","onFinish","ready","definitions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAC1C,SAASC,iBAAiB,QAAQ,uDAAuD;AACzF,SAASC,+BAA+B,QAAQ,qEAAqE;AAGrH,OAAO,MAAMC,wBAAwB,CAACC,MAAqBC;IACvD,MAAM,CAACC,QAAQC,UAAU,GAAGP,SAAgC;IAE5D,MAAMQ,qBAAqBT,QAAQ;QAC/B,OAAO;YACHU,oBAAoB;YACpBC,kBAAkB;YAClBC,qBAAqB,IAAM;YAC3BC,oBAAoB;YACpBC,QAAQ;gBACJ,IAAI,CAACT,MAAM;oBACP,MAAM,IAAIU,MAAM;gBACpB;gBAEA,MAAMC,YAAYb,gCACdE,MACAC;gBAGJ,OAAOJ,kBAAkBc;YAC7B;YACAC,UAAU,CAACV;gBACPC,UAAUD;YACd;YACAW,OAAOb,SAAS;QACpB;IACJ,GAAG;QAACA;KAAK;IAET,OAAO;QACHc,aAAaZ;QACbE;IACJ;AACJ,EAAE"}
|
@@ -0,0 +1,134 @@
|
|
1
|
+
export const playdateConstants = [
|
2
|
+
{
|
3
|
+
name: 'PlaydateColor',
|
4
|
+
values: [
|
5
|
+
{
|
6
|
+
name: 'Black',
|
7
|
+
value: 0,
|
8
|
+
docs: ''
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: 'White',
|
12
|
+
value: 1,
|
13
|
+
docs: ''
|
14
|
+
},
|
15
|
+
{
|
16
|
+
name: 'Clear',
|
17
|
+
value: 2,
|
18
|
+
docs: ''
|
19
|
+
},
|
20
|
+
{
|
21
|
+
name: 'XOR',
|
22
|
+
value: 4,
|
23
|
+
docs: ''
|
24
|
+
}
|
25
|
+
],
|
26
|
+
docs: ''
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'PlaydateImageFlip',
|
30
|
+
values: [
|
31
|
+
{
|
32
|
+
name: 'Unflipped',
|
33
|
+
value: 0,
|
34
|
+
docs: ''
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'FlippedX',
|
38
|
+
value: 1,
|
39
|
+
docs: ''
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: 'FlippedY',
|
43
|
+
value: 2,
|
44
|
+
docs: ''
|
45
|
+
},
|
46
|
+
{
|
47
|
+
name: 'FlippedXY',
|
48
|
+
value: 4,
|
49
|
+
docs: ''
|
50
|
+
}
|
51
|
+
],
|
52
|
+
docs: ''
|
53
|
+
},
|
54
|
+
{
|
55
|
+
name: 'PlaydatePolygonFill',
|
56
|
+
values: [
|
57
|
+
{
|
58
|
+
name: 'NonZero',
|
59
|
+
value: 1,
|
60
|
+
docs: ''
|
61
|
+
},
|
62
|
+
{
|
63
|
+
name: 'EvenOdd',
|
64
|
+
value: 2,
|
65
|
+
docs: ''
|
66
|
+
}
|
67
|
+
],
|
68
|
+
docs: ''
|
69
|
+
},
|
70
|
+
{
|
71
|
+
name: 'PlaydateButton',
|
72
|
+
values: [
|
73
|
+
{
|
74
|
+
name: 'Left',
|
75
|
+
value: 1,
|
76
|
+
docs: ''
|
77
|
+
},
|
78
|
+
{
|
79
|
+
name: 'Right',
|
80
|
+
value: 2,
|
81
|
+
docs: ''
|
82
|
+
},
|
83
|
+
{
|
84
|
+
name: 'Up',
|
85
|
+
value: 4,
|
86
|
+
docs: ''
|
87
|
+
},
|
88
|
+
{
|
89
|
+
name: 'Down',
|
90
|
+
value: 8,
|
91
|
+
docs: ''
|
92
|
+
},
|
93
|
+
{
|
94
|
+
name: 'B',
|
95
|
+
value: 16,
|
96
|
+
docs: ''
|
97
|
+
},
|
98
|
+
{
|
99
|
+
name: 'A',
|
100
|
+
value: 32,
|
101
|
+
docs: ''
|
102
|
+
},
|
103
|
+
{
|
104
|
+
name: 'Menu',
|
105
|
+
value: 64,
|
106
|
+
docs: ''
|
107
|
+
},
|
108
|
+
{
|
109
|
+
name: 'Lock',
|
110
|
+
value: 124,
|
111
|
+
docs: ''
|
112
|
+
}
|
113
|
+
],
|
114
|
+
docs: ''
|
115
|
+
},
|
116
|
+
{
|
117
|
+
name: 'PlaydateLanguage',
|
118
|
+
values: [
|
119
|
+
{
|
120
|
+
name: 'English',
|
121
|
+
value: 1,
|
122
|
+
docs: ''
|
123
|
+
},
|
124
|
+
{
|
125
|
+
name: 'Japanese',
|
126
|
+
value: 2,
|
127
|
+
docs: ''
|
128
|
+
}
|
129
|
+
],
|
130
|
+
docs: ''
|
131
|
+
}
|
132
|
+
];
|
133
|
+
|
134
|
+
//# sourceMappingURL=playdateConstants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/utils/playdateConstants.ts"],"sourcesContent":["import { ConstantDescription } from '@/cli/types.js';\n\nexport const playdateConstants = [\n {\n name: 'PlaydateColor',\n values: [\n { name: 'Black', value: 0, docs: '' },\n { name: 'White', value: 1, docs: '' },\n { name: 'Clear', value: 2, docs: '' },\n { name: 'XOR', value: 4, docs: '' },\n ],\n docs: '',\n },\n {\n name: 'PlaydateImageFlip',\n values: [\n { name: 'Unflipped', value: 0, docs: '' },\n { name: 'FlippedX', value: 1, docs: '' },\n { name: 'FlippedY', value: 2, docs: '' },\n { name: 'FlippedXY', value: 4, docs: '' },\n ],\n docs: '',\n },\n {\n name: 'PlaydatePolygonFill',\n values: [\n { name: 'NonZero', value: 1, docs: '' },\n { name: 'EvenOdd', value: 2, docs: '' },\n ],\n docs: '',\n },\n {\n name: 'PlaydateButton',\n values: [\n { name: 'Left', value: 1, docs: '' },\n { name: 'Right', value: 2, docs: '' },\n { name: 'Up', value: 4, docs: '' },\n { name: 'Down', value: 8, docs: '' },\n { name: 'B', value: 16, docs: '' },\n { name: 'A', value: 32, docs: '' },\n { name: 'Menu', value: 64, docs: '' },\n { name: 'Lock', value: 124, docs: '' },\n ],\n docs: '',\n },\n {\n name: 'PlaydateLanguage',\n values: [\n { name: 'English', value: 1, docs: '' },\n { name: 'Japanese', value: 2, docs: '' },\n ],\n docs: '',\n },\n] satisfies ConstantDescription[];\n"],"names":["playdateConstants","name","values","value","docs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,oBAAoB;IAC7B;QACIC,MAAM;QACNC,QAAQ;YACJ;gBAAED,MAAM;gBAASE,OAAO;gBAAGC,MAAM;YAAG;YACpC;gBAAEH,MAAM;gBAASE,OAAO;gBAAGC,MAAM;YAAG;YACpC;gBAAEH,MAAM;gBAASE,OAAO;gBAAGC,MAAM;YAAG;YACpC;gBAAEH,MAAM;gBAAOE,OAAO;gBAAGC,MAAM;YAAG;SACrC;QACDA,MAAM;IACV;IACA;QACIH,MAAM;QACNC,QAAQ;YACJ;gBAAED,MAAM;gBAAaE,OAAO;gBAAGC,MAAM;YAAG;YACxC;gBAAEH,MAAM;gBAAYE,OAAO;gBAAGC,MAAM;YAAG;YACvC;gBAAEH,MAAM;gBAAYE,OAAO;gBAAGC,MAAM;YAAG;YACvC;gBAAEH,MAAM;gBAAaE,OAAO;gBAAGC,MAAM;YAAG;SAC3C;QACDA,MAAM;IACV;IACA;QACIH,MAAM;QACNC,QAAQ;YACJ;gBAAED,MAAM;gBAAWE,OAAO;gBAAGC,MAAM;YAAG;YACtC;gBAAEH,MAAM;gBAAWE,OAAO;gBAAGC,MAAM;YAAG;SACzC;QACDA,MAAM;IACV;IACA;QACIH,MAAM;QACNC,QAAQ;YACJ;gBAAED,MAAM;gBAAQE,OAAO;gBAAGC,MAAM;YAAG;YACnC;gBAAEH,MAAM;gBAASE,OAAO;gBAAGC,MAAM;YAAG;YACpC;gBAAEH,MAAM;gBAAME,OAAO;gBAAGC,MAAM;YAAG;YACjC;gBAAEH,MAAM;gBAAQE,OAAO;gBAAGC,MAAM;YAAG;YACnC;gBAAEH,MAAM;gBAAKE,OAAO;gBAAIC,MAAM;YAAG;YACjC;gBAAEH,MAAM;gBAAKE,OAAO;gBAAIC,MAAM;YAAG;YACjC;gBAAEH,MAAM;gBAAQE,OAAO;gBAAIC,MAAM;YAAG;YACpC;gBAAEH,MAAM;gBAAQE,OAAO;gBAAKC,MAAM;YAAG;SACxC;QACDA,MAAM;IACV;IACA;QACIH,MAAM;QACNC,QAAQ;YACJ;gBAAED,MAAM;gBAAWE,OAAO;gBAAGC,MAAM;YAAG;YACtC;gBAAEH,MAAM;gBAAYE,OAAO;gBAAGC,MAAM;YAAG;SAC1C;QACDA,MAAM;IACV;CACH,CAAiC"}
|
package/src/constants.d.ts
CHANGED
package/src/constants.js
CHANGED
package/src/constants.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../libs/cli/src/constants.ts"],"sourcesContent":["export const CrankscriptConfigurationFileName = 'crankscript.json';\n"],"names":["CrankscriptConfigurationFileName"],"rangeMappings":"","mappings":"AAAA,OAAO,MAAMA,mCAAmC,mBAAmB"}
|
1
|
+
{"version":3,"sources":["../../../../libs/cli/src/constants.ts"],"sourcesContent":["export const CrankscriptConfigurationFileName = 'crankscript.json';\nexport const TypescriptReservedNamed = ['delete', 'new', 'function'];\n"],"names":["CrankscriptConfigurationFileName","TypescriptReservedNamed"],"rangeMappings":";;;;;","mappings":"AAAA,OAAO,MAAMA,mCAAmC,mBAAmB;AACnE,OAAO,MAAMC,0BAA0B;IAAC;IAAU;IAAO;CAAW,CAAC"}
|
@@ -1,27 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import { ConfigurationFileNotFoundError } from './configuration/error/ConfigurationFileNotFoundError.js';
|
3
|
-
import { ConfigurationFileValidationError } from './configuration/error/ConfigurationFileValidationError.js';
|
4
|
-
import { getConfiguration } from './configuration/getConfiguration.js';
|
1
|
+
import { HealthCheckStatusType } from '../types.js';
|
5
2
|
import { Environment } from './dto/Environment.js';
|
6
3
|
import { getPlaydateSdkPath } from './path/getPlaydateSdkPath.js';
|
7
4
|
/**
|
8
5
|
* Will create a configuration object from the environment.
|
9
6
|
*/ export const createEnvironment = (input)=>{
|
10
7
|
const { environment = process.env } = input != null ? input : {};
|
11
|
-
let configuration;
|
12
8
|
let sdkPath;
|
13
|
-
try {
|
14
|
-
configuration = getConfiguration();
|
15
|
-
} catch (error) {
|
16
|
-
return {
|
17
|
-
isHealthy: false,
|
18
|
-
health: {
|
19
|
-
configurationFilePresent: error instanceof ConfigurationFileNotFoundError ? HealthCheckStatus.Unhealthy : HealthCheckStatus.Healthy,
|
20
|
-
configurationFileValid: error instanceof ConfigurationFileValidationError && !(error instanceof ConfigurationFileNotFoundError) ? HealthCheckStatus.Unhealthy : error instanceof ConfigurationFileValidationError ? HealthCheckStatus.Unhealthy : HealthCheckStatus.Unknown,
|
21
|
-
sdkPathKnown: HealthCheckStatus.Unknown
|
22
|
-
}
|
23
|
-
};
|
24
|
-
}
|
25
9
|
try {
|
26
10
|
sdkPath = getPlaydateSdkPath({
|
27
11
|
environment
|
@@ -30,22 +14,22 @@ import { getPlaydateSdkPath } from './path/getPlaydateSdkPath.js';
|
|
30
14
|
return {
|
31
15
|
isHealthy: false,
|
32
16
|
health: {
|
33
|
-
|
34
|
-
|
35
|
-
|
17
|
+
sdkPathKnown: {
|
18
|
+
healthStatus: HealthCheckStatusType.Unhealthy
|
19
|
+
}
|
36
20
|
}
|
37
21
|
};
|
38
22
|
}
|
39
23
|
return {
|
40
24
|
isHealthy: true,
|
41
25
|
environment: new Environment({
|
42
|
-
configuration,
|
43
26
|
sdkPath
|
44
27
|
}),
|
45
28
|
health: {
|
46
|
-
|
47
|
-
|
48
|
-
|
29
|
+
sdkPathKnown: {
|
30
|
+
healthStatus: HealthCheckStatusType.Healthy,
|
31
|
+
argument: sdkPath
|
32
|
+
}
|
49
33
|
}
|
50
34
|
};
|
51
35
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../libs/cli/src/environment/createEnvironment.ts"],"sourcesContent":["import { EnvironmentHealthResult,
|
1
|
+
{"version":3,"sources":["../../../../../libs/cli/src/environment/createEnvironment.ts"],"sourcesContent":["import { EnvironmentHealthResult, HealthCheckStatusType } from '../types.js';\nimport { Environment } from './dto/Environment.js';\nimport { PlaydateSdkPath } from './path/dto/PlaydateSdkPath.js';\nimport { getPlaydateSdkPath } from './path/getPlaydateSdkPath.js';\n\n/**\n * Will create a configuration object from the environment.\n */\nexport const createEnvironment = (input?: {\n /**\n * The environment to create the configuration from.\n *\n * Defaults to `process.env`.\n */\n environment: Record<string, unknown>;\n}): EnvironmentHealthResult => {\n const { environment = process.env } = input ?? {};\n let sdkPath: PlaydateSdkPath;\n\n try {\n sdkPath = getPlaydateSdkPath({ environment });\n } catch (error) {\n return {\n isHealthy: false,\n health: {\n sdkPathKnown: { healthStatus: HealthCheckStatusType.Unhealthy },\n },\n };\n }\n\n return {\n isHealthy: true,\n environment: new Environment({\n sdkPath,\n }),\n health: {\n sdkPathKnown: {\n healthStatus: HealthCheckStatusType.Healthy,\n argument: sdkPath,\n },\n },\n };\n};\n"],"names":["HealthCheckStatusType","Environment","getPlaydateSdkPath","createEnvironment","input","environment","process","env","sdkPath","error","isHealthy","health","sdkPathKnown","healthStatus","Unhealthy","Healthy","argument"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAkCA,qBAAqB,QAAQ,cAAc;AAC7E,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,SAASC,kBAAkB,QAAQ,+BAA+B;AAElE;;CAEC,GACD,OAAO,MAAMC,oBAAoB,CAACC;IAQ9B,MAAM,EAAEC,cAAcC,QAAQC,GAAG,EAAE,GAAGH,gBAAAA,QAAS,CAAC;IAChD,IAAII;IAEJ,IAAI;QACAA,UAAUN,mBAAmB;YAAEG;QAAY;IAC/C,EAAE,OAAOI,OAAO;QACZ,OAAO;YACHC,WAAW;YACXC,QAAQ;gBACJC,cAAc;oBAAEC,cAAcb,sBAAsBc,SAAS;gBAAC;YAClE;QACJ;IACJ;IAEA,OAAO;QACHJ,WAAW;QACXL,aAAa,IAAIJ,YAAY;YACzBO;QACJ;QACAG,QAAQ;YACJC,cAAc;gBACVC,cAAcb,sBAAsBe,OAAO;gBAC3CC,UAAUR;YACd;QACJ;IACJ;AACJ,EAAE"}
|
@@ -1,10 +1,7 @@
|
|
1
|
-
import { ConfigurationType } from '../configuration/ConfigurationSchema.js';
|
2
1
|
import { PlaydateSdkPath } from '../path/dto/PlaydateSdkPath.js';
|
3
2
|
export declare class Environment {
|
4
|
-
configuration: ConfigurationType;
|
5
3
|
sdkPath: PlaydateSdkPath;
|
6
|
-
constructor({
|
7
|
-
configuration: ConfigurationType;
|
4
|
+
constructor({ sdkPath }: {
|
8
5
|
sdkPath: PlaydateSdkPath;
|
9
6
|
});
|
10
7
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/cli/src/environment/dto/Environment.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"sources":["../../../../../../libs/cli/src/environment/dto/Environment.ts"],"sourcesContent":["import { PlaydateSdkPath } from '../path/dto/PlaydateSdkPath.js';\n\nexport class Environment {\n sdkPath: PlaydateSdkPath;\n\n public constructor({ sdkPath }: { sdkPath: PlaydateSdkPath }) {\n this.sdkPath = sdkPath;\n }\n}\n"],"names":["Environment","sdkPath"],"rangeMappings":";;;;","mappings":"AAEA,OAAO,MAAMA;IAGT,YAAmB,EAAEC,OAAO,EAAgC,CAAE;QAC1D,IAAI,CAACA,OAAO,GAAGA;IACnB;AACJ"}
|
package/src/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
#!/usr/bin/env node
|
1
|
+
#!/usr/bin/env node --no-warnings=ExperimentalWarning
|
2
2
|
export {};
|
package/src/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
#!/usr/bin/env node
|
1
|
+
#!/usr/bin/env node --no-warnings=ExperimentalWarning
|
2
2
|
import { readFileSync } from 'fs';
|
3
3
|
import { join } from 'node:path';
|
4
4
|
import { Cli } from 'clipanion';
|
5
|
-
import { DoctorCommand } from '
|
6
|
-
import { GenerateTypesCommand } from '
|
7
|
-
import { RootFolder } from '
|
5
|
+
import { DoctorCommand } from '@/cli/commands/DoctorCommand.js';
|
6
|
+
import { GenerateTypesCommand } from '@/cli/commands/GenerateTypes/GenerateTypesCommand.js';
|
7
|
+
import { RootFolder } from '@/cli/utils/dirname.js';
|
8
8
|
const packageJsonContents = readFileSync(join(RootFolder, 'package.json'), 'utf-8');
|
9
9
|
const packageJson = JSON.parse(packageJsonContents);
|
10
10
|
const args = process.argv.slice(2);
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../libs/cli/src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { readFileSync } from 'fs';\nimport { join } from 'node:path';\nimport { Cli } from 'clipanion';\nimport { DoctorCommand } from '@/cli/commands/DoctorCommand.js';\nimport { GenerateTypesCommand } from '@/cli/commands/GenerateTypes/GenerateTypesCommand.js';\nimport { RootFolder } from '@/cli/utils/dirname.js';\n\nconst packageJsonContents = readFileSync(\n join(RootFolder, 'package.json'),\n 'utf-8'\n);\nconst packageJson = JSON.parse(packageJsonContents);\n\nconst args = process.argv.slice(2);\n\nconst cli = new Cli({\n binaryLabel: 'crankscript',\n binaryName: 'crankscript',\n binaryVersion: packageJson.version,\n});\n\ncli.register(DoctorCommand);\ncli.register(GenerateTypesCommand);\ncli.runExit(args);\n"],"names":["readFileSync","join","Cli","DoctorCommand","GenerateTypesCommand","RootFolder","packageJsonContents","packageJson","JSON","parse","args","process","argv","slice","cli","binaryLabel","binaryName","binaryVersion","version","register","runExit"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";AAEA,SAASA,YAAY,QAAQ,KAAK;AAClC,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,oBAAoB,QAAQ,uDAAuD;AAC5F,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,MAAMC,sBAAsBN,aACxBC,KAAKI,YAAY,iBACjB;AAEJ,MAAME,cAAcC,KAAKC,KAAK,CAACH;AAE/B,MAAMI,OAAOC,QAAQC,IAAI,CAACC,KAAK,CAAC;AAEhC,MAAMC,MAAM,IAAIZ,IAAI;IAChBa,aAAa;IACbC,YAAY;IACZC,eAAeV,YAAYW,OAAO;AACtC;AAEAJ,IAAIK,QAAQ,CAAChB;AACbW,IAAIK,QAAQ,CAACf;AACbU,IAAIM,OAAO,CAACV"}
|
1
|
+
{"version":3,"sources":["../../../../libs/cli/src/index.ts"],"sourcesContent":["#!/usr/bin/env node --no-warnings=ExperimentalWarning\n\nimport { readFileSync } from 'fs';\nimport { join } from 'node:path';\nimport { Cli } from 'clipanion';\nimport { DoctorCommand } from '@/cli/commands/DoctorCommand.js';\nimport { GenerateTypesCommand } from '@/cli/commands/GenerateTypes/GenerateTypesCommand.js';\nimport { RootFolder } from '@/cli/utils/dirname.js';\n\nconst packageJsonContents = readFileSync(\n join(RootFolder, 'package.json'),\n 'utf-8'\n);\nconst packageJson = JSON.parse(packageJsonContents);\n\nconst args = process.argv.slice(2);\n\nconst cli = new Cli({\n binaryLabel: 'crankscript',\n binaryName: 'crankscript',\n binaryVersion: packageJson.version,\n});\n\ncli.register(DoctorCommand);\ncli.register(GenerateTypesCommand);\ncli.runExit(args);\n"],"names":["readFileSync","join","Cli","DoctorCommand","GenerateTypesCommand","RootFolder","packageJsonContents","packageJson","JSON","parse","args","process","argv","slice","cli","binaryLabel","binaryName","binaryVersion","version","register","runExit"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";AAEA,SAASA,YAAY,QAAQ,KAAK;AAClC,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,GAAG,QAAQ,YAAY;AAChC,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,oBAAoB,QAAQ,uDAAuD;AAC5F,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,MAAMC,sBAAsBN,aACxBC,KAAKI,YAAY,iBACjB;AAEJ,MAAME,cAAcC,KAAKC,KAAK,CAACH;AAE/B,MAAMI,OAAOC,QAAQC,IAAI,CAACC,KAAK,CAAC;AAEhC,MAAMC,MAAM,IAAIZ,IAAI;IAChBa,aAAa;IACbC,YAAY;IACZC,eAAeV,YAAYW,OAAO;AACtC;AAEAJ,IAAIK,QAAQ,CAAChB;AACbW,IAAIK,QAAQ,CAACf;AACbU,IAAIM,OAAO,CAACV"}
|
package/src/types.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
import { Environment } from '
|
1
|
+
import { Environment } from '@/cli/environment/dto/Environment.js';
|
2
|
+
import { PlaydateSdkPath } from '@/cli/environment/path/dto/PlaydateSdkPath.js';
|
2
3
|
export declare enum PlaydateSdkVersionIdentifier {
|
3
|
-
FromConfig = "FromConfig",
|
4
4
|
Latest = "latest"
|
5
5
|
}
|
6
|
+
export type PlaydateSdkVersion = PlaydateSdkVersionIdentifier.Latest | string;
|
6
7
|
export type EnvironmentHealthResult = {
|
7
8
|
isHealthy: true;
|
8
9
|
environment: Environment;
|
@@ -11,19 +12,19 @@ export type EnvironmentHealthResult = {
|
|
11
12
|
isHealthy: false;
|
12
13
|
health: EnvironmentHealth;
|
13
14
|
};
|
14
|
-
export declare enum
|
15
|
+
export declare enum HealthCheckStatusType {
|
15
16
|
Healthy = "Healthy",
|
16
17
|
Unhealthy = "Unhealthy",
|
17
18
|
Unknown = "Unknown"
|
18
19
|
}
|
20
|
+
export type HealthCheckStatus<TArgument> = {
|
21
|
+
healthStatus: HealthCheckStatusType.Unknown | HealthCheckStatusType.Unhealthy;
|
22
|
+
} | {
|
23
|
+
healthStatus: HealthCheckStatusType.Healthy;
|
24
|
+
argument: TArgument;
|
25
|
+
};
|
19
26
|
export interface EnvironmentHealth {
|
20
|
-
|
21
|
-
configurationFileValid: HealthCheckStatus;
|
22
|
-
sdkPathKnown: HealthCheckStatus;
|
23
|
-
}
|
24
|
-
export declare enum ConfigurationFileValidationErrorType {
|
25
|
-
InvalidJson = "InvalidJson",
|
26
|
-
InvalidSchema = "InvalidSchema"
|
27
|
+
sdkPathKnown: HealthCheckStatus<PlaydateSdkPath>;
|
27
28
|
}
|
28
29
|
export type CheckListItem<TResult> = {
|
29
30
|
runningDescription: string;
|
@@ -34,3 +35,36 @@ export type CheckListItem<TResult> = {
|
|
34
35
|
onFinish?: (result: TResult) => void;
|
35
36
|
ready?: boolean;
|
36
37
|
};
|
38
|
+
export interface ParameterDescription {
|
39
|
+
name: string;
|
40
|
+
required: boolean;
|
41
|
+
type: string;
|
42
|
+
}
|
43
|
+
export interface FunctionDescription {
|
44
|
+
name: string;
|
45
|
+
namespaces: string[];
|
46
|
+
parameters: ParameterDescription[];
|
47
|
+
hasSelf: boolean;
|
48
|
+
docs: string;
|
49
|
+
}
|
50
|
+
export interface ConstantDescription {
|
51
|
+
name: string;
|
52
|
+
docs: string;
|
53
|
+
values: {
|
54
|
+
name: string;
|
55
|
+
value: number;
|
56
|
+
docs: string;
|
57
|
+
}[];
|
58
|
+
}
|
59
|
+
export interface PlaydateNamespace {
|
60
|
+
functions: FunctionDescription[];
|
61
|
+
callbacks: FunctionDescription[];
|
62
|
+
}
|
63
|
+
export interface PlaydateType {
|
64
|
+
methods: FunctionDescription[];
|
65
|
+
}
|
66
|
+
export interface ApiDefinitions {
|
67
|
+
namespaces: Record<string, PlaydateNamespace>;
|
68
|
+
types: Record<string, PlaydateType>;
|
69
|
+
constants: ConstantDescription[];
|
70
|
+
}
|