crankscript 0.17.0 → 0.18.0-beta.1
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/CHANGELOG.md +11 -5
- package/assets/ImportMap/ImportMap.js +26 -65
- package/assets/ImportMap/ImportMap.js.map +1 -1
- package/assets/ImportMap/index.js +3 -6
- package/assets/ImportMap/index.js.map +1 -1
- package/assets/beforeEmit/getBeforeEmit.js +11 -16
- package/assets/beforeEmit/getBeforeEmit.js.map +1 -1
- package/assets/beforeEmit/index.js +3 -6
- package/assets/beforeEmit/index.js.map +1 -1
- package/assets/beforeEmit/withAutomaticImportWarning.js +4 -11
- package/assets/beforeEmit/withAutomaticImportWarning.js.map +1 -1
- package/assets/index.js +18 -28
- package/assets/index.js.map +1 -1
- package/assets/transformCallExpression/getTransformCallExpression.js +66 -18
- package/assets/transformCallExpression/getTransformCallExpression.js.map +1 -1
- package/assets/transformCallExpression/index.js +3 -6
- package/assets/transformCallExpression/index.js.map +1 -1
- package/assets/transformClassDeclaration/createClasCall.js +11 -24
- package/assets/transformClassDeclaration/createClasCall.js.map +1 -1
- package/assets/transformClassDeclaration/getExportedClassDeclarationStatements.js +14 -15
- package/assets/transformClassDeclaration/getExportedClassDeclarationStatements.js.map +1 -1
- package/assets/transformClassDeclaration/getTransformClassDeclaration.js +47 -43
- package/assets/transformClassDeclaration/getTransformClassDeclaration.js.map +1 -1
- package/assets/transformClassDeclaration/index.js +3 -6
- package/assets/transformClassDeclaration/index.js.map +1 -1
- package/assets/transformClassDeclaration/transformConstructor.js +44 -56
- package/assets/transformClassDeclaration/transformConstructor.js.map +1 -1
- package/assets/transformClassDeclaration/transformMethodDeclaration.js +12 -20
- package/assets/transformClassDeclaration/transformMethodDeclaration.js.map +1 -1
- package/assets/transformClassDeclaration/transformPropertyName.js +14 -19
- package/assets/transformClassDeclaration/transformPropertyName.js.map +1 -1
- package/assets/transformExportDeclaration/getTransformExportDeclaration.d.ts +6 -0
- package/assets/transformExportDeclaration/getTransformExportDeclaration.js +52 -0
- package/assets/transformExportDeclaration/getTransformExportDeclaration.js.map +1 -0
- package/assets/transformNewExpression/index.js +3 -6
- package/assets/transformNewExpression/index.js.map +1 -1
- package/assets/transformNewExpression/isBuiltinNewExpression.js +11 -15
- package/assets/transformNewExpression/isBuiltinNewExpression.js.map +1 -1
- package/assets/transformNewExpression/transformNewExpression.js +12 -23
- package/assets/transformNewExpression/transformNewExpression.js.map +1 -1
- package/assets/transformPropertyAccessExpression/a.js +24 -0
- package/assets/transformPropertyAccessExpression/a.js.map +1 -0
- package/assets/transformPropertyAccessExpression/getTransformPropertyAccessExpression.js +6 -13
- package/assets/transformPropertyAccessExpression/getTransformPropertyAccessExpression.js.map +1 -1
- package/assets/transformPropertyAccessExpression/index.js +3 -6
- package/assets/transformPropertyAccessExpression/index.js.map +1 -1
- package/assets/transformSuperExpression/index.js +3 -6
- package/assets/transformSuperExpression/index.js.map +1 -1
- package/assets/transformSuperExpression/transformSuperExpression.js +8 -16
- package/assets/transformSuperExpression/transformSuperExpression.js.map +1 -1
- package/assets/types.js +1 -4
- package/assets/types.js.map +1 -1
- package/package.json +8 -5
- package/src/commands/CompileCommand/CompileCommand.d.ts +1 -1
- package/src/commands/CompileCommand/CompileCommand.js +3 -10
- package/src/commands/CompileCommand/CompileCommand.js.map +1 -1
- package/src/commands/CompileCommand/components/Compile.d.ts +1 -1
- package/src/commands/CompileCommand/components/Compile.js +3 -7
- package/src/commands/CompileCommand/components/Compile.js.map +1 -1
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.d.ts +1 -1
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js +1 -2
- package/src/commands/CompileCommand/fn/getPdcPathFromEnvironment.js.map +1 -1
- package/src/commands/CompileCommand/hooks/task/compile.d.ts +5 -2
- package/src/commands/CompileCommand/hooks/task/compile.js +10 -9
- package/src/commands/CompileCommand/hooks/task/compile.js.map +1 -1
- package/src/commands/CompileCommand/hooks/useCompileTasks.d.ts +5 -2
- package/src/commands/CompileCommand/hooks/useCompileTasks.js +33 -30
- package/src/commands/CompileCommand/hooks/useCompileTasks.js.map +1 -1
- package/src/commands/CompileCommand/index.js +0 -1
- package/src/commands/CompileCommand/index.js.map +1 -1
- package/src/commands/DoctorCommand.js +5 -12
- package/src/commands/DoctorCommand.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.d.ts +2 -2
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js +30 -30
- package/src/commands/EnvironmentAwareCommand/EnvironmentAwareCommand.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.d.ts +1 -1
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js +14 -15
- package/src/commands/EnvironmentAwareCommand/components/HealthReport.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js +5 -10
- package/src/commands/EnvironmentAwareCommand/contexts/CrankScriptContext.js.map +1 -1
- package/src/commands/EnvironmentAwareCommand/index.js +0 -1
- package/src/commands/EnvironmentAwareCommand/index.js.map +1 -1
- package/src/commands/GenerateTypes/GenerateTypesCommand.js +14 -21
- package/src/commands/GenerateTypes/GenerateTypesCommand.js.map +1 -1
- package/src/commands/GenerateTypes/components/GenerateTypes.d.ts +1 -1
- package/src/commands/GenerateTypes/components/GenerateTypes.js +11 -15
- package/src/commands/GenerateTypes/components/GenerateTypes.js.map +1 -1
- package/src/commands/GenerateTypes/constants.js +0 -1
- package/src/commands/GenerateTypes/constants.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getApiDefinitions.d.ts +1 -1
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js +12 -14
- package/src/commands/GenerateTypes/fn/getApiDefinitions.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.d.ts +1 -1
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js +38 -30
- package/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js +5 -4
- package/src/commands/GenerateTypes/fn/getFunctionTypeOverride.js.map +1 -1
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.js +6 -9
- package/src/commands/GenerateTypes/fn/getHtmlForVersion.js.map +1 -1
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js +13 -10
- package/src/commands/GenerateTypes/fn/parseFunctionSignature.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js +10 -12
- package/src/commands/GenerateTypes/hooks/useFetchHtml.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js +23 -29
- package/src/commands/GenerateTypes/hooks/useFormatTypeFile.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.d.ts +2 -2
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js +44 -75
- package/src/commands/GenerateTypes/hooks/useGenerateTypeFile.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.d.ts +1 -1
- package/src/commands/GenerateTypes/hooks/useGetVersion.js +19 -19
- package/src/commands/GenerateTypes/hooks/useGetVersion.js.map +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.d.ts +1 -1
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js +10 -12
- package/src/commands/GenerateTypes/hooks/useParseDocumentation.js.map +1 -1
- package/src/commands/GenerateTypes/index.js +0 -1
- package/src/commands/GenerateTypes/index.js.map +1 -1
- package/src/commands/GenerateTypes/types.d.ts +1 -1
- package/src/commands/GenerateTypes/types.js +1 -2
- package/src/commands/GenerateTypes/types.js.map +1 -1
- package/src/commands/GenerateTypes/utils/createTypeProvider.d.ts +2 -2
- package/src/commands/GenerateTypes/utils/createTypeProvider.js +63 -85
- package/src/commands/GenerateTypes/utils/createTypeProvider.js.map +1 -1
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.d.ts +1 -1
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.js +6 -7
- package/src/commands/GenerateTypes/utils/functionTypeOverrides.js.map +1 -1
- package/src/commands/NewCommand/NewCommand.js +9 -17
- package/src/commands/NewCommand/NewCommand.js.map +1 -1
- package/src/commands/NewCommand/components/New.d.ts +1 -1
- package/src/commands/NewCommand/components/New.js +19 -25
- package/src/commands/NewCommand/components/New.js.map +1 -1
- package/src/commands/NewLibCommand/NewLibCommand.js +9 -17
- package/src/commands/NewLibCommand/NewLibCommand.js.map +1 -1
- package/src/commands/NewLibCommand/components/NewLib.d.ts +1 -1
- package/src/commands/NewLibCommand/components/NewLib.js +19 -25
- package/src/commands/NewLibCommand/components/NewLib.js.map +1 -1
- package/src/commands/NewLibCommand/index.js +0 -1
- package/src/commands/NewLibCommand/index.js.map +1 -1
- package/src/commands/RenderableCommand.d.ts +1 -1
- package/src/commands/RenderableCommand.js +5 -3
- package/src/commands/RenderableCommand.js.map +1 -1
- package/src/commands/SimulatorCommand/SimulatorCommand.d.ts +1 -1
- package/src/commands/SimulatorCommand/SimulatorCommand.js +23 -38
- package/src/commands/SimulatorCommand/SimulatorCommand.js.map +1 -1
- package/src/commands/SimulatorCommand/components/Simulator.d.ts +3 -2
- package/src/commands/SimulatorCommand/components/Simulator.js +19 -17
- package/src/commands/SimulatorCommand/components/Simulator.js.map +1 -1
- package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.d.ts +1 -1
- package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.js +15 -22
- package/src/commands/SimulatorCommand/components/TemporaryFolderCreator.js.map +1 -1
- package/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.js +8 -6
- package/src/commands/SimulatorCommand/fn/createTemporaryFolderPathFromEntryFile.js.map +1 -1
- package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.d.ts +1 -1
- package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.js +1 -2
- package/src/commands/SimulatorCommand/fn/getSimulatorPathFromEnvironment.js.map +1 -1
- package/src/commands/SimulatorCommand/hooks/useFileWatcher.js +10 -10
- package/src/commands/SimulatorCommand/hooks/useFileWatcher.js.map +1 -1
- package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.d.ts +6 -2
- package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.js +52 -50
- package/src/commands/SimulatorCommand/hooks/useSimulatorTasks.js.map +1 -1
- package/src/commands/SimulatorCommand/index.js +0 -1
- package/src/commands/SimulatorCommand/index.js.map +1 -1
- package/src/commands/TestCommand/TestCommand.d.ts +12 -0
- package/src/commands/TestCommand/TestCommand.js +32 -0
- package/src/commands/TestCommand/TestCommand.js.map +1 -0
- package/src/commands/TestCommand/components/Test.d.ts +9 -0
- package/src/commands/TestCommand/components/Test.js +73 -0
- package/src/commands/TestCommand/components/Test.js.map +1 -0
- package/src/commands/TestCommand/components/TestLine.d.ts +10 -0
- package/src/commands/TestCommand/components/TestLine.js +11 -0
- package/src/commands/TestCommand/components/TestLine.js.map +1 -0
- package/src/commands/TestCommand/components/TestResult.d.ts +8 -0
- package/src/commands/TestCommand/components/TestResult.js +21 -0
- package/src/commands/TestCommand/components/TestResult.js.map +1 -0
- package/src/commands/TestCommand/components/TestSuite.d.ts +8 -0
- package/src/commands/TestCommand/components/TestSuite.js +60 -0
- package/src/commands/TestCommand/components/TestSuite.js.map +1 -0
- package/src/commands/TestCommand/components/TestSummary.d.ts +7 -0
- package/src/commands/TestCommand/components/TestSummary.js +9 -0
- package/src/commands/TestCommand/components/TestSummary.js.map +1 -0
- package/src/commands/TestCommand/hooks/useTestFiles.d.ts +3 -0
- package/src/commands/TestCommand/hooks/useTestFiles.js +8 -0
- package/src/commands/TestCommand/hooks/useTestFiles.js.map +1 -0
- package/src/commands/TestCommand/hooks/useTestServer.d.ts +5 -0
- package/src/commands/TestCommand/hooks/useTestServer.js +26 -0
- package/src/commands/TestCommand/hooks/useTestServer.js.map +1 -0
- package/src/commands/TestCommand/hooks/useTestTasks.d.ts +14 -0
- package/src/commands/TestCommand/hooks/useTestTasks.js +61 -0
- package/src/commands/TestCommand/hooks/useTestTasks.js.map +1 -0
- package/src/commands/TestCommand/index.d.ts +1 -0
- package/src/commands/TestCommand/index.js +2 -0
- package/src/commands/TestCommand/index.js.map +1 -0
- package/src/commands/TestCommand/server/TestServer.d.ts +72 -0
- package/src/commands/TestCommand/server/TestServer.js +249 -0
- package/src/commands/TestCommand/server/TestServer.js.map +1 -0
- package/src/commands/TestCommand/types.d.ts +4 -0
- package/src/commands/TestCommand/types.js +6 -0
- package/src/commands/TestCommand/types.js.map +1 -0
- package/src/commands/TestCommand/utils/formatTestError.d.ts +1 -0
- package/src/commands/TestCommand/utils/formatTestError.js +7 -0
- package/src/commands/TestCommand/utils/formatTestError.js.map +1 -0
- package/src/commands/TranspileCommand/TranspileCommand.d.ts +1 -0
- package/src/commands/TranspileCommand/TranspileCommand.js +23 -28
- package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -1
- package/src/commands/TranspileCommand/components/Transpile.d.ts +4 -3
- package/src/commands/TranspileCommand/components/Transpile.js +4 -7
- package/src/commands/TranspileCommand/components/Transpile.js.map +1 -1
- package/src/commands/TranspileCommand/fn/getErrorMessage.d.ts +1 -1
- package/src/commands/TranspileCommand/fn/getErrorMessage.js +5 -6
- package/src/commands/TranspileCommand/fn/getErrorMessage.js.map +1 -1
- package/src/commands/TranspileCommand/fn/transpile.d.ts +4 -3
- package/src/commands/TranspileCommand/fn/transpile.js +21 -24
- package/src/commands/TranspileCommand/fn/transpile.js.map +1 -1
- package/src/commands/TranspileCommand/fn/validateEntryPoint.d.ts +1 -1
- package/src/commands/TranspileCommand/fn/validateEntryPoint.js +2 -3
- package/src/commands/TranspileCommand/fn/validateEntryPoint.js.map +1 -1
- package/src/commands/TranspileCommand/fn/validateExitPoint.d.ts +1 -1
- package/src/commands/TranspileCommand/fn/validateExitPoint.js +6 -6
- package/src/commands/TranspileCommand/fn/validateExitPoint.js.map +1 -1
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.d.ts +6 -5
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +35 -33
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js.map +1 -1
- package/src/commands/TranspileCommand/index.js +0 -1
- package/src/commands/TranspileCommand/index.js.map +1 -1
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js +1 -2
- package/src/commands/TranspileCommand/model/ValidatedEntryPoint.js.map +1 -1
- package/src/commands/TranspileCommand/model/ValidatedExitPoint.js +1 -2
- package/src/commands/TranspileCommand/model/ValidatedExitPoint.js.map +1 -1
- package/src/commands/TranspileCommand/types.js +1 -2
- package/src/commands/TranspileCommand/types.js.map +1 -1
- package/src/components/CheckList/CheckList.d.ts +3 -2
- package/src/components/CheckList/CheckList.js +14 -21
- package/src/components/CheckList/CheckList.js.map +1 -1
- package/src/components/CheckList/Item.d.ts +3 -2
- package/src/components/CheckList/Item.js +47 -44
- package/src/components/CheckList/Item.js.map +1 -1
- package/src/components/CheckList/index.js +0 -1
- package/src/components/CheckList/index.js.map +1 -1
- package/src/components/ErrorBoundary.d.ts +14 -0
- package/src/components/ErrorBoundary.js +7 -13
- package/src/components/ErrorBoundary.js.map +1 -1
- package/src/components/Spinner.d.ts +1 -1
- package/src/components/Spinner.js +13 -18
- package/src/components/Spinner.js.map +1 -1
- package/src/constants.js +1 -6
- package/src/constants.js.map +1 -1
- package/src/environment/createEnvironment.d.ts +1 -1
- package/src/environment/createEnvironment.js +13 -16
- package/src/environment/createEnvironment.js.map +1 -1
- package/src/environment/dto/Environment.d.ts +1 -1
- package/src/environment/dto/Environment.js +1 -2
- package/src/environment/dto/Environment.js.map +1 -1
- package/src/environment/error/EnvironmentError.js +0 -1
- package/src/environment/error/EnvironmentError.js.map +1 -1
- package/src/environment/path/dto/PlaydateSdkPath.js +3 -4
- package/src/environment/path/dto/PlaydateSdkPath.js.map +1 -1
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js +1 -2
- package/src/environment/path/error/PlaydateSdkPathVariableNotSetError.js.map +1 -1
- package/src/environment/path/getPlaydateSdkPath.js +5 -3
- package/src/environment/path/getPlaydateSdkPath.js.map +1 -1
- package/src/index.js +7 -5
- package/src/index.js.map +1 -1
- package/src/types.d.ts +3 -3
- package/src/types.js +4 -5
- package/src/types.js.map +1 -1
- package/src/utils/appendExeOnWindows.js +1 -2
- package/src/utils/appendExeOnWindows.js.map +1 -1
- package/src/utils/dirname.js +0 -1
- package/src/utils/dirname.js.map +1 -1
- package/src/utils/platform.js +0 -1
- package/src/utils/platform.js.map +1 -1
- package/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.js +0 -4
- package/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-automatic-imports/src/index.js +0 -3
- package/src/commands/TranspileCommand/fn/_tests/test-automatic-imports/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-builtins/src/index.js +0 -4
- package/src/commands/TranspileCommand/fn/_tests/test-builtins/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-default-parameters/src/index.js +0 -17
- package/src/commands/TranspileCommand/fn/_tests/test-default-parameters/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-implicit-constructor/src/index.js +0 -10
- package/src/commands/TranspileCommand/fn/_tests/test-implicit-constructor/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-static/src/index.js +0 -18
- package/src/commands/TranspileCommand/fn/_tests/test-static/src/index.js.map +0 -1
- package/src/commands/TranspileCommand/fn/_tests/test-super/src/index.js +0 -24
- package/src/commands/TranspileCommand/fn/_tests/test-super/src/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/getDescriptionsFromHtml.ts"],"
|
|
1
|
+
{"version":3,"file":"getDescriptionsFromHtml.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/getDescript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Aa,CAAC;oBAE/B,SAAS,CAAC,IAAI,iCACP,WAAW,KACd,IAAI,IACN,CAAC;gBACP,CAAC;gBAAC,OAAO,MAAM,EAAE,CAAC;oBACd,SAAS;gBACb,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { functionTypeOverrides } from '../../../commands/GenerateTypes/utils/functionTypeOverrides.js';
|
|
2
|
-
export const getFunctionTypeOverride = (version)=>{
|
|
3
|
-
var
|
|
4
|
-
return (
|
|
2
|
+
export const getFunctionTypeOverride = (version) => {
|
|
3
|
+
var _a;
|
|
4
|
+
return ((_a = functionTypeOverrides[version]) !== null && _a !== void 0 ? _a :
|
|
5
|
+
// biome-ignore lint/complexity/useLiteralKeys: otherwise TypeScript will complain
|
|
6
|
+
functionTypeOverrides['defaultVersion']);
|
|
5
7
|
};
|
|
6
|
-
|
|
7
8
|
//# sourceMappingURL=getFunctionTypeOverride.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/getFunctionTypeOverride.ts"],"
|
|
1
|
+
{"version":3,"file":"getFunctionTypeOverride.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/getFunctionTypeOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAEpG,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAE,EAAE;;IACvD,OAAO,CACH,MAAA,qBAAqB,CAAC,OAAO,CAAC;IAC9B,kFAAkF;IAClF,qBAAqB,CAAC,gBAAgB,CAAC,CAC1C,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { mkdirSync } from 'node:fs';
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
-
export const getHtmlForVersion =
|
|
5
|
+
export const getHtmlForVersion = (version) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
6
|
const cacheDir = join(tmpdir(), 'crankscript', 'cache');
|
|
7
7
|
const path = join(cacheDir, `${version}.html`);
|
|
8
8
|
if (!existsSync(cacheDir)) {
|
|
9
|
-
mkdirSync(cacheDir, {
|
|
10
|
-
recursive: true
|
|
11
|
-
});
|
|
9
|
+
mkdirSync(cacheDir, { recursive: true });
|
|
12
10
|
}
|
|
13
11
|
if (existsSync(path)) {
|
|
14
12
|
return readFileSync(path, 'utf8');
|
|
15
13
|
}
|
|
16
|
-
const html =
|
|
14
|
+
const html = yield fetch(`https://sdk.play.date/${version}/`).then((res) => res.text());
|
|
17
15
|
writeFileSync(path, html, 'utf8');
|
|
18
16
|
return html;
|
|
19
|
-
};
|
|
20
|
-
|
|
17
|
+
});
|
|
21
18
|
//# sourceMappingURL=getHtmlForVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/getHtmlForVersion.ts"],"
|
|
1
|
+
{"version":3,"file":"getHtmlForVersion.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/getHtmlForVersion.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAO,OAAe,EAAE,EAAE;IACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,OAAO,OAAO,CAAC,CAAC;IAE/C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,yBAAyB,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACvE,GAAG,CAAC,IAAI,EAAE,CACb,CAAC;IAEF,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAElC,OAAO,IAAI,CAAC;AAChB,CAAC,CAAA,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export const parseFunctionSignature = (signature)=>{
|
|
2
|
-
const normalizedSignature = signature.includes('(')
|
|
1
|
+
export const parseFunctionSignature = (signature) => {
|
|
2
|
+
const normalizedSignature = signature.includes('(')
|
|
3
|
+
? signature
|
|
4
|
+
: `${signature}()`;
|
|
3
5
|
const [fullyQualifiedName, paramString] = normalizedSignature.split('(');
|
|
4
6
|
const hasSelf = fullyQualifiedName.includes(':');
|
|
5
7
|
const normalizedFullyQualifiedName = fullyQualifiedName.replace(':', '.');
|
|
@@ -8,18 +10,19 @@ export const parseFunctionSignature = (signature)=>{
|
|
|
8
10
|
const namespaces = segments.slice(0, -1);
|
|
9
11
|
const params = paramString.split(')')[0].split(',').filter(Boolean);
|
|
10
12
|
// Find if there's any optional parameter
|
|
11
|
-
const firstOptionalIndex = params.findIndex((param)=>param.includes('[') || param.includes(']'));
|
|
13
|
+
const firstOptionalIndex = params.findIndex((param) => param.includes('[') || param.includes(']'));
|
|
12
14
|
return {
|
|
13
15
|
signature,
|
|
14
16
|
name: functionName,
|
|
15
17
|
namespaces,
|
|
16
|
-
parameters: params.map((eachParam, index)=>({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
parameters: params.map((eachParam, index) => ({
|
|
19
|
+
name: eachParam.replace(/\[/g, '').replace(/]/g, '').trim(),
|
|
20
|
+
// Parameter is not required if it has brackets or comes after an optional parameter
|
|
21
|
+
required: firstOptionalIndex === -1
|
|
22
|
+
? !eachParam.includes('[') && !eachParam.includes(']')
|
|
23
|
+
: index < firstOptionalIndex,
|
|
24
|
+
})),
|
|
25
|
+
hasSelf,
|
|
22
26
|
};
|
|
23
27
|
};
|
|
24
|
-
|
|
25
28
|
//# sourceMappingURL=parseFunctionSignature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/parseFunctionSignature.ts"],"
|
|
1
|
+
{"version":3,"file":"parseFunctionSignature.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/fn/parseFunctionSignature.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACxD,MAAM,mBAAmB,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC/C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,GAAG,SAAS,IAAI,CAAC;IAEvB,MAAM,CAAC,kBAAkB,EAAE,WAAW,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzE,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,4BAA4B,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1E,MAAM,QAAQ,G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n/getHtmlForVersion.js';
|
|
3
|
-
export const useFetchHtml = (version)=>{
|
|
4
|
+
export const useFetchHtml = (version) => {
|
|
4
5
|
const [html, setHtml] = useState(null);
|
|
5
|
-
const fetchHtml = useMemo(()=>{
|
|
6
|
+
const fetchHtml = useMemo(() => {
|
|
6
7
|
return {
|
|
7
8
|
waitingDescription: 'Waiting to fetch HTML contents',
|
|
8
9
|
errorDescription: 'Failed to fetch HTML contents',
|
|
9
|
-
finishedDescription: ()=>'HTML contents fetched',
|
|
10
|
+
finishedDescription: () => 'HTML contents fetched',
|
|
10
11
|
runningDescription: 'Fetching HTML contents...',
|
|
11
|
-
runner:
|
|
12
|
+
runner: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
13
|
if (!version) {
|
|
13
14
|
throw new Error('Version is not set');
|
|
14
15
|
}
|
|
15
16
|
return getHtmlForVersion(version);
|
|
16
|
-
},
|
|
17
|
-
onFinish: (result)=>{
|
|
17
|
+
}),
|
|
18
|
+
onFinish: (result) => {
|
|
18
19
|
setHtml(result === false ? null : result);
|
|
19
20
|
},
|
|
20
|
-
ready: version !== null
|
|
21
|
+
ready: version !== null,
|
|
21
22
|
};
|
|
22
|
-
}, [
|
|
23
|
-
version
|
|
24
|
-
]);
|
|
23
|
+
}, [version]);
|
|
25
24
|
return {
|
|
26
25
|
html,
|
|
27
|
-
fetchHtml
|
|
26
|
+
fetchHtml,
|
|
28
27
|
};
|
|
29
28
|
};
|
|
30
|
-
|
|
31
29
|
//# sourceMappingURL=useFetchHtml.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useFetchHtml.ts"],"
|
|
1
|
+
{"version":3,"file":"useFetchHtml.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useFetchHtml.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAGzF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAsB,EAAE,EAAE;IACnD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAEtD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,OAAO;YACH,kBAAkB,EAAE,gCAAgC;YACpD,gBAAgB,EAAE,+BAA+B;YACjD,mBAAmB,EAAE,GAAG,EAAE,CAAC,uBAAuB;YAClD,kBAAkB,EAAE,2BAA2B;YAC/C,MAAM,EAAE,GAAS,EAAE;gBACf,IAAI,CAAC,OAAO,EAAE,CAAC;oBACX,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBAC1C,CAAC;gBAED,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACtC,CAAC,CAAA;YACD,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;gBACjB,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAC9C,CAAC;YACD,KAAK,EAAE,OAAO,KAAK,IAAI;SACM,CAAC;IACtC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO;QACH,IAAI;QACJ,SAAS;KACZ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,70 +1,64 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
1
2
|
import { execSync } from 'node:child_process';
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
|
-
export const useFormatTypeFile = (path)=>{
|
|
4
|
-
const formatTypeFile = useMemo(()=>{
|
|
4
|
+
export const useFormatTypeFile = (path) => {
|
|
5
|
+
const formatTypeFile = useMemo(() => {
|
|
5
6
|
// Check if prettier and eslint are available
|
|
6
|
-
const checkToolsAvailability = ()=>{
|
|
7
|
+
const checkToolsAvailability = () => {
|
|
7
8
|
let hasPrettier = false;
|
|
8
9
|
let hasEslint = false;
|
|
9
10
|
try {
|
|
10
11
|
// Check if prettier is available
|
|
11
|
-
execSync('pnpm exec prettier --version', {
|
|
12
|
-
stdio: 'ignore'
|
|
13
|
-
});
|
|
12
|
+
execSync('pnpm exec prettier --version', { stdio: 'ignore' });
|
|
14
13
|
hasPrettier = true;
|
|
15
|
-
}
|
|
16
|
-
|
|
14
|
+
}
|
|
15
|
+
catch (_error) {
|
|
16
|
+
// Prettier not available
|
|
17
17
|
}
|
|
18
18
|
try {
|
|
19
19
|
// Check if eslint is available
|
|
20
|
-
execSync('pnpm exec eslint --version', {
|
|
21
|
-
stdio: 'ignore'
|
|
22
|
-
});
|
|
20
|
+
execSync('pnpm exec eslint --version', { stdio: 'ignore' });
|
|
23
21
|
hasEslint = true;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
// ESLint not available
|
|
26
22
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
23
|
+
catch (_error) {
|
|
24
|
+
// ESLint not available
|
|
25
|
+
}
|
|
26
|
+
return { hasPrettier, hasEslint };
|
|
31
27
|
};
|
|
32
28
|
const { hasPrettier, hasEslint } = checkToolsAvailability();
|
|
33
29
|
return {
|
|
34
30
|
waitingDescription: 'Waiting to format the type file...',
|
|
35
31
|
errorDescription: 'Failed to format the type file',
|
|
36
|
-
finishedDescription: ()=>'Type file formatted',
|
|
32
|
+
finishedDescription: () => 'Type file formatted',
|
|
37
33
|
runningDescription: 'Formatting the type file...',
|
|
38
|
-
runner:
|
|
34
|
+
runner: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
35
|
try {
|
|
40
36
|
// Run prettier on the generated file if available
|
|
41
37
|
if (hasPrettier) {
|
|
42
38
|
execSync(`pnpm exec prettier --write "${path}"`, {
|
|
43
|
-
stdio: 'ignore'
|
|
39
|
+
stdio: 'ignore',
|
|
44
40
|
});
|
|
45
41
|
}
|
|
46
42
|
// Run eslint if available
|
|
47
43
|
if (hasEslint) {
|
|
48
44
|
execSync(`pnpm exec eslint --fix "${path}"`, {
|
|
49
|
-
stdio: 'ignore'
|
|
45
|
+
stdio: 'ignore',
|
|
50
46
|
});
|
|
51
47
|
}
|
|
52
48
|
return true;
|
|
53
|
-
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
54
51
|
console.error('Error formatting file:', error);
|
|
55
52
|
return false;
|
|
56
53
|
}
|
|
57
|
-
},
|
|
54
|
+
}),
|
|
58
55
|
ready: true,
|
|
59
56
|
// Skip only if both tools are unavailable
|
|
60
|
-
skip: !hasPrettier && !hasEslint
|
|
57
|
+
skip: !hasPrettier && !hasEslint,
|
|
61
58
|
};
|
|
62
|
-
}, [
|
|
63
|
-
path
|
|
64
|
-
]);
|
|
59
|
+
}, [path]);
|
|
65
60
|
return {
|
|
66
|
-
formatTypeFile
|
|
61
|
+
formatTypeFile,
|
|
67
62
|
};
|
|
68
63
|
};
|
|
69
|
-
|
|
70
64
|
//# sourceMappingURL=useFormatTypeFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useFormatTypeFile.ts"],"
|
|
1
|
+
{"version":3,"file":"useFormatTypeFile.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useFormatTypeFile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;IAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,6CAA6C;QAC7C,MAAM,sBAAsB,GAAG,GAAG,EAAE;YAChC,IAAI,WAAW,GAAG,KAAK,CAAC;YACxB,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,IAA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;YACD,KAAK,EAAE,IAAI;YACX,0CAA0C;YAC1C,IAAI,EAAE,CAAC,WAAW,IAAI,CAAC,SAAS;SACF,CAAC;IACvC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO;QACH,cAAc;KACjB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createTypeProvider } from '../../../commands/GenerateTypes/utils/createTypeProvider.js';
|
|
2
|
-
import { ApiDefinitions } from '../../../types.js';
|
|
1
|
+
import type { createTypeProvider } from '../../../commands/GenerateTypes/utils/createTypeProvider.js';
|
|
2
|
+
import type { ApiDefinitions } from '../../../types.js';
|
|
3
3
|
export declare const useGenerateTypeFile: (path: string, definitions: ApiDefinitions | null, typeProvider: ReturnType<typeof createTypeProvider> | null) => {
|
|
4
4
|
generateTypeFile: {
|
|
5
5
|
waitingDescription: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
2
|
import { writeFileSync } from 'node:fs';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { ModuleDeclarationKind, Project, VariableDeclarationKind } from 'ts-morph';
|
|
4
|
+
import { ModuleDeclarationKind, Project, VariableDeclarationKind, } from 'ts-morph';
|
|
5
5
|
import { TypescriptReservedNamed } from '../../../constants.js';
|
|
6
|
-
export const useGenerateTypeFile = (path, definitions, typeProvider)=>{
|
|
7
|
-
const generateTypeFile = useMemo(()=>{
|
|
6
|
+
export const useGenerateTypeFile = (path, definitions, typeProvider) => {
|
|
7
|
+
const generateTypeFile = useMemo(() => {
|
|
8
8
|
return {
|
|
9
9
|
waitingDescription: 'Waiting to generate the type file...',
|
|
10
10
|
errorDescription: 'Failed to generate the type file',
|
|
11
|
-
finishedDescription: ()=>'Type file generated',
|
|
11
|
+
finishedDescription: () => 'Type file generated',
|
|
12
12
|
runningDescription: 'Generating the type file...',
|
|
13
|
-
runner:
|
|
13
|
+
runner: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
14
|
if (!definitions) {
|
|
15
15
|
throw new Error('Definitions are not set');
|
|
16
16
|
}
|
|
@@ -19,133 +19,102 @@ export const useGenerateTypeFile = (path, definitions, typeProvider)=>{
|
|
|
19
19
|
}
|
|
20
20
|
const project = new Project();
|
|
21
21
|
const typeFile = project.createSourceFile(path, '', {
|
|
22
|
-
overwrite: true
|
|
22
|
+
overwrite: true,
|
|
23
23
|
});
|
|
24
24
|
const globalNamespace = definitions.global;
|
|
25
25
|
typeFile.addStatements(typeProvider.getGlobalStatements());
|
|
26
26
|
const globalModule = typeFile.addModule({
|
|
27
27
|
name: 'global',
|
|
28
28
|
hasDeclareKeyword: true,
|
|
29
|
-
declarationKind: ModuleDeclarationKind.Global
|
|
29
|
+
declarationKind: ModuleDeclarationKind.Global,
|
|
30
30
|
});
|
|
31
31
|
generateNamespace(globalNamespace, globalModule, typeProvider, '');
|
|
32
32
|
writeFileSync(path, typeFile.getFullText().replace('*/', '*/\n'));
|
|
33
|
-
},
|
|
34
|
-
ready: definitions !== null && typeProvider !== null
|
|
33
|
+
}),
|
|
34
|
+
ready: definitions !== null && typeProvider !== null,
|
|
35
35
|
};
|
|
36
|
-
}, [
|
|
37
|
-
definitions,
|
|
38
|
-
typeProvider
|
|
39
|
-
]);
|
|
36
|
+
}, [definitions, typeProvider, path]);
|
|
40
37
|
return {
|
|
41
|
-
generateTypeFile
|
|
38
|
+
generateTypeFile,
|
|
42
39
|
};
|
|
43
40
|
};
|
|
44
|
-
const generateNamespace = (apiObject, incomingSubject, typeProvider, namespace, name)=>{
|
|
41
|
+
const generateNamespace = (apiObject, incomingSubject, typeProvider, namespace, name) => {
|
|
45
42
|
let subject = incomingSubject;
|
|
46
|
-
const fullNamespaceName = [
|
|
47
|
-
namespace,
|
|
48
|
-
name
|
|
49
|
-
].filter(Boolean).join('.');
|
|
43
|
+
const fullNamespaceName = [namespace, name].filter(Boolean).join('.');
|
|
50
44
|
if (name) {
|
|
51
45
|
subject = incomingSubject.addModule({
|
|
52
|
-
name
|
|
46
|
+
name,
|
|
53
47
|
});
|
|
54
48
|
}
|
|
55
49
|
if (name === 'playdate') {
|
|
56
50
|
subject.addStatements(typeProvider.getStatements());
|
|
57
51
|
}
|
|
58
|
-
for (const constant of typeProvider.getConstants(fullNamespaceName)){
|
|
52
|
+
for (const constant of typeProvider.getConstants(fullNamespaceName)) {
|
|
59
53
|
subject.addVariableStatement({
|
|
60
|
-
declarations: [
|
|
61
|
-
constant
|
|
62
|
-
],
|
|
54
|
+
declarations: [constant],
|
|
63
55
|
isExported: true,
|
|
64
|
-
declarationKind: VariableDeclarationKind.Const
|
|
56
|
+
declarationKind: VariableDeclarationKind.Const,
|
|
65
57
|
});
|
|
66
58
|
}
|
|
67
|
-
for (const func of apiObject.functions){
|
|
59
|
+
for (const func of apiObject.functions) {
|
|
68
60
|
const isFunctionNameReserved = TypescriptReservedNamed.includes(func.name);
|
|
69
61
|
const resolvedName = `_${func.name}`;
|
|
70
62
|
const parameters = typeProvider.getParameters(func);
|
|
71
|
-
subject.addFunction(
|
|
72
|
-
name: isFunctionNameReserved ? resolvedName : func.name,
|
|
73
|
-
docs: [
|
|
74
|
-
func.docs
|
|
75
|
-
],
|
|
76
|
-
parameters,
|
|
77
|
-
returnType: typeProvider.getFunctionReturnType(func),
|
|
78
|
-
isExported: !!name
|
|
79
|
-
}, typeProvider.getFunctionOverrideOptions(func)));
|
|
63
|
+
subject.addFunction(Object.assign({ name: isFunctionNameReserved ? resolvedName : func.name, docs: [func.docs], parameters, returnType: typeProvider.getFunctionReturnType(func), isExported: !!name }, typeProvider.getFunctionOverrideOptions(func)));
|
|
80
64
|
if (isFunctionNameReserved) {
|
|
81
65
|
subject.addExportDeclaration({
|
|
82
66
|
leadingTrivia: '/** @ts-ignore */\n',
|
|
83
67
|
namedExports: [
|
|
84
68
|
{
|
|
85
69
|
name: resolvedName,
|
|
86
|
-
alias: func.name
|
|
87
|
-
}
|
|
88
|
-
]
|
|
70
|
+
alias: func.name,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
89
73
|
});
|
|
90
74
|
}
|
|
91
75
|
}
|
|
92
76
|
let propertiesSubject = null;
|
|
93
77
|
if (name && apiObject.methods.length > 0) {
|
|
94
|
-
const typeClass = incomingSubject.addClass(
|
|
95
|
-
name,
|
|
96
|
-
isExported: true
|
|
97
|
-
}, typeProvider.getClassOptions(fullNamespaceName)));
|
|
78
|
+
const typeClass = incomingSubject.addClass(Object.assign({ name, isExported: true }, typeProvider.getClassOptions(fullNamespaceName)));
|
|
98
79
|
propertiesSubject = typeClass;
|
|
99
|
-
for (const method of apiObject.methods){
|
|
80
|
+
for (const method of apiObject.methods) {
|
|
100
81
|
const parameters = typeProvider.getParameters(method);
|
|
101
|
-
typeClass.addMethod(
|
|
102
|
-
name: method.name,
|
|
103
|
-
docs: [
|
|
104
|
-
method.docs
|
|
105
|
-
],
|
|
106
|
-
parameters,
|
|
107
|
-
returnType: typeProvider.getFunctionReturnType(method)
|
|
108
|
-
}, typeProvider.getFunctionOverrideOptions(method)));
|
|
82
|
+
typeClass.addMethod(Object.assign({ name: method.name, docs: [method.docs], parameters, returnType: typeProvider.getFunctionReturnType(method) }, typeProvider.getFunctionOverrideOptions(method)));
|
|
109
83
|
}
|
|
110
84
|
}
|
|
111
|
-
const dynamicProperties = typeProvider
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
]){
|
|
85
|
+
const dynamicProperties = typeProvider
|
|
86
|
+
.getDynamicProperties(`${namespace}.${name}`)
|
|
87
|
+
.map((dynamicProperty) => ({
|
|
88
|
+
name: dynamicProperty.name,
|
|
89
|
+
docs: dynamicProperty.docs,
|
|
90
|
+
namespaces: namespace.split('.'),
|
|
91
|
+
signature: `${namespace}.${name}.${dynamicProperty.name}`,
|
|
92
|
+
}));
|
|
93
|
+
for (const property of [...apiObject.properties, ...dynamicProperties]) {
|
|
121
94
|
const propertyDetails = typeProvider.getPropertyDetails(property);
|
|
122
95
|
if (propertiesSubject) {
|
|
123
96
|
propertiesSubject.addProperty({
|
|
124
97
|
name: property.name,
|
|
125
|
-
docs: [
|
|
126
|
-
property.docs
|
|
127
|
-
],
|
|
98
|
+
docs: [property.docs],
|
|
128
99
|
type: propertyDetails.type,
|
|
129
100
|
isStatic: propertyDetails.isStatic,
|
|
130
|
-
isReadonly: propertyDetails.isReadonly
|
|
101
|
+
isReadonly: propertyDetails.isReadonly,
|
|
131
102
|
});
|
|
132
|
-
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
133
105
|
subject.addVariableStatement({
|
|
134
|
-
docs: [
|
|
135
|
-
property.docs
|
|
136
|
-
],
|
|
106
|
+
docs: [property.docs],
|
|
137
107
|
declarations: [
|
|
138
108
|
{
|
|
139
109
|
name: property.name,
|
|
140
|
-
type: propertyDetails.type
|
|
141
|
-
}
|
|
142
|
-
]
|
|
110
|
+
type: propertyDetails.type,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
143
113
|
});
|
|
144
114
|
}
|
|
145
115
|
}
|
|
146
|
-
for (const eachNamespace of Object.entries(apiObject.namespaces)){
|
|
116
|
+
for (const eachNamespace of Object.entries(apiObject.namespaces)) {
|
|
147
117
|
generateNamespace(eachNamespace[1], subject, typeProvider, fullNamespaceName, eachNamespace[0]);
|
|
148
118
|
}
|
|
149
119
|
};
|
|
150
|
-
|
|
151
120
|
//# sourceMappingURL=useGenerateTypeFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useGenerateTypeFile.ts"],"sourcesContent":["import { writeFileSync } from 'node:fs';\nimport { useMemo } from 'react';\nimport {\n ClassDeclaration,\n FunctionDeclarationStructure,\n MethodDeclarationStructure,\n ModuleDeclaration,\n ModuleDeclarationKind,\n Project,\n SourceFile,\n VariableDeclarationKind,\n} from 'ts-morph';\nimport { createTypeProvider } from '@/cli/commands/GenerateTypes/utils/createTypeProvider.js';\nimport { TypescriptReservedNamed } from '@/cli/constants.js';\nimport {\n ApiDefinitions,\n ApiObject,\n CheckListItem,\n PropertyDescription,\n} from '@/cli/types.js';\n\nexport const useGenerateTypeFile = (\n path: string,\n definitions: ApiDefinitions | null,\n typeProvider: ReturnType<typeof createTypeProvider> | 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 if (!typeProvider) {\n throw new Error('Type provider is not set');\n }\n\n const project = new Project();\n const typeFile = project.createSourceFile(path, '', {\n overwrite: true,\n });\n\n const globalNamespace = definitions.global;\n\n typeFile.addStatements(typeProvider.getGlobalStatements());\n const globalModule = typeFile.addModule({\n name: 'global',\n hasDeclareKeyword: true,\n declarationKind: ModuleDeclarationKind.Global,\n });\n\n generateNamespace(\n globalNamespace,\n globalModule,\n typeProvider,\n '',\n );\n\n writeFileSync(\n path,\n typeFile.getFullText().replace('*/', '*/\\n'),\n );\n },\n ready: definitions !== null && typeProvider !== null,\n } satisfies CheckListItem<void>;\n }, [definitions, typeProvider]);\n\n return {\n generateTypeFile,\n };\n};\n\nconst generateNamespace = (\n apiObject: ApiObject,\n incomingSubject: SourceFile | ModuleDeclaration,\n typeProvider: ReturnType<typeof createTypeProvider>,\n namespace: string,\n name?: string,\n) => {\n let subject = incomingSubject;\n const fullNamespaceName = [namespace, name].filter(Boolean).join('.');\n\n if (name) {\n subject = incomingSubject.addModule({\n name,\n });\n }\n\n if (name === 'playdate') {\n subject.addStatements(typeProvider.getStatements());\n }\n\n for (const constant of typeProvider.getConstants(fullNamespaceName)) {\n subject.addVariableStatement({\n declarations: [constant],\n isExported: true,\n declarationKind: VariableDeclarationKind.Const,\n });\n }\n\n for (const func of apiObject.functions) {\n const isFunctionNameReserved = TypescriptReservedNamed.includes(\n func.name,\n );\n const resolvedName = `_${func.name}`;\n const parameters = typeProvider.getParameters(func);\n\n subject.addFunction({\n name: isFunctionNameReserved ? resolvedName : func.name,\n docs: [func.docs],\n parameters,\n returnType: typeProvider.getFunctionReturnType(func),\n isExported: !!name,\n ...(typeProvider.getFunctionOverrideOptions(\n func,\n ) as FunctionDeclarationStructure),\n });\n\n if (isFunctionNameReserved) {\n subject.addExportDeclaration({\n leadingTrivia: '/** @ts-ignore */\\n',\n namedExports: [\n {\n name: resolvedName,\n alias: func.name,\n },\n ],\n });\n }\n }\n\n let propertiesSubject: ClassDeclaration | null = null;\n\n if (name && apiObject.methods.length > 0) {\n const typeClass = incomingSubject.addClass({\n name,\n isExported: true,\n ...typeProvider.getClassOptions(fullNamespaceName),\n });\n propertiesSubject = typeClass;\n\n for (const method of apiObject.methods) {\n const parameters = typeProvider.getParameters(method);\n\n typeClass.addMethod({\n name: method.name,\n docs: [method.docs],\n parameters,\n returnType: typeProvider.getFunctionReturnType(method),\n ...(typeProvider.getFunctionOverrideOptions(\n method,\n ) as Partial<MethodDeclarationStructure>),\n });\n }\n }\n\n const dynamicProperties = typeProvider\n .getDynamicProperties(`${namespace}.${name}`)\n .map(\n dynamicProperty =>\n ({\n name: dynamicProperty.name,\n docs: dynamicProperty.docs,\n namespaces: namespace.split('.'),\n signature: `${namespace}.${name}.${dynamicProperty.name}`,\n } satisfies PropertyDescription),\n );\n\n for (const property of [...apiObject.properties, ...dynamicProperties]) {\n const propertyDetails = typeProvider.getPropertyDetails(property);\n\n if (propertiesSubject) {\n propertiesSubject.addProperty({\n name: property.name,\n docs: [property.docs],\n type: propertyDetails.type,\n isStatic: propertyDetails.isStatic,\n isReadonly: propertyDetails.isReadonly,\n });\n } else {\n subject.addVariableStatement({\n docs: [property.docs],\n declarations: [\n {\n name: property.name,\n type: propertyDetails.type,\n },\n ],\n });\n }\n }\n\n for (const eachNamespace of Object.entries(apiObject.namespaces)) {\n generateNamespace(\n eachNamespace[1],\n subject,\n typeProvider,\n fullNamespaceName,\n eachNamespace[0],\n );\n }\n};\n"],"names":["writeFileSync","useMemo","ModuleDeclarationKind","Project","VariableDeclarationKind","TypescriptReservedNamed","useGenerateTypeFile","path","definitions","typeProvider","generateTypeFile","waitingDescription","errorDescription","finishedDescription","runningDescription","runner","Error","project","typeFile","createSourceFile","overwrite","globalNamespace","global","addStatements","getGlobalStatements","globalModule","addModule","name","hasDeclareKeyword","declarationKind","Global","generateNamespace","getFullText","replace","ready","apiObject","incomingSubject","namespace","subject","fullNamespaceName","filter","Boolean","join","getStatements","constant","getConstants","addVariableStatement","declarations","isExported","Const","func","functions","isFunctionNameReserved","includes","resolvedName","parameters","getParameters","addFunction","docs","returnType","getFunctionReturnType","getFunctionOverrideOptions","addExportDeclaration","leadingTrivia","namedExports","alias","propertiesSubject","methods","length","typeClass","addClass","getClassOptions","method","addMethod","dynamicProperties","getDynamicProperties","map","dynamicProperty","namespaces","split","signature","property","properties","propertyDetails","getPropertyDetails","addProperty","type","isStatic","isReadonly","eachNamespace","Object","entries"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,aAAa,QAAQ,UAAU;AACxC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAKIC,qBAAqB,EACrBC,OAAO,EAEPC,uBAAuB,QACpB,WAAW;AAElB,SAASC,uBAAuB,QAAQ,qBAAqB;AAQ7D,OAAO,MAAMC,sBAAsB,CAC/BC,MACAC,aACAC;IAEA,MAAMC,mBAAmBT,QAAQ;QAC7B,OAAO;YACHU,oBAAoB;YACpBC,kBAAkB;YAClBC,qBAAqB,IAAM;YAC3BC,oBAAoB;YACpBC,QAAQ;g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UAAU,CAAC,EAAEV,KAAK,CAAC,EAAEkD,gBAAgBlD,IAAI,CAAC,CAAC;QAC7D,CAAA;IAGZ,KAAK,MAAMsD,YAAY;WAAI9C,UAAU+C,UAAU;WAAKR;KAAkB,CAAE;QACpE,MAAMS,kBAAkB1E,aAAa2E,kBAAkB,CAACH;QAExD,IAAIf,mBAAmB;YACnBA,kBAAkBmB,WAAW,CAAC;gBAC1B1D,MAAMsD,SAAStD,IAAI;gBACnB+B,MAAM;oBAACuB,SAASvB,IAAI;iBAAC;gBACrB4B,MAAMH,gBAAgBG,IAAI;gBAC1BC,UAAUJ,gBAAgBI,QAAQ;gBAClCC,YAAYL,gBAAgBK,UAAU;YAC1C;QACJ,OAAO;YACHlD,QAAQQ,oBAAoB,CAAC;gBACzBY,MAAM;oBAACuB,SAASvB,IAAI;iBAAC;gBACrBX,cAAc;oBACV;wBACIpB,MAAMsD,SAAStD,IAAI;wBACnB2D,MAAMH,gBAAgBG,IAAI;oBAC9B;iBACH;YACL;QACJ;IACJ;IAEA,KAAK,MAAMG,iBAAiBC,OAAOC,OAAO,CAACxD,UAAU2C,UAAU,EAAG;QAC9D/C,kBACI0D,aAAa,CAAC,EAAE,EAChBnD,SACA7B,cACA8B,mBACAkD,aAAa,CAAC,EAAE;IAExB;AACJ"}
|
|
1
|
+
{"version":3,"file":"useGenerateTypeFile.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/commands/GenerateTypes/hooks/useGenerateTypeFile.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAKH,qBAAqB,EACrB,OAAO,EAEP,uBAAuB,GAC1B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAQ7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAC/B,IAAY,EACZ,WAAkC,EAClC,YAA0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