Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
}
]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ testem.log
.DS_Store
Thumbs.db

.nx/cache
.nx/cache
.nx/workspace-data
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/dist
/coverage

/.nx/cache
/.nx/cache
/.nx/workspace-data
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,37 @@
},
"private": true,
"devDependencies": {
"@nx/devkit": "18.2.3",
"@nx/workspace": "18.2.3",
"@nx/js": "18.2.3",
"@nx/plugin": "18.2.3",
"@nx/jest": "18.2.3",
"@nx/node": "18.2.3",
"@nx/eslint-plugin": "18.2.3",
"@swc-node/register": "^1.9.0",
"@swc/core": "^1.4.0",
"@nx/devkit": "19.3.0",
"@nx/workspace": "19.3.0",
"@nx/js": "19.3.0",
"@nx/plugin": "19.3.0",
"@nx/jest": "19.3.0",
"@nx/node": "19.3.0",
"@nx/eslint-plugin": "19.3.0",
"@swc-node/register": "1.9.2",
"@swc/core": "1.6.1",
"@types/jest": "~29.5.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "7.5.0",
"@typescript-eslint/parser": "7.5.0",
"conventional-changelog-cli": "^2.2.0",
"@typescript-eslint/eslint-plugin": "7.13.1",
"@typescript-eslint/parser": "7.13.1",
"conventional-changelog-cli": "^5.0.0",
"dotenv": "~16.4.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"github-contributors-list": "~1.2.3",
"husky": "~9.0.0",
"jest": "29.7.0",
"nx-cloud": "18.0.0",
"nx": "18.2.3",
"nx-cloud": "19.0.0",
"nx": "19.3.0",
"parse-version-string": "^1.0.1",
"prettier": "2.7.1",
"rxjs": "~7.8.1",
"prettier": "^2.8.0",
"rxjs": "^7.8.1",
"semver": "^7.5.4",
"ts-jest": "29.1.2",
"ts-jest": "29.1.5",
"ts-node": "^10.9.0",
"tslib": "^2.0.0",
"typescript": "5.4.4",
"@nx/eslint": "18.2.3"
"typescript": "5.4.5",
"@nx/eslint": "19.3.0"
},
"lint-staged": {
"**/*.{js,ts,scss,json,html}": [
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-tools/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
"version": "5.2.0",
"description": "Migrate tools to 5.2.0",
"implementation": "./src/migrations/update-5-2-0/update-5-2-0"
},
"update-to-5.3.0": {
"cli": "nx",
"version": "5.3.0",
"description": "Migrate tools to 5.3.0",
"implementation": "./src/migrations/update-5-3-0/update-5-3-0"
}
}
}
32 changes: 16 additions & 16 deletions packages/plugin-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/plugin-tools",
"version": "5.2.5",
"version": "5.3.0",
"description": "NativeScript plugin tooling for workspaces",
"homepage": "https://nativescript.org",
"repository": {
Expand All @@ -27,21 +27,21 @@
},
"dependencies": {
"xml2js": "~0.6.0",
"@nativescript/nx": "^18.0.0",
"@nx/angular": "^18.0.0",
"@nx/devkit": "^18.0.0",
"@nx/workspace": "^18.0.0",
"@nx/js": "^18.0.0",
"@nx/plugin": "^18.0.0",
"@nx/jest": "^18.0.0",
"@nx/node": "^18.0.0",
"@nx/eslint-plugin": "^18.0.0",
"nx-cloud": "^18.0.0",
"@nstudio/focus": "^17.0.0",
"@nativescript/nx": "^19.0.0",
"@nx/angular": "^19.0.0",
"@nx/devkit": "^19.0.0",
"@nx/workspace": "^19.0.0",
"@nx/js": "^19.0.0",
"@nx/plugin": "^19.0.0",
"@nx/jest": "^19.0.0",
"@nx/node": "^19.0.0",
"@nx/eslint-plugin": "^19.0.0",
"nx-cloud": "^19.0.0",
"@nstudio/focus": "^19.0.0",
"@nstudio/nps-i": "^2.0.0",
"@types/node": "^12.0.0",
"@typescript-eslint/eslint-plugin": "7.5.0",
"@typescript-eslint/parser": "7.5.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "7.13.1",
"@typescript-eslint/parser": "7.13.1",
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.1.0",
"husky": "^9.0.0",
Expand All @@ -55,6 +55,6 @@
"rimraf": "^5.0.0",
"ts-node": "^10.0.0",
"ts-patch": "^3.0.0",
"@nx/eslint": "^18.0.0"
"@nx/eslint": "^19.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"migrations": [
{
"cli": "nx",
"version": "19.2.0-beta.2",
"description": "Updates the default workspace data directory to .nx/workspace-data",
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory",
"package": "nx",
"name": "19-2-0-move-graph-cache-directory"
},
{
"cli": "nx",
"version": "19.2.2-beta.0",
"description": "Updates the nx wrapper.",
"implementation": "./src/migrations/update-17-3-0/update-nxw",
"package": "nx",
"name": "19-2-2-update-nx-wrapper"
},
{
"version": "19.2.4-beta.0",
"description": "Set project name in nx.json explicitly",
"implementation": "./src/migrations/update-19-2-4/set-project-name",
"x-repair-skip": true,
"package": "nx",
"name": "19-2-4-set-project-name"
},
{
"cli": "nx",
"version": "19.1.0-beta.6",
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi",
"package": "@nx/eslint-plugin",
"name": "update-19-1-0-rename-no-extra-semi"
}
]
}
126 changes: 126 additions & 0 deletions packages/plugin-tools/src/migrations/update-5-3-0/update-5-3-0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { formatFiles, Tree, updateJson } from '@nx/devkit';
import { readModulePackageJson } from 'nx/src/utils/package-json';
import { updateDemoAppPackages } from '../../utils/migrations';
import { dirname } from 'path';
const migrations = require('./migrations-to-run.json');

function readPackageMigrationConfig(packageName: string, dir?: string) {
const { path: packageJsonPath, packageJson: json } = readModulePackageJson(packageName, dir ? [dir] : undefined);

const migrationConfigOrFile = json['nx-migrations'] || json['ng-update'];

if (!migrationConfigOrFile) {
return { packageJson: json, migrations: null, packageGroup: [] };
}

const migrationsConfig =
typeof migrationConfigOrFile === 'string'
? {
migrations: migrationConfigOrFile,
packageGroup: [],
}
: migrationConfigOrFile;

try {
const migrationFile = require.resolve(migrationsConfig.migrations, {
paths: [dirname(packageJsonPath)],
});

return {
packageJson: json,
migrations: migrationFile,
packageGroup: migrationsConfig.packageGroup,
};
} catch {
return {
packageJson: json,
migrations: null,
packageGroup: migrationsConfig.packageGroup,
};
}
}

export default async function (tree: Tree) {
updateDependencies(tree);
updateJson(tree, 'tsconfig.base.json', (json) => {
json.compilerOptions = json.compilerOptions || {};
json.compilerOptions.target = 'ES2020';
json.compilerOptions.module = 'ESNext';
json.compilerOptions.lib = ['ESNext', 'dom'];
return json;
});
updateDemoAppPackages(tree, {
devDependencies: {
'@nativescript/android': '~8.7.0',
'@nativescript/ios': '~8.7.0',
},
});
for (const migration of migrations.migrations) {
const packageName = migration.package;
const implRelativePath = migration.implementation || migration.factory;
const collectionPath = readPackageMigrationConfig(packageName).migrations;
let implPath: string;

if (collectionPath) {
let fn: any;
try {
try {
implPath = require.resolve(implRelativePath, {
paths: [dirname(collectionPath)],
});
} catch (e) {
// workaround for a bug in node 12
implPath = require.resolve(`${dirname(collectionPath)}/${implRelativePath}`);
}

fn = require(implPath).default;
} catch (e) {
// ignore, most likely missing package
}
if (fn) {
await fn(tree, {});
}
}
}
// TODO: Edit the generators to use the new tsconfig

await formatFiles(tree);

console.log(`\n NOTE: Your plugin workspace is now migrated. Run this to finish the dependency cleanup:`);
console.log(`\n`);
console.log(` npm run setup`);
console.log(`\n`);
console.log(` This will ensure your workspace is properly reset with all the updates.`);
console.log(` It is also recommended to clean all your demo apps.`);
console.log(`\n`);
}

function updateDependencies(tree: Tree) {
updateJson(tree, 'package.json', (json) => {
if (json.devDependencies['@angular/core']) {
json.devDependencies['@angular-devkit/build-angular'] = '^18.0.0';
for (const key in json.devDependencies) {
if (key.indexOf('@angular/') > -1) {
json.devDependencies[key] = '^18.0.0';
}
if (key.indexOf('@angular-eslint/') > -1) {
json.devDependencies[key] = '^18.0.0';
}
}
}
json.devDependencies['@nativescript/angular'] = '^18.0.0';
json.devDependencies['@nativescript/core'] = '~8.7.0';
json.devDependencies['@nativescript/types'] = '~8.7.0';
json.devDependencies['@ngtools/webpack'] = '^18.0.0';
json.devDependencies['husky'] = '~9.0.0';
json.devDependencies['ng-packagr'] = '^18.0.0';
json.devDependencies['rxjs'] = '~7.8.0';
json.devDependencies['zone.js'] = '~0.14.0';
json.devDependencies['typescript'] = '~5.4.0';

if (json.devDependencies['ts-patch']) {
json.devDependencies['ts-patch'] = '^3.0.0';
}
return json;
});
}
2 changes: 1 addition & 1 deletion packages/plugin-tools/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const toolsVersion = '*';
export const nxVersion = '18.2.3';
export const nxVersion = '19.3.0';
Loading