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

init: pnpm setup #6114

Merged
merged 9 commits into from
Sep 3, 2024
Merged

init: pnpm setup #6114

merged 9 commits into from
Sep 3, 2024

Conversation

danstarns
Copy link
Member

@danstarns danstarns commented Sep 3, 2024

What?

This PR implements the following changes:

  1. Adds pnpm for package management

It sets up the workspace as a monorepo containing two packages:

  1. grapesjs (published)
  2. @grapesjs/docs (non-published)

Both packages are managed through the root pnpm monorepo, including linting, shared dependencies, and build steps.

Why?

We have a collection of repositories in our organization that depend on either the GrapesJS core or the GrapesJS CLI. Each repo currently contains slightly different versions and collections of issues. By moving these packages together, we aim to achieve:

  • Better maintainability
  • Higher visibility
  • Faster time to ship

We chose pnpm because:

  1. It's well-suited for managing many packages in a single repo (including potential future additions like component libraries, plugins, blocks, adapters, and tests).
  2. It offers an excellent workspaces:@ package resolution mechanism.

Usage

Note: pnpm is required globally.

For detailed usage instructions, please refer to the updated CONTRIBUTING.md file in this branch.

Related

@@ -36,32 +36,21 @@
"backbone-undo": "0.2.6",
"codemirror": "5.63.0",
"codemirror-formatting": "1.0.0",
"html-entities": "~1.4.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

@artf this is needed to stop error:

Looks like we should keep it.

@danstarns danstarns requested a review from artf September 3, 2024 07:17
"format": "prettier . --write",
"format:check": "prettier . --check"
},
"devDependencies": {
Copy link
Member Author

Choose a reason for hiding this comment

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

Most of the dev deps for typescript, testing, building, and lining are now in this file.

},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
Copy link
Member Author

Choose a reason for hiding this comment

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

They are hoisted to the root.

"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jest": "28.8.0",
"eslint-plugin-prettier": "5.1.3",
"grapesjs-cli": "4.1.3",
Copy link
Member Author

Choose a reason for hiding this comment

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

There is a conflict in the repo with webpack, as vuepress relies on a different version of webpack as to grapesjs-cli, we can resolve this better and share webpack when we have the cli in the monorepo.

"documentation": "14.0.3",
"postcss": "8",
"sass": "1.42.1",
"vuepress": "1.9.10",
Copy link
Member Author

Choose a reason for hiding this comment

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

Relies on webpack.

.github/workflows/quality.yml Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

💜

@artf artf merged commit 9360241 into dev Sep 3, 2024
1 check passed
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