crankscript 0.17.0 → 0.18.0-beta.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/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.js +20 -28
- package/src/commands/TranspileCommand/TranspileCommand.js.map +1 -1
- package/src/commands/TranspileCommand/components/Transpile.d.ts +2 -2
- package/src/commands/TranspileCommand/components/Transpile.js +3 -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 +2 -2
- package/src/commands/TranspileCommand/fn/transpile.js +15 -17
- 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 +4 -4
- package/src/commands/TranspileCommand/hooks/useTranspileTasks.js +34 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
# crankscript
|
|
2
2
|
|
|
3
|
+
## 0.18.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#72](https://github.com/crankscript/crankscript/pull/72) [`bdd37c9`](https://github.com/crankscript/crankscript/commit/bdd37c901aaff9b20bcabe6d1dabf43342f1b4bb) Thanks [@alberteddu](https://github.com/alberteddu)! - introduce `test` command for Lua runtime testing
|
|
8
|
+
|
|
3
9
|
## 0.17.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
6
12
|
|
|
7
|
-
-
|
|
13
|
+
- [`111f7f8`](https://github.com/crankscript/crankscript/commit/111f7f89dda1976bf12411ed56e62e849453abe3) Thanks [@alberteddu](https://github.com/alberteddu)! - add types for 2.7.5 and fix 2.7.4
|
|
8
14
|
|
|
9
15
|
## 0.16.1
|
|
10
16
|
|
|
11
17
|
### Patch Changes
|
|
12
18
|
|
|
13
|
-
-
|
|
19
|
+
- [`a10781b`](https://github.com/crankscript/crankscript/commit/a10781ba378686468d51dda68b65480b7af56934) Thanks [@alberteddu](https://github.com/alberteddu)! - fix bug where keyboard must be always imported
|
|
14
20
|
|
|
15
21
|
## 0.16.0
|
|
16
22
|
|
|
17
23
|
### Minor Changes
|
|
18
24
|
|
|
19
|
-
-
|
|
25
|
+
- [#66](https://github.com/crankscript/crankscript/pull/66) [`d25e342`](https://github.com/crankscript/crankscript/commit/d25e3427ea07c4a6c4f76931f89f2a5a2e2c7a4f) Thanks [@alberteddu](https://github.com/alberteddu)! - update types to Playdate SDK 2.7.4
|
|
20
26
|
|
|
21
27
|
## 0.15.3
|
|
22
28
|
|
|
23
29
|
### Patch Changes
|
|
24
30
|
|
|
25
|
-
-
|
|
31
|
+
- [#64](https://github.com/crankscript/crankscript/pull/64) [`f771b7a`](https://github.com/crankscript/crankscript/commit/f771b7a9414fcca89ac2e50cda85d171e127927e) Thanks [@alberteddu](https://github.com/alberteddu)! - abstract methods do not cause transpilation to fail anymore
|
|
26
32
|
|
|
27
33
|
## 0.15.0
|
|
28
34
|
|
|
29
35
|
### Minor Changes
|
|
30
36
|
|
|
31
|
-
-
|
|
37
|
+
- [`a25ad06`](https://github.com/crankscript/crankscript/commit/a25ad06575995c2e39a8352586a81d72d8cc1199) Thanks [@alberteddu](https://github.com/alberteddu)! - Add crankscript simulator support for standalone files with `crankscript simulator file.ts`
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImportMap = void 0;
|
|
4
|
+
class ImportMap {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.imports = new Set();
|
|
7
|
+
// Needed for now: https://github.com/crankscript/crankscript/issues/67
|
|
8
|
+
this.add('keyboard');
|
|
9
9
|
}
|
|
10
|
-
});
|
|
11
|
-
let ImportMap = class ImportMap {
|
|
12
10
|
toArray() {
|
|
13
11
|
return Array.from(this.imports);
|
|
14
12
|
}
|
|
@@ -19,67 +17,30 @@ let ImportMap = class ImportMap {
|
|
|
19
17
|
this.imports.add(importName);
|
|
20
18
|
}
|
|
21
19
|
processName(name) {
|
|
22
|
-
for (const [key, value] of Object.entries(ImportMap.map)){
|
|
20
|
+
for (const [key, value] of Object.entries(ImportMap.map)) {
|
|
23
21
|
if (value.has(name)) {
|
|
24
22
|
this.add(key);
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// Needed for now: https://github.com/crankscript/crankscript/issues/67
|
|
31
|
-
this.add('keyboard');
|
|
32
|
-
}
|
|
33
|
-
};
|
|
26
|
+
}
|
|
27
|
+
exports.ImportMap = ImportMap;
|
|
34
28
|
ImportMap.map = {
|
|
35
|
-
graphics: new Set([
|
|
36
|
-
|
|
37
|
-
]),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
]),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
]),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
]),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
]),
|
|
50
|
-
|
|
51
|
-
'easingFunctions'
|
|
52
|
-
]),
|
|
53
|
-
nineSlice: new Set([
|
|
54
|
-
'nineSlice'
|
|
55
|
-
]),
|
|
56
|
-
qrcode: new Set([
|
|
57
|
-
'generateQRCode'
|
|
58
|
-
]),
|
|
59
|
-
animation: new Set([
|
|
60
|
-
'animation'
|
|
61
|
-
]),
|
|
62
|
-
animator: new Set([
|
|
63
|
-
'animator'
|
|
64
|
-
]),
|
|
65
|
-
keyboard: new Set([
|
|
66
|
-
'keyboard'
|
|
67
|
-
]),
|
|
68
|
-
math: new Set([
|
|
69
|
-
'math'
|
|
70
|
-
]),
|
|
71
|
-
string: new Set([
|
|
72
|
-
'string'
|
|
73
|
-
]),
|
|
74
|
-
timer: new Set([
|
|
75
|
-
'timer'
|
|
76
|
-
]),
|
|
77
|
-
frameTimer: new Set([
|
|
78
|
-
'frameTimer'
|
|
79
|
-
]),
|
|
80
|
-
ui: new Set([
|
|
81
|
-
'ui'
|
|
82
|
-
])
|
|
29
|
+
graphics: new Set(['graphics']),
|
|
30
|
+
sprites: new Set(['sprite']),
|
|
31
|
+
crank: new Set(['getCrankTicks']),
|
|
32
|
+
object: new Set(['printTable']),
|
|
33
|
+
'utilities/where': new Set(['where']),
|
|
34
|
+
easing: new Set(['easingFunctions']),
|
|
35
|
+
nineSlice: new Set(['nineSlice']),
|
|
36
|
+
qrcode: new Set(['generateQRCode']),
|
|
37
|
+
animation: new Set(['animation']),
|
|
38
|
+
animator: new Set(['animator']),
|
|
39
|
+
keyboard: new Set(['keyboard']),
|
|
40
|
+
math: new Set(['math']),
|
|
41
|
+
string: new Set(['string']),
|
|
42
|
+
timer: new Set(['timer']),
|
|
43
|
+
frameTimer: new Set(['frameTimer']),
|
|
44
|
+
ui: new Set(['ui']),
|
|
83
45
|
};
|
|
84
|
-
|
|
85
46
|
//# sourceMappingURL=ImportMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"ImportMap.js","sourceRoot":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,WAAW,CAAC,CAAC;IACjC,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACnC,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;IACjC,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/B,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC3B,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;IACzB,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;IACnC,EAAE,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;CACtB,AAjBiB,CAiBhB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
-
_export_star._(require("./ImportMap"), exports);
|
|
7
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ImportMap"), exports);
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/ImportMap/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
const _withAutomaticImportWarning = require("./withAutomaticImportWarning");
|
|
12
|
-
const getBeforeEmit = (importMap)=>{
|
|
13
|
-
return (_, __, ___, result)=>{
|
|
14
|
-
const importsString = importMap.map((importString)=>`import "CoreLibs/${importString}"`).join('\n');
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBeforeEmit = void 0;
|
|
4
|
+
const withAutomaticImportWarning_1 = require("./withAutomaticImportWarning");
|
|
5
|
+
const getBeforeEmit = (importMap) => {
|
|
6
|
+
return ((_, __, ___, result) => {
|
|
7
|
+
const importsString = importMap
|
|
8
|
+
.map(importString => `import "CoreLibs/${importString}"`)
|
|
9
|
+
.join('\n');
|
|
15
10
|
if (importsString.trim() === '') {
|
|
16
11
|
return;
|
|
17
12
|
}
|
|
18
|
-
result[0].code = (0,
|
|
19
|
-
};
|
|
13
|
+
result[0].code = (0, withAutomaticImportWarning_1.withAutomaticImportWarning)(importsString, result[0].code);
|
|
14
|
+
});
|
|
20
15
|
};
|
|
21
|
-
|
|
16
|
+
exports.getBeforeEmit = getBeforeEmit;
|
|
22
17
|
//# sourceMappingURL=getBeforeEmit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"getBeforeEmit.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/beforeEmit/getBeforeEmit.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAGnE,MAAM,aAAa,GAAG,CAAC,SAAoB,EAAE,EAAE;IAClD,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;QAC3B,MAAM,aAAa,GAAG,SAAS;aAC1B,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,oBAAoB,YAAY,GAAG,CAAC;aACxD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhB,IAAI,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9B,OAAO;QACX,CAAC;QAED,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAA,uDAA0B,EACvC,aAAa,EACb,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CACjB,CAAC;IACN,CAAC,CAAgC,CAAC;AACtC,CAAC,CAAC;AAfW,QAAA,aAAa,iBAexB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
-
_export_star._(require("./getBeforeEmit"), exports);
|
|
7
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./getBeforeEmit"), exports);
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/beforeEmit/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "withAutomaticImportWarning", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return withAutomaticImportWarning;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const withAutomaticImportWarning = (importsString, code)=>{
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withAutomaticImportWarning = void 0;
|
|
4
|
+
const withAutomaticImportWarning = (importsString, code) => {
|
|
12
5
|
return `-- These imports were added automatically\n\n${importsString}\n\n-- End of automatic imports\n\n${code}`;
|
|
13
6
|
};
|
|
14
|
-
|
|
7
|
+
exports.withAutomaticImportWarning = withAutomaticImportWarning;
|
|
15
8
|
//# sourceMappingURL=withAutomaticImportWarning.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"withAutomaticImportWarning.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/beforeEmit/withAutomaticImportWarning.ts"],"names":[],"mappings":";;;AAAO,MAAM,0BAA0B,GAAG,CACtC,aAAqB,EACrB,IAAY,EACd,EAAE;IACA,OAAO,gDAAgD,aAAa,sCAAsC,IAAI,EAAE,CAAC;AACrH,CAAC,CAAC;AALW,QAAA,0BAA0B,8BAKrC"}
|
package/assets/index.js
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const _ImportMap = require("./ImportMap");
|
|
15
|
-
const _transformCallExpression = require("./transformCallExpression");
|
|
16
|
-
const _transformClassDeclaration = require("./transformClassDeclaration");
|
|
17
|
-
const _transformNewExpression = require("./transformNewExpression");
|
|
18
|
-
const _transformPropertyAccessExpression = require("./transformPropertyAccessExpression");
|
|
19
|
-
const _transformSuperExpression = require("./transformSuperExpression");
|
|
20
|
-
const importMap = new _ImportMap.ImportMap();
|
|
21
|
-
const _default = {
|
|
22
|
-
beforeEmit: (0, _beforeEmit.getBeforeEmit)(importMap),
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ts = require("typescript");
|
|
4
|
+
const beforeEmit_1 = require("./beforeEmit");
|
|
5
|
+
const ImportMap_1 = require("./ImportMap");
|
|
6
|
+
const transformCallExpression_1 = require("./transformCallExpression");
|
|
7
|
+
const transformClassDeclaration_1 = require("./transformClassDeclaration");
|
|
8
|
+
const transformNewExpression_1 = require("./transformNewExpression");
|
|
9
|
+
const transformPropertyAccessExpression_1 = require("./transformPropertyAccessExpression");
|
|
10
|
+
const transformSuperExpression_1 = require("./transformSuperExpression");
|
|
11
|
+
const importMap = new ImportMap_1.ImportMap();
|
|
12
|
+
exports.default = {
|
|
13
|
+
beforeEmit: (0, beforeEmit_1.getBeforeEmit)(importMap),
|
|
23
14
|
visitors: {
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
}
|
|
15
|
+
[ts.SyntaxKind.ClassDeclaration]: (0, transformClassDeclaration_1.getTransformClassDeclaration)(importMap),
|
|
16
|
+
[ts.SyntaxKind.SuperKeyword]: transformSuperExpression_1.transformSuperExpression,
|
|
17
|
+
[ts.SyntaxKind.NewExpression]: transformNewExpression_1.transformNewExpression,
|
|
18
|
+
[ts.SyntaxKind.PropertyAccessExpression]: (0, transformPropertyAccessExpression_1.getTransformPropertyAccessExpression)(importMap),
|
|
19
|
+
[ts.SyntaxKind.CallExpression]: (0, transformCallExpression_1.getTransformCallExpression)(importMap),
|
|
20
|
+
},
|
|
30
21
|
};
|
|
31
|
-
|
|
32
22
|
//# sourceMappingURL=index.js.map
|
package/assets/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/tstl-plugin/src/index.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEjC,6CAA6C;AAC7C,2CAAwC;AACxC,uEAAuE;AACvE,2EAA2E;AAC3E,qEAAkE;AAClE,2FAA2F;AAC3F,yEAAsE;AAEtE,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAElC,kBAAe;IACX,UAAU,EAAE,IAAA,0BAAa,EAAC,SAAS,CAAC;IACpC,QAAQ,EAAE;QACN,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAC5B,IAAA,wDAA4B,EAAC,SAAS,CAAC;QAC3C,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,mDAAwB;QACtD,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,+CAAsB;QACrD,CAAC,EAAE,CAAC,UAAU,CAAC,wBAAwB,CAAC,EACpC,IAAA,wEAAoC,EAAC,SAAS,CAAC;QACnD,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,IAAA,oDAA0B,EAAC,SAAS,CAAC;KACxE;CACa,CAAC"}
|
|
@@ -1,29 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return getTransformCallExpression;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _typescript = /*#__PURE__*/ _interop_require_wildcard._(require("typescript"));
|
|
13
|
-
const getTransformCallExpression = (importMap)=>{
|
|
14
|
-
return (node, context)=>{
|
|
15
|
-
if (_typescript.isIdentifier(node.expression)) {
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTransformCallExpression = void 0;
|
|
4
|
+
const ts = require("typescript");
|
|
5
|
+
const getTransformCallExpression = (importMap) => {
|
|
6
|
+
return ((node, context) => {
|
|
7
|
+
if (ts.isIdentifier(node.expression)) {
|
|
16
8
|
importMap.processName(node.expression.escapedText.toString());
|
|
17
9
|
}
|
|
18
|
-
if (
|
|
10
|
+
if (ts.isPropertyAccessExpression(node.expression) &&
|
|
11
|
+
node.expression.expression.kind === ts.SyntaxKind.SuperKeyword) {
|
|
12
|
+
return context.superTransformExpression(node);
|
|
13
|
+
}
|
|
14
|
+
if (node.expression.kind === ts.SyntaxKind.SuperKeyword) {
|
|
15
|
+
const superPropertyAccess = ts.factory.createPropertyAccessExpression(ts.factory.createSuper(), 'init');
|
|
16
|
+
const newCallExpression = ts.factory.createCallExpression(superPropertyAccess, undefined, node.arguments);
|
|
17
|
+
return context.superTransformExpression(newCallExpression);
|
|
18
|
+
}
|
|
19
|
+
const typeChecker = context.program.getTypeChecker();
|
|
20
|
+
const callExpressionType = typeChecker.getTypeAtLocation(node.expression);
|
|
21
|
+
const callTypeString = typeChecker.typeToString(callExpressionType);
|
|
22
|
+
if (callTypeString.startsWith('PredictFunction<')) {
|
|
23
|
+
const sourceFile = node.getSourceFile();
|
|
24
|
+
const fileName = sourceFile.fileName;
|
|
25
|
+
const lineNumber = sourceFile.getLineAndCharacterOfPosition(node.getStart()).line +
|
|
26
|
+
1;
|
|
27
|
+
const newCallExpression = ts.factory.createCallExpression(node.expression, undefined, [
|
|
28
|
+
ts.factory.createStringLiteral(fileName),
|
|
29
|
+
ts.factory.createNumericLiteral(lineNumber.toString()),
|
|
30
|
+
...node.arguments,
|
|
31
|
+
]);
|
|
32
|
+
return context.superTransformExpression(newCallExpression);
|
|
33
|
+
}
|
|
34
|
+
if (ts.isPropertyAccessExpression(node.expression)) {
|
|
35
|
+
const typeChecker = context.program.getTypeChecker();
|
|
36
|
+
const methodType = typeChecker.getTypeAtLocation(node.expression);
|
|
37
|
+
const methodTypeString = typeChecker.typeToString(methodType);
|
|
38
|
+
if (methodTypeString.startsWith('PredictFunction<')) {
|
|
39
|
+
const sourceFile = node.getSourceFile();
|
|
40
|
+
const fileName = sourceFile.fileName;
|
|
41
|
+
const lineNumber = sourceFile.getLineAndCharacterOfPosition(node.getStart())
|
|
42
|
+
.line + 1;
|
|
43
|
+
const newCallExpression = ts.factory.createCallExpression(node.expression, undefined, [
|
|
44
|
+
ts.factory.createStringLiteral(fileName),
|
|
45
|
+
ts.factory.createNumericLiteral(lineNumber.toString()),
|
|
46
|
+
...node.arguments,
|
|
47
|
+
]);
|
|
48
|
+
return context.superTransformExpression(newCallExpression);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (ts.isIdentifier(node.expression) &&
|
|
52
|
+
node.expression.escapedText === 'require') {
|
|
19
53
|
const normalNode = context.superTransformExpression(node);
|
|
20
54
|
normalNode.expression.text = 'import';
|
|
21
55
|
normalNode.expression.originalName = 'import';
|
|
22
56
|
return normalNode;
|
|
23
|
-
}
|
|
57
|
+
}
|
|
58
|
+
else if (ts.isIdentifier(node.expression) &&
|
|
59
|
+
node.expression.escapedText === 'predict') {
|
|
60
|
+
const sourceFile = node.getSourceFile();
|
|
61
|
+
const fileName = sourceFile.fileName;
|
|
62
|
+
const lineNumber = sourceFile.getLineAndCharacterOfPosition(node.getStart()).line +
|
|
63
|
+
1;
|
|
64
|
+
const newCallExpression = ts.factory.createCallExpression(node.expression, undefined, [
|
|
65
|
+
...node.arguments,
|
|
66
|
+
ts.factory.createStringLiteral(fileName),
|
|
67
|
+
ts.factory.createNumericLiteral(lineNumber.toString()),
|
|
68
|
+
]);
|
|
69
|
+
return context.superTransformExpression(newCallExpression);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
24
72
|
return context.superTransformExpression(node);
|
|
25
73
|
}
|
|
26
|
-
};
|
|
74
|
+
});
|
|
27
75
|
};
|
|
28
|
-
|
|
76
|
+
exports.getTransformCallExpression = getTransformCallExpression;
|
|
29
77
|
//# sourceMappingURL=getTransformCallExpression.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"getTransformCallExpression.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/transformCallExpression/getTransformCallExpression.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAI1B,MAAM,0BAA0B,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC/D,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACtB,IAAI,EAAE,CAAC,YAAY,CAAC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8C,CAAC;AACpD,CAAC,CAAC;AAxHW,QAAA,0BAA0B,8BAwHrC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
-
_export_star._(require("./getTransformCallExpression"), exports);
|
|
7
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./getTransformCallExpression"), exports);
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/transformCallExpression/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C"}
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return createClassCall;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _typescripttolua = /*#__PURE__*/ _interop_require_wildcard._(require("typescript-to-lua"));
|
|
13
|
-
const createClassCall = (context, className, extendsNode)=>{
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createClassCall = void 0;
|
|
4
|
+
const tstl = require("typescript-to-lua");
|
|
5
|
+
const createClassCall = (context, className, extendsNode) => {
|
|
14
6
|
// class('X')
|
|
15
|
-
const classCall =
|
|
16
|
-
_typescripttolua.createStringLiteral(className.text)
|
|
17
|
-
]);
|
|
7
|
+
const classCall = tstl.createCallExpression(tstl.createIdentifier('class'), [tstl.createStringLiteral(className.text)]);
|
|
18
8
|
let classCreationExpression;
|
|
19
9
|
if (extendsNode) {
|
|
20
10
|
// class('X').extends(Blah)
|
|
21
|
-
classCreationExpression =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
classCreationExpression = _typescripttolua.createCallExpression(_typescripttolua.createTableIndexExpression(classCall, _typescripttolua.createStringLiteral('extends')), [
|
|
26
|
-
_typescripttolua.createIdentifier('Object')
|
|
27
|
-
]);
|
|
11
|
+
classCreationExpression = tstl.createCallExpression(tstl.createTableIndexExpression(classCall, tstl.createStringLiteral('extends')), [context.transformExpression(extendsNode.expression)]);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
classCreationExpression = tstl.createCallExpression(tstl.createTableIndexExpression(classCall, tstl.createStringLiteral('extends')), [tstl.createIdentifier('Object')]);
|
|
28
15
|
}
|
|
29
|
-
return
|
|
16
|
+
return tstl.createExpressionStatement(classCreationExpression);
|
|
30
17
|
};
|
|
31
|
-
|
|
18
|
+
exports.createClassCall = createClassCall;
|
|
32
19
|
//# sourceMappingURL=createClasCall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"createClasCall.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/transformClassDeclaration/createClasCall.ts"],"names":[],"mappings":";;;AACA,0CAA0C;AAEnC,MAAM,eAAe,GAAG,CAC3B,OAAmC,EACnC,SAA0B,EAC1B,WAA4C,EAC9B,EAAE;IAChB,aAAa;IACb,MAAM,SAAS,GAAG,IAAI,CAAC,oBAAoB,CACvC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAC9B,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAC7C,CAAC;IACF,IAAI,uBAAwC,CAAC;IAC7C,IAAI,WAAW,EAAE,CAAC;QACd,2BAA2B;QAC3B,uBAAuB,GAAG,IAAI,CAAC,oBAAoB,CAC/C,IAAI,CAAC,0BAA0B,CAC3B,SAAS,EACT,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CACtC,EACD,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CACxD,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,uBAAuB,GAAG,IAAI,CAAC,oBAAoB,CAC/C,IAAI,CAAC,0BAA0B,CAC3B,SAAS,EACT,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CACtC,EACD,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CACpC,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if ('localSymbol' in declaration && declaration.localSymbol && typeof declaration.localSymbol === 'object' && 'exportSymbol' in declaration.localSymbol && declaration.localSymbol.exportSymbol && typeof declaration.localSymbol.exportSymbol === 'object' && 'escapedName' in declaration.localSymbol.exportSymbol && typeof declaration.localSymbol.exportSymbol.escapedName === 'string') {
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExportedClassDeclarationStatements = void 0;
|
|
4
|
+
const tstl = require("typescript-to-lua");
|
|
5
|
+
const getExportedClassDeclarationStatements = (className, declaration) => {
|
|
6
|
+
if ('localSymbol' in declaration &&
|
|
7
|
+
declaration.localSymbol &&
|
|
8
|
+
typeof declaration.localSymbol === 'object' &&
|
|
9
|
+
'exportSymbol' in declaration.localSymbol &&
|
|
10
|
+
declaration.localSymbol.exportSymbol &&
|
|
11
|
+
typeof declaration.localSymbol.exportSymbol === 'object' &&
|
|
12
|
+
'escapedName' in declaration.localSymbol.exportSymbol &&
|
|
13
|
+
typeof declaration.localSymbol.exportSymbol.escapedName === 'string') {
|
|
15
14
|
const escapedName = declaration.localSymbol.exportSymbol.escapedName;
|
|
16
15
|
return [
|
|
17
|
-
|
|
16
|
+
tstl.createAssignmentStatement(tstl.createTableIndexExpression(tstl.createIdentifier('____exports'), tstl.createStringLiteral(escapedName)), className),
|
|
18
17
|
];
|
|
19
18
|
}
|
|
20
19
|
return [];
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
exports.getExportedClassDeclarationStatements = getExportedClassDeclarationStatements;
|
|
23
22
|
//# sourceMappingURL=getExportedClassDeclarationStatements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"getExportedClassDeclarationStatements.js","sourceRoot":"","sources":["../../../../libs/tstl-plugin/src/transformClassDeclaration/getExportedClassDeclarationStatements.ts"],"names":[],"mappings":";;;AACA,0CAA0C;AAEnC,MAAM,qCAAqC,GAAG,CACjD,SAA0B,EAC1B,WAAoC,EACtC,EAAE;IACA,IACI,aAAa,IAAI,WAAW;QAC5B,WAAW,CAAC,WAAW;QACvB,OAAO,WAAW,CAAC,WAAW,KAAK,QAAQ;QAC3C,cAAc,IAAI,WAAW,CAAC,WAAW;QACzC,WAAW,CAAC,WAAW,CAAC,YAAY;QACpC,OAAO,WAAW,CAAC,WAAW,CAAC,YAAY,KAAK,QAAQ;QACxD,aAAa,IAAI,WAAW,CAAC,WAAW,CAAC,YAAY;QACrD,OAAO,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,KAAK,QAAQ,EACtE,CAAC;QACC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC;QAErE,OAAO;YACH,IAAI,CAAC,yBAAyB,CAC1B,IAAI,CAAC,0BAA0B,CAC3B,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EACpC,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CACxC,EACD,SAAS,CACZ;SACJ,CAAC;IACN,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC,CAAC;AA5BW,QAAA,qCAAqC,yCA4BhD"}
|