npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

suggestcat

v1.0.0

Published

## pnpm workspace

Downloads

75

Readme

suggestcat-dev :pencil2:

pnpm workspace

:warning: WARNING:exclamation::skull:

:warning: :stop_sign: DO NOT USE npm - we are using pnpm from now on, even in the submodules, even if you clone just the submodule!!!! :exclamation:

  • in case you use npm please make sure not to commit package-lock.json
  • in case you have something IDE specific file/folder which should be gitignored, please include it in .gitignore:exclamation:

dev environment

  • modules inside /packages are git submodules, meaning they are all separate git projects, will be refered to as workspace(s)
  • if you make changes in any of the workspaces, changes should be commited and pushed inside that specific folder
  • changes outside of the /packages should be commited from the root folder to this github repo
  • inside /app folder there is a create-react-app project, which is part of this project - not a git submodule

prerequisites :clipboard:

Before running the project for the first time, ensure that you have completed the following steps:

npm install -g pnpm # just for the first time, install `pnpm`
pnpm -r exec rm -rf node_modules # just for the first time, remove all `node_modules`
corepack enable

If you installed Node.js using Homebrew, you'll need to install corepack separately:

brew install corepack

for the first time, this command will fetch the git submodules

git submodule update --init --recursive # from the root folder

you may need to set github access tokens for submodules:
remote: Permission to emergence-engineering/<git-repo>.git denied to optimistiks.

git remote remove origin
# replace <access-token> with your access token
# replace <git-repo> with a git submodule name
git remote add origin https://<access-token>@github.com/emergence-engineering/<git-repo>.git

start project :rocket:

pnpm install # installs packages in all workspaces

this is a bit buggy atm

pnpm run dev-all # runs all workspaces inside `/packages` using `concurrently`

if so, run build or dev from separate terminal windows

  • keep in mind, if you just run build from one terminal session one after another, the order matters as prosemirror-suggestcar-plugin-react depends on the rest of the workspaces
  • no need to build all of them all the time, if one package is built already and there are no changes, no need to build it
pnpm --filter prosemirror-slash-menu dev # terminal #1
pnpm --filter prosemirror-suggestcat-plugin dev # terminal #2
pnpm --filter prosemirror-slash-menu-react dev # terminal #3
pnpm --filter prosemirror-suggestcat-plugin-react dev # terminal #4

usually only need to run 1 or 2 workspaces in live mode

pnpm --filter <workspace> dev # replace `<workspace>`
pnpm --filter editor run start # in another terminal starts the CRA project inside `/apps/editor`

tips & tricks :wrench:

  • Prune node_modules installations for all packages:
    pnpm -r exec rm -rf node_modules
  • run a package.json script in a specific workspace
    pnpm --filter <project name> <cmd>
  • run a package.json script in all workspaces
    pnpm -r run <cmd>

For more information about pnpm read the workspaces docs :books:

publishing submodules to npm registry :package:

generate a new changeset

# in the root of the repository
pnpm changeset # select workspaces that need a new version

following will bump the versions of the packages previously specified with pnpm changeset (and any dependents of those) and update the changelog files.

pnpm changeset version # in the root of the repository
pnpm install # in the root of the repository
pnpm publish # in the workspace root you want to publish from

add git tags

git tag v0.1.5 --annotate -m "message" # change v0.1.5 with the current version
git push --tags # push tags to github

at this point you have some changes in the monorepo, commit and push

  • keep in mind that the submodules just point to a commit hash in the submodule
  • let's keep that commit be that latest commit hash on the given submodule's main branch
  • :warning: DO NOT commit dirty commit hash
  • :warning: DO NOT commit feature/bug or any other branch's commit other than the main's branch latest commit hash

for full documentation read pnpm changeset docs :books:\