Skip to content

Commit

Permalink
Update package managing flow
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Sep 26, 2024
1 parent 4482cd3 commit 86cde83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,5 +385,8 @@
"**/tsconfig.json": [
"npm run lint:tsconfig"
]
}
},
"workspaces": [
"packages/*"
]
}
10 changes: 3 additions & 7 deletions packages/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Managing Packages

This repository uses [monorepo] to manage WordPress modules and publish them with [lerna] as packages to [npm].
This repository uses [monorepo](https://monorepo.tools) to manage WordPress modules and publish them with [lerna](https://lerna.js.org/) as packages to [npm](https://www.npmjs.com/).

## Creating a New Package

Expand Down Expand Up @@ -70,12 +70,12 @@ Production dependencies are stored in the `dependencies` section of the package

#### Adding New Dependencies

The simplest way to add a production dependency to one of the packages is to run a very convenient [lerna add](https://github.com/lerna/lerna/tree/HEAD/commands/add#readme) command from the root of the project.
The simplest way to add a production dependency to one of the packages is to run a command like the following from the root of the project.

_Example:_

```bash
lerna add change-case packages/a11y
npm install change-case -w packages/a11y
```

This command adds the latest version of `change-case` as a dependency to the `@wordpress/a11y` package, which is located in `packages/a11y` folder.
Expand Down Expand Up @@ -239,10 +239,6 @@ For consumers to use the published type declarations, we'll set the `types` fiel

Ensure that the `build-types` directory will be included in the published package, for example if a `files` field is declared.

[lerna]: https://lerna.js.org/
[monorepo]: https://monorepo.tools
[npm]: https://www.npmjs.com/

## Optimizing for bundlers

In order for bundlers to tree-shake packages effectively, they often need to know whether a package includes side effects in its code. This is done through the `sideEffects` field in the package's `package.json`.
Expand Down

0 comments on commit 86cde83

Please sign in to comment.