Skip to content

Comments

Bump midnight-js, transition to biome, basic improvements#35

Merged
andrew-fleming merged 17 commits intomainfrom
update-midnight-js
Apr 29, 2025
Merged

Bump midnight-js, transition to biome, basic improvements#35
andrew-fleming merged 17 commits intomainfrom
update-midnight-js

Conversation

@andrew-fleming
Copy link
Contributor

@andrew-fleming andrew-fleming commented Apr 18, 2025

This PR proposes the following changes:

Bump midnight-js to v1.0.0

Transition to biome

Instead of having both eslint and prettier, we can simplify the repo structure by integrating biome. This PR also formats and lints all files according to the defined biome config

Remove unused dependencies

There was a ton of unused deps in the root package.json

Improve scripts and turbo json

This PR bumpes turbo to ^2.5.0 and cleans up the existing scripts and leverages biome for the following scripts:

  • fmt
  • fmt:fix
  • lint
  • lint:fix

There's also a clean script which removes all gitignored dirs within the workspaces (excludes node_modules/ which is in root)

Simplify jest testing

This PR removes coverage and reports as it makes test ouputs quite noisy. Coverage will be integrated in the future

@andrew-fleming andrew-fleming requested review from 0xisk and emnul April 18, 2025 03:46
"contracts/utils/"
],
"scripts": {
"compact": "turbo run compact",
Copy link
Member

Choose a reason for hiding this comment

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

I tried to run yarn compact but it failed to find run-compactc

• Packages in scope: @midnight-ntwrk/compact, @openzeppelin-midnight-contracts/erc20-contract, @openzeppelin-midnight-contracts/initializable-contract, @openzeppelin-midnight-contracts/utils-contract
• Running compact in 4 packages
• Remote caching disabled
@openzeppelin-midnight-contracts/erc20-contract:compact: cache bypass, force executing 76f89da084269672
@openzeppelin-midnight-contracts/erc20-contract:compact: 
@openzeppelin-midnight-contracts/utils-contract:compact: cache bypass, force executing 970880d875611f38
@openzeppelin-midnight-contracts/utils-contract:compact: 
@openzeppelin-midnight-contracts/initializable-contract:compact: cache bypass, force executing 7487f9778e309e2a
@openzeppelin-midnight-contracts/initializable-contract:compact: 
@openzeppelin-midnight-contracts/initializable-contract:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight-contracts/initializable-contract:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight-contracts/utils-contract:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight-contracts/utils-contract:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight-contracts/erc20-contract:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight-contracts/erc20-contract:compact: sh: line 1: run-compactc: command not found

 Tasks:    3 successful, 3 total
Cached:    0 cached, 3 total
  Time:    318ms 

    ...Finishing writing to cache...                                        WARNING  no output files found for task @openzeppelin-midnight-contracts/erc20-contract#compact. Please check your `outputs` key in `turbo.json`
 WARNING  no output files found for task @openzeppelin-midnight-contracts/initializable-contract#compact. Please check your `outputs` key in `turbo.json`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the turbo cache is the culprit. We need to remove .turbo/

From root, run:

npx turbo clean && rm -rf .turbo && yarn && npx turbo compact

Copy link
Member

Choose a reason for hiding this comment

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

npx turbo clean && rm -rf .turbo && yarn && npx turbo compact

That works for me but yarn compact does not:

 yarn compact --force 
╭──────────────────────────────────────────────────────────────────────────╮
│                                                                          │
│                     Update available v2.5.1 ≫ v2.5.2                     │
│    Changelog: https://github.com/vercel/turborepo/releases/tag/v2.5.2    │
│             Run "npx @turbo/codemod@latest update" to update             │
│                                                                          │
│          Follow @turborepo for updates: https://x.com/turborepo          │
╰──────────────────────────────────────────────────────────────────────────╯
turbo 2.5.1

• Packages in scope: @midnight-ntwrk/compact, @openzeppelin-midnight/erc20, @openzeppelin-midnight/utils
• Running compact in 3 packages
• Remote caching disabled
@openzeppelin-midnight/erc20:compact: cache bypass, force executing 961d7876a9a77eda
@openzeppelin-midnight/erc20:compact: 
@openzeppelin-midnight/utils:compact: cache bypass, force executing bda21583df48afa1
@openzeppelin-midnight/utils:compact: 
@openzeppelin-midnight/erc20:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/erc20:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/utils:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/utils:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/utils:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/utils:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/utils:compact: sh: line 1: run-compactc: command not found
@openzeppelin-midnight/utils:compact: sh: line 1: run-compactc: command not found

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    321ms 

And I think that is because utils pkg for example does not have compact pkg installed as a dependency. I think that will be resolved by the next PR #41

Copy link
Member

@0xisk 0xisk left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @andrew-fleming!

@andrew-fleming andrew-fleming merged commit e2a709d into main Apr 29, 2025
@andrew-fleming andrew-fleming deleted the update-midnight-js branch April 29, 2025 21:36
emnul pushed a commit that referenced this pull request Jun 5, 2025
* bump midnight-js

* remove unused deps

* remove eslint and prettier, add biome

* run fmt

* run lint

* organize imports

* remove dev deps from contracts/

* remove unused deps

* update turbo and scripts

* add clean script

* add clean script

* clean up test config

* remove jest reporters

* bump turbo to 2.5

* bump turbo

* fix package names
andrew-fleming added a commit that referenced this pull request Jun 25, 2025
* bump midnight-js

* remove unused deps

* remove eslint and prettier, add biome

* run fmt

* run lint

* organize imports

* remove dev deps from contracts/

* remove unused deps

* update turbo and scripts

* add clean script

* add clean script

* clean up test config

* remove jest reporters

* bump turbo to 2.5

* bump turbo

* fix package names
emnul pushed a commit that referenced this pull request Jun 26, 2025
* bump midnight-js

* remove unused deps

* remove eslint and prettier, add biome

* run fmt

* run lint

* organize imports

* remove dev deps from contracts/

* remove unused deps

* update turbo and scripts

* add clean script

* add clean script

* clean up test config

* remove jest reporters

* bump turbo to 2.5

* bump turbo

* fix package names
emnul pushed a commit that referenced this pull request Jun 26, 2025
* bump midnight-js

* remove unused deps

* remove eslint and prettier, add biome

* run fmt

* run lint

* organize imports

* remove dev deps from contracts/

* remove unused deps

* update turbo and scripts

* add clean script

* add clean script

* clean up test config

* remove jest reporters

* bump turbo to 2.5

* bump turbo

* fix package names
emnul pushed a commit that referenced this pull request Jun 26, 2025
* bump midnight-js

* remove unused deps

* remove eslint and prettier, add biome

* run fmt

* run lint

* organize imports

* remove dev deps from contracts/

* remove unused deps

* update turbo and scripts

* add clean script

* add clean script

* clean up test config

* remove jest reporters

* bump turbo to 2.5

* bump turbo

* fix package names
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