testeranto 0.177.0 → 0.197.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/ALL_LICENSES.txt +11246 -0
- package/LICENSE +21 -0
- package/README.md +24 -4
- package/default-project.json +44 -0
- package/design-editor/DesignEditor.tsx +247 -0
- package/design-editor/index.ts +2 -0
- package/design-editor/server.ts +121 -0
- package/design-editor/types.ts +16 -0
- package/designs/default-project.json +210 -0
- package/dist/common/design-editor/DesignEditor.js +239 -0
- package/dist/common/design-editor/index.js +18 -0
- package/dist/common/design-editor/server.js +98 -0
- package/dist/common/design-editor/types.js +2 -0
- package/dist/common/src/App.js +53 -0
- package/dist/common/src/Node.js +4 -8
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +10 -34
- package/dist/common/src/PM/base.js +1 -1
- package/dist/common/src/PM/main.js +581 -113
- package/dist/common/src/PM/node.js +4 -2
- package/dist/common/src/PM/nodeSidecar.js +1 -0
- package/dist/common/src/PM/pure.js +20 -57
- package/dist/common/src/PM/pureSidecar.js +1 -1
- package/dist/common/src/PM/types.js +1 -0
- package/dist/common/src/PM/web.js +7 -4
- package/dist/common/src/Pure.js +1 -1
- package/dist/common/src/Pure.test.js +49 -79
- package/dist/common/src/ReportServer.js +8 -2
- package/dist/common/src/build.js +31 -40
- package/dist/common/src/components/DesignEditorPage.js +169 -0
- package/dist/common/src/components/SunriseAnimation.js +291 -0
- package/dist/common/src/components/SunriseAnimation.test/interface.js +67 -0
- package/dist/common/src/components/SunriseAnimation.test/types.js +2 -0
- package/dist/common/src/components/TestStatusBadge.js +1 -21
- package/dist/common/src/components/pure/AppFrame.js +69 -0
- package/dist/common/src/components/pure/AppFrame.test/implementation.js +63 -0
- package/dist/common/src/components/pure/AppFrame.test/index.js +14 -0
- package/dist/common/src/components/pure/AppFrame.test/specification.js +25 -0
- package/dist/common/src/components/pure/AppFrame.test/types.js +3 -0
- package/dist/common/src/components/pure/FeaturesReporterView.js +23 -0
- package/dist/common/src/components/pure/FeaturesReporterView.test/implementation.js +84 -0
- package/dist/common/src/components/pure/FeaturesReporterView.test/index.js +14 -0
- package/dist/common/src/components/pure/FeaturesReporterView.test/specification.js +27 -0
- package/dist/common/src/components/pure/FeaturesReporterView.test/types.js +2 -0
- package/dist/common/src/components/pure/ModalContent.js +86 -0
- package/dist/common/src/components/pure/ModalContent.test/implementation.js +35 -0
- package/dist/common/src/components/pure/ModalContent.test/index.js +58 -0
- package/dist/common/src/components/pure/ModalContent.test/specification.js +19 -0
- package/dist/common/src/components/pure/ModalContent.test/types.js +4 -0
- package/dist/common/src/{NavBar.js → components/pure/NavBar.js} +9 -10
- package/dist/common/src/components/pure/ProcessManager.js +112 -0
- package/dist/common/src/components/pure/ProcessManagerView.js +237 -0
- package/dist/common/src/components/pure/ProjectPageView.js +53 -76
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +167 -54
- package/dist/common/src/components/pure/ProjectPageView.test/index.js +5 -1
- package/dist/common/src/components/pure/ProjectPageView.test/specification.js +15 -2
- package/dist/common/src/components/pure/ProjectPageView.test/types.js +2 -0
- package/dist/common/src/components/pure/ProjectsPageView.js +72 -0
- package/dist/common/src/components/pure/SettingsButton.js +13 -0
- package/dist/common/src/components/pure/SingleProcessView.js +214 -0
- package/dist/common/src/components/pure/TestPageView.js +513 -0
- package/dist/common/src/components/pure/TestPageView.test/implementation.js +157 -0
- package/dist/common/src/components/pure/TestPageView.test/index.js +15 -0
- package/dist/common/src/components/pure/TestPageView.test/specification.js +26 -0
- package/dist/common/src/components/pure/TestPageView.test/types.js +4 -0
- package/dist/common/src/components/pure/ThemeCard.js +15 -0
- package/dist/common/src/components/stateful/FeaturesReporter.js +59 -0
- package/dist/common/src/components/stateful/FileTree.js +40 -0
- package/dist/common/src/components/stateful/ProcessManagerPage.js +112 -0
- package/dist/common/src/components/stateful/ProjectPage.js +101 -0
- package/dist/common/src/components/stateful/ProjectsPage.js +118 -0
- package/dist/common/src/components/stateful/SettingsPage.js +72 -0
- package/dist/common/src/components/stateful/SingleProcessPage.js +147 -0
- package/dist/common/src/components/stateful/TestPage.js +229 -0
- package/dist/common/src/components/stateful/TextEditorPage.js +154 -0
- package/dist/common/src/defaultConfig.js +1 -0
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +3 -4
- package/dist/common/src/esbuildConfigs/web.js +1 -1
- package/dist/common/src/lib/BaseSuite.js +7 -3
- package/dist/common/src/lib/BaseSuite.test/mock.js +17 -41
- package/dist/common/src/lib/BaseSuite.test/test.js +33 -42
- package/dist/common/src/lib/Sidecar.js +1 -0
- package/dist/common/src/lib/abstractBase.js +40 -13
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +12 -12
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +15 -13
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +28 -17
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.pure.js +2 -2
- package/dist/common/src/lib/basebuilder.js +29 -35
- package/dist/common/src/lib/classBuilder.js +5 -3
- package/dist/common/src/lib/core.js +3 -6
- package/dist/common/src/lib/core.test/MockCore.js +0 -14
- package/dist/common/src/lib/core.test/core.test.adapter.js +2 -9
- package/dist/common/src/lib/core.test/core.test.implementation.js +3 -7
- package/dist/common/src/lib/index.js +13 -14
- package/dist/common/src/lib/pmProxy.js +37 -16
- package/dist/common/src/lib/pmProxy.test/adapter.js +20 -4
- package/dist/common/src/lib/pmProxy.test/implementation.js +93 -34
- package/dist/common/src/lib/pmProxy.test/mockPMBase.js +9 -0
- package/dist/common/src/lib/pmProxy.test/specification.js +3 -0
- package/dist/common/src/mothership/index.js +5 -0
- package/dist/common/src/mothership/test.js +44 -25
- package/dist/common/src/types/features.js +34 -0
- package/dist/common/src/utils/api.js +57 -27
- package/dist/common/src/utils/featureUtils.js +29 -0
- package/dist/common/src/utils/logFiles.js +51 -0
- package/dist/common/src/utils/makePrompt.js +116 -0
- package/dist/common/src/web.html.js +2 -6
- package/dist/common/testeranto.config.js +54 -24
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/design-editor/DesignEditor.js +203 -0
- package/dist/module/design-editor/index.js +2 -0
- package/dist/module/design-editor/server.js +92 -0
- package/dist/module/design-editor/types.js +1 -0
- package/dist/module/src/App.js +19 -17
- package/dist/module/src/Node.js +4 -8
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +11 -35
- package/dist/module/src/PM/base.js +1 -1
- package/dist/module/src/PM/main.js +577 -109
- package/dist/module/src/PM/node.js +4 -2
- package/dist/module/src/PM/nodeSidecar.js +1 -0
- package/dist/module/src/PM/pure.js +20 -57
- package/dist/module/src/PM/pureSidecar.js +1 -1
- package/dist/module/src/PM/types.js +1 -0
- package/dist/module/src/PM/web.js +7 -4
- package/dist/module/src/Pure.js +1 -1
- package/dist/module/src/Pure.test.js +49 -79
- package/dist/module/src/ReportServer.js +8 -2
- package/dist/module/src/build.js +26 -38
- package/dist/module/src/components/DesignEditorPage.js +132 -0
- package/dist/module/src/components/SunriseAnimation.test/interface.js +32 -1
- package/dist/module/src/components/SunriseAnimation.test/types.js +1 -0
- package/dist/module/src/components/TestStatusBadge.js +1 -21
- package/dist/module/src/components/pure/AppFrame.js +32 -0
- package/dist/module/src/components/pure/AppFrame.test/implementation.js +57 -0
- package/dist/module/src/components/pure/AppFrame.test/index.js +9 -0
- package/dist/module/src/components/pure/AppFrame.test/specification.js +21 -0
- package/dist/module/src/components/pure/AppFrame.test/types.js +2 -0
- package/dist/module/src/components/pure/FeaturesReporterView.js +16 -0
- package/dist/module/src/components/pure/FeaturesReporterView.test/implementation.js +81 -0
- package/dist/module/src/components/pure/FeaturesReporterView.test/index.js +9 -0
- package/dist/module/src/components/pure/FeaturesReporterView.test/specification.js +23 -0
- package/dist/module/src/components/pure/FeaturesReporterView.test/types.js +1 -0
- package/dist/module/src/components/pure/ModalContent.js +79 -0
- package/dist/module/src/components/pure/ModalContent.test/implementation.js +32 -0
- package/dist/module/src/components/pure/ModalContent.test/index.js +53 -0
- package/dist/module/src/components/pure/ModalContent.test/specification.js +15 -0
- package/dist/module/src/components/pure/ModalContent.test/types.js +3 -0
- package/dist/module/src/{NavBar.js → components/pure/NavBar.js} +10 -11
- package/dist/module/src/components/pure/ProcessManager.js +75 -0
- package/dist/module/src/components/pure/ProcessManagerView.js +200 -0
- package/dist/module/src/components/pure/ProjectPageView.js +54 -77
- package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +167 -54
- package/dist/module/src/components/pure/ProjectPageView.test/index.js +5 -1
- package/dist/module/src/components/pure/ProjectPageView.test/specification.js +15 -2
- package/dist/module/src/components/pure/ProjectPageView.test/types.js +2 -0
- package/dist/module/src/components/pure/ProjectsPageView.js +21 -14
- package/dist/module/src/components/pure/SettingsButton.js +6 -0
- package/dist/module/src/components/pure/SingleProcessView.js +214 -0
- package/dist/module/src/components/pure/TestPageView.js +470 -142
- package/dist/module/src/components/pure/TestPageView.test/implementation.js +121 -0
- package/dist/module/src/components/pure/TestPageView.test/index.js +10 -0
- package/dist/module/src/components/pure/TestPageView.test/specification.js +22 -0
- package/dist/module/src/components/pure/TestPageView.test/types.js +3 -0
- package/dist/module/src/components/pure/ThemeCard.js +8 -0
- package/dist/module/src/components/stateful/FeaturesReporter.js +22 -0
- package/dist/module/src/components/stateful/FileTree.js +33 -0
- package/dist/module/src/components/stateful/ProcessManagerPage.js +75 -0
- package/dist/module/src/components/stateful/ProjectPage.js +7 -6
- package/dist/module/src/components/stateful/ProjectsPage.js +32 -6
- package/dist/module/src/components/stateful/SettingsPage.js +35 -0
- package/dist/module/src/components/stateful/SingleProcessPage.js +110 -0
- package/dist/module/src/components/stateful/TestPage.js +123 -13
- package/dist/module/src/components/stateful/TextEditorPage.js +117 -0
- package/dist/module/src/defaultConfig.js +1 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +3 -4
- package/dist/module/src/esbuildConfigs/web.js +1 -1
- package/dist/module/src/lib/BaseSuite.js +7 -3
- package/dist/module/src/lib/BaseSuite.test/mock.js +17 -41
- package/dist/module/src/lib/BaseSuite.test/test.js +33 -42
- package/dist/module/src/lib/Sidecar.js +1 -0
- package/dist/module/src/lib/abstractBase.js +40 -13
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +12 -12
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +15 -13
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +28 -17
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.pure.js +1 -1
- package/dist/module/src/lib/basebuilder.js +29 -35
- package/dist/module/src/lib/classBuilder.js +5 -3
- package/dist/module/src/lib/core.js +3 -6
- package/dist/module/src/lib/core.test/MockCore.js +0 -14
- package/dist/module/src/lib/core.test/core.test.adapter.js +2 -9
- package/dist/module/src/lib/core.test/core.test.implementation.js +3 -7
- package/dist/module/src/lib/index.js +13 -14
- package/dist/module/src/lib/pmProxy.js +37 -16
- package/dist/module/src/lib/pmProxy.test/adapter.js +20 -4
- package/dist/module/src/lib/pmProxy.test/implementation.js +93 -34
- package/dist/module/src/lib/pmProxy.test/mockPMBase.js +9 -0
- package/dist/module/src/lib/pmProxy.test/specification.js +3 -0
- package/dist/module/src/mothership/index.js +5 -0
- package/dist/module/src/mothership/test.js +44 -25
- package/dist/module/src/types/features.js +31 -0
- package/dist/module/src/utils/api.js +56 -25
- package/dist/module/src/utils/featureUtils.js +24 -0
- package/dist/module/src/utils/logFiles.js +46 -0
- package/dist/module/src/utils/makePrompt.js +109 -0
- package/dist/module/src/web.html.js +2 -6
- package/dist/module/testeranto.config.js +54 -24
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.css +53 -80
- package/dist/prebuild/App.js +15520 -4397
- package/dist/prebuild/ReportServer.mjs +104 -6
- package/dist/prebuild/build.mjs +95 -108
- package/dist/prebuild/mothership/index.mjs +5 -0
- package/dist/prebuild/run.mjs +704 -221
- package/dist/types/design-editor/DesignEditor.d.ts +18 -0
- package/dist/types/design-editor/server.d.ts +1 -0
- package/dist/types/src/App.d.ts +1 -0
- package/dist/types/src/PM/index.d.ts +1 -1
- package/dist/types/src/PM/main.d.ts +37 -3
- package/dist/types/src/PM/pure.d.ts +10 -7
- package/dist/types/src/PM/web.d.ts +1 -1
- package/dist/types/src/Pure.test.d.ts +13 -1
- package/dist/types/src/Types.d.ts +1 -0
- package/dist/types/src/components/DesignEditorPage.d.ts +1 -0
- package/dist/types/src/components/SunriseAnimation.d.ts +5 -0
- package/dist/types/src/components/SunriseAnimation.test/interface.d.ts +11 -0
- package/dist/types/src/components/SunriseAnimation.test/types.d.ts +39 -0
- package/dist/types/src/components/pure/AppFrame.d.ts +11 -0
- package/dist/types/src/components/pure/AppFrame.test/implementation.d.ts +3 -0
- package/dist/types/src/components/pure/AppFrame.test/index.d.ts +5 -0
- package/dist/types/src/components/pure/AppFrame.test/specification.d.ts +3 -0
- package/dist/types/src/components/pure/AppFrame.test/types.d.ts +33 -0
- package/dist/types/src/components/pure/FeaturesReporterView.d.ts +7 -0
- package/dist/types/src/components/pure/FeaturesReporterView.test/implementation.d.ts +3 -0
- package/dist/types/src/components/pure/FeaturesReporterView.test/index.d.ts +2 -0
- package/dist/types/src/components/pure/FeaturesReporterView.test/specification.d.ts +3 -0
- package/dist/types/src/components/pure/FeaturesReporterView.test/types.d.ts +54 -0
- package/dist/types/src/components/pure/ModalContent.d.ts +7 -0
- package/dist/types/src/components/pure/ModalContent.test/implementation.d.ts +3 -0
- package/dist/types/src/components/pure/ModalContent.test/index.d.ts +3 -0
- package/dist/types/src/components/pure/ModalContent.test/specification.d.ts +3 -0
- package/dist/types/src/components/pure/ModalContent.test/types.d.ts +45 -0
- package/dist/types/src/{NavBar.d.ts → components/pure/NavBar.d.ts} +4 -0
- package/dist/types/src/components/pure/ProcessManager.d.ts +8 -0
- package/dist/types/src/components/pure/ProcessManagerView.d.ts +20 -0
- package/dist/types/src/components/pure/ProjectPageView.d.ts +7 -7
- package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +1 -2
- package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +29 -11
- package/dist/types/src/components/pure/ProjectsPageView.d.ts +29 -0
- package/dist/types/src/components/pure/SettingsButton.d.ts +2 -0
- package/dist/types/src/components/pure/SingleProcessView.d.ts +0 -0
- package/dist/types/src/components/pure/TestPageView.d.ts +15 -0
- package/dist/types/src/components/pure/TestPageView.test/implementation.d.ts +12 -0
- package/dist/types/src/components/pure/TestPageView.test/index.d.ts +3 -0
- package/dist/types/src/components/pure/TestPageView.test/specification.d.ts +11 -0
- package/dist/types/src/components/pure/TestPageView.test/types.d.ts +65 -0
- package/dist/types/src/components/pure/ThemeCard.d.ts +9 -0
- package/dist/types/src/components/stateful/FeaturesReporter.d.ts +2 -0
- package/dist/types/src/components/stateful/FileTree.d.ts +8 -0
- package/dist/types/src/components/stateful/ProcessManagerPage.d.ts +2 -0
- package/dist/types/src/components/stateful/ProjectPage.d.ts +1 -0
- package/dist/types/src/components/stateful/ProjectsPage.d.ts +1 -0
- package/dist/types/src/components/stateful/SettingsPage.d.ts +2 -0
- package/dist/types/src/components/stateful/SingleProcessPage.d.ts +2 -0
- package/dist/types/src/components/stateful/TestPage.d.ts +1 -0
- package/dist/types/src/components/stateful/TextEditorPage.d.ts +1 -0
- package/dist/types/src/lib/BaseSuite.test/mock.d.ts +3 -3
- package/dist/types/src/lib/abstractBase.d.ts +1 -1
- package/dist/types/src/lib/abstractBase.test/MockGiven.d.ts +1 -1
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +1 -1
- package/dist/types/src/lib/basebuilder.d.ts +1 -1
- package/dist/types/src/lib/index.d.ts +8 -8
- package/dist/types/src/lib/pmProxy.test/mockPMBase.d.ts +1 -1
- package/dist/types/src/types/features.d.ts +7 -0
- package/dist/types/src/utils/api.d.ts +1 -5
- package/dist/types/src/utils/featureUtils.d.ts +6 -0
- package/dist/types/src/utils/logFiles.d.ts +71 -0
- package/dist/types/src/utils/makePrompt.d.ts +2 -0
- package/dist/types/src/web.html.d.ts +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/index.md +17 -0
- package/docs/test-page-components.md +91 -0
- package/docs/testing.prompt.txt +1 -3
- package/index.d.ts +38 -13
- package/marketing.md +166 -0
- package/package.json +38 -11
- package/src/App.tsx +22 -25
- package/src/Node.ts +6 -9
- package/src/PM/PM_WithEslintAndTsc.ts +16 -97
- package/src/PM/__tests__/nodeSidecar.testeranto.ts +2 -0
- package/src/PM/base.ts +1 -3
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +673 -128
- package/src/PM/node.ts +5 -2
- package/src/PM/nodeSidecar.ts +1 -0
- package/src/PM/pure.ts +28 -72
- package/src/PM/pureSidecar.ts +1 -1
- package/src/PM/types.ts +0 -0
- package/src/PM/web.ts +9 -4
- package/src/Pure.test.ts +66 -101
- package/src/Pure.ts +1 -1
- package/src/README.md +85 -0
- package/src/ReportServer.ts +10 -3
- package/src/Types.ts +1 -0
- package/src/app.scss +169 -0
- package/src/build.ts +33 -55
- package/src/components/DesignEditorPage.tsx +169 -0
- package/src/components/{pure/ProjectPageView.test/index.ts → SunriseAnimation.test/index.tsx} +7 -4
- package/src/components/SunriseAnimation.test/interface.ts +49 -0
- package/src/components/SunriseAnimation.test/types.ts +53 -0
- package/src/components/TestStatusBadge.tsx +2 -23
- package/src/components/pure/AppFrame.test/implementation.tsx +72 -0
- package/src/components/pure/AppFrame.test/index.tsx +22 -0
- package/src/components/pure/AppFrame.test/specification.ts +35 -0
- package/src/components/pure/AppFrame.test/types.ts +65 -0
- package/src/components/pure/AppFrame.tsx +134 -0
- package/src/components/pure/FeaturesReporterView.test/implementation.tsx +106 -0
- package/src/components/pure/FeaturesReporterView.test/index.tsx +18 -0
- package/src/components/pure/FeaturesReporterView.test/specification.ts +39 -0
- package/src/components/pure/FeaturesReporterView.test/types.ts +77 -0
- package/src/components/pure/FeaturesReporterView.tsx +37 -0
- package/src/components/pure/ModalContent.test/implementation.tsx +45 -0
- package/src/components/pure/ModalContent.test/index.tsx +67 -0
- package/src/components/pure/ModalContent.test/specification.ts +27 -0
- package/src/components/pure/ModalContent.test/types.ts +72 -0
- package/src/components/pure/ModalContent.tsx +182 -0
- package/src/{NavBar.tsx → components/pure/NavBar.tsx} +31 -15
- package/src/components/pure/ProcessManager.tsx +117 -0
- package/src/components/pure/ProcessManagerView.tsx +414 -0
- package/src/components/pure/ProjectPageView.test/implementation.tsx +186 -57
- package/src/components/pure/ProjectPageView.test/index.tsx +18 -0
- package/src/components/pure/ProjectPageView.test/specification.ts +15 -2
- package/src/components/pure/ProjectPageView.test/types.ts +57 -13
- package/src/components/pure/ProjectPageView.tsx +155 -121
- package/src/components/pure/ProjectsPageView.tsx +73 -32
- package/src/components/pure/SettingsButton.md +1 -0
- package/src/components/pure/SettingsButton.tsx +11 -0
- package/src/components/pure/SingleProcessView.tsx +235 -0
- package/src/components/pure/TestPageView.test/implementation.ts +162 -0
- package/src/components/pure/TestPageView.test/index.tsx +20 -0
- package/src/components/pure/TestPageView.test/specification.ts +58 -0
- package/src/components/pure/TestPageView.test/types.ts +92 -0
- package/src/components/pure/TestPageView.tsx +1009 -299
- package/src/components/pure/ThemeCard.tsx +34 -0
- package/src/components/stateful/FeaturesReporter.tsx +24 -0
- package/src/components/stateful/FileTree.tsx +66 -0
- package/src/components/stateful/ProcessManagerPage.tsx +108 -0
- package/src/components/stateful/ProjectPage.tsx +10 -8
- package/src/components/stateful/ProjectsPage.tsx +36 -7
- package/src/components/stateful/SettingsPage.tsx +82 -0
- package/src/components/stateful/SingleProcessPage.tsx +155 -0
- package/src/components/stateful/TestPage.tsx +147 -30
- package/src/components/stateful/TextEditorPage.tsx +170 -0
- package/src/defaultConfig.ts +1 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +3 -4
- package/src/esbuildConfigs/web.ts +2 -1
- package/src/lib/BaseSuite.test/mock.ts +21 -68
- package/src/lib/BaseSuite.test/test.ts +39 -65
- package/src/lib/BaseSuite.ts +9 -3
- package/src/lib/Sidecar.ts +2 -0
- package/src/lib/abstractBase.test/MockGiven.ts +1 -1
- package/src/lib/abstractBase.ts +47 -20
- package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +14 -13
- package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +17 -14
- package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +27 -17
- package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +1 -1
- package/src/lib/basebuilder.ts +48 -54
- package/src/lib/classBuilder.ts +11 -10
- package/src/lib/core.test/MockCore.ts +0 -23
- package/src/lib/core.test/core.test.adapter.ts +6 -12
- package/src/lib/core.test/core.test.implementation.ts +7 -10
- package/src/lib/core.ts +5 -20
- package/src/lib/index.ts +28 -27
- package/src/lib/pmProxy.test/adapter.ts +18 -4
- package/src/lib/pmProxy.test/implementation.ts +130 -46
- package/src/lib/pmProxy.test/mockPMBase.ts +12 -1
- package/src/lib/pmProxy.test/specification.ts +11 -0
- package/src/lib/pmProxy.ts +42 -17
- package/src/lib/types.ts +2 -0
- package/src/mothership/index.ts +6 -0
- package/src/mothership/test.ts +53 -26
- package/src/style.md +2 -0
- package/src/style.scss +3 -486
- package/src/templates/frontpage.html +331 -0
- package/src/templates/frontpage.md +79 -0
- package/src/themes.scss +48 -16
- package/src/types/features.ts +38 -0
- package/src/utils/api.ts +66 -33
- package/src/utils/featureUtils.tsx +42 -0
- package/src/utils/logFiles.ts +60 -0
- package/src/utils/makePrompt.ts +149 -0
- package/src/web.html.ts +6 -6
- package/stargazers.txt +15 -0
- package/stargzers.js +68 -0
- package/testeranto/App.css +53 -80
- package/testeranto/App.js +15520 -4397
- package/testeranto/bundles/node/core/chunk-4CSH4UJE.mjs +872 -0
- package/testeranto/bundles/node/core/chunk-4JTDLQVA.mjs +253 -0
- package/testeranto/bundles/node/core/chunk-C3APFDUV.mjs +70 -0
- package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +295 -0
- package/testeranto/bundles/node/core/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +243 -0
- package/testeranto/bundles/node/core/src/lib/classBuilder.test/classBuilder.test.mjs +411 -0
- package/testeranto/bundles/node/core/src/lib/core.test/core.test.mjs +494 -0
- package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +4755 -0
- package/testeranto/bundles/pure/core/chunk-62UVCSQC.mjs +1022 -0
- package/testeranto/bundles/pure/core/src/Pure.test.mjs +410 -0
- package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +352 -0
- package/testeranto/bundles/pure/core/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +241 -0
- package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.html +15 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.html +1 -5
- package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.html +15 -0
- package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.html +15 -0
- package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.html +15 -0
- package/testeranto/metafiles/node/core.json +2906 -0
- package/testeranto/metafiles/pure/core.json +860 -0
- package/testeranto/metafiles/web/core.json +546 -0
- package/testeranto/reports/core/config.json +103 -2
- 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/message.txt +17 -0
- package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +14 -0
- package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +71 -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 +3 -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 +0 -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 +3 -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 +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/error.log +3 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/exit.log +1 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/info.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +14 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stderr.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stdout.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +31 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +61 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/exit.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/message.txt +17 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +15 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +61 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/debug.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/error.log +3 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/exit.log +1 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/info.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +10 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/stderr.log +0 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/stdout.log +6 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +1 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-1/butThen/artifact_test.txt +1 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +71 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +42 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/exit.log +0 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +10 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +17 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +42 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/debug.log +0 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/error.log +3 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/exit.log +1 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/info.log +0 -0
- package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/stderr.log +0 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/stdout.log +619 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/tests.json +165 -0
- package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +88 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/lint_errors.txt +21 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/prompt.txt +19 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/stderr.log +0 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/stdout.log +0 -0
- package/testeranto/reports/core/src/lib/core.test/core.test/node/type_errors.txt +45 -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 +88 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +10 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/tests.json +152 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +52 -0
- package/testeranto/reports/core/summary.json +74 -5
- package/testeranto/reportsweb_build_errors +546 -0
- package/testeranto.config.ts +58 -25
- package/tsc.log +378 -211
- package/tsconfig.common.json +4 -2
- package/tsconfig.json +9 -6
- package/tsconfig.module.json +3 -2
- package/tsconfig.types.json +3 -1
- package/dist/common/src/components/pure/ProjectPageView.test/adapter.js +0 -20
- package/dist/common/src/lib/dailyAnimation.js +0 -130
- package/dist/module/src/Footer.js +0 -5
- package/dist/module/src/ProjectPage.js +0 -319
- package/dist/module/src/ProjectsPage.js +0 -1
- package/dist/module/src/SettingsButton.js +0 -157
- package/dist/module/src/TestPage.js +0 -271
- package/dist/module/src/TestReport.js +0 -368
- package/dist/module/src/components/pure/ProjectPageView.test/adapter.js +0 -17
- package/dist/module/src/lib/dailyAnimation.js +0 -130
- package/dist/types/src/components/pure/ProjectPageView.test/adapter.d.ts +0 -3
- package/dist/types/testeranto.config.d.ts +0 -3
- package/docs/testing.ai.txt +0 -106
- package/docs.html +0 -572
- package/example.css +0 -351
- package/index.html +0 -284
- package/scripts/compile-docs.js +0 -140
- package/src/App.scss +0 -132
- package/src/Footer.tsx +0 -8
- package/src/Project.scss +0 -1
- package/src/ProjectPage.tsx +0 -459
- package/src/ProjectsPage.tsx +0 -1
- package/src/ReportApp.scss +0 -1
- package/src/SettingsButton.tsx +0 -268
- package/src/TestPage.tsx +0 -476
- package/src/TestReport.scss +0 -24
- package/src/TestReport.tsx +0 -411
- package/src/components/pure/ProjectPageView.test/adapter.ts +0 -21
- package/src/fonts.scss +0 -55
- package/src/lib/dailyAnimation.ts +0 -147
- package/style.css +0 -12156
- package/testeranto/bundles/node/core/metafile.json +0 -8
- package/testeranto/bundles/pure/core/metafile.json +0 -8
- package/testeranto/bundles/web/core/metafile.json +0 -15086
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +0 -39991
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +0 -18
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +0 -59
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -2
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -27
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +0 -50
- /package/dist/types/src/{lib/dailyAnimation.d.ts → PM/types.d.ts} +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 [Adam Wong, Demiurge Labs]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
# testeranto
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Brings vibe coding to the real world
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Testeranto lets you vibe code large, real-world codebases by intelligently managing the AI context
|
|
6
|
+
|
|
7
|
+
#### 🚀 Join Our Beta Program! 🚀
|
|
8
|
+
|
|
9
|
+
We're launching a private beta for GitHub stargazers first, followed by a public beta.
|
|
10
|
+
|
|
11
|
+
**Private Beta **
|
|
12
|
+
|
|
13
|
+
- Early access to AI-powered test fixing
|
|
14
|
+
- Lifetime priority support from the creator
|
|
15
|
+
- Personal onboarding assistance
|
|
16
|
+
- Direct influence on the roadmap
|
|
17
|
+
- Permanent "Beta Pioneer" status
|
|
18
|
+
|
|
19
|
+
[email us](mailto:testeranto.dev@gmail.com) to express interest.
|
|
6
20
|
|
|
7
21
|
## quick links
|
|
8
22
|
|
|
9
|
-
-
|
|
23
|
+
- Example test reports: [adamwong246.github.io/testeranto/testeranto](https://adamwong246.github.io/testeranto/testeranto/projects.html)
|
|
10
24
|
- demo of me using testeranto to fix a bug: [youtube](https://www.youtube.com/embed/WvU5xMqGi6Q)
|
|
11
25
|
- a starter testeranto project: [testeranto-starter](https://github.com/adamwong246/testeranto-starter)
|
|
26
|
+
- Explainer video source: [github.com/adamwong246/testeranto-video](https://github.com/adamwong246/testeranto-video)
|
|
12
27
|
|
|
13
28
|
## What is testeranto?
|
|
14
29
|
|
|
@@ -18,7 +33,12 @@
|
|
|
18
33
|
- Testeranto can be used to test anything that can be bundled with esbuild.
|
|
19
34
|
- Testeranto connects "features" to "tests". This allows the AI to read feature documentation from external systems, like Jira.
|
|
20
35
|
- Testeranto generates test results as a static website that can be easily deployed to GitHub Pages.
|
|
21
|
-
- Testeranto uses esbuild to
|
|
36
|
+
- Testeranto uses esbuild to analyze dependencies and bundle only the essential files needed for test fixing. This context optimization means:
|
|
37
|
+
- No wasted tokens on irrelevant code
|
|
38
|
+
- All type signatures and dependencies included
|
|
39
|
+
- Related documentation automatically linked
|
|
40
|
+
- Failed tests get priority placement
|
|
41
|
+
- **The result:** Your LLM works with laser focus on exactly what needs fixing
|
|
22
42
|
|
|
23
43
|
## Key Technologies
|
|
24
44
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6.7.1",
|
|
3
|
+
"objects": [
|
|
4
|
+
{
|
|
5
|
+
"radius": 50,
|
|
6
|
+
"startAngle": 0,
|
|
7
|
+
"endAngle": 360,
|
|
8
|
+
"counterClockwise": false,
|
|
9
|
+
"type": "Circle",
|
|
10
|
+
"version": "6.7.1",
|
|
11
|
+
"originX": "left",
|
|
12
|
+
"originY": "top",
|
|
13
|
+
"left": 80.9524,
|
|
14
|
+
"top": 200,
|
|
15
|
+
"width": 100,
|
|
16
|
+
"height": 100,
|
|
17
|
+
"fill": "blue",
|
|
18
|
+
"stroke": null,
|
|
19
|
+
"strokeWidth": 1,
|
|
20
|
+
"strokeDashArray": null,
|
|
21
|
+
"strokeLineCap": "butt",
|
|
22
|
+
"strokeDashOffset": 0,
|
|
23
|
+
"strokeLineJoin": "miter",
|
|
24
|
+
"strokeUniform": false,
|
|
25
|
+
"strokeMiterLimit": 4,
|
|
26
|
+
"scaleX": 5.2241,
|
|
27
|
+
"scaleY": 1,
|
|
28
|
+
"angle": 0,
|
|
29
|
+
"flipX": false,
|
|
30
|
+
"flipY": false,
|
|
31
|
+
"opacity": 1,
|
|
32
|
+
"shadow": null,
|
|
33
|
+
"visible": true,
|
|
34
|
+
"backgroundColor": "",
|
|
35
|
+
"fillRule": "nonzero",
|
|
36
|
+
"paintFirst": "fill",
|
|
37
|
+
"globalCompositeOperation": "source-over",
|
|
38
|
+
"skewX": 0,
|
|
39
|
+
"skewY": 0
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"background": "#ffffff",
|
|
43
|
+
"projectId": "default-project"
|
|
44
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
3
|
+
import { Canvas, Rect, Circle, Text } from 'fabric';
|
|
4
|
+
import { toPng } from 'html-to-image';
|
|
5
|
+
|
|
6
|
+
interface DesignObject {
|
|
7
|
+
type: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Design {
|
|
12
|
+
version: string;
|
|
13
|
+
background: string;
|
|
14
|
+
objects: DesignObject[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Collaborator {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface DesignEditorRef {
|
|
23
|
+
loadDesign: (design: Design) => void;
|
|
24
|
+
saveDesign: () => Design | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const DesignEditor = React.forwardRef<DesignEditorRef, { projectId: string }>(
|
|
28
|
+
({ projectId }, ref) => {
|
|
29
|
+
const canvasRef = useRef<fabric.Canvas | null>(null);
|
|
30
|
+
const [design, setDesign] = useState<Design>({
|
|
31
|
+
objects: [],
|
|
32
|
+
background: '#ffffff',
|
|
33
|
+
version: '1.0'
|
|
34
|
+
});
|
|
35
|
+
const [collaborators, setCollaborators] = useState<Collaborator[]>([]);
|
|
36
|
+
const wsRef = useRef<WebSocket | null>(null);
|
|
37
|
+
|
|
38
|
+
// Initialize canvas and WebSocket connection
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const canvas = new Canvas('design-canvas', {
|
|
41
|
+
width: 800,
|
|
42
|
+
height: 600
|
|
43
|
+
});
|
|
44
|
+
canvas.backgroundColor = design.background;
|
|
45
|
+
canvasRef.current = canvas;
|
|
46
|
+
|
|
47
|
+
const wsPort = window.location.port ? Number(window.location.port) + 1 : 3001;
|
|
48
|
+
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
49
|
+
const host = window.location.hostname;
|
|
50
|
+
wsRef.current = new WebSocket(`${protocol}//${host}:${wsPort}/design?project=${projectId}`);
|
|
51
|
+
|
|
52
|
+
wsRef.current.onmessage = (event) => {
|
|
53
|
+
const message = JSON.parse(event.data);
|
|
54
|
+
if (message.type === 'design_update' && canvasRef.current) {
|
|
55
|
+
canvasRef.current.loadFromJSON(message.data, () => {
|
|
56
|
+
canvasRef.current?.renderAll();
|
|
57
|
+
});
|
|
58
|
+
} else if (message.type === 'collaborators_update') {
|
|
59
|
+
setCollaborators(message.data);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return () => {
|
|
64
|
+
wsRef.current?.close();
|
|
65
|
+
canvas.dispose();
|
|
66
|
+
};
|
|
67
|
+
}, [projectId]);
|
|
68
|
+
|
|
69
|
+
const addShape = (shape: string) => {
|
|
70
|
+
if (!canvasRef.current) return;
|
|
71
|
+
|
|
72
|
+
let object;
|
|
73
|
+
switch (shape) {
|
|
74
|
+
case 'rectangle':
|
|
75
|
+
object = new Rect({
|
|
76
|
+
width: 100,
|
|
77
|
+
height: 100,
|
|
78
|
+
fill: 'red',
|
|
79
|
+
left: 100,
|
|
80
|
+
top: 100
|
|
81
|
+
});
|
|
82
|
+
break;
|
|
83
|
+
case 'circle':
|
|
84
|
+
object = new Circle({
|
|
85
|
+
radius: 50,
|
|
86
|
+
fill: 'blue',
|
|
87
|
+
left: 200,
|
|
88
|
+
top: 200
|
|
89
|
+
});
|
|
90
|
+
break;
|
|
91
|
+
case 'text':
|
|
92
|
+
object = new Text('Double click to edit', {
|
|
93
|
+
fontFamily: 'Arial',
|
|
94
|
+
fontSize: 20,
|
|
95
|
+
left: 100,
|
|
96
|
+
top: 300
|
|
97
|
+
});
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
canvasRef.current.add(object);
|
|
104
|
+
canvasRef.current.renderAll();
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const saveDesign = (): Design | null => {
|
|
108
|
+
if (!canvasRef.current) {
|
|
109
|
+
console.warn('Canvas ref is null, cannot save design');
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
// Get current canvas state
|
|
115
|
+
const json = canvasRef.current.toJSON() as Design;
|
|
116
|
+
setDesign(json);
|
|
117
|
+
|
|
118
|
+
// Send update to collaborators
|
|
119
|
+
if (wsRef.current) {
|
|
120
|
+
wsRef.current.send(JSON.stringify({
|
|
121
|
+
type: 'design_update',
|
|
122
|
+
data: json
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Force re-render of all objects
|
|
127
|
+
canvasRef.current.getObjects().forEach(obj => {
|
|
128
|
+
obj.set('dirty', true);
|
|
129
|
+
});
|
|
130
|
+
canvasRef.current.renderAll();
|
|
131
|
+
|
|
132
|
+
console.log('Design saved:', json);
|
|
133
|
+
return json;
|
|
134
|
+
} catch (err) {
|
|
135
|
+
console.error('Error saving design:', err);
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const loadDesign = (design: Design) => {
|
|
141
|
+
console.log('loadDesign called with:', design);
|
|
142
|
+
if (!canvasRef.current) {
|
|
143
|
+
console.warn('Canvas ref is null, cannot load design');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
console.log('Loading design into canvas...');
|
|
149
|
+
|
|
150
|
+
// Clear existing canvas
|
|
151
|
+
canvasRef.current.clear();
|
|
152
|
+
|
|
153
|
+
// Set background color
|
|
154
|
+
if (design.background) {
|
|
155
|
+
canvasRef.current.backgroundColor = design.background;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Load objects if they exist
|
|
159
|
+
if (design.objects && design.objects.length > 0) {
|
|
160
|
+
console.log('Loading objects:', design.objects.length);
|
|
161
|
+
canvasRef.current.loadFromJSON(design, () => {
|
|
162
|
+
console.log('Design loaded, rendering canvas...');
|
|
163
|
+
// Force re-render of all objects
|
|
164
|
+
canvasRef.current?.getObjects().forEach(obj => {
|
|
165
|
+
obj.set('dirty', true);
|
|
166
|
+
});
|
|
167
|
+
canvasRef.current?.renderAll();
|
|
168
|
+
console.log('Canvas rendered with new design');
|
|
169
|
+
});
|
|
170
|
+
} else {
|
|
171
|
+
console.log('No objects to load, rendering empty canvas');
|
|
172
|
+
canvasRef.current.renderAll();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Force immediate render
|
|
176
|
+
canvasRef.current.renderAll();
|
|
177
|
+
} catch (err) {
|
|
178
|
+
console.error('Error loading design:', err);
|
|
179
|
+
if (err instanceof Error) {
|
|
180
|
+
console.error('Error details:', {
|
|
181
|
+
name: err.name,
|
|
182
|
+
message: err.message,
|
|
183
|
+
stack: err.stack
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// Expose methods via ref
|
|
190
|
+
React.useImperativeHandle(ref, () => ({
|
|
191
|
+
loadDesign,
|
|
192
|
+
saveDesign
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
const exportAsPNG = async () => {
|
|
196
|
+
if (!canvasRef.current) return;
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
// Store current active object and hide controls
|
|
200
|
+
const activeObject = canvasRef.current.getActiveObject();
|
|
201
|
+
if (activeObject) {
|
|
202
|
+
canvasRef.current.discardActiveObject();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Render once to clear controls
|
|
206
|
+
canvasRef.current.renderAll();
|
|
207
|
+
|
|
208
|
+
// Get canvas element and export
|
|
209
|
+
const canvasElement = document.getElementById('design-canvas');
|
|
210
|
+
if (!canvasElement) return;
|
|
211
|
+
|
|
212
|
+
const dataUrl = await toPng(canvasElement);
|
|
213
|
+
const link = document.createElement('a');
|
|
214
|
+
link.download = `design-${projectId}.png`;
|
|
215
|
+
link.href = dataUrl;
|
|
216
|
+
link.click();
|
|
217
|
+
|
|
218
|
+
// Restore active object if there was one
|
|
219
|
+
if (activeObject) {
|
|
220
|
+
canvasRef.current.setActiveObject(activeObject);
|
|
221
|
+
canvasRef.current.renderAll();
|
|
222
|
+
}
|
|
223
|
+
} catch (error) {
|
|
224
|
+
console.error('Error exporting PNG:', error);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
<div className="design-editor">
|
|
230
|
+
<div className="toolbar">
|
|
231
|
+
<button onClick={() => addShape('rectangle')}>Add Rectangle</button>
|
|
232
|
+
<button onClick={() => addShape('circle')}>Add Circle</button>
|
|
233
|
+
<button onClick={() => addShape('text')}>Add Text</button>
|
|
234
|
+
<button onClick={exportAsPNG}>Export PNG</button>
|
|
235
|
+
</div>
|
|
236
|
+
<canvas id="design-canvas" />
|
|
237
|
+
<div className="collaborators">
|
|
238
|
+
<h3>Collaborators ({collaborators.length})</h3>
|
|
239
|
+
<ul>
|
|
240
|
+
{collaborators.map(user => (
|
|
241
|
+
<li key={user.id}>{user.name}</li>
|
|
242
|
+
))}
|
|
243
|
+
</ul>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
);
|
|
247
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import { WebSocketServer, WebSocket } from "ws";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
|
|
7
|
+
interface Design {
|
|
8
|
+
version: string;
|
|
9
|
+
background: string;
|
|
10
|
+
objects: any[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Project {
|
|
14
|
+
connections: Set<any>;
|
|
15
|
+
design: Design;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const projects = new Map<string, Project>();
|
|
19
|
+
|
|
20
|
+
export function startDesignEditorServer(wssPort: number, httpPort?: number) {
|
|
21
|
+
const wss = new WebSocketServer({ port: wssPort });
|
|
22
|
+
|
|
23
|
+
wss.on("connection", (ws: WebSocket, req) => {
|
|
24
|
+
// Create URL from request URL and host header
|
|
25
|
+
const url = new URL(req.url || "", `http://${req.headers.host}`);
|
|
26
|
+
const projectId = url.searchParams.get("project") || "default";
|
|
27
|
+
|
|
28
|
+
if (!projects.has(projectId)) {
|
|
29
|
+
projects.set(projectId, {
|
|
30
|
+
connections: new Set(),
|
|
31
|
+
design: loadDesign(projectId),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const project = projects.get(projectId)!;
|
|
36
|
+
project.connections.add(ws);
|
|
37
|
+
|
|
38
|
+
// Send current design to new collaborator
|
|
39
|
+
ws.send(
|
|
40
|
+
JSON.stringify({
|
|
41
|
+
type: "design_update",
|
|
42
|
+
data: project.design,
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
broadcastCollaborators(projectId);
|
|
47
|
+
|
|
48
|
+
ws.on("message", (message: string) => {
|
|
49
|
+
const data = JSON.parse(message);
|
|
50
|
+
if (data.type === "design_update") {
|
|
51
|
+
project.design = data.data;
|
|
52
|
+
saveDesign(projectId, data.data);
|
|
53
|
+
broadcastToProject(projectId, message.toString());
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
ws.on("close", (code: number, reason: Buffer) => {
|
|
58
|
+
project.connections.delete(ws);
|
|
59
|
+
if (project.connections.size === 0) {
|
|
60
|
+
projects.delete(projectId);
|
|
61
|
+
} else {
|
|
62
|
+
broadcastCollaborators(projectId);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
console.log(`Design editor WebSocket server running on port ${wssPort}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function broadcastToProject(projectId: string, message: string) {
|
|
71
|
+
const project = projects.get(projectId);
|
|
72
|
+
if (project) {
|
|
73
|
+
project.connections.forEach((client: WebSocket) => {
|
|
74
|
+
if (client.readyState === client.OPEN) {
|
|
75
|
+
client.send(message);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function broadcastCollaborators(projectId: string) {
|
|
82
|
+
const project = projects.get(projectId);
|
|
83
|
+
if (project) {
|
|
84
|
+
const collaborators = Array.from(project.connections).map((_, i) => ({
|
|
85
|
+
id: `user-${i}`,
|
|
86
|
+
name: `Collaborator ${i + 1}`,
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
broadcastToProject(
|
|
90
|
+
projectId,
|
|
91
|
+
JSON.stringify({
|
|
92
|
+
type: "collaborators_update",
|
|
93
|
+
data: collaborators,
|
|
94
|
+
})
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function loadDesign(projectId: string): Design {
|
|
100
|
+
const designsDir = path.join(process.cwd(), "designs");
|
|
101
|
+
const filePath = path.join(designsDir, `${projectId}.json`);
|
|
102
|
+
try {
|
|
103
|
+
const data = fs.readFileSync(filePath, "utf-8");
|
|
104
|
+
return JSON.parse(data);
|
|
105
|
+
} catch {
|
|
106
|
+
return {
|
|
107
|
+
version: "1.0",
|
|
108
|
+
background: "#ffffff",
|
|
109
|
+
objects: [],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function saveDesign(projectId: string, design: Design) {
|
|
115
|
+
const designsDir = path.join(process.cwd(), "designs");
|
|
116
|
+
if (!fs.existsSync(designsDir)) {
|
|
117
|
+
fs.mkdirSync(designsDir, { recursive: true });
|
|
118
|
+
}
|
|
119
|
+
const filePath = path.join(designsDir, `${projectId}.json`);
|
|
120
|
+
fs.writeFileSync(filePath, JSON.stringify(design, null, 2));
|
|
121
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
export interface DesignObject {
|
|
3
|
+
type: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Design {
|
|
8
|
+
version: string;
|
|
9
|
+
background: string;
|
|
10
|
+
objects: DesignObject[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface Collaborator {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}
|