Skip to content

Commit

Permalink
fix(plugin): adjust add-soba generator to make sure all peer deps are…
Browse files Browse the repository at this point in the history
… installed properly
  • Loading branch information
nartc committed Aug 13, 2024
1 parent d97d48d commit caf58a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libs/plugin/src/generators/add-soba/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { SOBA_PEER_DEPENDENCIES } from '../version';
const ENTRY_POINTS = {
abstractions: ['troika-three-text'],
controls: ['camera-controls', 'maath'],
materials: ['three-custom-shader-material', 'three-mesh-bvh'],
materials: ['three-custom-shader-material'],
staging: ['troika-three-text', '@monogrid/gainmap-js'],
stats: ['stats-gl'],
};

export async function addSobaGenerator(tree: Tree) {
const packagesToAdd = ['three-stdlib', '@pmndrs/vanilla'];
const packagesToAdd = ['three-stdlib', '@pmndrs/vanilla', 'three-mesh-bvh'];

const packageJson = readJson(tree, 'package.json');
const ngtVersion = packageJson['dependencies']['angular-three'] || packageJson['devDependencies']['angular-three'];
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function addSobaGenerator(tree: Tree) {
}
return acc;
},
{} as Record<string, string>,
{ 'angular-three-soba': ngtVersion } as Record<string, string>,
);

// add deps to package.json
Expand Down
7 changes: 4 additions & 3 deletions libs/soba/abstractions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ This module provides abstract components and patterns for building reusable and
| Package | Description |
| ------------------- | -------------------------------------------- |
| `troika-three-text` | Required for using the `NgtsText` component. |
| `three-mesh-bvh` | Required for `angular-three-soba/shaders` |

To install these dependencies, use one of the following commands:

```bash
npm install troika-three-text
# yarn add troika-three-text
# pnpm add troika-three-text
npm install troika-three-text three-mesh-bvh
# yarn add troika-three-text three-mesh-bvh
# pnpm add troika-three-text three-mesh-bvh
```

## TOC
Expand Down

0 comments on commit caf58a6

Please sign in to comment.