Problem/Motivation

Determine what structure and tooling needs to be in place to support development on our first POC. There are likely some must-haves, along with things that we could take care of after initial development has started.

Proposed resolution

Likely musts:
* Monorepo / workspace structure with base API client, and JSON:API client workspaces.
* TypeScript Config.
* Dev and Build scripts.
* Linting and formatting
* Automated tests
* Gitlab CI running linting and tests.

Things we could defer:
* Publishing workflow
* Automated security audits (don't want to wait too long on this, need to do before publishing for sure)
* The ability to generate API documentation (again, wouldn't want to wait too long for this either)

Remaining tasks

* Gather feedback.
* Determine what else falls into 'musts'
* Scaffold the codebase.
** pnpm - Monorepo / workspace structure with base API client, and JSON:API client workspaces. (completed on scaffold branch)
** Typescript - basic builds with tsup (completed on scaffold branch)
** Eslint config as outlined in https://www.drupal.org/project/api_client/issues/3374157 (completed in 'scaffold' branch)
** Vitest (completed on scaffold branch)
** Typedoc (completed on scaffold branch)
** Prettier (completed on scaffold branch)
** tsc for typechecking (completed on scaffold branch)
** Husy checks on push (completed on scaffold branch)
* Gitlab CI
** Add examples/demo - or dev script of some kind? (completed on scaffold branch)

Issue fork api_client-3365959

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

brianperry created an issue. See original summary.

brianperry’s picture

Slowly chipping away at some of this on the scaffold branch on this fork. Helps me to have a little code to play with as I flesh out some of the related issues...

brianperry’s picture

coby.sher made their first commit to this issue’s fork.

brianperry’s picture

Issue summary: View changes
brianperry’s picture

@mitchellmarkoff is going to take a look at adding Eslint and Typedoc as outlined here: https://www.drupal.org/project/api_client/issues/3374157

mitchellmarkoff made their first commit to this issue’s fork.

brianperry’s picture

@mitchellmarkoff took a look at the `code-standards` branch. What is there looks good so far. I think what remains is mostly scripts to make use of it. Now that the config and dependencies exist, there should be an npm script that lints the codebase.

And not sure if this branch is actually intended to cover tsdoc yet, but I think it would be helpful to have something that can generate docs based on the tsdoc comments, even if we're only using it as a development tool. Typedoc could be a simple option for this: https://typedoc.org/

Also, do we need to add https://tsdoc.org/pages/packages/eslint-plugin-tsdoc/ to lint our tsdoc comments, or does `eslint-config-airbnb-typescript` take care of that?

So I think the remaining tasks are:
* Add a lint script.
* Add Typedoc
* Add an example tsdoc comment for an existing function so Typedoc can generate something.
* Evaluate if we need eslint-plugin-tsdoc

brianperry’s picture

Issue summary: View changes
brianperry’s picture

Added a json-api-client example and dev script on the `scaffold` branch.

brianperry’s picture

Issue summary: View changes
brianperry’s picture

Issue summary: View changes
brianperry’s picture

Issue summary: View changes
brianperry’s picture

Issue summary: View changes
brianperry’s picture

Issue summary: View changes
brianperry’s picture

Issue summary: View changes
brianperry’s picture

Issue summary: View changes
brianperry’s picture

Added a husky pre-push hook. I think there might be a little tweaking to do on the prettier config. The git hook tends to complain about minor formatting issues that seem to be created by format on save during editing. Easy to get around manually, but something we should be able to iron out.

brianperry’s picture

Status: Active » Fixed

I'm sure we'll continue to make adjustments as we go along, but the initial work here has been merged to our main and canary branches!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.