Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit 9e46872

Browse files
maclover7rvagg
authored andcommitted
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add too much value. Happy to add back if helps some people when reading through `node-gyp`. - DRY up `lib/process-release.js`. - Removes a bunch of extra blank lines, as well as random spaces. PR-URL: #1508 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 3e64c78 commit 9e46872

12 files changed

Lines changed: 21 additions & 109 deletions

‎bin/node-gyp.js‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#!/usr/bin/env node
22

3-
/**
4-
* Set the title.
5-
*/
6-
73
process.title='node-gyp'
84

9-
/**
10-
* Module dependencies.
11-
*/
12-
135
vargyp=require('../')
146
varlog=require('npmlog')
157
varosenv=require('osenv')
@@ -126,7 +118,7 @@ process.on('uncaughtException', function (err) {
126118
})
127119

128120
functionerrorMessage(){
129-
// copied from npm's lib/util/error-handler.js
121+
// copied from npm's lib/utils/error-handler.js
130122
varos=require('os')
131123
log.error('System',os.type()+' '+os.release())
132124
log.error('command',process.argv

‎lib/build.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
module.exports=exports=build
33

4-
/**
5-
* Module dependencies.
6-
*/
7-
84
varfs=require('graceful-fs')
95
,rm=require('rimraf')
106
,path=require('path')
@@ -32,8 +28,6 @@ function build (gyp, argv, callback) {
3228
varrelease=processRelease(argv,gyp,process.version,process.release)
3329
,makeCommand=gyp.opts.make||process.env.MAKE||platformMake
3430
,command=win ? 'msbuild' : makeCommand
35-
,buildDir=path.resolve('build')
36-
,configPath=path.resolve(buildDir,'config.gypi')
3731
,jobs=gyp.opts.jobs||process.env.JOBS
3832
,buildType
3933
,config
@@ -47,6 +41,7 @@ function build (gyp, argv, callback) {
4741
*/
4842

4943
functionloadConfigGypi(){
44+
varconfigPath=path.resolve('build','config.gypi')
5045
fs.readFile(configPath,'utf8',function(err,data){
5146
if(err){
5247
if(err.code=='ENOENT'){
@@ -187,13 +182,11 @@ function build (gyp, argv, callback) {
187182
})
188183
}
189184

190-
191185
/**
192186
* Actually spawn the process and compile the module.
193187
*/
194188

195189
functiondoBuild(){
196-
197190
// Enable Verbose build
198191
varverbose=log.levels[log.level]<=log.levels.verbose
199192
if(!win&&verbose){
@@ -253,10 +246,6 @@ function build (gyp, argv, callback) {
253246
proc.on('exit',onExit)
254247
}
255248

256-
/**
257-
* Invoked after the make/msbuild command exits.
258-
*/
259-
260249
functiononExit(code,signal){
261250
if(code!==0){
262251
returncallback(newError('`'+command+'` failed with exit code: '+code))
@@ -266,5 +255,4 @@ function build (gyp, argv, callback) {
266255
}
267256
callback()
268257
}
269-
270258
}

‎lib/clean.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ module.exports = exports = clean
33

44
exports.usage='Removes any generated build files and the "out" dir'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varrm=require('rimraf')
117
varlog=require('npmlog')
128

13-
149
functionclean(gyp,argv,callback){
15-
1610
// Remove the 'build' dir
1711
varbuildDir='build'
1812

1913
log.verbose('clean','removing "%s" directory',buildDir)
2014
rm(buildDir,callback)
21-
2215
}

‎lib/configure.js‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ module.exports.test = {
55
findPython: findPython,
66
}
77

8-
/**
9-
* Module dependencies.
10-
*/
11-
128
varfs=require('graceful-fs')
139
,path=require('path')
1410
,log=require('npmlog')
@@ -28,7 +24,6 @@ if (win)
2824
exports.usage='Generates '+(win ? 'MSVC project files' : 'a Makefile')+' for the current module'
2925

3026
functionconfigure(gyp,argv,callback){
31-
3227
varpython=gyp.opts.python||process.env.PYTHON||'python2'
3328
,buildDir=path.resolve('build')
3429
,configNames=['config.gypi','common.gypi']
@@ -46,7 +41,6 @@ function configure (gyp, argv, callback) {
4641
})
4742

4843
functiongetNodeDir(){
49-
5044
// 'python' should be set by now
5145
process.env.PYTHON=python
5246

@@ -56,7 +50,6 @@ function configure (gyp, argv, callback) {
5650

5751
log.verbose('get node dir','compiling against specified --nodedir dev files: %s',nodeDir)
5852
createBuildDir()
59-
6053
}else{
6154
// if no --nodedir specified, ensure node dependencies are installed
6255
if('v'+release.version!==process.version){
@@ -245,12 +238,12 @@ function configure (gyp, argv, callback) {
245238
})
246239

247240
// For AIX and z/OS we need to set up the path to the exports file
248-
// which contains the symbols needed for linking.
241+
// which contains the symbols needed for linking.
249242
varnode_exp_file=undefined
250243
if(process.platform==='aix'||process.platform==='os390'){
251244
varext=process.platform==='aix' ? 'exp' : 'x'
252245
varnode_root_dir=findNodeDirectory()
253-
varcandidates=undefined
246+
varcandidates=undefined
254247
if(process.platform==='aix'){
255248
candidates=['include/node/node',
256249
'out/Release/node',
@@ -336,10 +329,6 @@ function configure (gyp, argv, callback) {
336329
})
337330
}
338331

339-
/**
340-
* Called when the `gyp` child process exits.
341-
*/
342-
343332
functiononCpExit(code,signal){
344333
if(code!==0){
345334
callback(newError('`gyp` failed with exit code: '+code))

‎lib/find-node-directory.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
varpath=require('path')
22
,log=require('npmlog')
33

4-
functionfindNodeDirectory(scriptLocation,processObj){
4+
module.exports=functionfindNodeDirectory(scriptLocation,processObj){
55
// set dirname and process if not passed in
66
// this facilitates regression tests
77
if(scriptLocation===undefined){
@@ -57,5 +57,3 @@ function findNodeDirectory(scriptLocation, processObj) {
5757
}
5858
returnnode_root_dir
5959
}
60-
61-
module.exports=findNodeDirectory

‎lib/find-vs2017.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var log = require('npmlog')
22
,execFile=require('child_process').execFile
33
,path=require('path')
44

5-
functionfindVS2017(callback){
5+
module.exports=functionfindVS2017(callback){
66
varps=path.join(process.env.SystemRoot,'System32','WindowsPowerShell',
77
'v1.0','powershell.exe')
88
varcsFile=path.join(__dirname,'Find-VS2017.cs')
@@ -42,5 +42,3 @@ function findVS2017(callback) {
4242

4343
child.stdin.end()
4444
}
45-
46-
module.exports=findVS2017

‎lib/install.js‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ module.exports.test = {
1010

1111
exports.usage='Install node development files for the specified node version.'
1212

13-
/**
14-
* Module dependencies.
15-
*/
16-
1713
varfs=require('graceful-fs')
1814
,osenv=require('osenv')
1915
,tar=require('tar')
@@ -28,7 +24,6 @@ var fs = require('graceful-fs')
2824
,win=process.platform=='win32'
2925

3026
functioninstall(fs,gyp,argv,callback){
31-
3227
varrelease=processRelease(argv,gyp,process.version,process.release)
3328

3429
// ensure no double-callbacks happen
@@ -124,7 +119,6 @@ function install (fs, gyp, argv, callback) {
124119
}
125120

126121
functiongo(){
127-
128122
log.verbose('ensuring nodedir is created',devDir)
129123

130124
// first create the dir for the node dev files
@@ -165,7 +159,6 @@ function install (fs, gyp, argv, callback) {
165159
}
166160

167161
// download the tarball and extract!
168-
169162
if(tarPath){
170163
returntar.extract({
171164
file: tarPath,

‎lib/list.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = exports = list
33

44
exports.usage='Prints a listing of the currently installed node development files'
55

6-
/**
7-
* Module dependencies.
8-
*/
9-
106
varfs=require('graceful-fs')
117
,path=require('path')
128
,log=require('npmlog')
139

1410
functionlist(gyp,args,callback){
15-
1611
vardevDir=gyp.devDir
1712
log.verbose('list','using node-gyp dir:',devDir)
1813

19-
// readdir() the node-gyp dir
2014
fs.readdir(devDir,onreaddir)
2115

2216
functiononreaddir(err,versions){

‎lib/node-gyp.js‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11

2-
/**
3-
* Module exports.
4-
*/
5-
62
module.exports=exports=gyp
73

8-
/**
9-
* Module dependencies.
10-
*/
11-
124
varfs=require('graceful-fs')
135
,path=require('path')
146
,nopt=require('nopt')
@@ -35,10 +27,6 @@ var fs = require('graceful-fs')
3527
// differentiate node-gyp's logs from npm's
3628
log.heading='gyp'
3729

38-
/**
39-
* The `gyp` function.
40-
*/
41-
4230
functiongyp(){
4331
returnnewGyp()
4432
}
@@ -213,4 +201,3 @@ Object.defineProperty(proto, 'version', {
213201
}
214202
,enumerable: true
215203
})
216-

‎lib/process-release.js‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var semver = require('semver')
99
,bitsreV3=/\/win-(x86|ia32|x64)\//// io.js v3.x.x shipped with "ia32" but should
1010
// have been "x86"
1111

12-
// Captures all the logic required to determine download URLs, local directory and
12+
// Captures all the logic required to determine download URLs, local directory and
1313
// file names. Inputs come from command-line switches (--target, --dist-url),
1414
// `process.version` and `process.release` where it exists.
1515
functionprocessRelease(argv,gyp,defaultVersion,defaultRelease){
@@ -88,35 +88,22 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
8888
baseUrl=url.resolve(defaultRelease.headersUrl,'./')
8989
libUrl32=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x86',versionSemver.major)
9090
libUrl64=resolveLibUrl(name,defaultRelease.libUrl||baseUrl||distBaseUrl,'x64',versionSemver.major)
91-
92-
return{
93-
version: version,
94-
semver: versionSemver,
95-
name: name,
96-
baseUrl: baseUrl,
97-
tarballUrl: defaultRelease.headersUrl,
98-
shasumsUrl: url.resolve(baseUrl,'SHASUMS256.txt'),
99-
versionDir: (name!=='node' ? name+'-' : '')+version,
100-
libUrl32: libUrl32,
101-
libUrl64: libUrl64,
102-
libPath32: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl32).path)),
103-
libPath64: normalizePath(path.relative(url.parse(baseUrl).path,url.parse(libUrl64).path))
104-
}
91+
tarballUrl=defaultRelease.headersUrl
92+
}else{
93+
// older versions without process.release are captured here and we have to make
94+
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
95+
// current process.release
96+
baseUrl=distBaseUrl
97+
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
98+
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
99+
100+
// making the bold assumption that anything with a version number >3.0.0 will
101+
// have a *-headers.tar.gz file in its dist location, even some frankenstein
102+
// custom version
103+
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
104+
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
105105
}
106106

107-
// older versions without process.release are captured here and we have to make
108-
// a lot of assumptions, additionally if you --target=x.y.z then we can't use the
109-
// current process.release
110-
111-
baseUrl=distBaseUrl
112-
libUrl32=resolveLibUrl(name,baseUrl,'x86',versionSemver.major)
113-
libUrl64=resolveLibUrl(name,baseUrl,'x64',versionSemver.major)
114-
// making the bold assumption that anything with a version number >3.0.0 will
115-
// have a *-headers.tar.gz file in its dist location, even some frankenstein
116-
// custom version
117-
canGetHeaders=semver.satisfies(versionSemver,headersTarballRange)
118-
tarballUrl=url.resolve(baseUrl,name+'-v'+version+(canGetHeaders ? '-headers' : '')+'.tar.gz')
119-
120107
return{
121108
version: version,
122109
semver: versionSemver,

0 commit comments

Comments
 (0)