@nstudio/xplat-utils 15.0.4-rc.0 → 16.2.0-beta.0
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 +19 -13
- package/package.json +1 -1
- package/src/utils/types.d.ts +6 -6
- package/src/utils/utils.js +1 -1
package/README.md
CHANGED
@@ -24,13 +24,19 @@
|
|
24
24
|
|
25
25
|
```
|
26
26
|
npx create-nx-workspace@latest
|
27
|
-
```
|
28
27
|
|
29
|
-
|
28
|
+
// Choose "Integrated monorepo" at the prompt:
|
29
|
+
|
30
|
+
? Choose what to create …
|
31
|
+
> Integrated monorepo: Nx configures your favorite frameworks and lets you focus on shipping features.
|
30
32
|
|
31
|
-
|
33
|
+
// Choose "apps" at the prompt:
|
34
|
+
|
35
|
+
? What to create in the new workspace …
|
36
|
+
> apps [an empty monorepo with no plugins with a layout that works best for building apps]
|
37
|
+
```
|
32
38
|
|
33
|
-
|
39
|
+
Install the tools:
|
34
40
|
|
35
41
|
```
|
36
42
|
npm i @nstudio/xplat -D
|
@@ -39,7 +45,7 @@ npm i @nstudio/xplat -D
|
|
39
45
|
You are now ready to create apps:
|
40
46
|
|
41
47
|
```
|
42
|
-
nx g app
|
48
|
+
npx nx g @nstudio/xplat:app
|
43
49
|
```
|
44
50
|
|
45
51
|
**NOTE:** If you encounter any issue, you can try creating an Nx workspace with version specified, for example:
|
@@ -59,7 +65,7 @@ Electron app generator can use any web app in the workspace as it's target.
|
|
59
65
|
If you don't have a web app yet, create one first:
|
60
66
|
|
61
67
|
```
|
62
|
-
nx g app sample
|
68
|
+
npx nx g @nstudio/xplat:app sample
|
63
69
|
```
|
64
70
|
|
65
71
|
> choose `web`
|
@@ -67,7 +73,7 @@ nx g app sample
|
|
67
73
|
You can now use the web app as the Electron target:
|
68
74
|
|
69
75
|
```
|
70
|
-
nx g app desktop --target=web-sample
|
76
|
+
npx nx g @nstudio/xplat:app desktop --target=web-sample
|
71
77
|
```
|
72
78
|
|
73
79
|
> choose `electron`
|
@@ -81,7 +87,7 @@ npm run start.electron.desktop
|
|
81
87
|
### Ionic
|
82
88
|
|
83
89
|
```
|
84
|
-
nx g app sample
|
90
|
+
npx nx g @nstudio/xplat:app sample
|
85
91
|
```
|
86
92
|
|
87
93
|
> choose `ionic`
|
@@ -89,13 +95,13 @@ nx g app sample
|
|
89
95
|
Develop in browser with:
|
90
96
|
|
91
97
|
```
|
92
|
-
nx serve ionic-sample
|
98
|
+
npx nx serve ionic-sample
|
93
99
|
```
|
94
100
|
|
95
101
|
Build Ionic app:
|
96
102
|
|
97
103
|
```
|
98
|
-
nx build ionic-sample
|
104
|
+
npx nx build ionic-sample
|
99
105
|
```
|
100
106
|
|
101
107
|
A. **Capacitor iOS** - Prepare for development
|
@@ -125,7 +131,7 @@ npm run open.ionic.sample.android
|
|
125
131
|
### NativeScript
|
126
132
|
|
127
133
|
```
|
128
|
-
nx g app mobile
|
134
|
+
nx g @nstudio/xplat:app mobile
|
129
135
|
```
|
130
136
|
|
131
137
|
> choose `nativescript`
|
@@ -133,13 +139,13 @@ nx g app mobile
|
|
133
139
|
A. **iOS**
|
134
140
|
|
135
141
|
```
|
136
|
-
nx run nativescript-mobile:ios
|
142
|
+
npx nx run nativescript-mobile:ios
|
137
143
|
```
|
138
144
|
|
139
145
|
B. **Android**
|
140
146
|
|
141
147
|
```
|
142
|
-
nx run nativescript-mobile:android
|
148
|
+
npx nx run nativescript-mobile:android
|
143
149
|
```
|
144
150
|
|
145
151
|
## Documentation
|
package/package.json
CHANGED
package/src/utils/types.d.ts
CHANGED
@@ -4,9 +4,9 @@ export interface ITargetPlatforms {
|
|
4
4
|
ionic?: boolean;
|
5
5
|
electron?: boolean;
|
6
6
|
}
|
7
|
-
export
|
8
|
-
export
|
9
|
-
export
|
10
|
-
export
|
11
|
-
export
|
12
|
-
export
|
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';
|
package/src/utils/utils.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.toFileName = exports.parseProjectNameFromPath = exports.sanitizeCommaDelimitedArg = exports.prerun = exports.getAppPaths = exports.getRootTsConfigPath = exports.copy = exports.getNxWorkspaceConfig = exports.updateFile = exports.updateJsonFile = exports.getJsonFromFile = exports.jsonParse = exports.isTesting = exports.setTest = exports.isXplatWorkspace = exports.getAppName = exports.getGroupByName = exports.getFrontendFramework = exports.getPrefix = exports.getNpmScope = exports.supportedFrameworks = exports.supportedPlatformsWithNx = exports.supportedNxExtraPlatforms = exports.supportedPlatforms = void 0;
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
|
-
const devkit_1 = require("@
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
6
6
|
exports.supportedPlatforms = [
|
7
7
|
'web',
|
8
8
|
'nativescript',
|