Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose core test types properly #1087

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

boneskull
Copy link
Contributor

@boneskull boneskull commented Mar 11, 2024

This change exposes the types added in #651 to consumers (including our own packages). This is necessary for any package to use types like Scenario.

Of note, I moved the LavaMoatOpts type into lavamoat-core, because that type is used directly by the Scenario type. This will avoid an implicit cycle in lavamoat-core & lavamoat.


  • chore(node, core): move LavaMoatOpts typedef into lavamoat-core
  • chore(core): expose types from test/util and scenario definition
  • chore(eslint): prevent n/no-extraneous-* from touching test files with .ts extensions

@boneskull boneskull requested review from legobeat and a team as code owners March 11, 2024 22:58
@github-actions github-actions bot added the pkg:lavamoat-core Changes in package lavamoat-core label Mar 11, 2024
@boneskull
Copy link
Contributor Author

boneskull commented Mar 11, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @boneskull and the rest of your teammates on Graphite Graphite

@boneskull
Copy link
Contributor Author

A thing that sucks is the auto-label tool only detects additions and modifications--not deletions.

@boneskull boneskull added the pkg:lavamoat Changes in package lavamoat label Mar 11, 2024
@boneskull boneskull force-pushed the boneskull/expose-core-types branch 4 times, most recently from bb9cd67 to 97a69e9 Compare March 19, 2024 19:40
@boneskull boneskull changed the base branch from main to boneskull/zap-aa-macos-perf-test March 19, 2024 19:40
@boneskull boneskull force-pushed the boneskull/zap-aa-macos-perf-test branch from 166c953 to 8fcab2f Compare March 19, 2024 20:29
Base automatically changed from boneskull/zap-aa-macos-perf-test to main March 20, 2024 10:51
@boneskull boneskull force-pushed the boneskull/expose-core-types branch 4 times, most recently from 72279ff to bd55e73 Compare March 27, 2024 19:49
this removes the implicit dependency on `lavamoat` from `lavamoat-core`
In order for other packages to consume the types from `test/util.js` (and the `Scenario` type), `lavamoat-core` needs to generate `.d.ts` files.  To do this, I:

1. Moved `test/scenarios/scenario.d.ts` (which is not typechecked!) to `test/scenario.ts` (which is)
2. Changed `test/tsconfig.json` to output declarations (instead of nothing) for both `test/util.js` and `test/scenario.ts`
3. Update `test/util.js` with the new location of the `scenario` module (and fix a type problem I found)
@boneskull boneskull force-pushed the boneskull/expose-core-types branch from bd55e73 to 1b5299b Compare April 9, 2024 20:49
Copy link
Member

@naugtur naugtur left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:lavamoat Changes in package lavamoat pkg:lavamoat-core Changes in package lavamoat-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants