@rnx-kit/metro-serializer
Advanced tools
Comparing version 1.0.12 to 1.0.13
import type { MixedOutput, Module, ReadOnlyGraph, SerializerOptions } from "metro"; | ||
export type MetroPlugin<T = MixedOutput> = (entryPoint: string, preModules: ReadonlyArray<Module<T>>, graph: ReadOnlyGraph<T>, options: SerializerOptions<T>) => void; | ||
export type MetroPlugin<T = MixedOutput> = (entryPoint: string, preModules: readonly Module<T>[], graph: ReadOnlyGraph<T>, options: SerializerOptions<T>) => void; | ||
export type CustomSerializerResult = string | { | ||
@@ -7,3 +7,3 @@ code: string; | ||
}; | ||
export type CustomSerializer = (entryPoint: string, preModules: ReadonlyArray<Module>, graph: ReadOnlyGraph, options: SerializerOptions) => Promise<CustomSerializerResult> | CustomSerializerResult; | ||
export type CustomSerializer = (entryPoint: string, preModules: readonly Module[], graph: ReadOnlyGraph, options: SerializerOptions) => Promise<CustomSerializerResult> | CustomSerializerResult; | ||
/** | ||
@@ -10,0 +10,0 @@ * Metro's default bundle serializer. |
@@ -27,2 +27,3 @@ "use strict"; | ||
exports.MetroSerializer = void 0; | ||
const metro_1 = require("@rnx-kit/tools-react-native/metro"); | ||
const semver = __importStar(require("semver")); | ||
@@ -38,4 +39,5 @@ /** | ||
function MetroSerializer(plugins) { | ||
const baseJSBundle = require("metro/src/DeltaBundler/Serializers/baseJSBundle"); | ||
const bundleToString = require("metro/src/lib/bundleToString"); | ||
const metroPath = (0, metro_1.findMetroPath)() || "metro"; | ||
const baseJSBundle = require(`${metroPath}/src/DeltaBundler/Serializers/baseJSBundle`); | ||
const bundleToString = require(`${metroPath}/src/lib/bundleToString`); | ||
const { version } = require("metro/package.json"); | ||
@@ -42,0 +44,0 @@ const shouldReturnPromise = semver.satisfies(version, ">=0.60.0"); |
{ | ||
"name": "@rnx-kit/metro-serializer", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "Metro's default JavaScript bundle serializer but with plugin support", | ||
@@ -24,2 +24,3 @@ "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/metro-serializer#readme", | ||
"dependencies": { | ||
"@rnx-kit/tools-react-native": "^1.3.4", | ||
"semver": "^7.0.0" | ||
@@ -29,7 +30,6 @@ }, | ||
"@rnx-kit/scripts": "*", | ||
"@types/metro": "^0.76.0", | ||
"@types/semver": "^7.0.0", | ||
"eslint": "^8.0.0", | ||
"jest": "^29.2.1", | ||
"metro": "^0.73.7", | ||
"metro": "^0.76.5", | ||
"prettier": "^3.0.0", | ||
@@ -36,0 +36,0 @@ "typescript": "^5.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7280
7
66
0
2
2
+ Added@rnx-kit/tools-node@2.1.2(transitive)
+ Added@rnx-kit/tools-react-native@1.4.2(transitive)