6 Commits

Author SHA1 Message Date
ThibaudAv
1604b617a9
feat: start and build storybook witout browser-target
only tsConfig is required and can be directly given to storybook using new Angular builder for SB

should allow project with only lib, without `@angular-devkit/build-angular:browser` to complete the configuration, to work more simply
2021-09-03 14:01:36 +02:00
ThibaudAv
bda825b59f
feat: start and build storybook by ng Builder with only tsConfig
should allow project with only lib, without `@angular-devkit/build-angular:browser` to complete the configuration, to work more simply
2021-09-03 14:01:36 +02:00
ThibaudAv
8ae51ecf49 fix(angular): use docsMode to set docs options
setting the docs property to false seems to break things. probably used for other things.
docsMode seems to be the right option for the standalone run
2021-06-10 15:06:41 +02:00
ThibaudAv
ded597cb8c feat(angular): add compodoc for storybook build builder 2021-06-07 19:30:51 +02:00
ThibaudAv
b4e579e6f0 test: fix angular test error
fix this error log
```
Failed to collect coverage from /tmp/storybook/app/angular/src/builders/build-storybook/index.spec.ts
ERROR: /tmp/storybook/app/angular/src/builders/build-storybook/index.spec.ts: The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.
Invalid variable access: buildStandaloneMock
Allowed objects: Array, ArrayBuffer, Atomics, BigInt, BigInt64Array, BigUint64Array, Boolean, Buffer, DataView, Date, Error, EvalError, Float32Array, Float64Array, Function, GLOBAL, Generator, GeneratorFunction, Infinity, Int16Array, Int32Array, Int8Array, InternalError, Intl, JSON, Map, Math, NaN, Number, Object, Promise, Proxy, RangeError, ReferenceError, Reflect, RegExp, Set, SharedArrayBuffer, String, Symbol, SyntaxError, TextDecoder, TextEncoder, TypeError, URIError, URL, URLSearchParams, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray, WeakMap, WeakSet, WebAssembly, arguments, clearImmediate, clearInterval, clearTimeout, console, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, escape, eval, expect, global, globalThis, isFinite, isNaN, jest, parseFloat, parseInt, process, queueMicrotask, require, root, setImmediate, setInterval, setTimeout, undefined, unescape.
Note: This is a precaution to guard against uninitialized mock variables. If it is ensured that the mock is required lazily, variable names prefixed with `mock` (case insensitive) are permitted.

   6 | const buildStandaloneMock = jest.fn().mockImplementation((_options: unknown) => Promise.resolve());
   7 |
>  8 | jest.mock('@storybook/angular/standalone', () => buildStandaloneMock);
```
2021-06-02 22:23:59 +02:00
ThibaudAv
d14690c85f feat(angular): add angular builder to build storybook
The builder allows to add a "architect" in angular.json to build storybook
config ex :
```
"build-storybook": {
 "builder": "@storybook/angular:build-storybook",
  "options": {
    "browserTarget": "angular-cli:build"
  }
}
```
cmd : `ng run angular-cli:build-storybook`

With this solution it is possible to have several angular projects using different assets and style
2021-06-01 16:44:53 +02:00