effect-aws icon indicating copy to clipboard operation
effect-aws copied to clipboard

Update README for contributing

Open dmeehan1968 opened this issue 9 months ago • 2 comments

The current README for contributing (under 'pull requests') doesn't detail how to actually make changes and run the codegen.

@floydspace has outlined these in an issue comment as follows:

  1. pnpm install
  2. add the new clients in the list in the file scripts/client-singularities.ts
  3. run pnpm default to generate folder structure by projen
  4. run pnpm codegen-client for your new clients to generate rest of the files
  5. commit and raise the PR

Additionally, the tests (including those generated by adding a client) can be run with:

pnpm test

Given that the codegen will create new files that are not added as part of the existing, it should be made clear that unversioned files should be added to the commit (so they are not perceived as artifacts). It's possible that the codegen step could also include adding the files to git (but not committing) assuming that the codegen completes without error.

I'm also unclear on how I can use the new client prior to the pull request being merged. I've looked at various examples but I don't seem to be able to reference either my local copy or my fork on github based on a branch name that contains the commits). My IDE complains that it can't find the package. Maybe there is another build step that needs to be done locally to allow this. Docs on this would be helpful (I don't regularly contribute to packages by way of pull requests so this is always painful to figure out).

dmeehan1968 avatar Mar 16 '25 12:03 dmeehan1968

I realised that I hadn't done ppm build in my local copy of effect-aws, which helped.

I used npm link from within the packages/client-firehose directory, and then npm link @effect-aws/client-firehose in my project.

So I can import Firehose but I get some slightly cryptic error when trying to call the putRecord method.

Image

Note that the return type of putRecord is Effect<... and not Effect.Effect<... as shown in the tooltip for a call to TimestreamWrite which is imported from npm's @effect/client-timestream-write which we created a couple of days ago.

Firehose: Image

Timestream Write: Image

So there is a difference with importing from npm and importing from a local package.

As far as I can tell, it might be because within effect-aws you have effect specified as 3.10.16, and my project is using 3.13.11. I think I've seen this sort of problem when there are mixed effect versions. When I npm list effect it looks like it doesn't override the version in the linked package like it does when I'm importing from npm.

Image

I've tried using an npm override statement in my root package.json to set the effect version to mine, but this doesn't seem to make any different.

Apologies if I'm just being a newbie here.

dmeehan1968 avatar Mar 16 '25 17:03 dmeehan1968

Would be good if you'd ask such questions in the special discord channel created for this repo: #effect-aws

  • and answering your question: try using pnpm dedupe command or remove effect and then add again,
  • effect-aws clients depend on effect peer which is quite a wide range of versions (>=3.0.4), the 3.10.16 is a dev dependency, but I cannot exclude that typescript is choosing incorrect version from node modules...
  • on my fresh folder I see all works well... so it is defenetly issue with multipel effect versions.

floydspace avatar Mar 16 '25 20:03 floydspace