@vibecodeapp/sdk 0.2.0 → 0.3.0

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 (43) hide show
  1. package/dist/dev/VibeDevWrapper.d.ts +9 -0
  2. package/dist/dev/VibeDevWrapper.d.ts.map +1 -0
  3. package/dist/dev/VibeDevWrapper.js +6 -0
  4. package/dist/dev/VibeDevWrapper.js.map +1 -0
  5. package/dist/dev/safe-insets.d.ts +9 -0
  6. package/dist/dev/safe-insets.d.ts.map +1 -0
  7. package/dist/dev/safe-insets.js +5 -0
  8. package/dist/dev/safe-insets.js.map +1 -0
  9. package/dist/dev/safe-insets.web.d.ts +9 -0
  10. package/dist/dev/safe-insets.web.d.ts.map +1 -0
  11. package/dist/dev/safe-insets.web.js +30 -0
  12. package/dist/dev/safe-insets.web.js.map +1 -0
  13. package/dist/index.d.ts +5 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +5 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/polyfills/alert.web.d.ts +1 -1
  18. package/dist/polyfills/alert.web.d.ts.map +1 -1
  19. package/dist/polyfills/alert.web.js +1 -1
  20. package/dist/polyfills/alert.web.js.map +1 -1
  21. package/dist/polyfills/fetch.web.d.ts +14 -0
  22. package/dist/polyfills/fetch.web.d.ts.map +1 -0
  23. package/dist/polyfills/fetch.web.js +170 -0
  24. package/dist/polyfills/fetch.web.js.map +1 -0
  25. package/dist/polyfills/haptics.web.d.ts.map +1 -1
  26. package/dist/polyfills/haptics.web.js +3 -3
  27. package/dist/polyfills/haptics.web.js.map +1 -1
  28. package/dist/polyfills/maps.web.d.ts +2 -2
  29. package/dist/polyfills/maps.web.d.ts.map +1 -1
  30. package/dist/polyfills/maps.web.js +4 -4
  31. package/dist/polyfills/maps.web.js.map +1 -1
  32. package/dist/polyfills/refresh-control-component.d.ts +2 -2
  33. package/dist/polyfills/refresh-control-component.d.ts.map +1 -1
  34. package/dist/polyfills/refresh-control-component.js +19 -10
  35. package/dist/polyfills/refresh-control-component.js.map +1 -1
  36. package/dist/polyfills/secure-store.web.d.ts.map +1 -1
  37. package/dist/polyfills/secure-store.web.js +6 -6
  38. package/dist/polyfills/secure-store.web.js.map +1 -1
  39. package/metro/index.cjs +137 -108
  40. package/metro/index.d.ts +18 -18
  41. package/metro/metro-http-store.cjs +254 -254
  42. package/metro/transformer.cjs +69 -0
  43. package/package.json +59 -57
@@ -15,7 +15,7 @@ const KEYCHAIN_CONSTANTS = {
15
15
  };
16
16
  export const { AFTER_FIRST_UNLOCK, AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY, ALWAYS, WHEN_PASSCODE_SET_THIS_DEVICE_ONLY, ALWAYS_THIS_DEVICE_ONLY, WHEN_UNLOCKED, WHEN_UNLOCKED_THIS_DEVICE_ONLY, } = KEYCHAIN_CONSTANTS;
17
17
  function isValidValue(value) {
18
- if (typeof value !== "string") {
18
+ if (typeof value !== 'string') {
19
19
  return false;
20
20
  }
21
21
  if (new Blob([value]).size > VALUE_BYTES_LIMIT) {
@@ -27,10 +27,10 @@ function getStorageKey(key) {
27
27
  return `_vibecode_secure_store_${key}`;
28
28
  }
29
29
  export async function isAvailableAsync() {
30
- const testKey = "__SECURE_STORE_AVAILABILITY_TEST_KEY__";
30
+ const testKey = '__SECURE_STORE_AVAILABILITY_TEST_KEY__';
31
31
  try {
32
- localStorage.setItem(testKey, "test");
33
- if (localStorage.getItem(testKey) !== "test") {
32
+ localStorage.setItem(testKey, 'test');
33
+ if (localStorage.getItem(testKey) !== 'test') {
34
34
  return false;
35
35
  }
36
36
  localStorage.removeItem(testKey);
@@ -48,13 +48,13 @@ export async function getItemAsync(key, _options = {}) {
48
48
  }
49
49
  export async function setItemAsync(key, value, _options = {}) {
50
50
  if (!isValidValue(value)) {
51
- throw new Error("Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.");
51
+ throw new Error('Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.');
52
52
  }
53
53
  localStorage.setItem(getStorageKey(key), value);
54
54
  }
55
55
  export function setItem(key, value, _options = {}) {
56
56
  if (!isValidValue(value)) {
57
- throw new Error("Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.");
57
+ throw new Error('Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.');
58
58
  }
59
59
  localStorage.setItem(getStorageKey(key), value);
60
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"secure-store.web.js","sourceRoot":"","sources":["../../src/polyfills/secure-store.web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B,MAAM,kBAAkB,GAAG;IACzB,kBAAkB,EAAE,CAAC;IACrB,mCAAmC,EAAE,CAAC;IACtC,MAAM,EAAE,CAAC;IACT,kCAAkC,EAAE,CAAC;IACrC,uBAAuB,EAAE,CAAC;IAC1B,aAAa,EAAE,CAAC;IAChB,8BAA8B,EAAE,CAAC;CAClC,CAAC;AAIF,MAAM,CAAC,MAAM,EACX,kBAAkB,EAClB,mCAAmC,EACnC,MAAM,EACN,kCAAkC,EAClC,uBAAuB,EACvB,aAAa,EACb,8BAA8B,GAC/B,GAAG,kBAAkB,CAAC;AASvB,SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,iBAAiB,EAAE,CAAC;QAC/C,OAAO,CAAC,IAAI,CACV,oDAAoD,iBAAiB,+CAA+C,CACrH,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,OAAO,0BAA0B,GAAG,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IAC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K,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,GAAW,EACX,WAA+B,EAAE;IAEjC,OAAO,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"secure-store.web.js","sourceRoot":"","sources":["../../src/polyfills/secure-store.web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAE9B,MAAM,kBAAkB,GAAG;IAC1B,kBAAkB,EAAE,CAAC;IACrB,mCAAmC,EAAE,CAAC;IACtC,MAAM,EAAE,CAAC;IACT,kCAAkC,EAAE,CAAC;IACrC,uBAAuB,EAAE,CAAC;IAC1B,aAAa,EAAE,CAAC;IAChB,8BAA8B,EAAE,CAAC;CACjC,CAAA;AAID,MAAM,CAAC,MAAM,EACZ,kBAAkB,EAClB,mCAAmC,EACnC,MAAM,EACN,kCAAkC,EAClC,uBAAuB,EACvB,aAAa,EACb,8BAA8B,GAC9B,GAAG,kBAAkB,CAAA;AAStB,SAAS,YAAY,CAAC,KAAa;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAA;IACb,CAAC;IACD,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,iBAAiB,EAAE,CAAC;QAChD,OAAO,CAAC,IAAI,CACX,oDAAoD,iBAAiB,+CAA+C,CACpH,CAAA;IACF,CAAC;IACD,OAAO,IAAI,CAAA;AACZ,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IACjC,OAAO,0BAA0B,GAAG,EAAE,CAAA;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACrC,MAAM,OAAO,GAAG,wCAAwC,CAAA;IACxD,IAAI,CAAC;QACJ,YAAY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ACX,WAA+B,EAAE;IAEjC,OAAO,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC5C,OAAO,KAAK,CAAA;AACb,CAAC"}
package/metro/index.cjs CHANGED
@@ -1,14 +1,14 @@
1
- const path = require("node:path");
2
- const os = require("node:os");
3
- const { FileStore } = require("metro-cache");
4
- const { HttpStore } = require("./metro-http-store.cjs");
1
+ const path = require('node:path')
2
+ const os = require('node:os')
3
+ const { FileStore } = require('metro-cache')
4
+ const { HttpStore } = require('./metro-http-store.cjs')
5
5
 
6
6
  /**
7
7
  * Metro configuration helper for Vibecode
8
8
  * Provides web polyfills and HTTP cache store for remote caching.
9
9
  */
10
10
 
11
- const distPath = path.resolve(__dirname, "../dist/");
11
+ const distPath = path.resolve(__dirname, '../dist/')
12
12
 
13
13
  /**
14
14
  * Create cache stores array for Metro config.
@@ -22,27 +22,28 @@ const distPath = path.resolve(__dirname, "../dist/");
22
22
  * @returns {Array} Array of cache store instances
23
23
  */
24
24
  function createCacheStores(options = {}) {
25
- const cacheDir =
26
- options.cacheDir ||
27
- process.env.METRO_CACHE_DIR ||
28
- path.join(os.homedir(), ".metro-cache");
29
-
30
- const httpEndpoint = options.httpEndpoint || process.env.METRO_CACHE_HTTP_ENDPOINT;
31
-
32
- const stores = [new FileStore({ root: cacheDir })];
33
-
34
- if (httpEndpoint) {
35
- stores.push(
36
- new HttpStore({
37
- endpoint: httpEndpoint,
38
- timeout: options.httpTimeout ?? 30000,
39
- maxConnections: options.httpMaxConnections ?? 64,
40
- maxConcurrent: options.httpMaxConcurrent ?? 256,
41
- })
42
- );
43
- }
44
-
45
- return stores;
25
+ const cacheDir =
26
+ options.cacheDir ||
27
+ process.env.METRO_CACHE_DIR ||
28
+ path.join(os.homedir(), '.metro-cache')
29
+
30
+ const httpEndpoint =
31
+ options.httpEndpoint || process.env.METRO_CACHE_HTTP_ENDPOINT
32
+
33
+ const stores = [new FileStore({ root: cacheDir })]
34
+
35
+ if (httpEndpoint) {
36
+ stores.push(
37
+ new HttpStore({
38
+ endpoint: httpEndpoint,
39
+ timeout: options.httpTimeout ?? 30000,
40
+ maxConnections: options.httpMaxConnections ?? 64,
41
+ maxConcurrent: options.httpMaxConcurrent ?? 256,
42
+ }),
43
+ )
44
+ }
45
+
46
+ return stores
46
47
  }
47
48
 
48
49
  /**
@@ -64,88 +65,116 @@ function createCacheStores(options = {}) {
64
65
  * @param {number} [options.httpMaxConcurrent] - Max concurrent requests
65
66
  * @returns {Object} Enhanced Metro config
66
67
  */
68
+ // Path to the fetch polyfill that auto-initializes the proxy
69
+ const fetchPolyfillPath = path.resolve(distPath, 'polyfills/fetch.web.js')
70
+
67
71
  function withVibecodeMetro(config, options = {}) {
68
- const originalResolveRequest = config.resolver?.resolveRequest;
69
- const enableCache = options.enableCache !== false;
70
-
71
- const result = {
72
- ...config,
73
- resolver: {
74
- ...config.resolver,
75
- extraNodeModules: {
76
- assert: require.resolve("assert"),
77
- ...config.resolver?.extraNodeModules,
78
- },
79
- resolveRequest: (context, moduleName, platform) => {
80
- // Redirect expo-haptics to our web polyfill on web platform
81
- if (moduleName === "expo-haptics" && platform === "web") {
82
- return {
83
- filePath: path.resolve(distPath, "polyfills/haptics.web.js"),
84
- type: "sourceFile",
85
- };
86
- }
87
-
88
- if (moduleName === "expo-secure-store" && platform === "web") {
89
- return {
90
- filePath: path.resolve(distPath, "polyfills/secure-store.web.js"),
91
- type: "sourceFile",
92
- };
93
- }
94
-
95
- if (moduleName === "react-native-maps" && platform === "web") {
96
- return {
97
- filePath: path.resolve(distPath, "polyfills/maps.web.js"),
98
- type: "sourceFile",
99
- };
100
- }
101
-
102
- if (
103
- moduleName === "react-native-web/dist/exports/RefreshControl" &&
104
- platform === "web"
105
- ) {
106
- return {
107
- filePath: path.resolve(
108
- distPath,
109
- "polyfills/refresh-control-component.js"
110
- ),
111
- type: "sourceFile",
112
- };
113
- }
114
-
115
- if (
116
- moduleName === "react-native-web/dist/exports/Alert" &&
117
- platform === "web"
118
- ) {
119
- return {
120
- filePath: path.resolve(distPath, "polyfills/alert.web.js"),
121
- type: "sourceFile",
122
- };
123
- }
124
-
125
- if (originalResolveRequest) {
126
- return originalResolveRequest(context, moduleName, platform);
127
- }
128
-
129
- return context.resolveRequest(context, moduleName, platform);
130
- },
131
- },
132
- };
133
-
134
- // Configure caching if enabled
135
- if (enableCache) {
136
- result.cacheStores = createCacheStores({
137
- cacheDir: options.cacheDir,
138
- httpEndpoint: options.httpEndpoint,
139
- httpTimeout: options.httpTimeout,
140
- httpMaxConnections: options.httpMaxConnections,
141
- httpMaxConcurrent: options.httpMaxConcurrent,
142
- });
143
-
144
- result.cacheVersion =
145
- options.cacheVersion || process.env.METRO_CACHE_VERSION || "1";
146
- }
147
-
148
- return result;
72
+ const originalResolveRequest = config.resolver?.resolveRequest
73
+ const originalGetModulesRunBeforeMainModule =
74
+ config.serializer?.getModulesRunBeforeMainModule
75
+ const enableCache = options.enableCache !== false
76
+
77
+ const result = {
78
+ ...config,
79
+ serializer: {
80
+ ...config.serializer,
81
+ // Inject the fetch polyfill to run before the main module on web
82
+ getModulesRunBeforeMainModule: (entryFilePath) => {
83
+ const originalModules = originalGetModulesRunBeforeMainModule
84
+ ? originalGetModulesRunBeforeMainModule(entryFilePath)
85
+ : []
86
+ // Add our fetch polyfill to run before the app starts
87
+ return [...originalModules, fetchPolyfillPath]
88
+ },
89
+ },
90
+ transformer: {
91
+ ...config.transformer,
92
+ babelTransformerPath: require.resolve('./transformer.cjs'),
93
+ },
94
+ resolver: {
95
+ ...config.resolver,
96
+ extraNodeModules: {
97
+ assert: require.resolve('assert'),
98
+ ...config.resolver?.extraNodeModules,
99
+ },
100
+ resolveRequest: (context, moduleName, platform) => {
101
+ // Redirect expo-haptics to our web polyfill on web platform
102
+ if (moduleName === 'expo-haptics' && platform === 'web') {
103
+ return {
104
+ filePath: path.resolve(distPath, 'polyfills/haptics.web.js'),
105
+ type: 'sourceFile',
106
+ }
107
+ }
108
+
109
+ if (moduleName === 'expo-secure-store' && platform === 'web') {
110
+ return {
111
+ filePath: path.resolve(distPath, 'polyfills/secure-store.web.js'),
112
+ type: 'sourceFile',
113
+ }
114
+ }
115
+
116
+ if (moduleName === 'react-native-maps' && platform === 'web') {
117
+ return {
118
+ filePath: path.resolve(distPath, 'polyfills/maps.web.js'),
119
+ type: 'sourceFile',
120
+ }
121
+ }
122
+
123
+ if (
124
+ moduleName === 'react-native-web/dist/exports/RefreshControl' &&
125
+ platform === 'web'
126
+ ) {
127
+ return {
128
+ filePath: path.resolve(
129
+ distPath,
130
+ 'polyfills/refresh-control-component.js',
131
+ ),
132
+ type: 'sourceFile',
133
+ }
134
+ }
135
+
136
+ if (
137
+ moduleName === 'react-native-web/dist/exports/Alert' &&
138
+ platform === 'web'
139
+ ) {
140
+ return {
141
+ filePath: path.resolve(distPath, 'polyfills/alert.web.js'),
142
+ type: 'sourceFile',
143
+ }
144
+ }
145
+
146
+ // Override expo/fetch on web to use our proxy-enabled fetch
147
+ if (moduleName === 'expo/fetch' && platform === 'web') {
148
+ return {
149
+ filePath: path.resolve(distPath, 'polyfills/fetch.web.js'),
150
+ type: 'sourceFile',
151
+ }
152
+ }
153
+
154
+ if (originalResolveRequest) {
155
+ return originalResolveRequest(context, moduleName, platform)
156
+ }
157
+
158
+ return context.resolveRequest(context, moduleName, platform)
159
+ },
160
+ },
161
+ }
162
+
163
+ // Configure caching if enabled
164
+ if (enableCache) {
165
+ result.cacheStores = createCacheStores({
166
+ cacheDir: options.cacheDir,
167
+ httpEndpoint: options.httpEndpoint,
168
+ httpTimeout: options.httpTimeout,
169
+ httpMaxConnections: options.httpMaxConnections,
170
+ httpMaxConcurrent: options.httpMaxConcurrent,
171
+ })
172
+
173
+ result.cacheVersion =
174
+ options.cacheVersion || process.env.METRO_CACHE_VERSION || '1'
175
+ }
176
+
177
+ return result
149
178
  }
150
179
 
151
- module.exports = { withVibecodeMetro };
180
+ module.exports = { withVibecodeMetro }
package/metro/index.d.ts CHANGED
@@ -1,26 +1,26 @@
1
- import type { MetroConfig } from "metro-config";
1
+ import type { MetroConfig } from 'metro-config'
2
2
 
3
3
  export interface VibecodeMetroOptions {
4
- /** Enable cache configuration (default: true) */
5
- enableCache?: boolean;
6
- /** Local cache directory (default: ~/.metro-cache) */
7
- cacheDir?: string;
8
- /** Cache version string (default: "1") */
9
- cacheVersion?: string;
10
- /** HTTP/2 cache server endpoint */
11
- httpEndpoint?: string;
12
- /** HTTP request timeout in ms (default: 30000) */
13
- httpTimeout?: number;
14
- /** HTTP/2 connection pool size (default: 64) */
15
- httpMaxConnections?: number;
16
- /** Max concurrent HTTP requests (default: 256) */
17
- httpMaxConcurrent?: number;
4
+ /** Enable cache configuration (default: true) */
5
+ enableCache?: boolean
6
+ /** Local cache directory (default: ~/.metro-cache) */
7
+ cacheDir?: string
8
+ /** Cache version string (default: "1") */
9
+ cacheVersion?: string
10
+ /** HTTP/2 cache server endpoint */
11
+ httpEndpoint?: string
12
+ /** HTTP request timeout in ms (default: 30000) */
13
+ httpTimeout?: number
14
+ /** HTTP/2 connection pool size (default: 64) */
15
+ httpMaxConnections?: number
16
+ /** Max concurrent HTTP requests (default: 256) */
17
+ httpMaxConcurrent?: number
18
18
  }
19
19
 
20
20
  /**
21
21
  * Wrap a Metro config with Vibecode enhancements.
22
22
  */
23
23
  export function withVibecodeMetro(
24
- config: MetroConfig,
25
- options?: VibecodeMetroOptions
26
- ): MetroConfig;
24
+ config: MetroConfig,
25
+ options?: VibecodeMetroOptions,
26
+ ): MetroConfig