🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

metro-transform-worker

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-transform-worker - npm Package Compare versions

Comparing version
0.84.1
to
0.84.2
+124
src/index.d.ts
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noformat
* @oncall react_native
* @generated SignedSource<<a9f82c31a355f3717a1bad9c405ed305>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-worker/src/index.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {
CustomTransformOptions,
TransformProfile,
} from 'metro-babel-transformer';
import type {
BasicSourceMap,
FBSourceFunctionMap,
MetroSourceMapSegmentTuple,
} from 'metro-source-map';
import type {TransformResultDependency} from 'metro/private/DeltaBundler';
import type {AllowOptionalDependencies} from 'metro/private/DeltaBundler/types';
import type {DynamicRequiresBehavior} from 'metro/private/ModuleGraph/worker/collectDependencies';
type MinifierConfig = Readonly<{[$$Key$$: string]: unknown}>;
export type MinifierOptions = {
code: string;
map: null | undefined | BasicSourceMap;
filename: string;
reserved: ReadonlyArray<string>;
config: MinifierConfig;
};
export type MinifierResult = {code: string; map?: BasicSourceMap};
export type Minifier = (
$$PARAM_0$$: MinifierOptions,
) => MinifierResult | Promise<MinifierResult>;
export type Type = 'script' | 'module' | 'asset';
export type JsTransformerConfig = Readonly<{
assetPlugins: ReadonlyArray<string>;
assetRegistryPath: string;
asyncRequireModulePath: string;
babelTransformerPath: string;
dynamicDepsInPackages: DynamicRequiresBehavior;
enableBabelRCLookup: boolean;
enableBabelRuntime: boolean | string;
globalPrefix: string;
hermesParser: boolean;
minifierConfig: MinifierConfig;
minifierPath: string;
optimizationSizeLimit: number;
publicPath: string;
allowOptionalDependencies: AllowOptionalDependencies;
unstable_dependencyMapReservedName: null | undefined | string;
unstable_disableModuleWrapping: boolean;
unstable_disableNormalizePseudoGlobals: boolean;
unstable_compactOutput: boolean;
/** Enable `require.context` statements which can be used to import multiple files in a directory. */
unstable_allowRequireContext: boolean;
/** With inlineRequires, enable a module-scope memo var and inline as (v || v=require('foo')) */
unstable_memoizeInlineRequires?: boolean;
/** With inlineRequires, do not memoize these module specifiers */
unstable_nonMemoizedInlineRequires?: ReadonlyArray<string>;
/** Whether to rename scoped `require` functions to `_$$_REQUIRE`, usually an extraneous operation when serializing to iife (default). */
unstable_renameRequire?: boolean;
}>;
export type {CustomTransformOptions} from 'metro-babel-transformer';
export type JsTransformOptions = Readonly<{
customTransformOptions?: CustomTransformOptions;
dev: boolean;
experimentalImportSupport?: boolean;
inlinePlatform: boolean;
inlineRequires: boolean;
minify: boolean;
nonInlinedRequires?: ReadonlyArray<string>;
platform: null | undefined | string;
type: Type;
unstable_memoizeInlineRequires?: boolean;
unstable_nonMemoizedInlineRequires?: ReadonlyArray<string>;
unstable_staticHermesOptimizedRequire?: boolean;
unstable_transformProfile: TransformProfile;
}>;
type JSFileType = 'js/script' | 'js/module' | 'js/module/asset';
export type JsOutput = Readonly<{
data: Readonly<{
code: string;
lineCount: number;
map: Array<MetroSourceMapSegmentTuple>;
functionMap: null | undefined | FBSourceFunctionMap;
}>;
type: JSFileType;
}>;
type TransformResponse = Readonly<{
dependencies: ReadonlyArray<TransformResultDependency>;
output: ReadonlyArray<JsOutput>;
}>;
export declare const transform: (
config: JsTransformerConfig,
projectRoot: string,
filename: string,
data: Buffer,
options: JsTransformOptions,
) => Promise<TransformResponse>;
export declare type transform = typeof transform;
export declare const getCacheKey: (config: JsTransformerConfig) => string;
export declare type getCacheKey = typeof getCacheKey;
/**
* Backwards-compatibility with CommonJS consumers using interopRequireDefault.
* Do not add to this list.
*
* @deprecated Default import from 'metro-transform-worker' is deprecated, use named exports.
*/
declare const $$EXPORT_DEFAULT_DECLARATION$$: {
getCacheKey: typeof getCacheKey;
transform: typeof transform;
};
declare type $$EXPORT_DEFAULT_DECLARATION$$ =
typeof $$EXPORT_DEFAULT_DECLARATION$$;
export default $$EXPORT_DEFAULT_DECLARATION$$;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noformat
* @oncall react_native
* @generated SignedSource<<b122890ad90539195b3a9805a1a7e02f>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-worker/src/utils/assetTransformer.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {File} from '@babel/types';
import type {BabelTransformerArgs} from 'metro-babel-transformer';
export declare function transform(
$$PARAM_0$$: BabelTransformerArgs,
assetRegistryPath: string,
assetDataPlugins: ReadonlyArray<string>,
): Promise<{ast: File}>;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noformat
* @oncall react_native
* @generated SignedSource<<410ba17e82af72676f3993ebd1d0f60f>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-worker/src/utils/getMinifier.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {Minifier} from '../index.js';
declare function getMinifier(minifierPath: string): Minifier;
export default getMinifier;
+8
-8
{
"name": "metro-transform-worker",
"version": "0.84.1",
"version": "0.84.2",
"description": "🚇 Transform worker for Metro.",

@@ -27,9 +27,9 @@ "main": "src/index.js",

"flow-enums-runtime": "^0.0.6",
"metro": "0.84.1",
"metro-babel-transformer": "0.84.1",
"metro-cache": "0.84.1",
"metro-cache-key": "0.84.1",
"metro-minify-terser": "0.84.1",
"metro-source-map": "0.84.1",
"metro-transform-plugins": "0.84.1",
"metro": "0.84.2",
"metro-babel-transformer": "0.84.2",
"metro-cache": "0.84.2",
"metro-cache-key": "0.84.2",
"metro-minify-terser": "0.84.2",
"metro-source-map": "0.84.2",
"metro-transform-plugins": "0.84.2",
"nullthrows": "^1.1.1"

@@ -36,0 +36,0 @@ },