crankscript 0.0.6 → 0.1.5-beta
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/README.md +1 -11
- package/assets/package.json +4 -0
- package/assets/plugin.js +260 -0
- package/assets/plugin.ts +372 -0
- package/assets/tsconfig.json +10 -0
- package/package.json +30 -17
- package/src/commands/CompileCommand/CompileCommand.d.ts +8 -0
- package/src/commands/CompileCommand/CompileCommand.js +21 -0
- package/src/commands/CompileCommand/CompileCommand.js.map +1 -0
- package/src/commands/CompileCommand/components/Compile.d.ts +7 -0
- package/src/commands/CompileCommand/components/Compile.js +14 -0
- package/src/commands/CompileCommand/components/Compile.js.map +1 -0
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.d.ts +2 -0
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js +6 -0
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js.map +1 -0
- package/src/commands/CompileCommand/fn/getSimulatorPathFromEnvironment.d.ts +2 -0
- package/src/commands/CompileCommand/fn/getSimulatorPathFromEnvironment.js +6 -0
- package/src/commands/CompileCommand/fn/getSimulatorPathFromEnvironment.js.map +1 -0
- package/src/commands/CompileCommand/hooks/useCompileTasks.d.ts +2 -0
- package/src/commands/CompileCommand/hooks/useCompileTasks.js +60 -0
- package/src/commands/CompileCommand/hooks/useCompileTasks.js.map +1 -0
- package/src/commands/CompileCommand/index.d.ts +1 -0
- package/src/commands/CompileCommand/index.js +3 -0
- package/src/commands/CompileCommand/index.js.map +1 -0
- package/src/commands/DoctorCommand.d.ts +7 -0
- package/src/commands/DoctorCommand.js +26 -0
- package/src/commands/DoctorCommand.js.map +1 -0
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.d.ts +9 -0
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js +25 -0
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js.map +1 -0
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.d.ts +7 -0
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js +41 -0
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js.map +1 -0
- package/src/commands/EnvironmentAwareCommand/index.d.ts +1 -0
- package/src/commands/EnvironmentAwareCommand/index.js +3 -0
- package/src/commands/EnvironmentAwareCommand/index.js.map +1 -0
- package/src/commands/GenerateTypes/GenerateTypesCommand.d.ts +10 -0
- package/src/commands/GenerateTypes/GenerateTypesCommand.js +45 -0
- package/src/commands/GenerateTypes/GenerateTypesCommand.js.map +1 -0
- package/src/commands/GenerateTypes/components/GenerateTypes.d.ts +9 -0
- package/src/commands/GenerateTypes/components/GenerateTypes.js +36 -0
- package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -0
- package/src/commands/GenerateTypes/constants.d.ts +1 -0
- package/src/commands/GenerateTypes/constants.js +3 -0
- package/src/commands/GenerateTypes/constants.js.map +1 -0
- package/src/commands/GenerateTypes/fn/getApiDefinitions.d.ts +2 -0
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js +39 -0
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js.map +1 -0
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.d.ts +5 -0
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js +78 -0
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js.map +1 -0
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.d.ts +1 -0
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js +7 -0
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js.map +1 -0
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.d.ts +1 -0
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.js +21 -0
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.js.map +1 -0
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.d.ts +10 -0
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +22 -0
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -0
- package/src/commands/GenerateTypes/hooks/useFetchHtml.d.ts +12 -0
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js +31 -0
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js.map +1 -0
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.d.ts +12 -0
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +126 -0
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -0
- package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +53 -0
- package/src/commands/GenerateTypes/hooks/useGetVersion.js +52 -0
- package/src/commands/GenerateTypes/hooks/useGetVersion.js.map +1 -0
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.d.ts +13 -0
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js +34 -0
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js.map +1 -0
- package/src/commands/GenerateTypes/index.d.ts +1 -0
- package/src/commands/GenerateTypes/index.js +3 -0
- package/src/commands/GenerateTypes/index.js.map +1 -0
- package/src/commands/GenerateTypes/utils/createTypeProvider.d.ts +43 -0
- package/src/commands/GenerateTypes/utils/createTypeProvider.js +156 -0
- package/src/commands/GenerateTypes/utils/createTypeProvider.js.map +1 -0
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.d.ts +2 -0
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.js +18 -0
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.js.map +1 -0
- package/src/commands/NewCommand/NewCommand.d.ts +10 -0
- package/src/commands/NewCommand/NewCommand.js +35 -0
- package/src/commands/NewCommand/NewCommand.js.map +1 -0
- package/src/commands/NewCommand/components/New.d.ts +8 -0
- package/src/commands/NewCommand/components/New.js +26 -0
- package/src/commands/NewCommand/components/New.js.map +1 -0
- package/src/commands/RenderableCommand.d.ts +7 -0
- package/src/commands/RenderableCommand.js +12 -0
- package/src/commands/RenderableCommand.js.map +1 -0
- package/src/commands/SimulatorCommand/SimulatorCommand.d.ts +12 -0
- package/src/commands/SimulatorCommand/SimulatorCommand.js +39 -0
- package/src/commands/SimulatorCommand/SimulatorCommand.js.map +1 -0
- package/src/commands/SimulatorCommand/components/Simulator.d.ts +11 -0
- package/src/commands/SimulatorCommand/components/Simulator.js +80 -0
- package/src/commands/SimulatorCommand/components/Simulator.js.map +1 -0
- package/src/commands/SimulatorCommand/index.d.ts +1 -0
- package/src/commands/SimulatorCommand/index.js +3 -0
- package/src/commands/SimulatorCommand/index.js.map +1 -0
- package/src/commands/TranspileCommand/TranspileCommand.d.ts +9 -0
- package/src/commands/TranspileCommand/TranspileCommand.js +31 -0
- package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -0
- package/src/commands/TranspileCommand/components/Transpile.d.ts +6 -0
- package/src/commands/TranspileCommand/components/Transpile.js +12 -0
- package/src/commands/TranspileCommand/components/Transpile.js.map +1 -0
- package/src/commands/TranspileCommand/fn/transpile.d.ts +1 -0
- package/src/commands/TranspileCommand/fn/transpile.js +19 -0
- package/src/commands/TranspileCommand/fn/transpile.js.map +1 -0
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.d.ts +2 -0
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +18 -0
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js.map +1 -0
- package/src/commands/TranspileCommand/index.d.ts +1 -0
- package/src/commands/TranspileCommand/index.js +3 -0
- package/src/commands/TranspileCommand/index.js.map +1 -0
- package/src/components/CheckList/CheckList.d.ts +8 -0
- package/src/components/CheckList/CheckList.js +34 -0
- package/src/components/CheckList/CheckList.js.map +1 -0
- package/src/components/CheckList/Item.d.ts +7 -0
- package/src/components/CheckList/Item.js +87 -0
- package/src/components/CheckList/Item.js.map +1 -0
- package/src/components/CheckList/index.d.ts +1 -0
- package/src/components/CheckList/index.js +3 -0
- package/src/components/CheckList/index.js.map +1 -0
- package/src/components/Spinner.d.ts +3 -0
- package/src/components/Spinner.js +26 -0
- package/src/components/Spinner.js.map +1 -0
- package/src/constants.d.ts +3 -0
- package/src/constants.js +11 -0
- package/src/constants.js.map +1 -0
- package/src/environment/createEnvironment.d.ts +12 -0
- package/src/environment/createEnvironment.js +37 -0
- package/src/environment/createEnvironment.js.map +1 -0
- package/src/environment/dto/Environment.d.ts +7 -0
- package/src/environment/dto/Environment.js +7 -0
- package/src/environment/dto/Environment.js.map +1 -0
- package/src/environment/error/EnvironmentError.d.ts +2 -0
- package/src/environment/error/EnvironmentError.js +4 -0
- package/src/environment/error/EnvironmentError.js.map +1 -0
- package/src/environment/path/dto/PlaydateSdkPath.d.ts +5 -0
- package/src/environment/path/dto/PlaydateSdkPath.js +10 -0
- package/src/environment/path/dto/PlaydateSdkPath.js.map +1 -0
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.d.ts +4 -0
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js +8 -0
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js.map +1 -0
- package/src/environment/path/getPlaydateSdkPath.d.ts +14 -0
- package/src/environment/path/getPlaydateSdkPath.js +16 -0
- package/src/environment/path/getPlaydateSdkPath.js.map +1 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +30 -11
- package/src/index.js.map +1 -1
- package/src/types.d.ts +96 -0
- package/src/types.js +16 -0
- package/src/types.js.map +1 -0
- package/src/utils/dirname.d.ts +1 -0
- package/src/utils/dirname.js +5 -0
- package/src/utils/dirname.js.map +1 -0
package/src/types.d.ts
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
import { ClassDeclarationStructure, FunctionDeclarationStructure, MethodDeclarationStructure, ParameterDeclarationStructure } from 'ts-morph';
|
2
|
+
import { Environment } from './environment/dto/Environment.js';
|
3
|
+
import { PlaydateSdkPath } from './environment/path/dto/PlaydateSdkPath.js';
|
4
|
+
export declare enum PlaydateSdkVersionIdentifier {
|
5
|
+
Latest = "latest"
|
6
|
+
}
|
7
|
+
export type PlaydateSdkVersion = PlaydateSdkVersionIdentifier.Latest | string;
|
8
|
+
export type EnvironmentHealthResult = {
|
9
|
+
isHealthy: true;
|
10
|
+
environment: Environment;
|
11
|
+
health: EnvironmentHealth;
|
12
|
+
} | {
|
13
|
+
isHealthy: false;
|
14
|
+
health: EnvironmentHealth;
|
15
|
+
};
|
16
|
+
export declare enum HealthCheckStatusType {
|
17
|
+
Healthy = "Healthy",
|
18
|
+
Unhealthy = "Unhealthy",
|
19
|
+
Unknown = "Unknown"
|
20
|
+
}
|
21
|
+
export type HealthCheckStatus<TArgument> = {
|
22
|
+
healthStatus: HealthCheckStatusType.Unknown | HealthCheckStatusType.Unhealthy;
|
23
|
+
} | {
|
24
|
+
healthStatus: HealthCheckStatusType.Healthy;
|
25
|
+
argument: TArgument;
|
26
|
+
};
|
27
|
+
export interface EnvironmentHealth {
|
28
|
+
sdkPathKnown: HealthCheckStatus<PlaydateSdkPath>;
|
29
|
+
}
|
30
|
+
export type CheckListItem<TResult> = {
|
31
|
+
runningDescription: string;
|
32
|
+
waitingDescription: string;
|
33
|
+
errorDescription: string;
|
34
|
+
finishedDescription: (result: TResult) => string;
|
35
|
+
runner: () => Promise<TResult> | Promise<false>;
|
36
|
+
onFinish?: (result: TResult) => void;
|
37
|
+
ready?: boolean;
|
38
|
+
};
|
39
|
+
export interface ParameterDescription {
|
40
|
+
name: string;
|
41
|
+
required: boolean;
|
42
|
+
}
|
43
|
+
export interface PropertyDescription {
|
44
|
+
signature: string;
|
45
|
+
name: string;
|
46
|
+
namespaces: string[];
|
47
|
+
docs: string;
|
48
|
+
}
|
49
|
+
export interface FunctionDescription {
|
50
|
+
signature: string;
|
51
|
+
name: string;
|
52
|
+
namespaces: string[];
|
53
|
+
parameters: ParameterDescription[];
|
54
|
+
hasSelf: boolean;
|
55
|
+
docs: string;
|
56
|
+
}
|
57
|
+
export interface ApiObject {
|
58
|
+
functions: FunctionDescription[];
|
59
|
+
methods: FunctionDescription[];
|
60
|
+
properties: PropertyDescription[];
|
61
|
+
namespaces: Record<string, ApiObject>;
|
62
|
+
}
|
63
|
+
export interface ApiDefinitions {
|
64
|
+
global: ApiObject;
|
65
|
+
}
|
66
|
+
export interface ParameterDetails {
|
67
|
+
name: string;
|
68
|
+
type: string;
|
69
|
+
overrideOptions?: Partial<Omit<ParameterDeclarationStructure, 'kind' | 'name' | 'type'>>;
|
70
|
+
}
|
71
|
+
export interface PropertyDetails {
|
72
|
+
signature: string;
|
73
|
+
type: string;
|
74
|
+
isStatic?: boolean;
|
75
|
+
isReadOnly?: boolean;
|
76
|
+
}
|
77
|
+
export interface FunctionDetails {
|
78
|
+
signature: string;
|
79
|
+
parameters: ParameterDetails[];
|
80
|
+
returnType: string;
|
81
|
+
overrideParameters?: boolean;
|
82
|
+
overrideOptions?: Partial<FunctionDeclarationStructure | MethodDeclarationStructure>;
|
83
|
+
}
|
84
|
+
export type TypeProviderData = {
|
85
|
+
globalStatements: string[];
|
86
|
+
statements: string[];
|
87
|
+
classes: Record<string, Partial<ClassDeclarationStructure>>;
|
88
|
+
properties: Record<string, PropertyDetails>;
|
89
|
+
functions: Record<string, FunctionDetails>;
|
90
|
+
};
|
91
|
+
export type FunctionTypeOverrideMap = Record<string, {
|
92
|
+
isMethod: boolean;
|
93
|
+
}>;
|
94
|
+
export declare enum TemplateName {
|
95
|
+
Blank = "blank"
|
96
|
+
}
|
package/src/types.js
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
export var PlaydateSdkVersionIdentifier;
|
2
|
+
(function(PlaydateSdkVersionIdentifier) {
|
3
|
+
PlaydateSdkVersionIdentifier["Latest"] = "latest";
|
4
|
+
})(PlaydateSdkVersionIdentifier || (PlaydateSdkVersionIdentifier = {}));
|
5
|
+
export var HealthCheckStatusType;
|
6
|
+
(function(HealthCheckStatusType) {
|
7
|
+
HealthCheckStatusType["Healthy"] = "Healthy";
|
8
|
+
HealthCheckStatusType["Unhealthy"] = "Unhealthy";
|
9
|
+
HealthCheckStatusType["Unknown"] = "Unknown";
|
10
|
+
})(HealthCheckStatusType || (HealthCheckStatusType = {}));
|
11
|
+
export var TemplateName;
|
12
|
+
(function(TemplateName) {
|
13
|
+
TemplateName["Blank"] = "blank";
|
14
|
+
})(TemplateName || (TemplateName = {}));
|
15
|
+
|
16
|
+
//# sourceMappingURL=types.js.map
|
package/src/types.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../libs/cli/src/types.ts"],"sourcesContent":["import {\n ClassDeclarationStructure,\n FunctionDeclarationStructure,\n MethodDeclarationStructure,\n ParameterDeclarationStructure,\n} from 'ts-morph';\nimport { Environment } from '@/cli/environment/dto/Environment.js';\nimport { PlaydateSdkPath } from '@/cli/environment/path/dto/PlaydateSdkPath.js';\n\nexport enum PlaydateSdkVersionIdentifier {\n Latest = 'latest',\n}\n\nexport type PlaydateSdkVersion = PlaydateSdkVersionIdentifier.Latest | string;\n\nexport type EnvironmentHealthResult =\n | {\n isHealthy: true;\n environment: Environment;\n health: EnvironmentHealth;\n }\n | {\n isHealthy: false;\n health: EnvironmentHealth;\n };\n\nexport enum HealthCheckStatusType {\n Healthy = 'Healthy',\n Unhealthy = 'Unhealthy',\n Unknown = 'Unknown',\n}\n\nexport type HealthCheckStatus<TArgument> =\n | {\n healthStatus:\n | HealthCheckStatusType.Unknown\n | HealthCheckStatusType.Unhealthy;\n }\n | {\n healthStatus: HealthCheckStatusType.Healthy;\n argument: TArgument;\n };\n\nexport interface EnvironmentHealth {\n sdkPathKnown: HealthCheckStatus<PlaydateSdkPath>;\n}\n\nexport type CheckListItem<TResult> = {\n runningDescription: string;\n waitingDescription: string;\n errorDescription: string;\n finishedDescription: (result: TResult) => string;\n runner: () => Promise<TResult> | Promise<false>;\n onFinish?: (result: TResult) => void;\n ready?: boolean;\n};\n\nexport interface ParameterDescription {\n name: string;\n required: boolean;\n}\n\nexport interface PropertyDescription {\n signature: string;\n name: string;\n namespaces: string[];\n docs: string;\n}\n\nexport interface FunctionDescription {\n signature: string;\n name: string;\n namespaces: string[];\n parameters: ParameterDescription[];\n hasSelf: boolean;\n docs: string;\n}\n\nexport interface ApiObject {\n functions: FunctionDescription[];\n methods: FunctionDescription[];\n properties: PropertyDescription[];\n namespaces: Record<string, ApiObject>;\n}\n\nexport interface ApiDefinitions {\n global: ApiObject;\n}\n\nexport interface ParameterDetails {\n name: string;\n type: string;\n overrideOptions?: Partial<\n Omit<ParameterDeclarationStructure, 'kind' | 'name' | 'type'>\n >;\n}\n\nexport interface PropertyDetails {\n signature: string;\n type: string;\n isStatic?: boolean;\n isReadOnly?: boolean;\n}\n\nexport interface FunctionDetails {\n signature: string;\n parameters: ParameterDetails[];\n returnType: string;\n overrideParameters?: boolean;\n overrideOptions?: Partial<\n FunctionDeclarationStructure | MethodDeclarationStructure\n >;\n}\n\nexport type TypeProviderData = {\n globalStatements: string[];\n statements: string[];\n classes: Record<string, Partial<ClassDeclarationStructure>>;\n properties: Record<string, PropertyDetails>;\n functions: Record<string, FunctionDetails>;\n};\n\nexport type FunctionTypeOverrideMap = Record<string, { isMethod: boolean }>;\n\nexport enum TemplateName {\n Blank = 'blank',\n}\n"],"names":["PlaydateSdkVersionIdentifier","HealthCheckStatusType","TemplateName"],"rangeMappings":";;;;;;;;;;;;;","mappings":";UASYA;;GAAAA,iCAAAA;;UAiBAC;;;;GAAAA,0BAAAA;;UAkGAC;;GAAAA,iBAAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const __dirname: string;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../libs/cli/src/utils/dirname.ts"],"sourcesContent":["import { dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport const __dirname = dirname(fileURLToPath(import.meta.url));\n"],"names":["dirname","fileURLToPath","__dirname","url"],"rangeMappings":";;","mappings":"AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,aAAa,QAAQ,WAAW;AAEzC,OAAO,MAAMC,YAAYF,QAAQC,cAAc,YAAYE,GAAG,GAAG"}
|