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

Pnpm #564

Merged
merged 97 commits into from
Jul 6, 2023
Merged

Pnpm #564

merged 97 commits into from
Jul 6, 2023

Conversation

dayhaysoos
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Jun 22, 2023

Deploy Preview for tbd-website-developer canceled.

Name Link
🔨 Latest commit fd0ba55
🔍 Latest deploy log https://app.netlify.com/sites/tbd-website-developer/deploys/64a7324f9d6c4f0008179b14

Copy link
Contributor

@ALRubinger ALRubinger left a comment

Choose a reason for hiding this comment

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

PNPM seems to be working great! Ran through it and w/ @dayhaysoos came across changes to fulfill the underlying #532 issue.

  • Right now - the pnpm arrangement doesn’t yet fulfill the issue Unify all docs on developer.tbd.website to respect one dependency #532 to declare and respect one dependency (for instance Web5) across all examples and the site. For instance, “examples/todo-app/package.json” has “"@tbd54566975/web5": “0.7.8”; expecting this to be declared once uniformly at the top level so all examples and the site itself use the same version. That gives us one place to update as defined by Update Quickstart: Instantiation #538.
  • Similar to above, Dev Site is using its own declaration of Web5 in its package.json: "@tbd54566975/web5": "0.7.9"
  • Figure a way to inline the declared dependency into the dev site QuickStart instructions:
Pasted Graphic 1
  • Web5-quickstart-widgets index.html is still using a direct dependency declaration for Web5, outside the new pnpm system: “import { Web5 } from 'https://cdn.jsdelivr.net/npm/@tbd54566975/web5@0.7.0/dist/browser.mjs’;”
  • Renames suggested: todo-app > todo-completed, and todo-app-tutorial > todo-starter
  • Suggest script renames: “start:todo-tutorial” > “start:tutorial-todo-starter”, “start:filter-todo” > “start:tutorial-todo-completed”
  • Todo-app-tutorial - needs updating to get the starter app (web5-tutorials) and completed example (incubating-web5-labs) from their new locations (under the monorepo in examples folder)
  • pnpm-lock.yaml to .gitignore
  • tbd-project-template stuff - license, CoC, Governance, etc.
  • In “site commands”, prefix the commands with “pnpm”
  • In site commands, “pnpm start, not start:site”
  • On http://localhost:3000/docs/apis/ssi-service, templating looks borked:
Pasted Graphic
  • “Running commands” section in README: what does “target specific packages” mean? Maybe this section could have an example to show what you’d be doing with this command, for instance updating web5?
  • Suggest renaming “docs” package to “site” to match the folder structure and refer to the site that we’re building.
  • npm older commands like "install" still runnable directly, but can lead to the wrong build outputs? Can we remove npm from working at all, signifying that pnpm should be the build system of record?

@dayhaysoos
Copy link
Contributor Author

dayhaysoos commented Jun 27, 2023

Right now - the pnpm arrangement doesn’t yet fulfill the issue #532 to declare and respect one dependency (for instance Web5) across all examples and the site. For instance, “examples/todo-app/package.json” has “"@tbd54566975/web5": “0.7.8”; expecting this to be declared once uniformly at the top level so all examples and the site itself use the same version. That gives us one place to update as defined by #538.

We have a dependency at the root package.json now that says to use web5 0.7.10, however, that doesn't actually install the required package inside each project. It allows us to locally test versions.

I made a specific command for updating all dependencies in examples to take care of this:

pnpm update:web5 will recusrively add the latest version of web5 to every example.

Here is what the package.json looks like now.

I think this is the best we can do for now, I'm sure we can get some custom hooks going to automate this just a bit further.

Edit:

The reason why we should keep the dependencies within each package.json is because if someone wanted to try to to run these locally, they won't install properly. If we don't care too much about that then we can remove the update script and leave it as is.

@ALRubinger
Copy link
Contributor

Got off a pair exercise w/ @dayhaysoos - here's where we landed:

  • He's put the web5 dependency into the top level pnpm
  • That makes for one declared dependency for web5, used by the site and all examples/demos/starter templates/etc
  • Additional dependencies that are specific to the site or examples/demos/starters/etc can still go in the package.json of that submodule

So with that arrangement, let's say @bobbilee19 wants to upgrade Web5. She could either:

  1. Update the version number in the top-level package.json once, or
  2. Run a pnpm command at the root level to have pnpm do the above (@dayhaysoos is documenting how in the README)

@bobbilee19 - this one is of particular interest: we advise taking the "completed" index.js in the Quickstart and instead of it being a free-floating file the user downloads, make it into a simple "quickstart-completed" application mirroring how we do it in the completed TODO app. That way:

  • A user has the fully runnable application available to them, which includes the package.json needed to run it
  • We have a uniform approach to completed applications and we can upgrade and test them all in the same way; no more standalone floating Node scripts to independently patch and manually check when we upgrade

@dayhaysoos is working through the bullets in my PR review above, looks like making great progress.

And I'm super excited because in addition to easing the maintenance burden, we're giving some really good unifying structure to the examples/completed apps/playgrounds etc which is going to make it really clear to the user how to get them, how to run them, and for us to make testsuites for them.

@bobbilee19
Copy link
Contributor

@dayhaysoos oh 100%, consistency, consistency and the two points for why we should do that, 100% agree...for the index.js question above.

@dayhaysoos
Copy link
Contributor Author

"See it deployed here" at the end points to https://unrivaled-crumble-56ce70.netlify.app/, which is configured on Netlify still using the old location https://github.com/TBD54566975/incubating-web5-labs

Having some trouble getting our netlify set up right to deploy multiple sites. I think for now I'd like to make this an issue and ask for support from Netlify just so we can land this PR today.

Until then, probably won't be a good idea to remove the apps from the other repos. We'll leave it up for people to see in the mean time.

@dayhaysoos dayhaysoos merged commit a326efa into main Jul 6, 2023
5 checks passed
@dayhaysoos dayhaysoos deleted the pnpm branch July 6, 2023 21:35
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.

None yet

7 participants