@nstudio/xplat 15.0.3 → 15.0.4-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/migrations/update-12-4-3/update-12-4-3.js +31 -33
- package/migrations/update-13-0-0/update-13-0-0.js +38 -40
- package/migrations.json +0 -66
- package/package.json +3 -3
- package/src/schematics/feature/index.spec.js +2 -2
- package/src/utils/ast.d.ts +4 -76
- package/src/utils/ast.js +19 -304
- package/src/utils/general.d.ts +35 -6
- package/src/utils/general.js +155 -11
- package/src/utils/versions.js +1 -1
- package/src/utils/xplat.js +16 -7
- package/migrations/update-10-2-0/update-10-2-0.d.ts +0 -2
- package/migrations/update-10-2-0/update-10-2-0.js +0 -11
- package/migrations/update-11-0-0/clean-old-dirs.d.ts +0 -2
- package/migrations/update-11-0-0/clean-old-dirs.js +0 -57
- package/migrations/update-11-0-0/update-11-0-0.d.ts +0 -5
- package/migrations/update-11-0-0/update-11-0-0.js +0 -594
- package/migrations/update-11-0-0/update-to-11-env-base.d.ts +0 -5
- package/migrations/update-11-0-0/update-to-11-env-base.js +0 -289
- package/migrations/update-11-0-0/update-to-11-imports.d.ts +0 -6
- package/migrations/update-11-0-0/update-to-11-imports.js +0 -173
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schematics_1 = require("@angular-devkit/schematics");
|
4
4
|
const path_1 = require("path");
|
5
5
|
const fs = require("fs");
|
6
|
-
const workspace_1 = require("@nrwl/workspace");
|
7
6
|
const xplat_1 = require("@nstudio/xplat");
|
8
7
|
const xplat_utils_1 = require("@nstudio/xplat-utils");
|
9
8
|
const angularVersion = '^12.0.0';
|
@@ -54,7 +53,7 @@ function updateNativeScriptApps(tree, context) {
|
|
54
53
|
const webpackConfig = fs.readFileSync(webpackConfigPath, {
|
55
54
|
encoding: 'utf-8',
|
56
55
|
});
|
57
|
-
(0,
|
56
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/webpack.config.js`, webpackConfig
|
58
57
|
.replace(/<%= pathOffset %>/gi, relativePath + '/')
|
59
58
|
.replace(/<%= npmScope %>/gi, npmScope));
|
60
59
|
// update {N} app deps
|
@@ -101,7 +100,7 @@ function updateNativeScriptApps(tree, context) {
|
|
101
100
|
if (tree.exists(`${dirPath}/tsconfig.tns.json`)) {
|
102
101
|
tree.delete(`${dirPath}/tsconfig.tns.json`);
|
103
102
|
}
|
104
|
-
(0,
|
103
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node
|
105
104
|
|
106
105
|
const fs = require('fs-extra');
|
107
106
|
const path = require('path');
|
@@ -125,7 +124,7 @@ child.on('close', (code) => {
|
|
125
124
|
|
126
125
|
});
|
127
126
|
`);
|
128
|
-
(0,
|
127
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.app.json`, `{
|
129
128
|
"extends": "./tsconfig.json",
|
130
129
|
"compilerOptions": {
|
131
130
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -141,7 +140,7 @@ child.on('close', (code) => {
|
|
141
140
|
"./src/polyfills.ts"
|
142
141
|
]
|
143
142
|
}`);
|
144
|
-
(0,
|
143
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.editor.json`, `{
|
145
144
|
"extends": "./tsconfig.json",
|
146
145
|
"include": ["**/*.ts"],
|
147
146
|
"compilerOptions": {
|
@@ -149,7 +148,7 @@ child.on('close', (code) => {
|
|
149
148
|
}
|
150
149
|
}
|
151
150
|
`);
|
152
|
-
(0,
|
151
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.json`, `{
|
153
152
|
"extends": "${relativePath}/tsconfig.base.json",
|
154
153
|
"files": [],
|
155
154
|
"include": [],
|
@@ -166,7 +165,7 @@ child.on('close', (code) => {
|
|
166
165
|
]
|
167
166
|
}
|
168
167
|
`);
|
169
|
-
(0,
|
168
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.spec.json`, `{
|
170
169
|
"extends": "./tsconfig.json",
|
171
170
|
"compilerOptions": {
|
172
171
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -177,8 +176,8 @@ child.on('close', (code) => {
|
|
177
176
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
178
177
|
}
|
179
178
|
`);
|
180
|
-
(0,
|
181
|
-
(0,
|
179
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`);
|
180
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/src/polyfills.ts`, `/**
|
182
181
|
* NativeScript Polyfills
|
183
182
|
*/
|
184
183
|
|
@@ -199,7 +198,7 @@ import 'zone.js';
|
|
199
198
|
// Add NativeScript specific Zone JS patches
|
200
199
|
import '@nativescript/zone-js';
|
201
200
|
`);
|
202
|
-
(0,
|
201
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/.eslintrc.json`, `{
|
203
202
|
"extends": "${relativePath}/.eslintrc.json",
|
204
203
|
"ignorePatterns": [
|
205
204
|
"!**/*"
|
@@ -264,29 +263,28 @@ import '@nativescript/zone-js';
|
|
264
263
|
return tree;
|
265
264
|
}
|
266
265
|
function updateRootPackage(tree, context) {
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
})(tree, context);
|
266
|
+
const json = (0, xplat_utils_1.getJsonFromFile)(tree, 'package.json');
|
267
|
+
json.scripts = json.scripts || {};
|
268
|
+
const nativeScriptDeps = {
|
269
|
+
'@nativescript/angular': nsNgScopedVersion,
|
270
|
+
'@nativescript/core': nsCoreVersion,
|
271
|
+
};
|
272
|
+
const nativeScriptDevDeps = {
|
273
|
+
'@nativescript/types': nsCoreVersion,
|
274
|
+
'@nativescript/webpack': nsWebpackVersion,
|
275
|
+
};
|
276
|
+
json.scripts.clean =
|
277
|
+
'npx rimraf hooks node_modules package-lock.json && yarn config set ignore-engines true && yarn';
|
278
|
+
json.dependencies = json.dependencies || {};
|
279
|
+
json.dependencies = Object.assign(Object.assign(Object.assign(Object.assign({}, json.dependencies), ngDeps), (hasNativeScriptApps ? nativeScriptDeps : {})), { '@ngx-translate/core': ngxTranslateVersion, rxjs: rxjsVersion, 'zone.js': zoneJsVersion });
|
280
|
+
delete json.dependencies['nativescript-angular'];
|
281
|
+
delete json.dependencies['tns-core-modules'];
|
282
|
+
delete json.devDependencies['tns-core-modules'];
|
283
|
+
delete json.dependencies['tns-platform-declarations'];
|
284
|
+
delete json.devDependencies['tns-platform-declarations'];
|
285
|
+
json.devDependencies = json.devDependencies || {};
|
286
|
+
json.devDependencies = Object.assign(Object.assign(Object.assign(Object.assign({}, json.devDependencies), { '@angular-devkit/architect': '^0.1200.0', '@angular-devkit/build-angular': angularVersion, '@angular-devkit/core': angularVersion, '@angular-devkit/schematics': angularVersion, '@angular/compiler-cli': angularVersion, '@angular/language-service': angularVersion }), (hasNativeScriptApps ? nativeScriptDevDeps : {})), { typescript: typescriptVersion });
|
287
|
+
return (0, xplat_utils_1.updateJsonFile)(tree, 'package.json', json);
|
290
288
|
}
|
291
289
|
function default_1() {
|
292
290
|
return (0, schematics_1.chain)([
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const schematics_1 = require("@angular-devkit/schematics");
|
4
|
-
const workspace_1 = require("@nrwl/workspace");
|
5
4
|
const xplat_1 = require("@nstudio/xplat");
|
6
5
|
const xplat_utils_1 = require("@nstudio/xplat-utils");
|
7
6
|
const angularVersion = '^12.2.0';
|
@@ -71,7 +70,7 @@ function updateNativeScriptApps(tree, context) {
|
|
71
70
|
if (tree.exists(`${dirPath}/tsconfig.tns.json`)) {
|
72
71
|
tree.delete(`${dirPath}/tsconfig.tns.json`);
|
73
72
|
}
|
74
|
-
(0,
|
73
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node
|
75
74
|
|
76
75
|
const fs = require('fs-extra');
|
77
76
|
const path = require('path');
|
@@ -111,7 +110,7 @@ child.stdout.on('data', function (data) {
|
|
111
110
|
});
|
112
111
|
|
113
112
|
`);
|
114
|
-
(0,
|
113
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.app.json`, `{
|
115
114
|
"extends": "./tsconfig.json",
|
116
115
|
"compilerOptions": {
|
117
116
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -127,7 +126,7 @@ child.stdout.on('data', function (data) {
|
|
127
126
|
"./src/polyfills.ts"
|
128
127
|
]
|
129
128
|
}`);
|
130
|
-
(0,
|
129
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.editor.json`, `{
|
131
130
|
"extends": "./tsconfig.json",
|
132
131
|
"include": ["**/*.ts"],
|
133
132
|
"compilerOptions": {
|
@@ -135,7 +134,7 @@ child.stdout.on('data', function (data) {
|
|
135
134
|
}
|
136
135
|
}
|
137
136
|
`);
|
138
|
-
(0,
|
137
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.json`, `{
|
139
138
|
"extends": "${relativePath}/tsconfig.base.json",
|
140
139
|
"files": [],
|
141
140
|
"include": [],
|
@@ -152,7 +151,7 @@ child.stdout.on('data', function (data) {
|
|
152
151
|
]
|
153
152
|
}
|
154
153
|
`);
|
155
|
-
(0,
|
154
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/tsconfig.spec.json`, `{
|
156
155
|
"extends": "./tsconfig.json",
|
157
156
|
"compilerOptions": {
|
158
157
|
"outDir": "${relativePath}/dist/out-tsc",
|
@@ -163,8 +162,8 @@ child.stdout.on('data', function (data) {
|
|
163
162
|
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
164
163
|
}
|
165
164
|
`);
|
166
|
-
(0,
|
167
|
-
(0,
|
165
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular/setup-jest';`);
|
166
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/src/polyfills.ts`, `/**
|
168
167
|
* NativeScript Polyfills
|
169
168
|
*/
|
170
169
|
|
@@ -185,7 +184,7 @@ import 'zone.js';
|
|
185
184
|
// Add NativeScript specific Zone JS patches
|
186
185
|
import '@nativescript/zone-js';
|
187
186
|
`);
|
188
|
-
(0,
|
187
|
+
(0, xplat_utils_1.updateFile)(tree, `${dirPath}/.eslintrc.json`, `{
|
189
188
|
"extends": "${relativePath}/.eslintrc.json",
|
190
189
|
"ignorePatterns": [
|
191
190
|
"!**/*"
|
@@ -250,37 +249,36 @@ import '@nativescript/zone-js';
|
|
250
249
|
return tree;
|
251
250
|
}
|
252
251
|
function updateRootPackage(tree, context) {
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
})(tree, context);
|
252
|
+
const json = (0, xplat_utils_1.getJsonFromFile)(tree, 'package.json');
|
253
|
+
json.scripts = json.scripts || {};
|
254
|
+
const nativeScriptDeps = {
|
255
|
+
'@nativescript/angular': nsNgScopedVersion,
|
256
|
+
'@nativescript/core': nsCoreVersion,
|
257
|
+
};
|
258
|
+
const nativeScriptDevDeps = {
|
259
|
+
'@nativescript/types': nsCoreVersion,
|
260
|
+
'@nativescript/webpack': nsWebpackVersion,
|
261
|
+
};
|
262
|
+
json.dependencies = json.dependencies || {};
|
263
|
+
json.dependencies = Object.assign(Object.assign(Object.assign({}, json.dependencies), (hasNativeScriptApps ? nativeScriptDeps : {})), { '@ngx-translate/core': ngxTranslateVersion });
|
264
|
+
let ngToolsDeps = {
|
265
|
+
'@ngtools/webpack': angularVersion
|
266
|
+
};
|
267
|
+
if (json.dependencies['@angular/core']) {
|
268
|
+
// make sure in sync with current angular versions
|
269
|
+
ngToolsDeps['@ngtools/webpack'] = json.dependencies['@angular/core'];
|
270
|
+
}
|
271
|
+
else {
|
272
|
+
ngToolsDeps = null;
|
273
|
+
}
|
274
|
+
delete json.dependencies['nativescript-angular'];
|
275
|
+
delete json.dependencies['tns-core-modules'];
|
276
|
+
delete json.devDependencies['tns-core-modules'];
|
277
|
+
delete json.dependencies['tns-platform-declarations'];
|
278
|
+
delete json.devDependencies['tns-platform-declarations'];
|
279
|
+
json.devDependencies = json.devDependencies || {};
|
280
|
+
json.devDependencies = Object.assign(Object.assign(Object.assign({}, json.devDependencies), (hasNativeScriptApps ? nativeScriptDevDeps : {})), (ngToolsDeps ? ngToolsDeps : {}));
|
281
|
+
return (0, xplat_utils_1.updateJsonFile)(tree, 'package.json', json);
|
284
282
|
}
|
285
283
|
function default_1() {
|
286
284
|
return (0, schematics_1.chain)([
|
package/migrations.json
CHANGED
@@ -1,30 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"schematics": {
|
3
|
-
"update-to-10.2.0": {
|
4
|
-
"version": "10.2.0",
|
5
|
-
"description": "Migrate workspace to 10.2.0",
|
6
|
-
"factory": "./migrations/update-10-2-0/update-10-2-0"
|
7
|
-
},
|
8
|
-
"update-to-11.0.0": {
|
9
|
-
"version": "11.0.21",
|
10
|
-
"description": "Migrate workspace to 11.0.0",
|
11
|
-
"factory": "./migrations/update-11-0-0/update-11-0-0"
|
12
|
-
},
|
13
|
-
"update-to-11-imports": {
|
14
|
-
"version": "11.0.21",
|
15
|
-
"description": "Migrate workspace to use v11 import barrels",
|
16
|
-
"factory": "./migrations/update-11-0-0/update-to-11-imports"
|
17
|
-
},
|
18
|
-
"update-to-11-env-base": {
|
19
|
-
"version": "11.0.21",
|
20
|
-
"description": "Migrate workspace to use v11 env base option",
|
21
|
-
"factory": "./migrations/update-11-0-0/update-to-11-env-base"
|
22
|
-
},
|
23
|
-
"update-to-11-clean-old-dirs": {
|
24
|
-
"version": "11.0.21",
|
25
|
-
"description": "Remove old dirs",
|
26
|
-
"factory": "./migrations/update-11-0-0/clean-old-dirs"
|
27
|
-
},
|
28
3
|
"update-to-12.4.3": {
|
29
4
|
"version": "12.4.3",
|
30
5
|
"description": "Migrate workspace to 12.4.3",
|
@@ -37,47 +12,6 @@
|
|
37
12
|
}
|
38
13
|
},
|
39
14
|
"packageJsonUpdates": {
|
40
|
-
"11.0.21": {
|
41
|
-
"version": "11.0.21",
|
42
|
-
"packages": {
|
43
|
-
"@nstudio/angular": {
|
44
|
-
"version": "11.0.21",
|
45
|
-
"alwaysAddToPackageJson": false
|
46
|
-
},
|
47
|
-
"@nstudio/electron": {
|
48
|
-
"version": "11.0.21",
|
49
|
-
"alwaysAddToPackageJson": false
|
50
|
-
},
|
51
|
-
"@nstudio/electron-angular": {
|
52
|
-
"version": "11.0.21",
|
53
|
-
"alwaysAddToPackageJson": false
|
54
|
-
},
|
55
|
-
"@nstudio/ionic": {
|
56
|
-
"version": "11.0.21",
|
57
|
-
"alwaysAddToPackageJson": false
|
58
|
-
},
|
59
|
-
"@nstudio/ionic-angular": {
|
60
|
-
"version": "11.0.21",
|
61
|
-
"alwaysAddToPackageJson": false
|
62
|
-
},
|
63
|
-
"@nstudio/nativescript": {
|
64
|
-
"version": "11.0.21",
|
65
|
-
"alwaysAddToPackageJson": false
|
66
|
-
},
|
67
|
-
"@nstudio/nativescript-angular": {
|
68
|
-
"version": "11.0.21",
|
69
|
-
"alwaysAddToPackageJson": false
|
70
|
-
},
|
71
|
-
"@nstudio/web": {
|
72
|
-
"version": "11.0.21",
|
73
|
-
"alwaysAddToPackageJson": false
|
74
|
-
},
|
75
|
-
"@nstudio/web-angular": {
|
76
|
-
"version": "11.0.21",
|
77
|
-
"alwaysAddToPackageJson": false
|
78
|
-
}
|
79
|
-
}
|
80
|
-
},
|
81
15
|
"12.4.3": {
|
82
16
|
"version": "12.4.3",
|
83
17
|
"packages": {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nstudio/xplat",
|
3
|
-
"version": "15.0.
|
3
|
+
"version": "15.0.4-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": "15.0.
|
45
|
-
"@nstudio/xplat-utils": "15.0.
|
44
|
+
"@nstudio/focus": "15.0.4-rc.0",
|
45
|
+
"@nstudio/xplat-utils": "15.0.4-rc.0"
|
46
46
|
},
|
47
47
|
"author": "Nathan Walker",
|
48
48
|
"license": "MIT",
|
@@ -11,9 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.sandboxHomeSetup = void 0;
|
13
13
|
const schematics_1 = require("@angular-devkit/schematics");
|
14
|
-
const workspace_1 = require("@nrwl/workspace");
|
15
14
|
const testing_utils_1 = require("../../utils/testing-utils");
|
16
15
|
const testing_1 = require("../../utils/testing");
|
16
|
+
const xplat_utils_1 = require("@nstudio/xplat-utils");
|
17
17
|
xdescribe('feature schematic', () => {
|
18
18
|
let appTree;
|
19
19
|
const defaultOptions = {
|
@@ -327,7 +327,7 @@ xdescribe('feature schematic', () => {
|
|
327
327
|
appTree = (0, testing_utils_1.createXplatWithNativeScriptWeb)(appTree, true);
|
328
328
|
// manually update home.component to prep for sandobx
|
329
329
|
const homeCmpPath = `/apps/nativescript-viewer/src/features/home/components/home.component.html`;
|
330
|
-
(0,
|
330
|
+
(0, xplat_utils_1.updateFile)(appTree, homeCmpPath, sandboxHomeSetup());
|
331
331
|
// console.log('homecmp:', getFileContent(tree, homeCmpPath));
|
332
332
|
options.onlyProject = true;
|
333
333
|
options.adjustSandbox = true;
|
package/src/utils/ast.d.ts
CHANGED
@@ -1,77 +1,5 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT- style license that can be
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
7
|
-
*/
|
8
|
-
import { Tree } from '@angular-devkit/schematics';
|
9
1
|
import * as ts from 'typescript';
|
10
|
-
|
11
|
-
|
12
|
-
export
|
13
|
-
|
14
|
-
readonly type: string;
|
15
|
-
readonly path: string | null;
|
16
|
-
readonly order: number;
|
17
|
-
readonly description: string;
|
18
|
-
}
|
19
|
-
export declare class NoopChange implements Change {
|
20
|
-
type: string;
|
21
|
-
description: string;
|
22
|
-
order: number;
|
23
|
-
path: any;
|
24
|
-
apply(): Promise<void>;
|
25
|
-
}
|
26
|
-
export declare class InsertChange implements Change {
|
27
|
-
path: string;
|
28
|
-
pos: number;
|
29
|
-
toAdd: string;
|
30
|
-
type: string;
|
31
|
-
order: number;
|
32
|
-
description: string;
|
33
|
-
constructor(path: string, pos: number, toAdd: string);
|
34
|
-
apply(host: any): any;
|
35
|
-
}
|
36
|
-
export declare class RemoveChange implements Change {
|
37
|
-
path: string;
|
38
|
-
private pos;
|
39
|
-
private toRemove;
|
40
|
-
type: string;
|
41
|
-
order: number;
|
42
|
-
description: string;
|
43
|
-
constructor(path: string, pos: number, toRemove: string);
|
44
|
-
apply(host: any): Promise<void>;
|
45
|
-
}
|
46
|
-
export declare class ReplaceChange implements Change {
|
47
|
-
path: string;
|
48
|
-
pos: number;
|
49
|
-
oldText: string;
|
50
|
-
newText: string;
|
51
|
-
type: string;
|
52
|
-
order: number;
|
53
|
-
description: string;
|
54
|
-
constructor(path: string, pos: number, oldText: string, newText: string);
|
55
|
-
apply(host: any): Promise<void>;
|
56
|
-
}
|
57
|
-
export declare function addParameterToConstructor(source: ts.SourceFile, modulePath: string, opts: {
|
58
|
-
className: string;
|
59
|
-
param: string;
|
60
|
-
}): Change[];
|
61
|
-
export declare function addMethod(source: ts.SourceFile, modulePath: string, opts: {
|
62
|
-
className: string;
|
63
|
-
methodHeader: string;
|
64
|
-
body: string;
|
65
|
-
}): Change[];
|
66
|
-
export declare function findClass(source: ts.SourceFile, className: string, silent?: boolean): ts.ClassDeclaration;
|
67
|
-
export declare function offset(text: string, numberOfTabs: number, wrap: boolean): string;
|
68
|
-
export declare function addIncludeToTsConfig(tsConfigPath: string, source: ts.SourceFile, include: string): Change[];
|
69
|
-
export declare function getImport(source: ts.SourceFile, predicate: (a: any) => boolean): {
|
70
|
-
moduleSpec: string;
|
71
|
-
bindings: string[];
|
72
|
-
}[];
|
73
|
-
export declare function addGlobal(source: ts.SourceFile, modulePath: string, statement: string, isExport?: boolean): Change[];
|
74
|
-
export declare function insert(host: Tree, modulePath: string, changes: Change[]): void;
|
75
|
-
export declare function getProjectConfig(tree: Tree, name: string): any;
|
76
|
-
export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean): Change;
|
77
|
-
export declare function replaceNodeValue(host: Tree, modulePath: string, node: ts.Node, content: string): void;
|
2
|
+
import { Tree } from '@nrwl/devkit';
|
3
|
+
import { Tree as NgTree } from '@angular-devkit/schematics';
|
4
|
+
export declare function addGlobal(tree: Tree, source: ts.SourceFile, modulePath: string, statement: string, isExport?: boolean): ts.SourceFile[];
|
5
|
+
export declare function insert(host: NgTree, modulePath: string, changes: any[]): void;
|