creevey 0.9.0-non-webpack.2.fix-capture-element → 0.9.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/.yarnrc.yml +1 -0
- package/CHANGELOG.md +51 -0
- package/README.md +4 -3
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/addon/components/Addon.d.ts +8 -0
- package/dist/client/addon/components/Addon.js +57 -0
- package/dist/client/addon/components/Addon.js.map +1 -0
- package/{lib/types → dist}/client/addon/components/Icons.d.ts +7 -7
- package/dist/client/addon/components/Icons.js +18 -0
- package/dist/client/addon/components/Icons.js.map +1 -0
- package/{lib/types → dist}/client/addon/components/Panel.d.ts +9 -9
- package/dist/client/addon/components/Panel.js +32 -0
- package/dist/client/addon/components/Panel.js.map +1 -0
- package/{lib/types → dist}/client/addon/components/TestSelect.d.ts +8 -8
- package/dist/client/addon/components/TestSelect.js +33 -0
- package/dist/client/addon/components/TestSelect.js.map +1 -0
- package/dist/client/addon/components/Tools.d.ts +6 -0
- package/dist/client/addon/components/Tools.js +89 -0
- package/dist/client/addon/components/Tools.js.map +1 -0
- package/{lib/types/client/addon/Manager.d.ts → dist/client/addon/controller.d.ts} +38 -37
- package/dist/client/addon/controller.js +208 -0
- package/dist/client/addon/controller.js.map +1 -0
- package/dist/client/addon/decorator.d.ts +1 -0
- package/dist/client/addon/decorator.js +6 -0
- package/dist/client/addon/decorator.js.map +1 -0
- package/dist/client/addon/index.d.ts +2 -0
- package/dist/client/addon/index.js +19 -0
- package/dist/client/addon/index.js.map +1 -0
- package/dist/client/addon/manager.d.ts +1 -0
- package/dist/client/addon/manager.js +41 -0
- package/dist/client/addon/manager.js.map +1 -0
- package/dist/client/addon/preset.d.ts +2 -0
- package/dist/client/addon/preset.js +6 -0
- package/dist/client/addon/preset.js.map +1 -0
- package/dist/client/addon/preview.d.ts +4 -0
- package/dist/client/addon/preview.js +8 -0
- package/dist/client/addon/preview.js.map +1 -0
- package/{lib/types → dist}/client/addon/readyForCapture.d.ts +6 -6
- package/dist/client/addon/readyForCapture.js +7 -0
- package/dist/client/addon/readyForCapture.js.map +1 -0
- package/{lib/types → dist}/client/addon/utils.d.ts +3 -2
- package/dist/client/addon/utils.js +27 -0
- package/dist/client/addon/utils.js.map +1 -0
- package/{lib/types → dist}/client/addon/withCreevey.d.ts +25 -24
- package/dist/client/addon/withCreevey.js +286 -0
- package/dist/client/addon/withCreevey.js.map +1 -0
- package/dist/client/shared/components/ImagesView/BlendView.d.ts +5 -0
- package/dist/client/shared/components/ImagesView/BlendView.js +74 -0
- package/dist/client/shared/components/ImagesView/BlendView.js.map +1 -0
- package/dist/client/shared/components/ImagesView/ImagesView.d.ts +9 -0
- package/dist/client/shared/components/ImagesView/ImagesView.js +46 -0
- package/dist/client/shared/components/ImagesView/ImagesView.js.map +1 -0
- package/dist/client/shared/components/ImagesView/SideBySideView.d.ts +5 -0
- package/dist/client/shared/components/ImagesView/SideBySideView.js +121 -0
- package/dist/client/shared/components/ImagesView/SideBySideView.js.map +1 -0
- package/dist/client/shared/components/ImagesView/SlideView.d.ts +5 -0
- package/dist/client/shared/components/ImagesView/SlideView.js +136 -0
- package/dist/client/shared/components/ImagesView/SlideView.js.map +1 -0
- package/dist/client/shared/components/ImagesView/SwapView.d.ts +5 -0
- package/dist/client/shared/components/ImagesView/SwapView.js +72 -0
- package/dist/client/shared/components/ImagesView/SwapView.js.map +1 -0
- package/{lib/types/client/shared/components/ImagesView/ImagesView.d.ts → dist/client/shared/components/ImagesView/common.d.ts} +15 -24
- package/dist/client/shared/components/ImagesView/common.js +14 -0
- package/dist/client/shared/components/ImagesView/common.js.map +1 -0
- package/dist/client/shared/components/ImagesView/index.d.ts +5 -0
- package/dist/client/shared/components/ImagesView/index.js +14 -0
- package/dist/client/shared/components/ImagesView/index.js.map +1 -0
- package/{lib/types → dist}/client/shared/components/PageFooter/PageFooter.d.ts +8 -8
- package/dist/client/shared/components/PageFooter/PageFooter.js +25 -0
- package/dist/client/shared/components/PageFooter/PageFooter.js.map +1 -0
- package/{lib/types → dist}/client/shared/components/PageFooter/Paging.d.ts +7 -7
- package/dist/client/shared/components/PageFooter/Paging.js +68 -0
- package/dist/client/shared/components/PageFooter/Paging.js.map +1 -0
- package/{lib/types → dist}/client/shared/components/PageHeader/ImagePreview.d.ts +14 -12
- package/dist/client/shared/components/PageHeader/ImagePreview.js +61 -0
- package/dist/client/shared/components/PageHeader/ImagePreview.js.map +1 -0
- package/{lib/types → dist}/client/shared/components/PageHeader/PageHeader.d.ts +14 -16
- package/dist/client/shared/components/PageHeader/PageHeader.js +86 -0
- package/dist/client/shared/components/PageHeader/PageHeader.js.map +1 -0
- package/{lib/types → dist}/client/shared/components/ResultsPage.d.ts +18 -18
- package/dist/client/shared/components/ResultsPage.js +95 -0
- package/dist/client/shared/components/ResultsPage.js.map +1 -0
- package/{lib/types → dist}/client/shared/creeveyClientApi.d.ts +9 -9
- package/dist/client/shared/creeveyClientApi.js +53 -0
- package/dist/client/shared/creeveyClientApi.js.map +1 -0
- package/{lib/types → dist}/client/shared/helpers.d.ts +46 -46
- package/dist/client/shared/helpers.js +381 -0
- package/dist/client/shared/helpers.js.map +1 -0
- package/{lib/types → dist}/client/shared/viewMode.d.ts +4 -4
- package/dist/client/shared/viewMode.js +11 -0
- package/dist/client/shared/viewMode.js.map +1 -0
- package/dist/client/web/202.js +1 -0
- package/dist/client/web/270.js +43 -0
- package/dist/client/web/752.js +1 -0
- package/{lib/types → dist}/client/web/CreeveyApp.d.ts +11 -11
- package/dist/client/web/CreeveyApp.js +130 -0
- package/dist/client/web/CreeveyApp.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyContext.d.ts +11 -11
- package/dist/client/web/CreeveyContext.js +17 -0
- package/dist/client/web/CreeveyContext.js.map +1 -0
- package/dist/client/web/CreeveyLoader.d.ts +3 -0
- package/dist/client/web/CreeveyLoader.js +52 -0
- package/dist/client/web/CreeveyLoader.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/Checkbox.d.ts +22 -19
- package/dist/client/web/CreeveyView/SideBar/Checkbox.js +86 -0
- package/dist/client/web/CreeveyView/SideBar/Checkbox.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/Search.d.ts +6 -6
- package/dist/client/web/CreeveyView/SideBar/Search.js +125 -0
- package/dist/client/web/CreeveyView/SideBar/Search.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/SideBar.d.ts +14 -14
- package/dist/client/web/CreeveyView/SideBar/SideBar.js +101 -0
- package/dist/client/web/CreeveyView/SideBar/SideBar.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/SideBarHeader.d.ts +12 -12
- package/dist/client/web/CreeveyView/SideBar/SideBarHeader.js +113 -0
- package/dist/client/web/CreeveyView/SideBar/SideBarHeader.js.map +1 -0
- package/dist/client/web/CreeveyView/SideBar/SuiteLink.d.ts +38 -0
- package/dist/client/web/CreeveyView/SideBar/SuiteLink.js +108 -0
- package/dist/client/web/CreeveyView/SideBar/SuiteLink.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/TestLink.d.ts +7 -7
- package/dist/client/web/CreeveyView/SideBar/TestLink.js +63 -0
- package/dist/client/web/CreeveyView/SideBar/TestLink.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/TestStatusIcon.d.ts +12 -10
- package/dist/client/web/CreeveyView/SideBar/TestStatusIcon.js +52 -0
- package/dist/client/web/CreeveyView/SideBar/TestStatusIcon.js.map +1 -0
- package/dist/client/web/CreeveyView/SideBar/TestsStatus.d.ts +11 -0
- package/dist/client/web/CreeveyView/SideBar/TestsStatus.js +74 -0
- package/dist/client/web/CreeveyView/SideBar/TestsStatus.js.map +1 -0
- package/{lib/types → dist}/client/web/CreeveyView/SideBar/Toggle.d.ts +6 -6
- package/dist/client/web/CreeveyView/SideBar/Toggle.js +69 -0
- package/dist/client/web/CreeveyView/SideBar/Toggle.js.map +1 -0
- package/dist/client/web/CreeveyView/SideBar/index.d.ts +1 -0
- package/dist/client/web/CreeveyView/SideBar/index.js +6 -0
- package/dist/client/web/CreeveyView/SideBar/index.js.map +1 -0
- package/{lib/types → dist}/client/web/KeyboardEventsContext.d.ts +15 -13
- package/dist/client/web/KeyboardEventsContext.js +116 -0
- package/dist/client/web/KeyboardEventsContext.js.map +1 -0
- package/{lib/types → dist}/client/web/index.d.ts +4 -4
- package/{lib/cjs → dist}/client/web/index.html +12 -3
- package/dist/client/web/index.js +75 -0
- package/dist/client/web/index.js.map +1 -0
- package/dist/client/web/main.js +79 -0
- package/{lib/cjs → dist}/client/web/main.js.LICENSE.txt +0 -15
- package/{lib/types → dist}/creevey.d.ts +1 -1
- package/dist/creevey.js +52 -0
- package/dist/creevey.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/{lib/types → dist}/server/config.d.ts +4 -4
- package/dist/server/config.js +86 -0
- package/dist/server/config.js.map +1 -0
- package/{lib/types → dist}/server/docker.d.ts +7 -7
- package/dist/server/docker.js +122 -0
- package/dist/server/docker.js.map +1 -0
- package/{lib/types → dist}/server/index.d.ts +2 -2
- package/dist/server/index.js +47 -0
- package/dist/server/index.js.map +1 -0
- package/{lib/types → dist}/server/logger.d.ts +10 -10
- package/dist/server/logger.js +25 -0
- package/dist/server/logger.js.map +1 -0
- package/{lib/types → dist}/server/master/api.d.ts +7 -7
- package/dist/server/master/api.js +50 -0
- package/dist/server/master/api.js.map +1 -0
- package/dist/server/master/index.d.ts +3 -0
- package/dist/server/master/index.js +110 -0
- package/dist/server/master/index.js.map +1 -0
- package/{lib/types → dist}/server/master/master.d.ts +7 -7
- package/dist/server/master/master.js +40 -0
- package/dist/server/master/master.js.map +1 -0
- package/{lib/types → dist}/server/master/pool.d.ts +30 -31
- package/dist/server/master/pool.js +186 -0
- package/dist/server/master/pool.js.map +1 -0
- package/{lib/types → dist}/server/master/runner.d.ts +21 -26
- package/dist/server/master/runner.js +172 -0
- package/dist/server/master/runner.js.map +1 -0
- package/dist/server/master/server.d.ts +2 -0
- package/dist/server/master/server.js +114 -0
- package/dist/server/master/server.js.map +1 -0
- package/{lib/types → dist}/server/messages.d.ts +26 -27
- package/dist/server/messages.js +222 -0
- package/dist/server/messages.js.map +1 -0
- package/{lib/types → dist}/server/selenium/browser.d.ts +19 -17
- package/dist/server/selenium/browser.js +637 -0
- package/dist/server/selenium/browser.js.map +1 -0
- package/dist/server/selenium/index.d.ts +2 -0
- package/dist/server/selenium/index.js +19 -0
- package/dist/server/selenium/index.js.map +1 -0
- package/{lib/types → dist}/server/selenium/selenoid.d.ts +3 -3
- package/dist/server/selenium/selenoid.js +120 -0
- package/dist/server/selenium/selenoid.js.map +1 -0
- package/dist/server/stories.d.ts +3 -0
- package/dist/server/stories.js +92 -0
- package/dist/server/stories.js.map +1 -0
- package/dist/server/storybook/providers/browser.d.ts +2 -0
- package/dist/server/storybook/providers/browser.js +60 -0
- package/dist/server/storybook/providers/browser.js.map +1 -0
- package/dist/server/storybook/providers/hybrid.d.ts +2 -0
- package/dist/server/storybook/providers/hybrid.js +59 -0
- package/dist/server/storybook/providers/hybrid.js.map +1 -0
- package/dist/server/telemetry.d.ts +2 -0
- package/dist/server/telemetry.js +196 -0
- package/dist/server/telemetry.js.map +1 -0
- package/{lib/types → dist}/server/testsFiles/parser.d.ts +8 -12
- package/dist/server/testsFiles/parser.js +50 -0
- package/dist/server/testsFiles/parser.js.map +1 -0
- package/dist/server/update.d.ts +2 -0
- package/dist/server/update.js +53 -0
- package/dist/server/update.js.map +1 -0
- package/dist/server/utils.d.ts +25 -0
- package/dist/server/utils.js +157 -0
- package/dist/server/utils.js.map +1 -0
- package/{lib/types → dist}/server/worker/chai-image.d.ts +5 -6
- package/dist/server/worker/chai-image.js +113 -0
- package/dist/server/worker/chai-image.js.map +1 -0
- package/{lib/types → dist}/server/worker/helpers.d.ts +8 -8
- package/dist/server/worker/helpers.js +57 -0
- package/dist/server/worker/helpers.js.map +1 -0
- package/dist/server/worker/index.d.ts +1 -0
- package/dist/server/worker/index.js +6 -0
- package/dist/server/worker/index.js.map +1 -0
- package/{lib/types → dist}/server/worker/reporter.d.ts +8 -8
- package/dist/server/worker/reporter.js +130 -0
- package/dist/server/worker/reporter.js.map +1 -0
- package/dist/server/worker/worker.d.ts +4 -0
- package/dist/server/worker/worker.js +211 -0
- package/dist/server/worker/worker.js.map +1 -0
- package/{lib/types → dist}/shared/index.d.ts +7 -7
- package/dist/shared/index.js +77 -0
- package/dist/shared/index.js.map +1 -0
- package/{lib/types → dist}/shared/serializeRegExp.d.ts +9 -9
- package/dist/shared/serializeRegExp.js +25 -0
- package/dist/shared/serializeRegExp.js.map +1 -0
- package/{lib/types → dist}/types.d.ts +459 -490
- package/dist/types.js +61 -0
- package/dist/types.js.map +1 -0
- package/docs/config.md +30 -30
- package/docs/tests.md +3 -3
- package/manager/package.json +3 -0
- package/package.json +115 -156
- package/preset/README.md +3 -0
- package/preset/package.json +3 -0
- package/preview/README.md +3 -0
- package/preview/package.json +3 -0
- package/src/cli.ts +3 -0
- package/src/client/addon/components/Addon.tsx +53 -0
- package/src/client/addon/components/Icons.tsx +28 -0
- package/src/client/addon/components/Panel.tsx +53 -0
- package/src/client/addon/components/TestSelect.tsx +48 -0
- package/src/client/addon/components/Tools.tsx +93 -0
- package/src/client/addon/controller.ts +224 -0
- package/src/client/addon/decorator.ts +3 -0
- package/src/client/addon/index.ts +2 -0
- package/src/client/addon/manager.ts +44 -0
- package/src/client/addon/preset.ts +3 -0
- package/src/client/addon/preview.ts +7 -0
- package/src/client/addon/readyForCapture.ts +9 -0
- package/src/client/addon/utils.tsx +24 -0
- package/src/client/addon/withCreevey.ts +326 -0
- package/src/client/shared/components/ImagesView/BlendView.tsx +71 -0
- package/src/client/shared/components/ImagesView/ImagesView.tsx +70 -0
- package/src/client/shared/components/ImagesView/SideBySideView.tsx +139 -0
- package/src/client/shared/components/ImagesView/SlideView.tsx +146 -0
- package/src/client/shared/components/ImagesView/SwapView.tsx +81 -0
- package/src/client/shared/components/ImagesView/common.ts +23 -0
- package/src/client/shared/components/ImagesView/index.ts +5 -0
- package/src/client/shared/components/PageFooter/PageFooter.tsx +44 -0
- package/src/client/shared/components/PageFooter/Paging.tsx +105 -0
- package/src/client/shared/components/PageHeader/ImagePreview.tsx +82 -0
- package/src/client/shared/components/PageHeader/PageHeader.tsx +123 -0
- package/src/client/shared/components/ResultsPage.tsx +135 -0
- package/src/client/shared/creeveyClientApi.ts +64 -0
- package/src/client/shared/helpers.ts +422 -0
- package/src/client/shared/viewMode.ts +10 -0
- package/src/client/web/CreeveyApp.tsx +177 -0
- package/src/client/web/CreeveyContext.tsx +20 -0
- package/src/client/web/CreeveyLoader.tsx +56 -0
- package/src/client/web/CreeveyView/SideBar/Checkbox.tsx +118 -0
- package/src/client/web/CreeveyView/SideBar/Search.tsx +140 -0
- package/src/client/web/CreeveyView/SideBar/SideBar.tsx +125 -0
- package/src/client/web/CreeveyView/SideBar/SideBarHeader.tsx +138 -0
- package/src/client/web/CreeveyView/SideBar/SuiteLink.tsx +118 -0
- package/src/client/web/CreeveyView/SideBar/TestLink.tsx +67 -0
- package/src/client/web/CreeveyView/SideBar/TestStatusIcon.tsx +58 -0
- package/src/client/web/CreeveyView/SideBar/TestsStatus.tsx +105 -0
- package/src/client/web/CreeveyView/SideBar/Toggle.tsx +85 -0
- package/src/client/web/CreeveyView/SideBar/index.ts +1 -0
- package/src/client/web/KeyboardEventsContext.tsx +121 -0
- package/src/client/web/index.html +28 -0
- package/src/client/web/index.tsx +63 -0
- package/src/creevey.ts +47 -0
- package/src/index.ts +4 -0
- package/src/server/config.ts +83 -0
- package/src/server/docker.ts +136 -0
- package/src/server/index.ts +51 -0
- package/{lib/esm/server/logger.js → src/server/logger.ts} +8 -7
- package/src/server/master/api.ts +55 -0
- package/src/server/master/index.ts +111 -0
- package/src/server/master/master.ts +47 -0
- package/src/server/master/pool.ts +203 -0
- package/src/server/master/runner.ts +189 -0
- package/src/server/master/server.ts +124 -0
- package/src/server/messages.ts +273 -0
- package/src/server/selenium/browser.ts +837 -0
- package/src/server/selenium/index.ts +2 -0
- package/src/server/selenium/selenoid.ts +154 -0
- package/src/server/stories.ts +133 -0
- package/src/server/storybook/providers/browser.ts +58 -0
- package/src/server/storybook/providers/hybrid.ts +70 -0
- package/src/server/telemetry.ts +212 -0
- package/src/server/testsFiles/parser.ts +62 -0
- package/src/server/update.ts +74 -0
- package/src/server/utils.ts +206 -0
- package/src/server/worker/chai-image.ts +147 -0
- package/src/server/worker/helpers.ts +61 -0
- package/src/server/worker/index.ts +1 -0
- package/src/server/worker/reporter.ts +170 -0
- package/src/server/worker/worker.ts +239 -0
- package/src/shared/index.ts +76 -0
- package/src/shared/serializeRegExp.ts +26 -0
- package/src/types.ts +500 -0
- package/types/chai.d.ts +0 -1
- package/types/global.d.ts +5 -0
- package/types/mocha.d.ts +1 -1
- package/addon/package.json +0 -4
- package/jest.config.js +0 -6
- package/lib/cjs/cli.js +0 -5
- package/lib/cjs/client/addon/Manager.js +0 -264
- package/lib/cjs/client/addon/components/Addon.js +0 -55
- package/lib/cjs/client/addon/components/Icons.js +0 -46
- package/lib/cjs/client/addon/components/Panel.js +0 -72
- package/lib/cjs/client/addon/components/TestSelect.js +0 -65
- package/lib/cjs/client/addon/components/Tools.js +0 -95
- package/lib/cjs/client/addon/decorator.js +0 -11
- package/lib/cjs/client/addon/index.js +0 -31
- package/lib/cjs/client/addon/preset.js +0 -62
- package/lib/cjs/client/addon/readyForCapture.js +0 -12
- package/lib/cjs/client/addon/register.js +0 -72
- package/lib/cjs/client/addon/utils.js +0 -38
- package/lib/cjs/client/addon/withCreevey.js +0 -346
- package/lib/cjs/client/shared/components/ImagesView/BlendView.js +0 -87
- package/lib/cjs/client/shared/components/ImagesView/ImagesView.js +0 -92
- package/lib/cjs/client/shared/components/ImagesView/SideBySideView.js +0 -154
- package/lib/cjs/client/shared/components/ImagesView/SlideView.js +0 -166
- package/lib/cjs/client/shared/components/ImagesView/SwapView.js +0 -91
- package/lib/cjs/client/shared/components/ImagesView/index.js +0 -45
- package/lib/cjs/client/shared/components/PageFooter/PageFooter.js +0 -50
- package/lib/cjs/client/shared/components/PageFooter/Paging.js +0 -94
- package/lib/cjs/client/shared/components/PageHeader/ImagePreview.js +0 -82
- package/lib/cjs/client/shared/components/PageHeader/PageHeader.js +0 -119
- package/lib/cjs/client/shared/components/ResultsPage.js +0 -143
- package/lib/cjs/client/shared/creeveyClientApi.js +0 -76
- package/lib/cjs/client/shared/helpers.js +0 -411
- package/lib/cjs/client/shared/viewMode.js +0 -17
- package/lib/cjs/client/web/142.js +0 -2
- package/lib/cjs/client/web/142.js.LICENSE.txt +0 -12
- package/lib/cjs/client/web/32.js +0 -1
- package/lib/cjs/client/web/551.js +0 -1
- package/lib/cjs/client/web/566.js +0 -2
- package/lib/cjs/client/web/566.js.LICENSE.txt +0 -31
- package/lib/cjs/client/web/691.js +0 -2
- package/lib/cjs/client/web/691.js.LICENSE.txt +0 -8
- package/lib/cjs/client/web/725.js +0 -1
- package/lib/cjs/client/web/main.js +0 -2
- package/lib/cjs/creevey.js +0 -69
- package/lib/cjs/index.js +0 -62
- package/lib/cjs/server/config.js +0 -96
- package/lib/cjs/server/docker.js +0 -146
- package/lib/cjs/server/extract.js +0 -50
- package/lib/cjs/server/index.js +0 -83
- package/lib/cjs/server/loaders/babel/creevey-plugin.js +0 -86
- package/lib/cjs/server/loaders/babel/helpers.js +0 -469
- package/lib/cjs/server/loaders/babel/register.js +0 -124
- package/lib/cjs/server/loaders/hooks/mdx.js +0 -30
- package/lib/cjs/server/loaders/hooks/svelte.js +0 -65
- package/lib/cjs/server/loaders/webpack/compile.js +0 -293
- package/lib/cjs/server/loaders/webpack/creevey-loader.js +0 -179
- package/lib/cjs/server/loaders/webpack/dummy-hmr.js +0 -39
- package/lib/cjs/server/loaders/webpack/mdx-loader.js +0 -72
- package/lib/cjs/server/loaders/webpack/start.js +0 -41
- package/lib/cjs/server/logger.js +0 -48
- package/lib/cjs/server/master/api.js +0 -75
- package/lib/cjs/server/master/index.js +0 -146
- package/lib/cjs/server/master/master.js +0 -57
- package/lib/cjs/server/master/pool.js +0 -197
- package/lib/cjs/server/master/runner.js +0 -281
- package/lib/cjs/server/master/server.js +0 -129
- package/lib/cjs/server/messages.js +0 -264
- package/lib/cjs/server/selenium/browser.js +0 -672
- package/lib/cjs/server/selenium/index.js +0 -31
- package/lib/cjs/server/selenium/selenoid.js +0 -172
- package/lib/cjs/server/stories.js +0 -159
- package/lib/cjs/server/storybook/entry.js +0 -70
- package/lib/cjs/server/storybook/helpers.js +0 -159
- package/lib/cjs/server/storybook/providers/browser.js +0 -74
- package/lib/cjs/server/storybook/providers/hybrid.js +0 -84
- package/lib/cjs/server/storybook/providers/nodejs.js +0 -239
- package/lib/cjs/server/testsFiles/parser.js +0 -72
- package/lib/cjs/server/testsFiles/register.js +0 -48
- package/lib/cjs/server/update.js +0 -79
- package/lib/cjs/server/utils.js +0 -183
- package/lib/cjs/server/worker/chai-image.js +0 -142
- package/lib/cjs/server/worker/helpers.js +0 -69
- package/lib/cjs/server/worker/index.js +0 -15
- package/lib/cjs/server/worker/reporter.js +0 -108
- package/lib/cjs/server/worker/worker.js +0 -268
- package/lib/cjs/shared/index.js +0 -101
- package/lib/cjs/shared/serializeRegExp.js +0 -42
- package/lib/cjs/types.js +0 -74
- package/lib/esm/cli.js +0 -4
- package/lib/esm/client/addon/Manager.js +0 -248
- package/lib/esm/client/addon/components/Addon.js +0 -39
- package/lib/esm/client/addon/components/Icons.js +0 -31
- package/lib/esm/client/addon/components/Panel.js +0 -53
- package/lib/esm/client/addon/components/TestSelect.js +0 -51
- package/lib/esm/client/addon/components/Tools.js +0 -74
- package/lib/esm/client/addon/decorator.js +0 -2
- package/lib/esm/client/addon/index.js +0 -2
- package/lib/esm/client/addon/preset.js +0 -41
- package/lib/esm/client/addon/readyForCapture.js +0 -5
- package/lib/esm/client/addon/register.js +0 -51
- package/lib/esm/client/addon/utils.js +0 -31
- package/lib/esm/client/addon/withCreevey.js +0 -322
- package/lib/esm/client/shared/components/ImagesView/BlendView.js +0 -67
- package/lib/esm/client/shared/components/ImagesView/ImagesView.js +0 -69
- package/lib/esm/client/shared/components/ImagesView/SideBySideView.js +0 -131
- package/lib/esm/client/shared/components/ImagesView/SlideView.js +0 -143
- package/lib/esm/client/shared/components/ImagesView/SwapView.js +0 -71
- package/lib/esm/client/shared/components/ImagesView/index.js +0 -5
- package/lib/esm/client/shared/components/PageFooter/PageFooter.js +0 -36
- package/lib/esm/client/shared/components/PageFooter/Paging.js +0 -80
- package/lib/esm/client/shared/components/PageHeader/ImagePreview.js +0 -68
- package/lib/esm/client/shared/components/PageHeader/PageHeader.js +0 -97
- package/lib/esm/client/shared/components/ResultsPage.js +0 -115
- package/lib/esm/client/shared/creeveyClientApi.js +0 -67
- package/lib/esm/client/shared/helpers.js +0 -353
- package/lib/esm/client/shared/viewMode.js +0 -6
- package/lib/esm/creevey.js +0 -54
- package/lib/esm/index.js +0 -5
- package/lib/esm/server/config.js +0 -73
- package/lib/esm/server/docker.js +0 -123
- package/lib/esm/server/extract.js +0 -34
- package/lib/esm/server/index.js +0 -64
- package/lib/esm/server/loaders/babel/creevey-plugin.js +0 -72
- package/lib/esm/server/loaders/babel/helpers.js +0 -452
- package/lib/esm/server/loaders/babel/register.js +0 -103
- package/lib/esm/server/loaders/hooks/mdx.js +0 -15
- package/lib/esm/server/loaders/hooks/svelte.js +0 -49
- package/lib/esm/server/loaders/webpack/compile.js +0 -270
- package/lib/esm/server/loaders/webpack/creevey-loader.js +0 -158
- package/lib/esm/server/loaders/webpack/dummy-hmr.js +0 -32
- package/lib/esm/server/loaders/webpack/mdx-loader.js +0 -58
- package/lib/esm/server/loaders/webpack/start.js +0 -27
- package/lib/esm/server/master/api.js +0 -64
- package/lib/esm/server/master/index.js +0 -125
- package/lib/esm/server/master/master.js +0 -38
- package/lib/esm/server/master/pool.js +0 -176
- package/lib/esm/server/master/runner.js +0 -259
- package/lib/esm/server/master/server.js +0 -105
- package/lib/esm/server/messages.js +0 -232
- package/lib/esm/server/selenium/browser.js +0 -639
- package/lib/esm/server/selenium/index.js +0 -2
- package/lib/esm/server/selenium/selenoid.js +0 -149
- package/lib/esm/server/stories.js +0 -140
- package/lib/esm/server/storybook/entry.js +0 -46
- package/lib/esm/server/storybook/helpers.js +0 -98
- package/lib/esm/server/storybook/providers/browser.js +0 -60
- package/lib/esm/server/storybook/providers/hybrid.js +0 -64
- package/lib/esm/server/storybook/providers/nodejs.js +0 -217
- package/lib/esm/server/testsFiles/parser.js +0 -50
- package/lib/esm/server/testsFiles/register.js +0 -35
- package/lib/esm/server/update.js +0 -61
- package/lib/esm/server/utils.js +0 -142
- package/lib/esm/server/worker/chai-image.js +0 -130
- package/lib/esm/server/worker/helpers.js +0 -60
- package/lib/esm/server/worker/index.js +0 -1
- package/lib/esm/server/worker/reporter.js +0 -86
- package/lib/esm/server/worker/worker.js +0 -238
- package/lib/esm/shared/index.js +0 -78
- package/lib/esm/shared/serializeRegExp.js +0 -24
- package/lib/esm/types.js +0 -43
- package/lib/types/cli.d.ts +0 -1
- package/lib/types/client/addon/components/Addon.d.ts +0 -8
- package/lib/types/client/addon/components/Tools.d.ts +0 -6
- package/lib/types/client/addon/decorator.d.ts +0 -1
- package/lib/types/client/addon/index.d.ts +0 -2
- package/lib/types/client/addon/preset.d.ts +0 -23
- package/lib/types/client/addon/register.d.ts +0 -3
- package/lib/types/client/shared/components/ImagesView/BlendView.d.ts +0 -3
- package/lib/types/client/shared/components/ImagesView/SideBySideView.d.ts +0 -3
- package/lib/types/client/shared/components/ImagesView/SlideView.d.ts +0 -3
- package/lib/types/client/shared/components/ImagesView/SwapView.d.ts +0 -3
- package/lib/types/client/shared/components/ImagesView/index.d.ts +0 -5
- package/lib/types/client/web/CreeveyLoader.d.ts +0 -2
- package/lib/types/client/web/CreeveyView/SideBar/SuiteLink.d.ts +0 -33
- package/lib/types/client/web/CreeveyView/SideBar/TestsStatus.d.ts +0 -9
- package/lib/types/client/web/CreeveyView/SideBar/index.d.ts +0 -1
- package/lib/types/index.d.ts +0 -2
- package/lib/types/server/extract.d.ts +0 -2
- package/lib/types/server/loaders/babel/creevey-plugin.d.ts +0 -1
- package/lib/types/server/loaders/babel/helpers.d.ts +0 -19
- package/lib/types/server/loaders/babel/register.d.ts +0 -5
- package/lib/types/server/loaders/hooks/mdx.d.ts +0 -1
- package/lib/types/server/loaders/hooks/svelte.d.ts +0 -1
- package/lib/types/server/loaders/webpack/compile.d.ts +0 -2
- package/lib/types/server/loaders/webpack/creevey-loader.d.ts +0 -4
- package/lib/types/server/loaders/webpack/dummy-hmr.d.ts +0 -10
- package/lib/types/server/loaders/webpack/mdx-loader.d.ts +0 -6
- package/lib/types/server/loaders/webpack/start.d.ts +0 -1
- package/lib/types/server/master/index.d.ts +0 -3
- package/lib/types/server/master/server.d.ts +0 -2
- package/lib/types/server/selenium/index.d.ts +0 -2
- package/lib/types/server/stories.d.ts +0 -8
- package/lib/types/server/storybook/entry.d.ts +0 -18
- package/lib/types/server/storybook/helpers.d.ts +0 -24
- package/lib/types/server/storybook/providers/browser.d.ts +0 -4
- package/lib/types/server/storybook/providers/hybrid.d.ts +0 -4
- package/lib/types/server/storybook/providers/nodejs.d.ts +0 -9
- package/lib/types/server/testsFiles/register.d.ts +0 -2
- package/lib/types/server/update.d.ts +0 -2
- package/lib/types/server/utils.d.ts +0 -20
- package/lib/types/server/worker/index.d.ts +0 -1
- package/lib/types/server/worker/worker.d.ts +0 -4
- package/preset.js +0 -9
- package/types/babel__register.d.ts +0 -1
- package/types/event-source-polyfill.d.ts +0 -6
- package/types/mdx.d.ts +0 -7
- /package/{addon → manager}/README.md +0 -0
package/lib/esm/server/index.js
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
import cluster from 'cluster';
|
2
|
-
import { readConfig, defaultBrowser } from './config';
|
3
|
-
import { logger } from './logger'; // NOTE: Impure function, mutate config by adding gridUrl prop
|
4
|
-
|
5
|
-
async function startWebdriverServer(config, options) {
|
6
|
-
if (config.useDocker) {
|
7
|
-
return (await import('./docker')).default(config, options.browser, async () => (await import('./selenium/selenoid')).startSelenoidContainer(config, options.debug));
|
8
|
-
} else {
|
9
|
-
return (await import('./selenium/selenoid')).startSelenoidStandalone(config, options.debug);
|
10
|
-
}
|
11
|
-
}
|
12
|
-
|
13
|
-
export default async function (options) {
|
14
|
-
const config = await readConfig(options);
|
15
|
-
const {
|
16
|
-
browser = defaultBrowser,
|
17
|
-
extract,
|
18
|
-
tests,
|
19
|
-
update,
|
20
|
-
webpack,
|
21
|
-
ui,
|
22
|
-
port
|
23
|
-
} = options;
|
24
|
-
if (!config) return; // NOTE: We don't need docker nor selenoid for webpack or update options
|
25
|
-
|
26
|
-
if (!(config.gridUrl || Object.values(config.browsers).every(({
|
27
|
-
gridUrl
|
28
|
-
}) => gridUrl)) && !extract && !webpack && !tests && !update) {
|
29
|
-
await startWebdriverServer(config, options);
|
30
|
-
}
|
31
|
-
|
32
|
-
switch (true) {
|
33
|
-
case Boolean(extract) || tests:
|
34
|
-
{
|
35
|
-
return (await import('./extract')).default(config, options);
|
36
|
-
}
|
37
|
-
|
38
|
-
case Boolean(update):
|
39
|
-
{
|
40
|
-
return (await import('./update')).default(config, typeof update == 'string' ? update : undefined);
|
41
|
-
}
|
42
|
-
|
43
|
-
case webpack:
|
44
|
-
{
|
45
|
-
logger.info('Starting Webpack Compiler');
|
46
|
-
return (await import('./loaders/webpack/compile')).default(config, options);
|
47
|
-
}
|
48
|
-
|
49
|
-
case cluster.isPrimary:
|
50
|
-
{
|
51
|
-
logger.info('Starting Master Process');
|
52
|
-
const resolveApi = (await import('./master/server')).default(config.reportDir, port, ui);
|
53
|
-
return (await import('./master')).default(config, options, resolveApi);
|
54
|
-
}
|
55
|
-
|
56
|
-
default:
|
57
|
-
{
|
58
|
-
logger.info(`Starting Worker for ${browser}`);
|
59
|
-
return (await import('./worker')).default(config, { ...options,
|
60
|
-
browser
|
61
|
-
});
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
import path from 'path';
|
2
|
-
import { commonVisitor, FileType, mdxVisitor, previewVisitor, storyVisitor } from './helpers';
|
3
|
-
import { logger } from '../../logger';
|
4
|
-
let lastStoryFile = null;
|
5
|
-
const stories = new Set();
|
6
|
-
const reexportedStories = new Map();
|
7
|
-
export default function () {
|
8
|
-
return {
|
9
|
-
pre() {
|
10
|
-
const parents = this.opts.parents() ?? [];
|
11
|
-
const story = this.opts.story();
|
12
|
-
this.resourcePath = this.filename;
|
13
|
-
this.fileType = FileType.Invalid; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
14
|
-
|
15
|
-
this.visitedTopPaths = new Set();
|
16
|
-
this.visitedBindings = new Set();
|
17
|
-
this.reexportedStories = reexportedStories;
|
18
|
-
|
19
|
-
if (story && this.filename.startsWith(story) || parents.find(parent => this.reexportedStories.has(parent))) {
|
20
|
-
this.fileType = FileType.Story;
|
21
|
-
this.isMDX = path.parse(this.filename).ext == '.mdx';
|
22
|
-
lastStoryFile = this.filename;
|
23
|
-
stories.add(this.filename);
|
24
|
-
} else if (this.filename.startsWith(this.opts.preview)) this.fileType = FileType.Preview;else if (lastStoryFile && this.opts.debug) {
|
25
|
-
logger.warn('Trying to transform possible non-story file', this.resourcePath, 'Please check the', lastStoryFile);
|
26
|
-
lastStoryFile = null; // TODO Add link to docs, how creevey works and what user should do in this situation
|
27
|
-
}
|
28
|
-
},
|
29
|
-
|
30
|
-
visitor: { ...commonVisitor,
|
31
|
-
|
32
|
-
ExportAllDeclaration(path) {
|
33
|
-
if (this.fileType == FileType.Story && typeof storyVisitor.ExportAllDeclaration == 'function') {
|
34
|
-
storyVisitor.ExportAllDeclaration.call(this, path, this);
|
35
|
-
}
|
36
|
-
},
|
37
|
-
|
38
|
-
ExportDefaultDeclaration(path) {
|
39
|
-
if (this.fileType == FileType.Story && typeof storyVisitor.ExportDefaultDeclaration == 'function') {
|
40
|
-
storyVisitor.ExportDefaultDeclaration.call(this, path, this);
|
41
|
-
}
|
42
|
-
},
|
43
|
-
|
44
|
-
ExportNamedDeclaration(path) {
|
45
|
-
if (this.fileType == FileType.Preview && typeof previewVisitor.ExportNamedDeclaration == 'function') {
|
46
|
-
previewVisitor.ExportNamedDeclaration.call(this, path, this);
|
47
|
-
}
|
48
|
-
|
49
|
-
if (this.fileType == FileType.Story && typeof storyVisitor.ExportNamedDeclaration == 'function') {
|
50
|
-
storyVisitor.ExportNamedDeclaration.call(this, path, this);
|
51
|
-
}
|
52
|
-
},
|
53
|
-
|
54
|
-
CallExpression(path) {
|
55
|
-
if (this.fileType == FileType.Preview && typeof previewVisitor.CallExpression == 'function') {
|
56
|
-
previewVisitor.CallExpression.call(this, path, this);
|
57
|
-
}
|
58
|
-
|
59
|
-
if (this.fileType == FileType.Story && typeof storyVisitor.CallExpression == 'function') {
|
60
|
-
storyVisitor.CallExpression.call(this, path, this);
|
61
|
-
}
|
62
|
-
},
|
63
|
-
|
64
|
-
FunctionDeclaration(path) {
|
65
|
-
if (this.isMDX && typeof mdxVisitor.FunctionDeclaration == 'function') {
|
66
|
-
mdxVisitor.FunctionDeclaration.call(this, path, this);
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
}
|
71
|
-
};
|
72
|
-
}
|
@@ -1,452 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { isDefined } from '../../../types';
|
3
|
-
|
4
|
-
function isExports(path) {
|
5
|
-
const {
|
6
|
-
parentPath
|
7
|
-
} = path;
|
8
|
-
return path.node.name == 'exports' && path.scope.hasGlobal('exports') && !path.scope.hasBinding('exports') && parentPath.isMemberExpression() && parentPath.get('object').isIdentifier({
|
9
|
-
name: 'exports'
|
10
|
-
});
|
11
|
-
}
|
12
|
-
|
13
|
-
function isModuleExports(path) {
|
14
|
-
const {
|
15
|
-
parentPath
|
16
|
-
} = path;
|
17
|
-
return path.node.name == 'module' && path.scope.hasGlobal('module') && !path.scope.hasBinding('module') && parentPath.isMemberExpression() && parentPath.get('object').isIdentifier({
|
18
|
-
name: 'module'
|
19
|
-
}) && parentPath.get('property').isIdentifier({
|
20
|
-
name: 'exports'
|
21
|
-
});
|
22
|
-
}
|
23
|
-
|
24
|
-
function isObjectAssign(path) {
|
25
|
-
if (!(path !== null && path !== void 0 && path.isCallExpression())) return false;
|
26
|
-
const calleePath = path.get('callee');
|
27
|
-
return calleePath.isMemberExpression() && calleePath.get('object').isIdentifier({
|
28
|
-
name: 'Object'
|
29
|
-
}) && calleePath.get('property').isIdentifier({
|
30
|
-
name: 'assign'
|
31
|
-
});
|
32
|
-
}
|
33
|
-
|
34
|
-
function isTemplateBind(path) {
|
35
|
-
if (!(path !== null && path !== void 0 && path.isCallExpression())) return false;
|
36
|
-
const calleePath = path.get('callee');
|
37
|
-
return calleePath.isMemberExpression() && calleePath.get('object').isIdentifier() && calleePath.get('property').isIdentifier({
|
38
|
-
name: 'bind'
|
39
|
-
});
|
40
|
-
}
|
41
|
-
|
42
|
-
function findRootPath(path) {
|
43
|
-
return path.find(x => {
|
44
|
-
var _x$parentPath;
|
45
|
-
|
46
|
-
return Boolean((_x$parentPath = x.parentPath) === null || _x$parentPath === void 0 ? void 0 : _x$parentPath.isProgram());
|
47
|
-
});
|
48
|
-
}
|
49
|
-
|
50
|
-
function getPropertyPath(path, name) {
|
51
|
-
const propertyPath = path.get('properties').find(propPath => propPath.isObjectProperty() && t.isIdentifier(propPath.node.key, {
|
52
|
-
name
|
53
|
-
}));
|
54
|
-
return propertyPath !== null && propertyPath !== void 0 && propertyPath.isObjectProperty() ? propertyPath : undefined;
|
55
|
-
} // TODO Support import and process them
|
56
|
-
|
57
|
-
|
58
|
-
function getDeclaratorPath(path) {
|
59
|
-
if (path !== null && path !== void 0 && path.isIdentifier()) {
|
60
|
-
const {
|
61
|
-
path: bindingPath
|
62
|
-
} = path.scope.getBinding(path.node.name) ?? {};
|
63
|
-
if (bindingPath !== null && bindingPath !== void 0 && bindingPath.isVariableDeclarator() || bindingPath !== null && bindingPath !== void 0 && bindingPath.isFunctionDeclaration() || bindingPath !== null && bindingPath !== void 0 && bindingPath.isImportSpecifier()) return bindingPath;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
function getKindObjectNodePath(path) {
|
68
|
-
if (path.isObjectExpression()) {
|
69
|
-
return getPropertyPath(path, 'title') ? path : undefined;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
function getIdentifiers(path) {
|
74
|
-
return path.map(x => x.isFunctionDeclaration() ? x.get('id') : x.get('id')).map(idPath => idPath.isIdentifier() ? idPath : null).filter(isDefined);
|
75
|
-
}
|
76
|
-
|
77
|
-
function removeAllPropsExcept(path, propNames) {
|
78
|
-
const getPropName = propPath => propNames.find(names => {
|
79
|
-
const keyPath = propPath.isObjectProperty() ? propPath.get('key') : propPath.get('key');
|
80
|
-
if (!keyPath.isIdentifier()) return;
|
81
|
-
const name = Array.isArray(names) ? names[0] : names;
|
82
|
-
return typeof name == 'string' ? keyPath.isIdentifier({
|
83
|
-
name
|
84
|
-
}) : name(keyPath.node.name);
|
85
|
-
});
|
86
|
-
|
87
|
-
path.get('properties').forEach(propPath => {
|
88
|
-
if (propPath.isObjectProperty() || propPath.isObjectMethod()) {
|
89
|
-
const propName = getPropName(propPath);
|
90
|
-
if (!propName) return propPath.remove();
|
91
|
-
const restNames = Array.isArray(propName) ? propName.slice(1) : [];
|
92
|
-
if (propPath.isObjectProperty() && restNames.length != 0) removeAllExpressionPropsExcept(propPath === null || propPath === void 0 ? void 0 : propPath.get('value'), restNames);
|
93
|
-
if (propPath.isObjectMethod() && restNames[0] == 'storyName') replaceStoryFnToNoop(propPath);
|
94
|
-
} else if (propPath.isSpreadElement()) {
|
95
|
-
removeAllExpressionPropsExcept(propPath.get('argument'), propNames);
|
96
|
-
} else propPath.remove();
|
97
|
-
});
|
98
|
-
}
|
99
|
-
|
100
|
-
function removeAllPropAssignsExcept(propAssigns, propNames) {
|
101
|
-
for (const [assignPath, props] of propAssigns ?? []) {
|
102
|
-
const restNames = props.reduce((subPropNames, prop) => {
|
103
|
-
const propName = subPropNames.find(names => {
|
104
|
-
const name = Array.isArray(names) ? names[0] : names;
|
105
|
-
return typeof name == 'string' ? name == prop : name(prop);
|
106
|
-
});
|
107
|
-
if (Array.isArray(propName)) return propName.slice(1);
|
108
|
-
if (!propName) assignPath.remove();
|
109
|
-
return [];
|
110
|
-
}, propNames);
|
111
|
-
if (restNames.length != 0) removeAllExpressionPropsExcept(assignPath.get('right'), restNames);
|
112
|
-
}
|
113
|
-
}
|
114
|
-
|
115
|
-
function replaceStoryFnToNoop(path) {
|
116
|
-
if (path !== null && path !== void 0 && path.isArrowFunctionExpression()) path.get('body').replaceWith(t.blockStatement([]));else if (path !== null && path !== void 0 && path.isFunctionDeclaration()) path.get('body').replaceWith(t.blockStatement([]));else if (path !== null && path !== void 0 && path.isFunctionExpression()) path.get('body').replaceWith(t.blockStatement([]));else if (path !== null && path !== void 0 && path.isObjectMethod()) path.get('body').replaceWith(t.blockStatement([]));
|
117
|
-
}
|
118
|
-
|
119
|
-
function getAssignmentPathWithProps(refPath) {
|
120
|
-
const assignmentPath = refPath.findParent(parentPath => parentPath.isAssignmentExpression());
|
121
|
-
if (!(assignmentPath !== null && assignmentPath !== void 0 && assignmentPath.isAssignmentExpression())) return;
|
122
|
-
const props = [];
|
123
|
-
|
124
|
-
for (let propPath = refPath.parentPath; propPath != assignmentPath; propPath = propPath.parentPath) {
|
125
|
-
var _propPath;
|
126
|
-
|
127
|
-
if (!((_propPath = propPath) !== null && _propPath !== void 0 && _propPath.isMemberExpression())) return;
|
128
|
-
const propNode = propPath.node.property;
|
129
|
-
if (!t.isIdentifier(propNode)) return;
|
130
|
-
props.push(propNode.name);
|
131
|
-
}
|
132
|
-
|
133
|
-
if (props.length != 0) return [assignmentPath, props];
|
134
|
-
}
|
135
|
-
|
136
|
-
function getPropertyAssignmentPaths(idPaths) {
|
137
|
-
const assignPaths = new Map();
|
138
|
-
idPaths.forEach(idPath => {
|
139
|
-
var _idPath$scope$getBind;
|
140
|
-
|
141
|
-
const referencePaths = ((_idPath$scope$getBind = idPath.scope.getBinding(idPath.node.name)) === null || _idPath$scope$getBind === void 0 ? void 0 : _idPath$scope$getBind.referencePaths) ?? [];
|
142
|
-
referencePaths.forEach(refPath => {
|
143
|
-
const [assignmentPath, props] = getAssignmentPathWithProps(refPath) ?? [];
|
144
|
-
if (assignmentPath && props) assignPaths.set(assignmentPath, props);
|
145
|
-
});
|
146
|
-
});
|
147
|
-
return assignPaths;
|
148
|
-
}
|
149
|
-
|
150
|
-
function removeAllExpressionPropsExcept(expressionPath, propNames) {
|
151
|
-
const resolvedDeclPath = getDeclaratorPath(expressionPath);
|
152
|
-
if (expressionPath !== null && expressionPath !== void 0 && expressionPath.isObjectExpression()) removeAllPropsExcept(expressionPath, propNames);else if (expressionPath !== null && expressionPath !== void 0 && expressionPath.isCallExpression()) {
|
153
|
-
if (isObjectAssign(expressionPath)) expressionPath.get('arguments').forEach(argumentPath => removeAllExpressionPropsExcept(argumentPath, storyProps));else if (isTemplateBind(expressionPath)) {
|
154
|
-
const calleePath = expressionPath.get('callee');
|
155
|
-
if (calleePath.isMemberExpression()) removeAllExpressionPropsExcept(calleePath.get('object'), propNames);
|
156
|
-
} else if (propNames[0] == 'storyName') {
|
157
|
-
expressionPath === null || expressionPath === void 0 ? void 0 : expressionPath.replaceWith(t.arrowFunctionExpression([], t.blockStatement([])));
|
158
|
-
}
|
159
|
-
} else if ((expressionPath !== null && expressionPath !== void 0 && expressionPath.isFunctionExpression() || expressionPath !== null && expressionPath !== void 0 && expressionPath.isArrowFunctionExpression()) && propNames[0] == 'storyName') replaceStoryFnToNoop(expressionPath);else if ((!resolvedDeclPath || resolvedDeclPath.isImportSpecifier()) && propNames[0] == 'storyName') expressionPath === null || expressionPath === void 0 ? void 0 : expressionPath.replaceWith(t.arrowFunctionExpression([], t.blockStatement([])));
|
160
|
-
|
161
|
-
if (resolvedDeclPath) {
|
162
|
-
if (!resolvedDeclPath.isImportSpecifier()) removeAllPropAssignsExcept(getPropertyAssignmentPaths(getIdentifiers([resolvedDeclPath])).entries(), propNames);
|
163
|
-
if (resolvedDeclPath.isVariableDeclarator()) removeAllExpressionPropsExcept(resolvedDeclPath.get('init'), propNames);
|
164
|
-
if (resolvedDeclPath.isFunctionDeclaration() && propNames[0] == 'storyName') replaceStoryFnToNoop(resolvedDeclPath);
|
165
|
-
}
|
166
|
-
}
|
167
|
-
|
168
|
-
function cleanUpStoriesOfCallChain(storiesOfPath) {
|
169
|
-
let callPath = storiesOfPath;
|
170
|
-
|
171
|
-
do {
|
172
|
-
const childCallPath = callPath;
|
173
|
-
const {
|
174
|
-
parentPath: memberPath
|
175
|
-
} = childCallPath;
|
176
|
-
if (!memberPath || !memberPath.isMemberExpression()) return;
|
177
|
-
callPath = memberPath.parentPath;
|
178
|
-
const propPath = memberPath.get('property');
|
179
|
-
if (!callPath.isCallExpression()) return;
|
180
|
-
|
181
|
-
if (propPath.isIdentifier({
|
182
|
-
name: 'add'
|
183
|
-
})) {
|
184
|
-
const [, storyPath, parametersPath] = callPath.get('arguments');
|
185
|
-
storyPath.replaceWith(t.arrowFunctionExpression([], t.blockStatement([])));
|
186
|
-
removeAllExpressionPropsExcept(parametersPath, ['creevey']);
|
187
|
-
} else if (propPath.isIdentifier({
|
188
|
-
name: 'addDecorator'
|
189
|
-
})) {
|
190
|
-
callPath.replaceWith(childCallPath);
|
191
|
-
} else if (propPath.isIdentifier({
|
192
|
-
name: 'addParameters'
|
193
|
-
})) {
|
194
|
-
const [parametersPath] = callPath.get('arguments');
|
195
|
-
removeAllExpressionPropsExcept(parametersPath, ['creevey']);
|
196
|
-
}
|
197
|
-
} while (callPath.parentPath != null);
|
198
|
-
}
|
199
|
-
|
200
|
-
function recursivelyRemoveUnreferencedBindings(path) {
|
201
|
-
const getUnreferencedBindings = () => {
|
202
|
-
path.scope.crawl();
|
203
|
-
return Object.values(path.scope.bindings).filter(binding => !binding.referenced || binding.referencePaths.every(refPath => refPath.find(x => x.node == binding.path.node)));
|
204
|
-
};
|
205
|
-
|
206
|
-
let bindings = getUnreferencedBindings();
|
207
|
-
|
208
|
-
do {
|
209
|
-
bindings.forEach(binding => !binding.path.removed && binding.path.remove());
|
210
|
-
} while ((bindings = getUnreferencedBindings()).length > 0);
|
211
|
-
}
|
212
|
-
|
213
|
-
function getUnvisitedRefs(paths, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
214
|
-
state) {
|
215
|
-
const rootPaths = [...new Set(paths.map(findRootPath).filter(isDefined))];
|
216
|
-
const bindings = new Set();
|
217
|
-
rootPaths.forEach(rootPath => {
|
218
|
-
state.visitedTopPaths.add(rootPath);
|
219
|
-
rootPath.traverse({
|
220
|
-
Identifier(identifierPath) {
|
221
|
-
const binding = identifierPath.scope.getBinding(identifierPath.node.name);
|
222
|
-
|
223
|
-
if ((binding === null || binding === void 0 ? void 0 : binding.scope) == rootPath.scope && !state.visitedBindings.has(binding)) {
|
224
|
-
bindings.add(binding);
|
225
|
-
state.visitedBindings.add(binding);
|
226
|
-
}
|
227
|
-
}
|
228
|
-
|
229
|
-
});
|
230
|
-
});
|
231
|
-
const refs = [].concat(...[...bindings].map(b => [b.path, ...b.referencePaths]));
|
232
|
-
return [...new Set(refs)];
|
233
|
-
}
|
234
|
-
|
235
|
-
export let FileType;
|
236
|
-
|
237
|
-
(function (FileType) {
|
238
|
-
FileType[FileType["Invalid"] = -1] = "Invalid";
|
239
|
-
FileType[FileType["Entry"] = 0] = "Entry";
|
240
|
-
FileType[FileType["Preview"] = 1] = "Preview";
|
241
|
-
FileType[FileType["Story"] = 2] = "Story";
|
242
|
-
})(FileType || (FileType = {}));
|
243
|
-
|
244
|
-
export const commonVisitor = {
|
245
|
-
Program: {
|
246
|
-
enter(path) {
|
247
|
-
path.traverse({
|
248
|
-
TSDeclareFunction(path) {
|
249
|
-
path.remove();
|
250
|
-
},
|
251
|
-
|
252
|
-
TSTypeAliasDeclaration(path) {
|
253
|
-
path.remove();
|
254
|
-
},
|
255
|
-
|
256
|
-
TSInterfaceDeclaration(path) {
|
257
|
-
path.remove();
|
258
|
-
},
|
259
|
-
|
260
|
-
TSTypeAnnotation(path) {
|
261
|
-
path.remove();
|
262
|
-
},
|
263
|
-
|
264
|
-
TSAsExpression(path) {
|
265
|
-
path.replaceWith(path.get('expression'));
|
266
|
-
}
|
267
|
-
|
268
|
-
});
|
269
|
-
},
|
270
|
-
|
271
|
-
exit(path) {
|
272
|
-
if (this.fileType != FileType.Story && this.fileType != FileType.Preview) return;
|
273
|
-
recursivelyRemoveUnreferencedBindings(path);
|
274
|
-
path.traverse({
|
275
|
-
ImportDeclaration(path) {
|
276
|
-
if (path.node.specifiers.length == 0) path.remove();
|
277
|
-
}
|
278
|
-
|
279
|
-
});
|
280
|
-
let refs = [...this.visitedTopPaths];
|
281
|
-
|
282
|
-
while (refs.length > 0) {
|
283
|
-
refs = getUnvisitedRefs(refs, this);
|
284
|
-
}
|
285
|
-
|
286
|
-
path.get('body').filter(x => !this.visitedTopPaths.has(x)).forEach(x => x.remove());
|
287
|
-
}
|
288
|
-
|
289
|
-
}
|
290
|
-
};
|
291
|
-
export const previewVisitor = {
|
292
|
-
ExportNamedDeclaration(namedPath) {
|
293
|
-
this.visitedTopPaths.add(namedPath);
|
294
|
-
const declarationPath = namedPath.get('declaration');
|
295
|
-
if (!declarationPath.isVariableDeclaration()) return;
|
296
|
-
declarationPath.get('declarations').forEach(declPath => {
|
297
|
-
if (!declPath.isVariableDeclarator()) return;
|
298
|
-
if (t.isIdentifier(declPath.node.id, {
|
299
|
-
name: 'decorators'
|
300
|
-
})) return declPath.remove();
|
301
|
-
|
302
|
-
if (t.isIdentifier(declPath.node.id, {
|
303
|
-
name: 'parameters'
|
304
|
-
})) {
|
305
|
-
removeAllExpressionPropsExcept(declPath.get('init'), ['creevey']);
|
306
|
-
}
|
307
|
-
});
|
308
|
-
},
|
309
|
-
|
310
|
-
CallExpression(rootCallPath) {
|
311
|
-
const rootPath = findRootPath(rootCallPath);
|
312
|
-
const calleePath = rootCallPath.get('callee');
|
313
|
-
if (calleePath.isIdentifier({
|
314
|
-
name: 'configure'
|
315
|
-
}) && rootPath) this.visitedTopPaths.add(rootPath);else if (calleePath.isIdentifier({
|
316
|
-
name: 'addDecorator'
|
317
|
-
})) rootCallPath.remove();else if (calleePath.isIdentifier({
|
318
|
-
name: 'addParameters'
|
319
|
-
})) {
|
320
|
-
const [argPath] = rootCallPath.get('arguments');
|
321
|
-
if (!argPath || !argPath.isObjectExpression()) return;
|
322
|
-
if (rootPath) this.visitedTopPaths.add(rootPath);
|
323
|
-
removeAllPropsExcept(argPath, ['creevey']);
|
324
|
-
}
|
325
|
-
}
|
326
|
-
|
327
|
-
};
|
328
|
-
export const mdxVisitor = {
|
329
|
-
FunctionDeclaration(functionPath) {
|
330
|
-
var _functionPath$get$nod, _rootPath$scope$getBi;
|
331
|
-
|
332
|
-
const functionName = (_functionPath$get$nod = functionPath.get('id').node) === null || _functionPath$get$nod === void 0 ? void 0 : _functionPath$get$nod.name;
|
333
|
-
if (functionName != 'MDXContent') return;
|
334
|
-
const rootPath = findRootPath(functionPath);
|
335
|
-
const refs = (rootPath === null || rootPath === void 0 ? void 0 : (_rootPath$scope$getBi = rootPath.scope.getBinding(functionName)) === null || _rootPath$scope$getBi === void 0 ? void 0 : _rootPath$scope$getBi.referencePaths) ?? [];
|
336
|
-
refs.forEach(refPath => {
|
337
|
-
var _findRootPath;
|
338
|
-
|
339
|
-
return (_findRootPath = findRootPath(refPath)) === null || _findRootPath === void 0 ? void 0 : _findRootPath.remove();
|
340
|
-
});
|
341
|
-
rootPath === null || rootPath === void 0 ? void 0 : rootPath.remove();
|
342
|
-
}
|
343
|
-
|
344
|
-
};
|
345
|
-
const kindProps = ['title', 'id', ['parameters', 'creevey'], 'includeStories', 'excludeStories'];
|
346
|
-
const storyProps = ['storyName', ['story', 'name', ['parameters', 'creevey', 'docsOnly']], ['parameters', 'creevey', 'docsOnly']];
|
347
|
-
const exportsProps = [['default', ...kindProps], [name => name != 'default', ...storyProps]];
|
348
|
-
export const storyVisitor = {
|
349
|
-
ExportDefaultDeclaration(defaultPath) {
|
350
|
-
const defaultDeclaration = defaultPath.get('declaration');
|
351
|
-
const declaratorPath = getDeclaratorPath(defaultDeclaration);
|
352
|
-
const kindPath = declaratorPath !== null && declaratorPath !== void 0 && declaratorPath.isVariableDeclarator() ? getKindObjectNodePath(declaratorPath.get('init')) : getKindObjectNodePath(defaultDeclaration);
|
353
|
-
if (!kindPath) return;
|
354
|
-
this.visitedTopPaths.add(defaultPath);
|
355
|
-
removeAllPropsExcept(kindPath, kindProps);
|
356
|
-
if (declaratorPath && !declaratorPath.isImportSpecifier()) removeAllPropAssignsExcept(getPropertyAssignmentPaths(getIdentifiers([declaratorPath])).entries(), kindProps);
|
357
|
-
},
|
358
|
-
|
359
|
-
ExportAllDeclaration(allPath) {
|
360
|
-
const request = allPath.get('source').node.value;
|
361
|
-
this.reexportedStories.set(this.resourcePath, (this.reexportedStories.get(this.resourcePath) ?? new Set()).add(request));
|
362
|
-
this.visitedTopPaths.add(allPath);
|
363
|
-
},
|
364
|
-
|
365
|
-
ExportNamedDeclaration(namedPath) {
|
366
|
-
this.visitedTopPaths.add(namedPath);
|
367
|
-
const declarationPath = namedPath.get('declaration');
|
368
|
-
let storyFnPropAssigns = new Map();
|
369
|
-
|
370
|
-
if (declarationPath.isVariableDeclaration()) {
|
371
|
-
const declarations = declarationPath.get('declarations');
|
372
|
-
declarations.map(x => x.get('init')).forEach(initPath => removeAllExpressionPropsExcept(initPath, storyProps));
|
373
|
-
storyFnPropAssigns = getPropertyAssignmentPaths(getIdentifiers(declarations));
|
374
|
-
} else if (declarationPath.isFunctionDeclaration()) {
|
375
|
-
replaceStoryFnToNoop(declarationPath);
|
376
|
-
storyFnPropAssigns = getPropertyAssignmentPaths(getIdentifiers([declarationPath]));
|
377
|
-
}
|
378
|
-
|
379
|
-
removeAllPropAssignsExcept(storyFnPropAssigns.entries(), storyProps);
|
380
|
-
},
|
381
|
-
|
382
|
-
CallExpression(rootCallPath) {
|
383
|
-
const rootPath = findRootPath(rootCallPath);
|
384
|
-
if (!rootCallPath.get('callee').isIdentifier({
|
385
|
-
name: 'storiesOf'
|
386
|
-
})) return;
|
387
|
-
if (rootPath) this.visitedTopPaths.add(rootPath);
|
388
|
-
|
389
|
-
if (rootPath !== null && rootPath !== void 0 && rootPath.isVariableDeclaration()) {
|
390
|
-
var _rootPath$get$find;
|
391
|
-
|
392
|
-
const storiesIdPath = (_rootPath$get$find = rootPath.get('declarations').find(decl => decl.get('init') == rootCallPath)) === null || _rootPath$get$find === void 0 ? void 0 : _rootPath$get$find.get('id');
|
393
|
-
|
394
|
-
if (storiesIdPath !== null && storiesIdPath !== void 0 && storiesIdPath.isIdentifier()) {
|
395
|
-
var _storiesIdPath$scope$;
|
396
|
-
|
397
|
-
(((_storiesIdPath$scope$ = storiesIdPath.scope.getBinding(storiesIdPath.node.name)) === null || _storiesIdPath$scope$ === void 0 ? void 0 : _storiesIdPath$scope$.referencePaths) ?? []).forEach(cleanUpStoriesOfCallChain);
|
398
|
-
}
|
399
|
-
}
|
400
|
-
|
401
|
-
cleanUpStoriesOfCallChain(rootCallPath);
|
402
|
-
},
|
403
|
-
|
404
|
-
Identifier(identifierPath) {
|
405
|
-
if (isExports(identifierPath)) {
|
406
|
-
const rootPath = findRootPath(identifierPath);
|
407
|
-
if (rootPath) this.visitedTopPaths.add(rootPath);
|
408
|
-
const [assignmentPath, props] = getAssignmentPathWithProps(identifierPath) ?? [];
|
409
|
-
|
410
|
-
if (assignmentPath && props) {
|
411
|
-
if (props.length == 1 && props[0] != 'default') {
|
412
|
-
const declaratorPath = getDeclaratorPath(assignmentPath.get('right'));
|
413
|
-
|
414
|
-
if (declaratorPath && !declaratorPath.isImportSpecifier()) {
|
415
|
-
removeAllPropAssignsExcept(getPropertyAssignmentPaths(getIdentifiers([declaratorPath])).entries(), storyProps);
|
416
|
-
} else {
|
417
|
-
const rightPath = assignmentPath.get('right');
|
418
|
-
|
419
|
-
if (isObjectAssign(rightPath)) {
|
420
|
-
rightPath.get('arguments').forEach(argumentPath => removeAllExpressionPropsExcept(argumentPath, storyProps));
|
421
|
-
} else rightPath.replaceWith(t.arrowFunctionExpression([], t.blockStatement([])));
|
422
|
-
}
|
423
|
-
} else removeAllPropAssignsExcept(new Map([[assignmentPath, props]]).entries(), exportsProps);
|
424
|
-
}
|
425
|
-
}
|
426
|
-
|
427
|
-
if (isModuleExports(identifierPath)) {
|
428
|
-
const rootPath = findRootPath(identifierPath);
|
429
|
-
if (rootPath) this.visitedTopPaths.add(rootPath);
|
430
|
-
const [assignmentPath, props] = getAssignmentPathWithProps(identifierPath) ?? [];
|
431
|
-
|
432
|
-
if (assignmentPath && props) {
|
433
|
-
if (props.length == 1 && props[0] == 'exports') {
|
434
|
-
removeAllExpressionPropsExcept(assignmentPath.get('right'), exportsProps);
|
435
|
-
} else if (props.length == 2 && props[0] == 'exports' && props[1] != 'default') {
|
436
|
-
const declaratorPath = getDeclaratorPath(assignmentPath.get('right'));
|
437
|
-
|
438
|
-
if (declaratorPath && !declaratorPath.isImportSpecifier()) {
|
439
|
-
removeAllPropAssignsExcept(getPropertyAssignmentPaths(getIdentifiers([declaratorPath])).entries(), storyProps);
|
440
|
-
} else {
|
441
|
-
const rightPath = assignmentPath.get('right');
|
442
|
-
|
443
|
-
if (isObjectAssign(rightPath)) {
|
444
|
-
rightPath.get('arguments').forEach(argumentPath => removeAllExpressionPropsExcept(argumentPath, storyProps));
|
445
|
-
} else rightPath.replaceWith(t.arrowFunctionExpression([], t.blockStatement([])));
|
446
|
-
}
|
447
|
-
} else removeAllPropAssignsExcept(new Map([[assignmentPath, props]]).entries(), [['exports', ...exportsProps]]);
|
448
|
-
}
|
449
|
-
}
|
450
|
-
}
|
451
|
-
|
452
|
-
};
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import Module from 'module';
|
2
|
-
import fs from 'fs';
|
3
|
-
import { isAbsolute, join, relative, resolve } from 'path';
|
4
|
-
import { addHook } from 'pirates';
|
5
|
-
import { isDefined } from '../../../types';
|
6
|
-
import { extensions } from '../../utils';
|
7
|
-
import plugin from './creevey-plugin';
|
8
|
-
import { hasDocsAddon, hasSvelteCSFAddon, isStorybookVersionLessThan } from '../../storybook/helpers';
|
9
|
-
let parents = null;
|
10
|
-
let story = null; //@ts-expect-error private field doesn't have types
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
12
|
-
|
13
|
-
const jsLoader = Module._extensions['.js']; //@ts-expect-error private field doesn't have types
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
15
|
-
|
16
|
-
Module._extensions['.js'] = function (mod, filename) {
|
17
|
-
parents = Object.values(require.cache).filter(m => m === null || m === void 0 ? void 0 : m.children.includes(mod)).filter(isDefined).map(m => m.filename); // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
18
|
-
|
19
|
-
jsLoader(mod, filename);
|
20
|
-
parents = null;
|
21
|
-
};
|
22
|
-
|
23
|
-
addHook(() => '', {
|
24
|
-
exts: ['.jpg', '.jpeg', '.png', '.gif', '.eot', '.otf', '.svg', '.ttf', '.woff', '.woff2', '.css', '.less', '.scss', '.styl'],
|
25
|
-
ignoreNodeModules: false
|
26
|
-
});
|
27
|
-
|
28
|
-
function getRequireContext(rootDir) {
|
29
|
-
return function requireContext(rootPath, deep, filter) {
|
30
|
-
const ids = [];
|
31
|
-
let contextPath; // Relative path
|
32
|
-
|
33
|
-
if (rootPath.startsWith('.')) contextPath = resolve(rootDir, rootPath); // Module path
|
34
|
-
else if (!isAbsolute(rootPath)) contextPath = require.resolve(rootPath); // Absolute path
|
35
|
-
else contextPath = rootPath;
|
36
|
-
|
37
|
-
const traverse = dirPath => {
|
38
|
-
fs.readdirSync(dirPath, {
|
39
|
-
withFileTypes: true
|
40
|
-
}).forEach(dirent => {
|
41
|
-
const filename = dirent.name;
|
42
|
-
const filePath = join(dirPath, filename);
|
43
|
-
if (dirent.isDirectory() && deep) return traverse(filePath);
|
44
|
-
if (dirent.isFile() && ((filter === null || filter === void 0 ? void 0 : filter.test(`./${relative(contextPath, filePath)}`)) ?? true)) return ids.push(filePath);
|
45
|
-
});
|
46
|
-
};
|
47
|
-
|
48
|
-
traverse(contextPath);
|
49
|
-
|
50
|
-
const context = id => {
|
51
|
-
story = id; // eslint-disable-next-line @typescript-eslint/no-var-requires
|
52
|
-
|
53
|
-
const storyModule = require(id);
|
54
|
-
|
55
|
-
story = null;
|
56
|
-
return storyModule;
|
57
|
-
};
|
58
|
-
|
59
|
-
context.id = contextPath;
|
60
|
-
|
61
|
-
context.keys = () => ids;
|
62
|
-
|
63
|
-
context.resolve = id => id;
|
64
|
-
|
65
|
-
return context;
|
66
|
-
};
|
67
|
-
}
|
68
|
-
|
69
|
-
export default async function register(config, debug = false) {
|
70
|
-
const rootDir = isStorybookVersionLessThan(6, 4) ? config.storybookDir : process.cwd();
|
71
|
-
const requireContext = getRequireContext(rootDir);
|
72
|
-
const preview = resolve(config.storybookDir, 'preview');
|
73
|
-
if (hasDocsAddon()) await (await import('../hooks/mdx')).addMDXHook(() => story);
|
74
|
-
if (hasSvelteCSFAddon()) await (await import('../hooks/svelte')).addSvelteHook(() => story); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
75
|
-
|
76
|
-
(await import('@babel/register')).default(config.babelOptions({
|
77
|
-
babelrc: false,
|
78
|
-
rootMode: 'upward-optional',
|
79
|
-
ignore: [/node_modules/],
|
80
|
-
extensions: [...extensions, ...(hasDocsAddon() ? ['.mdx'] : []), ...(hasSvelteCSFAddon() ? ['.svelte'] : [])],
|
81
|
-
parserOpts: {
|
82
|
-
sourceType: 'module',
|
83
|
-
plugins: ['classProperties', 'decorators-legacy', 'jsx', 'typescript']
|
84
|
-
},
|
85
|
-
plugins: [[plugin, {
|
86
|
-
debug,
|
87
|
-
preview,
|
88
|
-
parents: () => parents,
|
89
|
-
story: () => story
|
90
|
-
}], ['@babel/plugin-transform-runtime', {
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
92
|
-
version: require('@babel/helpers/package.json').version,
|
93
|
-
absoluteRuntime: true,
|
94
|
-
corejs: 3
|
95
|
-
}]],
|
96
|
-
presets: [['@babel/preset-env', {
|
97
|
-
targets: {
|
98
|
-
node: '10'
|
99
|
-
}
|
100
|
-
}]]
|
101
|
-
}));
|
102
|
-
return requireContext;
|
103
|
-
}
|