Code Monkey home page Code Monkey logo

swiftyripgrep's Introduction

SwiftyRipgrep

SwiftyRipgrep Platform iOS Badge macOS Badge

This repository contains a Swift package that wraps ripgrep to be used programmatically in iOS (device and simulator) and macOS.

Usage

SwiftyRipgrep is distributed as a Swift Package. All you need to do is to add the dependency to your project through Xcode or in the Package.swift of your package:

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/tuist/SwiftyRipgrep.git", from: "13.0.0")
    ],
    ...
)

Version: The version of SwiftyRipgrep aligns with the version of Ripgrep wrapped so version 13.0.0 indicates that the Swift package is using the same version of Ripgrep.

Development

System dependencies

We recommend the usage of asdf to install the dependencies necessary to contribute to this project:

Generate the Swift Package

The project uses swift-bridge, a Rust tool that leverages macros and other build-time tools to generate the Swift Package from the Rust code. If you change the Rust code or update Cargo dependencies you'll have to run bin/generate.rb. The script will update the Package.swift and the content under Sources and generate a RustXcframework.xcframework directory at the root.

Testing the generated Swift package

The repository contains a Swift package under fixture that contains a tests target to test the public interface of the SwiftyRipgrep package generated at the root. You can run the tests by running swift test --package-path ./fixture

References

swiftyripgrep's People

Contributors

pepicrft avatar renovate[bot] avatar

Stargazers

Diego Pasquali avatar Roman avatar Dan Hart avatar Manuel Sánchez avatar Mark Anderson avatar adamz avatar Roman Podymov avatar Ivan Glushko avatar Tim Kersey avatar Marcin Krzyzanowski avatar  avatar Aidar Nugmanoff avatar

Watchers

 avatar

swiftyripgrep's Issues

Set up CI

Due to the lack of a CI process set up, we can't ship changes with the confidence that things are not breaking. Therefore, we should set up a CI pipeline that:

  • Ensures that the generate.rb scripts works as expected
  • That the packages at the root and under fixture build successfully and the tests pass.

Note that's important that we test against the minimum Swift version supported.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

asdf
.tool-versions
  • ruby 3.2.0
bundler
Gemfile
  • toml "~> 0.3.0"
  • rainbow "~> 3.1"
  • debug "~> 1.7"
cargo
Cargo.toml
  • grep 0.2
  • swift-bridge 0.1
  • ripgrep 13.0.0
  • swift-bridge-build 0.1
github-actions
.github/workflows/SwiftyRipgrep.yml
  • actions/checkout v1

  • Check this box to trigger a request for Renovate to run again on this repository

Fix logic in `generate.rb` to make all the generated code private

We have a generate script that uses swift-bridge to generate the Swift package from the Rust code. This package makes everything public by default leaking internal Rust-specific types. Since we don't want that, we extended the workflow to make everything private after the generation, but that's too strict because Swift expects some conformances to be public.

The goal of this task is to adjust that logic to only make private what needs to be private.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.