Skip to content

Commit

Permalink
chore(core): 11.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Jan 17, 2021
1 parent 99b9ac5 commit 611c7b1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [11.0.22](https://github.com/nstudio/xplat/compare/11.0.21...11.0.22) (2021-01-17)

### Features

- **core:** support Nx lib barrels as feature targets ([99b9ac5](https://github.com/nstudio/xplat/commit/99b9ac503bb39e6e9c76d9efab930ce64326ee66))

## [11.0.21](https://github.com/nstudio/xplat/compare/11.0.16...11.0.21) (2021-01-09)

### Bug Fixes
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
```
npx create-nx-workspace@latest
```

At the prompts:

> provide a name
Expand All @@ -36,6 +37,7 @@ npm i @nstudio/xplat -D
```

You are now ready to create apps:

```
nx g app
```
Expand All @@ -53,16 +55,19 @@ If you don't have a web app yet, create one first:
```
nx g app sample
```

> choose `web`
You can now use the web app as the Electron target:

```
nx g app desktop --target=web-sample
```

> choose `electron`
Develop with:

```
npm run start.electron.desktop
```
Expand All @@ -72,9 +77,11 @@ npm run start.electron.desktop
```
nx g app sample
```

> choose `ionic`
Develop in browser with:

```
nx run ionic-sample:serve
```
Expand Down Expand Up @@ -108,6 +115,7 @@ npm run open.ionic.sample.android
```
nx g app mobile
```

> choose `nativescript`
A. **iOS**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nstudio/xplat-source",
"version": "11.0.21",
"version": "11.0.22",
"description": "Cross-platform (xplat) tools for Nx workspaces.",
"homepage": "https://nstudio.io/xplat",
"private": true,
Expand Down
14 changes: 8 additions & 6 deletions packages/angular/src/schematics/ngrx/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ describe('ngrx schematic', () => {
it('should create ngrx state for Nx lib only', async () => {
// console.log('appTree:', appTree);
appTree = Tree.empty();
appTree = createXplatWithNativeScriptWeb(appTree, null, 'angular', 'sample');
appTree = createXplatWithNativeScriptWeb(
appTree,
null,
'angular',
'sample'
);
const options: GenerateOptions = {
name: 'auth',
feature: '@testing/sample',
Expand All @@ -174,14 +179,11 @@ describe('ngrx schematic', () => {

// state should be lib specific
expect(
files.indexOf(
`/libs/sample/src/lib/state/auth.actions.ts`
)
files.indexOf(`/libs/sample/src/lib/state/auth.actions.ts`)
).toBeGreaterThanOrEqual(0);

// file content
let indexPath =
`/libs/sample/src/lib/state/auth.actions.ts`;
let indexPath = `/libs/sample/src/lib/state/auth.actions.ts`;
let content = getFileContent(tree, indexPath);
// console.log(barrelPath + ':');
// console.log(barrelIndex);
Expand Down
9 changes: 7 additions & 2 deletions packages/angular/src/utils/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ export function generate(type: IGenerateType, options) {
platform,
'angular'
);
return adjustModule(tree, type, options, `libs/xplat/${xplatFolderName}`);
return adjustModule(
tree,
type,
options,
`libs/xplat/${xplatFolderName}`
);
});
} else {
throw new Error(unsupportedPlatformError(platform));
Expand Down Expand Up @@ -603,7 +608,7 @@ export function adjustBarrelIndexForType(
}

export function adjustModule(
tree: Tree,
tree: Tree,
type: IGenerateType,
options: IGenerateOptions,
prefixPath: string
Expand Down
3 changes: 1 addition & 2 deletions packages/xplat/src/utils/testing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,11 @@ export function createNxLib(tree: Tree, name: string) {
export class ${name}Module {}`
);
const configPaths = {};
configPaths[`@testing/${name}`] = [`libs/${name}/src/index.ts`]
configPaths[`@testing/${name}`] = [`libs/${name}/src/index.ts`];
tree.overwrite(
'/tsconfig.base.json',
JSON.stringify({ compilerOptions: { paths: configPaths } })
);

}

export function createXplatLibs(tree: Tree) {
Expand Down

0 comments on commit 611c7b1

Please sign in to comment.