@mrgrain/cdk-esbuild 4.0.0-alpha.4 → 4.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "isexe",
3
+ "version": "2.0.0",
4
+ "description": "Minimal module to check if a file is executable.",
5
+ "main": "index.js",
6
+ "directories": {
7
+ "test": "test"
8
+ },
9
+ "devDependencies": {
10
+ "mkdirp": "^0.5.1",
11
+ "rimraf": "^2.5.0",
12
+ "tap": "^10.3.0"
13
+ },
14
+ "scripts": {
15
+ "test": "tap test/*.js --100",
16
+ "preversion": "npm test",
17
+ "postversion": "npm publish",
18
+ "postpublish": "git push origin --all; git push origin --tags"
19
+ },
20
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
21
+ "license": "ISC",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/isaacs/isexe.git"
25
+ },
26
+ "keywords": [],
27
+ "bugs": {
28
+ "url": "https://github.com/isaacs/isexe/issues"
29
+ },
30
+ "homepage": "https://github.com/isaacs/isexe#readme"
31
+
32
+ ,"_resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz"
33
+ ,"_integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
34
+ ,"_from": "isexe@2.0.0"
35
+ }
@@ -0,0 +1,221 @@
1
+ var t = require('tap')
2
+ var fs = require('fs')
3
+ var path = require('path')
4
+ var fixture = path.resolve(__dirname, 'fixtures')
5
+ var meow = fixture + '/meow.cat'
6
+ var mine = fixture + '/mine.cat'
7
+ var ours = fixture + '/ours.cat'
8
+ var fail = fixture + '/fail.false'
9
+ var noent = fixture + '/enoent.exe'
10
+ var mkdirp = require('mkdirp')
11
+ var rimraf = require('rimraf')
12
+
13
+ var isWindows = process.platform === 'win32'
14
+ var hasAccess = typeof fs.access === 'function'
15
+ var winSkip = isWindows && 'windows'
16
+ var accessSkip = !hasAccess && 'no fs.access function'
17
+ var hasPromise = typeof Promise === 'function'
18
+ var promiseSkip = !hasPromise && 'no global Promise'
19
+
20
+ function reset () {
21
+ delete require.cache[require.resolve('../')]
22
+ return require('../')
23
+ }
24
+
25
+ t.test('setup fixtures', function (t) {
26
+ rimraf.sync(fixture)
27
+ mkdirp.sync(fixture)
28
+ fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n')
29
+ fs.chmodSync(meow, parseInt('0755', 8))
30
+ fs.writeFileSync(fail, '#!/usr/bin/env false\n')
31
+ fs.chmodSync(fail, parseInt('0644', 8))
32
+ fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n')
33
+ fs.chmodSync(mine, parseInt('0744', 8))
34
+ fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n')
35
+ fs.chmodSync(ours, parseInt('0754', 8))
36
+ t.end()
37
+ })
38
+
39
+ t.test('promise', { skip: promiseSkip }, function (t) {
40
+ var isexe = reset()
41
+ t.test('meow async', function (t) {
42
+ isexe(meow).then(function (is) {
43
+ t.ok(is)
44
+ t.end()
45
+ })
46
+ })
47
+ t.test('fail async', function (t) {
48
+ isexe(fail).then(function (is) {
49
+ t.notOk(is)
50
+ t.end()
51
+ })
52
+ })
53
+ t.test('noent async', function (t) {
54
+ isexe(noent).catch(function (er) {
55
+ t.ok(er)
56
+ t.end()
57
+ })
58
+ })
59
+ t.test('noent ignore async', function (t) {
60
+ isexe(noent, { ignoreErrors: true }).then(function (is) {
61
+ t.notOk(is)
62
+ t.end()
63
+ })
64
+ })
65
+ t.end()
66
+ })
67
+
68
+ t.test('no promise', function (t) {
69
+ global.Promise = null
70
+ var isexe = reset()
71
+ t.throws('try to meow a promise', function () {
72
+ isexe(meow)
73
+ })
74
+ t.end()
75
+ })
76
+
77
+ t.test('access', { skip: accessSkip || winSkip }, function (t) {
78
+ runTest(t)
79
+ })
80
+
81
+ t.test('mode', { skip: winSkip }, function (t) {
82
+ delete fs.access
83
+ delete fs.accessSync
84
+ var isexe = reset()
85
+ t.ok(isexe.sync(ours, { uid: 0, gid: 0 }))
86
+ t.ok(isexe.sync(mine, { uid: 0, gid: 0 }))
87
+ runTest(t)
88
+ })
89
+
90
+ t.test('windows', function (t) {
91
+ global.TESTING_WINDOWS = true
92
+ var pathExt = '.EXE;.CAT;.CMD;.COM'
93
+ t.test('pathExt option', function (t) {
94
+ runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' })
95
+ })
96
+ t.test('pathExt env', function (t) {
97
+ process.env.PATHEXT = pathExt
98
+ runTest(t)
99
+ })
100
+ t.test('no pathExt', function (t) {
101
+ // with a pathExt of '', any filename is fine.
102
+ // so the "fail" one would still pass.
103
+ runTest(t, { pathExt: '', skipFail: true })
104
+ })
105
+ t.test('pathext with empty entry', function (t) {
106
+ // with a pathExt of '', any filename is fine.
107
+ // so the "fail" one would still pass.
108
+ runTest(t, { pathExt: ';' + pathExt, skipFail: true })
109
+ })
110
+ t.end()
111
+ })
112
+
113
+ t.test('cleanup', function (t) {
114
+ rimraf.sync(fixture)
115
+ t.end()
116
+ })
117
+
118
+ function runTest (t, options) {
119
+ var isexe = reset()
120
+
121
+ var optionsIgnore = Object.create(options || {})
122
+ optionsIgnore.ignoreErrors = true
123
+
124
+ if (!options || !options.skipFail) {
125
+ t.notOk(isexe.sync(fail, options))
126
+ }
127
+ t.notOk(isexe.sync(noent, optionsIgnore))
128
+ if (!options) {
129
+ t.ok(isexe.sync(meow))
130
+ } else {
131
+ t.ok(isexe.sync(meow, options))
132
+ }
133
+
134
+ t.ok(isexe.sync(mine, options))
135
+ t.ok(isexe.sync(ours, options))
136
+ t.throws(function () {
137
+ isexe.sync(noent, options)
138
+ })
139
+
140
+ t.test('meow async', function (t) {
141
+ if (!options) {
142
+ isexe(meow, function (er, is) {
143
+ if (er) {
144
+ throw er
145
+ }
146
+ t.ok(is)
147
+ t.end()
148
+ })
149
+ } else {
150
+ isexe(meow, options, function (er, is) {
151
+ if (er) {
152
+ throw er
153
+ }
154
+ t.ok(is)
155
+ t.end()
156
+ })
157
+ }
158
+ })
159
+
160
+ t.test('mine async', function (t) {
161
+ isexe(mine, options, function (er, is) {
162
+ if (er) {
163
+ throw er
164
+ }
165
+ t.ok(is)
166
+ t.end()
167
+ })
168
+ })
169
+
170
+ t.test('ours async', function (t) {
171
+ isexe(ours, options, function (er, is) {
172
+ if (er) {
173
+ throw er
174
+ }
175
+ t.ok(is)
176
+ t.end()
177
+ })
178
+ })
179
+
180
+ if (!options || !options.skipFail) {
181
+ t.test('fail async', function (t) {
182
+ isexe(fail, options, function (er, is) {
183
+ if (er) {
184
+ throw er
185
+ }
186
+ t.notOk(is)
187
+ t.end()
188
+ })
189
+ })
190
+ }
191
+
192
+ t.test('noent async', function (t) {
193
+ isexe(noent, options, function (er, is) {
194
+ t.ok(er)
195
+ t.notOk(is)
196
+ t.end()
197
+ })
198
+ })
199
+
200
+ t.test('noent ignore async', function (t) {
201
+ isexe(noent, optionsIgnore, function (er, is) {
202
+ if (er) {
203
+ throw er
204
+ }
205
+ t.notOk(is)
206
+ t.end()
207
+ })
208
+ })
209
+
210
+ t.test('directory is not executable', function (t) {
211
+ isexe(__dirname, options, function (er, is) {
212
+ if (er) {
213
+ throw er
214
+ }
215
+ t.notOk(is)
216
+ t.end()
217
+ })
218
+ })
219
+
220
+ t.end()
221
+ }
@@ -0,0 +1,42 @@
1
+ module.exports = isexe
2
+ isexe.sync = sync
3
+
4
+ var fs = require('fs')
5
+
6
+ function checkPathExt (path, options) {
7
+ var pathext = options.pathExt !== undefined ?
8
+ options.pathExt : process.env.PATHEXT
9
+
10
+ if (!pathext) {
11
+ return true
12
+ }
13
+
14
+ pathext = pathext.split(';')
15
+ if (pathext.indexOf('') !== -1) {
16
+ return true
17
+ }
18
+ for (var i = 0; i < pathext.length; i++) {
19
+ var p = pathext[i].toLowerCase()
20
+ if (p && path.substr(-p.length).toLowerCase() === p) {
21
+ return true
22
+ }
23
+ }
24
+ return false
25
+ }
26
+
27
+ function checkStat (stat, path, options) {
28
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
29
+ return false
30
+ }
31
+ return checkPathExt(path, options)
32
+ }
33
+
34
+ function isexe (path, options, cb) {
35
+ fs.stat(path, function (er, stat) {
36
+ cb(er, er ? false : checkStat(stat, path, options))
37
+ })
38
+ }
39
+
40
+ function sync (path, options) {
41
+ return checkStat(fs.statSync(path), path, options)
42
+ }
@@ -0,0 +1,166 @@
1
+ # Changes
2
+
3
+
4
+ ## 2.0.2
5
+
6
+ * Rename bin to `node-which`
7
+
8
+ ## 2.0.1
9
+
10
+ * generate changelog and publish on version bump
11
+ * enforce 100% test coverage
12
+ * Promise interface
13
+
14
+ ## 2.0.0
15
+
16
+ * Parallel tests, modern JavaScript, and drop support for node < 8
17
+
18
+ ## 1.3.1
19
+
20
+ * update deps
21
+ * update travis
22
+
23
+ ## v1.3.0
24
+
25
+ * Add nothrow option to which.sync
26
+ * update tap
27
+
28
+ ## v1.2.14
29
+
30
+ * appveyor: drop node 5 and 0.x
31
+ * travis-ci: add node 6, drop 0.x
32
+
33
+ ## v1.2.13
34
+
35
+ * test: Pass missing option to pass on windows
36
+ * update tap
37
+ * update isexe to 2.0.0
38
+ * neveragain.tech pledge request
39
+
40
+ ## v1.2.12
41
+
42
+ * Removed unused require
43
+
44
+ ## v1.2.11
45
+
46
+ * Prevent changelog script from being included in package
47
+
48
+ ## v1.2.10
49
+
50
+ * Use env.PATH only, not env.Path
51
+
52
+ ## v1.2.9
53
+
54
+ * fix for paths starting with ../
55
+ * Remove unused `is-absolute` module
56
+
57
+ ## v1.2.8
58
+
59
+ * bullet items in changelog that contain (but don't start with) #
60
+
61
+ ## v1.2.7
62
+
63
+ * strip 'update changelog' changelog entries out of changelog
64
+
65
+ ## v1.2.6
66
+
67
+ * make the changelog bulleted
68
+
69
+ ## v1.2.5
70
+
71
+ * make a changelog, and keep it up to date
72
+ * don't include tests in package
73
+ * Properly handle relative-path executables
74
+ * appveyor
75
+ * Attach error code to Not Found error
76
+ * Make tests pass on Windows
77
+
78
+ ## v1.2.4
79
+
80
+ * Fix typo
81
+
82
+ ## v1.2.3
83
+
84
+ * update isexe, fix regression in pathExt handling
85
+
86
+ ## v1.2.2
87
+
88
+ * update deps, use isexe module, test windows
89
+
90
+ ## v1.2.1
91
+
92
+ * Sometimes windows PATH entries are quoted
93
+ * Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode.
94
+ * doc cli
95
+
96
+ ## v1.2.0
97
+
98
+ * Add support for opt.all and -as cli flags
99
+ * test the bin
100
+ * update travis
101
+ * Allow checking for multiple programs in bin/which
102
+ * tap 2
103
+
104
+ ## v1.1.2
105
+
106
+ * travis
107
+ * Refactored and fixed undefined error on Windows
108
+ * Support strict mode
109
+
110
+ ## v1.1.1
111
+
112
+ * test +g exes against secondary groups, if available
113
+ * Use windows exe semantics on cygwin & msys
114
+ * cwd should be first in path on win32, not last
115
+ * Handle lower-case 'env.Path' on Windows
116
+ * Update docs
117
+ * use single-quotes
118
+
119
+ ## v1.1.0
120
+
121
+ * Add tests, depend on is-absolute
122
+
123
+ ## v1.0.9
124
+
125
+ * which.js: root is allowed to execute files owned by anyone
126
+
127
+ ## v1.0.8
128
+
129
+ * don't use graceful-fs
130
+
131
+ ## v1.0.7
132
+
133
+ * add license to package.json
134
+
135
+ ## v1.0.6
136
+
137
+ * isc license
138
+
139
+ ## 1.0.5
140
+
141
+ * Awful typo
142
+
143
+ ## 1.0.4
144
+
145
+ * Test for path absoluteness properly
146
+ * win: Allow '' as a pathext if cmd has a . in it
147
+
148
+ ## 1.0.3
149
+
150
+ * Remove references to execPath
151
+ * Make `which.sync()` work on Windows by honoring the PATHEXT variable.
152
+ * Make `isExe()` always return true on Windows.
153
+ * MIT
154
+
155
+ ## 1.0.2
156
+
157
+ * Only files can be exes
158
+
159
+ ## 1.0.1
160
+
161
+ * Respect the PATHEXT env for win32 support
162
+ * should 0755 the bin
163
+ * binary
164
+ * guts
165
+ * package
166
+ * 1st
@@ -0,0 +1,15 @@
1
+ The ISC License
2
+
3
+ Copyright (c) Isaac Z. Schlueter and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,54 @@
1
+ # which
2
+
3
+ Like the unix `which` utility.
4
+
5
+ Finds the first instance of a specified executable in the PATH
6
+ environment variable. Does not cache the results, so `hash -r` is not
7
+ needed when the PATH changes.
8
+
9
+ ## USAGE
10
+
11
+ ```javascript
12
+ var which = require('which')
13
+
14
+ // async usage
15
+ which('node', function (er, resolvedPath) {
16
+ // er is returned if no "node" is found on the PATH
17
+ // if it is found, then the absolute path to the exec is returned
18
+ })
19
+
20
+ // or promise
21
+ which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... })
22
+
23
+ // sync usage
24
+ // throws if not found
25
+ var resolved = which.sync('node')
26
+
27
+ // if nothrow option is used, returns null if not found
28
+ resolved = which.sync('node', {nothrow: true})
29
+
30
+ // Pass options to override the PATH and PATHEXT environment vars.
31
+ which('node', { path: someOtherPath }, function (er, resolved) {
32
+ if (er)
33
+ throw er
34
+ console.log('found at %j', resolved)
35
+ })
36
+ ```
37
+
38
+ ## CLI USAGE
39
+
40
+ Same as the BSD `which(1)` binary.
41
+
42
+ ```
43
+ usage: which [-as] program ...
44
+ ```
45
+
46
+ ## OPTIONS
47
+
48
+ You may pass an options object as the second argument.
49
+
50
+ - `path`: Use instead of the `PATH` environment variable.
51
+ - `pathExt`: Use instead of the `PATHEXT` environment variable.
52
+ - `all`: Return all matches, instead of just the first one. Note that
53
+ this means the function returns an array of strings instead of a
54
+ single string.
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ var which = require("../")
3
+ if (process.argv.length < 3)
4
+ usage()
5
+
6
+ function usage () {
7
+ console.error('usage: which [-as] program ...')
8
+ process.exit(1)
9
+ }
10
+
11
+ var all = false
12
+ var silent = false
13
+ var dashdash = false
14
+ var args = process.argv.slice(2).filter(function (arg) {
15
+ if (dashdash || !/^-/.test(arg))
16
+ return true
17
+
18
+ if (arg === '--') {
19
+ dashdash = true
20
+ return false
21
+ }
22
+
23
+ var flags = arg.substr(1).split('')
24
+ for (var f = 0; f < flags.length; f++) {
25
+ var flag = flags[f]
26
+ switch (flag) {
27
+ case 's':
28
+ silent = true
29
+ break
30
+ case 'a':
31
+ all = true
32
+ break
33
+ default:
34
+ console.error('which: illegal option -- ' + flag)
35
+ usage()
36
+ }
37
+ }
38
+ return false
39
+ })
40
+
41
+ process.exit(args.reduce(function (pv, current) {
42
+ try {
43
+ var f = which.sync(current, { all: all })
44
+ if (all)
45
+ f = f.join('\n')
46
+ if (!silent)
47
+ console.log(f)
48
+ return pv;
49
+ } catch (e) {
50
+ return 1;
51
+ }
52
+ }, 0))
@@ -0,0 +1,47 @@
1
+ {
2
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
3
+ "name": "which",
4
+ "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
5
+ "version": "2.0.2",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git://github.com/isaacs/node-which.git"
9
+ },
10
+ "main": "which.js",
11
+ "bin": {
12
+ "node-which": "./bin/node-which"
13
+ },
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "isexe": "^2.0.0"
17
+ },
18
+ "devDependencies": {
19
+ "mkdirp": "^0.5.0",
20
+ "rimraf": "^2.6.2",
21
+ "tap": "^14.6.9"
22
+ },
23
+ "scripts": {
24
+ "test": "tap",
25
+ "preversion": "npm test",
26
+ "postversion": "npm publish",
27
+ "prepublish": "npm run changelog",
28
+ "prechangelog": "bash gen-changelog.sh",
29
+ "changelog": "git add CHANGELOG.md",
30
+ "postchangelog": "git commit -m 'update changelog - '${npm_package_version}",
31
+ "postpublish": "git push origin --follow-tags"
32
+ },
33
+ "files": [
34
+ "which.js",
35
+ "bin/node-which"
36
+ ],
37
+ "tap": {
38
+ "check-coverage": true
39
+ },
40
+ "engines": {
41
+ "node": ">= 8"
42
+ }
43
+
44
+ ,"_resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz"
45
+ ,"_integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="
46
+ ,"_from": "which@2.0.2"
47
+ }