@nstudio/xplat-utils 15.0.3 → 15.0.4-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,10 +42,12 @@ You are now ready to create apps:
42
42
  nx g app
43
43
  ```
44
44
 
45
- **NOTE:** If you encounter any issue, you can try creating an Nx workspace with version specified, for example:
45
+ **NOTE:** If you encounter any issue, you can try creating an Nx workspace with a version specified.
46
+
47
+ We have tested with the following, for example:
46
48
 
47
49
  ```
48
- npx create-nx-workspace@14.1.7
50
+ npx create-nx-workspace@15.9.2
49
51
  ```
50
52
 
51
53
  ## App generation examples
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nstudio/xplat-utils",
3
- "version": "15.0.3",
3
+ "version": "15.0.4-rc.1",
4
4
  "description": "Utilities for xplat tooling.",
5
5
  "homepage": "https://nstudio.io/xplat",
6
6
  "repository": {
@@ -4,9 +4,9 @@ export interface ITargetPlatforms {
4
4
  ionic?: boolean;
5
5
  electron?: boolean;
6
6
  }
7
- export declare type PlatformTypes = 'web' | 'nativescript' | 'ionic' | 'electron';
8
- export declare type PlatformNxExtraTypes = 'express' | 'nest' | 'node' | 'react';
9
- export declare type PlatformWithNxTypes = PlatformTypes | PlatformNxExtraTypes;
10
- export declare type PlatformModes = PlatformTypes | 'fullstack';
11
- export declare type FrameworkTypes = 'angular';
12
- export declare type FrameworkOptions = FrameworkTypes | 'all';
7
+ export type PlatformTypes = 'web' | 'nativescript' | 'ionic' | 'electron';
8
+ export type PlatformNxExtraTypes = 'express' | 'nest' | 'node' | 'react';
9
+ export type PlatformWithNxTypes = PlatformTypes | PlatformNxExtraTypes;
10
+ export type PlatformModes = PlatformTypes | 'fullstack';
11
+ export type FrameworkTypes = 'angular';
12
+ export type FrameworkOptions = FrameworkTypes | 'all';
@@ -1,5 +1,5 @@
1
1
  import type { FrameworkTypes, PlatformNxExtraTypes, PlatformTypes, PlatformWithNxTypes } from './types';
2
- import { Tree } from '@angular-devkit/schematics';
2
+ import { Tree as NgTree } from '@angular-devkit/schematics';
3
3
  export declare const supportedPlatforms: Array<PlatformTypes>;
4
4
  export declare const supportedNxExtraPlatforms: Array<PlatformNxExtraTypes>;
5
5
  export declare const supportedPlatformsWithNx: Array<PlatformWithNxTypes>;
@@ -13,14 +13,14 @@ export declare function isXplatWorkspace(): boolean;
13
13
  export declare function setTest(): void;
14
14
  export declare function isTesting(): boolean;
15
15
  export declare function jsonParse(content: string): any;
16
- export declare function getJsonFromFile(tree: Tree, path: string): any;
17
- export declare function updateJsonFile(tree: Tree, path: string, jsonData: any): import("@angular-devkit/schematics/src/tree/interface").Tree;
18
- export declare function updateFile(tree: Tree, path: string, content: string): import("@angular-devkit/schematics/src/tree/interface").Tree;
19
- export declare function getNxWorkspaceConfig(tree: Tree): any;
20
- export declare const copy: (tree: Tree, from: string, to: string) => void;
16
+ export declare function getJsonFromFile(tree: NgTree, path: string): any;
17
+ export declare function updateJsonFile(tree: NgTree, path: string, jsonData: any): import("@angular-devkit/schematics/src/tree/interface").Tree;
18
+ export declare function updateFile(tree: NgTree, path: string, content: string): import("@angular-devkit/schematics/src/tree/interface").Tree;
19
+ export declare function getNxWorkspaceConfig(tree: NgTree): any;
20
+ export declare const copy: (tree: NgTree, from: string, to: string) => void;
21
21
  export declare function getRootTsConfigPath(): string;
22
- export declare function getAppPaths(tree: Tree, type?: PlatformTypes): Array<string>;
23
- export declare function prerun(options?: any, init?: boolean): (tree: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
22
+ export declare function getAppPaths(tree: NgTree, type?: PlatformTypes): Array<string>;
23
+ export declare function prerun(options?: any, init?: boolean): (tree: NgTree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
24
24
  export declare function sanitizeCommaDelimitedArg(input: string): Array<string>;
25
25
  export declare function parseProjectNameFromPath(input: string): string;
26
26
  export declare function toFileName(s: string): string;
@@ -89,8 +89,14 @@ exports.updateJsonFile = updateJsonFile;
89
89
  function updateFile(tree, path, content) {
90
90
  try {
91
91
  // if (tree.exists(path)) {
92
- tree.overwrite(path, content);
92
+ // tree.overwrite(path, content);
93
93
  // }
94
+ if (tree.exists(path)) {
95
+ tree.overwrite(path, content);
96
+ }
97
+ else {
98
+ tree.create(path, content);
99
+ }
94
100
  return tree;
95
101
  }
96
102
  catch (err) {