@tagadapay/plugin-sdk 2.2.2 → 2.2.4

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.
@@ -16,7 +16,12 @@ let configPromise = null;
16
16
  const loadLocalDevConfig = async (configVariant = 'default') => {
17
17
  try {
18
18
  // Only try to load local config in development
19
- if (process.env.NODE_ENV !== 'development') {
19
+ // Use hostname-based detection for better Vite compatibility
20
+ const isLocalDev = typeof window !== 'undefined' &&
21
+ (window.location.hostname === 'localhost' ||
22
+ window.location.hostname.includes('.localhost') ||
23
+ window.location.hostname.includes('127.0.0.1'));
24
+ if (!isLocalDev) {
20
25
  return null;
21
26
  }
22
27
  // Load local store/account config
@@ -176,7 +181,12 @@ export const clearPluginConfigCache = () => {
176
181
  * Development helper to log current configuration
177
182
  */
178
183
  export const debugPluginConfig = async (configVariant = 'default') => {
179
- if (process.env.NODE_ENV !== 'development') {
184
+ // Use hostname-based detection for better Vite compatibility
185
+ const isLocalDev = typeof window !== 'undefined' &&
186
+ (window.location.hostname === 'localhost' ||
187
+ window.location.hostname.includes('.localhost') ||
188
+ window.location.hostname.includes('127.0.0.1'));
189
+ if (!isLocalDev) {
180
190
  return;
181
191
  }
182
192
  const config = await getPluginConfig(configVariant);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,24 @@
16
16
  "require": "./dist/react/index.js"
17
17
  }
18
18
  },
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "clean": "rm -rf dist",
22
+ "lint": "echo \"No linting configured\"",
23
+ "test": "echo \"No tests yet\" && exit 0",
24
+ "dev": "tsc --watch",
25
+ "prepublishOnly": "npm run clean && npm run build",
26
+ "publish:patch": "npm version patch && npm publish",
27
+ "publish:minor": "npm version minor && npm publish",
28
+ "publish:major": "npm version major && npm publish",
29
+ "publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
30
+ "publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
31
+ "version:patch": "npm version patch",
32
+ "version:minor": "npm version minor",
33
+ "version:major": "npm version major",
34
+ "version:beta": "npm version prerelease --preid=beta",
35
+ "version:alpha": "npm version prerelease --preid=alpha"
36
+ },
19
37
  "keywords": [
20
38
  "tagadapay",
21
39
  "cms",
@@ -56,22 +74,5 @@
56
74
  "bugs": {
57
75
  "url": "https://github.com/tagadapay/plugin-sdk/issues"
58
76
  },
59
- "homepage": "https://github.com/tagadapay/plugin-sdk#readme",
60
- "scripts": {
61
- "build": "tsc",
62
- "clean": "rm -rf dist",
63
- "lint": "echo \"No linting configured\"",
64
- "test": "echo \"No tests yet\" && exit 0",
65
- "dev": "tsc --watch",
66
- "publish:patch": "npm version patch && npm publish",
67
- "publish:minor": "npm version minor && npm publish",
68
- "publish:major": "npm version major && npm publish",
69
- "publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
70
- "publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
71
- "version:patch": "npm version patch",
72
- "version:minor": "npm version minor",
73
- "version:major": "npm version major",
74
- "version:beta": "npm version prerelease --preid=beta",
75
- "version:alpha": "npm version prerelease --preid=alpha"
76
- }
77
- }
77
+ "homepage": "https://github.com/tagadapay/plugin-sdk#readme"
78
+ }