Skip to content

Commit

Permalink
chore: apply minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
juliomrqz committed Nov 25, 2019
1 parent 8ec6ced commit f9f4694
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ src/*.d.ts
!src/references.d.ts
!src/scripts/*.js
!seed-tests/*.js
seed-tests/seed-copy/**/*.*
seed-tests/seed-copy
seed-tests/seed-copy-new-git-repo/**/*.*
!demo/karma.conf.js
!demo/app/tests/*.js
Expand Down
18 changes: 9 additions & 9 deletions publish/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Publish helper",
"devDependencies": {
"ncp": "^2.0.0",
"rimraf": "^2.5.0"
"ncp": "2.0.0",
"rimraf": "3.0.0"
}
}
3 changes: 2 additions & 1 deletion src/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ scripts/*
platforms/android/*
!platforms/android/include.gradle
!platforms/android/*.aar
!platforms/android/*.jar
!platforms/android/*.jar
.DS_Store
6 changes: 3 additions & 3 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 55 additions & 59 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,57 @@
{
"name": "nativescript-vibrate",
"version": "3.0.0",
"description": "A vibrate NativeScript plugin for Android and iOS",
"main": "vibrate",
"typings": "index.d.ts",
"nativescript": {
"platforms": {
"android": "6.0.0",
"ios": "6.0.0"
}
},
"scripts": {
"tsc": "npm i && tsc",
"build": "npm run tsc && npm run build.native",
"build.native": "node scripts/build-native.js",
"postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src",
"test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
"test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"",
"plugin.tscwatch": "npm run tsc -- -w",
"demo.ios": "npm run tsc && cd ../demo && tns run ios",
"demo.android": "npm run tsc && cd ../demo && tns run android",
"demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
"plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-vibrate && tns plugin add ../src",
"clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i",
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'",
"prepack": "npm run build.native"
},
"keywords": [
"NativeScript",
"JavaScript",
"Android",
"iOS"
],
"author": {
"name": "Julio Marquez",
"email": "j@bazzite.com"
},
"bugs": {
"url": "https://github.com/bazzite/nativescript-vibrate/issues"
},
"repository": {
"type": "git",
"url": "git://github.com/bazzite/nativescript-vibrate.git"
},
"license": "MIT",
"homepage": "https://www.bazzite.com/docs/nativescript-vibrate",
"readmeFilename": "README.md",
"devDependencies": {
"tns-core-modules": "~6.1.2",
"tns-platform-declarations": "~6.1.2",
"typescript": "~3.4.5",
"prompt": "^1.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.14.0",
"semver": "^6.1.2"
},
"dependencies": {},
"bootstrapper": "nativescript-plugin-seed"
"name": "nativescript-vibrate",
"version": "3.0.0",
"description": "A vibrate NativeScript plugin for Android and iOS",
"main": "vibrate",
"typings": "index.d.ts",
"nativescript": {
"platforms": {
"android": "6.0.0",
"ios": "6.0.1"
}
},
"scripts": {
"tsc": "npm i && tsc",
"build": "npm run tsc && npm run build.native",
"build.native": "node scripts/build-native.js",
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"",
"ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'",
"prepack": "npm run build.native",
"demo.ios": "npm i && cd ../demo && tns run ios",
"demo.android": "npm i && cd ../demo && tns run android",
"demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
"plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-vibrate && tns plugin add ../src && tns plugin remove nativescript-vibrate && tns plugin add ../src",
"clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i"
},
"keywords": [
"NativeScript",
"JavaScript",
"Android",
"iOS",
"Vibrate"
],
"author": {
"name": "Julio Marquez",
"email": "j@bazzite.com"
},
"bugs": {
"url": "https://github.com/bazzite/nativescript-vibrate/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/bazzite/nativescript-vibrate.git"
},
"license": "MIT",
"homepage": "https://www.bazzite.com/docs/nativescript-vibrate",
"devDependencies": {
"tns-core-modules": "~6.1.2",
"tns-platform-declarations": "~6.1.2",
"typescript": "~3.4.5",
"prompt": "^1.0.0",
"rimraf": "^2.6.3",
"tslint": "^5.14.0",
"semver": "^6.1.2"
},
"dependencies": {},
"bootstrapper": "nativescript-plugin-seed"
}
10 changes: 9 additions & 1 deletion src/scripts/build-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ exec('tns --version', (err, stdout, stderr) => {
return;
}

const tnsVersion = semver.major(stdout);
// In case the current Node.js version is not supported by CLI, a warning in `tns --version` output is shown.
// Sample output:
//
/*Support for Node.js ^8.0.0 is deprecated and will be removed in one of the next releases of NativeScript. Please, upgrade to the latest Node.js LTS version.
6.0.0
*/
// Extract the actual version (6.0.0) from it.
const tnsVersion = semver.major((stdout.match(/^(?:\d+\.){2}\d+.*?$/m) || [])[0]);

// execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder.
if (tnsVersion >= 4) {
Expand Down

0 comments on commit f9f4694

Please sign in to comment.