@storybook/angular 7.0.0-alpha.8 → 7.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/.eslintrc.js +8 -0
  2. package/README.md +1 -1
  3. package/dist/{types/builders → builders}/build-storybook/index.d.ts +3 -3
  4. package/dist/{types/builders → builders}/build-storybook/index.js +0 -0
  5. package/dist/builders/build-storybook/index.spec.d.ts +1 -0
  6. package/dist/builders/build-storybook/index.spec.js +218 -0
  7. package/dist/{types/builders → builders}/build-storybook/schema.json +0 -0
  8. package/dist/{types/builders → builders}/builders.json +0 -0
  9. package/dist/{types/builders → builders}/start-storybook/index.d.ts +3 -3
  10. package/dist/{types/builders → builders}/start-storybook/index.js +0 -0
  11. package/dist/builders/start-storybook/index.spec.d.ts +1 -0
  12. package/dist/builders/start-storybook/index.spec.js +214 -0
  13. package/dist/{types/builders → builders}/start-storybook/schema.json +0 -0
  14. package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.d.ts +0 -0
  15. package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.js +3 -6
  16. package/dist/{types/builders → builders}/utils/run-compodoc.d.ts +0 -0
  17. package/dist/{types/builders → builders}/utils/run-compodoc.js +0 -1
  18. package/dist/builders/utils/run-compodoc.spec.d.ts +1 -0
  19. package/dist/builders/utils/run-compodoc.spec.js +59 -0
  20. package/dist/{types/builders → builders}/utils/standalone-options.d.ts +3 -3
  21. package/dist/{types/builders → builders}/utils/standalone-options.js +0 -0
  22. package/dist/{types/client → client}/angular/app.component.d.ts +1 -1
  23. package/dist/{types/client → client}/angular/app.component.js +0 -1
  24. package/dist/{types/client → client}/angular/app.token.d.ts +0 -0
  25. package/dist/{types/client → client}/angular/app.token.js +0 -0
  26. package/dist/{types/client → client}/angular/helpers.d.ts +3 -3
  27. package/dist/{types/client → client}/angular/helpers.js +1 -2
  28. package/dist/{types/client → client}/angular-beta/AbstractRenderer.d.ts +1 -1
  29. package/dist/{types/client → client}/angular-beta/AbstractRenderer.js +13 -13
  30. package/dist/{types/client → client}/angular-beta/CanvasRenderer.d.ts +0 -0
  31. package/dist/{types/client → client}/angular-beta/CanvasRenderer.js +0 -0
  32. package/dist/{types/client → client}/angular-beta/ComputesTemplateFromComponent.d.ts +3 -3
  33. package/dist/{types/client → client}/angular-beta/ComputesTemplateFromComponent.js +3 -3
  34. package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +1 -0
  35. package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +390 -0
  36. package/dist/{types/client → client}/angular-beta/DocsRenderer.d.ts +0 -0
  37. package/dist/{types/client → client}/angular-beta/DocsRenderer.js +5 -8
  38. package/dist/{types/client → client}/angular-beta/RendererFactory.d.ts +1 -1
  39. package/dist/{types/client → client}/angular-beta/RendererFactory.js +3 -3
  40. package/dist/client/angular-beta/RendererFactory.test.d.ts +1 -0
  41. package/dist/client/angular-beta/RendererFactory.test.js +297 -0
  42. package/dist/{types/client → client}/angular-beta/StorybookModule.d.ts +2 -2
  43. package/dist/{types/client → client}/angular-beta/StorybookModule.js +4 -23
  44. package/dist/client/angular-beta/StorybookModule.test.d.ts +1 -0
  45. package/dist/client/angular-beta/StorybookModule.test.js +279 -0
  46. package/dist/{types/client → client}/angular-beta/StorybookProvider.d.ts +1 -1
  47. package/dist/{types/client → client}/angular-beta/StorybookProvider.js +0 -0
  48. package/dist/{types/client → client}/angular-beta/StorybookWrapperComponent.d.ts +0 -0
  49. package/dist/{types/client → client}/angular-beta/StorybookWrapperComponent.js +0 -1
  50. package/dist/client/angular-beta/__testfixtures__/input.component.d.ts +26 -0
  51. package/dist/client/angular-beta/__testfixtures__/input.component.js +67 -0
  52. package/dist/{types/client → client}/angular-beta/utils/NgComponentAnalyzer.d.ts +2 -2
  53. package/dist/{types/client → client}/angular-beta/utils/NgComponentAnalyzer.js +0 -0
  54. package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.d.ts +1 -0
  55. package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.js +340 -0
  56. package/dist/{types/client → client}/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
  57. package/dist/{types/client → client}/angular-beta/utils/NgModulesAnalyzer.js +0 -0
  58. package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.d.ts +1 -0
  59. package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.js +23 -0
  60. package/dist/client/config.d.ts +6 -0
  61. package/dist/client/config.js +10 -0
  62. package/dist/client/decorateStory.d.ts +4 -0
  63. package/dist/{types/client → client}/decorateStory.js +3 -3
  64. package/dist/client/decorateStory.test.d.ts +1 -0
  65. package/dist/client/decorateStory.test.js +335 -0
  66. package/dist/client/decorators.d.ts +5 -0
  67. package/dist/{types/client → client}/decorators.js +0 -0
  68. package/dist/client/decorators.test.d.ts +1 -0
  69. package/dist/client/decorators.test.js +106 -0
  70. package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +111 -0
  71. package/dist/client/docs/__testfixtures__/doc-button/input.js +207 -0
  72. package/dist/client/docs/__testfixtures__/doc-button/tsconfig.json +7 -0
  73. package/dist/client/docs/angular-properties.test.d.ts +1 -0
  74. package/dist/client/docs/angular-properties.test.js +56 -0
  75. package/dist/{types/client → client}/docs/compodoc.d.ts +5 -11
  76. package/dist/{types/client → client}/docs/compodoc.js +7 -7
  77. package/dist/client/docs/compodoc.test.d.ts +1 -0
  78. package/dist/client/docs/compodoc.test.js +131 -0
  79. package/dist/client/docs/config.d.ts +4 -0
  80. package/dist/{types/client → client}/docs/config.js +0 -0
  81. package/dist/{types/client → client}/docs/index.d.ts +0 -0
  82. package/dist/{types/client → client}/docs/index.js +0 -0
  83. package/dist/{types/client → client}/docs/sourceDecorator.d.ts +3 -3
  84. package/dist/{types/client → client}/docs/sourceDecorator.js +3 -3
  85. package/dist/{types/client → client}/docs/types.d.ts +1 -1
  86. package/dist/{types/client → client}/docs/types.js +0 -0
  87. package/dist/{types/client → client}/globals.d.ts +0 -0
  88. package/dist/{types/client → client}/globals.js +0 -0
  89. package/dist/{types/client → client}/index.d.ts +0 -0
  90. package/dist/{types/client → client}/index.js +3 -0
  91. package/dist/client/public-api.d.ts +15 -0
  92. package/dist/{types/client → client}/public-api.js +2 -9
  93. package/dist/client/public-types.d.ts +36 -0
  94. package/dist/{types/client → client}/public-types.js +0 -0
  95. package/dist/client/render.d.ts +6 -0
  96. package/dist/{types/client → client}/render.js +3 -3
  97. package/dist/{types/client → client}/types.d.ts +9 -13
  98. package/dist/{types/client → client}/types.js +0 -0
  99. package/dist/{types/index.d.ts → index.d.ts} +0 -0
  100. package/dist/{types/index.js → index.js} +0 -0
  101. package/dist/{types/preset.d.ts → preset.d.ts} +1 -1
  102. package/dist/{types/preset.js → preset.js} +0 -1
  103. package/dist/{types/renderer.d.ts → renderer.d.ts} +0 -0
  104. package/dist/{types/renderer.js → renderer.js} +0 -0
  105. package/dist/{types/server → server}/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -0
  106. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/angular.json +0 -0
  107. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -0
  108. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.js +0 -0
  109. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -0
  110. package/dist/{types/server/__mocks-ng-workspace__/some-config → server/__mocks-ng-workspace__/minimal-config}/tsconfig.json +1 -4
  111. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/angular.json +0 -0
  112. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -0
  113. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.js +0 -0
  114. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -0
  115. package/dist/{types/server/__mocks-ng-workspace__/with-angularBrowserTarget → server/__mocks-ng-workspace__/some-config}/tsconfig.json +1 -4
  116. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -0
  117. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -0
  118. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -0
  119. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -0
  120. package/dist/{types/server/__mocks-ng-workspace__/minimal-config → server/__mocks-ng-workspace__/with-angularBrowserTarget}/tsconfig.json +1 -4
  121. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/angular.json +0 -0
  122. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -0
  123. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -0
  124. package/dist/{types/server/__mocks-ng-workspace__/without-projects-entry → server/__mocks-ng-workspace__/with-lib}/projects/pattern-lib/tsconfig.lib.json +2 -8
  125. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/tsconfig.json +1 -4
  126. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/angular.json +0 -0
  127. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/nx.json +0 -0
  128. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -0
  129. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.js +0 -0
  130. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -0
  131. package/dist/server/__mocks-ng-workspace__/with-nx/tsconfig.json +14 -0
  132. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -0
  133. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -0
  134. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -0
  135. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -0
  136. package/dist/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +14 -0
  137. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -0
  138. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/angular.json +0 -0
  139. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -0
  140. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -0
  141. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -0
  142. package/dist/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +13 -0
  143. package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build/angular.json +0 -0
  144. package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -0
  145. package/dist/{types/server → server}/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -0
  146. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -0
  147. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -0
  148. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -0
  149. package/dist/{types/server/__mocks-ng-workspace__/with-lib → server/__mocks-ng-workspace__/without-projects-entry}/projects/pattern-lib/tsconfig.lib.json +2 -8
  150. package/dist/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +13 -0
  151. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -0
  152. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -0
  153. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -0
  154. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -0
  155. package/dist/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +13 -0
  156. package/dist/server/__tests__/angular.json +96 -0
  157. package/dist/{types/server/angular-cli-webpack-12.2.x.d.ts → server/angular-cli-webpack.d.ts} +0 -0
  158. package/dist/{types/server/angular-cli-webpack-13.x.x.js → server/angular-cli-webpack.js} +6 -1
  159. package/dist/{types/server → server}/angular-read-workspace.d.ts +0 -0
  160. package/dist/{types/server → server}/angular-read-workspace.js +1 -1
  161. package/dist/{types/server → server}/framework-preset-angular-cli.d.ts +1 -1
  162. package/dist/{types/server → server}/framework-preset-angular-cli.js +5 -24
  163. package/dist/server/framework-preset-angular-cli.test.d.ts +1 -0
  164. package/dist/server/framework-preset-angular-cli.test.js +698 -0
  165. package/dist/{types/server → server}/framework-preset-angular-docs.d.ts +1 -1
  166. package/dist/{types/server → server}/framework-preset-angular-docs.js +1 -1
  167. package/dist/{types/server → server}/framework-preset-angular-ivy.d.ts +1 -1
  168. package/dist/{types/server → server}/framework-preset-angular-ivy.js +4 -2
  169. package/dist/server/plugins/storybook-normalize-angular-entry-plugin.d.ts +25 -0
  170. package/dist/server/plugins/storybook-normalize-angular-entry-plugin.js +46 -0
  171. package/dist/{types/server → server}/preset-options.d.ts +2 -2
  172. package/dist/{types/server → server}/preset-options.js +0 -0
  173. package/dist/{types/server → server}/utils/filter-out-styling-rules.d.ts +1 -1
  174. package/dist/{types/server → server}/utils/filter-out-styling-rules.js +0 -0
  175. package/dist/{types/server → server}/utils/module-is-available.d.ts +0 -0
  176. package/dist/{types/server → server}/utils/module-is-available.js +0 -0
  177. package/dist/{types/server → server}/utils/normalize-asset-patterns.d.ts +1 -1
  178. package/dist/{types/server → server}/utils/normalize-asset-patterns.js +0 -0
  179. package/dist/{types/server → server}/utils/normalize-optimization.d.ts +0 -0
  180. package/dist/{types/server → server}/utils/normalize-optimization.js +0 -0
  181. package/dist/types.d.ts +29 -0
  182. package/dist/{types/types.js → types.js} +0 -0
  183. package/jest.config.js +8 -1
  184. package/package.json +49 -54
  185. package/preset.js +1 -1
  186. package/renderer.d.ts +1 -1
  187. package/renderer.js +1 -1
  188. package/template/cli/.eslintrc.json +5 -0
  189. package/template/cli/Button.stories.ts +51 -0
  190. package/template/cli/Header.stories.ts +37 -0
  191. package/template/cli/Page.stories.ts +46 -0
  192. package/template/cli/User.ts +2 -0
  193. package/template/cli/button.component.ts +53 -0
  194. package/template/cli/header.component.ts +75 -0
  195. package/template/cli/page.component.ts +77 -0
  196. package/template/components/button.component.ts +54 -0
  197. package/template/components/button.css +30 -0
  198. package/template/components/form.component.ts +37 -0
  199. package/template/components/html.component.ts +22 -0
  200. package/template/components/index.js +8 -0
  201. package/template/components/pre.component.ts +29 -0
  202. package/template/stories/angular-mdx.stories.mdx +25 -0
  203. package/template/stories/argTypes/doc-button/doc-button.component.html +7 -0
  204. package/template/stories/argTypes/doc-button/doc-button.component.scss +3 -0
  205. package/template/stories/argTypes/doc-button/doc-button.component.ts +233 -0
  206. package/template/stories/argTypes/doc-button/doc-button.stories.ts +24 -0
  207. package/template/stories/argTypes/doc-directive/doc-directive.directive.ts +24 -0
  208. package/template/stories/argTypes/doc-directive/doc-directive.stories.ts +14 -0
  209. package/template/stories/argTypes/doc-injectable/doc-injectable.service.ts +27 -0
  210. package/template/stories/argTypes/doc-injectable/doc-injectable.stories.ts +17 -0
  211. package/template/stories/argTypes/doc-pipe/doc-pipe.pipe.ts +18 -0
  212. package/template/stories/argTypes/doc-pipe/doc-pipe.stories.ts +17 -0
  213. package/template/stories/basics/README.stories.mdx +7 -0
  214. package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva-component.stories.ts +27 -0
  215. package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva.component.ts +57 -0
  216. package/template/stories/basics/component-with-complex-selectors/attribute-selector.component.ts +19 -0
  217. package/template/stories/basics/component-with-complex-selectors/attribute-selectors.component.stories.ts +8 -0
  218. package/template/stories/basics/component-with-complex-selectors/class-selector.component.stories.ts +8 -0
  219. package/template/stories/basics/component-with-complex-selectors/class-selector.component.ts +19 -0
  220. package/template/stories/basics/component-with-complex-selectors/multiple-class-selector.component.stories.ts +8 -0
  221. package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.stories.ts +8 -0
  222. package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.ts +37 -0
  223. package/template/stories/basics/component-with-enums/enums.component.html +8 -0
  224. package/template/stories/basics/component-with-enums/enums.component.stories.ts +24 -0
  225. package/template/stories/basics/component-with-enums/enums.component.ts +53 -0
  226. package/template/stories/basics/component-with-inheritance/base-button.component.ts +10 -0
  227. package/template/stories/basics/component-with-inheritance/base-button.stories.ts +12 -0
  228. package/template/stories/basics/component-with-inheritance/icon-button.component.ts +11 -0
  229. package/template/stories/basics/component-with-inheritance/icon-button.stories.ts +13 -0
  230. package/template/stories/basics/component-with-ng-content/ng-content-about-parent.stories.ts +58 -0
  231. package/template/stories/basics/component-with-ng-content/ng-content-simple.stories.ts +29 -0
  232. package/template/stories/basics/component-with-ng-on-destroy/component-with-on-destroy.stories.ts +42 -0
  233. package/template/stories/basics/component-with-on-push/on-push-box.component.ts +21 -0
  234. package/template/stories/basics/component-with-on-push/on-push.stories.ts +21 -0
  235. package/template/stories/basics/component-with-pipe/custom-pipes.stories.ts +31 -0
  236. package/template/stories/basics/component-with-pipe/custom.pipe.ts +10 -0
  237. package/template/stories/basics/component-with-pipe/with-pipe.component.ts +10 -0
  238. package/template/stories/basics/component-with-provider/di.component.html +7 -0
  239. package/template/stories/basics/component-with-provider/di.component.stories.ts +26 -0
  240. package/template/stories/basics/component-with-provider/di.component.ts +28 -0
  241. package/template/stories/basics/component-with-style/styled.component.css +3 -0
  242. package/template/stories/basics/component-with-style/styled.component.html +5 -0
  243. package/template/stories/basics/component-with-style/styled.component.scss +5 -0
  244. package/template/stories/basics/component-with-style/styled.component.stories.ts +10 -0
  245. package/template/stories/basics/component-with-style/styled.component.ts +8 -0
  246. package/template/stories/basics/component-without-selector/without-selector-ng-component-outlet.stories.ts +73 -0
  247. package/template/stories/basics/component-without-selector/without-selector-ng-factory-resolver.stories.ts +71 -0
  248. package/template/stories/basics/component-without-selector/without-selector.component.ts +30 -0
  249. package/template/stories/basics/component-without-selector/without-selector.stories.ts +30 -0
  250. package/template/stories/basics/ng-module/angular-src/chip-color.token.ts +3 -0
  251. package/template/stories/basics/ng-module/angular-src/chip-text.pipe.ts +29 -0
  252. package/template/stories/basics/ng-module/angular-src/chip.component.ts +60 -0
  253. package/template/stories/basics/ng-module/angular-src/chips-group.component.ts +49 -0
  254. package/template/stories/basics/ng-module/angular-src/chips.module.ts +31 -0
  255. package/template/stories/basics/ng-module/import-module-for-root.stories.ts +50 -0
  256. package/template/stories/basics/ng-module/import-module.stories.ts +46 -0
  257. package/template/stories/button.component.ts +26 -0
  258. package/template/stories/core/README.stories.mdx +7 -0
  259. package/template/stories/core/decorators/componentWrapperDecorator/child.component.ts +20 -0
  260. package/template/stories/core/decorators/componentWrapperDecorator/decorators.stories.ts +117 -0
  261. package/template/stories/core/decorators/componentWrapperDecorator/parent.component.ts +18 -0
  262. package/template/stories/core/decorators/theme-decorator/decorators.stories.ts +20 -0
  263. package/template/stories/core/moduleMetadata/angular-src/custom.pipe.ts +10 -0
  264. package/template/stories/core/moduleMetadata/angular-src/dummy.service.ts +14 -0
  265. package/template/stories/core/moduleMetadata/angular-src/service.component.ts +24 -0
  266. package/template/stories/core/moduleMetadata/angular-src/token.component.ts +31 -0
  267. package/template/stories/core/moduleMetadata/in-export-default.stories.ts +38 -0
  268. package/template/stories/core/moduleMetadata/in-stories.stories.ts +46 -0
  269. package/template/stories/core/moduleMetadata/merge-default-and-story.stories.ts +35 -0
  270. package/template/stories/core/parameters/bootstrap-options.stories.ts +22 -0
  271. package/template/stories/core/styles/story-styles.stories.ts +50 -0
  272. package/template/stories/others/issues/12009-unknown-component.stories.ts +14 -0
  273. package/template/stories/others/ngx-translate/README.stories.mdx +58 -0
  274. package/LICENSE +0 -21
  275. package/dist/types/client/config.d.ts +0 -6
  276. package/dist/types/client/config.js +0 -10
  277. package/dist/types/client/decorateStory.d.ts +0 -4
  278. package/dist/types/client/decorators.d.ts +0 -5
  279. package/dist/types/client/docs/config.d.ts +0 -14
  280. package/dist/types/client/public-api.d.ts +0 -23
  281. package/dist/types/client/public-types.d.ts +0 -27
  282. package/dist/types/client/render.d.ts +0 -7
  283. package/dist/types/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -19
  284. package/dist/types/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -19
  285. package/dist/types/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -16
  286. package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -16
  287. package/dist/types/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -16
  288. package/dist/types/server/angular-cli-webpack-12.2.x.js +0 -66
  289. package/dist/types/server/angular-cli-webpack-13.x.x.d.ts +0 -1
  290. package/dist/types/server/angular-cli-webpack-older.d.ts +0 -6
  291. package/dist/types/server/angular-cli-webpack-older.js +0 -111
  292. package/dist/types/server/angular-devkit-build-webpack.d.ts +0 -30
  293. package/dist/types/server/angular-devkit-build-webpack.js +0 -164
  294. package/dist/types/server/create-fork-ts-checker-plugin.d.ts +0 -3
  295. package/dist/types/server/create-fork-ts-checker-plugin.js +0 -19
  296. package/dist/types/server/framework-preset-angular.d.ts +0 -5
  297. package/dist/types/server/framework-preset-angular.js +0 -103
  298. package/dist/types/server/ngx-template-loader/index.d.ts +0 -1
  299. package/dist/types/server/ngx-template-loader/index.js +0 -46
  300. package/dist/types/server/ts_config.d.ts +0 -2
  301. package/dist/types/server/ts_config.js +0 -28
  302. package/dist/types/types.d.ts +0 -28
package/.eslintrc.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ rules: {
3
+ '@typescript-eslint/consistent-type-imports': [
4
+ 'error',
5
+ { prefer: 'no-type-imports', disallowTypeAnnotations: false },
6
+ ],
7
+ },
8
+ };
package/README.md CHANGED
@@ -12,7 +12,7 @@ So you can develop UI components in isolation without worrying about app specifi
12
12
 
13
13
  ```sh
14
14
  cd my-angular-app
15
- npx sb init
15
+ npx storybook init
16
16
  ```
17
17
 
18
18
  For more information visit: [storybook.js.org](https://storybook.js.org)
@@ -1,8 +1,8 @@
1
1
  import { BuilderOutput } from '@angular-devkit/architect';
2
2
  import { JsonObject } from '@angular-devkit/core';
3
- import type { CLIOptions } from '@storybook/core-common';
3
+ import { CLIOptions } from '@storybook/types';
4
4
  import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
5
- export declare type StorybookBuilderOptions = JsonObject & {
5
+ export type StorybookBuilderOptions = JsonObject & {
6
6
  browserTarget?: string | null;
7
7
  tsConfig?: string;
8
8
  compodoc: boolean;
@@ -10,6 +10,6 @@ export declare type StorybookBuilderOptions = JsonObject & {
10
10
  styles?: ExtraEntryPoint[];
11
11
  stylePreprocessorOptions?: StylePreprocessorOptions;
12
12
  } & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs' | 'webpackStatsJson'>;
13
- export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
13
+ export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
14
14
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
15
15
  export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const architect_1 = require("@angular-devkit/architect");
27
+ const testing_1 = require("@angular-devkit/architect/testing");
28
+ const core_1 = require("@angular-devkit/core");
29
+ const path = __importStar(require("path"));
30
+ const buildDevStandaloneMock = jest.fn();
31
+ const buildStaticStandaloneMock = jest.fn();
32
+ const buildMock = {
33
+ buildDevStandalone: buildDevStandaloneMock,
34
+ buildStaticStandalone: buildStaticStandaloneMock,
35
+ };
36
+ jest.doMock('@storybook/core-server', () => buildMock);
37
+ jest.doMock('find-up', () => ({ sync: () => './storybook/tsconfig.ts' }));
38
+ const cpSpawnMock = {
39
+ spawn: jest.fn(),
40
+ };
41
+ jest.doMock('child_process', () => cpSpawnMock);
42
+ describe('Build Storybook Builder', () => {
43
+ let architect;
44
+ let architectHost;
45
+ beforeEach(async () => {
46
+ const registry = new core_1.schema.CoreSchemaRegistry();
47
+ registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
48
+ architectHost = new testing_1.TestingArchitectHost();
49
+ architect = new architect_1.Architect(architectHost, registry);
50
+ architectHost.addBuilder('@angular-devkit/build-angular:browser', (0, architect_1.createBuilder)(() => {
51
+ return { success: true };
52
+ }));
53
+ architectHost.addTarget({ project: 'angular-cli', target: 'build-2' }, '@angular-devkit/build-angular:browser', {
54
+ outputPath: 'dist/angular-cli',
55
+ index: 'src/index.html',
56
+ main: 'src/main.ts',
57
+ polyfills: 'src/polyfills.ts',
58
+ tsConfig: 'src/tsconfig.app.json',
59
+ assets: ['src/favicon.ico', 'src/assets'],
60
+ styles: ['src/styles.css'],
61
+ scripts: [],
62
+ });
63
+ // This will either take a Node package name, or a path to the directory
64
+ // for the package.json file.
65
+ await architectHost.addBuilderFromPackage(path.join(__dirname, '../../..'));
66
+ });
67
+ beforeEach(() => {
68
+ buildStaticStandaloneMock.mockImplementation((_options) => Promise.resolve());
69
+ cpSpawnMock.spawn.mockImplementation(() => ({
70
+ stdout: { on: () => { } },
71
+ stderr: { on: () => { } },
72
+ on: (_event, cb) => cb(0),
73
+ }));
74
+ });
75
+ afterEach(() => {
76
+ jest.clearAllMocks();
77
+ });
78
+ it('should start storybook with angularBrowserTarget', async () => {
79
+ const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
80
+ browserTarget: 'angular-cli:build-2',
81
+ compodoc: false,
82
+ });
83
+ const output = await run.result;
84
+ await run.stop();
85
+ expect(output.success).toBeTruthy();
86
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
87
+ expect(buildStaticStandaloneMock).toHaveBeenCalledWith({
88
+ angularBrowserTarget: 'angular-cli:build-2',
89
+ angularBuilderContext: expect.any(Object),
90
+ angularBuilderOptions: {},
91
+ configDir: '.storybook',
92
+ docs: undefined,
93
+ loglevel: undefined,
94
+ quiet: false,
95
+ outputDir: 'storybook-static',
96
+ packageJson: expect.any(Object),
97
+ mode: 'static',
98
+ tsConfig: './storybook/tsconfig.ts',
99
+ webpackStatsJson: false,
100
+ });
101
+ });
102
+ it('should start storybook with tsConfig', async () => {
103
+ const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
104
+ tsConfig: 'path/to/tsConfig.json',
105
+ compodoc: false,
106
+ });
107
+ const output = await run.result;
108
+ await run.stop();
109
+ expect(output.success).toBeTruthy();
110
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
111
+ expect(buildStaticStandaloneMock).toHaveBeenCalledWith({
112
+ angularBrowserTarget: null,
113
+ angularBuilderContext: expect.any(Object),
114
+ angularBuilderOptions: {},
115
+ configDir: '.storybook',
116
+ docs: undefined,
117
+ loglevel: undefined,
118
+ quiet: false,
119
+ outputDir: 'storybook-static',
120
+ packageJson: expect.any(Object),
121
+ mode: 'static',
122
+ tsConfig: 'path/to/tsConfig.json',
123
+ webpackStatsJson: false,
124
+ });
125
+ });
126
+ it('should build storybook with webpack stats.json', async () => {
127
+ const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
128
+ tsConfig: 'path/to/tsConfig.json',
129
+ compodoc: false,
130
+ webpackStatsJson: true,
131
+ });
132
+ const output = await run.result;
133
+ await run.stop();
134
+ expect(output.success).toBeTruthy();
135
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
136
+ expect(buildStaticStandaloneMock).toHaveBeenCalledWith({
137
+ angularBrowserTarget: null,
138
+ angularBuilderContext: expect.any(Object),
139
+ angularBuilderOptions: {},
140
+ configDir: '.storybook',
141
+ docs: undefined,
142
+ loglevel: undefined,
143
+ quiet: false,
144
+ outputDir: 'storybook-static',
145
+ packageJson: expect.any(Object),
146
+ mode: 'static',
147
+ tsConfig: 'path/to/tsConfig.json',
148
+ webpackStatsJson: true,
149
+ });
150
+ });
151
+ it('should throw error', async () => {
152
+ buildStaticStandaloneMock.mockRejectedValue(true);
153
+ const run = await architect.scheduleBuilder('@storybook/angular:start-storybook', {
154
+ browserTarget: 'angular-cli:build-2',
155
+ port: 4400,
156
+ compodoc: false,
157
+ });
158
+ try {
159
+ await run.result;
160
+ expect(false).toEqual('Throw expected');
161
+ }
162
+ catch (error) {
163
+ // eslint-disable-next-line jest/no-try-expect, jest/no-conditional-expect
164
+ expect(error).toEqual('Broken build, fix the error above.\nYou may need to refresh the browser.');
165
+ }
166
+ });
167
+ it('should run compodoc', async () => {
168
+ const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
169
+ browserTarget: 'angular-cli:build-2',
170
+ });
171
+ const output = await run.result;
172
+ await run.stop();
173
+ expect(output.success).toBeTruthy();
174
+ expect(cpSpawnMock.spawn).toHaveBeenCalledWith('npx', ['compodoc', '-p', './storybook/tsconfig.ts', '-d', '', '-e', 'json'], {
175
+ cwd: '',
176
+ shell: true,
177
+ });
178
+ expect(buildStaticStandaloneMock).toHaveBeenCalledWith({
179
+ angularBrowserTarget: 'angular-cli:build-2',
180
+ angularBuilderContext: expect.any(Object),
181
+ angularBuilderOptions: {},
182
+ configDir: '.storybook',
183
+ docs: undefined,
184
+ loglevel: undefined,
185
+ quiet: false,
186
+ outputDir: 'storybook-static',
187
+ packageJson: expect.any(Object),
188
+ mode: 'static',
189
+ tsConfig: './storybook/tsconfig.ts',
190
+ webpackStatsJson: false,
191
+ });
192
+ });
193
+ it('should start storybook with styles options', async () => {
194
+ const run = await architect.scheduleBuilder('@storybook/angular:build-storybook', {
195
+ tsConfig: 'path/to/tsConfig.json',
196
+ compodoc: false,
197
+ styles: ['style.scss'],
198
+ });
199
+ const output = await run.result;
200
+ await run.stop();
201
+ expect(output.success).toBeTruthy();
202
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
203
+ expect(buildStaticStandaloneMock).toHaveBeenCalledWith({
204
+ angularBrowserTarget: null,
205
+ angularBuilderContext: expect.any(Object),
206
+ angularBuilderOptions: { styles: ['style.scss'] },
207
+ configDir: '.storybook',
208
+ docs: undefined,
209
+ loglevel: undefined,
210
+ quiet: false,
211
+ outputDir: 'storybook-static',
212
+ packageJson: expect.any(Object),
213
+ mode: 'static',
214
+ tsConfig: 'path/to/tsConfig.json',
215
+ webpackStatsJson: false,
216
+ });
217
+ });
218
+ });
File without changes
@@ -1,8 +1,8 @@
1
1
  import { BuilderOutput } from '@angular-devkit/architect';
2
2
  import { JsonObject } from '@angular-devkit/core';
3
3
  import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
4
- import type { CLIOptions } from '@storybook/core-common';
5
- export declare type StorybookBuilderOptions = JsonObject & {
4
+ import { CLIOptions } from '@storybook/types';
5
+ export type StorybookBuilderOptions = JsonObject & {
6
6
  browserTarget?: string | null;
7
7
  tsConfig?: string;
8
8
  compodoc: boolean;
@@ -10,6 +10,6 @@ export declare type StorybookBuilderOptions = JsonObject & {
10
10
  styles?: ExtraEntryPoint[];
11
11
  stylePreprocessorOptions?: StylePreprocessorOptions;
12
12
  } & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
13
- export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
13
+ export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
14
14
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
15
15
  export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const architect_1 = require("@angular-devkit/architect");
27
+ const testing_1 = require("@angular-devkit/architect/testing");
28
+ const core_1 = require("@angular-devkit/core");
29
+ const path = __importStar(require("path"));
30
+ const buildDevStandaloneMock = jest.fn();
31
+ const buildStaticStandaloneMock = jest.fn();
32
+ const buildMock = {
33
+ buildDevStandalone: buildDevStandaloneMock,
34
+ buildStaticStandalone: buildStaticStandaloneMock,
35
+ };
36
+ jest.doMock('@storybook/core-server', () => buildMock);
37
+ jest.doMock('find-up', () => ({ sync: () => './storybook/tsconfig.ts' }));
38
+ const cpSpawnMock = {
39
+ spawn: jest.fn(),
40
+ };
41
+ jest.doMock('child_process', () => cpSpawnMock);
42
+ describe('Start Storybook Builder', () => {
43
+ let architect;
44
+ let architectHost;
45
+ beforeEach(async () => {
46
+ const registry = new core_1.schema.CoreSchemaRegistry();
47
+ registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
48
+ architectHost = new testing_1.TestingArchitectHost();
49
+ architect = new architect_1.Architect(architectHost, registry);
50
+ architectHost.addBuilder('@angular-devkit/build-angular:browser', (0, architect_1.createBuilder)(() => {
51
+ return { success: true };
52
+ }));
53
+ architectHost.addTarget({ project: 'angular-cli', target: 'build-2' }, '@angular-devkit/build-angular:browser', {
54
+ outputPath: 'dist/angular-cli',
55
+ index: 'src/index.html',
56
+ main: 'src/main.ts',
57
+ polyfills: 'src/polyfills.ts',
58
+ tsConfig: 'src/tsconfig.app.json',
59
+ assets: ['src/favicon.ico', 'src/assets'],
60
+ styles: ['src/styles.css'],
61
+ scripts: [],
62
+ });
63
+ // This will either take a Node package name, or a path to the directory
64
+ // for the package.json file.
65
+ await architectHost.addBuilderFromPackage(path.join(__dirname, '../../..'));
66
+ });
67
+ beforeEach(() => {
68
+ buildDevStandaloneMock.mockImplementation((_options) => Promise.resolve());
69
+ cpSpawnMock.spawn.mockImplementation(() => ({
70
+ stdout: { on: () => { } },
71
+ stderr: { on: () => { } },
72
+ on: (_event, cb) => cb(0),
73
+ }));
74
+ });
75
+ afterEach(() => {
76
+ jest.clearAllMocks();
77
+ });
78
+ it('should start storybook with angularBrowserTarget', async () => {
79
+ const run = await architect.scheduleBuilder('@storybook/angular:start-storybook', {
80
+ browserTarget: 'angular-cli:build-2',
81
+ port: 4400,
82
+ compodoc: false,
83
+ });
84
+ const output = await run.result;
85
+ await run.stop();
86
+ expect(output.success).toBeTruthy();
87
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
88
+ expect(buildDevStandaloneMock).toHaveBeenCalledWith({
89
+ angularBrowserTarget: 'angular-cli:build-2',
90
+ angularBuilderContext: expect.any(Object),
91
+ angularBuilderOptions: {},
92
+ ci: false,
93
+ configDir: '.storybook',
94
+ docs: undefined,
95
+ host: 'localhost',
96
+ https: false,
97
+ packageJson: expect.any(Object),
98
+ port: 4400,
99
+ quiet: false,
100
+ smokeTest: false,
101
+ sslCa: undefined,
102
+ sslCert: undefined,
103
+ sslKey: undefined,
104
+ tsConfig: './storybook/tsconfig.ts',
105
+ });
106
+ });
107
+ it('should start storybook with tsConfig', async () => {
108
+ const run = await architect.scheduleBuilder('@storybook/angular:start-storybook', {
109
+ tsConfig: 'path/to/tsConfig.json',
110
+ port: 4400,
111
+ compodoc: false,
112
+ });
113
+ const output = await run.result;
114
+ await run.stop();
115
+ expect(output.success).toBeTruthy();
116
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
117
+ expect(buildDevStandaloneMock).toHaveBeenCalledWith({
118
+ angularBrowserTarget: null,
119
+ angularBuilderContext: expect.any(Object),
120
+ angularBuilderOptions: {},
121
+ ci: false,
122
+ configDir: '.storybook',
123
+ docs: undefined,
124
+ host: 'localhost',
125
+ https: false,
126
+ packageJson: expect.any(Object),
127
+ port: 4400,
128
+ quiet: false,
129
+ smokeTest: false,
130
+ sslCa: undefined,
131
+ sslCert: undefined,
132
+ sslKey: undefined,
133
+ tsConfig: 'path/to/tsConfig.json',
134
+ });
135
+ });
136
+ it('should throw error', async () => {
137
+ buildDevStandaloneMock.mockRejectedValue(true);
138
+ const run = await architect.scheduleBuilder('@storybook/angular:start-storybook', {
139
+ browserTarget: 'angular-cli:build-2',
140
+ port: 4400,
141
+ compodoc: false,
142
+ });
143
+ try {
144
+ await run.result;
145
+ expect(false).toEqual('Throw expected');
146
+ }
147
+ catch (error) {
148
+ // eslint-disable-next-line jest/no-try-expect, jest/no-conditional-expect
149
+ expect(error).toEqual('Broken build, fix the error above.\nYou may need to refresh the browser.');
150
+ }
151
+ });
152
+ it('should run compodoc', async () => {
153
+ const run = await architect.scheduleBuilder('@storybook/angular:start-storybook', {
154
+ browserTarget: 'angular-cli:build-2',
155
+ });
156
+ const output = await run.result;
157
+ await run.stop();
158
+ expect(output.success).toBeTruthy();
159
+ expect(cpSpawnMock.spawn).toHaveBeenCalledWith('npx', ['compodoc', '-p', './storybook/tsconfig.ts', '-d', '', '-e', 'json'], {
160
+ cwd: '',
161
+ shell: true,
162
+ });
163
+ expect(buildDevStandaloneMock).toHaveBeenCalledWith({
164
+ angularBrowserTarget: 'angular-cli:build-2',
165
+ angularBuilderContext: expect.any(Object),
166
+ angularBuilderOptions: {},
167
+ ci: false,
168
+ configDir: '.storybook',
169
+ docs: undefined,
170
+ host: 'localhost',
171
+ https: false,
172
+ packageJson: expect.any(Object),
173
+ port: 9009,
174
+ quiet: false,
175
+ smokeTest: false,
176
+ sslCa: undefined,
177
+ sslCert: undefined,
178
+ sslKey: undefined,
179
+ tsConfig: './storybook/tsconfig.ts',
180
+ });
181
+ });
182
+ it('should start storybook with styles options', async () => {
183
+ const run = await architect.scheduleBuilder('@storybook/angular:start-storybook', {
184
+ tsConfig: 'path/to/tsConfig.json',
185
+ port: 4400,
186
+ compodoc: false,
187
+ styles: ['src/styles.css'],
188
+ });
189
+ const output = await run.result;
190
+ await run.stop();
191
+ expect(output.success).toBeTruthy();
192
+ expect(cpSpawnMock.spawn).not.toHaveBeenCalledWith();
193
+ expect(buildDevStandaloneMock).toHaveBeenCalledWith({
194
+ angularBrowserTarget: null,
195
+ angularBuilderContext: expect.any(Object),
196
+ angularBuilderOptions: {
197
+ styles: ['src/styles.css'],
198
+ },
199
+ ci: false,
200
+ configDir: '.storybook',
201
+ docs: undefined,
202
+ host: 'localhost',
203
+ https: false,
204
+ port: 4400,
205
+ packageJson: expect.any(Object),
206
+ quiet: false,
207
+ smokeTest: false,
208
+ sslCa: undefined,
209
+ sslCert: undefined,
210
+ sslKey: undefined,
211
+ tsConfig: 'path/to/tsConfig.json',
212
+ });
213
+ });
214
+ });
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.buildStandaloneErrorHandler = void 0;
7
4
  const node_logger_1 = require("@storybook/node-logger");
8
- const ts_dedent_1 = __importDefault(require("ts-dedent"));
5
+ const ts_dedent_1 = require("ts-dedent");
9
6
  const buildStandaloneErrorHandler = (error) => {
10
7
  // Duplicate code for Standalone error handling
11
8
  // Source: https://github.com/storybookjs/storybook/blob/39c7ba09ad84fbd466f9c25d5b92791a5450b9f6/lib/core-server/src/build-dev.ts#L136
@@ -26,11 +23,11 @@ const buildStandaloneErrorHandler = (error) => {
26
23
  }
27
24
  node_logger_1.logger.line();
28
25
  return error.close
29
- ? (0, ts_dedent_1.default) `
26
+ ? (0, ts_dedent_1.dedent) `
30
27
  FATAL broken build!, will close the process,
31
28
  Fix the error below and restart storybook.
32
29
  `
33
- : (0, ts_dedent_1.default) `
30
+ : (0, ts_dedent_1.dedent) `
34
31
  Broken build, fix the error above.
35
32
  You may need to refresh the browser.
36
33
  `;
@@ -48,7 +48,6 @@ const runCompodoc = ({ compodocArgs, tsconfig }, context) => {
48
48
  context.logger.info(finalCompodocArgs.join(' '));
49
49
  const child = (0, child_process_1.spawn)('npx', finalCompodocArgs, {
50
50
  cwd: context.workspaceRoot,
51
- env: process.env,
52
51
  shell: true,
53
52
  });
54
53
  child.stdout.on('data', (data) => {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const operators_1 = require("rxjs/operators");
4
+ const cpSpawnMock = {
5
+ spawn: jest.fn(),
6
+ };
7
+ jest.doMock('child_process', () => cpSpawnMock);
8
+ const { runCompodoc } = require('./run-compodoc');
9
+ const builderContextLoggerMock = {
10
+ createChild: jest.fn(),
11
+ log: jest.fn(),
12
+ debug: jest.fn(),
13
+ info: jest.fn(),
14
+ warn: jest.fn(),
15
+ error: jest.fn(),
16
+ fatal: jest.fn(),
17
+ };
18
+ describe('runCompodoc', () => {
19
+ beforeEach(() => {
20
+ cpSpawnMock.spawn.mockImplementation(() => ({
21
+ stdout: { on: () => { } },
22
+ stderr: { on: () => { } },
23
+ on: (_event, cb) => cb(0),
24
+ }));
25
+ });
26
+ afterEach(() => {
27
+ jest.clearAllMocks();
28
+ });
29
+ it('should run compodoc with tsconfig from context', async () => {
30
+ runCompodoc({
31
+ compodocArgs: [],
32
+ tsconfig: 'path/to/tsconfig.json',
33
+ }, {
34
+ workspaceRoot: 'path/to/project',
35
+ logger: builderContextLoggerMock,
36
+ })
37
+ .pipe((0, operators_1.take)(1))
38
+ .subscribe();
39
+ expect(cpSpawnMock.spawn).toHaveBeenCalledWith('npx', ['compodoc', '-p', 'path/to/tsconfig.json', '-d', 'path/to/project'], {
40
+ cwd: 'path/to/project',
41
+ shell: true,
42
+ });
43
+ });
44
+ it('should run compodoc with tsconfig from compodocArgs', async () => {
45
+ runCompodoc({
46
+ compodocArgs: ['-p', 'path/to/tsconfig.stories.json'],
47
+ tsconfig: 'path/to/tsconfig.json',
48
+ }, {
49
+ workspaceRoot: 'path/to/project',
50
+ logger: builderContextLoggerMock,
51
+ })
52
+ .pipe((0, operators_1.take)(1))
53
+ .subscribe();
54
+ expect(cpSpawnMock.spawn).toHaveBeenCalledWith('npx', ['compodoc', '-d', 'path/to/project', '-p', 'path/to/tsconfig.stories.json'], {
55
+ cwd: 'path/to/project',
56
+ shell: true,
57
+ });
58
+ });
59
+ });
@@ -1,6 +1,6 @@
1
- import type { BuilderContext } from '@angular-devkit/architect';
2
- import type { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/core-common';
3
- export declare type StandaloneOptions = Partial<CLIOptions & LoadOptions & BuilderOptions & {
1
+ import { BuilderContext } from '@angular-devkit/architect';
2
+ import { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/types';
3
+ export type StandaloneOptions = Partial<CLIOptions & LoadOptions & BuilderOptions & {
4
4
  mode?: 'static' | 'dev';
5
5
  angularBrowserTarget?: string | null;
6
6
  angularBuilderOptions?: Record<string, any> & {
@@ -1,4 +1,4 @@
1
- import { OnInit, ViewContainerRef, ComponentFactoryResolver, OnDestroy, ChangeDetectorRef } from '@angular/core';
1
+ import { ViewContainerRef, ChangeDetectorRef, OnInit, ComponentFactoryResolver, OnDestroy } from '@angular/core';
2
2
  import { Observable, Subscription } from 'rxjs';
3
3
  import { StoryFnAngularReturnType } from '../types';
4
4
  export declare class AppComponent implements OnInit, OnDestroy {
@@ -13,7 +13,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.AppComponent = void 0;
16
- /* eslint-disable no-useless-constructor */
17
16
  // We could use NgComponentOutlet here but there's currently no easy way
18
17
  // to provide @Inputs and subscribe to @Outputs, see
19
18
  // https://github.com/angular/angular/issues/15360
@@ -1,8 +1,8 @@
1
- import type { PartialStoryFn } from '@storybook/csf';
2
- import type { AngularFramework } from '../types';
1
+ import { PartialStoryFn } from '@storybook/types';
2
+ import { AngularRenderer } from '../types';
3
3
  declare global {
4
4
  interface Window {
5
5
  NODE_ENV: 'string' | 'development' | undefined;
6
6
  }
7
7
  }
8
- export declare const renderNgApp: (storyFn: PartialStoryFn<AngularFramework>, forced: boolean) => void;
8
+ export declare const renderNgApp: (storyFn: PartialStoryFn<AngularRenderer>, forced: boolean) => void;