Skip to content

Commit 40956aa

Browse files
authored
Merge pull request #8 from wp-media/develop
Releasing v1.0.2
2 parents 8b7a5d2 + 0137c76 commit 40956aa

File tree

6 files changed

+41
-17
lines changed

6 files changed

+41
-17
lines changed

README.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
Here we have main script sources to be used in WP Rocket plugin repository.
44

5+
## Building
6+
57
`dist` directory contains the final build files.
68

7-
## Scripts/Commands
9+
Developments for the scripts are done in the `src` folder. To update the outputs in the dist folder
810

911
```
1012
npm run build:unmin
@@ -24,27 +26,48 @@ npm run build
2426

2527
This is to build both minified and not minified versions.
2628

27-
## How to test a change in WP Rocket plugin
29+
# Updating WP Rocket
30+
31+
## How to import changes from rocket-scripts
2832

29-
1. Create a branch and PR for your change in this repository.
30-
2. Edit `package.json` inside WP Rocket plugin repository to have the following line:
33+
The following steps must be followed when you need to test a new version of the scripts within WP Rocket plugin, or to submit a new version into WP Rocket through a PR.
34+
35+
1. Create a branch and PR for your changes in this repository.
36+
2. Check out wp rocket plugin on branch develop (or a dedicated branch for the issue to test if needed)
37+
3. Edit `package.json` inside WP Rocket plugin repository to change the targeted version of wp-rocket-scripts:
3138
```
3239
"wp-rocket-scripts": "github:wp-media/rocket-scripts#branch-name",
3340
```
34-
3. Remove `node_modules` directory and `package-lock.json` file.
35-
4. Run the command
41+
42+
This syntax allows to target a specific branch as dependency. For instance:
43+
44+
```
45+
"wp-rocket-scripts": "github:wp-media/rocket-scripts#enhancement/6741-adjust-beacon-timeout",
46+
```
47+
48+
4. Remove `node_modules` directory and `package-lock.json` file.
49+
5. Run the command
3650
```
3751
npm install
3852
```
39-
5. Use the gulp task there to generate the beacon script:
53+
54+
You should see the targeted version of the beacon in your working directory `/node_modules/wp-rocket-scripts/dist`.
55+
56+
6. Use the gulp task there to generate the beacon script:
4057
```
4158
npm run gulp build:js:beacon
4259
```
43-
6. This will update the beacon script with the corresponding branch changes.
4460

45-
## How to release
46-
1. Update the version in `package.json`
61+
You should see the new beacon files in `assets/js`.
62+
63+
7. Compile the plugin zip as usual.
64+
65+
## How to release a new version
66+
67+
When a new WP Rocket release occurs with a new version of rocket-scripts, or when new developments are available on rocket-scripts develop without breaking compatibility with WP Rocket, a new rocket-scripts version must be created. To do so:
68+
69+
1. Update the version in `package.json`.
4770
2. Make sure everything is merged into `trunk` branch.
48-
3. Create a release from `trunk`
71+
3. Create a release from `trunk`.
4972
4. Github Workflow will run to release into npm.
5073
5. In WP Rocket or any other code that uses this package can update the version in their `package.json` and run `npm install` again.

dist/lcp-beacon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
this.config = config;
66
this.performanceImages = [];
77
this.errorCode = "";
8-
this.scriptTimer = /* @__PURE__ */ new Date();
98
this.infiniteLoopId = null;
109
}
1110
async init() {
11+
this.scriptTimer = /* @__PURE__ */ new Date();
1212
if (!await this._isValidPreconditions()) {
1313
this._finalize();
1414
return;

dist/lcp-beacon.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)