diff --git a/.vscode/settings.json b/.vscode/settings.json index 3a51bc298..5acd7ae98 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,5 @@ "**/platforms": true, "**/*.js": true, "**/*.js.map": true - }, - "tslint.configFile": "./build/tslint.json" + } } \ No newline at end of file diff --git a/apps/automated/package.json b/apps/automated/package.json index 7c22fd46e..154e9cf95 100644 --- a/apps/automated/package.json +++ b/apps/automated/package.json @@ -11,10 +11,10 @@ "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core" }, "devDependencies": { - "@nativescript/android": "~8.3.0", - "@nativescript/ios": "~8.3.0", + "@nativescript/android": "~8.4.0", + "@nativescript/ios": "~8.4.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "4.8.4" + "typescript": "~4.9.5" }, "gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3", "readme": "NativeScript Application" diff --git a/apps/toolbox/package.json b/apps/toolbox/package.json index 88fd27c87..636850fce 100644 --- a/apps/toolbox/package.json +++ b/apps/toolbox/package.json @@ -12,9 +12,9 @@ "@nativescript/imagepicker": "^1.0.6" }, "devDependencies": { - "@nativescript/android": "~8.3.0", - "@nativescript/ios": "~8.3.0", + "@nativescript/android": "~8.4.0", + "@nativescript/ios": "~8.4.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "4.8.4" + "typescript": "~4.9.5" } } diff --git a/apps/ui/package.json b/apps/ui/package.json index 2790dc201..f097078ff 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -11,10 +11,10 @@ "@nativescript/core": "file:../../packages/core" }, "devDependencies": { - "@nativescript/android": "~8.3.0", - "@nativescript/ios": "~8.3.0", + "@nativescript/android": "~8.4.0", + "@nativescript/ios": "~8.4.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "4.8.4" + "typescript": "~4.9.5" }, "gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4", "readme": "NativeScript Application", diff --git a/nx.json b/nx.json index bfcc2e8a8..53d69cccd 100644 --- a/nx.json +++ b/nx.json @@ -79,7 +79,7 @@ "$schema": "./node_modules/nx/schemas/nx-schema.json", "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], - "sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/tslint.json", "{workspaceRoot}/nx.json"], + "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"] }, "targetDefaults": { diff --git a/package.json b/package.json index a085d1fd2..f5a4a69f1 100644 --- a/package.json +++ b/package.json @@ -18,28 +18,25 @@ "url": "https://github.com/NativeScript/NativeScript.git" }, "dependencies": { - "@nrwl/nx-cloud": "^15.0.2", + "@nrwl/nx-cloud": "15.0.3", "nativescript-theme-core": "^1.0.4" }, "devDependencies": { "@nativescript/hook": "^2.0.0", - "@nativescript/nx": "~4.1.0", - "@nrwl/cli": "15.2.1", - "@nrwl/eslint-plugin-nx": "15.2.1", - "@nrwl/jest": "15.2.1", - "@nrwl/node": "15.2.1", - "@nrwl/workspace": "15.2.1", + "@nativescript/nx": "~4.2.0", + "@nrwl/cli": "15.6.3", + "@nrwl/eslint-plugin-nx": "15.6.3", + "@nrwl/jest": "15.6.3", + "@nrwl/node": "15.6.3", + "@nrwl/workspace": "15.6.3", "@nstudio/focus": "^15.0.0", "@nstudio/nps-i": "~2.0.0", "@prettier/plugin-xml": "^2.2.0", - "@types/chai": "^4.2.11", - "@types/jest": "29.2.3", - "@types/mocha": "^7.0.2", + "@types/jest": "29.4.0", "@types/node": "18.7.1", "@typescript-eslint/eslint-plugin": "^5.30.0", "@typescript-eslint/parser": "^5.30.0", - "chai": "^4.2.0", - "conventional-changelog-cli": "^2.1.1", + "conventional-changelog-cli": "^2.2.2", "copyfiles": "^2.4.0", "css": "^3.0.0", "css-tree": "^1.1.2", @@ -49,14 +46,12 @@ "eslint-config-prettier": "^8.1.0", "gonzales": "^1.0.7", "husky": "^8.0.1", - "jest": "29.3.1", - "lint-staged": "^13.0.1", - "mocha": "^8.0.1", - "mocha-typescript": "^1.1.17", + "jest": "29.4.1", + "lint-staged": "^13.1.0", "module-alias": "^2.2.2", - "nativescript": "~8.3.0", + "nativescript": "~8.4.0", "nativescript-typedoc-theme": "1.1.0", - "nx": "15.2.1", + "nx": "15.6.3", "parse-css": "git+https://github.com/tabatkins/parse-css.git", "parserlib": "^1.1.1", "prettier": "^2.6.2", @@ -64,14 +59,12 @@ "sass": "^1.45.2", "shady-css-parser": "^0.1.0", "tree-kill": "^1.2.2", - "ts-jest": "29.0.3", + "ts-jest": "29.0.5", "ts-node": "10.9.1", - "ts-patch": "^2.0.1", - "tslib": "^2.4.0", - "tslint": "6.1.3", - "tslint-to-eslint-config": "^2.13.0", - "typedoc": "^0.22.17", - "typescript": "4.8.4", + "ts-patch": "^2.1.0", + "tslib": "^2.5.0", + "typedoc": "^0.23.24", + "typescript": "~4.9.5", "zx": "^7.0.5" }, "lint-staged": { @@ -80,3 +73,4 @@ ] } } + diff --git a/packages/core/ui/builder/component-builder/index.ts b/packages/core/ui/builder/component-builder/index.ts index 14943cd36..757cd282a 100644 --- a/packages/core/ui/builder/component-builder/index.ts +++ b/packages/core/ui/builder/component-builder/index.ts @@ -102,25 +102,22 @@ const createComponentInstance = profile('createComponentInstance', (elementName: return { instance, instanceModule }; }); -const getComponentModuleExports = profile( - 'getComponentModuleExports', - (instance: View, moduleExports: Object, attributes: Object): Object => { - if (attributes) { - const codeFileAttribute = attributes[CODE_FILE] || attributes[IMPORT]; - if (codeFileAttribute) { - const resolvedCodeFileModule = resolveModuleName(sanitizeModuleName(codeFileAttribute), ''); - if (resolvedCodeFileModule) { - moduleExports = global.loadModule(resolvedCodeFileModule, true); - (instance).exports = moduleExports; - } else { - throw new Error(`Code file with path "${codeFileAttribute}" cannot be found! Looking for webpack module with name "${resolvedCodeFileModule}"`); - } +const getComponentModuleExports = profile('getComponentModuleExports', (instance: View, moduleExports: Object, attributes: Object): Object => { + if (attributes) { + const codeFileAttribute = attributes[CODE_FILE] || attributes[IMPORT]; + if (codeFileAttribute) { + const resolvedCodeFileModule = resolveModuleName(sanitizeModuleName(codeFileAttribute), ''); + if (resolvedCodeFileModule) { + moduleExports = global.loadModule(resolvedCodeFileModule, true); + (instance).exports = moduleExports; + } else { + throw new Error(`Code file with path "${codeFileAttribute}" cannot be found! Looking for webpack module with name "${resolvedCodeFileModule}"`); } } - - return moduleExports; } -); + + return moduleExports; +}); const applyComponentCss = profile('applyComponentCss', (instance: View, moduleName: string, attributes: Object) => { let cssApplied = false; @@ -249,5 +246,5 @@ function isBinding(value: any): boolean { // For example, ListView.itemTemplateSelector const KNOWN_FUNCTIONS = 'knownFunctions'; function isKnownFunction(name: string, instance: View): boolean { - return instance.constructor && KNOWN_FUNCTIONS in instance.constructor && instance.constructor[KNOWN_FUNCTIONS].indexOf(name) !== -1; + return instance.constructor && KNOWN_FUNCTIONS in instance.constructor && (instance.constructor[KNOWN_FUNCTIONS] as string).indexOf(name) !== -1; } diff --git a/packages/core/ui/core/properties/index.ts b/packages/core/ui/core/properties/index.ts index b8c0de16b..1eedb390e 100644 --- a/packages/core/ui/core/properties/index.ts +++ b/packages/core/ui/core/properties/index.ts @@ -243,7 +243,7 @@ export class Property implements TypedPropertyDescriptor< } } - const oldValue = key in this ? this[key] : defaultValue; + const oldValue = (key in this ? this[key] : defaultValue); const changed: boolean = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value; if (wrapped || changed) { @@ -310,11 +310,11 @@ export class Property implements TypedPropertyDescriptor< }; this.get = function (this: T): U { - return key in this ? this[key] : defaultValue; + return (key in this ? this[key] : defaultValue); }; this.nativeValueChange = function (owner: T, value: U): void { - const oldValue = key in owner ? owner[key] : defaultValue; + const oldValue = (key in owner ? owner[key] : defaultValue); const changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value; if (changed) { owner[key] = value; @@ -406,7 +406,7 @@ export class CoercibleProperty extends Property imp }; this.coerce = function (target: T): void { - const originalValue: U = coerceKey in target ? target[coerceKey] : defaultValue; + const originalValue = (coerceKey in target ? target[coerceKey] : defaultValue); // need that to make coercing but also fire change events target[propertyName] = originalValue; }; @@ -662,7 +662,7 @@ export class CssProperty implements CssProperty { value = valueConverter && typeof newValue === 'string' ? valueConverter(newValue) : newValue; } - const oldValue: U = key in this ? this[key] : defaultValue; + const oldValue = (key in this ? this[key] : defaultValue); const changed: boolean = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value; if (changed) { @@ -747,7 +747,7 @@ export class CssProperty implements CssProperty { this[sourceKey] = ValueSource.Css; } - const oldValue: U = key in this ? this[key] : defaultValue; + const oldValue = (key in this ? this[key] : defaultValue); const changed: boolean = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value; if (changed) { diff --git a/packages/webpack5/package.json b/packages/webpack5/package.json index 0f4a73f7b..1ef7a9b7f 100644 --- a/packages/webpack5/package.json +++ b/packages/webpack5/package.json @@ -56,18 +56,18 @@ "devDependencies": { "@angular-devkit/build-angular": "^15.0.1", "@types/css": "0.0.33", - "@types/jest": "29.1.1", + "@types/jest": "29.4.0", "@types/loader-utils": "2.0.3", "@types/lodash.get": "4.4.7", "@types/micromatch": "4.0.2", "@types/sax": "1.2.4", "@types/terser-webpack-plugin": "5.2.0", "@types/webpack-virtual-modules": "0.1.1", - "jest": "29.1.2", - "jest-matcher-utils": "29.1.2", + "jest": "29.4.1", + "jest-matcher-utils": "29.4.1", "nativescript-vue-template-compiler": "2.9.3", - "ts-jest": "29.0.3", - "typescript": "4.8.4" + "ts-jest": "29.0.5", + "typescript": "~4.9.5" }, "peerDependencies": { "nativescript-vue-template-compiler": "^2.8.1" diff --git a/tools/assets/App_Resources/Android/app.gradle b/tools/assets/App_Resources/Android/app.gradle index 1c5f15925..ebf69ee08 100644 --- a/tools/assets/App_Resources/Android/app.gradle +++ b/tools/assets/App_Resources/Android/app.gradle @@ -6,10 +6,11 @@ //} android { - compileSdkVersion 31 + compileSdkVersion 33 + buildToolsVersion "33.0.0" defaultConfig { - minSdkVersion 19 - targetSdkVersion 31 + minSdkVersion 23 + targetSdkVersion 33 generatedDensities = [] } aaptOptions { diff --git a/tools/notes/CodingConvention.md b/tools/notes/CodingConvention.md index e20320c82..1f8ceebe4 100644 --- a/tools/notes/CodingConvention.md +++ b/tools/notes/CodingConvention.md @@ -1,14 +1,5 @@ # NativeScript Modules Coding Convention -## Linting - -We use [TSLint](https://palantir.github.io/tslint/) for linting. Rules are defined in `build/tslint.json`. -Run the tslint from the root of the repo with: - -```bash -npm run tslint -``` - ## Tabs vs Spaces Use 4 spaces indentation.