Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jack
    @jackguoAtJogg
    @itaymendel_twitter I have updated to 3.1.13 and still getting the same error when building
    Rinse Ringma
    @rinseringma_twitter
    @amitgilad3 So I see! Many thanks guys!
    Simon Dahlberg
    @thezic

    Hi!

    I have a question about reusing components, using the bit client.
    Let's say I have a project, where i bit init and then bit import ... a component.

    After that I push this project to a git repo. I include only my code using the component, .bitmap and package.json, which retain the workspace configuration. I left out the components directory, as specified in documentation under "Best practices".

    I now try to clone this project and get it up and running.
    As I understand, when I run bit import in the cloned repo, all components should be made available. But I see no components directory is created, so I can't use the components unless I bit import every component by it self again.

    What am I doing wrong?

    itay mendelawy
    @itaymendel_twitter
    hi @thezic when you clone the project to a new dir and run bit init && bit import Bit does not import the components correctly? is there any error prompted?
    Simon Dahlberg
    @thezic
    No, I Don't ger any errors

    bit status gives me the error that "component files were deleted".

    But I guess that is to be expected, as I don't have a component directory

    Simon Dahlberg
    @thezic

    @itaymendel_twitter I see now that this is the default behaviour for bit import without giving any ids. It just imports component objects, but don't write anything to the file system.

    Then I wonder, what would be the correct way to do this without committing the components directory?

    Thank you for your help! :)

    itay mendelawy
    @itaymendel_twitter
    i think there's a mistake in the best-practices... i'll see about it asap.
    but if you use bit import its best to keep the components folder in git.
    Simon Dahlberg
    @thezic

    I see, so the best way would be to use npm.

    Thank you, I think I have an idea on what I have to do next

    itay mendelawy
    @itaymendel_twitter
    This message was deleted
    Simon Dahlberg
    @thezic
    How would I register an extension to to a remote created with bit init --bare ?
    Gilad Shoham
    @GiladShoham
    @thezic what extension do you want to register?
    Simon Dahlberg
    @thezic
    @GiladShoham anyone, acually. When I try running the bit import ... --extension command inside such a remote, I only get a message telling my it's not a workspace.
    ~/d/c/t/bit-remote ❯❯❯ bit init --bare
    successfully initialized an empty bare bit scope.
    ~/d/c/t/bit-remote ❯❯❯ bit import
    workspace not found. to initiate a new workspace, please use `bit init`
    ~/d/c/t/bit-remote ❯❯❯
    I'm trying to figure out how to publish a npm package when a component is updated
    Gilad Shoham
    @GiladShoham
    there is a way to configure it, it's not documented because it's not finalized and it might break in the future. I'll explain to you how to do it. I would really want to learn which kind of extensions you want to run in the remote server. if you can share your use case it will be great.
    first, you should probably want to look on this extension (we use it internally to do the same for our registry) - https://bit.dev/bit/extensions/npm/pack
    we also use this - https://bit.dev/bit/extensions/defaults/webhooks to trigger the other one on export
    Simon Dahlberg
    @thezic
    Thank you, that is exacly what I'm looking for.
    I did laborate with the npm/pack extension. But I havn't been able to get it running yet
    Gilad Shoham
    @GiladShoham
    in order to configure it, you should configure it in a global bit.json that bit's loads always.
    Simon Dahlberg
    @thezic
    ok! which search pathes does bit use?
    Gilad Shoham
    @GiladShoham

    on our server, we import the webhook extension to some folder (doesn't really matter where)
    bit import bit.extensions/defaults/webhooks@0.2.1 --extension
    than we configure the global bit.json like this

    {
        "extensions": {
            "bit.extensions/defaults/webhooks@0.2.1": {
                "config": {
                    "publisherBaseUrl": "some url"
                },
                "options": {
                    "file": "path to imported location/components/defaults/webhooks/bit.extensions/0.2.1/index.js"
                }
            }
        }
    }

    the global bit.json is located at
    /root/Library/Caches/Bit/config/bit.json
    (assuming it's a linux machine) - it might not be existing, you can create it
    then run some operation (can bit a bit list against the remote) and look on the logs in the server to check if the extension loaded correctly

    the npm pack is configured in a similar way, and it adds a new command to bit called bit npm-pack which creates the tar file
    Simon Dahlberg
    @thezic
    Thank you! I will try this! :)
    Gilad Shoham
    @GiladShoham
    keep in mind that by default bit scoping any component package with @bit. but you can change it.
    you can see an example (it's not documented as well since it's not fully tested)
    https://github.com/teambit/bit/blob/060ae2f58226637ee5ed96342b5edf2e464c7a6c/e2e/npm-ci-registry.ts
    this is taken from bit e2e tests, where we run our own registry with different scope name
    @thezic let me know if you need any more help, it might be a bit tricky.
    Also would be really like to hear your story when you success:)
    Simon Dahlberg
    @thezic
    Thank you, I really appreciate your help! I'll test this and try to tell the outcome :)
    tehpud
    @tehpud
    Hi everyone! I'm trying to find a design file for the components in this library. Is there an existing SKETCH file I can give to my designer? They were unable to track one down. Many thanks!
    denis-zenkovich
    @denis-zenkovich
    Hi guys, where do I find bit.log? Need to debug this: "error found while resolving the file dependencies (see the log for the full error)"
    oh my, bit's compiler fails for fragment shortcut - "<></>". That was it.
    Jack
    @jackguoAtJogg

    image.png

    Anyone else is having this issue?

    Tally Barak
    @Tallyb
    @denis-zenkovich https://docs.bit.dev/docs/workspace#logs. which compiler do you use?
    Taha Hassan Mujaddadi
    @Mujaddadi
    hi, I am getting this error your workspace has outdated objects. please use "bit import" to pull the latest objects from the remote scope.
    but when I do bit import I get error: component "fc.lib/ui/label@0.0.1" was not found
    It seems the component don't exist. How do I remove bit from monitoring it?
    by the way bit list gives me
    `$ bit list
    • listing components
      found 0 components in local scope
      `
    Taha Hassan Mujaddadi
    @Mujaddadi
    Never mind. I just removed the .bitmap file
    denis-zenkovich
    @denis-zenkovich
    @Tallyb Thanks! Compiler was React
    Diego Cáceres
    @diego-caceres
    Hi there, does anyone know if there's a compiler for React, with ES6 and Flow?
    Because I have tried the React Compiler, but the build fails with an error about 'import' words.. but if I use babel compiler it fails about jsx.. and the flow compiler fails awfully
    Tally Barak
    @Tallyb
    @diego-caceres https://bit.dev/bit/envs/compilers/flow in latest version does not work?
    Diego Cáceres
    @diego-caceres

    It fails in a normal JSX prop..
    error: bit failed to build button with the following exception:
    unknown: Unexpected token, expected "," (14:4)

    12 | export const primary = () => (
    13 |   <Button

    14 | disabled={boolean('Disabled', false)}
    | ^
    15 | block={boolean('Block', false)}
    16 | >

    Tally Barak
    @Tallyb
    Can you comapre your local babelrc to the configuration here: https://bit.dev/bit/envs/compilers/flow/~code#compilers/flow/.babelrc
    Diego Cáceres
    @diego-caceres
    yep, it is different. I have more presets that are not present there, like "@babel/preset-react"
    This means I need to create a custom compiler?
    Tally Barak
    @Tallyb
    yes, you need to create your own compiler. Anyway - can you open an issue here https://github.com/teambit/envs with the missing plugins? we will look into upgrading this compiler.
    Diego Cáceres
    @diego-caceres
    Ok, I'll first try to create a working compiler to make sure what would be missing in the current one
    Tally Barak
    @Tallyb
    It would be good to have the list of such plugins anyway...
    Diego Cáceres
    @diego-caceres

    My current babelrc file lists: "presets": ["flow", "@babel/preset-flow", "@babel/preset-env", "@babel/preset-react"] whereas the flow compiler lists: "presets": ["@babel/preset-env","@babel/preset-flow"],

    But since I am new to Bit, I am still not sure that this will be fixed only by changing the presets.

    Diego Cáceres
    @diego-caceres
    Well, it seems the "flow" preset was not needed, I created a new compiler only adding the preset "@babel/preset-react" and it seems to have worked in the build!
    https://bit.dev/diego-caceres/compilers/compilers/flow
    I'll open the issue
    Thanks!