Skip to content

Commit d3a0f2c

Browse files
authored
chore: TypeScript 5.1 with Nx 16.6 migrations (#10338)
1 parent 7a353ec commit d3a0f2c

File tree

61 files changed

+731
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+731
-473
lines changed

.eslintrc.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nrwl/nx"],
4+
"plugins": ["@nx"],
55
"overrides": [
66
{
77
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
88
"rules": {
9-
"@nrwl/nx/enforce-module-boundaries": [
9+
"@nx/enforce-module-boundaries": [
1010
"error",
1111
{
1212
"enforceBuildableLibDependency": true,
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"files": ["*.ts", "*.tsx"],
26-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nrwl/nx/typescript"],
26+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nx/typescript"],
2727
"rules": {
2828
"no-empty": "off",
2929
"no-useless-escape": "off",
@@ -43,14 +43,19 @@
4343
},
4444
{
4545
"files": ["*.js", "*.jsx"],
46-
"extends": ["plugin:@nrwl/nx/javascript"],
46+
"extends": ["plugin:@nx/javascript"],
4747
"rules": {}
4848
},
4949
{
5050
"files": ["references.d.ts"],
5151
"rules": {
5252
"@typescript-eslint/triple-slash-reference": "off"
5353
}
54+
},
55+
{
56+
"files": "*.json",
57+
"parser": "jsonc-eslint-parser",
58+
"rules": {}
5459
}
5560
]
5661
}

.vscode/settings.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Place your settings in this file to overwrite default and user settings.
21
{
3-
"search.exclude": {
4-
"**/node_modules": true,
5-
"**/bower_components": true,
6-
"**/platforms": true,
7-
"**/*.js": true,
8-
"**/*.js.map": true
9-
}
10-
}
2+
"search.exclude": {
3+
"**/node_modules": true,
4+
"**/bower_components": true,
5+
"**/platforms": true,
6+
"**/*.js": true,
7+
"**/*.js.map": true
8+
},
9+
"eslint.validate": ["json"]
10+
}

apps/automated/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@nativescript/ios": "~8.5.0",
1616
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
1717
"circular-dependency-plugin": "^5.2.2",
18-
"typescript": "~4.9.5"
18+
"typescript": "5.1.6"
1919
},
2020
"gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3",
2121
"readme": "NativeScript Application"

apps/automated/src/pages/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "testsapp",
3-
"main": "app.js"
2+
"name": "testsapp",
3+
"main": "app.js"
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"main": "lifecycle-tests"
2+
"main": "lifecycle-tests"
33
}

apps/automated/src/ui/repeater/repeater-tests.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,15 +474,15 @@ export var test_RepeaterItemsGestureBindings = function () {
474474
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
475475
};
476476

477-
export var test_RepeaterItemsParentBindingsShouldWork = function () {
477+
export var test_RepeaterItemsBindingsShouldWork = function () {
478478
var testFunc = function (page: Page) {
479479
var repeater = <Repeater>page.getViewById('repeater');
480-
var expectedText = page.bindingContext['parentViewProperty'];
481-
var testPass = false;
480+
var expectedText = page.bindingContext['items'];
481+
var testPass: string;
482482
var eachChildCallback = function (childItem: View) {
483483
if (childItem instanceof Label) {
484-
testPass = (<Label>childItem).text === expectedText;
485-
if (testPass === false) {
484+
testPass = (<Label>childItem).text;
485+
if (!testPass) {
486486
return false;
487487
}
488488
} else if (childItem instanceof LayoutBase) {
@@ -494,7 +494,7 @@ export var test_RepeaterItemsParentBindingsShouldWork = function () {
494494

495495
repeater.eachChildView(eachChildCallback);
496496

497-
TKUnit.assertEqual(testPass, true, 'Every item should have text bound to Page binding context!');
497+
TKUnit.assertEqual(!!testPass, true, 'Every item should have text bound to binding context!');
498498
};
499499

500500
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);

apps/automated/src/ui/repeater/repeaterItems-bindingToGestures-page.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function pageLoaded(args) {
1+
export function pageLoaded(args) {
22
var page = args.object;
33
page.bindingContext = {
44
items: [
@@ -18,8 +18,3 @@ function pageLoaded(args) {
1818
parentViewProperty: 'Parent View Property',
1919
};
2020
}
21-
exports.pageLoaded = pageLoaded;
22-
23-
exports.tapPage = function (args) {
24-
console.log('Tap! ' + args + ' ' + args.object);
25-
};

apps/automated/src/ui/repeater/repeaterItems-bindingToGestures-page.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
22
<Repeater id="repeater" items="{{ items }}">
33
<Repeater.itemTemplate>
4-
<GridLayout width="94" height="94" >
5-
<Label text="{{ $parents['Page'].parentViewProperty }}" tap="{{ tapItem }}" />
4+
<GridLayout width="94" height="94">
5+
<Label text="{{ text }}" tap="{{ tapItem }}" />
66
</GridLayout>
77
</Repeater.itemTemplate>
88
</Repeater>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "MyControl",
3-
"main": "MyControl.js"
2+
"name": "MyControl",
3+
"main": "MyControl.js"
44
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "MyControl",
3-
"main": "MyControl.js"
2+
"name": "MyControl",
3+
"main": "MyControl.js"
44
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "xml-declaration",
3-
"main": "app.js"
2+
"name": "xml-declaration",
3+
"main": "app.js"
44
}

apps/toolbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"@nativescript/android": "~8.5.0",
1616
"@nativescript/ios": "~8.5.0",
1717
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
18-
"typescript": "~4.9.5"
18+
"typescript": "5.1.6"
1919
}
2020
}

apps/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@nativescript/android": "~8.5.0",
1515
"@nativescript/ios": "~8.5.0",
1616
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
17-
"typescript": "~4.9.5"
17+
"typescript": "5.1.6"
1818
},
1919
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
2020
"readme": "NativeScript Application",

apps/ui/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Application.on('displayed', (args) => {
1818
Application.on('uncaughtError', (args) => {
1919
const error = args.error;
2020
console.warn(error.message);
21-
if (error.nativeError) {
22-
console.warn('native error: ' + error.nativeError);
21+
if (error.nativeException) {
22+
console.warn('native error: ' + error.nativeException);
2323
}
2424
});
2525

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const { getJestProjects } = require('@nrwl/jest');
1+
const { getJestProjects } = require('@nx/jest');
22

33
export default { projects: getJestProjects() };

jest.preset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const nxPreset = require('@nrwl/jest/preset').default;
1+
const nxPreset = require('@nx/jest/preset').default;
22

33
module.exports = {
44
...nxPreset,

migrations.json

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"migrations": [
3+
{
4+
"cli": "nx",
5+
"version": "16.0.0-beta.0",
6+
"description": "Remove @nrwl/cli.",
7+
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
8+
"package": "nx",
9+
"name": "16.0.0-remove-nrwl-cli"
10+
},
11+
{
12+
"cli": "nx",
13+
"version": "16.0.0-beta.9",
14+
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
15+
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
16+
"package": "nx",
17+
"name": "16.0.0-tokens-for-depends-on"
18+
},
19+
{
20+
"cli": "nx",
21+
"version": "16.0.0-beta.0",
22+
"description": "Replace @nrwl/nx-cloud with nx-cloud",
23+
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
24+
"package": "nx",
25+
"name": "16.0.0-update-nx-cloud-runner"
26+
},
27+
{
28+
"cli": "nx",
29+
"version": "16.2.0-beta.0",
30+
"description": "Remove outputPath from run commands",
31+
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
32+
"package": "nx",
33+
"name": "16.2.0-remove-output-path-from-run-commands"
34+
},
35+
{
36+
"cli": "nx",
37+
"version": "16.6.0-beta.6",
38+
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
39+
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
40+
"package": "nx",
41+
"name": "16.6.0-prefix-outputs"
42+
},
43+
{
44+
"cli": "nx",
45+
"version": "16.0.0-beta.1",
46+
"description": "Replace @nx/workspace with @nx/workspace",
47+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
48+
"package": "@nx/workspace",
49+
"name": "update-16-0-0-add-nx-packages"
50+
},
51+
{
52+
"version": "16.0.0-beta.4",
53+
"description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
54+
"cli": "nx",
55+
"implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
56+
"package": "@nx/workspace",
57+
"name": "16-0-0-move-workspace-generators-into-local-plugin"
58+
},
59+
{
60+
"version": "16.0.0-beta.9",
61+
"description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
62+
"cli": "nx",
63+
"implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
64+
"package": "@nx/workspace",
65+
"name": "16-0-0-fix-invalid-babelrc"
66+
},
67+
{
68+
"cli": "nx",
69+
"version": "16.0.0-beta.1",
70+
"description": "Replace @nx/eslint-plugin with @nx/eslint-plugin",
71+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
72+
"package": "@nx/eslint-plugin",
73+
"name": "update-16-0-0-add-nx-packages"
74+
},
75+
{
76+
"cli": "nx",
77+
"version": "16.0.0-beta.1",
78+
"description": "Replace @nx/node with @nx/node",
79+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
80+
"package": "@nx/node",
81+
"name": "update-16-0-0-add-nx-packages"
82+
},
83+
{
84+
"cli": "nx",
85+
"version": "16.0.0-beta.5",
86+
"description": "Replace @nx/node:webpack with @nx/node:webpack",
87+
"implementation": "./src/migrations/update-16-0-0/update-webpack-executor",
88+
"package": "@nx/node",
89+
"name": "update-16-0-0-update-executor"
90+
},
91+
{
92+
"cli": "nx",
93+
"version": "16.3.1-beta.0",
94+
"description": "Replace @nx/node:webpack and @nx/node:webpack with @nx/webpack:webpack for all project targets",
95+
"implementation": "./src/migrations/update-16-3-1/update-webpack-executor",
96+
"package": "@nx/node",
97+
"name": "update-16-3-1-update-executor"
98+
},
99+
{
100+
"cli": "nx",
101+
"version": "16.4.0-beta.8",
102+
"description": "Replace @nx/node:node with @nx/js:node for all project targets",
103+
"implementation": "./src/migrations/update-16-4-0/replace-node-executor",
104+
"package": "@nx/node",
105+
"name": "update-16-4-0-replace-node-executor"
106+
},
107+
{
108+
"cli": "nx",
109+
"version": "16.0.0-beta.1",
110+
"description": "Replace @nx/jest with @nx/jest",
111+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
112+
"package": "@nx/jest",
113+
"name": "update-16-0-0-add-nx-packages"
114+
},
115+
{
116+
"cli": "nx",
117+
"version": "16.5.0-beta.2",
118+
"description": "Add test-setup.ts to ignored files in production input",
119+
"implementation": "./src/migrations/update-16-5-0/add-test-setup-to-inputs-ignore",
120+
"package": "@nx/jest",
121+
"name": "add-test-setup-to-inputs-ignore"
122+
}
123+
]
124+
}

nx.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"tasksRunnerOptions": {
88
"default": {
9-
"runner": "@nrwl/nx-cloud",
9+
"runner": "nx-cloud",
1010
"options": {
1111
"useDaemonProcess": false,
1212
"cacheableOperations": ["build", "lint", "test", "ios", "android", "e2e"],
@@ -18,11 +18,6 @@
1818
}
1919
},
2020
"generators": {
21-
"@nrwl/workspace": {
22-
"library": {
23-
"linter": "eslint"
24-
}
25-
},
2621
"@nrwl/cypress": {
2722
"cypress-project": {
2823
"linter": "eslint"
@@ -46,14 +41,6 @@
4641
"linter": "eslint"
4742
}
4843
},
49-
"@nrwl/node": {
50-
"application": {
51-
"linter": "eslint"
52-
},
53-
"library": {
54-
"linter": "eslint"
55-
}
56-
},
5744
"@nrwl/nx-plugin": {
5845
"plugin": {
5946
"linter": "eslint"
@@ -71,6 +58,19 @@
7158
"library": {
7259
"linter": "eslint"
7360
}
61+
},
62+
"@nx/workspace": {
63+
"library": {
64+
"linter": "eslint"
65+
}
66+
},
67+
"@nx/node": {
68+
"application": {
69+
"linter": "eslint"
70+
},
71+
"library": {
72+
"linter": "eslint"
73+
}
7474
}
7575
},
7676
"affected": {
@@ -80,7 +80,7 @@
8080
"namedInputs": {
8181
"default": ["{projectRoot}/**/*", "sharedGlobals"],
8282
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/nx.json"],
83-
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s"]
83+
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/src/test-setup.[jt]s"]
8484
},
8585
"targetDefaults": {
8686
"build": {

0 commit comments

Comments
 (0)