Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages/kernel": "0.1.2",
"packages/cli": "0.1.1",
"packages/ui": "0.1.1",
"packages/e2e-utils": "0.1.1"
"packages/kernel": "0.3.0",
"packages/cli": "0.3.0",
"packages/ui": "0.3.0",
"packages/e2e-utils": "0.3.0"
}
6 changes: 3 additions & 3 deletions app/showcase/__tests__/e2e/job-create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ test.describe.serial('Job creation workflow', () => {
await expect(rowLocator).toBeVisible({ timeout: 30000 });
const jobIdAttr = await rowLocator.first().getAttribute('data-job-id');
const jobId = jobIdAttr ? Number(jobIdAttr) : NaN;
if (!Number.isNaN(jobId)) {
createdJobIds.push(jobId);
} else {
if (Number.isNaN(jobId)) {
throw new Error('Failed to capture created job ID for cleanup');
} else {
createdJobIds.push(jobId);
}
});
});
4 changes: 2 additions & 2 deletions app/showcase/src/actions/jobs/CreateJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { job } from '../../resources';
import type { Job } from '../../../types/job';
import { ShowcaseActionError } from '../../errors/ShowcaseActionError';

export interface CreateJobInput {
export type CreateJobInput = {
title: string;
department?: string;
location?: string;
description?: string;
status: 'draft' | 'publish' | 'closed';
}
};

/**
* CreateJob orchestrates job creation through the resource client.
Expand Down
4 changes: 2 additions & 2 deletions app/showcase/src/errors/ShowcaseActionError.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { KernelError } from '@geekist/wp-kernel';
import type { ErrorCode, ErrorContext, ErrorData } from '@geekist/wp-kernel';

interface ShowcaseActionErrorOptions {
type ShowcaseActionErrorOptions = {
message?: string;
data?: ErrorData;
context?: ErrorContext;
}
};

/**
* ShowcaseActionError standardizes failures raised from showcase actions.
Expand Down
4 changes: 2 additions & 2 deletions app/showcase/src/resources/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { Job } from '../../types/job';
/**
* Query parameters for job listing endpoint.
*/
export interface JobListParams {
export type JobListParams = {
q?: string;
department?: string;
location?: string;
status?: 'draft' | 'publish' | 'closed';
cursor?: string;
}
};

/**
* Resource definition for job postings.
Expand Down
4 changes: 2 additions & 2 deletions app/showcase/src/views/jobs/JobCreatePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
import { __ } from '@wordpress/i18n';
import type { CreateJobInput } from '../../actions/jobs/CreateJob';

interface JobCreatePanelProps {
type JobCreatePanelProps = {
onSubmit: (input: CreateJobInput) => Promise<void> | void;
feedback?: { type: 'success' | 'error'; message: string } | null;
isSubmitting: boolean;
}
};

const createDefaultFormState = (): CreateJobInput => ({
title: '',
Expand Down
8 changes: 4 additions & 4 deletions app/showcase/src/views/jobs/JobFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { __ } from '@wordpress/i18n';

export type JobStatusFilter = 'all' | 'draft' | 'publish' | 'closed';

export interface JobFiltersState {
export type JobFiltersState = {
search: string;
status: JobStatusFilter;
}
};

interface JobFiltersProps {
type JobFiltersProps = {
value: JobFiltersState;
onChange: (next: JobFiltersState) => void;
}
};

/**
* JobFilters renders simple controls for search + status filtering.
Expand Down
4 changes: 2 additions & 2 deletions app/showcase/src/views/jobs/JobListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
import { __ } from '@wordpress/i18n';
import type { Job } from '../../../types/job';

interface JobListTableProps {
type JobListTableProps = {
jobs: Job[];
isLoading: boolean;
errorMessage?: string | null;
}
};

const formatDate = (value?: string): string => {
if (!value) {
Expand Down
4 changes: 2 additions & 2 deletions docs/api/generated/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
**WP Kernel API v0.1.1**
**WP Kernel API v0.3.0**

---

# WP Kernel API v0.1.1
# WP Kernel API v0.3.0

## Modules

Expand Down
13 changes: 5 additions & 8 deletions docs/api/generated/error/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**WP Kernel API v0.1.1**](../README.md)
[**WP Kernel API v0.3.0**](../README.md)

---

Expand All @@ -17,13 +17,10 @@ Exports all error types and utilities for consistent error handling throughout t
- [ServerError](classes/ServerError.md)
- [TransportError](classes/TransportError.md)

## Interfaces

- [WordPressRESTError](interfaces/WordPressRESTError.md)
- [ErrorContext](interfaces/ErrorContext.md)
- [ErrorData](interfaces/ErrorData.md)
- [SerializedError](interfaces/SerializedError.md)

## Type Aliases

- [WordPressRESTError](type-aliases/WordPressRESTError.md)
- [ErrorCode](type-aliases/ErrorCode.md)
- [ErrorContext](type-aliases/ErrorContext.md)
- [ErrorData](type-aliases/ErrorData.md)
- [SerializedError](type-aliases/SerializedError.md)
30 changes: 6 additions & 24 deletions docs/api/generated/error/classes/KernelError.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[**WP Kernel API v0.1.1**](../../README.md)
[**WP Kernel API v0.3.0**](../../README.md)

---

[WP Kernel API](../../README.md) / [error](../README.md) / KernelError

# Class: KernelError

Defined in: [error/KernelError.ts:28](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L28)

Base error class for WP Kernel

## Example
Expand Down Expand Up @@ -37,8 +35,6 @@ throw new KernelError('PolicyDenied', {
new KernelError(code, options): KernelError;
```

Defined in: [error/KernelError.ts:53](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L53)

Create a new KernelError

#### Parameters
Expand All @@ -59,11 +55,11 @@ Error options

###### data?

[`ErrorData`](../interfaces/ErrorData.md)
[`ErrorData`](../type-aliases/ErrorData.md)

###### context?

[`ErrorContext`](../interfaces/ErrorContext.md)
[`ErrorContext`](../type-aliases/ErrorContext.md)

#### Returns

Expand All @@ -83,8 +79,6 @@ Error.constructor;
readonly code: ErrorCode;
```

Defined in: [error/KernelError.ts:32](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L32)

Error code - identifies the type of error

---
Expand All @@ -95,8 +89,6 @@ Error code - identifies the type of error
readonly optional data: ErrorData;
```

Defined in: [error/KernelError.ts:37](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L37)

Additional data about the error

---
Expand All @@ -107,8 +99,6 @@ Additional data about the error
readonly optional context: ErrorContext;
```

Defined in: [error/KernelError.ts:42](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L42)

Context in which the error occurred

## Methods
Expand All @@ -119,13 +109,11 @@ Context in which the error occurred
toJSON(): SerializedError;
```

Defined in: [error/KernelError.ts:84](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L84)

Serialize error to JSON-safe format

#### Returns

[`SerializedError`](../interfaces/SerializedError.md)
[`SerializedError`](../type-aliases/SerializedError.md)

Serialized error object

Expand All @@ -137,15 +125,13 @@ Serialized error object
static fromJSON(serialized): KernelError;
```

Defined in: [error/KernelError.ts:101](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L101)

Create KernelError from serialized format

#### Parameters

##### serialized

[`SerializedError`](../interfaces/SerializedError.md)
[`SerializedError`](../type-aliases/SerializedError.md)

Serialized error object

Expand All @@ -163,8 +149,6 @@ New KernelError instance
static isKernelError(error): error is KernelError;
```

Defined in: [error/KernelError.ts:144](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L144)

Check if an error is a KernelError

#### Parameters
Expand Down Expand Up @@ -192,8 +176,6 @@ static wrap(
context?): KernelError;
```

Defined in: [error/KernelError.ts:156](https://github.com/theGeekist/wp-kernel/blob/main/packages/kernel/src/error/KernelError.ts#L156)

Wrap a native Error into a KernelError

#### Parameters
Expand All @@ -212,7 +194,7 @@ Error code to assign

##### context?

[`ErrorContext`](../interfaces/ErrorContext.md)
[`ErrorContext`](../type-aliases/ErrorContext.md)

Additional context

Expand Down
Loading
Loading