@react-native-community/cli-plugin-metro
Advanced tools
Comparing version 12.0.0-alpha.4 to 12.0.0-alpha.5
@@ -17,5 +17,5 @@ "use strict"; | ||
} | ||
function _fsExtra() { | ||
const data = _interopRequireDefault(require("fs-extra")); | ||
_fsExtra = function () { | ||
function _fs() { | ||
const data = _interopRequireDefault(require("fs")); | ||
_fs = function () { | ||
return data; | ||
@@ -36,5 +36,5 @@ }; | ||
function cleanAssetCatalog(catalogDir) { | ||
const files = _fsExtra().default.readdirSync(catalogDir).filter(file => file.endsWith('.imageset')); | ||
const files = _fs().default.readdirSync(catalogDir).filter(file => file.endsWith('.imageset')); | ||
for (const file of files) { | ||
_fsExtra().default.removeSync(_path().default.join(catalogDir, file)); | ||
_fs().default.rmSync(_path().default.join(catalogDir, file)); | ||
} | ||
@@ -60,8 +60,10 @@ } | ||
function writeImageSet(imageSet) { | ||
_fsExtra().default.mkdirsSync(imageSet.basePath); | ||
_fs().default.mkdirSync(imageSet.basePath, { | ||
recursive: true | ||
}); | ||
for (const file of imageSet.files) { | ||
const dest = _path().default.join(imageSet.basePath, file.name); | ||
_fsExtra().default.copyFileSync(file.src, dest); | ||
_fs().default.copyFileSync(file.src, dest); | ||
} | ||
_fsExtra().default.writeJSONSync(_path().default.join(imageSet.basePath, 'Contents.json'), { | ||
_fs().default.writeFileSync(_path().default.join(imageSet.basePath, 'Contents.json'), JSON.stringify({ | ||
images: imageSet.files.map(file => ({ | ||
@@ -76,5 +78,5 @@ filename: file.name, | ||
} | ||
}); | ||
})); | ||
} | ||
//# sourceMappingURL=assetCatalogIOS.ts.map |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
declare const outputBundle: any; | ||
import outputBundle from 'metro/src/shared/output/bundle'; | ||
import type { ConfigT } from 'metro-config'; | ||
@@ -11,0 +11,0 @@ import { CommandLineArgs } from './bundleCommandLineArgs'; |
@@ -15,2 +15,9 @@ "use strict"; | ||
} | ||
function _bundle() { | ||
const data = _interopRequireDefault(require("metro/src/shared/output/bundle")); | ||
_bundle = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _path() { | ||
@@ -48,5 +55,3 @@ const data = _interopRequireDefault(require("path")); | ||
// @ts-ignore - no typed definition for the package | ||
const outputBundle = require('metro/src/shared/output/bundle'); | ||
async function buildBundle(args, ctx, output = outputBundle) { | ||
async function buildBundle(args, ctx, output = _bundle().default) { | ||
const config = await (0, _loadMetroConfig.default)(ctx, { | ||
@@ -65,3 +70,3 @@ maxWorkers: args.maxWorkers, | ||
*/ | ||
async function buildBundleWithConfig(args, config, output = outputBundle) { | ||
async function buildBundleWithConfig(args, config, output = _bundle().default) { | ||
if (config.resolver.platforms.indexOf(args.platform) === -1) { | ||
@@ -86,4 +91,3 @@ _cliTools().logger.error(`Invalid platform ${args.platform ? `"${_chalk().default.bold(args.platform)}" ` : ''}selected.`); | ||
platform: args.platform, | ||
unstable_transformProfile: args.unstableTransformProfile, | ||
generateStaticViewConfigs: args.generateStaticViewConfigs | ||
unstable_transformProfile: args.unstableTransformProfile | ||
}; | ||
@@ -90,0 +94,0 @@ const server = new (_Server().default)(config); |
@@ -20,3 +20,3 @@ /** | ||
bundleOutput: string; | ||
bundleEncoding?: string; | ||
bundleEncoding?: 'utf8' | 'utf16le' | 'ascii'; | ||
maxWorkers?: number; | ||
@@ -28,3 +28,2 @@ sourcemapOutput?: string; | ||
unstableTransformProfile: string; | ||
generateStaticViewConfigs: boolean; | ||
} | ||
@@ -31,0 +30,0 @@ declare const _default: ({ |
@@ -84,6 +84,2 @@ "use strict"; | ||
parse: val => _path().default.resolve(val) | ||
}, { | ||
name: '--generate-static-view-configs', | ||
description: 'Generate static view configs for Fabric components. ' + 'If there are no Fabric components in the bundle or Fabric is disabled, this is just no-op.', | ||
default: true | ||
}]; | ||
@@ -90,0 +86,0 @@ exports.default = _default; |
@@ -52,4 +52,2 @@ "use strict"; | ||
// @ts-ignore untyped metro | ||
async function runServer(_argv, ctx, args) { | ||
@@ -56,0 +54,0 @@ let reportEvent; |
@@ -43,10 +43,13 @@ "use strict"; | ||
const outOfTreePlatforms = Object.keys(ctx.platforms).filter(platform => ctx.platforms[platform].npmPackageName); | ||
const resolver = { | ||
platforms: [...Object.keys(ctx.platforms), 'native'] | ||
}; | ||
if (outOfTreePlatforms.length) { | ||
resolver.resolveRequest = (0, _metroPlatformResolver.reactNativePlatformResolver)(outOfTreePlatforms.reduce((result, platform) => { | ||
result[platform] = ctx.platforms[platform].npmPackageName; | ||
return result; | ||
}, {})); | ||
} | ||
return { | ||
resolver: { | ||
resolveRequest: outOfTreePlatforms.length === 0 ? undefined : (0, _metroPlatformResolver.reactNativePlatformResolver)(outOfTreePlatforms.reduce((result, platform) => { | ||
result[platform] = ctx.platforms[platform].npmPackageName; | ||
return result; | ||
}, {})), | ||
platforms: [...Object.keys(ctx.platforms), 'native'] | ||
}, | ||
resolver, | ||
serializer: { | ||
@@ -53,0 +56,0 @@ // We can include multiple copies of InitializeCore here because metro will |
{ | ||
"name": "@react-native-community/cli-plugin-metro", | ||
"version": "12.0.0-alpha.4", | ||
"version": "12.0.0-alpha.5", | ||
"license": "MIT", | ||
@@ -10,4 +10,4 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@react-native-community/cli-server-api": "12.0.0-alpha.4", | ||
"@react-native-community/cli-tools": "12.0.0-alpha.4", | ||
"@react-native-community/cli-server-api": "12.0.0-alpha.5", | ||
"@react-native-community/cli-tools": "12.0.0-alpha.5", | ||
"chalk": "^4.1.2", | ||
@@ -24,3 +24,3 @@ "execa": "^5.0.0", | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "12.0.0-alpha.4" | ||
"@react-native-community/cli-types": "12.0.0-alpha.5" | ||
}, | ||
@@ -31,3 +31,3 @@ "files": [ | ||
], | ||
"homepage": "https://github.com/react-native-community/cli/tree/master/packages/cli-plugin-metro", | ||
"homepage": "https://github.com/react-native-community/cli/tree/main/packages/cli-plugin-metro", | ||
"repository": { | ||
@@ -38,3 +38,3 @@ "type": "git", | ||
}, | ||
"gitHead": "bd0963dbe23b079b50dd2b07f80f305b3bc92f3a" | ||
"gitHead": "3569633e1bbda4858195feb8537d7b9969b2040e" | ||
} |
@@ -162,3 +162,3 @@ # @react-native-community/cli-plugin-metro | ||
If you are planning on building a debug APK that will run without the packager, see ([--bundle-output](https://github.com/react-native-community/cli/blob/master/docs/commands.md#--bundle-output-string)) | ||
If you are planning on building a debug APK that will run without the packager, see ([--bundle-output](https://github.com/react-native-community/cli/blob/main/packages/cli-plugin-metro/README.md#--bundle-output-string)) | ||
@@ -165,0 +165,0 @@ <details> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No website
QualityPackage does not have a website.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1871
157629
+ Added@react-native-community/cli-debugger-ui@12.0.0-alpha.5(transitive)
+ Added@react-native-community/cli-server-api@12.0.0-alpha.5(transitive)
+ Added@react-native-community/cli-tools@12.0.0-alpha.5(transitive)
- Removed@react-native-community/cli-debugger-ui@12.0.0-alpha.4(transitive)
- Removed@react-native-community/cli-server-api@12.0.0-alpha.4(transitive)
- Removed@react-native-community/cli-tools@12.0.0-alpha.4(transitive)
Updated@react-native-community/cli-server-api@12.0.0-alpha.5