@vibexdotnew/inspector 0.0.1 → 0.0.2
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/expo/config.cjs +52 -0
- package/dist/expo/config.cjs.map +1 -0
- package/dist/expo/config.d.cts +48 -0
- package/dist/expo/config.d.ts +48 -0
- package/dist/expo/config.js +26 -0
- package/dist/expo/config.js.map +1 -0
- package/dist/expo/index.cjs +1018 -0
- package/dist/expo/index.cjs.map +1 -0
- package/dist/expo/index.d.cts +40 -0
- package/dist/expo/index.d.ts +40 -0
- package/dist/expo/index.js +994 -0
- package/dist/expo/index.js.map +1 -0
- package/dist/next/index.cjs +0 -14
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +0 -14
- package/dist/next/index.js.map +1 -1
- package/expo/metro-transformer.js +395 -0
- package/package.json +42 -7
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/expo/config.ts
|
|
22
|
+
var config_exports = {};
|
|
23
|
+
__export(config_exports, {
|
|
24
|
+
transformerPath: () => transformerPath,
|
|
25
|
+
withInspector: () => withInspector
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(config_exports);
|
|
28
|
+
var import_url = require("url");
|
|
29
|
+
var import_path = require("path");
|
|
30
|
+
var import_meta = {};
|
|
31
|
+
var __filename = (0, import_url.fileURLToPath)(import_meta.url);
|
|
32
|
+
var __dirname = (0, import_path.dirname)(__filename);
|
|
33
|
+
var transformerPath = (0, import_path.join)(__dirname, "..", "..", "expo", "metro-transformer.js");
|
|
34
|
+
function withInspector(metroConfig, options = {}) {
|
|
35
|
+
const { enableInProduction = false } = options;
|
|
36
|
+
if (process.env.NODE_ENV === "production" && !enableInProduction) {
|
|
37
|
+
return metroConfig;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
...metroConfig,
|
|
41
|
+
transformer: {
|
|
42
|
+
...metroConfig.transformer,
|
|
43
|
+
babelTransformerPath: transformerPath
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
transformerPath,
|
|
50
|
+
withInspector
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=config.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/expo/config.ts"],"sourcesContent":["import { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\n// Calculate the path to the transformer file\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Absolute path to the metro-transformer.js file.\n * Use this with Metro configuration.\n *\n * @example\n * ```javascript\n * const { getDefaultConfig } = require('expo/metro-config');\n * const { transformerPath } = require('@vibexdotnew/inspector/expo');\n *\n * const config = getDefaultConfig(__dirname);\n *\n * module.exports = {\n * ...config,\n * transformer: {\n * ...config.transformer,\n * babelTransformerPath: transformerPath,\n * },\n * };\n * ```\n */\nexport const transformerPath = join(__dirname, '..', '..', 'expo', 'metro-transformer.js');\n\nexport interface InspectorConfig {\n /**\n * Enable the inspector in production builds.\n * @default false\n */\n enableInProduction?: boolean;\n}\n\n/**\n * Wraps an Expo Metro config to add the Vibex Inspector transformer.\n *\n * @example\n * ```javascript\n * const { getDefaultConfig } = require('expo/metro-config');\n * const { withInspector } = require('@vibexdotnew/inspector/expo');\n *\n * const config = getDefaultConfig(__dirname);\n *\n * module.exports = withInspector(config);\n * ```\n */\nexport function withInspector<T extends { transformer?: { babelTransformerPath?: string } }>(\n metroConfig: T,\n options: InspectorConfig = {}\n): T {\n const { enableInProduction = false } = options;\n\n // Skip in production unless explicitly enabled\n if (process.env.NODE_ENV === 'production' && !enableInProduction) {\n return metroConfig;\n }\n\n return {\n ...metroConfig,\n transformer: {\n ...metroConfig.transformer,\n babelTransformerPath: transformerPath,\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA8B;AAC9B,kBAA8B;AAD9B;AAIA,IAAM,iBAAa,0BAAc,YAAY,GAAG;AAChD,IAAM,gBAAY,qBAAQ,UAAU;AAsB7B,IAAM,sBAAkB,kBAAK,WAAW,MAAM,MAAM,QAAQ,sBAAsB;AAuBlF,SAAS,cACZ,aACA,UAA2B,CAAC,GAC3B;AACD,QAAM,EAAE,qBAAqB,MAAM,IAAI;AAGvC,MAAI,QAAQ,IAAI,aAAa,gBAAgB,CAAC,oBAAoB;AAC9D,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,aAAa;AAAA,MACT,GAAG,YAAY;AAAA,MACf,sBAAsB;AAAA,IAC1B;AAAA,EACJ;AACJ;","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Absolute path to the metro-transformer.js file.
|
|
3
|
+
* Use this with Metro configuration.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```javascript
|
|
7
|
+
* const { getDefaultConfig } = require('expo/metro-config');
|
|
8
|
+
* const { transformerPath } = require('@vibexdotnew/inspector/expo');
|
|
9
|
+
*
|
|
10
|
+
* const config = getDefaultConfig(__dirname);
|
|
11
|
+
*
|
|
12
|
+
* module.exports = {
|
|
13
|
+
* ...config,
|
|
14
|
+
* transformer: {
|
|
15
|
+
* ...config.transformer,
|
|
16
|
+
* babelTransformerPath: transformerPath,
|
|
17
|
+
* },
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const transformerPath: string;
|
|
22
|
+
interface InspectorConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Enable the inspector in production builds.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
enableInProduction?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wraps an Expo Metro config to add the Vibex Inspector transformer.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```javascript
|
|
34
|
+
* const { getDefaultConfig } = require('expo/metro-config');
|
|
35
|
+
* const { withInspector } = require('@vibexdotnew/inspector/expo');
|
|
36
|
+
*
|
|
37
|
+
* const config = getDefaultConfig(__dirname);
|
|
38
|
+
*
|
|
39
|
+
* module.exports = withInspector(config);
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function withInspector<T extends {
|
|
43
|
+
transformer?: {
|
|
44
|
+
babelTransformerPath?: string;
|
|
45
|
+
};
|
|
46
|
+
}>(metroConfig: T, options?: InspectorConfig): T;
|
|
47
|
+
|
|
48
|
+
export { type InspectorConfig, transformerPath, withInspector };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Absolute path to the metro-transformer.js file.
|
|
3
|
+
* Use this with Metro configuration.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```javascript
|
|
7
|
+
* const { getDefaultConfig } = require('expo/metro-config');
|
|
8
|
+
* const { transformerPath } = require('@vibexdotnew/inspector/expo');
|
|
9
|
+
*
|
|
10
|
+
* const config = getDefaultConfig(__dirname);
|
|
11
|
+
*
|
|
12
|
+
* module.exports = {
|
|
13
|
+
* ...config,
|
|
14
|
+
* transformer: {
|
|
15
|
+
* ...config.transformer,
|
|
16
|
+
* babelTransformerPath: transformerPath,
|
|
17
|
+
* },
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const transformerPath: string;
|
|
22
|
+
interface InspectorConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Enable the inspector in production builds.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
enableInProduction?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wraps an Expo Metro config to add the Vibex Inspector transformer.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```javascript
|
|
34
|
+
* const { getDefaultConfig } = require('expo/metro-config');
|
|
35
|
+
* const { withInspector } = require('@vibexdotnew/inspector/expo');
|
|
36
|
+
*
|
|
37
|
+
* const config = getDefaultConfig(__dirname);
|
|
38
|
+
*
|
|
39
|
+
* module.exports = withInspector(config);
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function withInspector<T extends {
|
|
43
|
+
transformer?: {
|
|
44
|
+
babelTransformerPath?: string;
|
|
45
|
+
};
|
|
46
|
+
}>(metroConfig: T, options?: InspectorConfig): T;
|
|
47
|
+
|
|
48
|
+
export { type InspectorConfig, transformerPath, withInspector };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/expo/config.ts
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { dirname, join } from "path";
|
|
6
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
var __dirname = dirname(__filename);
|
|
8
|
+
var transformerPath = join(__dirname, "..", "..", "expo", "metro-transformer.js");
|
|
9
|
+
function withInspector(metroConfig, options = {}) {
|
|
10
|
+
const { enableInProduction = false } = options;
|
|
11
|
+
if (process.env.NODE_ENV === "production" && !enableInProduction) {
|
|
12
|
+
return metroConfig;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
...metroConfig,
|
|
16
|
+
transformer: {
|
|
17
|
+
...metroConfig.transformer,
|
|
18
|
+
babelTransformerPath: transformerPath
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
transformerPath,
|
|
24
|
+
withInspector
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/expo/config.ts"],"sourcesContent":["import { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\n// Calculate the path to the transformer file\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Absolute path to the metro-transformer.js file.\n * Use this with Metro configuration.\n *\n * @example\n * ```javascript\n * const { getDefaultConfig } = require('expo/metro-config');\n * const { transformerPath } = require('@vibexdotnew/inspector/expo');\n *\n * const config = getDefaultConfig(__dirname);\n *\n * module.exports = {\n * ...config,\n * transformer: {\n * ...config.transformer,\n * babelTransformerPath: transformerPath,\n * },\n * };\n * ```\n */\nexport const transformerPath = join(__dirname, '..', '..', 'expo', 'metro-transformer.js');\n\nexport interface InspectorConfig {\n /**\n * Enable the inspector in production builds.\n * @default false\n */\n enableInProduction?: boolean;\n}\n\n/**\n * Wraps an Expo Metro config to add the Vibex Inspector transformer.\n *\n * @example\n * ```javascript\n * const { getDefaultConfig } = require('expo/metro-config');\n * const { withInspector } = require('@vibexdotnew/inspector/expo');\n *\n * const config = getDefaultConfig(__dirname);\n *\n * module.exports = withInspector(config);\n * ```\n */\nexport function withInspector<T extends { transformer?: { babelTransformerPath?: string } }>(\n metroConfig: T,\n options: InspectorConfig = {}\n): T {\n const { enableInProduction = false } = options;\n\n // Skip in production unless explicitly enabled\n if (process.env.NODE_ENV === 'production' && !enableInProduction) {\n return metroConfig;\n }\n\n return {\n ...metroConfig,\n transformer: {\n ...metroConfig.transformer,\n babelTransformerPath: transformerPath,\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,SAAS,YAAY;AAG9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,QAAQ,UAAU;AAsB7B,IAAM,kBAAkB,KAAK,WAAW,MAAM,MAAM,QAAQ,sBAAsB;AAuBlF,SAAS,cACZ,aACA,UAA2B,CAAC,GAC3B;AACD,QAAM,EAAE,qBAAqB,MAAM,IAAI;AAGvC,MAAI,QAAQ,IAAI,aAAa,gBAAgB,CAAC,oBAAoB;AAC9D,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,aAAa;AAAA,MACT,GAAG,YAAY;AAAA,MACf,sBAAsB;AAAA,IAC1B;AAAA,EACJ;AACJ;","names":[]}
|