fsevents 1.2.7 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.travis.yml +1 -2
  2. package/binding.gyp +1 -9
  3. package/fsevents.cc +8 -11
  4. package/fsevents.js +1 -3
  5. package/node_modules/abbrev/package.json +2 -3
  6. package/node_modules/ansi-regex/package.json +1 -1
  7. package/node_modules/aproba/package.json +1 -1
  8. package/node_modules/are-we-there-yet/package.json +1 -1
  9. package/node_modules/balanced-match/package.json +1 -1
  10. package/node_modules/brace-expansion/package.json +1 -1
  11. package/node_modules/chownr/chownr.js +47 -10
  12. package/node_modules/chownr/package.json +7 -7
  13. package/node_modules/code-point-at/package.json +1 -1
  14. package/node_modules/concat-map/package.json +1 -1
  15. package/node_modules/console-control-strings/package.json +1 -1
  16. package/node_modules/core-util-is/package.json +1 -1
  17. package/node_modules/debug/CHANGELOG.md +34 -1
  18. package/node_modules/debug/README.md +188 -63
  19. package/node_modules/debug/dist/debug.js +886 -0
  20. package/node_modules/debug/package.json +28 -26
  21. package/node_modules/debug/src/browser.js +77 -82
  22. package/node_modules/debug/src/common.js +249 -0
  23. package/node_modules/debug/src/index.js +5 -3
  24. package/node_modules/debug/src/node.js +72 -146
  25. package/node_modules/deep-extend/package.json +1 -1
  26. package/node_modules/delegates/package.json +1 -1
  27. package/node_modules/detect-libc/package.json +1 -1
  28. package/node_modules/fs-minipass/index.js +2 -1
  29. package/node_modules/fs-minipass/package.json +13 -10
  30. package/node_modules/fs.realpath/package.json +1 -1
  31. package/node_modules/gauge/package.json +1 -1
  32. package/node_modules/glob/LICENSE +6 -0
  33. package/node_modules/glob/README.md +8 -1
  34. package/node_modules/glob/package.json +9 -6
  35. package/node_modules/has-unicode/package.json +1 -1
  36. package/node_modules/iconv-lite/package.json +1 -1
  37. package/node_modules/ignore-walk/README.md +1 -1
  38. package/node_modules/ignore-walk/index.js +9 -5
  39. package/node_modules/ignore-walk/package.json +11 -8
  40. package/node_modules/inflight/package.json +1 -1
  41. package/node_modules/inherits/inherits.js +2 -0
  42. package/node_modules/inherits/inherits_browser.js +18 -14
  43. package/node_modules/inherits/package.json +9 -11
  44. package/node_modules/ini/package.json +1 -1
  45. package/node_modules/is-fullwidth-code-point/package.json +1 -1
  46. package/node_modules/isarray/package.json +1 -1
  47. package/node_modules/minimatch/package.json +1 -1
  48. package/node_modules/minimist/package.json +1 -1
  49. package/node_modules/minipass/README.md +486 -4
  50. package/node_modules/minipass/index.js +190 -28
  51. package/node_modules/minipass/package.json +17 -14
  52. package/node_modules/minizlib/README.md +36 -27
  53. package/node_modules/minizlib/constants.js +73 -4
  54. package/node_modules/minizlib/index.js +137 -152
  55. package/node_modules/minizlib/package.json +12 -12
  56. package/node_modules/mkdirp/package.json +1 -2
  57. package/node_modules/ms/index.js +29 -19
  58. package/node_modules/ms/package.json +17 -17
  59. package/node_modules/ms/readme.md +18 -9
  60. package/node_modules/needle/README.md +1 -2
  61. package/node_modules/needle/examples/multipart-stream.js +1 -1
  62. package/node_modules/needle/lib/auth.js +1 -1
  63. package/node_modules/needle/lib/multipart.js +1 -1
  64. package/node_modules/needle/lib/needle.js +4 -2
  65. package/node_modules/needle/package.json +13 -13
  66. package/node_modules/needle/test/basic_auth_spec.js +1 -1
  67. package/node_modules/needle/test/cookies_spec.js +2 -2
  68. package/node_modules/needle/test/headers_spec.js +1 -1
  69. package/node_modules/needle/test/output_spec.js +1 -1
  70. package/node_modules/needle/test/post_data_spec.js +20 -20
  71. package/node_modules/needle/test/proxy_spec.js +1 -1
  72. package/node_modules/needle/test/utils/test.js +1 -1
  73. package/node_modules/node-pre-gyp/CHANGELOG.md +21 -0
  74. package/node_modules/node-pre-gyp/README.md +41 -6
  75. package/node_modules/node-pre-gyp/lib/build.js +1 -1
  76. package/node_modules/node-pre-gyp/lib/install.js +64 -22
  77. package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
  78. package/node_modules/node-pre-gyp/lib/pre-binding.js +5 -5
  79. package/node_modules/node-pre-gyp/lib/rebuild.js +1 -1
  80. package/node_modules/node-pre-gyp/lib/reinstall.js +1 -1
  81. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +288 -0
  82. package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +5 -2
  83. package/node_modules/node-pre-gyp/lib/util/napi.js +72 -23
  84. package/node_modules/node-pre-gyp/lib/util/versioning.js +7 -6
  85. package/node_modules/node-pre-gyp/package.json +12 -12
  86. package/node_modules/nopt/package.json +1 -1
  87. package/node_modules/npm-bundled/index.js +26 -6
  88. package/node_modules/npm-bundled/package.json +9 -6
  89. package/node_modules/npm-normalize-package-bin/.github/settings.yml +2 -0
  90. package/node_modules/npm-normalize-package-bin/.npmignore +24 -0
  91. package/node_modules/npm-normalize-package-bin/LICENSE +15 -0
  92. package/node_modules/npm-normalize-package-bin/README.md +14 -0
  93. package/node_modules/npm-normalize-package-bin/index.js +60 -0
  94. package/node_modules/npm-normalize-package-bin/package-lock.json +3529 -0
  95. package/node_modules/npm-normalize-package-bin/package.json +57 -0
  96. package/node_modules/npm-normalize-package-bin/test/array.js +37 -0
  97. package/node_modules/npm-normalize-package-bin/test/nobin.js +35 -0
  98. package/node_modules/npm-normalize-package-bin/test/object.js +141 -0
  99. package/node_modules/npm-normalize-package-bin/test/string.js +37 -0
  100. package/node_modules/npm-packlist/index.js +76 -16
  101. package/node_modules/npm-packlist/package.json +16 -9
  102. package/node_modules/npmlog/package.json +1 -1
  103. package/node_modules/number-is-nan/package.json +1 -1
  104. package/node_modules/object-assign/package.json +1 -1
  105. package/node_modules/once/package.json +1 -1
  106. package/node_modules/os-homedir/package.json +1 -1
  107. package/node_modules/os-tmpdir/package.json +1 -1
  108. package/node_modules/osenv/package.json +1 -1
  109. package/node_modules/path-is-absolute/package.json +1 -1
  110. package/node_modules/process-nextick-args/index.js +2 -1
  111. package/node_modules/process-nextick-args/package.json +6 -6
  112. package/node_modules/rc/node_modules/minimist/package.json +1 -1
  113. package/node_modules/rc/package.json +1 -1
  114. package/node_modules/readable-stream/package.json +1 -1
  115. package/node_modules/rimraf/package.json +6 -6
  116. package/node_modules/rimraf/rimraf.js +9 -1
  117. package/node_modules/safe-buffer/package.json +1 -1
  118. package/node_modules/safer-buffer/package.json +1 -1
  119. package/node_modules/sax/package.json +1 -1
  120. package/node_modules/semver/CHANGELOG.md +39 -0
  121. package/node_modules/semver/README.md +26 -13
  122. package/node_modules/semver/bin/semver +84 -77
  123. package/node_modules/semver/package.json +14 -8
  124. package/node_modules/semver/semver.js +906 -775
  125. package/node_modules/set-blocking/package.json +1 -1
  126. package/node_modules/signal-exit/package.json +1 -1
  127. package/node_modules/string-width/package.json +1 -1
  128. package/node_modules/string_decoder/package.json +1 -1
  129. package/node_modules/strip-ansi/package.json +1 -1
  130. package/node_modules/strip-json-comments/package.json +1 -1
  131. package/node_modules/tar/lib/large-numbers.js +32 -27
  132. package/node_modules/tar/lib/mkdir.js +2 -2
  133. package/node_modules/tar/lib/parse.js +6 -1
  134. package/node_modules/tar/lib/read-entry.js +4 -0
  135. package/node_modules/tar/lib/write-entry.js +2 -2
  136. package/node_modules/tar/package.json +22 -18
  137. package/node_modules/util-deprecate/package.json +1 -1
  138. package/node_modules/wide-align/package.json +1 -1
  139. package/node_modules/wrappy/package.json +1 -1
  140. package/node_modules/yallist/package.json +11 -11
  141. package/node_modules/yallist/yallist.js +50 -0
  142. package/package.json +5 -18
  143. package/src/constants.cc +20 -20
  144. package/install.js +0 -7
  145. package/node_modules/debug/.coveralls.yml +0 -1
  146. package/node_modules/debug/.eslintrc +0 -11
  147. package/node_modules/debug/.npmignore +0 -9
  148. package/node_modules/debug/.travis.yml +0 -14
  149. package/node_modules/debug/Makefile +0 -50
  150. package/node_modules/debug/component.json +0 -19
  151. package/node_modules/debug/karma.conf.js +0 -70
  152. package/node_modules/debug/src/debug.js +0 -202
  153. package/node_modules/debug/src/inspector-log.js +0 -15
  154. package/node_modules/needle/note.xml +0 -7
  155. package/node_modules/needle/note.xml.1 +0 -7
@@ -9,8 +9,8 @@ module.exports = exports;
9
9
 
10
10
  exports.usage = 'Finds the require path for the node-pre-gyp installed module';
11
11
 
12
- exports.validate = function(package_json) {
13
- versioning.validate_config(package_json);
12
+ exports.validate = function(package_json,opts) {
13
+ versioning.validate_config(package_json,opts);
14
14
  };
15
15
 
16
16
  exports.find = function(package_json_path,opts) {
@@ -18,10 +18,10 @@ exports.find = function(package_json_path,opts) {
18
18
  throw new Error("package.json does not exist at " + package_json_path);
19
19
  }
20
20
  var package_json = require(package_json_path);
21
- versioning.validate_config(package_json);
21
+ versioning.validate_config(package_json,opts);
22
22
  var napi_build_version;
23
- if (napi.get_napi_build_versions (package_json)) {
24
- napi_build_version = napi.get_best_napi_build_version(package_json);
23
+ if (napi.get_napi_build_versions (package_json, opts)) {
24
+ napi_build_version = napi.get_best_napi_build_version(package_json, opts);
25
25
  }
26
26
  opts = opts || {};
27
27
  if (!opts.module_root) opts.module_root = path.dirname(package_json_path);
@@ -13,7 +13,7 @@ function rebuild (gyp, argv, callback) {
13
13
  { name: 'clean', args: [] },
14
14
  { name: 'build', args: ['rebuild'] }
15
15
  ];
16
- commands = napi.expand_commands(package_json, commands);
16
+ commands = napi.expand_commands(package_json, gyp.opts, commands);
17
17
  for (var i = commands.length; i !== 0; i--) {
18
18
  gyp.todo.unshift(commands[i-1]);
19
19
  }
@@ -10,7 +10,7 @@ var napi = require('./util/napi.js');
10
10
  function rebuild (gyp, argv, callback) {
11
11
  var package_json = JSON.parse(fs.readFileSync('./package.json'));
12
12
  var installArgs = [];
13
- var napi_build_version = napi.get_best_napi_build_version(package_json);
13
+ var napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts);
14
14
  if (napi_build_version != null) installArgs = [ napi.get_command_arg (napi_build_version) ];
15
15
  gyp.todo.unshift(
16
16
  { name: 'clean', args: [] },
@@ -1503,6 +1503,30 @@
1503
1503
  "node_abi": 48,
1504
1504
  "v8": "5.1"
1505
1505
  },
1506
+ "6.14.4": {
1507
+ "node_abi": 48,
1508
+ "v8": "5.1"
1509
+ },
1510
+ "6.15.0": {
1511
+ "node_abi": 48,
1512
+ "v8": "5.1"
1513
+ },
1514
+ "6.15.1": {
1515
+ "node_abi": 48,
1516
+ "v8": "5.1"
1517
+ },
1518
+ "6.16.0": {
1519
+ "node_abi": 48,
1520
+ "v8": "5.1"
1521
+ },
1522
+ "6.17.0": {
1523
+ "node_abi": 48,
1524
+ "v8": "5.1"
1525
+ },
1526
+ "6.17.1": {
1527
+ "node_abi": 48,
1528
+ "v8": "5.1"
1529
+ },
1506
1530
  "7.0.0": {
1507
1531
  "node_abi": 51,
1508
1532
  "v8": "5.4"
@@ -1671,6 +1695,46 @@
1671
1695
  "node_abi": 57,
1672
1696
  "v8": "6.2"
1673
1697
  },
1698
+ "8.11.4": {
1699
+ "node_abi": 57,
1700
+ "v8": "6.2"
1701
+ },
1702
+ "8.12.0": {
1703
+ "node_abi": 57,
1704
+ "v8": "6.2"
1705
+ },
1706
+ "8.13.0": {
1707
+ "node_abi": 57,
1708
+ "v8": "6.2"
1709
+ },
1710
+ "8.14.0": {
1711
+ "node_abi": 57,
1712
+ "v8": "6.2"
1713
+ },
1714
+ "8.14.1": {
1715
+ "node_abi": 57,
1716
+ "v8": "6.2"
1717
+ },
1718
+ "8.15.0": {
1719
+ "node_abi": 57,
1720
+ "v8": "6.2"
1721
+ },
1722
+ "8.15.1": {
1723
+ "node_abi": 57,
1724
+ "v8": "6.2"
1725
+ },
1726
+ "8.16.0": {
1727
+ "node_abi": 57,
1728
+ "v8": "6.2"
1729
+ },
1730
+ "8.16.1": {
1731
+ "node_abi": 57,
1732
+ "v8": "6.2"
1733
+ },
1734
+ "8.16.2": {
1735
+ "node_abi": 57,
1736
+ "v8": "6.2"
1737
+ },
1674
1738
  "9.0.0": {
1675
1739
  "node_abi": 59,
1676
1740
  "v8": "6.2"
@@ -1778,5 +1842,229 @@
1778
1842
  "10.6.0": {
1779
1843
  "node_abi": 64,
1780
1844
  "v8": "6.7"
1845
+ },
1846
+ "10.7.0": {
1847
+ "node_abi": 64,
1848
+ "v8": "6.7"
1849
+ },
1850
+ "10.8.0": {
1851
+ "node_abi": 64,
1852
+ "v8": "6.7"
1853
+ },
1854
+ "10.9.0": {
1855
+ "node_abi": 64,
1856
+ "v8": "6.8"
1857
+ },
1858
+ "10.10.0": {
1859
+ "node_abi": 64,
1860
+ "v8": "6.8"
1861
+ },
1862
+ "10.11.0": {
1863
+ "node_abi": 64,
1864
+ "v8": "6.8"
1865
+ },
1866
+ "10.12.0": {
1867
+ "node_abi": 64,
1868
+ "v8": "6.8"
1869
+ },
1870
+ "10.13.0": {
1871
+ "node_abi": 64,
1872
+ "v8": "6.8"
1873
+ },
1874
+ "10.14.0": {
1875
+ "node_abi": 64,
1876
+ "v8": "6.8"
1877
+ },
1878
+ "10.14.1": {
1879
+ "node_abi": 64,
1880
+ "v8": "6.8"
1881
+ },
1882
+ "10.14.2": {
1883
+ "node_abi": 64,
1884
+ "v8": "6.8"
1885
+ },
1886
+ "10.15.0": {
1887
+ "node_abi": 64,
1888
+ "v8": "6.8"
1889
+ },
1890
+ "10.15.1": {
1891
+ "node_abi": 64,
1892
+ "v8": "6.8"
1893
+ },
1894
+ "10.15.2": {
1895
+ "node_abi": 64,
1896
+ "v8": "6.8"
1897
+ },
1898
+ "10.15.3": {
1899
+ "node_abi": 64,
1900
+ "v8": "6.8"
1901
+ },
1902
+ "10.16.0": {
1903
+ "node_abi": 64,
1904
+ "v8": "6.8"
1905
+ },
1906
+ "10.16.1": {
1907
+ "node_abi": 64,
1908
+ "v8": "6.8"
1909
+ },
1910
+ "10.16.2": {
1911
+ "node_abi": 64,
1912
+ "v8": "6.8"
1913
+ },
1914
+ "10.16.3": {
1915
+ "node_abi": 64,
1916
+ "v8": "6.8"
1917
+ },
1918
+ "10.17.0": {
1919
+ "node_abi": 64,
1920
+ "v8": "6.8"
1921
+ },
1922
+ "11.0.0": {
1923
+ "node_abi": 67,
1924
+ "v8": "7.0"
1925
+ },
1926
+ "11.1.0": {
1927
+ "node_abi": 67,
1928
+ "v8": "7.0"
1929
+ },
1930
+ "11.2.0": {
1931
+ "node_abi": 67,
1932
+ "v8": "7.0"
1933
+ },
1934
+ "11.3.0": {
1935
+ "node_abi": 67,
1936
+ "v8": "7.0"
1937
+ },
1938
+ "11.4.0": {
1939
+ "node_abi": 67,
1940
+ "v8": "7.0"
1941
+ },
1942
+ "11.5.0": {
1943
+ "node_abi": 67,
1944
+ "v8": "7.0"
1945
+ },
1946
+ "11.6.0": {
1947
+ "node_abi": 67,
1948
+ "v8": "7.0"
1949
+ },
1950
+ "11.7.0": {
1951
+ "node_abi": 67,
1952
+ "v8": "7.0"
1953
+ },
1954
+ "11.8.0": {
1955
+ "node_abi": 67,
1956
+ "v8": "7.0"
1957
+ },
1958
+ "11.9.0": {
1959
+ "node_abi": 67,
1960
+ "v8": "7.0"
1961
+ },
1962
+ "11.10.0": {
1963
+ "node_abi": 67,
1964
+ "v8": "7.0"
1965
+ },
1966
+ "11.10.1": {
1967
+ "node_abi": 67,
1968
+ "v8": "7.0"
1969
+ },
1970
+ "11.11.0": {
1971
+ "node_abi": 67,
1972
+ "v8": "7.0"
1973
+ },
1974
+ "11.12.0": {
1975
+ "node_abi": 67,
1976
+ "v8": "7.0"
1977
+ },
1978
+ "11.13.0": {
1979
+ "node_abi": 67,
1980
+ "v8": "7.0"
1981
+ },
1982
+ "11.14.0": {
1983
+ "node_abi": 67,
1984
+ "v8": "7.0"
1985
+ },
1986
+ "11.15.0": {
1987
+ "node_abi": 67,
1988
+ "v8": "7.0"
1989
+ },
1990
+ "12.0.0": {
1991
+ "node_abi": 72,
1992
+ "v8": "7.4"
1993
+ },
1994
+ "12.1.0": {
1995
+ "node_abi": 72,
1996
+ "v8": "7.4"
1997
+ },
1998
+ "12.2.0": {
1999
+ "node_abi": 72,
2000
+ "v8": "7.4"
2001
+ },
2002
+ "12.3.0": {
2003
+ "node_abi": 72,
2004
+ "v8": "7.4"
2005
+ },
2006
+ "12.3.1": {
2007
+ "node_abi": 72,
2008
+ "v8": "7.4"
2009
+ },
2010
+ "12.4.0": {
2011
+ "node_abi": 72,
2012
+ "v8": "7.4"
2013
+ },
2014
+ "12.5.0": {
2015
+ "node_abi": 72,
2016
+ "v8": "7.5"
2017
+ },
2018
+ "12.6.0": {
2019
+ "node_abi": 72,
2020
+ "v8": "7.5"
2021
+ },
2022
+ "12.7.0": {
2023
+ "node_abi": 72,
2024
+ "v8": "7.5"
2025
+ },
2026
+ "12.8.0": {
2027
+ "node_abi": 72,
2028
+ "v8": "7.5"
2029
+ },
2030
+ "12.8.1": {
2031
+ "node_abi": 72,
2032
+ "v8": "7.5"
2033
+ },
2034
+ "12.9.0": {
2035
+ "node_abi": 72,
2036
+ "v8": "7.6"
2037
+ },
2038
+ "12.9.1": {
2039
+ "node_abi": 72,
2040
+ "v8": "7.6"
2041
+ },
2042
+ "12.10.0": {
2043
+ "node_abi": 72,
2044
+ "v8": "7.6"
2045
+ },
2046
+ "12.11.0": {
2047
+ "node_abi": 72,
2048
+ "v8": "7.7"
2049
+ },
2050
+ "12.11.1": {
2051
+ "node_abi": 72,
2052
+ "v8": "7.7"
2053
+ },
2054
+ "12.12.0": {
2055
+ "node_abi": 72,
2056
+ "v8": "7.7"
2057
+ },
2058
+ "12.13.0": {
2059
+ "node_abi": 72,
2060
+ "v8": "7.7"
2061
+ },
2062
+ "13.0.0": {
2063
+ "node_abi": 79,
2064
+ "v8": "7.8"
2065
+ },
2066
+ "13.0.1": {
2067
+ "node_abi": 79,
2068
+ "v8": "7.8"
1781
2069
  }
1782
2070
  }
@@ -47,7 +47,8 @@ var share_with_node_gyp = [
47
47
  'module_path',
48
48
  'napi_version',
49
49
  'node_abi_napi',
50
- 'napi_build_version'
50
+ 'napi_build_version',
51
+ 'node_napi_label'
51
52
  ];
52
53
 
53
54
  function handle_gyp_opts(gyp, argv, callback) {
@@ -61,8 +62,10 @@ function handle_gyp_opts(gyp, argv, callback) {
61
62
  var val = opts[key];
62
63
  if (val) {
63
64
  node_pre_gyp_options.push('--' + key + '=' + val);
65
+ } else if (key === 'napi_build_version') {
66
+ node_pre_gyp_options.push('--' + key + '=0');
64
67
  } else {
65
- if (key !== 'napi_version' && key !== 'node_abi_napi' && key !== 'napi_build_version')
68
+ if (key !== 'napi_version' && key !== 'node_abi_napi')
66
69
  return callback(new Error("Option " + key + " required but not found by node-pre-gyp"));
67
70
  }
68
71
  });
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var fs = require('fs');
4
- var rm = require('rimraf');
5
4
 
6
5
  module.exports = exports;
7
6
 
@@ -27,8 +26,9 @@ var napi_multiple_commands = [
27
26
 
28
27
  var napi_build_version_tag = 'napi_build_version=';
29
28
 
30
- module.exports.get_napi_version = function() {
29
+ module.exports.get_napi_version = function(target) { // target may be undefined
31
30
  // returns the non-zero numeric napi version or undefined if napi is not supported.
31
+ // correctly supporting target requires an updated cross-walk
32
32
  var version = process.versions.napi; // can be undefined
33
33
  if (!version) { // this code should never need to be updated
34
34
  if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+
@@ -37,18 +37,20 @@ module.exports.get_napi_version = function() {
37
37
  return version;
38
38
  };
39
39
 
40
- module.exports.get_napi_version_as_string = function() {
40
+ module.exports.get_napi_version_as_string = function(target) {
41
41
  // returns the napi version as a string or an empty string if napi is not supported.
42
- var version = module.exports.get_napi_version();
42
+ var version = module.exports.get_napi_version(target);
43
43
  return version ? ''+version : '';
44
44
  };
45
45
 
46
- module.exports.validate_package_json = function(package_json) { // return err
46
+ module.exports.validate_package_json = function(package_json, opts) { // throws Error
47
+
47
48
  var binary = package_json.binary;
48
- var module_path_ok = binary.module_path && binary.module_path.indexOf('{napi_build_version}') !== -1;
49
- var remote_path_ok = binary.remote_path && binary.remote_path.indexOf('{napi_build_version}') !== -1;
50
- var package_name_ok = binary.package_name && binary.package_name.indexOf('{napi_build_version}') !== -1;
51
- var napi_build_versions = module.exports.get_napi_build_versions(package_json);
49
+ var module_path_ok = pathOK(binary.module_path);
50
+ var remote_path_ok = pathOK(binary.remote_path);
51
+ var package_name_ok = pathOK(binary.package_name);
52
+ var napi_build_versions = module.exports.get_napi_build_versions(package_json,opts,true);
53
+ var napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json);
52
54
 
53
55
  if (napi_build_versions) {
54
56
  napi_build_versions.forEach(function(napi_build_version){
@@ -63,29 +65,41 @@ module.exports.validate_package_json = function(package_json) { // return err
63
65
  "package_name must contain the substitution string '{napi_build_version}`.");
64
66
  }
65
67
 
66
- if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions) {
68
+ if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) {
67
69
  throw new Error("When the substitution string '{napi_build_version}` is specified in " +
68
70
  "module_path, remote_path, or package_name; napi_versions must also be specified.");
69
71
  }
70
72
 
71
- if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json)) {
73
+ if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) &&
74
+ module.exports.build_napi_only(package_json)) {
75
+ throw new Error(
76
+ 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
77
+ 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
78
+ 'This Node instance cannot run this module.');
79
+ }
80
+
81
+ if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) {
72
82
  throw new Error(
73
- 'The N-API version of this Node instance is ' + module.exports.get_napi_version() + '. ' +
74
- 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions(package_json) + '. ' +
83
+ 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
84
+ 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
75
85
  'This Node instance cannot run this module.');
76
86
  }
77
87
 
78
88
  };
79
89
 
80
- module.exports.expand_commands = function(package_json, commands) {
90
+ function pathOK (path) {
91
+ return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1);
92
+ }
93
+
94
+ module.exports.expand_commands = function(package_json, opts, commands) {
81
95
  var expanded_commands = [];
82
- var napi_build_versions = module.exports.get_napi_build_versions(package_json);
96
+ var napi_build_versions = module.exports.get_napi_build_versions(package_json, opts);
83
97
  commands.forEach(function(command){
84
98
  if (napi_build_versions && command.name === 'install') {
85
- var napi_build_version = module.exports.get_best_napi_build_version(package_json);
99
+ var napi_build_version = module.exports.get_best_napi_build_version(package_json, opts);
86
100
  var args = napi_build_version ? [ napi_build_version_tag+napi_build_version ] : [ ];
87
101
  expanded_commands.push ({ name: command.name, args: args });
88
- } else if (napi_build_versions && napi_multiple_commands.includes(command.name)) {
102
+ } else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) {
89
103
  napi_build_versions.forEach(function(napi_build_version){
90
104
  var args = command.args.slice();
91
105
  args.push (napi_build_version_tag+napi_build_version);
@@ -98,11 +112,39 @@ module.exports.expand_commands = function(package_json, commands) {
98
112
  return expanded_commands;
99
113
  };
100
114
 
101
- module.exports.get_napi_build_versions = function(package_json) {
115
+ module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined
116
+ var log = require('npmlog');
117
+ var napi_build_versions = [];
118
+ var supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
119
+ // remove duplicates, verify each napi version can actaully be built
120
+ if (package_json.binary && package_json.binary.napi_versions) {
121
+ package_json.binary.napi_versions.forEach(function(napi_version) {
122
+ var duplicated = napi_build_versions.indexOf(napi_version) !== -1;
123
+ if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) {
124
+ napi_build_versions.push(napi_version);
125
+ } else if (warnings && !duplicated && supported_napi_version) {
126
+ log.info('This Node instance does not support builds for N-API version', napi_version);
127
+ }
128
+ });
129
+ }
130
+ if (opts && opts["build-latest-napi-version-only"]) {
131
+ var latest_version = 0;
132
+ napi_build_versions.forEach(function(napi_version) {
133
+ if (napi_version > latest_version) latest_version = napi_version;
134
+ });
135
+ napi_build_versions = latest_version ? [ latest_version ] : [];
136
+ }
137
+ return napi_build_versions.length ? napi_build_versions : undefined;
138
+ };
139
+
140
+ module.exports.get_napi_build_versions_raw = function(package_json) {
102
141
  var napi_build_versions = [];
103
- if (package_json.binary && package_json.binary.napi_versions) { // remove duplicates
142
+ // remove duplicates
143
+ if (package_json.binary && package_json.binary.napi_versions) {
104
144
  package_json.binary.napi_versions.forEach(function(napi_version) {
105
- if (!napi_build_versions.includes(napi_version)) napi_build_versions.push(napi_version);
145
+ if (napi_build_versions.indexOf(napi_version) === -1) {
146
+ napi_build_versions.push(napi_version);
147
+ }
106
148
  });
107
149
  }
108
150
  return napi_build_versions.length ? napi_build_versions : undefined;
@@ -124,6 +166,7 @@ module.exports.get_napi_build_version_from_command_args = function(command_args)
124
166
 
125
167
  module.exports.swap_build_dir_out = function(napi_build_version) {
126
168
  if (napi_build_version) {
169
+ var rm = require('rimraf');
127
170
  rm.sync(module.exports.get_build_dir(napi_build_version));
128
171
  fs.renameSync('build', module.exports.get_build_dir(napi_build_version));
129
172
  }
@@ -131,6 +174,7 @@ module.exports.swap_build_dir_out = function(napi_build_version) {
131
174
 
132
175
  module.exports.swap_build_dir_in = function(napi_build_version) {
133
176
  if (napi_build_version) {
177
+ var rm = require('rimraf');
134
178
  rm.sync('build');
135
179
  fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');
136
180
  }
@@ -140,11 +184,11 @@ module.exports.get_build_dir = function(napi_build_version) {
140
184
  return 'build-tmp-napi-v'+napi_build_version;
141
185
  };
142
186
 
143
- module.exports.get_best_napi_build_version = function(package_json) {
187
+ module.exports.get_best_napi_build_version = function(package_json, opts) {
144
188
  var best_napi_build_version = 0;
145
- var napi_build_versions = module.exports.get_napi_build_versions (package_json);
189
+ var napi_build_versions = module.exports.get_napi_build_versions (package_json, opts);
146
190
  if (napi_build_versions) {
147
- var our_napi_version = module.exports.get_napi_version();
191
+ var our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
148
192
  napi_build_versions.forEach(function(napi_build_version){
149
193
  if (napi_build_version > best_napi_build_version &&
150
194
  napi_build_version <= our_napi_version) {
@@ -154,3 +198,8 @@ module.exports.get_best_napi_build_version = function(package_json) {
154
198
  }
155
199
  return best_napi_build_version === 0 ? undefined : best_napi_build_version;
156
200
  };
201
+
202
+ module.exports.build_napi_only = function(package_json) {
203
+ return package_json.binary && package_json.binary.package_name &&
204
+ package_json.binary.package_name.indexOf('{node_napi_label}') === -1;
205
+ };
@@ -192,7 +192,7 @@ var required_parameters = [
192
192
  'host'
193
193
  ];
194
194
 
195
- function validate_config(package_json) {
195
+ function validate_config(package_json,opts) {
196
196
  var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n';
197
197
  var missing = [];
198
198
  if (!package_json.main) {
@@ -226,7 +226,7 @@ function validate_config(package_json) {
226
226
  throw new Error("'host' protocol ("+protocol+") is invalid - only 'https:' is accepted");
227
227
  }
228
228
  }
229
- napi.validate_package_json(package_json);
229
+ napi.validate_package_json(package_json,opts);
230
230
  }
231
231
 
232
232
  module.exports.validate_config = validate_config;
@@ -276,7 +276,7 @@ var default_remote_path = '';
276
276
 
277
277
  module.exports.evaluate = function(package_json,options,napi_build_version) {
278
278
  options = options || {};
279
- validate_config(package_json);
279
+ validate_config(package_json,options); // options is a suitable substitute for opts in this case
280
280
  var v = package_json.version;
281
281
  var module_version = semver.parse(v);
282
282
  var runtime = options.runtime || get_process_runtime(process.versions);
@@ -293,9 +293,10 @@ module.exports.evaluate = function(package_json,options,napi_build_version) {
293
293
  patch: module_version.patch,
294
294
  runtime: runtime,
295
295
  node_abi: get_runtime_abi(runtime,options.target),
296
- node_abi_napi: napi.get_napi_version() ? 'napi' : get_runtime_abi(runtime,options.target),
297
- napi_version: napi.get_napi_version(), // non-zero numeric, undefined if unsupported
298
- napi_build_version: napi_build_version, // undefined if not specified
296
+ node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime,options.target),
297
+ napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported
298
+ napi_build_version: napi_build_version || '',
299
+ node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime,options.target),
299
300
  target: options.target || '',
300
301
  platform: options.target_platform || process.platform,
301
302
  target_platform: options.target_platform || process.platform,
@@ -1,27 +1,27 @@
1
1
  {
2
- "_from": "node-pre-gyp@^0.10.0",
3
- "_id": "node-pre-gyp@0.10.3",
2
+ "_from": "node-pre-gyp@*",
3
+ "_id": "node-pre-gyp@0.14.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==",
5
+ "_integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==",
6
6
  "_location": "/node-pre-gyp",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "node-pre-gyp@^0.10.0",
11
+ "raw": "node-pre-gyp@*",
12
12
  "name": "node-pre-gyp",
13
13
  "escapedName": "node-pre-gyp",
14
- "rawSpec": "^0.10.0",
14
+ "rawSpec": "*",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^0.10.0"
16
+ "fetchSpec": "*"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz",
22
- "_shasum": "3070040716afdc778747b61b6887bf78880b80fc",
23
- "_spec": "node-pre-gyp@^0.10.0",
24
- "_where": "/Users/pdunkel1/Office/fsevents/fsevents",
21
+ "_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz",
22
+ "_shasum": "9a0596533b877289bcad4e143982ca3d904ddc83",
23
+ "_spec": "node-pre-gyp@*",
24
+ "_where": "/Users/pipobscure/fsevents",
25
25
  "author": {
26
26
  "name": "Dane Springmeyer",
27
27
  "email": "dane@mapbox.com"
@@ -43,7 +43,7 @@
43
43
  "rc": "^1.2.7",
44
44
  "rimraf": "^2.6.1",
45
45
  "semver": "^5.3.0",
46
- "tar": "^4"
46
+ "tar": "^4.4.2"
47
47
  },
48
48
  "deprecated": false,
49
49
  "description": "Node.js native addon binary install tool",
@@ -82,5 +82,5 @@
82
82
  "test": "jshint lib lib/util scripts bin/node-pre-gyp && tape test/*test.js",
83
83
  "update-crosswalk": "node scripts/abi_crosswalk.js"
84
84
  },
85
- "version": "0.10.3"
85
+ "version": "0.14.0"
86
86
  }
@@ -21,7 +21,7 @@
21
21
  "_resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
22
22
  "_shasum": "d0d4685afd5415193c8c7505602d0d17cd64474d",
23
23
  "_spec": "nopt@^4.0.1",
24
- "_where": "/Users/pdunkel1/Office/fsevents/fsevents/node_modules/node-pre-gyp",
24
+ "_where": "/Users/pipobscure/fsevents/node_modules/node-pre-gyp",
25
25
  "author": {
26
26
  "name": "Isaac Z. Schlueter",
27
27
  "email": "i@izs.me",