@orderly.network/npm-release 0.0.2-alpha.6 → 0.0.2-alpha.7

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.
Files changed (2) hide show
  1. package/index.mjs +7 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -94,12 +94,17 @@ function getPackagePageUrl(pkgName) {
94
94
  async function sendSlackNotify({ success, error }) {
95
95
  if (!slackWebhookUrl) return;
96
96
 
97
+ const raw = npm.registry || "https://registry.npmjs.org";
98
+ const registry = raw.replace(/\/$/, "");
99
+ const isPublic = !npm.registry || registry === "https://registry.npmjs.org";
100
+ const registryLabel = isPublic ? "public" : "internal";
101
+
97
102
  const { name: pkgName, version } = readPackageJson();
98
103
  const packageUrl = getPackagePageUrl(pkgName);
99
104
  const linkedPkg = `<${packageUrl}|${pkgName}@${version}>`;
100
105
  const text = success
101
- ? `packages published successfully:\n${linkedPkg}`
102
- : `packages publish failed:\n${linkedPkg}\n${error || "Unknown error"}`;
106
+ ? `packages published successfully (${registryLabel} registry):\n${linkedPkg}`
107
+ : `packages publish failed (${registryLabel} registry):\n${linkedPkg}\n${error || "Unknown error"}`;
103
108
 
104
109
  try {
105
110
  const res = await fetch(slackWebhookUrl, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderly.network/npm-release",
3
- "version": "0.0.2-alpha.6",
3
+ "version": "0.0.2-alpha.7",
4
4
  "main": "index.mjs",
5
5
  "module": "index.mjs",
6
6
  "license": "MIT",