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

cleanup: clean up a bit of the mess i created #37

Merged
merged 2 commits into from
Nov 26, 2024
Merged

cleanup: clean up a bit of the mess i created #37

merged 2 commits into from
Nov 26, 2024

Conversation

sakulstra
Copy link
Contributor

@boredland sorry we had some issues with this action today, so i jumped the gun and merged without reviews to make things work again. If you got some time, please check the past prs and let me know what you don't like 😅

When committing I currently have to do it via --no-verify as otherwise the precommit errors with

The following paths are ignored by one of your .gitignore files:
dist/cli.d.mts
dist/cli.d.ts
dist/cli.js
dist/cli.mjs
dist/lib.d.mts
dist/lib.d.ts
dist/lib.js
dist/lib.mjs
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"

I indeed don't want to add them.
Ofc i could turn the message off, but i did not understand where it comes from - perhaps you got an idea.

@@ -42,22 +39,16 @@
"tsup": "^8.3.5",
"typescript": "^5.6.3",
"viem": "^2.21.48",
"vitest": "^2.1.4"
"vitest": "^2.1.4",
"dotenv": "^16.4.5"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why is everything devDependencies?

When using as a lib, i would expect viem to be a peerDependency.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because of how tsup works. DevDependencies are bundled up automatically and as we're only using the deps for some constants, IMO that is much nicer for downstream users.

Copy link
Collaborator

@boredland boredland Nov 21, 2024

Choose a reason for hiding this comment

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

This is particularly useful for actions-usage, where no dependency resolution takes place.

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 see, but currently, this means then when using as js lib it would contain the inlined viem + the viem the package uses?

It#s not a big problem as currently we only use this is node modules were pkg size does not matter, but perhaps that's sth we should look into down the line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Depending on if tree shake works, I'd say.. does the whole view land in there or the constants we need?

package.json Outdated
"src/lib.ts",
"src/cli.ts"
],
"entry": ["src/action.ts", "src/lib.ts", "src/cli.ts"],
"splitting": false,
"sourcemap": false,
"clean": true,
"dts": true,
"treeshake": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if that helps with anything

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it really doesn't do anything, that should be easily testable. Does removing it change the bundle (size)?

package.json Outdated
"src/lib.ts",
"src/cli.ts"
],
"entry": ["src/action.ts", "src/lib.ts", "src/cli.ts"],
"splitting": false,
"sourcemap": false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why no sourcemaps?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No particular reason, but mostly expected ts-users who likely will consume d.ts anyway.

@@ -1,4 +1,5 @@
#!/usr/bin/env node
import "dotenv/config";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not quite sure if it should be here ... probably not and one should export ALCHEMY_API_KEY before running the cli or put the api key as parameter on the script. Didn't want to add commander or similar for such a simple task though and working with pure args in node is pain :/

I'm conflicted.

@@ -102,4 +102,4 @@ export const getRPCUrl = (
} catch (e) {}
};

export { ChainId, ChainList };
export { ChainId, ChainList, type SupportedChainIds };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

noticed it would be useful to have this type.

@sakulstra sakulstra merged commit d9cca9b into main Nov 26, 2024
1 check passed
@sakulstra sakulstra deleted the cleanup branch November 26, 2024 12:40
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