Git Product home page Git Product logo

Comments (4)

nathansebhastian avatar nathansebhastian commented on June 7, 2024 1

Hello,

Yeah, I see the bug has been fixed now. Thanks for the quick response!

By the way, I also wrote an article about Agrippa here:

https://blog.bitsrc.io/create-react-components-from-the-command-line-with-agrippa-621a6f4d19e8

I hope more people know about this tool because it's very useful 👍

from agrippa.

nathansebhastian avatar nathansebhastian commented on June 7, 2024

Hi @nitzanhen

I just did a further debug with the --debug option and it seems --typescript option is set to true even when tsconfig.json is not found.

Take a look at the following output from the --debug command:

agrippa gen button --debug true
[DEBUG]: Agrippa v1.1.0
[DEBUG]: Looking for tsconfig.json...
[DEBUG]: Looking for .agripparc.json...
[DEBUG]: Looking for .package.json...
_[DEBUG]: No tsconfig.js found._
[DEBUG]: .agripparc.json found!
[DEBUG]: path: /Users/nsebhastian/Desktop/Sandbox/example-app/.agripparc.json
[DEBUG]: config: { styling: 'css', props: 'none' }
[DEBUG]: package.json found!
[DEBUG]: path: /Users/nsebhastian/Desktop/Sandbox/example-app/package.json
[DEBUG]: content: {
  name: 'example-app',
  version: '0.1.0',
  private: true,
  dependencies: {
    '@testing-library/jest-dom': '^5.11.4',
    '@testing-library/react': '^11.1.0',
    '@testing-library/user-event': '^12.1.10',
    react: '^17.0.2',
    'react-dom': '^17.0.2',
    'react-scripts': '4.0.3',
    'web-vitals': '^1.0.1'
  },
  scripts: {
    start: 'react-scripts start',
    build: 'react-scripts build',
    test: 'react-scripts test',
    eject: 'react-scripts eject'
  },
  eslintConfig: { extends: [ 'react-app', 'react-app/jest' ] },
  browserslist: {
    production: [ '>0.2%', 'not dead', 'not op_mini all' ],
    development: [
      'last 1 chrome version',
      'last 1 firefox version',
      'last 1 safari version'
    ]
  }
}
[DEBUG]: baseDir option, before resolving, is undefined
[DEBUG]: No baseDir specified, resolving relative to cwd
[DEBUG]: Generating component...
[DEBUG]: config: {
  name: 'button',
  debug: true,
  styling: 'css',
  props: 'none',
  children: false,
  _typescript: true,_
  flat: false,
  overwrite: false,
  destination: '.',
  stylingModule: true,
  importReact: true,
  postCommand: undefined,
  baseDir: '/Users/nsebhastian/Desktop/Sandbox/example-app/src',
  allowOutsideBase: false
}

As you can see, the output says No tsconfig.js found but typescript: true just below the Generating component... line

from agrippa.

nitzanhen avatar nitzanhen commented on June 7, 2024

(I closed this by mistake, sorry.)

Thank you for reporting this awkward bug! You're most correct, if a tsconfig.json file is not found, the project is assumed to be Javascript by default, and jsx files should be generated.

This should be fixed in v1.1.1; I fixed two other, small bugs along the way. Please test it out!

Also, your included debug output sent me in the right direction, so thanks again!

from agrippa.

nitzanhen avatar nitzanhen commented on June 7, 2024

Your article is great! Thank you for writing about Agrippa!

from agrippa.

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.