@analogjs/storybook-angular 2.0.0-beta.10 → 2.0.0-beta.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/storybook-angular",
3
- "version": "2.0.0-beta.10",
3
+ "version": "2.0.0-beta.12",
4
4
  "description": "Storybook Integration for Angular & Vite",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -39,16 +39,16 @@
39
39
  },
40
40
  "main": "src/index.js",
41
41
  "dependencies": {
42
- "@storybook/builder-vite": ">=8.6.0 || ^9.0.0"
42
+ "@storybook/builder-vite": "^10.0.0-rc.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@storybook/angular": ">=8.6.0 || ^9.0.0",
45
+ "@storybook/angular": "^10.0.0-rc.0",
46
46
  "@analogjs/vite-plugin-angular": "*",
47
- "storybook": ">=8.6.0 || ^9.0.0",
47
+ "storybook": "^10.0.0-rc.0",
48
48
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
49
49
  },
50
50
  "engines": {
51
- "node": ">=18.0.0"
51
+ "node": ">=20.0.0"
52
52
  },
53
53
  "builders": "src/lib/builders.json",
54
54
  "ng-add": {
package/preset.d.ts CHANGED
@@ -1,5 +1,10 @@
1
- import { PresetProperty } from 'storybook/internal/types';
2
- import { StorybookConfig } from './src/types';
3
- export declare const core: PresetProperty<'core'>;
4
- export declare const viteFinal: NonNullable<StorybookConfig['viteFinal']>;
5
- export { addons, previewAnnotations } from '@storybook/angular/dist/preset.js';
1
+ export declare const previewAnnotations: (
2
+ entries: any[],
3
+ options: any,
4
+ ) => Promise<any[]>;
5
+ export declare const core: (config: any, options: any) => Promise<any>;
6
+ export declare const viteFinal: (
7
+ config: any,
8
+ options: any,
9
+ ) => Promise<Record<string, any>>;
10
+ export { addons } from '@storybook/angular/preset';
package/preset.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"preset.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AAyC;gBACzC,6BAA6B;gBAC7B,mBAAmB;gBACnB,sCAAsC;gBACtC,+BAA+B;gBAC/B,uBAAuB;gBACvB,OAAO;gBACP,SAAS;aACV;SACF;QACD,OAAO,EAAE;YACP,OAAO,CAAC;gBACN,GAAG,EACD,OAAO,SAAS,CAAC,OAAO,EAAE,GAAG,KAAK,WAAW;oBAC3C,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG;oBACxB,CAAC,CAAC,IAAI;gBACV,UAAU,EACR,OAAO,SAAS,CAAC,OAAO,EAAE,UAAU,KAAK,WAAW;oBAClD,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU;oBAC/B,CAAC,CAAC,KAAK;gBACX,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,4BAA4B;aAC5D,CAAC;SACH;QACD,MAAM,EAAE;YACN,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC;gBACxC,oBAAoB,EAClB,CAAC,CAAC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB;aACzD,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"preset.js","sourceRoot":"","sources":["../../../../../packages/storybook-angular/src/lib/preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAAO,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,aAAa,CAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,kCAAkC,CAAC,CACxD,CAAC;IACF,MAAM,WAAW,GAAG,CAAC,GAAG,OAAO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CAAC,KAAK,CAAC,CAAC;oBACtB,CAAC,CAAC,CAAC;gBACL,CAAC;gBAED,MAAM,QAAQ,GAAG,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;gBAEtE,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAC1B,CAAC;gBAED,OAAO;oBACL,IAAI,EAAE;cACF,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;cACnE,IAAI;WACP;iBACF,CAAC;YACJ,CAAC;YAED,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB;IAC7B,OAAO;QACL,IAAI,EAAE,mCAAmC;QACzC,KAAK,EAAE,OAAO;QACd,MAAM;YACJ,OAAO;gBACL,OAAO,EAAE;oBACP,4CAA4C;oBAC5C,0CAA0C;oBAC1C,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,kCAAkC"}
package/preset.mjs CHANGED
@@ -1,149 +1,137 @@
1
- import { dirname, join, resolve } from 'node:path';
2
- import { createRequire } from 'node:module';
3
- import { core as PresetCore } from '@storybook/angular/dist/preset.js';
4
- const require = createRequire(import.meta.url);
5
- const getAbsolutePath = (input) =>
6
- dirname(require.resolve(join(input, 'package.json')));
1
+ import { resolve } from 'node:path';
2
+ import { core as PresetCore } from '@storybook/angular/preset';
3
+ import { fileURLToPath } from 'node:url';
4
+ export const previewAnnotations = async (entries = [], options) => {
5
+ const config = fileURLToPath(import.meta.resolve('@storybook/angular/client/config'));
6
+ const annotations = [...entries, config];
7
+ if (options.enableProdMode) {
8
+ const previewProdPath = fileURLToPath(import.meta.resolve('@storybook/angular/client/preview-prod'));
9
+ annotations.unshift(previewProdPath);
10
+ }
11
+ const docsConfig = await options.presets.apply('docs', {}, options);
12
+ const docsEnabled = Object.keys(docsConfig).length > 0;
13
+ if (docsEnabled) {
14
+ const docsConfigPath = fileURLToPath(import.meta.resolve('@storybook/angular/client/docs/config'));
15
+ annotations.push(docsConfigPath);
16
+ }
17
+ return annotations;
18
+ };
7
19
  export const core = async (config, options) => {
8
- const presetCore = PresetCore(config, options);
9
- return {
10
- ...presetCore,
11
- builder: {
12
- name: getAbsolutePath('@storybook/builder-vite'),
13
- options: { ...presetCore.options },
14
- },
15
- };
20
+ const presetCore = PresetCore(config, options);
21
+ return {
22
+ ...presetCore,
23
+ builder: {
24
+ name: import.meta.resolve('@storybook/builder-vite'),
25
+ options: { ...presetCore.options },
26
+ },
27
+ };
16
28
  };
17
29
  export const viteFinal = async (config, options) => {
18
- // Remove any loaded analogjs plugins from a vite.config.(m)ts file
19
- config.plugins = config.plugins
20
- .flat()
21
- .filter((plugin) => !plugin.name.includes('analogjs'));
22
-
23
- // Merge custom configuration into the default config
24
- const { mergeConfig, normalizePath } = await import('vite');
25
- const { default: angular } = await import('@analogjs/vite-plugin-angular');
26
- // @ts-ignore
27
- const framework = await options.presets.apply('framework');
28
- return mergeConfig(config, {
29
- // Add dependencies to pre-optimization
30
- optimizeDeps: {
31
- include: [
32
- '@storybook/angular/dist/client/index.js',
33
- '@analogjs/storybook-angular',
34
- '@angular/compiler',
35
- '@angular/platform-browser',
36
- '@angular/platform-browser/animations',
37
- 'tslib',
38
- ...(options?.angularBuilderOptions?.experimentalZoneless
39
- ? []
40
- : ['zone.js']),
41
- ],
42
- },
43
- plugins: [
44
- angular({
45
- jit:
46
- typeof framework.options?.jit !== 'undefined'
47
- ? framework.options?.jit
48
- : true,
49
- liveReload:
50
- typeof framework.options?.liveReload !== 'undefined'
51
- ? framework.options?.liveReload
52
- : false,
53
- tsconfig: options?.tsConfig ?? './.storybook/tsconfig.json',
54
- inlineStylesExtension:
55
- typeof framework.options?.inlineStylesExtension !== 'undefined'
56
- ? framework.options?.inlineStylesExtension
57
- : 'css',
58
- }),
59
- angularOptionsPlugin(options, { normalizePath }),
60
- storybookEsbuildPlugin(),
61
- ],
62
- define: {
63
- STORYBOOK_ANGULAR_OPTIONS: JSON.stringify({
64
- experimentalZoneless:
65
- !!options?.angularBuilderOptions?.experimentalZoneless,
66
- }),
67
- },
68
- });
30
+ // Remove any loaded analogjs plugins from a vite.config.(m)ts file
31
+ config.plugins = config.plugins
32
+ .flat()
33
+ .filter((plugin) => !plugin.name.includes('analogjs'));
34
+ // Merge custom configuration into the default config
35
+ const { mergeConfig, normalizePath } = await import('vite');
36
+ const { default: angular } = await import('@analogjs/vite-plugin-angular');
37
+ // @ts-ignore
38
+ const framework = await options.presets.apply('framework');
39
+ return mergeConfig(config, {
40
+ // Add dependencies to pre-optimization
41
+ optimizeDeps: {
42
+ include: [
43
+ '@storybook/angular/client',
44
+ '@analogjs/storybook-angular',
45
+ '@angular/compiler',
46
+ '@angular/platform-browser',
47
+ '@angular/platform-browser/animations',
48
+ 'tslib',
49
+ ...(options?.angularBuilderOptions?.experimentalZoneless
50
+ ? []
51
+ : ['zone.js']),
52
+ ],
53
+ },
54
+ plugins: [
55
+ angular({
56
+ jit: typeof framework.options?.jit !== 'undefined'
57
+ ? framework.options?.jit
58
+ : true,
59
+ liveReload: typeof framework.options?.liveReload !== 'undefined'
60
+ ? framework.options?.liveReload
61
+ : false,
62
+ tsconfig: options?.tsConfig ?? './.storybook/tsconfig.json',
63
+ inlineStylesExtension: typeof framework.options?.inlineStylesExtension !== 'undefined'
64
+ ? framework.options?.inlineStylesExtension
65
+ : 'css',
66
+ }),
67
+ angularOptionsPlugin(options, { normalizePath }),
68
+ storybookEsbuildPlugin(),
69
+ ],
70
+ define: {
71
+ STORYBOOK_ANGULAR_OPTIONS: JSON.stringify({
72
+ experimentalZoneless: !!options?.angularBuilderOptions?.experimentalZoneless,
73
+ }),
74
+ },
75
+ });
69
76
  };
70
-
71
77
  function angularOptionsPlugin(options, { normalizePath }) {
72
- return {
73
- name: 'analogjs-storybook-options-plugin',
74
- config() {
75
- const loadPaths =
76
- options?.angularBuilderOptions?.stylePreprocessorOptions?.loadPaths;
77
- const sassOptions =
78
- options?.angularBuilderOptions?.stylePreprocessorOptions?.sass;
79
-
80
- if (Array.isArray(loadPaths)) {
81
- return {
82
- css: {
83
- preprocessorOptions: {
84
- scss: {
85
- ...sassOptions,
86
- loadPaths: loadPaths.map(
87
- (loadPath) =>
88
- `${resolve(options.angularBuilderContext.workspaceRoot, loadPath)}`,
89
- ),
90
- },
91
- },
92
- },
93
- };
94
- }
95
-
96
- return;
97
- },
98
- transform(code, id) {
99
- if (
100
- normalizePath(id).endsWith(
101
- normalizePath(`${options.configDir}/preview.ts`),
102
- )
103
- ) {
104
- const imports = [];
105
- const styles = options?.angularBuilderOptions?.styles;
106
-
107
- if (Array.isArray(styles)) {
108
- styles.forEach((style) => {
109
- imports.push(style);
110
- });
111
- }
112
-
113
- const zoneless = options?.angularBuilderOptions?.experimentalZoneless;
114
-
115
- if (!zoneless) {
116
- imports.push('zone.js');
117
- }
118
-
119
- return {
120
- code: `
78
+ return {
79
+ name: 'analogjs-storybook-options-plugin',
80
+ config() {
81
+ const loadPaths = options?.angularBuilderOptions?.stylePreprocessorOptions?.loadPaths;
82
+ const sassOptions = options?.angularBuilderOptions?.stylePreprocessorOptions?.sass;
83
+ if (Array.isArray(loadPaths)) {
84
+ return {
85
+ css: {
86
+ preprocessorOptions: {
87
+ scss: {
88
+ ...sassOptions,
89
+ loadPaths: loadPaths.map((loadPath) => `${resolve(options.angularBuilderContext.workspaceRoot, loadPath)}`),
90
+ },
91
+ },
92
+ },
93
+ };
94
+ }
95
+ return;
96
+ },
97
+ transform(code, id) {
98
+ if (normalizePath(id).endsWith(normalizePath(`${options.configDir}/preview.ts`))) {
99
+ const imports = [];
100
+ const styles = options?.angularBuilderOptions?.styles;
101
+ if (Array.isArray(styles)) {
102
+ styles.forEach((style) => {
103
+ imports.push(style);
104
+ });
105
+ }
106
+ const zoneless = options?.angularBuilderOptions?.experimentalZoneless;
107
+ if (!zoneless) {
108
+ imports.push('zone.js');
109
+ }
110
+ return {
111
+ code: `
121
112
  ${imports.map((extraImport) => `import '${extraImport}';`).join('\n')}
122
113
  ${code}
123
114
  `,
124
- };
125
- }
126
-
127
- return;
128
- },
129
- };
115
+ };
116
+ }
117
+ return;
118
+ },
119
+ };
130
120
  }
131
-
132
121
  function storybookEsbuildPlugin() {
133
- return {
134
- name: 'analogjs-storybook-esbuild-config',
135
- apply: 'build',
136
- config() {
137
- return {
138
- esbuild: {
139
- // Don't mangle class names during the build
140
- // This fixes display of compodoc argtypes
141
- keepNames: true,
122
+ return {
123
+ name: 'analogjs-storybook-esbuild-config',
124
+ apply: 'build',
125
+ config() {
126
+ return {
127
+ esbuild: {
128
+ // Don't mangle class names during the build
129
+ // This fixes display of compodoc argtypes
130
+ keepNames: true,
131
+ },
132
+ };
142
133
  },
143
- };
144
- },
145
- };
134
+ };
146
135
  }
147
-
148
- export { addons, previewAnnotations } from '@storybook/angular/dist/preset.js';
136
+ export { addons } from '@storybook/angular/preset';
149
137
  //# sourceMappingURL=preset.js.map
package/src/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './types';
2
- export * from '@storybook/angular/dist/client/index.js';
2
+ export * from '@storybook/angular/client';
package/src/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './types';
2
- export * from '@storybook/angular/dist/client/index.js';
2
+ export * from '@storybook/angular/client';
3
3
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/storybook-angular/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yCAAyC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/storybook-angular/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC"}
@@ -1,2 +1,2 @@
1
- import BuildStorybookBuilder from '@storybook/angular/dist/builders/build-storybook/index.js';
1
+ import BuildStorybookBuilder from '@storybook/angular/builders/build-storybook';
2
2
  export default BuildStorybookBuilder;
@@ -1,3 +1,3 @@
1
- import BuildStorybookBuilder from '@storybook/angular/dist/builders/build-storybook/index.js';
1
+ import BuildStorybookBuilder from '@storybook/angular/builders/build-storybook';
2
2
  export default BuildStorybookBuilder;
3
3
  //# sourceMappingURL=build-storybook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-storybook.js","sourceRoot":"","sources":["../../../../../../packages/storybook-angular/src/lib/build-storybook/build-storybook.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,2DAA2D,CAAC;AAE9F,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"build-storybook.js","sourceRoot":"","sources":["../../../../../../packages/storybook-angular/src/lib/build-storybook/build-storybook.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,6CAA6C,CAAC;AAEhF,eAAe,qBAAqB,CAAC"}
@@ -1,2 +1,2 @@
1
- import StartStorybookBuilder from '@storybook/angular/dist/builders/start-storybook/index.js';
1
+ import StartStorybookBuilder from '@storybook/angular/builders/start-storybook';
2
2
  export default StartStorybookBuilder;
@@ -1,3 +1,3 @@
1
- import StartStorybookBuilder from '@storybook/angular/dist/builders/start-storybook/index.js';
1
+ import StartStorybookBuilder from '@storybook/angular/builders/start-storybook';
2
2
  export default StartStorybookBuilder;
3
3
  //# sourceMappingURL=start-storybook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"start-storybook.js","sourceRoot":"","sources":["../../../../../../packages/storybook-angular/src/lib/start-storybook/start-storybook.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,2DAA2D,CAAC;AAE9F,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"start-storybook.js","sourceRoot":"","sources":["../../../../../../packages/storybook-angular/src/lib/start-storybook/start-storybook.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,6CAA6C,CAAC;AAEhF,eAAe,qBAAqB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import '@angular/compiler';
1
2
  import type { AngularRenderer } from '@storybook/angular';
2
3
  import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, RenderContext } from 'storybook/internal/types';
3
4
  export declare const render: any;
@@ -1,5 +1,6 @@
1
- import { setProjectAnnotations as originalSetProjectAnnotations } from '@storybook/angular/dist/client/index.mjs';
2
- import * as configAnnotations from '@storybook/angular/dist/client/config.mjs';
1
+ import '@angular/compiler';
2
+ import { setProjectAnnotations as originalSetProjectAnnotations } from '@storybook/angular/client';
3
+ import * as configAnnotations from '@storybook/angular/client/config';
3
4
  export const render = configAnnotations.render;
4
5
  export async function renderToCanvas(context, element) {
5
6
  element.id = context.id;
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../packages/storybook-angular/src/lib/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,IAAI,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AAMlH,OAAO,KAAK,iBAAiB,MAAM,2CAA2C,CAAC;AAE/E,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAuC,EACvC,OAAoB;IAEpB,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACxB,MAAM,iBAAiB,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,iBAAiB,GAAG;IACxB,MAAM;IACN,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,kBAE2C;IAE3C,OAAO,6BAA6B,CAAC;QACnC,iBAAiB;QACjB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACnC,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;KAC1B,CAAkD,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../packages/storybook-angular/src/lib/testing.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,IAAI,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAMnG,OAAO,KAAK,iBAAiB,MAAM,kCAAkC,CAAC;AAEtE,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAuC,EACvC,OAAoB;IAEpB,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACxB,MAAM,iBAAiB,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,iBAAiB,GAAG;IACxB,MAAM;IACN,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,kBAE2C;IAE3C,OAAO,6BAA6B,CAAC;QACnC,iBAAiB;QACjB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACnC,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;KAC1B,CAAkD,CAAC;AACtD,CAAC"}