gatsby-plugin-newrelic 2.10.1 → 2.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,7 +124,7 @@ var _default = exports["default"] = function _default(_ref, pluginOptions) {
124
124
  var ajaxInitString = ajax !== null && ajax !== void 0 && ajax.deny_list ? "ajax:{deny_list:" + JSON.stringify(ajax === null || ajax === void 0 ? void 0 : ajax.deny_list) + "}," : "";
125
125
  init = sessionReplayInitString || distributedTracingInitString || privacyInitString || ajaxInitString ? ";window.NREUM||(NREUM={});NREUM.init={" + sessionReplayInitString + distributedTracingInitString + privacyInitString + ajaxInitString + "};" : "";
126
126
  }
127
- var configs = "\n ;NREUM.loader_config={accountID:\"" + options.accountId + "\",trustKey:\"" + options.trustKey + "\",agentID:\"" + options.agentID + "\",licenseKey:\"" + options.licenseKey + "\",applicationID:\"" + options.applicationID + "\"}\n ;NREUM.info={beacon:\"" + options.beacon + "\",errorBeacon:\"" + options.errorBeacon + "\",licenseKey:\"" + options.licenseKey + "\",applicationID:\"" + options.applicationID + "\",sa:1}\n ";
127
+ var configs = "\n ;window.NREUM||(NREUM={});NREUM.loader_config={accountID:\"" + options.accountId + "\",trustKey:\"" + options.trustKey + "\",agentID:\"" + options.agentID + "\",licenseKey:\"" + options.licenseKey + "\",applicationID:\"" + options.applicationID + "\"}\n ;NREUM.info={beacon:\"" + options.beacon + "\",errorBeacon:\"" + options.errorBeacon + "\",licenseKey:\"" + options.licenseKey + "\",applicationID:\"" + options.applicationID + "\",sa:1}\n ";
128
128
  if (configs && loaderType) {
129
129
  setHeadComponents([/*#__PURE__*/_react["default"].createElement("script", {
130
130
  key: "nr-init",
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "gatsby-plugin-newrelic",
3
- "version": "2.10.1",
3
+ "version": "2.10.3",
4
4
  "description": "Gatsby plugin for implementing the New Relic Browser agent",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "prebuild": "cross-env node scripts/prepare.js",
8
- "build": "babel src --out-dir . --ignore **/__tests__ && cp -r src/browser-agents browser-agents",
7
+ "build": "babel src --out-dir . --ignore **/__tests__",
9
8
  "watch": "babel -w src --out-dir . --ignore **/__tests__",
10
9
  "prepare": "cross-env NODE_ENV=production npm run build"
11
10
  },
@@ -47,6 +46,15 @@
47
46
  "cross-env": "^5.2.1",
48
47
  "semantic-release": "^24.0.0"
49
48
  },
49
+ "files": [
50
+ "index.js",
51
+ "gatsby-ssr.js",
52
+ "gatsby",
53
+ "LICENSE",
54
+ "README.md",
55
+ "THIRD_PARTY_NOTICES.md",
56
+ "third_party_manifest.json"
57
+ ],
50
58
  "engines": {
51
59
  "node": ">=16.3.1"
52
60
  },
package/.babelignore DELETED
@@ -1 +0,0 @@
1
- src/browser-agents/**
package/.babelrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "presets": [
3
- ["babel-preset-gatsby-package", { "browser": true }]
4
- ],
5
- "plugins": [
6
- ["@babel/plugin-proposal-private-methods", { "loose": false }]
7
- ]
8
- }
@@ -1,38 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Describe a scenario in which this project behaves unexpectedly
4
- title: ''
5
- labels: bug, needs-triage
6
- assignees: ''
7
-
8
- ---
9
-
10
- [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
11
-
12
- ## Description
13
-
14
- [NOTE]: # ( Describe the problem you're encountering. )
15
- [TIP]: # ( Do NOT give us access or passwords to your New Relic account or API keys! )
16
-
17
- ## Steps to Reproduce
18
-
19
- [NOTE]: # ( Please be as specific as possible. )
20
-
21
- ## Expected Behaviour
22
-
23
- [NOTE]: # ( Tell us what you expected to happen. )
24
-
25
- ## Relevant Logs / Console output
26
-
27
- [NOTE]: # ( Please provide specifics of the local error logs, Browser Dev Tools console, etc. if appropriate and possible. )
28
-
29
- ## Your Environment
30
-
31
- [TIP]: # ( Include as many relevant details about your environment as possible. )
32
-
33
- * ex: Browser name and version:
34
- * ex: Operating System and version:
35
-
36
- ## Additional context
37
-
38
- [TIP]: # ( Add any other context about the problem here. )
@@ -1,27 +0,0 @@
1
- ---
2
- name: Enhancement request
3
- about: Suggest an idea for a future version of this project
4
- title: ''
5
- labels: enhancement, needs-triage
6
- assignees: ''
7
-
8
- ---
9
-
10
- [NOTE]: # ( ^^ Provide a general summary of the request in the title above. ^^ )
11
-
12
- ## Summary
13
-
14
- [NOTE]: # ( Provide a brief overview of what the new feature is all about. )
15
-
16
- ## Desired Behaviour
17
-
18
- [NOTE]: # ( Tell us how the new feature should work. Be specific. )
19
- [TIP]: # ( Do NOT give us access or passwords to your New Relic account or API keys! )
20
-
21
- ## Possible Solution
22
-
23
- [NOTE]: # ( Not required. Suggest how to implement the addition or change. )
24
-
25
- ## Additional context
26
-
27
- [TIP]: # ( Why does this feature matter to you? What unique circumstances do you have? )
@@ -1,303 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - next
7
- - main
8
-
9
- env:
10
- THIRD_PARTY_GIT_AUTHOR_EMAIL: opensource+bot@newrelic.com
11
- THIRD_PARTY_GIT_AUTHOR_NAME: nr-opensource-bot
12
-
13
- jobs:
14
- log-context:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - name: Dump GitHub context
18
- env:
19
- GITHUB_CONTEXT: ${{ toJson(github) }}
20
- run: echo "$GITHUB_CONTEXT"
21
- - name: Dump job context
22
- env:
23
- JOB_CONTEXT: ${{ toJson(job) }}
24
- run: echo "$JOB_CONTEXT"
25
- - name: Dump steps context
26
- env:
27
- STEPS_CONTEXT: ${{ toJson(steps) }}
28
- run: echo "$STEPS_CONTEXT"
29
- - name: Dump runner context
30
- env:
31
- RUNNER_CONTEXT: ${{ toJson(runner) }}
32
- run: echo "$RUNNER_CONTEXT"
33
- - name: Dump strategy context
34
- env:
35
- STRATEGY_CONTEXT: ${{ toJson(strategy) }}
36
- run: echo "$STRATEGY_CONTEXT"
37
- - name: Dump matrix context
38
- env:
39
- MATRIX_CONTEXT: ${{ toJson(matrix) }}
40
- run: echo "$MATRIX_CONTEXT"
41
-
42
- job-checkout-and-build:
43
- if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
44
- runs-on: ubuntu-latest
45
- steps:
46
- - name: Checkout repo
47
- uses: actions/checkout@v4
48
- with:
49
- persist-credentials: false
50
-
51
- - name: Setup Node.js
52
- uses: actions/setup-node@v4
53
- with:
54
- node-version: 24.x
55
-
56
- - name: Cache node_modules
57
- id: cache-node-modules
58
- uses: actions/cache@v3
59
- env:
60
- cache-name: node-modules
61
- with:
62
- path: ~/.npm
63
- key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
64
- restore-keys: |
65
- ${{ runner.os }}-${{ env.cache-name }}-
66
-
67
- - name: Install Dependencies
68
- run: npm ci
69
-
70
- - name: Build
71
- run: |
72
- npm run build
73
-
74
- job-generate-third-party-notices:
75
- runs-on: ubuntu-latest
76
- needs: job-checkout-and-build
77
- steps:
78
- - name: Extract source variables
79
- run: |
80
- echo ::set-output name=name::${GITHUB_REF#refs/*/}
81
- echo ::set-output name=branch::${GITHUB_REF#refs/heads/}
82
- echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
83
- id: extract_source
84
-
85
- # Checkout fetch-depth: 2 because there's a check to see if package.json
86
- # was updated, and need at least 2 commits for the check to function properly
87
- - name: Checkout repo
88
- uses: actions/checkout@v4
89
- with:
90
- persist-credentials: false
91
- fetch-depth: 2
92
-
93
- - name: Setup Node.js
94
- uses: actions/setup-node@v4
95
- with:
96
- node-version: 24.x
97
-
98
- - name: Download Cached Deps
99
- id: cache-node-modules
100
- uses: actions/cache@v3
101
- env:
102
- cache-name: node-modules
103
- with:
104
- path: ~/.npm
105
- key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
106
- restore-keys: |
107
- ${{ runner.os }}-${{ env.cache-name }}-
108
-
109
- - name: Install Dependencies
110
- run: npm ci
111
-
112
- - name: Install OSS CLI
113
- run: |
114
- sudo npm install -g @newrelic/newrelic-oss-cli
115
-
116
- - name: Generate Third Party Notices
117
- id: generate-notices
118
- run: |
119
- if [ ! -f "third_party_manifest.json" ]; then
120
- echo "::error::third_party_manifest.json is missing. Must generate using the newrelic-oss-cli."
121
- exit 1
122
- fi
123
-
124
- # latest commit
125
- LATEST_COMMIT=$(git rev-parse HEAD)
126
-
127
- # latest commit where package.json was changed
128
- LAST_CHANGED_COMMIT=$(git log -1 --format=format:%H --full-diff package.json)
129
-
130
- if [ $LAST_CHANGED_COMMIT = $LATEST_COMMIT ]; then
131
- git config user.email "${{ env.THIRD_PARTY_GIT_AUTHOR_EMAIL }}"
132
- git config user.name "${{ env.THIRD_PARTY_GIT_AUTHOR_NAME }}"
133
-
134
- oss third-party manifest
135
- oss third-party notices
136
-
137
- git add third_party_manifest.json
138
- git add THIRD_PARTY_NOTICES.md
139
-
140
- git commit -m 'chore: update third-party manifest and notices [skip ci]'
141
- echo "::set-output name=commit::true"
142
- else
143
- echo "No change in package.json, not regenerating third-party notices"
144
- fi
145
-
146
- - name: Temporarily disable "required_pull_request_reviews" branch protection
147
- id: disable-branch-protection
148
- if: always()
149
- uses: actions/github-script@v1
150
- env:
151
- GITHUB_BRANCH: ${{ steps.extract_source.outputs.branch }}
152
- with:
153
- github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
154
- previews: luke-cage-preview
155
- script: |
156
- const result = await github.repos.updateBranchProtection({
157
- owner: context.repo.owner,
158
- repo: context.repo.repo,
159
- branch: process.env.GITHUB_BRANCH,
160
- required_status_checks: null,
161
- restrictions: null,
162
- enforce_admins: null,
163
- required_pull_request_reviews: null
164
- })
165
- console.log("Result:", result)
166
-
167
- - name: Push Commit
168
- if: steps.generate-notices.outputs.commit == 'true'
169
- uses: ad-m/github-push-action@v0.6.0
170
- with:
171
- github_token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
172
- branch: ${{ steps.extract_source.outputs.branch }}
173
-
174
- - name: Re-enable "required_pull_request_reviews" branch protection
175
- id: enable-branch-protection
176
- if: always()
177
- uses: actions/github-script@v1
178
- env:
179
- GITHUB_BRANCH: ${{ steps.extract_source.outputs.branch }}
180
- with:
181
- github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
182
- previews: luke-cage-preview
183
- script: |
184
- const result = await github.repos.updateBranchProtection({
185
- owner: context.repo.owner,
186
- repo: context.repo.repo,
187
- branch: process.env.GITHUB_BRANCH,
188
- required_status_checks: null,
189
- restrictions: null,
190
- enforce_admins: null,
191
- required_pull_request_reviews: {
192
- required_approving_review_count: 1
193
- }
194
- })
195
- console.log("Result:", result)
196
-
197
- job-generate-release:
198
- runs-on: ubuntu-latest
199
- needs: [job-checkout-and-build, job-generate-third-party-notices]
200
-
201
-
202
- permissions:
203
- contents: write # To push commits, tags, and GH Releases
204
- id-token: write # To authenticate with npm via OIDC
205
-
206
- steps:
207
- - name: Extract source variables
208
- run: |
209
- echo ::set-output name=name::${GITHUB_REF#refs/*/}
210
- echo ::set-output name=branch::${GITHUB_REF#refs/heads/}
211
- echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
212
- id: extract_source
213
-
214
- # Checkout specific branch we just committed third_party_notices too
215
- - name: Checkout repo
216
- uses: actions/checkout@v4
217
- with:
218
- persist-credentials: false
219
- ref: ${{ steps.extract_source.outputs.branch }}
220
-
221
- - name: Setup Node.js
222
- uses: actions/setup-node@v4
223
- with:
224
- node-version: 24.x
225
- registry-url: 'https://registry.npmjs.org'
226
-
227
- - name: Download Cached Deps
228
- id: cache-node-modules
229
- uses: actions/cache@v4
230
- env:
231
- cache-name: node-modules
232
- with:
233
- path: ~/.npm
234
- key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
235
- restore-keys: |
236
- ${{ runner.os }}-${{ env.cache-name }}-
237
-
238
- - name: Install dependencies
239
- run: npm ci
240
-
241
- - name: Temporarily disable "required_pull_request_reviews" branch protection
242
- id: disable-branch-protection
243
- if: always()
244
- uses: actions/github-script@v1
245
- env:
246
- GITHUB_BRANCH: ${{ steps.extract_source.outputs.branch }}
247
- with:
248
- github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
249
- previews: luke-cage-preview
250
- script: |
251
- const result = await github.repos.updateBranchProtection({
252
- owner: context.repo.owner,
253
- repo: context.repo.repo,
254
- branch: process.env.GITHUB_BRANCH,
255
- required_status_checks: null,
256
- restrictions: null,
257
- enforce_admins: null,
258
- required_pull_request_reviews: null
259
- })
260
- console.log("Result:", result)
261
-
262
- - name: Update dist-tag
263
- if: contains(github.ref, 'next')
264
- run: |
265
- npm install -g json
266
- json -I -f package.json -e 'this.publishConfig.tag="next"'
267
-
268
- - name: Run semantic-release
269
- env:
270
- # Use nr-opensource-bot for authoring commits done by
271
- # semantic-release (rather than using @semantic-release-bot)
272
- GIT_AUTHOR_NAME: "nr-opensource-bot"
273
- GIT_AUTHOR_EMAIL: "opensource+bot@newrelic.com"
274
- GIT_COMMITTER_NAME: "nr-opensource-bot"
275
- GIT_COMMITTER_EMAIL: "opensource+bot@newrelic.com"
276
- GITHUB_TOKEN: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
277
- run: npx semantic-release
278
-
279
- - name: Publish to npm with provenance
280
- run: npm publish --provenance --access public
281
-
282
- - name: Re-enable "required_pull_request_reviews" branch protection
283
- id: enable-branch-protection
284
- if: always()
285
- uses: actions/github-script@v1
286
- env:
287
- GITHUB_BRANCH: ${{ steps.extract_source.outputs.branch }}
288
- with:
289
- github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
290
- previews: luke-cage-preview
291
- script: |
292
- const result = await github.repos.updateBranchProtection({
293
- owner: context.repo.owner,
294
- repo: context.repo.repo,
295
- branch: process.env.GITHUB_BRANCH,
296
- required_status_checks: null,
297
- restrictions: null,
298
- enforce_admins: null,
299
- required_pull_request_reviews: {
300
- required_approving_review_count: 1
301
- }
302
- })
303
- console.log("Result:", result)
package/.releaserc DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "branches": ["main", "next"],
3
- "plugins": [
4
- "@semantic-release/commit-analyzer",
5
- "@semantic-release/release-notes-generator",
6
- ["@semantic-release/changelog", {
7
- "changelogFile": "docs/CHANGELOG.md"
8
- }],
9
- "@semantic-release/github",
10
- ["@semantic-release/npm", {
11
- "npmPublish": false
12
- }],
13
- ["@semantic-release/git", {
14
- "assets": ["docs", "package.json", "package-lock.json"],
15
- "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
16
- }]
17
- ],
18
- "dryRun": false,
19
- "debug": true
20
- }
@@ -1,46 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- ## Our Standards
8
-
9
- Examples of behavior that contributes to creating a positive environment include:
10
-
11
- * Using welcoming and inclusive language
12
- * Being respectful of differing viewpoints and experiences
13
- * Gracefully accepting constructive criticism
14
- * Focusing on what is best for the community
15
- * Showing empathy towards other community members
16
-
17
- Examples of unacceptable behavior by participants include:
18
-
19
- * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
- * Trolling, insulting/derogatory comments, and personal or political attacks
21
- * Public or private harassment
22
- * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
- * Other conduct which could reasonably be considered inappropriate in a professional setting
24
-
25
- ## Our Responsibilities
26
-
27
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
-
29
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- ## Scope
32
-
33
- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
-
35
- ## Enforcement
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at opensource@newrelic.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
-
39
- Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
-
41
- ## Attribution
42
-
43
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
-
45
- [homepage]: http://contributor-covenant.org
46
- [version]: http://contributor-covenant.org/version/1/4/
package/CONTRIBUTING.md DELETED
@@ -1,43 +0,0 @@
1
- # Contributing
2
-
3
- Contributions are always welcome. Before contributing please read the
4
- [code of conduct](./CODE_OF_CONDUCT.md) and [search the issue tracker](issues); your issue may have already been discussed or fixed in `master`. To contribute,
5
- [fork](https://help.github.com/articles/fork-a-repo/) this repository, commit your changes, and [send a Pull Request](https://help.github.com/articles/using-pull-requests/).
6
-
7
- Note that our [code of conduct](./CODE_OF_CONDUCT.md) applies to all platforms and venues related to this project; please follow it in all your interactions with the project and its participants.
8
-
9
- ## Feature Requests
10
-
11
- Feature requests should be submitted in the [Issue tracker](../../issues), with a description of the expected behavior & use case, where they’ll remain closed until sufficient interest, [e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/), has been [shown by the community](../../issues?q=label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).
12
- Before submitting an Issue, please search for similar ones in the
13
- [closed issues](../../issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
14
-
15
- ## Pull Requests
16
-
17
- 1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
18
- 2. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
19
- 3. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
20
-
21
- ## Publishing next versions to NPM
22
-
23
- A [Github workflow](https://github.com/newrelic/gatsby-plugin-newrelic/blob/main/.github/workflows/release.yml) which uses NPX [semantic-release](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches) exists to assist in publishing next versions of this plugin to NPM.
24
-
25
- > If you wish to publish a latest version to NPM follow these steps but ensure you change the tag in [package.json](package.json) to latest
26
-
27
- 1. Make your changes on a local branch from main.
28
- 2. After pulling down the code, run `git fetch && git pull` to ensure you have the latest code for main.
29
- 3. Commit your changes and submit a PR to the `next` branch.
30
- 4. Ensure that you [bump the version of the package](https://cloudfour.com/thinks/how-to-publish-an-updated-version-of-an-npm-package/#the-standard-release-process) by using semantic versioning using the `NPM version` command.
31
- 5. This will kick off the workflow to publish a next version to NPM.
32
- 6. Go to [NPM](https://www.npmjs.com/package/gatsby-plugin-newrelic) to view the next branch.
33
-
34
- ## Contributor License Agreement
35
-
36
- Keep in mind that when you submit your Pull Request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at opensource@newrelic.com.
37
-
38
- For more information about CLAs, please check out Alex Russell’s excellent post,
39
- [“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
40
-
41
- ## Slack
42
- We host a public Slack with a dedicated channel for contributors and maintainers of open source projects hosted by New Relic. If you are contributing to this project, you're welcome to request access to the #oss-contributors channel in the newrelicusers.slack.com workspace. To request access, please use this [link](https://join.slack.com/t/newrelicusers/shared_invite/zt-1ayj69rzm-~go~Eo1whIQGYnu3qi15ng).
43
-