Giter Site home page Giter Site logo

Comments (7)

dmytrorykun avatar dmytrorykun commented on July 3, 2024 1

This is definitely a bug. I'll take a look

from react-native.

cortinico avatar cortinico commented on July 3, 2024

This is (sadly) a known bug. The issue is happening regardless of you using includesGeneratedCode or not.

I have an internal ticket to work on this.
Sadly fixing it would be a breaking change for every codegen user so we're being a bit caution on when we should fix.

from react-native.

mfazekas avatar mfazekas commented on July 3, 2024

@cortinico thanks much.

Another issue is that outputDir is not relative to package root, but to cwd. So in the reproducer if run:

cd ReproducerApp
npx react-native codegen --path ../RTNCalculator --platform android

it generates into ./android/codegen which is ReproducerApp/android/codegen instead of ../RTNCalculator/android/codegen.

RTNCalculator/package.json:

    "includesGeneratedCode": true,
    "outputDir": {
      "android": "android/codegen"
    }

Is this a bug? Shall I open a separate issue for it?

from react-native.

cortinico avatar cortinico commented on July 3, 2024

it generates into ./android/codegen which is ReproducerApp/android/codegen instead of ../RTNCalculator/android/codegen.

mmm I'm not sure this follows to your previous statement.
If as you said, the path is relative to cwd (being ./ReproducerApp in your example), then stuff should be generated inside:

./RTNCalculator/android/codegen

no?

from react-native.

mfazekas avatar mfazekas commented on July 3, 2024

mmm I'm not sure this follows to your previous statement. If as you said, the path is relative to cwd (being ./ReproducerApp in your example), then stuff should be generated inside:

./RTNCalculator/android/codegen

no?

Sorry if I wasn't clear. I'd expect

"includesGeneratedCode": true,
    "outputDir": {
      "android": "android/codegen"
    }

to always generate into RTNCaclulator/android/codegen so always into the lib, but if I run from the app directory it creates new folder in the app

cd ReproducerApp
npx react-native codegen --path ../RTNCalculator --platform android

it generates into ReproducerApp/android/codegen

ReproducerApp % ls -la android/codegen/java/com/rtncalculator 
total 8
drwxr-xr-x  3 boga  staff    96 Jun 20 14:24 .
drwxr-xr-x  4 boga  staff   128 Jun 20 14:24 ..
-rw-r--r--  1 boga  staff  1130 Jun 20 14:24 NativeRTNCalculatorSpec.java

from react-native.

cortinico avatar cortinico commented on July 3, 2024

@dmytrorykun can help you more here as he implemented the react-native codegen command. But yes this is probably a separate bug which needs a separate issue

from react-native.

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.