Skip to content

Planned Future Version Items #161

@bachmacintosh

Description

@bachmacintosh

Version 2.x

No currently planned changes, other than continuing TypeScript version support

Version 3.0

Important

We're still working out the details; some of this is subject to change.

Split Main Package into Modules

This will allow people to install only what they need out of this library.

@bachman-dev/wanikani-api-types

  • Reduce package to only TypeScript type definitions and constants (eg MAX_LEVEL), other items will either be moved to other packages (see below) or removed
  • Other schema packages (see below) will export these types alongside this package, and the schema will have the same names as the types they implement, to reduce import duplication

Example:

// Both the Valibot schema and original TS type definition are available
import { ApiRevision, type DatableString } from "@bachman-dev/wanikani-api-valibot/v20170710";

@bachman-dev/wanikani-api-{arktype|effect-schema|standard-schema|valibot|zod}

Schema packages that provide schema for ArkType, Effect Schema, non-dependent Standard Schema, Valibot, and Zod

  • ArkType schema created using the Declare API
  • Effect Schema using Schema type with proper encoding / decoding behavior
  • A dependency-free Standard Schema implementation, in case someone isn't using the other "big 4" schema libraries
  • Valibot schema mostly copied over, should satisfy v.GenericSchema or v.SchemaWithPipe with the output
  • Zod schema should be a ZodType or similar on the output; support encoding/decoding when able
  • Regardless of which schema library, make sure all schema implements Standard Schema for the output
  • Move the type guards to these schema libraries

@bachman-dev/wanikani-api-requests

A package for creating requests to the WaniKani API, for those who prefer to use their own HTTP request handling library/API (eg fetch, undici, etc)

  • Move ApiRequestFactory, ApiRequest, etc to this package

@bachman-dev/wanikani-api-client

An API client that uses either the global Fetch API or a "fetcher" provided by the user to make requests to the WaniKani API. This will support rate limiting and caching resources per best practices.

  • Should re-export ApiRequestFactory and others to reduce import duplication
  • ApiClient (or similar name) should accept an optional ApiRequestFactory on initialization or use a default
  • Consider additional needed options like a Fetch Strategy (for those in runtimes that don't have a global fetch), a callback for rate limits, etc.

@bachman-dev/wanikani-api-utils

Miscellaneous utilities for working with data from the WaniKani API and to help build more consistent applications.

  • Move SUBJECT_MARKUP_MATCHER, parseSubjectMarkup and ParsedSubjectMarkup to this package
  • Add utilities to get WaniKani brand colors

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions