@storybook/csf 0.0.2-next.8 β†’ 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md ADDED
@@ -0,0 +1,73 @@
1
+ # v0.1.0 (Mon Apr 03 2023)
2
+
3
+ #### πŸš€ Enhancement
4
+
5
+
6
+ #### πŸ› Bug Fix
7
+
8
+ - Turn Args interfaces into types when passed to decorators [#65](https://github.com/ComponentDriven/csf/pull/65) ([@kasperpeulen](https://github.com/kasperpeulen))
9
+ - Improve the startcase implementation to mimick lodash's version more closely [#64](https://github.com/ComponentDriven/csf/pull/64) ([@ndelangen](https://github.com/ndelangen))
10
+ - replace lodash [#62](https://github.com/ComponentDriven/csf/pull/62) ([@ndelangen](https://github.com/ndelangen))
11
+ - Fix bug with meta not working well as generic parameter for StoryObj [#60](https://github.com/ComponentDriven/csf/pull/60) ([@kasperpeulen](https://github.com/kasperpeulen))
12
+ - Make sure that index signatures (used in decorators) don't cause unexpected types [#58](https://github.com/ComponentDriven/csf/pull/58) ([@kasperpeulen](https://github.com/kasperpeulen))
13
+ - Add strict variants for Args and Paramters to CSF [#57](https://github.com/ComponentDriven/csf/pull/57) ([@kasperpeulen](https://github.com/kasperpeulen))
14
+ - Revert stricter parameters [#56](https://github.com/ComponentDriven/csf/pull/56) ([@kasperpeulen](https://github.com/kasperpeulen))
15
+ - Use builtin installation of actions/setup-node [#55](https://github.com/ComponentDriven/csf/pull/55) ([@kasperpeulen](https://github.com/kasperpeulen))
16
+ - Rename Framework to Renderer [#54](https://github.com/ComponentDriven/csf/pull/54) ([@kasperpeulen](https://github.com/kasperpeulen))
17
+ - Rework Framework type to contain `canvasElement` [#53](https://github.com/ComponentDriven/csf/pull/53) ([@tmeasday](https://github.com/tmeasday))
18
+ - Add tags annotation at all levels [#52](https://github.com/ComponentDriven/csf/pull/52) ([@tmeasday](https://github.com/tmeasday))
19
+ - First attempt at bringing new types over [#29](https://github.com/ComponentDriven/csf/pull/29) ([@tmeasday](https://github.com/tmeasday) [@shilman](https://github.com/shilman) [@ghengeveld](https://github.com/ghengeveld) [@wKich](https://github.com/wKich) [@kasperpeulen](https://github.com/kasperpeulen))
20
+ - Revert "Play function can only be set at the story level" [#40](https://github.com/ComponentDriven/csf/pull/40) ([@wKich](https://github.com/wKich) [@shilman](https://github.com/shilman))
21
+ - Add conditional arg types and metadata [#36](https://github.com/ComponentDriven/csf/pull/36) ([@shilman](https://github.com/shilman) [@tmeasday](https://github.com/tmeasday) [@kasperpeulen](https://github.com/kasperpeulen))
22
+ - Re-apply `TArgs` to CSF `render` type [#43](https://github.com/ComponentDriven/csf/pull/43) ([@tmeasday](https://github.com/tmeasday) [@shilman](https://github.com/shilman) [@kasperpeulen](https://github.com/kasperpeulen))
23
+ - Add step to play context and `runStep` to project annotations [#48](https://github.com/ComponentDriven/csf/pull/48) ([@tmeasday](https://github.com/tmeasday) [@shilman](https://github.com/shilman) [@kasperpeulen](https://github.com/kasperpeulen))
24
+ - Sound arg types for CSF3 [#49](https://github.com/ComponentDriven/csf/pull/49) ([@kasperpeulen](https://github.com/kasperpeulen) [@shilman](https://github.com/shilman))
25
+ - ArgsFromMeta utility and generic ArgsStoryFn RT [#51](https://github.com/ComponentDriven/csf/pull/51) ([@kasperpeulen](https://github.com/kasperpeulen))
26
+ - Configure Auto [#50](https://github.com/ComponentDriven/csf/pull/50) ([@shilman](https://github.com/shilman))
27
+ - Only make `TArgs` parameterize `args` and `argTypes` in our default annotations [#33](https://github.com/ComponentDriven/csf/pull/33) ([@tmeasday](https://github.com/tmeasday))
28
+ - Adding Components.studio as a tool using CSF [#13](https://github.com/ComponentDriven/csf/pull/13) ([@georges-gomes](https://github.com/georges-gomes) [@ghengeveld](https://github.com/ghengeveld))
29
+ - Makes name argument for 'toId' optional [#17](https://github.com/ComponentDriven/csf/pull/17) ([@unematiii](https://github.com/unematiii) [@ghengeveld](https://github.com/ghengeveld))
30
+ - use permanent url for the header image [#12](https://github.com/ComponentDriven/csf/pull/12) ([@winkerVSbecks](https://github.com/winkerVSbecks))
31
+ - fix link to image [#10](https://github.com/ComponentDriven/csf/pull/10) ([@winkerVSbecks](https://github.com/winkerVSbecks))
32
+ - Publish under @componentdriven and update README [#8](https://github.com/ComponentDriven/csf/pull/8) ([@winkerVSbecks](https://github.com/winkerVSbecks))
33
+ - Add meta types for CSF [#5](https://github.com/ComponentDriven/csf/pull/5) ([@wKich](https://github.com/wKich))
34
+ - types of csf properties [#3](https://github.com/ComponentDriven/csf/pull/3) ([@atanasster](https://github.com/atanasster) [@ndelangen](https://github.com/ndelangen))
35
+ - Extract @storybook/csf from monorepo [#1](https://github.com/ComponentDriven/csf/pull/1) ([@shilman](https://github.com/shilman))
36
+
37
+ #### ⚠️ Pushed to `master`
38
+
39
+ - First commit ([@shilman](https://github.com/shilman))
40
+
41
+ #### πŸ“ Documentation
42
+
43
+ - added storyNameFromExport(key) in README.md [#2](https://github.com/ComponentDriven/csf/pull/2) ([@georges-gomes](https://github.com/georges-gomes) [@shilman](https://github.com/shilman))
44
+
45
+ #### πŸ”© Dependency Updates
46
+
47
+ - Bump handlebars from 4.5.3 to 4.7.7 [#20](https://github.com/ComponentDriven/csf/pull/20) ([@dependabot[bot]](https://github.com/dependabot[bot]))
48
+ - Bump y18n from 4.0.0 to 4.0.3 [#32](https://github.com/ComponentDriven/csf/pull/32) ([@dependabot[bot]](https://github.com/dependabot[bot]))
49
+ - Bump ini from 1.3.5 to 1.3.8 [#18](https://github.com/ComponentDriven/csf/pull/18) ([@dependabot[bot]](https://github.com/dependabot[bot]))
50
+ - Bump yargs-parser from 13.1.1 to 13.1.2 [#15](https://github.com/ComponentDriven/csf/pull/15) ([@dependabot[bot]](https://github.com/dependabot[bot]))
51
+ - Bump lodash from 4.17.15 to 4.17.21 [#21](https://github.com/ComponentDriven/csf/pull/21) ([@dependabot[bot]](https://github.com/dependabot[bot]))
52
+ - Bump hosted-git-info from 2.8.5 to 2.8.9 [#22](https://github.com/ComponentDriven/csf/pull/22) ([@dependabot[bot]](https://github.com/dependabot[bot]))
53
+ - Bump path-parse from 1.0.6 to 1.0.7 [#25](https://github.com/ComponentDriven/csf/pull/25) ([@dependabot[bot]](https://github.com/dependabot[bot]))
54
+ - Bump browserslist from 4.11.1 to 4.16.6 [#23](https://github.com/ComponentDriven/csf/pull/23) ([@dependabot[bot]](https://github.com/dependabot[bot]))
55
+ - Bump acorn from 5.7.3 to 5.7.4 [#27](https://github.com/ComponentDriven/csf/pull/27) ([@dependabot[bot]](https://github.com/dependabot[bot]))
56
+ - Bump ws from 5.2.2 to 5.2.3 [#28](https://github.com/ComponentDriven/csf/pull/28) ([@dependabot[bot]](https://github.com/dependabot[bot]))
57
+ - Bump tar from 4.4.13 to 4.4.19 [#30](https://github.com/ComponentDriven/csf/pull/30) ([@dependabot[bot]](https://github.com/dependabot[bot]))
58
+ - Bump tmpl from 1.0.4 to 1.0.5 [#31](https://github.com/ComponentDriven/csf/pull/31) ([@dependabot[bot]](https://github.com/dependabot[bot]))
59
+
60
+ #### Authors: 12
61
+
62
+ - [@dependabot[bot]](https://github.com/dependabot[bot])
63
+ - Atanas Stoyanov ([@atanasster](https://github.com/atanasster))
64
+ - Dmitriy Lazarev ([@wKich](https://github.com/wKich))
65
+ - Dominic Nguyen ([@domyen](https://github.com/domyen))
66
+ - Georges Gomes ([@georges-gomes](https://github.com/georges-gomes))
67
+ - Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))
68
+ - Kasper Peulen ([@kasperpeulen](https://github.com/kasperpeulen))
69
+ - Mati KΓ€rner ([@unematiii](https://github.com/unematiii))
70
+ - Michael Shilman ([@shilman](https://github.com/shilman))
71
+ - Norbert de Langen ([@ndelangen](https://github.com/ndelangen))
72
+ - Tom Coleman ([@tmeasday](https://github.com/tmeasday))
73
+ - Varun Vachhar ([@winkerVSbecks](https://github.com/winkerVSbecks))
package/dist/index.d.ts CHANGED
@@ -4,42 +4,42 @@ interface SBBaseType {
4
4
  required?: boolean;
5
5
  raw?: string;
6
6
  }
7
- declare type SBScalarType = SBBaseType & {
7
+ type SBScalarType = SBBaseType & {
8
8
  name: 'boolean' | 'string' | 'number' | 'function' | 'symbol';
9
9
  };
10
- declare type SBArrayType = SBBaseType & {
10
+ type SBArrayType = SBBaseType & {
11
11
  name: 'array';
12
12
  value: SBType;
13
13
  };
14
- declare type SBObjectType = SBBaseType & {
14
+ type SBObjectType = SBBaseType & {
15
15
  name: 'object';
16
16
  value: Record<string, SBType>;
17
17
  };
18
- declare type SBEnumType = SBBaseType & {
18
+ type SBEnumType = SBBaseType & {
19
19
  name: 'enum';
20
20
  value: (string | number)[];
21
21
  };
22
- declare type SBIntersectionType = SBBaseType & {
22
+ type SBIntersectionType = SBBaseType & {
23
23
  name: 'intersection';
24
24
  value: SBType[];
25
25
  };
26
- declare type SBUnionType = SBBaseType & {
26
+ type SBUnionType = SBBaseType & {
27
27
  name: 'union';
28
28
  value: SBType[];
29
29
  };
30
- declare type SBOtherType = SBBaseType & {
30
+ type SBOtherType = SBBaseType & {
31
31
  name: 'other';
32
32
  value: string;
33
33
  };
34
- declare type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
34
+ type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
35
35
 
36
- declare type StoryId = string;
37
- declare type ComponentId = string;
38
- declare type ComponentTitle = string;
39
- declare type StoryName = string;
36
+ type StoryId = string;
37
+ type ComponentId = string;
38
+ type ComponentTitle = string;
39
+ type StoryName = string;
40
40
  /** @deprecated */
41
- declare type StoryKind = ComponentTitle;
42
- declare type Tag = string;
41
+ type StoryKind = ComponentTitle;
42
+ type Tag = string;
43
43
  interface StoryIdentifier {
44
44
  componentId: ComponentId;
45
45
  title: ComponentTitle;
@@ -57,7 +57,7 @@ interface Parameters {
57
57
  interface StrictParameters {
58
58
  [name: string]: unknown;
59
59
  }
60
- declare type ConditionalTest = {
60
+ type ConditionalTest = {
61
61
  truthy?: boolean;
62
62
  } | {
63
63
  exists: boolean;
@@ -66,12 +66,12 @@ declare type ConditionalTest = {
66
66
  } | {
67
67
  neq: any;
68
68
  };
69
- declare type ConditionalValue = {
69
+ type ConditionalValue = {
70
70
  arg: string;
71
71
  } | {
72
72
  global: string;
73
73
  };
74
- declare type Conditional = ConditionalValue & ConditionalTest;
74
+ type Conditional = ConditionalValue & ConditionalTest;
75
75
  interface InputType {
76
76
  name?: string;
77
77
  description?: string;
@@ -90,22 +90,22 @@ interface Args {
90
90
  interface StrictArgs {
91
91
  [name: string]: unknown;
92
92
  }
93
- declare type ArgTypes<TArgs = Args> = {
93
+ type ArgTypes<TArgs = Args> = {
94
94
  [name in keyof TArgs]: InputType;
95
95
  };
96
- declare type StrictArgTypes<TArgs = Args> = {
96
+ type StrictArgTypes<TArgs = Args> = {
97
97
  [name in keyof TArgs]: StrictInputType;
98
98
  };
99
- declare type Globals = {
99
+ type Globals = {
100
100
  [name: string]: any;
101
101
  };
102
- declare type GlobalTypes = {
102
+ type GlobalTypes = {
103
103
  [name: string]: InputType;
104
104
  };
105
- declare type StrictGlobalTypes = {
105
+ type StrictGlobalTypes = {
106
106
  [name: string]: StrictInputType;
107
107
  };
108
- declare type Renderer = {
108
+ type Renderer = {
109
109
  /** What is the type of the `component` annotation in this renderer? */
110
110
  component: unknown;
111
111
  /** What does the story function return in this renderer? */
@@ -115,8 +115,8 @@ declare type Renderer = {
115
115
  T?: unknown;
116
116
  };
117
117
  /** @deprecated - use `Renderer` */
118
- declare type AnyFramework = Renderer;
119
- declare type StoryContextForEnhancers<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryIdentifier & {
118
+ type AnyFramework = Renderer;
119
+ type StoryContextForEnhancers<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryIdentifier & {
120
120
  component?: (TRenderer & {
121
121
  T: any;
122
122
  })['component'];
@@ -127,50 +127,50 @@ declare type StoryContextForEnhancers<TRenderer extends Renderer = Renderer, TAr
127
127
  initialArgs: TArgs;
128
128
  argTypes: StrictArgTypes<TArgs>;
129
129
  };
130
- declare type ArgsEnhancer<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForEnhancers<TRenderer, TArgs>) => TArgs;
131
- declare type ArgTypesEnhancer<TRenderer extends Renderer = Renderer, TArgs = Args> = ((context: StoryContextForEnhancers<TRenderer, TArgs>) => StrictArgTypes<TArgs>) & {
130
+ type ArgsEnhancer<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForEnhancers<TRenderer, TArgs>) => TArgs;
131
+ type ArgTypesEnhancer<TRenderer extends Renderer = Renderer, TArgs = Args> = ((context: StoryContextForEnhancers<TRenderer, TArgs>) => StrictArgTypes<TArgs>) & {
132
132
  secondPass?: boolean;
133
133
  };
134
- declare type StoryContextUpdate<TArgs = Args> = {
134
+ type StoryContextUpdate<TArgs = Args> = {
135
135
  args?: TArgs;
136
136
  globals?: Globals;
137
137
  [key: string]: any;
138
138
  };
139
- declare type ViewMode = 'story' | 'docs';
140
- declare type StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContextForEnhancers<TRenderer, TArgs> & Required<StoryContextUpdate<TArgs>> & {
139
+ type ViewMode = 'story' | 'docs';
140
+ type StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContextForEnhancers<TRenderer, TArgs> & Required<StoryContextUpdate<TArgs>> & {
141
141
  hooks: unknown;
142
142
  viewMode: ViewMode;
143
143
  originalStoryFn: StoryFn<TRenderer>;
144
144
  };
145
- declare type LoaderFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForLoaders<TRenderer, TArgs>) => Promise<Record<string, any>>;
146
- declare type StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContextForLoaders<TRenderer, TArgs> & {
145
+ type LoaderFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForLoaders<TRenderer, TArgs>) => Promise<Record<string, any>>;
146
+ type StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContextForLoaders<TRenderer, TArgs> & {
147
147
  loaded: Record<string, any>;
148
148
  abortSignal: AbortSignal;
149
149
  canvasElement: TRenderer['canvasElement'];
150
150
  };
151
- declare type StepLabel = string;
152
- declare type StepFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (label: StepLabel, play: PlayFunction<TRenderer, TArgs>) => Promise<void> | void;
153
- declare type PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContext<TRenderer, TArgs> & {
151
+ type StepLabel = string;
152
+ type StepFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (label: StepLabel, play: PlayFunction<TRenderer, TArgs>) => Promise<void> | void;
153
+ type PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContext<TRenderer, TArgs> & {
154
154
  step: StepFunction<TRenderer, TArgs>;
155
155
  };
156
- declare type PlayFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: PlayFunctionContext<TRenderer, TArgs>) => Promise<void> | void;
157
- declare type PartialStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (update?: StoryContextUpdate<Partial<TArgs>>) => TRenderer['storyResult'];
158
- declare type LegacyStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
159
- declare type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: TArgs, context: StoryContext<TRenderer, TArgs>) => (TRenderer & {
156
+ type PlayFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: PlayFunctionContext<TRenderer, TArgs>) => Promise<void> | void;
157
+ type PartialStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (update?: StoryContextUpdate<Partial<TArgs>>) => TRenderer['storyResult'];
158
+ type LegacyStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
159
+ type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: TArgs, context: StoryContext<TRenderer, TArgs>) => (TRenderer & {
160
160
  T: TArgs;
161
161
  })['storyResult'];
162
- declare type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
163
- declare type DecoratorFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (fn: PartialStoryFn<TRenderer, TArgs>, c: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
164
- declare type DecoratorApplicator<TRenderer extends Renderer = Renderer, TArgs = Args> = (storyFn: LegacyStoryFn<TRenderer, TArgs>, decorators: DecoratorFunction<TRenderer, TArgs>[]) => LegacyStoryFn<TRenderer, TArgs>;
165
- declare type StepRunner<TRenderer extends Renderer = Renderer, TArgs = Args> = (label: StepLabel, play: PlayFunction<TRenderer, TArgs>, context: PlayFunctionContext<TRenderer, TArgs>) => Promise<void>;
166
- declare type BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> = {
162
+ type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
163
+ type DecoratorFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (fn: PartialStoryFn<TRenderer, TArgs>, c: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
164
+ type DecoratorApplicator<TRenderer extends Renderer = Renderer, TArgs = Args> = (storyFn: LegacyStoryFn<TRenderer, TArgs>, decorators: DecoratorFunction<TRenderer, TArgs>[]) => LegacyStoryFn<TRenderer, TArgs>;
165
+ type StepRunner<TRenderer extends Renderer = Renderer, TArgs = Args> = (label: StepLabel, play: PlayFunction<TRenderer, TArgs>, context: PlayFunctionContext<TRenderer, TArgs>) => Promise<void>;
166
+ type BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> = {
167
167
  /**
168
168
  * Wrapper components or Storybook decorators that wrap a story.
169
169
  *
170
170
  * Decorators defined in Meta will be applied to every story variation.
171
171
  * @see [Decorators](https://storybook.js.org/docs/addons/introduction/#1-decorators)
172
172
  */
173
- decorators?: DecoratorFunction<TRenderer, TArgs>[];
173
+ decorators?: DecoratorFunction<TRenderer, Simplify<TArgs>>[];
174
174
  /**
175
175
  * Custom metadata for a story.
176
176
  * @see [Parameters](https://storybook.js.org/docs/basics/writing-stories/#parameters)
@@ -196,7 +196,7 @@ declare type BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args
196
196
  */
197
197
  render?: ArgsStoryFn<TRenderer, TArgs>;
198
198
  };
199
- declare type ProjectAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> = BaseAnnotations<TRenderer, TArgs> & {
199
+ type ProjectAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> = BaseAnnotations<TRenderer, TArgs> & {
200
200
  argsEnhancers?: ArgsEnhancer<TRenderer, Args>[];
201
201
  argTypesEnhancers?: ArgTypesEnhancer<TRenderer, Args>[];
202
202
  globals?: Globals;
@@ -204,7 +204,7 @@ declare type ProjectAnnotations<TRenderer extends Renderer = Renderer, TArgs = A
204
204
  applyDecorators?: DecoratorApplicator<TRenderer, Args>;
205
205
  runStep?: StepRunner<TRenderer, TArgs>;
206
206
  };
207
- declare type StoryDescriptor$1 = string[] | RegExp;
207
+ type StoryDescriptor$1 = string[] | RegExp;
208
208
  interface ComponentAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> extends BaseAnnotations<TRenderer, TArgs> {
209
209
  /**
210
210
  * Title of the component which will be presented in the navigation. **Should be unique.**
@@ -281,7 +281,7 @@ interface ComponentAnnotations<TRenderer extends Renderer = Renderer, TArgs = Ar
281
281
  */
282
282
  tags?: Tag[];
283
283
  }
284
- declare type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args, TRequiredArgs = Partial<TArgs>> = BaseAnnotations<TRenderer, TArgs> & {
284
+ type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args, TRequiredArgs = Partial<TArgs>> = BaseAnnotations<TRenderer, TArgs> & {
285
285
  /**
286
286
  * Override the display name in the UI (CSF v3)
287
287
  */
@@ -305,23 +305,23 @@ declare type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Arg
305
305
  } : {
306
306
  args: TRequiredArgs;
307
307
  });
308
- declare type LegacyAnnotatedStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryFn<TRenderer, TArgs> & StoryAnnotations<TRenderer, TArgs>;
309
- declare type LegacyStoryAnnotationsOrFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyAnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>;
310
- declare type AnnotatedStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = ArgsStoryFn<TRenderer, TArgs> & StoryAnnotations<TRenderer, TArgs>;
311
- declare type StoryAnnotationsOrFn<TRenderer extends Renderer = Renderer, TArgs = Args> = AnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>;
312
- declare type ArgsFromMeta<TRenderer extends Renderer, Meta> = Meta extends {
308
+ type LegacyAnnotatedStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryFn<TRenderer, TArgs> & StoryAnnotations<TRenderer, TArgs>;
309
+ type LegacyStoryAnnotationsOrFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyAnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>;
310
+ type AnnotatedStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = ArgsStoryFn<TRenderer, TArgs> & StoryAnnotations<TRenderer, TArgs>;
311
+ type StoryAnnotationsOrFn<TRenderer extends Renderer = Renderer, TArgs = Args> = AnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>;
312
+ type ArgsFromMeta<TRenderer extends Renderer, Meta> = Meta extends {
313
313
  render?: ArgsStoryFn<TRenderer, infer RArgs>;
314
314
  loaders?: (infer Loaders)[];
315
315
  decorators?: (infer Decorators)[];
316
316
  } ? Simplify<RemoveIndexSignature<RArgs & DecoratorsArgs<TRenderer, Decorators> & LoaderArgs<TRenderer, Loaders>>> : unknown;
317
- declare type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
318
- declare type LoaderArgs<TRenderer extends Renderer, Loaders> = UnionToIntersection<Loaders extends LoaderFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
317
+ type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
318
+ type LoaderArgs<TRenderer extends Renderer, Loaders> = UnionToIntersection<Loaders extends LoaderFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
319
319
 
320
320
  /**
321
321
  * Helper function to include/exclude an arg based on the value of other other args
322
322
  * aka "conditional args"
323
323
  */
324
- declare const includeConditionalArg: (argType: InputType, args: Args, globals: Globals) => boolean;
324
+ declare const includeConditionalArg: (argType: InputType, args: Args, globals: Globals) => any;
325
325
 
326
326
  /**
327
327
  * Remove punctuation and illegal characters from a story ID.
@@ -337,7 +337,7 @@ declare const toId: (kind: string, name?: string) => string;
337
337
  * Transform a CSF named export into a readable story name
338
338
  */
339
339
  declare const storyNameFromExport: (key: string) => string;
340
- declare type StoryDescriptor = string[] | RegExp;
340
+ type StoryDescriptor = string[] | RegExp;
341
341
  interface IncludeExcludeOptions {
342
342
  includeStories?: StoryDescriptor;
343
343
  excludeStories?: StoryDescriptor;
package/dist/index.js CHANGED
@@ -1,109 +1,10 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
25
2
 
26
- // src/index.ts
27
- var src_exports = {};
28
- __export(src_exports, {
29
- includeConditionalArg: () => includeConditionalArg,
30
- isExportStory: () => isExportStory,
31
- parseKind: () => parseKind,
32
- sanitize: () => sanitize,
33
- storyNameFromExport: () => storyNameFromExport,
34
- toId: () => toId
35
- });
36
- module.exports = __toCommonJS(src_exports);
37
- var import_startCase = __toESM(require("lodash/startCase"));
3
+ var B=Object.create;var R=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var E=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of C(e))!w.call(r,a)&&a!==t&&R(r,a,{get:()=>e[a],enumerable:!(n=b(e,a))||n.enumerable});return r};var P=(r,e,t)=>(t=r!=null?B(h(r)):{},E(e||!r||!r.__esModule?R(t,"default",{value:r,enumerable:!0}):t,r));var x=I(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,t=Object.getOwnPropertySymbols?function(n){return Object.keys(n).concat(Object.getOwnPropertySymbols(n))}:Object.keys;return function(n,a){return function i(o,s,d){var y,g,p,A=r.call(o),F=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(d.indexOf(o)>-1&&d.indexOf(s)>-1)return !0;if(d.push(o,s),A!=F||(y=t(o),g=t(s),y.length!=g.length||y.some(function(l){return !i(o[l],s[l],d)})))return !1;switch(A.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((p=y.next()).value,g.next().value,d))return !1;while(!p.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(p=0;p<o.length;p++)if((p in o||p in s)&&(p in o!=p in s||!i(o[p],s[p],d)))return !1;return !0;case"Object":return i(e(o),e(s),d);default:return !1}}(n,a,[])}}();});function u(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,t,n,a)=>`${t} ${n}${a}`).replace(/([a-z])([A-Z])/g,(e,t,n)=>`${t} ${n}`).replace(/([a-z])([0-9])/gi,(e,t,n)=>`${t} ${n}`).replace(/([0-9])([a-z])/gi,(e,t,n)=>`${t} ${n}`).replace(/(\s|^)(\w)/g,(e,t,n)=>`${t}${n.toUpperCase()}`).replace(/ +/g," ").trim()}var c=P(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,O=(r,e)=>{let{exists:t,eq:n,neq:a,truthy:i}=r;if(S([t,n,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:t,eq:n,neq:a})}`);if(typeof n<"u")return (0, c.isEqual)(e,n);if(typeof a<"u")return !(0, c.isEqual)(e,a);if(typeof t<"u"){let s=typeof e<"u";return t?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},v=(r,e,t)=>{if(!r.if)return !0;let{arg:n,global:a}=r.if;if(S([n,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:n,global:a})}`);let i=n?e[n]:t[a];return O(r.if,i)};var L=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let t=L(r);if(t==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return t},N=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,M=r=>u(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function G(r,{includeStories:e,excludeStories:t}){return r!=="__esModule"&&(!e||f(r,e))&&(!t||!f(r,t))}var z=(r,{rootSeparator:e,groupSeparator:t})=>{let[n,a]=r.split(e,2),i=(a||r).split(t).filter(o=>!!o);return {root:a?n:null,groups:i}};
38
4
 
39
- // src/includeConditionalArg.ts
40
- var import_isEqual = __toESM(require("lodash/isEqual"));
41
- var count = (vals) => vals.map((v) => typeof v !== "undefined").filter(Boolean).length;
42
- var testValue = (cond, value) => {
43
- const { exists, eq, neq, truthy } = cond;
44
- if (count([exists, eq, neq, truthy]) > 1) {
45
- throw new Error(`Invalid conditional test ${JSON.stringify({ exists, eq, neq })}`);
46
- }
47
- if (typeof eq !== "undefined") {
48
- return (0, import_isEqual.default)(value, eq);
49
- }
50
- if (typeof neq !== "undefined") {
51
- return !(0, import_isEqual.default)(value, neq);
52
- }
53
- if (typeof exists !== "undefined") {
54
- const valueExists = typeof value !== "undefined";
55
- return exists ? valueExists : !valueExists;
56
- }
57
- const shouldBeTruthy = typeof truthy === "undefined" ? true : truthy;
58
- return shouldBeTruthy ? !!value : !value;
59
- };
60
- var includeConditionalArg = (argType, args, globals) => {
61
- if (!argType.if)
62
- return true;
63
- const { arg, global } = argType.if;
64
- if (count([arg, global]) !== 1) {
65
- throw new Error(`Invalid conditional value ${JSON.stringify({ arg, global })}`);
66
- }
67
- const value = arg ? args[arg] : globals[global];
68
- return testValue(argType.if, value);
69
- };
70
-
71
- // src/index.ts
72
- var sanitize = (string) => {
73
- return string.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
74
- };
75
- var sanitizeSafe = (string, part) => {
76
- const sanitized = sanitize(string);
77
- if (sanitized === "") {
78
- throw new Error(`Invalid ${part} '${string}', must include alphanumeric characters`);
79
- }
80
- return sanitized;
81
- };
82
- var toId = (kind, name) => `${sanitizeSafe(kind, "kind")}${name ? `--${sanitizeSafe(name, "name")}` : ""}`;
83
- var storyNameFromExport = (key) => (0, import_startCase.default)(key);
84
- function matches(storyKey, arrayOrRegex) {
85
- if (Array.isArray(arrayOrRegex)) {
86
- return arrayOrRegex.includes(storyKey);
87
- }
88
- return storyKey.match(arrayOrRegex);
89
- }
90
- function isExportStory(key, { includeStories, excludeStories }) {
91
- return key !== "__esModule" && (!includeStories || matches(key, includeStories)) && (!excludeStories || !matches(key, excludeStories));
92
- }
93
- var parseKind = (kind, { rootSeparator, groupSeparator }) => {
94
- const [root, remainder] = kind.split(rootSeparator, 2);
95
- const groups = (remainder || kind).split(groupSeparator).filter((i) => !!i);
96
- return {
97
- root: remainder ? root : null,
98
- groups
99
- };
100
- };
101
- // Annotate the CommonJS export names for ESM import in node:
102
- 0 && (module.exports = {
103
- includeConditionalArg,
104
- isExportStory,
105
- parseKind,
106
- sanitize,
107
- storyNameFromExport,
108
- toId
109
- });
5
+ exports.includeConditionalArg = v;
6
+ exports.isExportStory = G;
7
+ exports.parseKind = z;
8
+ exports.sanitize = L;
9
+ exports.storyNameFromExport = M;
10
+ exports.toId = N;
package/dist/index.mjs CHANGED
@@ -1,73 +1,3 @@
1
- // src/index.ts
2
- import startCase from "lodash/startCase";
1
+ var B=Object.create;var R=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var E=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of C(e))!w.call(r,a)&&a!==t&&R(r,a,{get:()=>e[a],enumerable:!(n=b(e,a))||n.enumerable});return r};var P=(r,e,t)=>(t=r!=null?B(h(r)):{},E(e||!r||!r.__esModule?R(t,"default",{value:r,enumerable:!0}):t,r));var x=I(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,t=Object.getOwnPropertySymbols?function(n){return Object.keys(n).concat(Object.getOwnPropertySymbols(n))}:Object.keys;return function(n,a){return function i(o,s,d){var y,g,p,A=r.call(o),F=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(d.indexOf(o)>-1&&d.indexOf(s)>-1)return !0;if(d.push(o,s),A!=F||(y=t(o),g=t(s),y.length!=g.length||y.some(function(l){return !i(o[l],s[l],d)})))return !1;switch(A.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((p=y.next()).value,g.next().value,d))return !1;while(!p.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(p=0;p<o.length;p++)if((p in o||p in s)&&(p in o!=p in s||!i(o[p],s[p],d)))return !1;return !0;case"Object":return i(e(o),e(s),d);default:return !1}}(n,a,[])}}();});function u(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,t,n,a)=>`${t} ${n}${a}`).replace(/([a-z])([A-Z])/g,(e,t,n)=>`${t} ${n}`).replace(/([a-z])([0-9])/gi,(e,t,n)=>`${t} ${n}`).replace(/([0-9])([a-z])/gi,(e,t,n)=>`${t} ${n}`).replace(/(\s|^)(\w)/g,(e,t,n)=>`${t}${n.toUpperCase()}`).replace(/ +/g," ").trim()}var c=P(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,O=(r,e)=>{let{exists:t,eq:n,neq:a,truthy:i}=r;if(S([t,n,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:t,eq:n,neq:a})}`);if(typeof n<"u")return (0, c.isEqual)(e,n);if(typeof a<"u")return !(0, c.isEqual)(e,a);if(typeof t<"u"){let s=typeof e<"u";return t?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},v=(r,e,t)=>{if(!r.if)return !0;let{arg:n,global:a}=r.if;if(S([n,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:n,global:a})}`);let i=n?e[n]:t[a];return O(r.if,i)};var L=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let t=L(r);if(t==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return t},N=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,M=r=>u(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function G(r,{includeStories:e,excludeStories:t}){return r!=="__esModule"&&(!e||f(r,e))&&(!t||!f(r,t))}var z=(r,{rootSeparator:e,groupSeparator:t})=>{let[n,a]=r.split(e,2),i=(a||r).split(t).filter(o=>!!o);return {root:a?n:null,groups:i}};
3
2
 
4
- // src/includeConditionalArg.ts
5
- import isEqual from "lodash/isEqual";
6
- var count = (vals) => vals.map((v) => typeof v !== "undefined").filter(Boolean).length;
7
- var testValue = (cond, value) => {
8
- const { exists, eq, neq, truthy } = cond;
9
- if (count([exists, eq, neq, truthy]) > 1) {
10
- throw new Error(`Invalid conditional test ${JSON.stringify({ exists, eq, neq })}`);
11
- }
12
- if (typeof eq !== "undefined") {
13
- return isEqual(value, eq);
14
- }
15
- if (typeof neq !== "undefined") {
16
- return !isEqual(value, neq);
17
- }
18
- if (typeof exists !== "undefined") {
19
- const valueExists = typeof value !== "undefined";
20
- return exists ? valueExists : !valueExists;
21
- }
22
- const shouldBeTruthy = typeof truthy === "undefined" ? true : truthy;
23
- return shouldBeTruthy ? !!value : !value;
24
- };
25
- var includeConditionalArg = (argType, args, globals) => {
26
- if (!argType.if)
27
- return true;
28
- const { arg, global } = argType.if;
29
- if (count([arg, global]) !== 1) {
30
- throw new Error(`Invalid conditional value ${JSON.stringify({ arg, global })}`);
31
- }
32
- const value = arg ? args[arg] : globals[global];
33
- return testValue(argType.if, value);
34
- };
35
-
36
- // src/index.ts
37
- var sanitize = (string) => {
38
- return string.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
39
- };
40
- var sanitizeSafe = (string, part) => {
41
- const sanitized = sanitize(string);
42
- if (sanitized === "") {
43
- throw new Error(`Invalid ${part} '${string}', must include alphanumeric characters`);
44
- }
45
- return sanitized;
46
- };
47
- var toId = (kind, name) => `${sanitizeSafe(kind, "kind")}${name ? `--${sanitizeSafe(name, "name")}` : ""}`;
48
- var storyNameFromExport = (key) => startCase(key);
49
- function matches(storyKey, arrayOrRegex) {
50
- if (Array.isArray(arrayOrRegex)) {
51
- return arrayOrRegex.includes(storyKey);
52
- }
53
- return storyKey.match(arrayOrRegex);
54
- }
55
- function isExportStory(key, { includeStories, excludeStories }) {
56
- return key !== "__esModule" && (!includeStories || matches(key, includeStories)) && (!excludeStories || !matches(key, excludeStories));
57
- }
58
- var parseKind = (kind, { rootSeparator, groupSeparator }) => {
59
- const [root, remainder] = kind.split(rootSeparator, 2);
60
- const groups = (remainder || kind).split(groupSeparator).filter((i) => !!i);
61
- return {
62
- root: remainder ? root : null,
63
- groups
64
- };
65
- };
66
- export {
67
- includeConditionalArg,
68
- isExportStory,
69
- parseKind,
70
- sanitize,
71
- storyNameFromExport,
72
- toId
73
- };
3
+ export { v as includeConditionalArg, G as isExportStory, z as parseKind, L as sanitize, M as storyNameFromExport, N as toId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/csf",
3
- "version": "0.0.2-next.8",
3
+ "version": "0.1.0",
4
4
  "description": "Component Story Format (CSF) utilities",
5
5
  "keywords": [
6
6
  "storybook",
@@ -17,32 +17,33 @@
17
17
  "url": "https://github.com/ComponentDriven/csf.git"
18
18
  },
19
19
  "license": "MIT",
20
- "files": [
21
- "dist/**/*",
22
- "README.md",
23
- "*.js",
24
- "*.d.ts"
25
- ],
26
20
  "exports": {
27
21
  ".": {
28
22
  "import": "./dist/index.mjs",
29
- "require": "./dist/index.js"
23
+ "require": "./dist/index.js",
24
+ "browser": "./dist/index.mjs",
25
+ "node": "./dist/index.js",
26
+ "types": "./dist/index.d.ts"
30
27
  }
31
28
  },
32
29
  "main": "dist/index.js",
33
30
  "module": "dist/index.mjs",
34
31
  "types": "dist/index.d.ts",
32
+ "files": [
33
+ "dist/**/*",
34
+ "README.md",
35
+ "*.js",
36
+ "*.d.ts"
37
+ ],
35
38
  "scripts": {
36
- "build": "tsup ./src/index.ts --format esm,cjs --dts",
39
+ "build": "tsup ./src/index.ts --format esm,cjs --dts --treeshake --minify",
37
40
  "check": "tsc",
38
41
  "lint": "eslint src --ext .ts",
39
- "test": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-vm-modules jest",
40
- "release": "yarn build && auto shipit"
42
+ "release": "yarn build && auto shipit",
43
+ "test": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-vm-modules jest"
41
44
  },
45
+ "prettier": "@storybook/linter-config/prettier.config",
42
46
  "eslintConfig": {
43
- "extends": [
44
- "@storybook/eslint-config-storybook"
45
- ],
46
47
  "parserOptions": {
47
48
  "project": [
48
49
  "./tsconfig.json"
@@ -57,6 +58,9 @@
57
58
  }
58
59
  }
59
60
  },
61
+ "extends": [
62
+ "@storybook/eslint-config-storybook"
63
+ ],
60
64
  "rules": {
61
65
  "import/no-unresolved": "error",
62
66
  "jest/expect-expect": [
@@ -70,15 +74,18 @@
70
74
  ]
71
75
  }
72
76
  },
73
- "prettier": "@storybook/linter-config/prettier.config",
74
77
  "jest": {
75
- "preset": "ts-jest/presets/default-esm",
76
78
  "extensionsToTreatAsEsm": [
77
79
  ".ts"
78
80
  ],
79
81
  "moduleNameMapper": {
80
82
  "^(\\.{1,2}/.*)\\.js$": "$1"
81
83
  },
84
+ "preset": "ts-jest/presets/default-esm",
85
+ "roots": [
86
+ "<rootDir>/src"
87
+ ],
88
+ "testEnvironment": "node",
82
89
  "transform": {
83
90
  "^.+\\.tsx?$": [
84
91
  "ts-jest",
@@ -86,22 +93,16 @@
86
93
  "useESM": true
87
94
  }
88
95
  ]
89
- },
90
- "testEnvironment": "node",
91
- "roots": [
92
- "<rootDir>/src"
93
- ]
96
+ }
94
97
  },
95
98
  "dependencies": {
96
- "expect-type": "^0.14.2",
97
- "lodash": "^4.17.15",
98
99
  "type-fest": "^2.19.0"
99
100
  },
100
101
  "devDependencies": {
101
102
  "@auto-it/released": "^10.37.6",
103
+ "@ngard/tiny-isequal": "^1.1.0",
102
104
  "@storybook/eslint-config-storybook": "^3.1.2",
103
105
  "@types/jest": "^29.2.0",
104
- "@types/lodash": "^4.14.149",
105
106
  "@types/node": "^18.11.0",
106
107
  "@typescript-eslint/eslint-plugin": "^5.42.1",
107
108
  "@typescript-eslint/parser": "^5.42.1",
@@ -111,19 +112,22 @@
111
112
  "eslint-import-resolver-typescript": "^3.5.2",
112
113
  "eslint-plugin-import": "^2.26.0",
113
114
  "eslint-plugin-jest": "^27.1.4",
115
+ "expect-type": "^0.14.2",
114
116
  "jest": "^29.3.1",
117
+ "lodash": "^4.17.21",
118
+ "@types/lodash": "^4.14.191",
115
119
  "prettier": "^2.7.1",
116
120
  "ts-jest": "^29.0.3",
117
121
  "tsup": "^6.4.0",
118
122
  "typescript": "^4.8.4"
119
123
  },
124
+ "publishConfig": {
125
+ "access": "public"
126
+ },
120
127
  "auto": {
121
128
  "plugins": [
122
129
  "npm",
123
130
  "released"
124
131
  ]
125
- },
126
- "publishConfig": {
127
- "access": "public"
128
132
  }
129
133
  }