Skip to content

Commit

Permalink
Lint and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxhoundn committed Aug 1, 2024
1 parent 3b02723 commit b102582
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 32 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"updatePullRequestVersion"
],
"pre-push": [
"test"
"test",
"lint",
"build:test"
],
"scripts": {
"typedoc": "typedoc",
Expand All @@ -43,7 +45,8 @@
"build-storybook": "storybook build",
"prepare": "npm run build",
"chromatic": "npx chromatic --project-token=59cd7005d0f1",
"update-reqore": "yarn add -D @qoretechnologies/reqore@beta"
"update-reqore": "yarn add -D @qoretechnologies/reqore@beta",
"precheck": "yarn run lint && yarn run test && yarn build:test"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion pullRequestRelease.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version": "0.4.01722516445"}
{"version": "0.4.11722524490"}
4 changes: 2 additions & 2 deletions src/stories/QorusAuthenticator/Properties.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newClassPropertyStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Property';
const Template = 'Property';

const prepareStory = newClassPropertyStory(Template, 'QorusAuthenticator');

Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusDataProvider/Methods.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newMethodStory } from '../utils';

export default {
Expand Down Expand Up @@ -28,7 +28,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Method';
const Template = 'Method';

const prepareStory = newMethodStory(Template, 'QorusDataProvider');

Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusDataProvider/Properties.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newClassPropertyStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Property';
const Template = 'Property';
const prepareStory = newClassPropertyStory(Template, 'QorusDataProvider');

export const path = prepareStory('path');
Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusOptions/Methods.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newMethodStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Method';
const Template = 'Method';

const prepareStory = newMethodStory(Template, 'QorusOptions');

Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusOptions/Properties.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newClassPropertyStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Property';
const Template = 'Property';
const prepareStory = newClassPropertyStory(Template, 'QorusOptions');

export const name = prepareStory('name');
Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusRequest/Methods.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newMethodStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Method';
const Template = 'Method';

const prepareStory = newMethodStory(Template, 'QorusRequest');

Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusRequest/Properties.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newClassPropertyStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Property';
const Template = 'Property';
const prepareStory = newClassPropertyStory(Template, 'QorusRequest');

export const defaultHeaders = prepareStory('defaultHeaders');
Expand Down
4 changes: 2 additions & 2 deletions src/stories/QorusValidator/Methods.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Documentation } from '../components/documentation';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, getClassData, newMethodStory } from '../utils';

export default {
Expand Down Expand Up @@ -27,7 +27,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = {};
const Template = {};

const prepareStory = newMethodStory(Template, 'QorusValidator');

Expand Down
4 changes: 2 additions & 2 deletions src/stories/TypeAliases/TypeAliases.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DocumentationItem } from '../components/item';
import { DocumentationWrapper } from '../components/wrapper';
import { IDocumentationMeta, IDocumentationStory } from '../types';
import { IDocumentationMeta } from '../types';
import { argsData, prepareTypeStory } from '../utils';

export default {
Expand All @@ -18,7 +18,7 @@ export default {
},
} as IDocumentationMeta;

const Template: IDocumentationStory = 'Type';
const Template = 'Type';

export const TVersion = prepareTypeStory(Template, 'TVersion');
TVersion.storyName = 'TVersion';
Expand Down
5 changes: 3 additions & 2 deletions src/stories/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TReqoreIntent } from '@qoretechnologies/reqore/dist/constants/theme';
import { Meta } from '@storybook/react';

export interface IDocumentationParam {
// TODO: Type is now optional but needs to be REQUIRED in the future
Expand Down Expand Up @@ -26,8 +27,8 @@ export type TDocumentationLabel =

export interface IDocumentationProps extends IMethodDocs {}

export interface IDocumentationMeta {}
export interface IDocumentationStory {}
export interface IDocumentationMeta extends Meta {}
export interface IDocumentationStory extends Meta {}

export interface IDocumentationProperty {
name: string;
Expand Down
17 changes: 8 additions & 9 deletions src/stories/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
IDocumentationClass,
IDocumentationProperty,
IDocumentationProps,
IDocumentationStory,
IInterfaceDocs,
IMethodDocs,
ITypeAliasDocs,
Expand Down Expand Up @@ -135,7 +134,7 @@ export const getClassPropertyData = (propertyName: string, className: string): I
return property;
};

export const prepareMethodStory = (_template: IDocumentationStory, methodName: string, className: string) => {
export const prepareMethodStory = (_template: any, methodName: string, className: string) => {
const selectedMethod = getMethodData(methodName, className);

const story: any = {};
Expand All @@ -157,7 +156,7 @@ export const getTypeOrInterfaceData = (typeOrInterfaceName: string) => {
return getTypeAliasData(typeOrInterfaceName);
};

export const prepareInterfaceStory = (_template: IDocumentationStory, interfaceName: string) => {
export const prepareInterfaceStory = (_template: any, interfaceName: string) => {
const selectedInterface = getInterfaceData(interfaceName);

const story: any = {};
Expand All @@ -169,7 +168,7 @@ export const prepareInterfaceStory = (_template: IDocumentationStory, interfaceN
return story;
};

export const prepareTypeStory = (_template: IDocumentationStory, typeAliasName: string) => {
export const prepareTypeStory = (_template: any, typeAliasName: string) => {
const selectedTypeAlias = getTypeAliasData(typeAliasName);

const story: any = {};
Expand All @@ -181,7 +180,7 @@ export const prepareTypeStory = (_template: IDocumentationStory, typeAliasName:
return story;
};

export const prepareClassPropertyStory = (_template: IDocumentationStory, propertyName: string, className: string) => {
export const prepareClassPropertyStory = (_template: any, propertyName: string, className: string) => {
const propertyDocs = getClassPropertyData(propertyName, className);

const story: any = {};
Expand All @@ -193,18 +192,18 @@ export const prepareClassPropertyStory = (_template: IDocumentationStory, proper
return story;
};

export const newMethodStory = (template: IDocumentationStory, className: string) => (methodName: string) => {
export const newMethodStory = (template: any, className: string) => (methodName: string) => {
return prepareMethodStory(template, methodName, className);
};

export const newClassPropertyStory = (template: IDocumentationStory, className: string) => (propertyName: string) => {
export const newClassPropertyStory = (template: any, className: string) => (propertyName: string) => {
return prepareClassPropertyStory(template, propertyName, className);
};

export const newTypeAliasStory = (template: IDocumentationStory) => (typeAliasName: string) => {
export const newTypeAliasStory = (template: any) => (typeAliasName: string) => {
return prepareTypeStory(template, typeAliasName);
};
export const newInterfaceStory = (template: IDocumentationStory) => (interfaceName: string) => {
export const newInterfaceStory = (template: any) => (interfaceName: string) => {
return prepareInterfaceStory(template, interfaceName);
};

Expand Down

0 comments on commit b102582

Please sign in to comment.