Skip to content

Commit

Permalink
chore: TypeScript 5.1 with Nx 16.6 migrations (#10338)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Aug 11, 2023
1 parent 7a353ec commit d3a0f2c
Show file tree
Hide file tree
Showing 61 changed files with 731 additions and 473 deletions.
13 changes: 9 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,7 +23,7 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nrwl/nx/typescript"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nx/typescript"],
"rules": {
"no-empty": "off",
"no-useless-escape": "off",
Expand All @@ -43,14 +43,19 @@
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["references.d.ts"],
"rules": {
"@typescript-eslint/triple-slash-reference": "off"
}
},
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
}
18 changes: 9 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/platforms": true,
"**/*.js": true,
"**/*.js.map": true
}
}
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/platforms": true,
"**/*.js": true,
"**/*.js.map": true
},
"eslint.validate": ["json"]
}
2 changes: 1 addition & 1 deletion apps/automated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@nativescript/ios": "~8.5.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"circular-dependency-plugin": "^5.2.2",
"typescript": "~4.9.5"
"typescript": "5.1.6"
},
"gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3",
"readme": "NativeScript Application"
Expand Down
4 changes: 2 additions & 2 deletions apps/automated/src/pages/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "testsapp",
"main": "app.js"
"name": "testsapp",
"main": "app.js"
}
2 changes: 1 addition & 1 deletion apps/automated/src/ui/lifecycle/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"main": "lifecycle-tests"
"main": "lifecycle-tests"
}
12 changes: 6 additions & 6 deletions apps/automated/src/ui/repeater/repeater-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,15 @@ export var test_RepeaterItemsGestureBindings = function () {
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
};

export var test_RepeaterItemsParentBindingsShouldWork = function () {
export var test_RepeaterItemsBindingsShouldWork = function () {
var testFunc = function (page: Page) {
var repeater = <Repeater>page.getViewById('repeater');
var expectedText = page.bindingContext['parentViewProperty'];
var testPass = false;
var expectedText = page.bindingContext['items'];
var testPass: string;
var eachChildCallback = function (childItem: View) {
if (childItem instanceof Label) {
testPass = (<Label>childItem).text === expectedText;
if (testPass === false) {
testPass = (<Label>childItem).text;
if (!testPass) {
return false;
}
} else if (childItem instanceof LayoutBase) {
Expand All @@ -494,7 +494,7 @@ export var test_RepeaterItemsParentBindingsShouldWork = function () {

repeater.eachChildView(eachChildCallback);

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

helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function pageLoaded(args) {
export function pageLoaded(args) {
var page = args.object;
page.bindingContext = {
items: [
Expand All @@ -18,8 +18,3 @@ function pageLoaded(args) {
parentViewProperty: 'Parent View Property',
};
}
exports.pageLoaded = pageLoaded;

exports.tapPage = function (args) {
console.log('Tap! ' + args + ' ' + args.object);
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
<Repeater id="repeater" items="{{ items }}">
<Repeater.itemTemplate>
<GridLayout width="94" height="94" >
<Label text="{{ $parents['Page'].parentViewProperty }}" tap="{{ tapItem }}" />
<GridLayout width="94" height="94">
<Label text="{{ text }}" tap="{{ tapItem }}" />
</GridLayout>
</Repeater.itemTemplate>
</Repeater>
Expand Down
4 changes: 2 additions & 2 deletions apps/automated/src/ui/root-view/mymodule/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "MyControl",
"main": "MyControl.js"
"name": "MyControl",
"main": "MyControl.js"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "MyControl",
"main": "MyControl.js"
"name": "MyControl",
"main": "MyControl.js"
}
4 changes: 2 additions & 2 deletions apps/automated/src/xml-declaration/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "xml-declaration",
"main": "app.js"
"name": "xml-declaration",
"main": "app.js"
}
2 changes: 1 addition & 1 deletion apps/toolbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "~8.5.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"typescript": "~4.9.5"
"typescript": "5.1.6"
}
}
2 changes: 1 addition & 1 deletion apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "~8.5.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"typescript": "~4.9.5"
"typescript": "5.1.6"
},
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
"readme": "NativeScript Application",
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Application.on('displayed', (args) => {
Application.on('uncaughtError', (args) => {
const error = args.error;
console.warn(error.message);
if (error.nativeError) {
console.warn('native error: ' + error.nativeError);
if (error.nativeException) {
console.warn('native error: ' + error.nativeException);
}
});

Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');

export default { projects: getJestProjects() };
2 changes: 1 addition & 1 deletion jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const nxPreset = require('@nrwl/jest/preset').default;
const nxPreset = require('@nx/jest/preset').default;

module.exports = {
...nxPreset,
Expand Down
124 changes: 124 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"migrations": [
{
"cli": "nx",
"version": "16.0.0-beta.0",
"description": "Remove @nrwl/cli.",
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
"package": "nx",
"name": "16.0.0-remove-nrwl-cli"
},
{
"cli": "nx",
"version": "16.0.0-beta.9",
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
"package": "nx",
"name": "16.0.0-tokens-for-depends-on"
},
{
"cli": "nx",
"version": "16.0.0-beta.0",
"description": "Replace @nrwl/nx-cloud with nx-cloud",
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
"package": "nx",
"name": "16.0.0-update-nx-cloud-runner"
},
{
"cli": "nx",
"version": "16.2.0-beta.0",
"description": "Remove outputPath from run commands",
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
"package": "nx",
"name": "16.2.0-remove-output-path-from-run-commands"
},
{
"cli": "nx",
"version": "16.6.0-beta.6",
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
"package": "nx",
"name": "16.6.0-prefix-outputs"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/workspace with @nx/workspace",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/workspace",
"name": "update-16-0-0-add-nx-packages"
},
{
"version": "16.0.0-beta.4",
"description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
"cli": "nx",
"implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
"package": "@nx/workspace",
"name": "16-0-0-move-workspace-generators-into-local-plugin"
},
{
"version": "16.0.0-beta.9",
"description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
"cli": "nx",
"implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
"package": "@nx/workspace",
"name": "16-0-0-fix-invalid-babelrc"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/eslint-plugin with @nx/eslint-plugin",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/eslint-plugin",
"name": "update-16-0-0-add-nx-packages"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/node with @nx/node",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/node",
"name": "update-16-0-0-add-nx-packages"
},
{
"cli": "nx",
"version": "16.0.0-beta.5",
"description": "Replace @nx/node:webpack with @nx/node:webpack",
"implementation": "./src/migrations/update-16-0-0/update-webpack-executor",
"package": "@nx/node",
"name": "update-16-0-0-update-executor"
},
{
"cli": "nx",
"version": "16.3.1-beta.0",
"description": "Replace @nx/node:webpack and @nx/node:webpack with @nx/webpack:webpack for all project targets",
"implementation": "./src/migrations/update-16-3-1/update-webpack-executor",
"package": "@nx/node",
"name": "update-16-3-1-update-executor"
},
{
"cli": "nx",
"version": "16.4.0-beta.8",
"description": "Replace @nx/node:node with @nx/js:node for all project targets",
"implementation": "./src/migrations/update-16-4-0/replace-node-executor",
"package": "@nx/node",
"name": "update-16-4-0-replace-node-executor"
},
{
"cli": "nx",
"version": "16.0.0-beta.1",
"description": "Replace @nx/jest with @nx/jest",
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
"package": "@nx/jest",
"name": "update-16-0-0-add-nx-packages"
},
{
"cli": "nx",
"version": "16.5.0-beta.2",
"description": "Add test-setup.ts to ignored files in production input",
"implementation": "./src/migrations/update-16-5-0/add-test-setup-to-inputs-ignore",
"package": "@nx/jest",
"name": "add-test-setup-to-inputs-ignore"
}
]
}
30 changes: 15 additions & 15 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"runner": "nx-cloud",
"options": {
"useDaemonProcess": false,
"cacheableOperations": ["build", "lint", "test", "ios", "android", "e2e"],
Expand All @@ -18,11 +18,6 @@
}
},
"generators": {
"@nrwl/workspace": {
"library": {
"linter": "eslint"
}
},
"@nrwl/cypress": {
"cypress-project": {
"linter": "eslint"
Expand All @@ -46,14 +41,6 @@
"linter": "eslint"
}
},
"@nrwl/node": {
"application": {
"linter": "eslint"
},
"library": {
"linter": "eslint"
}
},
"@nrwl/nx-plugin": {
"plugin": {
"linter": "eslint"
Expand All @@ -71,6 +58,19 @@
"library": {
"linter": "eslint"
}
},
"@nx/workspace": {
"library": {
"linter": "eslint"
}
},
"@nx/node": {
"application": {
"linter": "eslint"
},
"library": {
"linter": "eslint"
}
}
},
"affected": {
Expand All @@ -80,7 +80,7 @@
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/nx.json"],
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s"]
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/src/test-setup.[jt]s"]
},
"targetDefaults": {
"build": {
Expand Down
Loading

0 comments on commit d3a0f2c

Please sign in to comment.