@seayoo-web/finder 2.0.6 → 2.0.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.
package/dist/index.cjs CHANGED
@@ -245,7 +245,7 @@ async function getServerSupportedProjects(serverDomain, ignoreCache = false, deb
245
245
  const { status, message, data } = await request({
246
246
  url: inspectURL,
247
247
  method: "GET",
248
- headers: { UserAgent: `web finder agent v2` }
248
+ headers: { "user-agent": `web finder agent v2` }
249
249
  });
250
250
  if (status !== 200) {
251
251
  if (debug) {
@@ -344,9 +344,10 @@ function viteDeployPlugin(option) {
344
344
  preview: true,
345
345
  ...option,
346
346
  dist: distDir
347
- }).catch(() => null);
348
- if (result === null) {
347
+ }).catch((e) => e instanceof Error ? e : typeof e === "string" ? new Error(e) : new Error(e + ""));
348
+ if (result instanceof Error) {
349
349
  (_a = option.onError) == null ? void 0 : _a.call(option);
350
+ console.log("部署失败".bgRed, result.message);
350
351
  } else {
351
352
  (_b = option.onFinished) == null ? void 0 : _b.call(option);
352
353
  console.log("部署成功".bgGreen, (result || "").green);
package/dist/index.js CHANGED
@@ -243,7 +243,7 @@ async function getServerSupportedProjects(serverDomain, ignoreCache = false, deb
243
243
  const { status, message, data } = await request({
244
244
  url: inspectURL,
245
245
  method: "GET",
246
- headers: { UserAgent: `web finder agent v2` }
246
+ headers: { "user-agent": `web finder agent v2` }
247
247
  });
248
248
  if (status !== 200) {
249
249
  if (debug) {
@@ -342,9 +342,10 @@ function viteDeployPlugin(option) {
342
342
  preview: true,
343
343
  ...option,
344
344
  dist: distDir
345
- }).catch(() => null);
346
- if (result === null) {
345
+ }).catch((e) => e instanceof Error ? e : typeof e === "string" ? new Error(e) : new Error(e + ""));
346
+ if (result instanceof Error) {
347
347
  (_a = option.onError) == null ? void 0 : _a.call(option);
348
+ console.log("部署失败".bgRed, result.message);
348
349
  } else {
349
350
  (_b = option.onFinished) == null ? void 0 : _b.call(option);
350
351
  console.log("部署成功".bgGreen, (result || "").green);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/finder",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "agent for web finder",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -1,5 +1,4 @@
1
1
  import { finderDeploy } from "./core";
2
- import "colors";
3
2
  type FinderDeployVitePluginOption = Omit<Parameters<typeof finderDeploy>[0], "dist"> & {
4
3
  onFinished?: () => unknown;
5
4
  onError?: () => unknown;