Skip to content

fix: git pull && npm i should not change things - #126

Merged
chadoh merged 1 commit into
mainfrom
build/include-local-packages-in-package-lock
Nov 14, 2025
Merged

chadoh merged 1 commit into
mainfrom
build/include-local-packages-in-package-lock

Conversation

@chadoh

@chadoh chadoh commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Pulling latest main and running npm i currently changes package-lock.json. Specifically, it adds the local packages from the packages folder. Let's check in this change.

Pulling latest `main` and running `npm i` currently changes
`package-lock.json`. Specifically, it adds the local packages from the
`packages` folder. Let's check in this change.

@pselle pselle left a comment

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.

I think the dependabot PRs that update dependencies rip these out. There might be some knob turning for a dependabot.yml that could build the clients and make sure these don't get removed.

@chadoh
chadoh merged commit 8362f44 into main Nov 14, 2025
1 check passed
@chadoh
chadoh deleted the build/include-local-packages-in-package-lock branch November 14, 2025 16:19
chadoh added a commit that referenced this pull request Nov 14, 2025
IS THIS A GOOD IDEA??

Force check-in everything in `packages` and `src/contracts`!

Why?

We recently ([1]) force-checked-in a `src/contracts/guess_the_number.ts`
stub so that linting would work on the main branch. The thinking being:

👉 People who read instructions (all 50% of them) will `scaffold init`
  the project, which will not have _any_ git, and so when they first
  `git init` and `git add`, the gitignore rules will be respected and
  the placeholder `src/contracts/*` file(s) will not be checked in.

In this PR, I went and used more features of the full, non-stubbed
version of `guess_the_number`, which means that the repo, having only
the stub, started failing linting again, because it doesn't know about
things like `tx.signAndSend`.

Rather than updating the stub, I wonder if it makes more sense, under
the same logic as above, to force-check-in _all_ these packages and
artifacts.

Pros
----

- Eslint on GH CI has full context, and won't say my code fails.
- It's also future-proof. As we add more features showing how to use
  different aspects of these generated libraries, we won't need to keep
  playing whack-a-mole with our stub.
- Dependabot! Dependabot has been stripping the stuff in `packages` out
  of our `package-lock.json`, which we then need to re-add (see #126).
  If the stuff in `packages` is force-checked-in, we should work around
  this problem.
- Less-treacherous contributing workflow: with the stub, anytime you
  pulled `stellar-scaffold-frontend` and ran `run dev`, you ended up
  overwriting the stub. This then led to ugly/confusing git changes that
  you needed to ignore. We should have _fewer_ such changes now, since
  the force-checked-in files _should_ match what's generated. Most of
  the time. When the contracts change, the generated packages will
  change too, and we will then end up with git diffs. But we actually
  WANT to check these in, to keep the described behavior here
  consistent.

Cons
----

- In order to achieve all the Pros listed above, we should _not_ include
  a comment saying that these files are stubs. We should just leave them
  as-is, to avoid git diffs as much as possible. Given that the standard
  `scaffold init` workflow should result in these files *NOT* being
  included, though, this seems fine? And for people ignoring
  instructions and cloning `scaffold-stellar-frontend` directly, well,
  they'll have functioning packages and `src/contracts` imports. At
  least to start off. And then they'll change things and end up with
  confusing git diffs and seek support at that point.

  [1]: #121 (comment)
chadoh added a commit that referenced this pull request Nov 14, 2025
IS THIS A GOOD IDEA??

Force check-in everything in `packages` and `src/contracts`!

Why?

We recently ([1]) force-checked-in a `src/contracts/guess_the_number.ts`
stub so that linting would work on the main branch. The thinking being:

👉 People who read instructions (all 50% of them) will `scaffold init`
  the project, which will not have _any_ git, and so when they first
  `git init` and `git add`, the gitignore rules will be respected and
  the placeholder `src/contracts/*` file(s) will not be checked in.

In this PR, I went and used more features of the full, non-stubbed
version of `guess_the_number`, which means that the repo, having only
the stub, started failing linting again, because it doesn't know about
things like `tx.signAndSend`.

Rather than updating the stub, I wonder if it makes more sense, under
the same logic as above, to force-check-in _all_ these packages and
artifacts.

Pros
----

- Eslint on GH CI has full context, and won't say my code fails.
- It's also future-proof. As we add more features showing how to use
  different aspects of these generated libraries, we won't need to keep
  playing whack-a-mole with our stub.
- Dependabot! Dependabot has been stripping the stuff in `packages` out
  of our `package-lock.json`, which we then need to re-add (see #126).
  If the stuff in `packages` is force-checked-in, we should work around
  this problem.
- Less-treacherous contributing workflow: with the stub, anytime you
  pulled `stellar-scaffold-frontend` and ran `run dev`, you ended up
  overwriting the stub. This then led to ugly/confusing git changes that
  you needed to ignore. We should have _fewer_ such changes now, since
  the force-checked-in files _should_ match what's generated. Most of
  the time. When the contracts change, the generated packages will
  change too, and we will then end up with git diffs. But we actually
  WANT to check these in, to keep the described behavior here
  consistent.

Cons
----

- In order to achieve all the Pros listed above, we should _not_ include
  a comment saying that these files are stubs. We should just leave them
  as-is, to avoid git diffs as much as possible. Given that the standard
  `scaffold init` workflow should result in these files *NOT* being
  included, though, this seems fine? And for people ignoring
  instructions and cloning `scaffold-stellar-frontend` directly, well,
  they'll have functioning packages and `src/contracts` imports. At
  least to start off. And then they'll change things and end up with
  confusing git diffs and seek support at that point.

I feel like maybe the pros outweigh the cons? Wdyt?

What else is in this commit
===========================

- Tell eslint to ignore the temporary files in `target/packages`, since
  they were causing tremendous noise when linting locally
- Suppress git diffs for `packages/*` and `src/contracts/*`, since these
  are now checked-in artifacts and don't need to clutter git diffs.

  [1]: #121 (comment)
chadoh added a commit that referenced this pull request Nov 14, 2025
IS THIS A GOOD IDEA??

Force check-in everything in `packages` and `src/contracts`!

Why?

We recently ([1]) force-checked-in a `src/contracts/guess_the_number.ts`
stub so that linting would work on the main branch. The thinking being:

👉 People who read instructions (all 50% of them) will `scaffold init`
  the project, which will not have _any_ git, and so when they first
  `git init` and `git add`, the gitignore rules will be respected and
  the placeholder `src/contracts/*` file(s) will not be checked in.

In this PR, I went and used more features of the full, non-stubbed
version of `guess_the_number`, which means that the repo, having only
the stub, started failing linting again, because it doesn't know about
things like `tx.signAndSend`.

Rather than updating the stub, I wonder if it makes more sense, under
the same logic as above, to force-check-in _all_ these packages and
artifacts.

Pros
----

- Eslint on GH CI has full context, and won't say my code fails.
- It's also future-proof. As we add more features showing how to use
  different aspects of these generated libraries, we won't need to keep
  playing whack-a-mole with our stub.
- Dependabot! Dependabot has been stripping the stuff in `packages` out
  of our `package-lock.json`, which we then need to re-add (see #126).
  If the stuff in `packages` is force-checked-in, we should work around
  this problem.
- Less-treacherous contributing workflow: with the stub, anytime you
  pulled `stellar-scaffold-frontend` and ran `run dev`, you ended up
  overwriting the stub. This then led to ugly/confusing git changes that
  you needed to ignore. We should have _fewer_ such changes now, since
  the force-checked-in files _should_ match what's generated. Most of
  the time. When the contracts change, the generated packages will
  change too, and we will then end up with git diffs. But we actually
  WANT to check these in, to keep the described behavior here
  consistent.

Cons
----

- In order to achieve all the Pros listed above, we should _not_ include
  a comment saying that these files are stubs. We should just leave them
  as-is, to avoid git diffs as much as possible. Given that the standard
  `scaffold init` workflow should result in these files *NOT* being
  included, though, this seems fine? And for people ignoring
  instructions and cloning `scaffold-stellar-frontend` directly, well,
  they'll have functioning packages and `src/contracts` imports. At
  least to start off. And then they'll change things and end up with
  confusing git diffs and seek support at that point.

I feel like maybe the pros outweigh the cons? Wdyt?

What else is in this commit
===========================

- Tell eslint to ignore the temporary files in `target/packages`, since
  they were causing tremendous noise when linting locally
- Suppress git diffs for `packages/*` and `src/contracts/*`, since these
  are now checked-in artifacts and don't need to clutter git diffs.

  [1]: #121 (comment)
chadoh added a commit that referenced this pull request Nov 14, 2025
IS THIS A GOOD IDEA??

Force check-in everything in `packages` and `src/contracts`!

Why?

We recently ([1]) force-checked-in a `src/contracts/guess_the_number.ts`
stub so that linting would work on the main branch. The thinking being:

👉 People who read instructions (all 50% of them) will `scaffold init`
  the project, which will not have _any_ git, and so when they first
  `git init` and `git add`, the gitignore rules will be respected and
  the placeholder `src/contracts/*` file(s) will not be checked in.

In this PR, I went and used more features of the full, non-stubbed
version of `guess_the_number`, which means that the repo, having only
the stub, started failing linting again, because it doesn't know about
things like `tx.signAndSend`.

Rather than updating the stub, I wonder if it makes more sense, under
the same logic as above, to force-check-in _all_ these packages and
artifacts.

Pros
----

- Eslint on GH CI has full context, and won't say my code fails.
- It's also future-proof. As we add more features showing how to use
  different aspects of these generated libraries, we won't need to keep
  playing whack-a-mole with our stub.
- Dependabot! Dependabot has been stripping the stuff in `packages` out
  of our `package-lock.json`, which we then need to re-add (see #126).
  If the stuff in `packages` is force-checked-in, we should work around
  this problem.
- Less-treacherous contributing workflow: with the stub, anytime you
  pulled `stellar-scaffold-frontend` and ran `run dev`, you ended up
  overwriting the stub. This then led to ugly/confusing git changes that
  you needed to ignore. We should have _fewer_ such changes now, since
  the force-checked-in files _should_ match what's generated. Most of
  the time. When the contracts change, the generated packages will
  change too, and we will then end up with git diffs. But we actually
  WANT to check these in, to keep the described behavior here
  consistent.

Cons
----

- In order to achieve all the Pros listed above, we should _not_ include
  a comment saying that these files are stubs. We should just leave them
  as-is, to avoid git diffs as much as possible. Given that the standard
  `scaffold init` workflow should result in these files *NOT* being
  included, though, this seems fine? And for people ignoring
  instructions and cloning `scaffold-stellar-frontend` directly, well,
  they'll have functioning packages and `src/contracts` imports. At
  least to start off. And then they'll change things and end up with
  confusing git diffs and seek support at that point.

I feel like maybe the pros outweigh the cons? Wdyt?

What else is in this commit
===========================

- Tell eslint to ignore the temporary files in `target/packages`, since
  they were causing tremendous noise when linting locally

  [1]: #121 (comment)
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