teambit / bit-angular

Angular support for bit harmony
28 stars 3 forks source link

Update readme to add teambit.angular dependency #36

Closed ashishkrtewari closed 2 years ago

ashishkrtewari commented 2 years ago

What is the Issue

The readme does not recommend users to add the teambit.angular dependency which results in compilation errors.

Suggested Solution

Add

"teambit.dependencies/dependency-resolver": {
    /**
     * choose the package manager for Bit to use. you can choose between 'yarn', 'pnpm'
     */
    "packageManager": "teambit.dependencies/pnpm",
    "policy": {
      "dependencies": {
        "@teambit/angular-v13": "0.0.19"
      },
      "peerDependencies": {}
    },
    "nodeLinker": "hoisted"
  },

to the workspace.jsonc example in readme

ocombe commented 2 years ago

You only need the env as a dependency if you use a custom env, and there will be a new bit command to define an env that will take care of the config for you, so hopefully that should be moot 🙂

ashishkrtewari commented 2 years ago

@ocombe If I just follow the exact steps mentioned in the readme, I face the following error

image

on running

bit start

Are you able to replicate it?

ocombe commented 2 years ago

No, are you using a custom env ?

ashishkrtewari commented 2 years ago

I found what I was doing wrong, I missed adding

// Load the angular-v13 environment into the workspace
"teambit.angular/angular-v13@x.x.x": {},

Shouldn't this be added by default in the workspace.jsonc, along with

"teambit.workspace/variants": {
    "*": {
      "teambit.angular/angular-v13@0.0.19": {}
    }
  },
  "teambit.angular/angular-v13@0.0.19": {},
  "teambit.generator/generator": {
    "aspects": [
      "teambit.angular/angular-v13@0.0.19"
    ]
  }

Anyone using custom env can remove it.

ocombe commented 2 years ago

You are totally right, it should be added by default but there's a bug in the workspace generator, I'm fixing it, thanks !

ocombe commented 2 years ago

Actually I just checked and it's added by default. It's even in the code that you copy pasted just above: image

ashishkrtewari commented 2 years ago

Let me check then what was the issue again.

ashishkrtewari commented 2 years ago

@ocombe Closing this as I am no longer able to replicate the issue, probably I made a mistake while setup. Thanks for your time.

ocombe commented 2 years ago

Don't forget that with custom envs you need to run compile after each change to make sure that it applies to your components (or use bit watch)