first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

27
node_modules/metro-minify-terser/package.json generated vendored Normal file
View File

@@ -0,0 +1,27 @@
{
"name": "metro-minify-terser",
"version": "0.83.3",
"description": "🚇 Minifier for Metro based on Terser.",
"main": "src/index.js",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json",
"./private/*": "./src/*.js"
},
"repository": {
"type": "git",
"url": "git@github.com:facebook/metro.git"
},
"scripts": {
"prepare-release": "test -d build && rm -rf src.real && mv src src.real && mv build src",
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
},
"license": "MIT",
"dependencies": {
"flow-enums-runtime": "^0.0.6",
"terser": "^5.15.0"
},
"engines": {
"node": ">=20.19.4"
}
}

7
node_modules/metro-minify-terser/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
var _minifier = _interopRequireDefault(require("./minifier"));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : { default: e };
}
module.exports = _minifier.default;

16
node_modules/metro-minify-terser/src/index.js.flow generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* 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.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import minifier from './minifier';
// CommonJS export for backwards compatibility
// eslint-disable-next-line import/no-commonjs
module.exports = minifier;

54
node_modules/metro-minify-terser/src/minifier.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = minifier;
var _terser = _interopRequireDefault(require("terser"));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : { default: e };
}
async function minifier(options) {
const result = await minify(options);
if (!options.map || result.map == null) {
return {
code: result.code,
};
}
const map = JSON.parse(result.map);
return {
code: result.code,
map: {
...map,
sources: [options.filename],
},
};
}
async function minify({ code, map, reserved, config }) {
const options = {
...config,
output: {
...(config.output ?? {}),
},
mangle:
config.mangle === false
? false
: {
...config.mangle,
reserved,
},
sourceMap: map
? config.sourceMap === false
? false
: {
...config.sourceMap,
content: map,
}
: false,
};
const result = await _terser.default.minify(code, options);
return {
code: result.code,
map: result.map,
};
}

70
node_modules/metro-minify-terser/src/minifier.js.flow generated vendored Normal file
View File

@@ -0,0 +1,70 @@
/**
* 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.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {BasicSourceMap} from 'metro-source-map';
import type {MinifierOptions, MinifierResult} from 'metro-transform-worker';
import terser from 'terser';
export default async function minifier(
options: MinifierOptions,
): Promise<MinifierResult> {
const result = await minify(options);
if (!options.map || result.map == null) {
return {code: result.code};
}
const map: BasicSourceMap = JSON.parse(result.map);
return {code: result.code, map: {...map, sources: [options.filename]}};
}
async function minify({
code,
map,
reserved,
config,
}: MinifierOptions): Promise<{code: string, map: ?string}> {
const options = {
...config,
output: {
// Mitigate https://github.com/terser/terser/issues/1341 - Terser may
// set its internal data on this object, so give it a shallow copy.
...(config.output ?? {}),
},
mangle:
config.mangle === false
? false
: {
...config.mangle,
reserved,
},
sourceMap: map
? config.sourceMap === false
? false
: {
...config.sourceMap,
content: map,
}
: false,
};
/* $FlowFixMe[incompatible-type](>=0.111.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.111 was deployed. To see the error, delete this
* comment and run Flow. */
const result = await terser.minify(code, options);
return {
code: result.code,
map: result.map,
};
}