Skip to content

Conversation

@joncinque
Copy link
Contributor

Problem

The libraries repo has a lot of packages to run CI and commands against, and contains a pretty long list of commands in package.json, so it's a great candidate for moving to a Makefile.

Summary of changes

This is pretty similar to the others, except that I removed the "first word before - means directory" and instead flatten everything at the top-level.

@joncinque joncinque marked this pull request as ready for review October 9, 2025 21:27
@joncinque joncinque requested a review from rustopian October 9, 2025 21:27
#### Problem

The libraries repo has a lot of packages to run CI and commands against,
and contains a pretty long list of commands in package.json, so it's a
great candidate for moving to a Makefile.

#### Summary of changes

This is pretty similar to the others, except that I removed the "first
word before - means directory" and instead flatten everything at the
top-level.
Copy link

@rustopian rustopian left a comment

Choose a reason for hiding this comment

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

Looks good, except that some -js-% targets need to be moved to fix an ordering problem.

Makefile Outdated
Comment on lines 74 to 81
format-check-js-%:
cd $(call make-path,$*) && pnpm install && pnpm format $(ARGS)

lint-js-%:
cd $(call make-path,$*) && pnpm install && pnpm lint $(ARGS)

test-js-%:
cd $(call make-path,$*) && pnpm install && pnpm build && pnpm test $(ARGS)

Choose a reason for hiding this comment

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

nit: what do you think about lockfile strictness for pnpm installs?

Suggested change
format-check-js-%:
cd $(call make-path,$*) && pnpm install && pnpm format $(ARGS)
lint-js-%:
cd $(call make-path,$*) && pnpm install && pnpm lint $(ARGS)
test-js-%:
cd $(call make-path,$*) && pnpm install && pnpm build && pnpm test $(ARGS)
format-check-js-%:
cd $(call make-path,$*) && pnpm install --frozen-lockfile && pnpm format $(ARGS)
lint-js-%:
cd $(call make-path,$*) && pnpm install --frozen-lockfile && pnpm lint $(ARGS)
test-js-%:
cd $(call make-path,$*) && pnpm install --frozen-lockfile && pnpm build && pnpm test $(ARGS)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can't hurt!

Makefile Outdated
Comment on lines 95 to 96
publish-js-%:
cd "$(call make-path,$*)" && pnpm install && pnpm version $(LEVEL) --no-git-tag-version $(call preid-arg,$(LEVEL),$(TAG)) && pnpm publish --no-git-checks --tag $(TAG)

Choose a reason for hiding this comment

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

Same

Suggested change
publish-js-%:
cd "$(call make-path,$*)" && pnpm install && pnpm version $(LEVEL) --no-git-tag-version $(call preid-arg,$(LEVEL),$(TAG)) && pnpm publish --no-git-checks --tag $(TAG)
publish-js-%:
cd "$(call make-path,$*)" && pnpm install --frozen-lockfile && pnpm version $(LEVEL) --no-git-tag-version $(call preid-arg,$(LEVEL),$(TAG)) && pnpm publish --no-git-checks --tag $(TAG)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You got it

Makefile Outdated
Comment on lines 74 to 80
format-check-js-%:
cd $(call make-path,$*) && pnpm install && pnpm format $(ARGS)

lint-js-%:
cd $(call make-path,$*) && pnpm install && pnpm lint $(ARGS)

test-js-%:

Choose a reason for hiding this comment

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

Ordering problem: the earlier patterns format-check- and test- match first, so they look for non-existent directories.

i.e.:

❯ make test-js-type-length-value-js
error: manifest path `js-type-length-value-js/Cargo.toml` does not exist
make: *** [test-js-type-length-value-js] Error 101

Solution:

  • move format-check-js-% and test-js-% before format-check-% and test-%

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah interesting! That must be the mac issue that @samkim-crypto noticed -- this works fine on Linux. Will fixup

@rustopian rustopian self-requested a review October 24, 2025 20:47
Copy link

@rustopian rustopian left a comment

Choose a reason for hiding this comment

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

Looks great

@joncinque joncinque merged commit 4ef0946 into solana-program:main Oct 24, 2025
41 checks passed
@joncinque joncinque deleted the makefile branch October 24, 2025 21:03
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