You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-21Lines changed: 5 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,17 @@
1
-
# @guardian/commercial
1
+
# Commercial Monorepo
2
2
3
3
This package contains the code for the commercial bundle that is loaded on all pages on theguardian.com.
4
4
5
5
There are 2 main parts to this repo:
6
6
- The commercial bundle itself, which is a set of javascript files that is loaded on all pages on theguardian.com.
7
7
- Some modules that are used by other parts of the Guardian codebase, such as DCR. This is published as a package to npm, `@guardian/commercial`.
8
8
9
-
The exported modules are in `src/core`, everything else is part of the commercial bundle.
10
-
11
-
## Installation
12
-
13
-
To install the npm package, run `pnpm i @guardian/commercial`.
9
+
The `@guardian/commercial` modules are in `core/src`, everything else is only part of the commercial bundle and not the `@guardian/commercial` package.
14
10
15
11
## Development
16
12
13
+
**For working on the commercial bundle, see below. For working on the `@guardian/commercial` npm package, see [core/README.md](core/README.md).**
14
+
17
15
### Requirements
18
16
19
17
- Node
@@ -25,15 +23,7 @@ To install the npm package, run `pnpm i @guardian/commercial`.
25
23
26
24
To install dependencies, run `pnpm`.
27
25
28
-
To develop locally on the bundle, run `pnpm serve` to start a local server. This will watch for changes and rebuild the bundle. Serving it at `http://localhost:3031`.
29
-
30
-
### Releasing to NPM
31
-
32
-
This repository uses [changesets](https://github.com/changesets/changesets) for version management
33
-
34
-
To release a new version with your changes, run `pnpm changeset add` and follow the prompts. This will create a new changeset file in the `.changeset` directory. Commit this file with your PR.
35
-
36
-
When your PR is merged, changeset will analyse the changes and create a PR to release the new version.
26
+
To develop the bundle locally on the bundle, run `pnpm serve` to start a local server. This will watch for changes and rebuild the bundle. Serving it at `http://localhost:3031`.
37
27
38
28
### Pull requests
39
29
@@ -89,12 +79,6 @@ To test the bundle on CODE, create a PR, wait for github actions to run and a ri
89
79
90
80
Although you can deploy CODE changes without deploying Frontend or DCR, it's a good idea to flag any CODE deployments on the dotcom semaphore chat in case it has an effect on anything anyone else is testing.
91
81
92
-
#### Testing changes to the `@guardian/commercial` npm package
93
-
You can add the [beta]@guardian/commercial label to your pull request, this will release a beta version of the bundle to NPM, the exact version will be commented on your PR.
94
-
95
-
In order to do this, run `pnpm changeset`. This will create a new changeset file in the .changeset directory. Commit this file with your PR.
96
-
97
-
Note: Once the beta version is released, the label will be removed from the PR, so you will need to add it again if you want to release subsequent new versions.
This directory contains the modules that are published as the `@guardian/commercial` npm package.
4
+
5
+
## Installation
6
+
7
+
To install the npm package, install with your favourite package manager:
8
+
9
+
```bash
10
+
pnpm i @guardian/commercial
11
+
yarn add @guardian/commercial
12
+
npm i @guardian/commercial
13
+
```
14
+
15
+
## Development
16
+
17
+
build the package with:
18
+
19
+
```bash
20
+
pnpm build
21
+
```
22
+
23
+
This will build the package into the `dist` directory, which is what is published to npm.
24
+
25
+
#### Testing changes to the `@guardian/commercial` npm package
26
+
You can add the [beta]@guardian/commercial label to your pull request, this will release a beta version of the bundle to NPM, the exact version will be commented on your PR.
27
+
28
+
In order to do this, run `pnpm changeset`. This will create a new changeset file in the .changeset directory. Commit this file with your PR.
29
+
30
+
Note: Once the beta version is released, the label will be removed from the PR, so you will need to add it again if you want to release subsequent new versions.
31
+
32
+
## Releasing to NPM
33
+
This repository uses changesets for version management.
34
+
35
+
To release a new version with your changes, run:
36
+
37
+
```bash
38
+
pnpm changeset add
39
+
```
40
+
41
+
and follow the prompts. This will create a new changeset file in the `.changeset` directory. Commit this file with your PR.
42
+
43
+
When your PR is merged, changeset will analyse the changes and create a PR to release the new version.
44
+
45
+
if you are part of the `commercial` team, you can merge the changeset PR to release the new version. If you are not part of the `commercial` team, you will need to ask someone who is to merge the PR for you.
0 commit comments