Skip to content

Commit

Permalink
chore: extensions-remove-unused
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbas21 committed Jan 29, 2025
1 parent f26f1f7 commit 8577a48
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- run: git branch --track main origin/main

- run: pnpm exec nx-cloud record -- nx format:check
- run: pnpm exec nx affected -t build lint test docs e2e-ci
- run: pnpm exec nx affected -t typecheck build lint test docs e2e-ci

- uses: codecov/codecov-action@v5
with:
Expand Down
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"noMarkdown": ["!{projectRoot}/**/*.md"]
},
"targetDefaults": {
"typecheck": {
"dependsOn": ["build", "^build"]
},
"docs": {
"dependsOn": ["build", "^build", "^docs"],
"cache": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/davinci-client/src/lib/client.types.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { describe, expectTypeOf, it } from 'vitest';
import type { InitFlow, InternalErrorResponse, FlowNode, Updater } from './client.types.js';
import type { InitFlow, InternalErrorResponse, Updater } from './client.types.js';
import type { GenericError } from './error.types.js';
import type { ErrorNode, FailureNode, ContinueNode, StartNode, SuccessNode } from './node.types.js';

Expand Down
4 changes: 2 additions & 2 deletions packages/davinci-client/src/lib/client.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GenericError } from './error.types';
import { ErrorNode, FailureNode, ContinueNode, StartNode, SuccessNode } from './node.types';
import { GenericError } from './error.types.js';
import { ErrorNode, FailureNode, ContinueNode, StartNode, SuccessNode } from './node.types.js';

export type FlowNode = ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode;

Expand Down
7 changes: 6 additions & 1 deletion packages/davinci-client/src/lib/collector.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import type {
MultiValueCollectorTypes,
InferActionCollectorType,
} from './collector.types';
import type { DaVinciField, MultiSelect, SingleSelect, StandardFieldValue } from './davinci.types';
import type {
DaVinciField,
MultiSelect,
SingleSelect,
StandardFieldValue,
} from './davinci.types.js';

/**
* @function returnActionCollector - Creates an ActionCollector object based on the provided field and index.
Expand Down
2 changes: 1 addition & 1 deletion packages/davinci-client/src/lib/config.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Import ConfigOptions type from the JavaScript SDK
*/
import type { AsyncConfigOptions } from '@forgerock/javascript-sdk/src/config/interfaces';
import { WellknownResponse } from './wellknown.types';
import { WellknownResponse } from './wellknown.types.js';

export interface DaVinciConfig extends AsyncConfigOptions {
responseType?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/davinci-client/src/lib/davinci.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { handleResponse, transformActionRequest, transformSubmitRequest } from '
* Import the DaVinci types
*/
import type { RootStateWithNode } from './client.store.utils.js';
import type { DaVinciCacheEntry, ThrownQueryError } from './davinci.types';
import type { DaVinciCacheEntry, ThrownQueryError } from './davinci.types.js';
import type { ContinueNode } from './node.types.js';
import type { StartNode } from '../types.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/davinci-client/src/lib/davinci.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import type { Dispatch } from '@reduxjs/toolkit';

import { nodeSlice } from './node.slice';
import { nodeSlice } from './node.slice.js';

import type {
DaVinciCacheEntry,
Expand Down
2 changes: 1 addition & 1 deletion packages/davinci-client/src/lib/node.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
returnSingleSelectCollector,
returnMultiSelectCollector,
} from './collector.utils.js';
import type { DaVinciField } from './davinci.types';
import type { DaVinciField } from './davinci.types.js';
import {
ActionCollector,
MultiSelectCollector,
Expand Down
8 changes: 4 additions & 4 deletions packages/davinci-client/src/lib/node.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import { createSlice } from '@reduxjs/toolkit';
/**
* Import the needed reducers
*/
import { nodeCollectorReducer, updateCollectorValues } from './node.reducer';
import { nodeCollectorReducer, updateCollectorValues } from './node.reducer.js';

/**
* Import the types
*/
import type { Draft, PayloadAction } from '@reduxjs/toolkit';
import type { SubmitCollector } from './collector.types';
import type { SubmitCollector } from './collector.types.js';
import type {
DavinciErrorResponse,
DaVinciFailureResponse,
DaVinciNextResponse,
DaVinciSuccessResponse,
} from './davinci.types';
import type { ContinueNode, SuccessNode, ErrorNode, StartNode, FailureNode } from './node.types';
} from './davinci.types.js';
import type { ContinueNode, SuccessNode, ErrorNode, StartNode, FailureNode } from './node.types.js';

/**
* The possible statuses for the four types of nodes
Expand Down
4 changes: 4 additions & 0 deletions packages/davinci-client/src/lib/node.types.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import type { ErrorDetail, Links } from './davinci.types.js';
import {
ActionCollector,
FlowCollector,
MultiSelectCollector,
PasswordCollector,
SingleSelectCollector,
SingleValueCollector,
SocialLoginCollector,
SubmitCollector,
Expand Down Expand Up @@ -203,6 +205,8 @@ describe('Node Types', () => {
| SubmitCollector
| ActionCollector<'ActionCollector'>
| SingleValueCollector<'SingleValueCollector'>
| MultiSelectCollector
| SingleSelectCollector
>();

// Test that each collector type is part of the union
Expand Down
16 changes: 5 additions & 11 deletions packages/davinci-client/src/lib/node.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import type {
SubmitCollector,
ActionCollector,
SingleValueCollector,
RadioCollector,
ComboboxCollector,
DropDownCollector,
//LabelCollector,
FlowLinkCollector,
SingleSelectCollector,
MultiSelectCollector,
} from './collector.types.js';
import type { ErrorDetail, Links } from './davinci.types.js';
import { GenericError } from './error.types.js';
Expand All @@ -25,15 +22,12 @@ export type Collectors =
| FlowCollector
| PasswordCollector
| TextCollector
| RadioCollector
| ComboboxCollector
| DropDownCollector
//| LabelCollector
| FlowLinkCollector
| SingleSelectCollector
| SocialLoginCollector
| SubmitCollector
| ActionCollector<'ActionCollector'>
| SingleValueCollector<'SingleValueCollector'>;
| SingleValueCollector<'SingleValueCollector'>
| MultiSelectCollector;

export interface ContinueNode {
cache: {
Expand Down
2 changes: 1 addition & 1 deletion packages/davinci-client/src/lib/wellknown.api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query';
import { WellknownResponse } from './wellknown.types';
import { WellknownResponse } from './wellknown.types.js';

export const wellknownApi = createApi({
reducerPath: 'wellknown',
Expand Down
46 changes: 0 additions & 46 deletions packages/davinci-client/src/types.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import type {
TextCollector,
SocialLoginCollector,
SubmitCollector,
DropdownCollector,
ComboboxCollector,
RadioCollector,
FlowLinkCollector,
} from './types.js';
import type * as Types from './types.js';

Expand Down Expand Up @@ -77,48 +73,6 @@ describe('Type exports', () => {
expectTypeOf<PasswordCollector>().toHaveProperty('input').toBeObject();
expectTypeOf<PasswordCollector>().toHaveProperty('output').toBeObject();
});

it('should validate DropdownCollector structure', () => {
expectTypeOf<DropdownCollector>()
.toHaveProperty('category')
.toEqualTypeOf<'SingleValueCollector'>();
expectTypeOf<DropdownCollector>()
.toHaveProperty('type')
.toEqualTypeOf<'DropDownCollector'>();
expectTypeOf<DropdownCollector>().toHaveProperty('input').toBeObject();
expectTypeOf<DropdownCollector>().toHaveProperty('output').toBeObject();
});

it('should validate ComboboxCollector structure', () => {
expectTypeOf<ComboboxCollector>()
.toHaveProperty('category')
.toEqualTypeOf<'SingleValueCollector'>();
expectTypeOf<ComboboxCollector>()
.toHaveProperty('type')
.toEqualTypeOf<'ComboboxCollector'>();
expectTypeOf<ComboboxCollector>().toHaveProperty('input').toBeObject();
expectTypeOf<ComboboxCollector>().toHaveProperty('output').toBeObject();
});

it('should validate RadioCollector structure', () => {
expectTypeOf<RadioCollector>()
.toHaveProperty('category')
.toEqualTypeOf<'SingleValueCollector'>();
expectTypeOf<RadioCollector>().toHaveProperty('type').toEqualTypeOf<'RadioCollector'>();
expectTypeOf<RadioCollector>().toHaveProperty('input').toBeObject();
expectTypeOf<RadioCollector>().toHaveProperty('output').toBeObject();
});

it('should validate FlowLinkCollector structure', () => {
expectTypeOf<FlowLinkCollector>()
.toHaveProperty('category')
.toEqualTypeOf<'SingleValueCollector'>();
expectTypeOf<FlowLinkCollector>()
.toHaveProperty('type')
.toEqualTypeOf<'FlowLinkCollector'>();
expectTypeOf<FlowLinkCollector>().toHaveProperty('input').toBeObject();
expectTypeOf<FlowLinkCollector>().toHaveProperty('output').toBeObject();
});
});

describe('ActionCollector Types', () => {
Expand Down
5 changes: 0 additions & 5 deletions packages/davinci-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ export type PasswordCollector = collectors.PasswordCollector;
export type TextCollector = collectors.TextCollector;
export type SocialLoginCollector = collectors.SocialLoginCollector;
export type SubmitCollector = collectors.SubmitCollector;
export type DropdownCollector = collectors.DropDownCollector;
export type ComboboxCollector = collectors.ComboboxCollector;
export type RadioCollector = collectors.RadioCollector;
export type FlowLinkCollector = collectors.FlowLinkCollector;
//export type LabelCollector = collectors.LabelCollector;

0 comments on commit 8577a48

Please sign in to comment.