From 611c7b1d8a96503424b7401c9c5988eaf9e7c4f8 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sun, 17 Jan 2021 13:43:06 -0800 Subject: [PATCH] chore(core): 11.0.22 --- CHANGELOG.md | 6 ++++++ README.md | 8 ++++++++ package.json | 2 +- packages/angular/src/schematics/ngrx/index.spec.ts | 14 ++++++++------ packages/angular/src/utils/generator.ts | 9 +++++++-- packages/xplat/src/utils/testing-utils.ts | 3 +-- 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8b371d..f0ecaab8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index bd153f7d..3ef1e667 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ ``` npx create-nx-workspace@latest ``` + At the prompts: > provide a name @@ -36,6 +37,7 @@ npm i @nstudio/xplat -D ``` You are now ready to create apps: + ``` nx g app ``` @@ -53,6 +55,7 @@ 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: @@ -60,9 +63,11 @@ 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 ``` @@ -72,9 +77,11 @@ npm run start.electron.desktop ``` nx g app sample ``` + > choose `ionic` Develop in browser with: + ``` nx run ionic-sample:serve ``` @@ -108,6 +115,7 @@ npm run open.ionic.sample.android ``` nx g app mobile ``` + > choose `nativescript` A. **iOS** diff --git a/package.json b/package.json index a10846a9..3333b5eb 100644 --- a/package.json +++ b/package.json @@ -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, diff --git a/packages/angular/src/schematics/ngrx/index.spec.ts b/packages/angular/src/schematics/ngrx/index.spec.ts index 0a4097e4..2c0ff443 100644 --- a/packages/angular/src/schematics/ngrx/index.spec.ts +++ b/packages/angular/src/schematics/ngrx/index.spec.ts @@ -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', @@ -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); diff --git a/packages/angular/src/utils/generator.ts b/packages/angular/src/utils/generator.ts index a6839e33..f0a31c83 100644 --- a/packages/angular/src/utils/generator.ts +++ b/packages/angular/src/utils/generator.ts @@ -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)); @@ -603,7 +608,7 @@ export function adjustBarrelIndexForType( } export function adjustModule( - tree: Tree, + tree: Tree, type: IGenerateType, options: IGenerateOptions, prefixPath: string diff --git a/packages/xplat/src/utils/testing-utils.ts b/packages/xplat/src/utils/testing-utils.ts index 5f40cc0f..326a8b39 100644 --- a/packages/xplat/src/utils/testing-utils.ts +++ b/packages/xplat/src/utils/testing-utils.ts @@ -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) {