Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Import/Export] Parse JSON with the existing plan schema

Open Beginner friendly
#785 0 comments 0 reactions 0 assignees View on GitHub

@wilkinsonjacob is already working on this.

Since Oct 14, 2026.

  • #882 by @wilkinsonjacob — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
92/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, testing

Research direction

Read src/lib/planFile/schema.ts and its tests in src/lib/planFile/schema.test.ts, then add src/lib/planFile/parse.ts and parse.test.ts beside them. Implement the specified size, JSON, version, schema, and known-term checks, returning a result without throwing. Run pnpm test; done means the listed acceptance cases pass with non-empty errors for failures.

Written by the indexing model from the issue text.

Description

import-export

What to build

Read the contents of an imported DogDays plan file and check them against the existing file format. Return either the accepted plan or a short error the import dialog can show, instead of letting invalid files crash the page.

Files

  • src/lib/planFile/parse.ts (new file)
  • Starting example: src/lib/planFile/schema.ts
    Code to add or extend: parsePlanFile(text: string, knownTerms?: readonly number[]): ParseResult.

Steps

  1. Add parsePlanFile(text, knownTerms?) and ParseResult: either {ok:true, plan} or {ok:false, error}. Use the existing PlanFile type.
  2. Inside try/catch, read text with JSON.parse and check the value with planFileSchema.safeParse. On success, return {ok:true, plan:parsed.data}.
  3. For invalid JSON return {ok:false, error:"This file is not valid JSON."}. For a failed format check return {ok:false, error:"This is not a valid DogDays plan file."}. Keep schema.ts rules unchanged.

Example

{"version":1,"term":202702,"name":"Sample","crns":[12345],"pinned":false} is accepted. Text that is not JSON and an object missing crns return the specified errors.

Check it works

In src/lib/planFile/parse.test.ts, check the example above and the failure or limit described in the steps. Run pnpm test -- src/lib/planFile/parse.test.ts, pnpm lint and pnpm typecheck.

References

Assign yourself before starting, or comment to claim the issue. Project setup.

Dominant language
TypeScript
Stars
19
Forks
94
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DevDogsUGA/DogDays

All issues in DevDogsUGA/DogDays

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.