Skip to content

Commit

Permalink
feat(core): support pnpm with new parsing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Jan 3, 2023
1 parent 7da33cc commit 94db30c
Show file tree
Hide file tree
Showing 22 changed files with 6,101 additions and 495 deletions.
2,424 changes: 2,424 additions & 0 deletions docs/generated/devkit/index.md

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions docs/generated/devkit/ngcli_adapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Module: ngcli-adapter

## Table of contents

### Ng CLI Adapter Classes

- [NxScopedHost](../../devkit/documents/ngcli_adapter#nxscopedhost)

### Functions

- [mockSchematicsForTesting](../../devkit/documents/ngcli_adapter#mockschematicsfortesting)
- [overrideCollectionResolutionForTesting](../../devkit/documents/ngcli_adapter#overridecollectionresolutionfortesting)
- [wrapAngularDevkitSchematic](../../devkit/documents/ngcli_adapter#wrapangulardevkitschematic)

## Ng CLI Adapter Classes

### NxScopedHost

**NxScopedHost**: `Object`

## Functions

### mockSchematicsForTesting

**mockSchematicsForTesting**(`schematics`): `void`

If you have an Nx Devkit generator invoking the wrapped Angular Devkit schematic,
and you don't want the Angular Devkit schematic to run, you can mock it up using this function.

Unfortunately, there are some edge cases in the Nx-Angular devkit integration that
can be seen in the unit tests context. This function is useful for handling that as well.

In this case, you can mock it up.

Example:

```typescript
mockSchematicsForTesting({
'mycollection:myschematic': (tree, params) => {
tree.write('README.md');
},
});
```

#### Parameters

| Name | Type |
| :----------- | :------- |
| `schematics` | `Object` |

#### Returns

`void`

---

### overrideCollectionResolutionForTesting

**overrideCollectionResolutionForTesting**(`collections`): `void`

By default, Angular Devkit schematic collections will be resolved using the Node resolution.
This doesn't work if you are testing schematics that refer to other schematics in the
same repo.

This function can can be used to override the resolution behaviour.

Example:

```typescript
overrideCollectionResolutionForTesting({
'@nrwl/workspace': path.join(
__dirname,
'../../../../workspace/generators.json'
),
'@nrwl/angular': path.join(__dirname, '../../../../angular/generators.json'),
'@nrwl/linter': path.join(__dirname, '../../../../linter/generators.json'),
});
```

#### Parameters

| Name | Type |
| :------------ | :------- |
| `collections` | `Object` |

#### Returns

`void`

---

### wrapAngularDevkitSchematic

**wrapAngularDevkitSchematic**(`collectionName`, `generatorName`): (`host`: [`Tree`](../../devkit/documents/index#tree), `generatorOptions`: { [k: string]: `any`; }) => `Promise`<`any`\>

#### Parameters

| Name | Type |
| :--------------- | :------- |
| `collectionName` | `string` |
| `generatorName` | `string` |

#### Returns

`fn`

▸ (`host`, `generatorOptions`): `Promise`<`any`\>

##### Parameters

| Name | Type |
| :----------------- | :------------------------------------------ |
| `host` | [`Tree`](../../devkit/documents/index#tree) |
| `generatorOptions` | `Object` |

##### Returns

`Promise`<`any`\>
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@ngrx/router-store": "~15.0.0",
"@ngrx/store": "~15.0.0",
"@nguniversal/builders": "~15.0.0",
"@npmcli/arborist": "^6.1.5",
"@nrwl/cypress": "15.4.0",
"@nrwl/devkit": "15.4.0",
"@nrwl/eslint-plugin-nx": "15.4.0",
Expand All @@ -70,6 +69,7 @@
"@parcel/watcher": "2.0.4",
"@phenomnomnominal/tsquery": "4.1.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@pnpm/lockfile-types": "^4.3.6",
"@reduxjs/toolkit": "1.9.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
Expand Down Expand Up @@ -327,4 +327,3 @@
]
}
}

1 change: 1 addition & 0 deletions packages/nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"homepage": "https://nx.dev",
"dependencies": {
"@parcel/watcher": "2.0.4",
"@pnpm/lockfile-types": "^4.3.6",
"@yarnpkg/lockfile": "^1.1.0",
"@yarnpkg/parsers": "^3.0.0-rc.18",
"@zkochan/js-yaml": "0.0.6",
Expand Down
Loading

0 comments on commit 94db30c

Please sign in to comment.