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
9 changes: 4 additions & 5 deletions packages/doctor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ coverage
# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

Expand Down Expand Up @@ -64,6 +61,8 @@ test-reports.xml

*.js
*.js.map
/src/.d.ts
.d.ts
!/*.js
!/scripts/*.js

/dist/
/dist-test/
1 change: 0 additions & 1 deletion packages/doctor/.npmrc

This file was deleted.

91 changes: 0 additions & 91 deletions packages/doctor/Gruntfile.js

This file was deleted.

26 changes: 10 additions & 16 deletions packages/doctor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
"name": "@nativescript/doctor",
"version": "2.0.17",
"description": "Library that helps identifying if the environment can be used for development of {N} apps.",
"main": "src/index.js",
"main": "dist/index.js",
"types": "./typings/nativescript-doctor.d.ts",
"files": [
"src/**/*.js",
"dist/**/*.js",
"dist/**/*.d.ts",
"resources",
"typings",
"CHANGELOG.md",
"NOTICE.txt"
],
"scripts": {
"clean": "npx rimraf node_modules package-lock.json && npm i && grunt clean",
"build": "grunt",
"build.all": "grunt ts:devall",
"prepack": "grunt pack",
"test": "istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive",
"clean": "npx rimraf node_modules package-lock.json && npm i && npm run clean.build",
"clean.build": "node scripts/clean.js",
"build": "tsc",
"build.all": "tsc -p tsconfig.test.json && node scripts/copy-test-fixtures.js",
"dev": "tsc --watch",
"prepack": "npm run clean.build && npm test && tsc -p tsconfig.release.json",
"test": "npm run build.all && mocha --recursive dist-test/test",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"repository": {
Expand Down Expand Up @@ -51,17 +54,8 @@
"@types/yauzl": "2.10.3",
"chai": "5.3.3",
"conventional-changelog-cli": "^5.0.0",
"grunt": "1.6.1",
"grunt-contrib-clean": "2.0.1",
"grunt-contrib-watch": "1.1.0",
"grunt-shell": "4.0.0",
"grunt-ts": "6.0.0-beta.22",
"grunt-tslint": "5.0.2",
"istanbul": "0.4.5",
"mocha": "11.7.5",
"rimraf": "6.1.2",
"tslint": "6.1.3",
"tslint-microsoft-contrib": "6.2.0",
"typescript": "~5.9.2"
},
"dependencies": {
Expand Down
30 changes: 30 additions & 0 deletions packages/doctor/scripts/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const child_process = require("child_process");
const fs = require("fs");
const path = require("path");

const rootDir = path.join(__dirname, "..");

// Older checkouts compiled next to the sources; .gitignore is the source of
// truth for which files under src/ and test/ are leftover compiler output.
const result = child_process.spawnSync("git", ["clean", "-Xdf", "src", "test"], {
cwd: rootDir,
stdio: "inherit",
});

if (result.error) {
throw result.error;
}

if (result.status !== 0) {
throw new Error(`git clean exited with status ${result.status}`);
}

for (const dir of ["dist", "dist-test", "coverage"]) {
fs.rmSync(path.join(rootDir, dir), { recursive: true, force: true });
}

for (const entry of fs.readdirSync(rootDir)) {
if (entry.endsWith(".tgz")) {
fs.rmSync(path.join(rootDir, entry));
}
}
11 changes: 11 additions & 0 deletions packages/doctor/scripts/copy-test-fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require("fs");
const path = require("path");

const rootDir = path.join(__dirname, "..");

// The tests resolve fixtures relative to __dirname, so they have to sit next to
// the compiled test files rather than in the source tree.
fs.cpSync(path.join(rootDir, "test"), path.join(rootDir, "dist-test", "test"), {
recursive: true,
filter: (src) => !src.endsWith(".ts"),
});
16 changes: 0 additions & 16 deletions packages/doctor/src/android-tools-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,20 +658,4 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
this._cachedRuntimeVersion = runtimeVersion;
return runtimeVersion;
}

private getMaxSupportedCompileVersion(
config: Partial<NativeScriptDoctor.IProjectDir> & {
runtimeVersion?: string;
},
): number {
if (
config.runtimeVersion &&
semver.lt(semver.coerce(config.runtimeVersion), "6.1.0")
) {
return 28;
}
return this.parseAndroidSdkString(
_.last(this.getSupportedTargets(config.projectDir).sort()),
);
}
}
Loading