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

metro-transform-plugins

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-plugins - npm Package Compare versions

Comparing version
0.84.1
to
0.84.2
+28
src/addParamsToDefineCall.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<<7b35f4001b105ee1f3612e8a0027a482>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/addParamsToDefineCall.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
/**
* Simple way of adding additional parameters to the end of the define calls.
*
* This is used to add extra information to the generaic compiled modules (like
* the dependencyMap object or the list of inverse dependencies).
*/
declare function addParamsToDefineCall(
code: string,
...paramsToAdd: Array<unknown>
): string;
export default addParamsToDefineCall;
/**
* 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<<126e200dfee829750f4424e550c34190>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/constant-folding-plugin.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {PluginObj} from '@babel/core';
import type $$IMPORT_TYPEOF_1$$ from '@babel/traverse';
import type * as $$IMPORT_TYPEOF_2$$ from '@babel/types';
type Traverse = typeof $$IMPORT_TYPEOF_1$$;
type Types = typeof $$IMPORT_TYPEOF_2$$;
type State = {stripped: boolean};
declare function constantFoldingPlugin(context: {
types: Types;
traverse: Traverse;
}): PluginObj<State>;
export default constantFoldingPlugin;
/**
* 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<<abccab72cbf3143d690c0cea72fcede8>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/import-export-plugin.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {PluginObj} from '@babel/core';
import type * as $$IMPORT_TYPEOF_1$$ from '@babel/types';
import type {Node, SourceLocation, Statement} from '@babel/types';
type Types = typeof $$IMPORT_TYPEOF_1$$;
export type Options = Readonly<{
importDefault: string;
importAll: string;
resolve: boolean;
out?: {isESModule: boolean};
}>;
type State = {
exportAll: Array<{file: string; loc: null | undefined | SourceLocation}>;
exportDefault: Array<{
local: string;
loc: null | undefined | SourceLocation;
}>;
exportNamed: Array<{
local: string;
remote: string;
loc: null | undefined | SourceLocation;
}>;
imports: Array<{node: Statement}>;
importDefault: Node;
importAll: Node;
opts: Options;
};
declare function importExportPlugin($$PARAM_0$$: {
types: Types;
}): PluginObj<State>;
export default importExportPlugin;
/**
* 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<<0a0f52c4e23d8cd25d04b2d46a09e480>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/inline-plugin.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {PluginObj} from '@babel/core';
import type * as $$IMPORT_TYPEOF_1$$ from '@babel/types';
type Types = typeof $$IMPORT_TYPEOF_1$$;
export type Options = Readonly<{
dev: boolean;
inlinePlatform: boolean;
isWrapped: boolean;
requireName?: string;
platform: string;
}>;
type State = {opts: Options};
declare function inlinePlugin(
$$PARAM_0$$: {types: Types},
options: Options,
): PluginObj<State>;
export default inlinePlugin;
/**
* 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
* @generated SignedSource<<1f73acbbf5a206de52478c57c058ccb8>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/inline-requires-plugin.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type * as $$IMPORT_TYPEOF_1$$ from '@babel/core';
import type {PluginObj} from '@babel/core';
type Babel = typeof $$IMPORT_TYPEOF_1$$;
export type PluginOptions = Readonly<{
ignoredRequires?: ReadonlyArray<string>;
inlineableCalls?: ReadonlyArray<string>;
nonMemoizedModules?: ReadonlyArray<string>;
memoizeCalls?: boolean;
}>;
export type State = {
opts?: PluginOptions;
ignoredRequires: Set<string>;
inlineableCalls: Set<string>;
membersAssigned: Map<string, Set<string>>;
};
/**
* This transform inlines top-level require(...) aliases with to enable lazy
* loading of dependencies. It is able to inline both single references and
* child property references.
*
* For instance:
* var Foo = require('foo');
* f(Foo);
*
* Will be transformed into:
* f(require('foo'));
*
* When the assigment expression has a property access, it will be inlined too,
* keeping the property. For instance:
* var Bar = require('foo').bar;
* g(Bar);
*
* Will be transformed into:
* g(require('foo').bar);
*
* Destructuring also works the same way. For instance:
* const {Baz} = require('foo');
* h(Baz);
*
* Is also successfully inlined into:
* g(require('foo').Baz);
*/
declare const $$EXPORT_DEFAULT_DECLARATION$$: (
$$PARAM_0$$: Babel,
) => PluginObj<State>;
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<<318e20b6680fabe0b8524213e38e0277>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/normalizePseudoGlobals.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {Node as BabelNode} from '@babel/types';
export type Options = {reservedNames: ReadonlyArray<string>};
declare function normalizePseudoglobals(
ast: BabelNode,
options?: Options,
): ReadonlyArray<string>;
export default normalizePseudoglobals;
/**
* 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<<13269e5dcf93e0b31428517812e3bb88>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-transform-plugins/src/utils/createInlinePlatformChecks.js
* To regenerate, run:
* js1 build metro-ts-defs (internal) OR
* yarn run build-ts-defs (OSS)
*/
import type {Scope} from '@babel/traverse';
import type * as $$IMPORT_TYPEOF_1$$ from '@babel/types';
import type {CallExpression, MemberExpression} from '@babel/types';
type Types = typeof $$IMPORT_TYPEOF_1$$;
type PlatformChecks = {
isPlatformNode: (
node: MemberExpression,
scope: Scope,
isWrappedModule: boolean,
) => boolean;
isPlatformSelectNode: (
node: CallExpression,
scope: Scope,
isWrappedModule: boolean,
) => boolean;
};
declare function createInlinePlatformChecks(
t: Types,
requireName?: string,
): PlatformChecks;
export default createInlinePlatformChecks;
+2
-2
{
"name": "metro-transform-plugins",
"version": "0.84.1",
"version": "0.84.2",
"description": "🚇 Transform plugins for Metro.",

@@ -36,3 +36,3 @@ "main": "src/index.js",

"babel-plugin-tester": "^6.0.1",
"metro": "0.84.1"
"metro": "0.84.2"
},

@@ -39,0 +39,0 @@ "engines": {