@nstudio/xplat 13.0.0 → 13.4.2-rc.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 +2 -2
- package/migrations/update-10-2-0/update-10-2-0.js +2 -2
- package/migrations/update-11-0-0/clean-old-dirs.js +2 -2
- package/migrations/update-11-0-0/update-11-0-0.js +45 -45
- package/migrations/update-11-0-0/update-to-11-env-base.js +22 -22
- package/migrations/update-11-0-0/update-to-11-imports.js +5 -5
- package/migrations/update-12-4-3/update-12-4-3.js +19 -19
- package/migrations/update-13-0-0/update-13-0-0.js +18 -18
- package/migrations.json +14 -15
- package/package.json +3 -3
- package/src/schematics/app-generate/index.js +3 -3
- package/src/schematics/application/index.js +1 -1
- package/src/schematics/application/index.spec.js +13 -13
- package/src/schematics/component/index.js +1 -1
- package/src/schematics/component/index.spec.js +22 -22
- package/src/schematics/feature/index.js +3 -3
- package/src/schematics/feature/index.spec.js +37 -37
- package/src/schematics/helpers/index.js +7 -7
- package/src/schematics/helpers/index.spec.js +4 -4
- package/src/schematics/init/index.js +13 -13
- package/src/schematics/init/index.spec.js +8 -8
- package/src/schematics/mode/index.js +3 -3
- package/src/schematics/ng-add/index.js +3 -3
- package/src/utils/ast.js +1 -1
- package/src/utils/general.js +10 -10
- package/src/utils/helpers.js +1 -1
- package/src/utils/postinstall.js +3 -3
- package/src/utils/testing-utils.js +2 -2
- package/src/utils/testing.js +2 -2
- package/src/utils/versions.js +1 -1
- package/src/utils/xplat.js +65 -65
@@ -29,8 +29,8 @@ function updateNativeScriptApps(tree, context) {
|
|
29
29
|
const appsDir = tree.getDir('apps');
|
30
30
|
const appFolders = appsDir.subdirs;
|
31
31
|
const cwd = process.cwd();
|
32
|
-
const nativeScriptAppsPaths = xplat_utils_1.getAppPaths(tree, 'nativescript');
|
33
|
-
const npmScope = xplat_utils_1.getNpmScope();
|
32
|
+
const nativeScriptAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'nativescript');
|
33
|
+
const npmScope = (0, xplat_utils_1.getNpmScope)();
|
34
34
|
const appsNames = [];
|
35
35
|
// update {N} apps and configs
|
36
36
|
for (const dirPath of nativeScriptAppsPaths) {
|
@@ -49,17 +49,17 @@ function updateNativeScriptApps(tree, context) {
|
|
49
49
|
.map((p) => '..')
|
50
50
|
.join('\\');
|
51
51
|
const cwd = process.cwd();
|
52
|
-
const webpackConfigPath = path_1.join(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js');
|
52
|
+
const webpackConfigPath = (0, path_1.join)(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js');
|
53
53
|
// console.log('webpackConfigPath:', webpackConfigPath);
|
54
54
|
const webpackConfig = fs.readFileSync(webpackConfigPath, {
|
55
55
|
encoding: 'utf-8',
|
56
56
|
});
|
57
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/webpack.config.js`, webpackConfig
|
57
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/webpack.config.js`, webpackConfig
|
58
58
|
.replace(/<%= pathOffset %>/gi, relativePath + '/')
|
59
59
|
.replace(/<%= npmScope %>/gi, npmScope));
|
60
60
|
// update {N} app deps
|
61
61
|
const packagePath = `${dirPath}/package.json`;
|
62
|
-
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath);
|
62
|
+
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath);
|
63
63
|
if (packageJson) {
|
64
64
|
packageJson.main = './src/main.ts';
|
65
65
|
packageJson.scripts = packageJson.scripts || {};
|
@@ -93,7 +93,7 @@ function updateNativeScriptApps(tree, context) {
|
|
93
93
|
};
|
94
94
|
// console.log('path:',path);
|
95
95
|
// console.log('packageJson overwrite:', JSON.stringify(packageJson));
|
96
|
-
tree = xplat_utils_1.updateJsonFile(tree, packagePath, packageJson);
|
96
|
+
tree = (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson);
|
97
97
|
}
|
98
98
|
if (tree.exists(`${dirPath}/tsconfig.env.json`)) {
|
99
99
|
tree.delete(`${dirPath}/tsconfig.env.json`);
|
@@ -101,7 +101,7 @@ function updateNativeScriptApps(tree, context) {
|
|
101
101
|
if (tree.exists(`${dirPath}/tsconfig.tns.json`)) {
|
102
102
|
tree.delete(`${dirPath}/tsconfig.tns.json`);
|
103
103
|
}
|
104
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node
|
104
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node
|
105
105
|
|
106
106
|
const fs = require('fs-extra');
|
107
107
|
const path = require('path');
|
@@ -125,7 +125,7 @@ child.on('close', (code) => {
|
|
125
125
|
|
126
126
|
});
|
127
127
|
`);
|
128
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.app.json`, `{
|
128
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.app.json`, `{
|
129
129
|
"extends": "./tsconfig.json",
|
130
130
|
"compilerOptions": {
|
131
131
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -141,7 +141,7 @@ child.on('close', (code) => {
|
|
141
141
|
"./src/polyfills.ts"
|
142
142
|
]
|
143
143
|
}`);
|
144
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.editor.json`, `{
|
144
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.editor.json`, `{
|
145
145
|
"extends": "./tsconfig.json",
|
146
146
|
"include": ["**/*.ts"],
|
147
147
|
"compilerOptions": {
|
@@ -149,7 +149,7 @@ child.on('close', (code) => {
|
|
149
149
|
}
|
150
150
|
}
|
151
151
|
`);
|
152
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.json`, `{
|
152
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.json`, `{
|
153
153
|
"extends": "${relativePath}/tsconfig.base.json",
|
154
154
|
"files": [],
|
155
155
|
"include": [],
|
@@ -166,7 +166,7 @@ child.on('close', (code) => {
|
|
166
166
|
]
|
167
167
|
}
|
168
168
|
`);
|
169
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.spec.json`, `{
|
169
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.spec.json`, `{
|
170
170
|
"extends": "./tsconfig.json",
|
171
171
|
"compilerOptions": {
|
172
172
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -177,8 +177,8 @@ child.on('close', (code) => {
|
|
177
177
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
178
178
|
}
|
179
179
|
`);
|
180
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`);
|
181
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/src/polyfills.ts`, `/**
|
180
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`);
|
181
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/polyfills.ts`, `/**
|
182
182
|
* NativeScript Polyfills
|
183
183
|
*/
|
184
184
|
|
@@ -199,7 +199,7 @@ import 'zone.js';
|
|
199
199
|
// Add NativeScript specific Zone JS patches
|
200
200
|
import '@nativescript/zone-js';
|
201
201
|
`);
|
202
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/.eslintrc.json`, `{
|
202
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/.eslintrc.json`, `{
|
203
203
|
"extends": "${relativePath}/.eslintrc.json",
|
204
204
|
"ignorePatterns": [
|
205
205
|
"!**/*"
|
@@ -223,7 +223,7 @@ import '@nativescript/zone-js';
|
|
223
223
|
"error",
|
224
224
|
{
|
225
225
|
"type": "attribute",
|
226
|
-
"prefix": "${xplat_utils_1.getPrefix()}",
|
226
|
+
"prefix": "${(0, xplat_utils_1.getPrefix)()}",
|
227
227
|
"style": "camelCase"
|
228
228
|
}
|
229
229
|
],
|
@@ -231,7 +231,7 @@ import '@nativescript/zone-js';
|
|
231
231
|
"error",
|
232
232
|
{
|
233
233
|
"type": "element",
|
234
|
-
"prefix": "${xplat_utils_1.getPrefix()}",
|
234
|
+
"prefix": "${(0, xplat_utils_1.getPrefix)()}",
|
235
235
|
"style": "kebab-case"
|
236
236
|
}
|
237
237
|
]
|
@@ -264,7 +264,7 @@ import '@nativescript/zone-js';
|
|
264
264
|
return tree;
|
265
265
|
}
|
266
266
|
function updateRootPackage(tree, context) {
|
267
|
-
return workspace_1.updateJsonInTree('package.json', (json) => {
|
267
|
+
return (0, workspace_1.updateJsonInTree)('package.json', (json) => {
|
268
268
|
json.scripts = json.scripts || {};
|
269
269
|
const nativeScriptDeps = {
|
270
270
|
'@nativescript/angular': nsNgScopedVersion,
|
@@ -289,8 +289,8 @@ function updateRootPackage(tree, context) {
|
|
289
289
|
})(tree, context);
|
290
290
|
}
|
291
291
|
function default_1() {
|
292
|
-
return schematics_1.chain([
|
293
|
-
xplat_utils_1.prerun({
|
292
|
+
return (0, schematics_1.chain)([
|
293
|
+
(0, xplat_utils_1.prerun)({
|
294
294
|
framework: 'angular',
|
295
295
|
}, true),
|
296
296
|
updateNativeScriptApps,
|
@@ -11,8 +11,8 @@ const nsNgScopedVersion = '^12.2.0';
|
|
11
11
|
const nsCoreVersion = '~8.1.0';
|
12
12
|
let hasNativeScriptApps = false;
|
13
13
|
function updateNativeScriptApps(tree, context) {
|
14
|
-
const nativeScriptAppsPaths = xplat_utils_1.getAppPaths(tree, 'nativescript');
|
15
|
-
const npmScope = xplat_utils_1.getNpmScope();
|
14
|
+
const nativeScriptAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'nativescript');
|
15
|
+
const npmScope = (0, xplat_utils_1.getNpmScope)();
|
16
16
|
const appsNames = [];
|
17
17
|
// update {N} apps and configs
|
18
18
|
for (const dirPath of nativeScriptAppsPaths) {
|
@@ -27,7 +27,7 @@ function updateNativeScriptApps(tree, context) {
|
|
27
27
|
.join('/');
|
28
28
|
// update {N} app deps
|
29
29
|
const packagePath = `${dirPath}/package.json`;
|
30
|
-
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath);
|
30
|
+
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath);
|
31
31
|
if (packageJson) {
|
32
32
|
packageJson.main = './src/main.ts';
|
33
33
|
packageJson.scripts = packageJson.scripts || {};
|
@@ -63,7 +63,7 @@ function updateNativeScriptApps(tree, context) {
|
|
63
63
|
};
|
64
64
|
// console.log('path:',path);
|
65
65
|
// console.log('packageJson overwrite:', JSON.stringify(packageJson));
|
66
|
-
tree = xplat_utils_1.updateJsonFile(tree, packagePath, packageJson);
|
66
|
+
tree = (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson);
|
67
67
|
}
|
68
68
|
if (tree.exists(`${dirPath}/tsconfig.env.json`)) {
|
69
69
|
tree.delete(`${dirPath}/tsconfig.env.json`);
|
@@ -71,7 +71,7 @@ function updateNativeScriptApps(tree, context) {
|
|
71
71
|
if (tree.exists(`${dirPath}/tsconfig.tns.json`)) {
|
72
72
|
tree.delete(`${dirPath}/tsconfig.tns.json`);
|
73
73
|
}
|
74
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node
|
74
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node
|
75
75
|
|
76
76
|
const fs = require('fs-extra');
|
77
77
|
const path = require('path');
|
@@ -111,7 +111,7 @@ child.stdout.on('data', function (data) {
|
|
111
111
|
});
|
112
112
|
|
113
113
|
`);
|
114
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.app.json`, `{
|
114
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.app.json`, `{
|
115
115
|
"extends": "./tsconfig.json",
|
116
116
|
"compilerOptions": {
|
117
117
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -127,7 +127,7 @@ child.stdout.on('data', function (data) {
|
|
127
127
|
"./src/polyfills.ts"
|
128
128
|
]
|
129
129
|
}`);
|
130
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.editor.json`, `{
|
130
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.editor.json`, `{
|
131
131
|
"extends": "./tsconfig.json",
|
132
132
|
"include": ["**/*.ts"],
|
133
133
|
"compilerOptions": {
|
@@ -135,7 +135,7 @@ child.stdout.on('data', function (data) {
|
|
135
135
|
}
|
136
136
|
}
|
137
137
|
`);
|
138
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.json`, `{
|
138
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.json`, `{
|
139
139
|
"extends": "${relativePath}/tsconfig.base.json",
|
140
140
|
"files": [],
|
141
141
|
"include": [],
|
@@ -152,7 +152,7 @@ child.stdout.on('data', function (data) {
|
|
152
152
|
]
|
153
153
|
}
|
154
154
|
`);
|
155
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.spec.json`, `{
|
155
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.spec.json`, `{
|
156
156
|
"extends": "./tsconfig.json",
|
157
157
|
"compilerOptions": {
|
158
158
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -163,8 +163,8 @@ child.stdout.on('data', function (data) {
|
|
163
163
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
164
164
|
}
|
165
165
|
`);
|
166
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular/setup-jest';`);
|
167
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/src/polyfills.ts`, `/**
|
166
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular/setup-jest';`);
|
167
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/polyfills.ts`, `/**
|
168
168
|
* NativeScript Polyfills
|
169
169
|
*/
|
170
170
|
|
@@ -185,7 +185,7 @@ import 'zone.js';
|
|
185
185
|
// Add NativeScript specific Zone JS patches
|
186
186
|
import '@nativescript/zone-js';
|
187
187
|
`);
|
188
|
-
workspace_1.createOrUpdate(tree, `${dirPath}/.eslintrc.json`, `{
|
188
|
+
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/.eslintrc.json`, `{
|
189
189
|
"extends": "${relativePath}/.eslintrc.json",
|
190
190
|
"ignorePatterns": [
|
191
191
|
"!**/*"
|
@@ -209,7 +209,7 @@ import '@nativescript/zone-js';
|
|
209
209
|
"error",
|
210
210
|
{
|
211
211
|
"type": "attribute",
|
212
|
-
"prefix": "${xplat_utils_1.getPrefix()}",
|
212
|
+
"prefix": "${(0, xplat_utils_1.getPrefix)()}",
|
213
213
|
"style": "camelCase"
|
214
214
|
}
|
215
215
|
],
|
@@ -217,7 +217,7 @@ import '@nativescript/zone-js';
|
|
217
217
|
"error",
|
218
218
|
{
|
219
219
|
"type": "element",
|
220
|
-
"prefix": "${xplat_utils_1.getPrefix()}",
|
220
|
+
"prefix": "${(0, xplat_utils_1.getPrefix)()}",
|
221
221
|
"style": "kebab-case"
|
222
222
|
}
|
223
223
|
]
|
@@ -250,7 +250,7 @@ import '@nativescript/zone-js';
|
|
250
250
|
return tree;
|
251
251
|
}
|
252
252
|
function updateRootPackage(tree, context) {
|
253
|
-
return workspace_1.updateJsonInTree('package.json', (json) => {
|
253
|
+
return (0, workspace_1.updateJsonInTree)('package.json', (json) => {
|
254
254
|
json.scripts = json.scripts || {};
|
255
255
|
const nativeScriptDeps = {
|
256
256
|
'@nativescript/angular': nsNgScopedVersion,
|
@@ -283,14 +283,14 @@ function updateRootPackage(tree, context) {
|
|
283
283
|
})(tree, context);
|
284
284
|
}
|
285
285
|
function default_1() {
|
286
|
-
return schematics_1.chain([
|
287
|
-
xplat_utils_1.prerun({
|
286
|
+
return (0, schematics_1.chain)([
|
287
|
+
(0, xplat_utils_1.prerun)({
|
288
288
|
framework: 'angular',
|
289
289
|
}, true),
|
290
290
|
updateNativeScriptApps,
|
291
291
|
updateRootPackage,
|
292
292
|
(tree) => {
|
293
|
-
return schematics_1.externalSchematic('@nrwl/workspace', 'convert-to-nx-project', {
|
293
|
+
return (0, schematics_1.externalSchematic)('@nrwl/workspace', 'convert-to-nx-project', {
|
294
294
|
all: true
|
295
295
|
});
|
296
296
|
},
|
package/migrations.json
CHANGED
@@ -30,9 +30,9 @@
|
|
30
30
|
"description": "Migrate workspace to 12.4.3",
|
31
31
|
"factory": "./migrations/update-12-4-3/update-12-4-3"
|
32
32
|
},
|
33
|
-
"update-to-13.0.
|
34
|
-
"version": "13.0.
|
35
|
-
"description": "Migrate workspace to 13.0.
|
33
|
+
"update-to-13.0.1": {
|
34
|
+
"version": "13.0.1",
|
35
|
+
"description": "Migrate workspace to 13.0.1",
|
36
36
|
"factory": "./migrations/update-13-0-0/update-13-0-0"
|
37
37
|
}
|
38
38
|
},
|
@@ -119,47 +119,46 @@
|
|
119
119
|
}
|
120
120
|
}
|
121
121
|
},
|
122
|
-
"13.0.
|
123
|
-
"version": "13.0.
|
122
|
+
"13.0.1": {
|
123
|
+
"version": "13.0.1",
|
124
124
|
"packages": {
|
125
125
|
"@nstudio/angular": {
|
126
|
-
"version": "13.0.
|
126
|
+
"version": "13.0.1",
|
127
127
|
"alwaysAddToPackageJson": false
|
128
128
|
},
|
129
129
|
"@nstudio/electron": {
|
130
|
-
"version": "13.0.
|
130
|
+
"version": "13.0.1",
|
131
131
|
"alwaysAddToPackageJson": false
|
132
132
|
},
|
133
133
|
"@nstudio/electron-angular": {
|
134
|
-
"version": "13.0.
|
134
|
+
"version": "13.0.1",
|
135
135
|
"alwaysAddToPackageJson": false
|
136
136
|
},
|
137
137
|
"@nstudio/ionic": {
|
138
|
-
"version": "13.0.
|
138
|
+
"version": "13.0.1",
|
139
139
|
"alwaysAddToPackageJson": false
|
140
140
|
},
|
141
141
|
"@nstudio/ionic-angular": {
|
142
|
-
"version": "13.0.
|
142
|
+
"version": "13.0.1",
|
143
143
|
"alwaysAddToPackageJson": false
|
144
144
|
},
|
145
145
|
"@nstudio/nativescript": {
|
146
|
-
"version": "13.0.
|
146
|
+
"version": "13.0.1",
|
147
147
|
"alwaysAddToPackageJson": false
|
148
148
|
},
|
149
149
|
"@nstudio/nativescript-angular": {
|
150
|
-
"version": "13.0.
|
150
|
+
"version": "13.0.1",
|
151
151
|
"alwaysAddToPackageJson": false
|
152
152
|
},
|
153
153
|
"@nstudio/web": {
|
154
|
-
"version": "13.0.
|
154
|
+
"version": "13.0.1",
|
155
155
|
"alwaysAddToPackageJson": false
|
156
156
|
},
|
157
157
|
"@nstudio/web-angular": {
|
158
|
-
"version": "13.0.
|
158
|
+
"version": "13.0.1",
|
159
159
|
"alwaysAddToPackageJson": false
|
160
160
|
}
|
161
161
|
}
|
162
162
|
}
|
163
163
|
}
|
164
|
-
}
|
165
164
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nstudio/xplat",
|
3
|
-
"version": "13.
|
3
|
+
"version": "13.4.2-rc.0",
|
4
4
|
"description": "Cross-platform (xplat) tools for Nx workspaces.",
|
5
5
|
"homepage": "https://nstudio.io/xplat",
|
6
6
|
"repository": {
|
@@ -41,8 +41,8 @@
|
|
41
41
|
"postinstall": "node src/utils/postinstall.js"
|
42
42
|
},
|
43
43
|
"dependencies": {
|
44
|
-
"@nstudio/focus": "13.
|
45
|
-
"@nstudio/xplat-utils": "13.
|
44
|
+
"@nstudio/focus": "13.4.2-rc.0",
|
45
|
+
"@nstudio/xplat-utils": "13.4.2-rc.0"
|
46
46
|
},
|
47
47
|
"author": "Nathan Walker",
|
48
48
|
"license": "MIT",
|
@@ -6,9 +6,9 @@ const xplat_utils_1 = require("@nstudio/xplat-utils");
|
|
6
6
|
let packagesToRunXplat = [];
|
7
7
|
function default_1(options) {
|
8
8
|
const externalChains = utils_1.XplatHelpers.getExternalChainsForGenerator(options, 'app', packagesToRunXplat);
|
9
|
-
return schematics_1.chain([
|
10
|
-
xplat_utils_1.prerun(options, true),
|
11
|
-
(tree, context) => schematics_1.chain(externalChains),
|
9
|
+
return (0, schematics_1.chain)([
|
10
|
+
(0, xplat_utils_1.prerun)(options, true),
|
11
|
+
(tree, context) => (0, schematics_1.chain)(externalChains),
|
12
12
|
]);
|
13
13
|
}
|
14
14
|
exports.default = default_1;
|
@@ -6,6 +6,6 @@ const utils_1 = require("../../utils");
|
|
6
6
|
let packagesToRun = [];
|
7
7
|
function default_1(options) {
|
8
8
|
const externalChains = utils_1.XplatHelpers.getExternalChainsForApplication(options, 'app', packagesToRun);
|
9
|
-
return schematics_1.chain([xplat_utils_1.prerun(options, true), (tree) => schematics_1.chain(externalChains)]);
|
9
|
+
return (0, schematics_1.chain)([(0, xplat_utils_1.prerun)(options, true), (tree) => (0, schematics_1.chain)(externalChains)]);
|
10
10
|
}
|
11
11
|
exports.default = default_1;
|
@@ -14,7 +14,7 @@ const xplat_utils_1 = require("@nstudio/xplat-utils");
|
|
14
14
|
const testing_1 = require("@nstudio/xplat/testing");
|
15
15
|
const testing_2 = require("../../utils/testing");
|
16
16
|
const testing_3 = require("@nrwl/workspace/testing");
|
17
|
-
xplat_utils_1.setTest();
|
17
|
+
(0, xplat_utils_1.setTest)();
|
18
18
|
describe('xplat schematic', () => {
|
19
19
|
let appTree;
|
20
20
|
const defaultOptions = {
|
@@ -24,13 +24,13 @@ describe('xplat schematic', () => {
|
|
24
24
|
};
|
25
25
|
beforeEach(() => {
|
26
26
|
appTree = schematics_1.Tree.empty();
|
27
|
-
appTree = testing_1.createEmptyWorkspace(appTree);
|
27
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree);
|
28
28
|
});
|
29
29
|
it('should create web angular app', () => __awaiter(void 0, void 0, void 0, function* () {
|
30
30
|
const options = Object.assign({}, defaultOptions);
|
31
31
|
options.platforms = 'web';
|
32
32
|
options.framework = 'angular';
|
33
|
-
const tree = yield testing_2.runSchematic('app', options, appTree);
|
33
|
+
const tree = yield (0, testing_2.runSchematic)('app', options, appTree);
|
34
34
|
const files = tree.files;
|
35
35
|
// console.log('files:', files);
|
36
36
|
expect(tree.exists('/apps/web-sample/tsconfig.json')).toBeTruthy();
|
@@ -43,7 +43,7 @@ describe('xplat schematic', () => {
|
|
43
43
|
const options = Object.assign({}, defaultOptions);
|
44
44
|
options.platforms = 'nativescript';
|
45
45
|
options.framework = 'angular';
|
46
|
-
const tree = yield testing_2.runSchematic('app', options, appTree);
|
46
|
+
const tree = yield (0, testing_2.runSchematic)('app', options, appTree);
|
47
47
|
const files = tree.files;
|
48
48
|
// console.log('files:', files);
|
49
49
|
expect(tree.exists('/apps/nativescript-sample/nativescript.config.ts')).toBeTruthy();
|
@@ -54,44 +54,44 @@ describe('xplat schematic', () => {
|
|
54
54
|
describe('Nx app generators supporte via proxy xplat app generator', () => {
|
55
55
|
it('should create Nx express', () => __awaiter(void 0, void 0, void 0, function* () {
|
56
56
|
appTree = schematics_1.Tree.empty();
|
57
|
-
appTree = testing_1.createEmptyWorkspace(appTree);
|
57
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree);
|
58
58
|
const options = Object.assign({}, defaultOptions);
|
59
59
|
options.platforms = 'express';
|
60
|
-
const tree = yield testing_2.runSchematic('app', options, appTree);
|
60
|
+
const tree = yield (0, testing_2.runSchematic)('app', options, appTree);
|
61
61
|
const files = tree.files;
|
62
62
|
// console.log('files:', files);
|
63
63
|
expect(tree.exists('/apps/express-sample/src/main.ts')).toBeTruthy();
|
64
|
-
let fileContent = testing_3.getFileContent(tree, '/apps/express-sample/src/main.ts');
|
64
|
+
let fileContent = (0, testing_3.getFileContent)(tree, '/apps/express-sample/src/main.ts');
|
65
65
|
// console.log(fileContent);
|
66
66
|
expect(fileContent.indexOf(`from 'express'`)).toBeGreaterThan(0);
|
67
67
|
}));
|
68
68
|
xit('should create Nx nest', () => __awaiter(void 0, void 0, void 0, function* () {
|
69
69
|
appTree = schematics_1.Tree.empty();
|
70
|
-
appTree = testing_1.createEmptyWorkspace(appTree);
|
70
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree);
|
71
71
|
const options = Object.assign({}, defaultOptions);
|
72
72
|
options.platforms = 'nest';
|
73
73
|
delete options.prefix;
|
74
74
|
delete options.isTesting;
|
75
|
-
const tree = yield testing_2.runSchematic('app', options, appTree);
|
75
|
+
const tree = yield (0, testing_2.runSchematic)('app', options, appTree);
|
76
76
|
const files = tree.files;
|
77
77
|
// console.log('files:', files);
|
78
78
|
expect(tree.exists('/apps/nest-sample/src/main.ts')).toBeTruthy();
|
79
|
-
let fileContent = testing_3.getFileContent(tree, '/apps/nest-sample/src/main.ts');
|
79
|
+
let fileContent = (0, testing_3.getFileContent)(tree, '/apps/nest-sample/src/main.ts');
|
80
80
|
// console.log(fileContent);
|
81
81
|
expect(fileContent.indexOf(`from '@nestjs/core'`)).toBeGreaterThan(0);
|
82
82
|
}));
|
83
83
|
xit('should create Nx node', () => __awaiter(void 0, void 0, void 0, function* () {
|
84
84
|
appTree = schematics_1.Tree.empty();
|
85
|
-
appTree = testing_1.createEmptyWorkspace(appTree);
|
85
|
+
appTree = (0, testing_1.createEmptyWorkspace)(appTree);
|
86
86
|
const options = Object.assign({}, defaultOptions);
|
87
87
|
options.platforms = 'node';
|
88
88
|
delete options.prefix;
|
89
89
|
delete options.isTesting;
|
90
|
-
const tree = yield testing_2.runSchematic('app', options, appTree);
|
90
|
+
const tree = yield (0, testing_2.runSchematic)('app', options, appTree);
|
91
91
|
const files = tree.files;
|
92
92
|
// console.log('files:', files);
|
93
93
|
expect(tree.exists('/apps/node-sample/src/main.ts')).toBeTruthy();
|
94
|
-
let fileContent = testing_3.getFileContent(tree, '/apps/node-sample/src/main.ts');
|
94
|
+
let fileContent = (0, testing_3.getFileContent)(tree, '/apps/node-sample/src/main.ts');
|
95
95
|
// console.log(fileContent);
|
96
96
|
expect(fileContent.indexOf(`console.log('Hello World!')`)).toBeGreaterThanOrEqual(0);
|
97
97
|
}));
|
@@ -6,6 +6,6 @@ const utils_1 = require("../../utils");
|
|
6
6
|
let packagesToRunXplat = [];
|
7
7
|
function default_1(options) {
|
8
8
|
const externalChains = utils_1.XplatHelpers.getExternalChainsForGenerator(options, 'component', packagesToRunXplat);
|
9
|
-
return schematics_1.chain([xplat_utils_1.prerun(options, true), (tree) => schematics_1.chain(externalChains)]);
|
9
|
+
return (0, schematics_1.chain)([(0, xplat_utils_1.prerun)(options, true), (tree) => (0, schematics_1.chain)(externalChains)]);
|
10
10
|
}
|
11
11
|
exports.default = default_1;
|