{"id":15826,"library":"sm-metro-bundler-cli","title":"SM Metro Bundler CLI","description":"sm-metro-bundler-cli is a command-line interface tool designed to customize React Native bundling processes, specifically by adjusting module ID references to use strings instead of incremental numbers. It extends the functionality of the official Metro Bundler CLI. This tool is built upon and specifically compatible with React Native version 0.50.3, a version released in late 2017. Its primary differentiator is the modification of module ID referencing and the inclusion of commands (`init`, `upgrade`, `validate`) for managing project structures based on private templates (`sm-react-native-templates`), indicating a highly specialized use case, likely within a specific organizational context. The current stable version is 1.0.8, and given its reliance on an outdated React Native version, it does not appear to follow a regular release cadence or receive active updates for modern React Native development.","status":"abandoned","version":"1.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/caiwenshu/sm-metro-bundler-cli","tags":["javascript","react-native","metro-bundler","cli"],"install":[{"cmd":"npm install sm-metro-bundler-cli","lang":"bash","label":"npm"},{"cmd":"yarn add sm-metro-bundler-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add sm-metro-bundler-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core JavaScript bundler for React Native that this CLI wraps and extends.","package":"metro","optional":false}],"imports":[],"quickstart":{"code":"npm install --global sm-metro-bundler-cli\n\nsm-metro-bundler bundle  \\\n  --entry-file index.js  \\\n  --bundle-output dist/business.jsbundle  \\\n  --assets-dest dist \\\n  --platform ios  \\\n  --dev false\n\n# Example of using a custom command (template source is private)\nsm-metro-bundler init MyNewProject","lang":"bash","description":"Installs the CLI globally and demonstrates bundling a React Native project and initializing a new project."},"warnings":[{"fix":"Do not use this package for modern React Native projects. Consider using the official Metro CLI or alternative bundlers that support your target React Native version.","message":"This CLI is explicitly built \"Based on React Native 0.50.3\". Using it with newer versions of React Native (e.g., 0.60.x and above) will lead to severe compatibility issues and likely outright failure, as Metro Bundler itself has evolved significantly.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Avoid using the `init`, `upgrade`, or `validate` commands unless you have access to, and are specifically working with, the private template repository. The primary utility for external users is limited to the `bundle` command modifications.","message":"The `init`, `upgrade`, and `validate` commands reference a private repository (`sm-react-native-templates`). These commands are likely non-functional or problematic outside of the original developer's specific corporate environment, leading to unexpected errors or missing templates.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For modern React Native projects, consult the official Metro documentation for current best practices regarding bundle optimization and module ID handling. Consider tools like Expo CLI which integrate and customize Metro effectively.","message":"The modification of module IDs for 'bundle splitting' or 'stable module IDs' as described in the reference `metro-bundler-cli` (which this project builds upon) might be superseded or handled differently in modern Metro Bundler versions. The techniques used here may not be optimal or necessary for current React Native development workflows.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Ensure `metro` and potentially `metro-bundler-cli` are installed either globally or as local dependencies in your project: `npm install --global metro` or `npm install metro`.","cause":"The underlying Metro bundler or the specific `metro-bundler-cli` dependency is not installed or discoverable in the expected path by the `sm-metro-bundler-cli` executable.","error":"Cannot find module 'metro' or 'metro-bundler-cli'"},{"fix":"This package is designed for React Native 0.50.3 projects. For newer React Native versions, use the official `@react-native/community/cli` or directly configure `metro` as appropriate for your version, rather than `sm-metro-bundler-cli`.","cause":"Attempting to use `sm-metro-bundler-cli` with a React Native project that uses a version significantly different from 0.50.3, leading to incompatibility within the bundling process.","error":"Error: React Native version mismatch. Expected 0.50.3 but found X.Y.Z"}],"ecosystem":"npm"}