crankscript 0.11.14 → 0.12.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.
Files changed (44) hide show
  1. package/package.json +3 -3
  2. package/src/commands/GenerateTypes/components/GenerateTypes.js +6 -2
  3. package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -1
  4. package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +5 -2
  5. package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -1
  6. package/src/commands/GenerateTypes/hooks/useFormatTypeFile.d.ts +11 -0
  7. package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js +70 -0
  8. package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js.map +1 -0
  9. package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +11 -4
  10. package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -1
  11. package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +5 -35
  12. package/src/commands/GenerateTypes/types.d.ts +12 -0
  13. package/src/commands/GenerateTypes/types.js +3 -0
  14. package/src/commands/GenerateTypes/types.js.map +1 -0
  15. package/src/commands/GenerateTypes/utils/createTypeProvider.d.ts +7 -37
  16. package/src/commands/GenerateTypes/utils/createTypeProvider.js +51 -27
  17. package/src/commands/GenerateTypes/utils/createTypeProvider.js.map +1 -1
  18. package/src/commands/SimulatorCommand/components/Simulator.js +7 -1
  19. package/src/commands/SimulatorCommand/components/Simulator.js.map +1 -1
  20. package/src/commands/TranspileCommand/TranspileCommand.d.ts +1 -0
  21. package/src/commands/TranspileCommand/TranspileCommand.js +10 -1
  22. package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -1
  23. package/src/commands/TranspileCommand/components/Transpile.d.ts +3 -2
  24. package/src/commands/TranspileCommand/components/Transpile.js +4 -2
  25. package/src/commands/TranspileCommand/components/Transpile.js.map +1 -1
  26. package/src/commands/TranspileCommand/fn/transpile.d.ts +5 -1
  27. package/src/commands/TranspileCommand/fn/transpile.js +5 -4
  28. package/src/commands/TranspileCommand/fn/transpile.js.map +1 -1
  29. package/src/commands/TranspileCommand/fn/validateEntryPoint.d.ts +5 -0
  30. package/src/commands/TranspileCommand/fn/validateEntryPoint.js +22 -0
  31. package/src/commands/TranspileCommand/fn/validateEntryPoint.js.map +1 -0
  32. package/src/commands/TranspileCommand/hooks/useTranspileTasks.d.ts +4 -1
  33. package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +4 -2
  34. package/src/commands/TranspileCommand/hooks/useTranspileTasks.js.map +1 -1
  35. package/src/commands/TranspileCommand/model/ValidatedEntryPoint.d.ts +11 -0
  36. package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js +3 -0
  37. package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js.map +1 -0
  38. package/src/components/CheckList/CheckList.d.ts +3 -3
  39. package/src/components/CheckList/CheckList.js.map +1 -1
  40. package/src/components/CheckList/Item.d.ts +1 -1
  41. package/src/components/CheckList/Item.js +19 -4
  42. package/src/components/CheckList/Item.js.map +1 -1
  43. package/src/types.d.ts +17 -16
  44. package/src/types.js.map +1 -1
package/src/types.js.map CHANGED
@@ -1 +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 | false) => string;\n runner: () => Promise<TResult> | Promise<false>;\n onFinish?: (result: TResult | false) => void;\n ready?: boolean;\n quitOnError?: 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 interface ConstantDefinition {\n name: string;\n type: string;\n}\n\nexport type TypeProviderData = {\n globalStatements: string[];\n statements: string[];\n constants: Record<string, (ConstantDefinition | string)[]>;\n classes: Record<string, Partial<ClassDeclarationStructure>>;\n properties: Record<string, PropertyDetails>;\n dynamicProperties: Record<\n string,\n Pick<PropertyDescription, 'name' | 'docs'>[]\n >;\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;;UA6GAC;;GAAAA,iBAAAA"}
1
+ {"version":3,"sources":["../../../../libs/cli/src/types.ts"],"sourcesContent":["import {\n ClassDeclarationStructure,\n FunctionDeclarationStructure,\n MethodDeclarationStructure,\n ParameterDeclarationStructure,\n PropertyDeclarationStructure,\n VariableDeclarationStructure,\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 | false) => string;\n skipDescription?: string;\n runner: () => Promise<TResult> | Promise<false>;\n onFinish?: (result: TResult | false) => void;\n ready?: boolean;\n quitOnError?: boolean;\n skip?: boolean | (() => 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 PropertyDetails extends Partial<PropertyDeclarationStructure> {\n signature: string;\n}\n\nexport type FunctionDetails = {\n signature: string;\n parameters: ParameterDetails[];\n overrideParameters?: boolean;\n} & (\n | Partial<FunctionDeclarationStructure>\n | Partial<MethodDeclarationStructure>\n);\n\nexport type ParameterDetails = ParameterDeclarationStructure;\n\nexport interface ConstantDefinition\n extends Partial<VariableDeclarationStructure> {\n name: string;\n}\n\nexport type TypeProviderData = {\n globalStatements: string[];\n statements: string[];\n constants: Record<string, (ConstantDefinition | string)[]>;\n classes: Record<string, Partial<ClassDeclarationStructure>>;\n properties: Record<string, PropertyDetails>;\n /**\n * Properties that are described in prose rather than in formal API documentation.\n * While 'properties' contains actual property definitions with their full path as the key,\n * 'dynamicProperties' contains additional properties that belong to a parent namespace.\n *\n * For example, if the docs mention \"You can access rect.x, rect.y\" in prose,\n * the key would be \"playdate.geometry.rect\" and the value would be the properties\n * that should be added to that namespace.\n */\n dynamicProperties: Record<\n string,\n Pick<PropertyDescription, 'name' | 'docs'>[]\n >;\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":";UAWYA;;GAAAA,iCAAAA;;UAiBAC;;;;GAAAA,0BAAAA;;UA8GAC;;GAAAA,iBAAAA"}