Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 4197e04

Browse files
EddyVerbruggeneddyverbruggen
authored andcommitted
postinstall script reinstated
1 parent d404323 commit 4197e04

File tree

5 files changed

+84
-32
lines changed

5 files changed

+84
-32
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<img src="docs/images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
22

33

4+
## 3.9.4 (2017, February 15)
5+
6+
Fix postinstall script
7+
8+
49
## 3.9.2 (2017, January 20)
510

611
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.9.1...3.9.2)

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ Now start an install script which will guide you through installing additional c
4141

4242
```
4343
cd node_modules/nativescript-plugin-firebase
44+
```
45+
46+
If you run NativeScript 2.5.0 (only that exact version) then run (with other versions this runs automatically through a postinstall script):
47+
48+
```
4449
npm run setup
4550
```
4651

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-plugin-firebase",
3-
"version": "3.9.3",
3+
"version": "3.9.4",
44
"description": "Fire. Base. Firebase!",
55
"main": "firebase",
66
"typings": "index.d.ts",
@@ -13,7 +13,8 @@
1313
"scripts": {
1414
"bundle-installer": "npm install --ignore-scripts && webpack --config scripts/webpack.config.js scripts/installer.js scripts/postinstall.js",
1515
"prepublish": "npm run bundle-installer",
16-
"setup": "node scripts/postinstall.js",
16+
"postinstall": "node scripts/installer.js",
17+
"setup": "node scripts/postinstall.js setup",
1718
"config": "node scripts/postinstall.js config"
1819
},
1920
"repository": {
@@ -44,8 +45,12 @@
4445
"url": "https://github.com/eddyverbruggen/nativescript-plugin-firebase/issues"
4546
},
4647
"homepage": "https://github.com/eddyverbruggen/nativescript-plugin-firebase",
48+
"dependencies": {
49+
"xcode": "0.8.0",
50+
"prompt-lite": "^0.1.1"
51+
},
4752
"devDependencies": {
48-
"prompt-lite": "^0.1.0",
53+
"prompt-lite": "^0.1.1",
4954
"xcode": "0.8.0",
5055
"webpack": "~2.2.0"
5156
}

scripts/installer.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ console.log('NativeScript Firebase Plugin Installation');
1616
var appRoot = "../../";
1717
var pluginConfigFile = "firebase.nativescript.json";
1818
var pluginConfigPath = path.join(appRoot, pluginConfigFile);
19-
2019
var config = {};
2120
function mergeConfig(result) {
2221
for (var key in result) {
@@ -36,12 +35,26 @@ function readConfig() {
3635
}
3736
}
3837

38+
// workaround for https://github.com/NativeScript/nativescript-cli/issues/2521 (2.5.0 only)
39+
var nativeScriptVersion = require('child_process').execSync('nativescript --version');
40+
var promptSupported = nativeScriptVersion.indexOf("2.5.0") === -1;
41+
42+
// note that for CI builds you want a pluginConfigFile, otherwise the build will fail
3943
if (process.argv.indexOf("config") == -1 && fs.existsSync(pluginConfigPath)) {
4044
readConfig();
4145
console.log("Config file exists (" + pluginConfigFile + ")");
4246
askiOSPromptResult(config);
4347
askAndroidPromptResult(config);
4448
promptQuestionsResult(config);
49+
} else if (!promptSupported && process.argv.indexOf("setup") == -1) {
50+
console.log("*******************************************************************");
51+
console.log("*******************************************************************");
52+
console.log("************************** IMPORTANT: *****************************");
53+
console.log("******************* with nativescript 2.5.0 *********************");
54+
console.log("************** now execute 'npm run setup' manually ***************");
55+
console.log("***** in the node_modules/nativescript-plugin-firebase folder *****");
56+
console.log("*******************************************************************");
57+
console.log("*******************************************************************");
4558
} else {
4659
console.log("No existing " + pluginConfigFile + " config file found, so let's configure the Firebase plugin!");
4760
prompt.start();

scripts/postinstall.js

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
/******/ __webpack_require__.p = "";
6464

6565
/******/ // Load entry module and return exports
66-
/******/ return __webpack_require__(__webpack_require__.s = 15);
66+
/******/ return __webpack_require__(__webpack_require__.s = 16);
6767
/******/ })
6868
/************************************************************************/
6969
/******/ ([
@@ -93,13 +93,13 @@ module.exports = require("readline");
9393
*
9494
*/
9595

96-
var events = __webpack_require__(/*! events */ 12),
96+
var events = __webpack_require__(/*! events */ 13),
9797
readline = __webpack_require__(/*! readline */ 0),
98-
util = __webpack_require__(/*! util */ 14),
99-
async = __webpack_require__(/*! async */ 4),
100-
read = __webpack_require__(/*! read */ 9),
101-
validate = __webpack_require__(/*! revalidator */ 10).validate,
102-
colors = __webpack_require__(/*! colors */ 7);
98+
util = __webpack_require__(/*! util */ 15),
99+
async = __webpack_require__(/*! async */ 5),
100+
read = __webpack_require__(/*! read */ 10),
101+
validate = __webpack_require__(/*! revalidator */ 11).validate,
102+
colors = __webpack_require__(/*! colors */ 8);
103103

104104
//
105105
// Monkey-punch readline.Interface to work-around
@@ -896,6 +896,17 @@ function mixin(target) {
896896
/* 2 */
897897
/* unknown exports provided */
898898
/* all exports used */
899+
/*!********************************!*\
900+
!*** external "child_process" ***!
901+
\********************************/
902+
/***/ (function(module, exports) {
903+
904+
module.exports = require("child_process");
905+
906+
/***/ }),
907+
/* 3 */
908+
/* unknown exports provided */
909+
/* all exports used */
899910
/*!*********************!*\
900911
!*** external "fs" ***!
901912
\*********************/
@@ -904,7 +915,7 @@ function mixin(target) {
904915
module.exports = require("fs");
905916

906917
/***/ }),
907-
/* 3 */
918+
/* 4 */
908919
/* unknown exports provided */
909920
/* all exports used */
910921
/*!***********************!*\
@@ -915,7 +926,7 @@ module.exports = require("fs");
915926
module.exports = require("path");
916927

917928
/***/ }),
918-
/* 4 */
929+
/* 5 */
919930
/* unknown exports provided */
920931
/* all exports used */
921932
/*!**************************!*\
@@ -925,11 +936,11 @@ module.exports = require("path");
925936

926937
// This file is just added for convenience so this repository can be
927938
// directly checked out into a project's deps folder
928-
module.exports = __webpack_require__(/*! ./lib/async */ 5);
939+
module.exports = __webpack_require__(/*! ./lib/async */ 6);
929940

930941

931942
/***/ }),
932-
/* 5 */
943+
/* 6 */
933944
/* unknown exports provided */
934945
/* all exports used */
935946
/*!******************************!*\
@@ -1632,7 +1643,7 @@ module.exports = __webpack_require__(/*! ./lib/async */ 5);
16321643

16331644

16341645
/***/ }),
1635-
/* 6 */
1646+
/* 7 */
16361647
/* unknown exports provided */
16371648
/* all exports used */
16381649
/*!******************!*\
@@ -1646,11 +1657,11 @@ function webpackEmptyContext(req) {
16461657
webpackEmptyContext.keys = function() { return []; };
16471658
webpackEmptyContext.resolve = webpackEmptyContext;
16481659
module.exports = webpackEmptyContext;
1649-
webpackEmptyContext.id = 6;
1660+
webpackEmptyContext.id = 7;
16501661

16511662

16521663
/***/ }),
1653-
/* 7 */
1664+
/* 8 */
16541665
/* unknown exports provided */
16551666
/* all exports used */
16561667
/*!****************************!*\
@@ -2003,15 +2014,15 @@ addProperty('zalgo', function () {
20032014

20042015

20052016
/***/ }),
2006-
/* 8 */
2017+
/* 9 */
20072018
/* unknown exports provided */
20082019
/* all exports used */
20092020
/*!*******************************!*\
20102021
!*** ./~/mute-stream/mute.js ***!
20112022
\*******************************/
20122023
/***/ (function(module, exports, __webpack_require__) {
20132024

2014-
var Stream = __webpack_require__(/*! stream */ 13)
2025+
var Stream = __webpack_require__(/*! stream */ 14)
20152026

20162027
module.exports = MuteStream
20172028

@@ -2159,7 +2170,7 @@ MuteStream.prototype.close = proxy('close')
21592170

21602171

21612172
/***/ }),
2162-
/* 9 */
2173+
/* 10 */
21632174
/* unknown exports provided */
21642175
/* all exports used */
21652176
/*!****************************!*\
@@ -2171,7 +2182,7 @@ MuteStream.prototype.close = proxy('close')
21712182
module.exports = read
21722183

21732184
var readline = __webpack_require__(/*! readline */ 0)
2174-
var Mute = __webpack_require__(/*! mute-stream */ 8)
2185+
var Mute = __webpack_require__(/*! mute-stream */ 9)
21752186

21762187
function read (opts, cb) {
21772188
if (opts.num) {
@@ -2283,7 +2294,7 @@ function read (opts, cb) {
22832294

22842295

22852296
/***/ }),
2286-
/* 10 */
2297+
/* 11 */
22872298
/* unknown exports provided */
22882299
/* all exports used */
22892300
/*!******************************************!*\
@@ -2719,10 +2730,10 @@ function read (opts, cb) {
27192730

27202731
})(typeof module === 'object' && module && module.exports ? module.exports : window);
27212732

2722-
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 11)(module)))
2733+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 12)(module)))
27232734

27242735
/***/ }),
2725-
/* 11 */
2736+
/* 12 */
27262737
/* unknown exports provided */
27272738
/* all exports used */
27282739
/*!***********************************!*\
@@ -2755,7 +2766,7 @@ module.exports = function(module) {
27552766

27562767

27572768
/***/ }),
2758-
/* 12 */
2769+
/* 13 */
27592770
/* unknown exports provided */
27602771
/* all exports used */
27612772
/*!*************************!*\
@@ -2766,7 +2777,7 @@ module.exports = function(module) {
27662777
module.exports = require("events");
27672778

27682779
/***/ }),
2769-
/* 13 */
2780+
/* 14 */
27702781
/* unknown exports provided */
27712782
/* all exports used */
27722783
/*!*************************!*\
@@ -2777,7 +2788,7 @@ module.exports = require("events");
27772788
module.exports = require("stream");
27782789

27792790
/***/ }),
2780-
/* 14 */
2791+
/* 15 */
27812792
/* unknown exports provided */
27822793
/* all exports used */
27832794
/*!***********************!*\
@@ -2788,16 +2799,16 @@ module.exports = require("stream");
27882799
module.exports = require("util");
27892800

27902801
/***/ }),
2791-
/* 15 */
2802+
/* 16 */
27922803
/* unknown exports provided */
27932804
/* all exports used */
27942805
/*!******************************!*\
27952806
!*** ./scripts/installer.js ***!
27962807
\******************************/
27972808
/***/ (function(module, exports, __webpack_require__) {
27982809

2799-
var fs = __webpack_require__(/*! fs */ 2);
2800-
var path = __webpack_require__(/*! path */ 3);
2810+
var fs = __webpack_require__(/*! fs */ 3);
2811+
var path = __webpack_require__(/*! path */ 4);
28012812
var prompt = __webpack_require__(/*! prompt-lite */ 1);
28022813

28032814
// Default settings for using ios and android with Firebase
@@ -2814,7 +2825,6 @@ console.log('NativeScript Firebase Plugin Installation');
28142825
var appRoot = "../../";
28152826
var pluginConfigFile = "firebase.nativescript.json";
28162827
var pluginConfigPath = path.join(appRoot, pluginConfigFile);
2817-
28182828
var config = {};
28192829
function mergeConfig(result) {
28202830
for (var key in result) {
@@ -2834,12 +2844,26 @@ function readConfig() {
28342844
}
28352845
}
28362846

2847+
// workaround for https://github.com/NativeScript/nativescript-cli/issues/2521 (2.5.0 only)
2848+
var nativeScriptVersion = __webpack_require__(/*! child_process */ 2).execSync('nativescript --version');
2849+
var promptSupported = nativeScriptVersion.indexOf("2.5.0") === -1;
2850+
2851+
// note that for CI builds you want a pluginConfigFile, otherwise the build will fail
28372852
if (process.argv.indexOf("config") == -1 && fs.existsSync(pluginConfigPath)) {
28382853
readConfig();
28392854
console.log("Config file exists (" + pluginConfigFile + ")");
28402855
askiOSPromptResult(config);
28412856
askAndroidPromptResult(config);
28422857
promptQuestionsResult(config);
2858+
} else if (!promptSupported && process.argv.indexOf("setup") == -1) {
2859+
console.log("*******************************************************************");
2860+
console.log("*******************************************************************");
2861+
console.log("************************** IMPORTANT: *****************************");
2862+
console.log("******************* with nativescript 2.5.0 *********************");
2863+
console.log("************** now execute 'npm run setup' manually ***************");
2864+
console.log("***** in the node_modules/nativescript-plugin-firebase folder *****");
2865+
console.log("*******************************************************************");
2866+
console.log("*******************************************************************");
28432867
} else {
28442868
console.log("No existing " + pluginConfigFile + " config file found, so let's configure the Firebase plugin!");
28452869
prompt.start();

0 commit comments

Comments
 (0)