Giter VIP home page Giter VIP logo

Comments (4)

rebello95 avatar rebello95 commented on June 28, 2024

👋🏽 @ivanvanderbyl, thanks for filing this issue. The example from the docs doesn't make any assumptions about how consumers modularize generated sources since that decision typically varies by project. Instead, it assumes all generated sources live in the same module. It sounds like you are trying to place mocks in a separate module from the production sources - can you share your module structure?

Also, Buf's Generated SDKs solve this problem automatically through Swift Package Manager if you're interested in checking that out: https://buf.build/solutions/generate-sdks

from connect-swift.

ivanvanderbyl avatar ivanvanderbyl commented on June 28, 2024

@rebello95 thanks for the quick reply. I am using Buf's generated SDKs, so they are naturally in a separate module. Here's the output of my generated code from BSR:

import Connect
import ConnectMocks
import Foundation
import Ivandev_ObservablePipeline_Apple_Swift
import SwiftProtobuf

    /// Mock implementation of `Scanner_V1alpha1_ScannerServiceClientInterface`.
@available(iOS 13, *)
open class ScannerServiceClientMock: Scanner_V1alpha1_ScannerServiceClientInterface, @unchecked Sendable {

It should be importing Ivandev_ObservablePipeline_Connectrpc_Swift as well as the Apple Swift mocks.

from connect-swift.

rebello95 avatar rebello95 commented on June 28, 2024

Thanks for the info. That should work, so I'm wondering if there was a regression on the Buf side. Can you please ask this question in the Buf Slack? Someone should be able to help debug more there: https://buf.build/links/slack

from connect-swift.

rebello95 avatar rebello95 commented on June 28, 2024

Looks like this is resolved by bufbuild/plugins#1140

from connect-swift.

Related Issues (20)

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.