Skip to content

Add @atlas/blueapi and @atlas/blueapi-query packages#17

Merged
douglaswinter merged 8 commits intomainfrom
dw/blueapi_package
Mar 10, 2026
Merged

Add @atlas/blueapi and @atlas/blueapi-query packages#17
douglaswinter merged 8 commits intomainfrom
dw/blueapi_package

Conversation

@douglaswinter
Copy link
Copy Markdown
Collaborator

Introducing two very light packages.

  1. @atlas/blueapi: axios blueapi queries. Can be used as is, or through

  2. @atlas/blueapi-query: tanstack react query wrappers for the above, exposing hooks such as usePlans(), etc.

Just linting for ViSR - still need to sort out consistent linting for
all apps and packages.
To remove the expectation of prebuilt dist/ folders, we can use
composite projects and references.
https://www.typescriptlang.org/docs/handbook/project-references.html
In this setup:
1) each internal TS package declares itself as composite:
"compilerOptions": {
  "composite": true
}
2) each dependent package lists its dependencies as references:
"references": [{ "path" : "../dependency" }]
3) each package is built with tsc -b
noEmit should not be in root config; only app configs should declare it
@EmsArnold
Copy link
Copy Markdown
Contributor

EmsArnold commented Mar 4, 2026

Currently this requires explicitly running a build task, but running turbo dev should implicitly build if necessary. Adding "dependsOn": ["^build"] to the "dev" task in turbo.json will result in the build task to be run if a cache is not available.

This commit migrates from a library-style, artifact-driven model (TS
project references + tsc -b + dist outputs) to a source-first model:
- internal packages export TypeScript source directly
- Vite/Vitest own all runtime transformation
- TypeScript is used purely for type-checking - CI check added
- no build artifacts (dist, .d.ts, .js) are produced inside packages.

This simplifies the mental model since no build graph between internal
packages is required, and no prebuild step is needed for dev or test.

A caveat: Vitest does not immediately start inside vite; it first starts
under node, then loads config, initialises vite, finally running tests.
For that reason, vitest-conf config is now declared as pure JS, not TS.
This also requires explicit declaration files, an inconvenience of
source-first.
@douglaswinter
Copy link
Copy Markdown
Collaborator Author

Currently this requires explicitly running a build task, but running turbo dev should implicitly build if necessary. Adding "dependsOn": ["^build"] to the "dev" task in turbo.json will result in the build task to be run if a cache is not available.

Changed now by switching to a source-first architecture, where internal packages export TS source code directly. No need for building when running dev.

Copy link
Copy Markdown
Contributor

@EmsArnold EmsArnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few variables which may need to be optional, but otherwise functions well and looks good.


/** Any metadata to apply to all runs within this task */
metadata: object;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do params and metadata need to be optional in this case?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what blueapi returns, and I believe metadata is always there, and if no params were specified with the task you get an empty object. If that's true, neither are optional.

name: string;

/** Values for parameters to plan, if any */
params: object;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should params be optional here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you!

@douglaswinter douglaswinter merged commit f7a16fd into main Mar 10, 2026
1 check passed
@douglaswinter douglaswinter deleted the dw/blueapi_package branch March 10, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants