Skip to content

Conversation

@refi64
Copy link
Collaborator

@refi64 refi64 commented Jun 16, 2022

...and also fix some bugs (includes slightly-tweaked #287). But bugs don't matter anyway, because THE CODE IS PRETTY!

Rationale:

  • Making a Python package: Once published, it'll be easily installable w/ pipx install flatpak-node-generator, and we can actually safely add dependencies without breaking everything or requiring manual venv management.
    • but I did keep our own semver for now, because apparently the packaging module's doesn't actually support some version values that actual semver does.
  • Type checking: This thing is massive, type checking helps keep things functioning.
  • Formatting: Okay this is totally just that I really like pretty code, and I also refuse to let go of my single quotes.

The main still-outstanding things are:

  • More tests! So many more tests!
  • I need to add GitHub Actions support to auto-run the tests on changes.
  • Later on, I want to fix up the console output a bit (did I mention we can safely add dependencies now?).

But for now, this is a good start!

(If I sound slightly hyper after spending several hours fighting with npm, it is because I am indeed hyper after spending several hours fighting with npm.)

refi64 added 16 commits June 15, 2022 21:10
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
YAPF isn't used very often anymore in favor of Black...but I'm *very*
tied to my single quotes...

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Not all the errors are fixed yet, but some of the code is going to be
removed shortly anyway.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
@refi64 refi64 requested a review from gasinvein June 16, 2022 02:19
build-commands:
# Have Yarn use the offline mirror.
- 'HOME=$PWD yarn config --offline set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror'
- HOME=$PWD yarn config --offline set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror
Copy link
Member

Choose a reason for hiding this comment

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

This is rather hackish, I'd rather suggest adding a separate .yarnrc source instead:

sources:
  ...
  - type: inline
    contents: |
      yarn-offline-mirror /run/build/electron-webpack-quick-start/flatpak-node/yarn-mirror
    dest-filename: .yarnrc

Copy link
Member

@gasinvein gasinvein left a comment

Choose a reason for hiding this comment

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

I didn't really look into the newly-added tests, but overall this looks cool!

gasinvein and others added 11 commits June 22, 2022 09:26
Re-committed by refi64 w/ some minor fixes, notes:

Original commit at
#287, I made some
changes to match npm's behavior a bit more closely. Context:

> Hahaha, so after hitting this locally, I've come to believe this
> actually changed in the npm registry, and dists that formerly returned
> the sha1 they were uploaded with now return a newly computed sha512. I
> think the previous behavior I followed was also changed in npm/pacote
> at some point too.
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Also adds another useful tool shell script to be able to generate the
lockfiles & examine the npm/yarn caches.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Also adds tests on Git repositories specifically.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Fixes #278.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
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.

3 participants