@mushi-mushi/core 1.19.1 → 1.20.0
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.
- package/CONTRIBUTING.md +12 -0
- package/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/CONTRIBUTING.md
CHANGED
|
@@ -81,6 +81,18 @@ tooling/
|
|
|
81
81
|
tsconfig/ Shared TypeScript configs
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
## What we don't accept
|
|
85
|
+
|
|
86
|
+
Knowing this upfront saves everyone time.
|
|
87
|
+
|
|
88
|
+
- **Automated / bulk / AI-slop PRs** — any PR that was opened by a script, an LLM agent acting without meaningful human review, or as part of a parallel bounty-farming sweep is closed on sight. The commit history, branch name, or helper scripts included in the PR make this obvious.
|
|
89
|
+
- **PRs that target the wrong base** — all PRs must branch from and target `master`. PRs targeting `main` or any other branch are closed (and will show an inflated diff that is not your work).
|
|
90
|
+
- **One PR per issue, one issue per PR** — splitting or duplicating work just to collect acknowledgements isn't welcome.
|
|
91
|
+
- **Good-first-issues without claiming first** — comment on the issue to claim it before starting. If two people open PRs for the same issue, the one that commented first is prioritised.
|
|
92
|
+
- **Documentation-only PRs that merely duplicate existing content** — if the information already exists (e.g. in another file in this repo), adding a redundant copy adds noise without value.
|
|
93
|
+
|
|
94
|
+
If a PR violates these policies it will be closed with a brief explanation. No hard feelings — a genuine contribution on the same issue is always welcome.
|
|
95
|
+
|
|
84
96
|
## Making Changes
|
|
85
97
|
|
|
86
98
|
1. Create a feature branch from `master`
|
package/dist/index.cjs
CHANGED
|
@@ -115,8 +115,9 @@ function createApiClient(options) {
|
|
|
115
115
|
const errorBody = await response.json().catch(() => ({}));
|
|
116
116
|
if ((response.status === 401 || response.status === 403) && !_credWarningEmitted) {
|
|
117
117
|
_credWarningEmitted = true;
|
|
118
|
+
const where = baseUrl === DEFAULT_API_ENDPOINT ? "Get the correct values at: https://kensaur.us/mushi-mushi/admin/projects" : "Get the correct values from your Mushi console's Projects page.";
|
|
118
119
|
console.error(
|
|
119
|
-
`[Mushi] Credentials rejected (HTTP ${response.status}). Check your Project ID and API key scope (must be "report:write").
|
|
120
|
+
`[Mushi] Credentials rejected (HTTP ${response.status}). Check your Project ID and API key scope (must be "report:write"). ` + where
|
|
120
121
|
);
|
|
121
122
|
}
|
|
122
123
|
if (response.status >= 500 && retries > 0) {
|
|
@@ -1996,10 +1997,20 @@ function readPageFaviconHref() {
|
|
|
1996
1997
|
];
|
|
1997
1998
|
for (const sel of selectors) {
|
|
1998
1999
|
const link = document.querySelector(sel);
|
|
1999
|
-
|
|
2000
|
+
const href = link?.href;
|
|
2001
|
+
if (href && isSafeFaviconHref(href)) return href;
|
|
2000
2002
|
}
|
|
2001
2003
|
return null;
|
|
2002
2004
|
}
|
|
2005
|
+
function isSafeFaviconHref(href) {
|
|
2006
|
+
try {
|
|
2007
|
+
const base = typeof location !== "undefined" ? location.href : void 0;
|
|
2008
|
+
const protocol = new URL(href, base).protocol;
|
|
2009
|
+
return protocol === "http:" || protocol === "https:";
|
|
2010
|
+
} catch {
|
|
2011
|
+
return false;
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2003
2014
|
|
|
2004
2015
|
exports.DEFAULT_API_ENDPOINT = DEFAULT_API_ENDPOINT;
|
|
2005
2016
|
exports.MAX_REPORT_PAYLOAD_BYTES = MAX_REPORT_PAYLOAD_BYTES;
|