@snowieedev/shipkit 1.0.0 → 1.0.1

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/dist/lib/api.js +7 -1
  2. package/package.json +2 -1
package/dist/lib/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import { getAuth } from './storage.js';
3
- const API_URL = process.env.SHIPKIT_API_URL || 'http://localhost:3000';
3
+ const API_URL = process.env.SHIPKIT_API_URL || 'https://shipkit-bice.vercel.app';
4
4
  export const apiClient = axios.create({
5
5
  baseURL: `${API_URL}/api`,
6
6
  timeout: 10000,
@@ -12,6 +12,12 @@ apiClient.interceptors.request.use((config) => {
12
12
  }
13
13
  return config;
14
14
  });
15
+ apiClient.interceptors.response.use((response) => response, (error) => {
16
+ if (error.code === 'ECONNREFUSED' || (error.name === 'AggregateError' && !error.message)) {
17
+ error.message = `Could not connect to ShipKit API at ${error.config?.baseURL || API_URL}. Is the server running?`;
18
+ }
19
+ return Promise.reject(error);
20
+ });
15
21
  export const api = {
16
22
  login: async (email, password) => {
17
23
  const { data } = await apiClient.post('/cli/login', { email, password });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snowieedev/shipkit",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "The command line interface for ShipKit - Build Faster. Ship Smarter.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -10,6 +10,7 @@
10
10
  "test": "vitest run",
11
11
  "test:coverage": "vitest run --coverage",
12
12
  "build": "tsc",
13
+ "prepublishOnly": "pnpm run build",
13
14
  "start": "node ./dist/index.js"
14
15
  },
15
16
  "keywords": [