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

feature: v1 #1

Merged
merged 13 commits into from
Jan 16, 2024
Merged

feature: v1 #1

merged 13 commits into from
Jan 16, 2024

Conversation

marlonmarcello
Copy link
Contributor

@marlonmarcello marlonmarcello commented Jan 15, 2024

Goal

Masher V1!
This initial work is mostly conversion and refactoring. A lot of the logic was kept intact with some improvements here and there.

Notes

Timing

I am not able to spend much more time refactoring this as we need V1 ready to continue work on Corgi and Component Library, so please focus your test on potential bugs and incompatibilities.

With the hardest part in place we can keep track of changes and features in Issues from here on out.

Picture component

I added the Picture component to the repo with the intention of releasing it soon. I have a ticket create for it so we can keep track of that feature #2 but please ignore it for now.

Testing

You don't need a Corgi project to test this.

  1. Clone this repo and checkout feature/v1
  2. Make sure you are running the correct node version and npm install
  3. npm run build
  4. npm link

You are now ready to test

  1. mkdir my-test
  2. cd my-test
  3. npm init -y
  4. npm link @wethegit/masher
  5. mkdir -p src/images/defined/
  6. Add a few images to the defined directory created above
  7. Run the masher npx @wethegit/masher
  8. For watching for changes npx @wethegit/masher --watch

After running the masher you should see the compressed images in a public/_images/ directory. You can change the input and output directories inside the masher.config.json file gets created after you ran it at least once.

@marlonmarcello marlonmarcello requested review from liamegan, ste-vg, NicholasLancey, rvno, chanroyc and andrewrubin and removed request for ste-vg January 15, 2024 22:42
@marlonmarcello marlonmarcello self-assigned this Jan 15, 2024
Copy link

changeset-bot bot commented Jan 15, 2024

🦋 Changeset detected

Latest commit: bd2f369

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wethegit/masher Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@andrewrubin
Copy link
Member

Hey @marlonmarcello, I'm having trouble testing this one.

  • Tried running it via npx, and got sh: masher: command not found

Lmk if I can help debug at all.

I think we could also maybe add an .npmignore for some of the stuff in the final package output. Whaddaya think?

Thanks

@marlonmarcello
Copy link
Contributor Author

marlonmarcello commented Jan 16, 2024

@andrewrubin use @wethegit/masher not masher. Step 7 on the instructions above, you need the namespace

@marlonmarcello
Copy link
Contributor Author

I think we could also maybe add an .npmignore for some of the stuff in the final package output. Whaddaya think?

Already added a .npmignore, did I miss anything there?

@andrewrubin
Copy link
Member

Hmm, I am running npx @wethegit/masher, I get the error like it's trying to run a shell script 🤔

Screen Shot 2024-01-15 at 4 31 15 PM

@andrewrubin
Copy link
Member

Oh, I didn't build the package.

@marlonmarcello
Copy link
Contributor Author

Ooh, missed that step, my bad!

@andrewrubin
Copy link
Member

Tested and working well, thanks!

Just a couple notes:

  • Should I be testing the picture React component for this review?
  • I'm not seeing the ignored files actually being ignored — is this maybe just because it's via npm link instead of a published package?

@marlonmarcello
Copy link
Contributor Author

marlonmarcello commented Jan 16, 2024

Thanks @andrewrubin !

Should I be testing the picture React component for this review?

You can, as per my comment on the PR body, it's not ready. But you can test the one on Corgi to make sure this didn't break that.

I'm not seeing the ignored files actually being ignored — is this maybe just because it's via npm link instead of a published package?

Do you mean for the NPM package itself? If so that's expected. link just basically creates a symbolical link of the whole thing.

@andrewrubin
Copy link
Member

Okay cool, thanks. Been a while since I last set up a new package for publishing, so wasn't sure how the .npmignore works.

<Picture> will need some tweaks, but I won't let that block this PR. Like you said, we can make issues for Picture specifically.

  • image output now lives in _images/defined, whereas picture expects it in _images/
  • The masher-register import path is relative, this will likely need to be aliased I'd imagine.

@marlonmarcello
Copy link
Contributor Author

  • image output now lives in _images/defined, whereas picture expects it in _images/

You can just delete defined/ we don't have multiple "modes" anymore. Just the default.

@marlonmarcello
Copy link
Contributor Author

Thanks for the review!

@marlonmarcello
Copy link
Contributor Author

The masher-register import path is relative, this will likely need to be aliased I'd imagine.

Maybe we output this file inside src/ so we can easily use the alias we have and do @local/register.json

@marlonmarcello marlonmarcello merged commit 669a19b into main Jan 16, 2024
2 checks passed
@marlonmarcello marlonmarcello deleted the feature/v1 branch January 16, 2024 01:22
@github-actions github-actions bot mentioned this pull request Jan 16, 2024
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