Skip to content

repack-init v1.0.2

Choose a tag to compare

@RafikiTiki RafikiTiki released this 22 May 17:55
· 587 commits to main since this release

Introducing @callstack/repack-init, which helps you setup RePack in your project in seconds!

After a few initial problems with release it's finally here!

Summary

repack-init is a utility npm package that automates the process of integrating the Repack bundler into React Native projects.

Here's a summary of the functionality repack-init provides:

  • Package Manager Detection: Identifies the package manager (npm or yarn) being used in the project.
  • React Native Verification: Checks whether React Native is installed in the project, and what version is being used.
  • Dependency Addition: Utilizes the established package manager to add necessary dependencies to the React-Native project.
  • Configuration of React Native Config: Checks for the existence of react-native.config.js and adds or modifies the necessary fields (commands).
  • Webpack Configuration: Creates and configures webpack.config.js based on user-provided flags (--mjs or --cjs).
  • iOS Modification: Updates the project.pbxproj file in the iOS directory.
  • Android Modification: Updates the build.gradle file in the Android directory based on specific React Native version requirements.

This tool aims to simplify the setup of Repack in React Native projects, ensuring developers can quickly start using Repack's features.

Limitations:

Minimum required node version: 16

Usage

Usage: @callstack/repack-init [options]

Options:
  -e, --entry    Path to main entry point for the React-Native project
                                                  [string] [default: "index.js"]
  -f, --format   Format of the webpack.config file
                               [string] [choices: "mjs", "cjs"] [default: "mjs"]
  -v, --verbose  Enables verbose logging              [boolean] [default: false]
      --version  Show version number                                   [boolean]
      --help     Show help                                             [boolean]

Example outputs

✔  Dependencies installed
✔  Created webpack.config.mjs from template
✔  Created react-native.config.js
✔  Added "webpack-bundle" as bundleCommand to android/app/build.gradle
✔  Added "webpack-bundle" as BUNDLE_COMMAND to build phase shellScript in ios/test1.xcodeproj/project.pbxproj

🎉 Setup complete. Thanks for using Re.Pack!

1.0.2

Patch Changes

  • Build the package properly before publishing to npm 🤦

1.0.1

Patch Changes

1.0.0

Major Changes

  • #356 17faa69 Thanks @jbroma! - Introducing @callstack/repack-init, which helps you setup RePack in your project in seconds!

    Usage:

    npx @callstack/repack-init