testeranto 0.200.1 → 0.202.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/README.md +26 -1
- package/design-editor/DesignEditor.tsx +40 -241
- package/dist/common/design-editor/DesignEditor.js +33 -198
- package/dist/common/src/App.js +158 -16
- package/dist/common/src/PM/PM_WithBuild.js +135 -0
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +79 -67
- package/dist/common/src/PM/PM_WithGit.js +517 -0
- package/dist/common/src/PM/PM_WithProcesses.js +519 -0
- package/dist/common/src/PM/PM_WithWebSocket.js +535 -0
- package/dist/common/src/PM/base.js +62 -0
- package/dist/common/src/PM/main.js +533 -1676
- package/dist/common/src/PM/metafileOutputs.js +78 -0
- package/dist/common/src/PM/node.js +0 -6
- package/dist/common/src/PM/pure.js +0 -8
- package/dist/common/src/PM/types.js +1 -0
- package/dist/common/src/PM/utils.js +210 -0
- package/dist/common/src/PM/web.js +0 -6
- package/dist/common/src/ReportServer.js +0 -10
- package/dist/common/src/ReportServerLib.js +0 -140
- package/dist/common/src/components/pure/AppFrame.js +68 -56
- package/dist/common/src/components/pure/ArtifactTree.js +80 -0
- package/dist/common/src/components/pure/BuildLogViewer.js +106 -0
- package/dist/common/src/components/pure/DebugEnv.js +30 -0
- package/dist/common/src/components/pure/FileTree.js +34 -0
- package/dist/common/src/components/pure/FileTreeItem.js +29 -0
- package/dist/common/src/components/pure/GitHubLoginButton.js +18 -0
- package/dist/common/src/components/pure/GitIntegrationView.js +342 -0
- package/dist/common/src/components/pure/ProcessManager.js +1 -0
- package/dist/common/src/components/pure/ProcessManagerView.js +73 -74
- package/dist/common/src/components/pure/ProjectPageView.js +4 -117
- package/dist/common/src/components/pure/Settings.js +121 -0
- package/dist/common/src/components/pure/Settings.test.js +34 -0
- package/dist/common/src/components/pure/SignIn.js +22 -0
- package/dist/common/src/components/pure/SingleProcessView.js +166 -213
- package/dist/common/src/components/pure/TestPageView.js +113 -368
- package/dist/common/src/components/pure/TestPageView_utils.js +117 -0
- package/dist/common/src/components/pure/TestTable.js +33 -0
- package/dist/common/src/components/pure/ToastNotification.js +14 -0
- package/dist/common/src/components/pure/UserProfile.js +27 -0
- package/dist/common/src/components/stateful/AuthCallbackPage.js +51 -0
- package/dist/common/src/components/stateful/FeaturesReporter.js +2 -1
- package/dist/common/src/components/stateful/FileTree.js +58 -39
- package/dist/common/src/components/stateful/GitIntegrationPage.js +12 -0
- package/dist/common/src/components/stateful/ProcessManagerPage.js +13 -15
- package/dist/common/src/components/stateful/ProjectPage.js +6 -5
- package/dist/common/src/components/stateful/ProjectsPage.js +17 -19
- package/dist/common/src/components/stateful/SingleProcessPage.js +16 -26
- package/dist/common/src/components/stateful/TestPage.js +7 -5
- package/dist/common/src/hooks/useGitMode.js +21 -0
- package/dist/common/src/lib/BaseSuite.test/mock.js +15 -8
- package/dist/common/src/lib/BaseSuite.test/test.js +56 -80
- package/dist/common/src/lib/Tiposkripto.js +24 -0
- package/dist/common/src/lib/Tiposkripto.test/MockTiposkripto.js +154 -10
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +6 -12
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +63 -23
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.specification.js +14 -6
- package/dist/common/src/lib/pmProxy.test/specification.js +167 -52
- package/dist/common/src/services/FileService.js +505 -0
- package/dist/common/src/services/GitHubAuthService.js +184 -0
- package/dist/common/src/testeranto.js +38 -97
- package/dist/common/src/utils/api.js +12 -8
- package/dist/common/src/utils/gitTest.js +27 -0
- package/dist/common/src/utils.js +23 -13
- package/dist/common/testeranto.config.js +21 -17
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/design-editor/DesignEditor.js +33 -199
- package/dist/module/src/App.js +121 -15
- package/dist/module/src/PM/PM_WithBuild.js +128 -0
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +79 -67
- package/dist/module/src/PM/PM_WithGit.js +477 -0
- package/dist/module/src/PM/PM_WithProcesses.js +479 -0
- package/dist/module/src/PM/PM_WithWebSocket.js +528 -0
- package/dist/module/src/PM/base.js +62 -0
- package/dist/module/src/PM/main.js +533 -1676
- package/dist/module/src/PM/metafileOutputs.js +78 -0
- package/dist/module/src/PM/node.js +0 -6
- package/dist/module/src/PM/pure.js +0 -8
- package/dist/module/src/PM/types.js +1 -1
- package/dist/module/src/PM/utils.js +196 -0
- package/dist/module/src/PM/web.js +0 -6
- package/dist/module/src/ReportServer.js +1 -9
- package/dist/module/src/ReportServerLib.js +1 -134
- package/dist/module/src/components/pure/AppFrame.js +66 -24
- package/dist/module/src/components/pure/ArtifactTree.js +80 -0
- package/dist/module/src/components/pure/BuildLogViewer.js +99 -0
- package/dist/module/src/components/pure/DebugEnv.js +23 -0
- package/dist/module/src/components/pure/FileTree.js +27 -0
- package/dist/module/src/components/pure/FileTreeItem.js +22 -0
- package/dist/module/src/components/pure/GitHubLoginButton.js +11 -0
- package/dist/module/src/components/pure/GitIntegrationView.js +305 -0
- package/dist/module/src/components/pure/ProcessManager.js +1 -0
- package/dist/module/src/components/pure/ProcessManagerView.js +74 -75
- package/dist/module/src/components/pure/ProjectPageView.js +5 -118
- package/dist/module/src/components/pure/Settings.js +84 -0
- package/dist/module/src/components/pure/Settings.test.js +29 -0
- package/dist/module/src/components/pure/SignIn.js +15 -0
- package/dist/module/src/components/pure/SingleProcessView.js +130 -214
- package/dist/module/src/components/pure/TestPageView.js +97 -352
- package/dist/module/src/components/pure/TestPageView_utils.js +109 -0
- package/dist/module/src/components/pure/TestTable.js +26 -0
- package/dist/module/src/components/pure/ToastNotification.js +7 -0
- package/dist/module/src/components/pure/UserProfile.js +20 -0
- package/dist/module/src/components/stateful/AuthCallbackPage.js +14 -0
- package/dist/module/src/components/stateful/FeaturesReporter.js +2 -1
- package/dist/module/src/components/stateful/FileTree.js +59 -33
- package/dist/module/src/components/stateful/GitIntegrationPage.js +5 -0
- package/dist/module/src/components/stateful/ProcessManagerPage.js +13 -15
- package/dist/module/src/components/stateful/ProjectPage.js +6 -5
- package/dist/module/src/components/stateful/ProjectsPage.js +16 -18
- package/dist/module/src/components/stateful/SingleProcessPage.js +16 -26
- package/dist/module/src/components/stateful/TestPage.js +8 -6
- package/dist/module/src/hooks/useGitMode.js +17 -0
- package/dist/module/src/lib/BaseSuite.test/mock.js +15 -8
- package/dist/module/src/lib/BaseSuite.test/test.js +56 -80
- package/dist/module/src/lib/Tiposkripto.js +24 -0
- package/dist/module/src/lib/Tiposkripto.test/MockTiposkripto.js +154 -10
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +6 -12
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +63 -23
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.specification.js +14 -6
- package/dist/module/src/lib/pmProxy.test/specification.js +167 -52
- package/dist/module/src/services/FileService.js +468 -0
- package/dist/module/src/services/GitHubAuthService.js +180 -0
- package/dist/module/src/testeranto.js +38 -97
- package/dist/module/src/utils/api.js +10 -7
- package/dist/module/src/utils/gitTest.js +23 -0
- package/dist/module/src/utils.js +21 -12
- package/dist/module/testeranto.config.js +21 -17
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.css +94 -121
- package/dist/prebuild/App.js +44601 -11225
- package/dist/prebuild/testeranto.mjs +3113 -2256
- package/dist/types/design-editor/DesignEditor.d.ts +1 -18
- package/dist/types/src/App.d.ts +18 -0
- package/dist/types/src/PM/PM_WithBuild.d.ts +13 -0
- package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +2 -4
- package/dist/types/src/PM/PM_WithGit.d.ts +27 -0
- package/dist/types/src/PM/PM_WithProcesses.d.ts +29 -0
- package/dist/types/src/PM/PM_WithWebSocket.d.ts +108 -0
- package/dist/types/src/PM/base.d.ts +1 -1
- package/dist/types/src/PM/index.d.ts +0 -2
- package/dist/types/src/PM/main.d.ts +6 -77
- package/dist/types/src/PM/metafileOutputs.d.ts +0 -0
- package/dist/types/src/PM/node.d.ts +0 -2
- package/dist/types/src/PM/pure.d.ts +0 -2
- package/dist/types/src/PM/types.d.ts +118 -0
- package/dist/types/src/PM/utils.d.ts +35 -0
- package/dist/types/src/PM/web.d.ts +0 -2
- package/dist/types/src/Pure.d.ts +6 -1
- package/dist/types/src/ReportServer.d.ts +0 -1
- package/dist/types/src/ReportServerLib.d.ts +0 -1
- package/dist/types/src/Types.d.ts +1 -0
- package/dist/types/src/components/pure/ArtifactTree.d.ts +0 -0
- package/dist/types/src/components/pure/BuildLogViewer.d.ts +7 -0
- package/dist/types/src/components/pure/DebugEnv.d.ts +2 -0
- package/dist/types/src/components/pure/FileTree.d.ts +6 -0
- package/dist/types/src/components/pure/FileTreeItem.d.ts +8 -0
- package/dist/types/src/components/pure/GitHubLoginButton.d.ts +8 -0
- package/dist/types/src/components/pure/GitIntegrationView.d.ts +1 -0
- package/dist/types/src/components/pure/Settings.d.ts +1 -0
- package/dist/types/src/components/pure/Settings.test.d.ts +1 -0
- package/dist/types/src/components/pure/SignIn.d.ts +1 -0
- package/dist/types/src/components/pure/SingleProcessView.d.ts +10 -0
- package/dist/types/src/components/pure/TestPageView.d.ts +2 -1
- package/dist/types/src/components/pure/TestPageView_utils.d.ts +23 -0
- package/dist/types/src/components/pure/TestTable.d.ts +16 -0
- package/dist/types/src/components/pure/ToastNotification.d.ts +6 -0
- package/dist/types/src/components/pure/UserProfile.d.ts +2 -0
- package/dist/types/src/components/stateful/AuthCallbackPage.d.ts +2 -0
- package/dist/types/src/components/stateful/FileTree.d.ts +0 -8
- package/dist/types/src/components/stateful/GitIntegrationPage.d.ts +1 -0
- package/dist/types/src/hooks/useGitMode.d.ts +7 -0
- package/dist/types/src/lib/BaseSuite.test/mock.d.ts +2 -2
- package/dist/types/src/lib/BaseSuite.test/test.d.ts +4 -3
- package/dist/types/src/lib/Tiposkripto.d.ts +2 -0
- package/dist/types/src/lib/Tiposkripto.test/MockTiposkripto.d.ts +3 -0
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.types.d.ts +5 -0
- package/dist/types/src/lib/index.d.ts +6 -0
- package/dist/types/src/services/FileService.d.ts +34 -0
- package/dist/types/src/services/GitHubAuthService.d.ts +32 -0
- package/dist/types/src/utils/api.d.ts +1 -0
- package/dist/types/src/utils/gitTest.d.ts +11 -0
- package/dist/types/src/utils.d.ts +3 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/example/__pycache__/Calculator.cpython-313.pyc +0 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/README.md +187 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_given.go +163 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_suite.go +85 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_then.go +21 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_when.go +21 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/golingvu.go +554 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/test_adapter.go +33 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/types.go +72 -0
- package/example/vendor/modules.txt +5 -0
- package/git-integration-plan.md +395 -0
- package/package.json +26 -14
- package/src/App.tsx +169 -18
- package/src/PM/PM_WithBuild.ts +171 -0
- package/src/PM/PM_WithEslintAndTsc.ts +109 -86
- package/src/PM/PM_WithGit.ts +585 -0
- package/src/PM/PM_WithProcesses.ts +639 -0
- package/src/PM/PM_WithWebSocket.ts +631 -0
- package/src/PM/base.ts +63 -1
- package/src/PM/index.ts +8 -5
- package/src/PM/main.ts +672 -2050
- package/src/PM/metafileOutputs.ts +90 -0
- package/src/PM/node.ts +18 -18
- package/src/PM/pure.ts +5 -13
- package/src/PM/types.ts +145 -0
- package/src/PM/utils.ts +256 -0
- package/src/PM/web.ts +8 -8
- package/src/README.md +122 -0
- package/src/ReportServer.ts +0 -12
- package/src/ReportServerLib.ts +0 -147
- package/src/Types.ts +1 -0
- package/src/app.scss +14 -164
- package/src/components/pure/AppFrame.tsx +237 -71
- package/src/components/pure/ArtifactTree.tsx +82 -0
- package/src/components/pure/BuildLogViewer.tsx +168 -0
- package/src/components/pure/DebugEnv.tsx +30 -0
- package/src/components/pure/FileTree.tsx +58 -0
- package/src/components/pure/FileTreeItem.tsx +49 -0
- package/src/components/pure/GitHubLoginButton.tsx +31 -0
- package/src/components/pure/GitIntegrationView.tsx +443 -0
- package/src/components/pure/ProcessManager.tsx +6 -5
- package/src/components/pure/ProcessManagerView.tsx +162 -166
- package/src/components/pure/ProjectPageView.tsx +6 -224
- package/src/components/pure/Settings.test.tsx +34 -0
- package/src/components/pure/Settings.tsx +163 -0
- package/src/components/pure/SignIn.tsx +33 -0
- package/src/components/pure/SingleProcessView.tsx +231 -235
- package/src/components/pure/TestPageView.test/specification.ts +1 -0
- package/src/components/pure/TestPageView.tsx +317 -826
- package/src/components/pure/TestPageView_utils.tsx +285 -0
- package/src/components/pure/TestTable.tsx +88 -0
- package/src/components/pure/ToastNotification.tsx +19 -0
- package/src/components/pure/UserProfile.tsx +44 -0
- package/src/components/stateful/AuthCallbackPage.tsx +21 -0
- package/src/components/stateful/FeaturesReporter.tsx +3 -1
- package/src/components/stateful/FileTree.tsx +58 -58
- package/src/components/stateful/GitIntegrationPage.tsx +8 -0
- package/src/components/stateful/ProcessManagerPage.tsx +13 -17
- package/src/components/stateful/ProjectPage.tsx +6 -5
- package/src/components/stateful/ProjectsPage.tsx +17 -19
- package/src/components/stateful/SVGEditor/CircleForm.tsx +68 -0
- package/src/components/stateful/SVGEditor/GroupForm.tsx +56 -0
- package/src/components/stateful/SVGEditor/RectForm.tsx +74 -0
- package/src/components/stateful/SVGEditor/SVGAttributeField.tsx +29 -0
- package/src/components/stateful/SVGEditor/SVGAttributesEditor.tsx +73 -0
- package/src/components/stateful/SVGEditor/SVGEditorControls.tsx +45 -0
- package/src/components/stateful/SVGEditor/SVGElementForm.tsx +45 -0
- package/src/components/stateful/SVGEditor/SVGPreview.tsx +225 -0
- package/src/components/stateful/SVGEditor/SVGTextEditor.tsx +166 -0
- package/src/components/stateful/SVGEditor/SVGTree.tsx +159 -0
- package/src/components/stateful/SVGEditor/SVGTypes.ts +36 -0
- package/src/components/stateful/SVGEditor/svg.xsd.xml +3038 -0
- package/src/components/stateful/SVGEditorPage.tsx +503 -0
- package/src/components/stateful/SingleProcessPage.tsx +18 -31
- package/src/components/stateful/TestPage.tsx +25 -22
- package/src/golingvu/golingvu.go +38 -2
- package/src/hooks/useGitMode.ts +20 -0
- package/src/lib/BaseSuite.test/mock.ts +16 -10
- package/src/lib/BaseSuite.test/test.ts +144 -103
- package/src/lib/Tiposkripto.test/MockTiposkripto.ts +178 -14
- package/src/lib/Tiposkripto.test/Tiposkripto.adapter.ts +9 -14
- package/src/lib/Tiposkripto.test/Tiposkripto.implementation.ts +78 -38
- package/src/lib/Tiposkripto.test/Tiposkripto.specification.ts +51 -9
- package/src/lib/Tiposkripto.test/Tiposkripto.types.ts +5 -0
- package/src/lib/Tiposkripto.ts +27 -0
- package/src/lib/index.ts +7 -0
- package/src/lib/pmProxy.test/specification.ts +168 -166
- package/src/pitono/PM/__pycache__/python.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/Pitono.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_given.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_suite.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_then.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_when.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/core_generator.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/simple_adapter.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/types.cpython-313.pyc +0 -0
- package/src/services/FileService.ts +542 -0
- package/src/services/GitHubAuthService.ts +240 -0
- package/src/testeranto.ts +62 -140
- package/src/utils/api.ts +15 -13
- package/src/utils/gitTest.ts +29 -0
- package/src/utils.ts +21 -12
- package/testeranto/App.css +94 -121
- package/testeranto/App.js +44601 -11225
- package/testeranto/bundles/golang/core/Calculator.golingvu.go +53 -0
- package/testeranto/bundles/golang/core/Calculator.golingvu.golingvu.go +53 -0
- package/testeranto/bundles/node/core/chunk-RIM6RECA.mjs +1170 -0
- package/testeranto/bundles/node/core/chunk-VXVF7WFO.mjs +4321 -0
- package/testeranto/bundles/node/core/example/Calculator.test.mjs +503 -0
- package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +94 -1231
- package/testeranto/bundles/node/core/src/lib/TipoSkripto.test/TipoSkripto.mjs +574 -0
- package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +482 -0
- package/testeranto/bundles/pure/core/chunk-XYOCRDEQ.mjs +1080 -0
- package/testeranto/bundles/pure/core/src/Pure.test.mjs +410 -0
- package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +93 -1146
- package/testeranto/bundles/python/core/Calculator.pitono.test.py +24 -0
- package/testeranto/bundles/python/core/test_example.py +24 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Black-O75GP5JI.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Bold-R524Q5BH.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-ExtraBold-C6GRMYVT.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Light-WKN65Y2C.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Medium-ZC4DWL7C.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Regular-DT6EKZ3S.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Thin-YWDNVG6M.ttf +0 -0
- package/testeranto/bundles/web/core/chunk-DFRN4SYZ.mjs +2297 -0
- package/testeranto/bundles/web/core/chunk-JMDLMADH.mjs +27996 -0
- package/testeranto/bundles/web/core/chunk-LQMU5NCG.mjs +3082 -0
- package/testeranto/bundles/web/core/chunk-Q5TONB2Z.mjs +6874 -0
- package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.mjs +164 -0
- package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.css +11697 -0
- package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.mjs +336 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.css +11697 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +517 -0
- package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.mjs +107 -1134
- package/testeranto/metafiles/golang/core.json +3 -3
- package/testeranto/metafiles/node/core.json +474 -31
- package/testeranto/metafiles/pure/core.json +144 -28
- package/testeranto/metafiles/python/core.json +11 -0
- package/testeranto/metafiles/web/core.json +15829 -45
- package/testeranto/reports/core/config.json +40 -0
- package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +14 -0
- package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +73 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +91 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +1 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +2 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +68 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +30 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +1 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +2 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +88 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -6
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -11
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stdout.log +1 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +1 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +35 -38
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -10
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +40 -38
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/tests.json +1 -1
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +55 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +191 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +71 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +15 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +20 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +4 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +49 -0
- package/testeranto/reports/core/summary.json +34 -6
- package/testeranto.config.ts +26 -20
- package/tsc.log +141 -91
- package/tsconfig.json +6 -2
- package/dist/types/design-editor/server.d.ts +0 -1
- package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.html +0 -15
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -25
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -56
- /package/testeranto/reports/core/src/{lib/BaseSuite.test/web.test/web → Pure.test/pure}/message.txt +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
// Static Mode Service (Read-only)
|
|
2
|
+
class StaticFileService {
|
|
3
|
+
async readFile(path) {
|
|
4
|
+
const response = await fetch(path);
|
|
5
|
+
if (!response.ok)
|
|
6
|
+
throw new Error(`Failed to read file: ${path}`);
|
|
7
|
+
return await response.text();
|
|
8
|
+
}
|
|
9
|
+
async readDirectory(path) {
|
|
10
|
+
// In static mode, we can't list directories from the client
|
|
11
|
+
// This would need to be provided by a server endpoint
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
async exists(path) {
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch(path, { method: "HEAD" });
|
|
17
|
+
return response.ok;
|
|
18
|
+
}
|
|
19
|
+
catch (_a) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Write operations are no-ops in static mode
|
|
24
|
+
async writeFile() {
|
|
25
|
+
/* no-op */
|
|
26
|
+
}
|
|
27
|
+
async createDirectory() {
|
|
28
|
+
/* no-op */
|
|
29
|
+
}
|
|
30
|
+
async deleteFile() {
|
|
31
|
+
/* no-op */
|
|
32
|
+
}
|
|
33
|
+
// Git operations are not available in static mode
|
|
34
|
+
async getFileStatus() {
|
|
35
|
+
return { status: "unchanged" };
|
|
36
|
+
}
|
|
37
|
+
async getChanges() {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
async commitChanges() {
|
|
41
|
+
throw new Error("Commit not available in static mode");
|
|
42
|
+
}
|
|
43
|
+
async pushChanges() {
|
|
44
|
+
throw new Error("Push not available in static mode");
|
|
45
|
+
}
|
|
46
|
+
async pullChanges() {
|
|
47
|
+
throw new Error("Pull not available in static mode");
|
|
48
|
+
}
|
|
49
|
+
async getCurrentBranch() {
|
|
50
|
+
return "main";
|
|
51
|
+
}
|
|
52
|
+
async getRemoteStatus() {
|
|
53
|
+
return { ahead: 0, behind: 0 };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Development Mode Service (Full filesystem access via server)
|
|
57
|
+
class DevelopmentFileService {
|
|
58
|
+
constructor() {
|
|
59
|
+
this.ws = null;
|
|
60
|
+
this.changeCallbacks = [];
|
|
61
|
+
this.statusCallbacks = [];
|
|
62
|
+
this.branchCallbacks = [];
|
|
63
|
+
this.connectWebSocket();
|
|
64
|
+
}
|
|
65
|
+
connectWebSocket() {
|
|
66
|
+
try {
|
|
67
|
+
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
68
|
+
const wsUrl = `${protocol}//${window.location.host}/api/git-ws`;
|
|
69
|
+
this.ws = new WebSocket(wsUrl);
|
|
70
|
+
this.ws.onopen = () => {
|
|
71
|
+
var _a;
|
|
72
|
+
console.log('Git WebSocket connected');
|
|
73
|
+
// Request initial state
|
|
74
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'get-initial-state' }));
|
|
75
|
+
};
|
|
76
|
+
this.ws.onmessage = (event) => {
|
|
77
|
+
try {
|
|
78
|
+
const data = JSON.parse(event.data);
|
|
79
|
+
switch (data.type) {
|
|
80
|
+
case 'changes':
|
|
81
|
+
this.changeCallbacks.forEach(callback => callback(data.changes));
|
|
82
|
+
break;
|
|
83
|
+
case 'status':
|
|
84
|
+
this.statusCallbacks.forEach(callback => callback(data.status));
|
|
85
|
+
break;
|
|
86
|
+
case 'branch':
|
|
87
|
+
this.branchCallbacks.forEach(callback => callback(data.branch));
|
|
88
|
+
break;
|
|
89
|
+
case 'error':
|
|
90
|
+
console.error('Git WebSocket error:', data.message);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('Error parsing WebSocket message:', error);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
this.ws.onclose = () => {
|
|
99
|
+
console.log('Git WebSocket disconnected, attempting to reconnect...');
|
|
100
|
+
setTimeout(() => this.connectWebSocket(), 3000);
|
|
101
|
+
};
|
|
102
|
+
this.ws.onerror = (error) => {
|
|
103
|
+
console.error('Git WebSocket error:', error);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.error('Failed to connect Git WebSocket:', error);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Subscribe to real-time changes
|
|
111
|
+
onChanges(callback) {
|
|
112
|
+
this.changeCallbacks.push(callback);
|
|
113
|
+
return () => {
|
|
114
|
+
this.changeCallbacks = this.changeCallbacks.filter(cb => cb !== callback);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
onStatusUpdate(callback) {
|
|
118
|
+
this.statusCallbacks.push(callback);
|
|
119
|
+
return () => {
|
|
120
|
+
this.statusCallbacks = this.statusCallbacks.filter(cb => cb !== callback);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
onBranchUpdate(callback) {
|
|
124
|
+
this.branchCallbacks.push(callback);
|
|
125
|
+
return () => {
|
|
126
|
+
this.branchCallbacks = this.branchCallbacks.filter(cb => cb !== callback);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
async readFile(path) {
|
|
130
|
+
const response = await fetch(`/api/files/read?path=${encodeURIComponent(path)}`);
|
|
131
|
+
if (!response.ok)
|
|
132
|
+
throw new Error(`Failed to read file: ${path}`);
|
|
133
|
+
return await response.text();
|
|
134
|
+
}
|
|
135
|
+
async readDirectory(path) {
|
|
136
|
+
const response = await fetch(`/api/files/list?path=${encodeURIComponent(path)}`);
|
|
137
|
+
if (!response.ok)
|
|
138
|
+
throw new Error(`Failed to list directory: ${path}`);
|
|
139
|
+
return await response.json();
|
|
140
|
+
}
|
|
141
|
+
async exists(path) {
|
|
142
|
+
const response = await fetch(`/api/files/exists?path=${encodeURIComponent(path)}`);
|
|
143
|
+
return response.ok;
|
|
144
|
+
}
|
|
145
|
+
async writeFile(path, content) {
|
|
146
|
+
var _a;
|
|
147
|
+
const response = await fetch("/api/files/write", {
|
|
148
|
+
method: "POST",
|
|
149
|
+
headers: { "Content-Type": "application/json" },
|
|
150
|
+
body: JSON.stringify({ path, content }),
|
|
151
|
+
});
|
|
152
|
+
if (!response.ok)
|
|
153
|
+
throw new Error(`Failed to write file: ${path}`);
|
|
154
|
+
// Notify server to update git status
|
|
155
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'file-changed', path }));
|
|
156
|
+
}
|
|
157
|
+
async createDirectory(path) {
|
|
158
|
+
var _a;
|
|
159
|
+
const response = await fetch("/api/files/mkdir", {
|
|
160
|
+
method: "POST",
|
|
161
|
+
headers: { "Content-Type": "application/json" },
|
|
162
|
+
body: JSON.stringify({ path }),
|
|
163
|
+
});
|
|
164
|
+
if (!response.ok)
|
|
165
|
+
throw new Error(`Failed to create directory: ${path}`);
|
|
166
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'file-changed', path }));
|
|
167
|
+
}
|
|
168
|
+
async deleteFile(path) {
|
|
169
|
+
var _a;
|
|
170
|
+
const response = await fetch("/api/files/delete", {
|
|
171
|
+
method: "POST",
|
|
172
|
+
headers: { "Content-Type": "application/json" },
|
|
173
|
+
body: JSON.stringify({ path }),
|
|
174
|
+
});
|
|
175
|
+
if (!response.ok)
|
|
176
|
+
throw new Error(`Failed to delete file: ${path}`);
|
|
177
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'file-changed', path }));
|
|
178
|
+
}
|
|
179
|
+
async getFileStatus(path) {
|
|
180
|
+
const response = await fetch(`/api/git/status?path=${encodeURIComponent(path)}`);
|
|
181
|
+
if (!response.ok)
|
|
182
|
+
return { status: "unchanged" };
|
|
183
|
+
return await response.json();
|
|
184
|
+
}
|
|
185
|
+
async getChanges() {
|
|
186
|
+
const response = await fetch("/api/git/changes");
|
|
187
|
+
if (!response.ok)
|
|
188
|
+
return [];
|
|
189
|
+
return await response.json();
|
|
190
|
+
}
|
|
191
|
+
async commitChanges(message, description) {
|
|
192
|
+
var _a;
|
|
193
|
+
const response = await fetch("/api/git/commit", {
|
|
194
|
+
method: "POST",
|
|
195
|
+
headers: { "Content-Type": "application/json" },
|
|
196
|
+
body: JSON.stringify({ message, description }),
|
|
197
|
+
});
|
|
198
|
+
if (!response.ok) {
|
|
199
|
+
const error = await response.text();
|
|
200
|
+
throw new Error(`Failed to commit changes: ${error}`);
|
|
201
|
+
}
|
|
202
|
+
// Request updated status after commit
|
|
203
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'refresh-status' }));
|
|
204
|
+
}
|
|
205
|
+
async pushChanges() {
|
|
206
|
+
var _a;
|
|
207
|
+
const response = await fetch("/api/git/push", {
|
|
208
|
+
method: "POST",
|
|
209
|
+
});
|
|
210
|
+
if (!response.ok) {
|
|
211
|
+
const error = await response.text();
|
|
212
|
+
throw new Error(`Failed to push changes: ${error}`);
|
|
213
|
+
}
|
|
214
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'refresh-status' }));
|
|
215
|
+
}
|
|
216
|
+
async pullChanges() {
|
|
217
|
+
var _a;
|
|
218
|
+
const response = await fetch("/api/git/pull", {
|
|
219
|
+
method: "POST",
|
|
220
|
+
});
|
|
221
|
+
if (!response.ok) {
|
|
222
|
+
const error = await response.text();
|
|
223
|
+
throw new Error(`Failed to pull changes: ${error}`);
|
|
224
|
+
}
|
|
225
|
+
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify({ type: 'refresh-status' }));
|
|
226
|
+
}
|
|
227
|
+
async getCurrentBranch() {
|
|
228
|
+
const response = await fetch("/api/git/branch");
|
|
229
|
+
if (!response.ok)
|
|
230
|
+
return "main";
|
|
231
|
+
return await response.text();
|
|
232
|
+
}
|
|
233
|
+
async getRemoteStatus() {
|
|
234
|
+
const response = await fetch("/api/git/remote-status");
|
|
235
|
+
if (!response.ok)
|
|
236
|
+
return { ahead: 0, behind: 0 };
|
|
237
|
+
return await response.json();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Git Mode Service (isomorphic-git based)
|
|
241
|
+
class GitFileService {
|
|
242
|
+
constructor() {
|
|
243
|
+
this.git = null;
|
|
244
|
+
this.fs = null;
|
|
245
|
+
this.dir = '/testeranto-git';
|
|
246
|
+
}
|
|
247
|
+
async ensureGit() {
|
|
248
|
+
if (!this.git) {
|
|
249
|
+
this.git = await import("isomorphic-git");
|
|
250
|
+
this.fs = await import("isomorphic-git/http/web");
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async ensureBufferPolyfill() {
|
|
254
|
+
if (typeof window !== 'undefined' && !window.Buffer) {
|
|
255
|
+
const buffer = await import('buffer');
|
|
256
|
+
window.Buffer = buffer.Buffer;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async readFile(path) {
|
|
260
|
+
await this.ensureBufferPolyfill();
|
|
261
|
+
await this.ensureGit();
|
|
262
|
+
try {
|
|
263
|
+
const content = await this.git.readBlob({
|
|
264
|
+
fs: window.fs,
|
|
265
|
+
dir: this.dir,
|
|
266
|
+
oid: await this.git.resolveRef({ fs: window.fs, dir: this.dir, ref: 'HEAD' }),
|
|
267
|
+
filepath: path,
|
|
268
|
+
});
|
|
269
|
+
return new TextDecoder().decode(content.blob);
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
throw new Error(`Failed to read file: ${path}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async readDirectory(path) {
|
|
276
|
+
await this.ensureBufferPolyfill();
|
|
277
|
+
await this.ensureGit();
|
|
278
|
+
try {
|
|
279
|
+
const files = await this.git.listFiles({
|
|
280
|
+
fs: window.fs,
|
|
281
|
+
dir: this.dir,
|
|
282
|
+
ref: 'HEAD',
|
|
283
|
+
});
|
|
284
|
+
return files.map(name => ({
|
|
285
|
+
name,
|
|
286
|
+
path: name,
|
|
287
|
+
type: name.includes('.') ? 'file' : 'directory',
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
async exists(path) {
|
|
295
|
+
try {
|
|
296
|
+
await this.readFile(path);
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
catch (_a) {
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async writeFile(path, content) {
|
|
304
|
+
await this.ensureBufferPolyfill();
|
|
305
|
+
await this.ensureGit();
|
|
306
|
+
// In Git mode, files are written to the virtual file system
|
|
307
|
+
// This would need proper implementation with IndexedDB or similar
|
|
308
|
+
console.log('Git mode write:', path);
|
|
309
|
+
}
|
|
310
|
+
async createDirectory(path) {
|
|
311
|
+
// Directories are created automatically when writing files
|
|
312
|
+
console.log('Git mode create directory:', path);
|
|
313
|
+
}
|
|
314
|
+
async deleteFile(path) {
|
|
315
|
+
await this.ensureBufferPolyfill();
|
|
316
|
+
await this.ensureGit();
|
|
317
|
+
// Mark file for deletion in next commit
|
|
318
|
+
console.log('Git mode delete:', path);
|
|
319
|
+
}
|
|
320
|
+
async getFileStatus(path) {
|
|
321
|
+
await this.ensureBufferPolyfill();
|
|
322
|
+
await this.ensureGit();
|
|
323
|
+
try {
|
|
324
|
+
const status = await this.git.status({
|
|
325
|
+
fs: window.fs,
|
|
326
|
+
dir: this.dir,
|
|
327
|
+
filepath: path,
|
|
328
|
+
});
|
|
329
|
+
return { status: status };
|
|
330
|
+
}
|
|
331
|
+
catch (_a) {
|
|
332
|
+
return { status: 'unchanged' };
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
async getChanges() {
|
|
336
|
+
await this.ensureBufferPolyfill();
|
|
337
|
+
await this.ensureGit();
|
|
338
|
+
try {
|
|
339
|
+
const statusMatrix = await this.git.statusMatrix({
|
|
340
|
+
fs: window.fs,
|
|
341
|
+
dir: this.dir,
|
|
342
|
+
});
|
|
343
|
+
return statusMatrix.map(([file, head, workdir, stage]) => {
|
|
344
|
+
let status = 'unchanged';
|
|
345
|
+
if (head === 0 && workdir === 2)
|
|
346
|
+
status = 'added';
|
|
347
|
+
else if (head === 1 && workdir === 0)
|
|
348
|
+
status = 'deleted';
|
|
349
|
+
else if (workdir === 2)
|
|
350
|
+
status = 'modified';
|
|
351
|
+
else if (head !== workdir)
|
|
352
|
+
status = 'modified';
|
|
353
|
+
return { path: file, status };
|
|
354
|
+
}).filter(change => change.status !== 'unchanged');
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
console.warn('Failed to get changes:', error);
|
|
358
|
+
return [];
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
async commitChanges(message, description) {
|
|
362
|
+
await this.ensureBufferPolyfill();
|
|
363
|
+
await this.ensureGit();
|
|
364
|
+
try {
|
|
365
|
+
// Stage all changes
|
|
366
|
+
const changes = await this.getChanges();
|
|
367
|
+
for (const change of changes) {
|
|
368
|
+
if (change.status === 'deleted') {
|
|
369
|
+
await this.git.remove({
|
|
370
|
+
fs: window.fs,
|
|
371
|
+
dir: this.dir,
|
|
372
|
+
filepath: change.path,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
await this.git.add({
|
|
377
|
+
fs: window.fs,
|
|
378
|
+
dir: this.dir,
|
|
379
|
+
filepath: change.path,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// Commit
|
|
384
|
+
await this.git.commit({
|
|
385
|
+
fs: window.fs,
|
|
386
|
+
dir: this.dir,
|
|
387
|
+
author: { name: 'Testeranto User', email: 'user@testeranto' },
|
|
388
|
+
message: description ? `${message}\n\n${description}` : message,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
throw new Error(`Failed to commit changes: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async pushChanges() {
|
|
396
|
+
await this.ensureBufferPolyfill();
|
|
397
|
+
await this.ensureGit();
|
|
398
|
+
try {
|
|
399
|
+
await this.git.push({
|
|
400
|
+
fs: window.fs,
|
|
401
|
+
http: this.fs,
|
|
402
|
+
dir: this.dir,
|
|
403
|
+
remote: 'origin',
|
|
404
|
+
ref: 'main',
|
|
405
|
+
onAuth: () => ({ username: 'token' }),
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
catch (error) {
|
|
409
|
+
throw new Error(`Failed to push changes: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
async pullChanges() {
|
|
413
|
+
await this.ensureBufferPolyfill();
|
|
414
|
+
await this.ensureGit();
|
|
415
|
+
try {
|
|
416
|
+
await this.git.pull({
|
|
417
|
+
fs: window.fs,
|
|
418
|
+
http: this.fs,
|
|
419
|
+
dir: this.dir,
|
|
420
|
+
remote: 'origin',
|
|
421
|
+
ref: 'main',
|
|
422
|
+
singleBranch: true,
|
|
423
|
+
onAuth: () => ({ username: 'token' }),
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
throw new Error(`Failed to pull changes: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
async getCurrentBranch() {
|
|
431
|
+
await this.ensureBufferPolyfill();
|
|
432
|
+
await this.ensureGit();
|
|
433
|
+
try {
|
|
434
|
+
return await this.git.currentBranch({
|
|
435
|
+
fs: window.fs,
|
|
436
|
+
dir: this.dir,
|
|
437
|
+
}) || 'main';
|
|
438
|
+
}
|
|
439
|
+
catch (_a) {
|
|
440
|
+
return 'main';
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
async getRemoteStatus() {
|
|
444
|
+
await this.ensureBufferPolyfill();
|
|
445
|
+
await this.ensureGit();
|
|
446
|
+
try {
|
|
447
|
+
// For now, return mock data
|
|
448
|
+
// In a real implementation, we'd compare local and remote branches
|
|
449
|
+
return { ahead: 0, behind: 0 };
|
|
450
|
+
}
|
|
451
|
+
catch (_a) {
|
|
452
|
+
return { ahead: 0, behind: 0 };
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
// Factory function to get the appropriate FileService based on mode
|
|
457
|
+
export const getFileService = (mode) => {
|
|
458
|
+
switch (mode) {
|
|
459
|
+
case "static":
|
|
460
|
+
return new StaticFileService();
|
|
461
|
+
case "dev":
|
|
462
|
+
return new DevelopmentFileService();
|
|
463
|
+
case "git":
|
|
464
|
+
return new GitFileService();
|
|
465
|
+
default:
|
|
466
|
+
return new StaticFileService();
|
|
467
|
+
}
|
|
468
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export class GitHubAuthService {
|
|
2
|
+
static get CLIENT_ID() {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
// Read from the global configuration
|
|
5
|
+
if (typeof window !== "undefined" &&
|
|
6
|
+
((_b = (_a = window.testerantoConfig) === null || _a === void 0 ? void 0 : _a.githubOAuth) === null || _b === void 0 ? void 0 : _b.clientId)) {
|
|
7
|
+
return window.testerantoConfig.githubOAuth.clientId;
|
|
8
|
+
}
|
|
9
|
+
console.log("GitHub OAuth client ID not found in configuration");
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
this.accessToken = null;
|
|
14
|
+
this.user = null;
|
|
15
|
+
this.listeners = new Map();
|
|
16
|
+
this.loadStoredAuth();
|
|
17
|
+
}
|
|
18
|
+
on(event, listener) {
|
|
19
|
+
if (!this.listeners.has(event)) {
|
|
20
|
+
this.listeners.set(event, []);
|
|
21
|
+
}
|
|
22
|
+
this.listeners.get(event).push(listener);
|
|
23
|
+
}
|
|
24
|
+
off(event, listener) {
|
|
25
|
+
const eventListeners = this.listeners.get(event);
|
|
26
|
+
if (eventListeners) {
|
|
27
|
+
const index = eventListeners.indexOf(listener);
|
|
28
|
+
if (index > -1) {
|
|
29
|
+
eventListeners.splice(index, 1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
emit(event, ...args) {
|
|
34
|
+
const eventListeners = this.listeners.get(event);
|
|
35
|
+
if (eventListeners) {
|
|
36
|
+
eventListeners.forEach((listener) => {
|
|
37
|
+
try {
|
|
38
|
+
listener(...args);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error(`Error in event listener for ${event}:`, error);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
loadStoredAuth() {
|
|
47
|
+
const token = localStorage.getItem("github_access_token");
|
|
48
|
+
const userStr = localStorage.getItem("github_user");
|
|
49
|
+
if (token) {
|
|
50
|
+
this.accessToken = token;
|
|
51
|
+
}
|
|
52
|
+
if (userStr) {
|
|
53
|
+
this.user = JSON.parse(userStr);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
get isAuthenticated() {
|
|
57
|
+
return !!this.accessToken;
|
|
58
|
+
}
|
|
59
|
+
get userInfo() {
|
|
60
|
+
return this.user;
|
|
61
|
+
}
|
|
62
|
+
get token() {
|
|
63
|
+
return this.accessToken;
|
|
64
|
+
}
|
|
65
|
+
initiateLogin() {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
const clientId = GitHubAuthService.CLIENT_ID;
|
|
68
|
+
console.log("Initiating login with CLIENT_ID:", clientId);
|
|
69
|
+
if (!clientId) {
|
|
70
|
+
console.error("GitHub OAuth client ID is not configured. Please set GITHUB_CLIENT_ID environment variable.");
|
|
71
|
+
// Provide helpful instructions for setup
|
|
72
|
+
const setupInstructions = `
|
|
73
|
+
GitHub authentication is not configured.
|
|
74
|
+
|
|
75
|
+
To set up GitHub OAuth:
|
|
76
|
+
|
|
77
|
+
1. Go to https://github.com/settings/developers
|
|
78
|
+
2. Create a new OAuth App
|
|
79
|
+
3. Set Authorization callback URL to: ${GitHubAuthService.REDIRECT_URI}
|
|
80
|
+
4. Add GITHUB_CLIENT_ID to your environment variables
|
|
81
|
+
5. Restart the development server
|
|
82
|
+
|
|
83
|
+
For development, you can create a .env file in the root directory with:
|
|
84
|
+
GITHUB_CLIENT_ID=your_client_id_here
|
|
85
|
+
|
|
86
|
+
Current environment analysis:
|
|
87
|
+
- process.env.GITHUB_CLIENT_ID: ${typeof process !== "undefined"
|
|
88
|
+
? ((_a = process.env) === null || _a === void 0 ? void 0 : _a.GITHUB_CLIENT_ID) || "undefined"
|
|
89
|
+
: "process undefined"}
|
|
90
|
+
- window.env.GITHUB_CLIENT_ID: ${typeof window !== "undefined"
|
|
91
|
+
? ((_b = window.env) === null || _b === void 0 ? void 0 : _b.GITHUB_CLIENT_ID) || "undefined"
|
|
92
|
+
: "window undefined"}
|
|
93
|
+
`;
|
|
94
|
+
alert(setupInstructions);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const authUrl = `https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(GitHubAuthService.REDIRECT_URI)}&scope=${encodeURIComponent(GitHubAuthService.SCOPE)}`;
|
|
98
|
+
console.log("Opening auth popup:", authUrl);
|
|
99
|
+
// Open in a popup window
|
|
100
|
+
const width = 600;
|
|
101
|
+
const height = 700;
|
|
102
|
+
const left = (window.screen.width - width) / 2;
|
|
103
|
+
const top = (window.screen.height - height) / 2;
|
|
104
|
+
window.open(authUrl, 'github-auth', `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes,status=yes`);
|
|
105
|
+
}
|
|
106
|
+
async handleCallback(code) {
|
|
107
|
+
try {
|
|
108
|
+
const response = await fetch("/api/auth/github/token", {
|
|
109
|
+
method: "POST",
|
|
110
|
+
headers: {
|
|
111
|
+
"Content-Type": "application/json",
|
|
112
|
+
},
|
|
113
|
+
body: JSON.stringify({ code }),
|
|
114
|
+
});
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
throw new Error("Failed to exchange code for token");
|
|
117
|
+
}
|
|
118
|
+
const data = await response.json();
|
|
119
|
+
this.accessToken = data.access_token;
|
|
120
|
+
// Store token
|
|
121
|
+
localStorage.setItem("github_access_token", this.accessToken);
|
|
122
|
+
// Get user info
|
|
123
|
+
await this.fetchUserInfo();
|
|
124
|
+
this.emit("authChange", true);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
console.error("Authentication failed:", error);
|
|
129
|
+
this.logout();
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async fetchUserInfo() {
|
|
134
|
+
if (!this.accessToken)
|
|
135
|
+
return;
|
|
136
|
+
try {
|
|
137
|
+
const response = await fetch("https://api.github.com/user", {
|
|
138
|
+
headers: {
|
|
139
|
+
Authorization: `Bearer ${this.accessToken}`,
|
|
140
|
+
Accept: "application/vnd.github.v3+json",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
if (!response.ok) {
|
|
144
|
+
throw new Error("Failed to fetch user info");
|
|
145
|
+
}
|
|
146
|
+
this.user = await response.json();
|
|
147
|
+
localStorage.setItem("github_user", JSON.stringify(this.user));
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
console.error("Failed to fetch user info:", error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
logout() {
|
|
154
|
+
this.accessToken = null;
|
|
155
|
+
this.user = null;
|
|
156
|
+
localStorage.removeItem("github_access_token");
|
|
157
|
+
localStorage.removeItem("github_user");
|
|
158
|
+
this.emit("authChange", false);
|
|
159
|
+
}
|
|
160
|
+
isConfigured() {
|
|
161
|
+
const clientId = GitHubAuthService.CLIENT_ID;
|
|
162
|
+
console.log("Checking if configured - CLIENT_ID:", clientId);
|
|
163
|
+
return !!clientId;
|
|
164
|
+
}
|
|
165
|
+
async makeAuthenticatedRequest(url, options = {}) {
|
|
166
|
+
if (!this.accessToken) {
|
|
167
|
+
throw new Error("Not authenticated");
|
|
168
|
+
}
|
|
169
|
+
const headers = Object.assign({ Authorization: `Bearer ${this.accessToken}`, Accept: "application/vnd.github.v3+json" }, options.headers);
|
|
170
|
+
const response = await fetch(url, Object.assign(Object.assign({}, options), { headers }));
|
|
171
|
+
if (response.status === 401) {
|
|
172
|
+
this.logout();
|
|
173
|
+
throw new Error("Authentication expired");
|
|
174
|
+
}
|
|
175
|
+
return response;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
GitHubAuthService.REDIRECT_URI = `${window.location.origin}/auth/github/callback`;
|
|
179
|
+
GitHubAuthService.SCOPE = "repo user";
|
|
180
|
+
export const githubAuthService = new GitHubAuthService();
|