@mrgrain/cdk-esbuild 4.0.0-alpha.7 → 4.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.jsii +1573 -588
  2. package/CHANGELOG.md +104 -0
  3. package/LICENSE +1 -1
  4. package/README.md +223 -102
  5. package/lib/asset.d.ts +20 -5
  6. package/lib/asset.js +31 -19
  7. package/lib/bundler.d.ts +51 -28
  8. package/lib/bundler.js +28 -17
  9. package/lib/code.d.ts +82 -16
  10. package/lib/code.js +71 -25
  11. package/lib/esbuild-types.d.ts +49 -18
  12. package/lib/esbuild-types.js +1 -1
  13. package/lib/index.d.ts +5 -4
  14. package/lib/index.js +8 -7
  15. package/lib/inline-code.d.ts +29 -77
  16. package/lib/inline-code.js +53 -104
  17. package/lib/private/dynamic-package.d.ts +41 -0
  18. package/lib/private/dynamic-package.js +115 -0
  19. package/lib/private/esbuild-source.d.ts +33 -0
  20. package/lib/private/esbuild-source.js +59 -0
  21. package/lib/private/utils.d.ts +7 -0
  22. package/lib/private/utils.js +23 -0
  23. package/lib/provider.d.ts +129 -0
  24. package/lib/provider.js +115 -0
  25. package/lib/source.d.ts +81 -5
  26. package/lib/source.js +84 -8
  27. package/package.json +33 -25
  28. package/rosetta/default.ts-fixture +32 -0
  29. package/.gitattributes +0 -24
  30. package/.projenrc.ts +0 -208
  31. package/API.md +0 -2477
  32. package/SECURITY.md +0 -19
  33. package/lib/esbuild-polyfill.js +0 -2302
  34. package/lib/esbuild-wrapper.d.ts +0 -3
  35. package/lib/esbuild-wrapper.js +0 -31
  36. package/lib/formatMessages.d.ts +0 -18
  37. package/lib/formatMessages.js +0 -34
  38. package/node_modules/isexe/.npmignore +0 -2
  39. package/node_modules/isexe/LICENSE +0 -15
  40. package/node_modules/isexe/README.md +0 -51
  41. package/node_modules/isexe/index.js +0 -57
  42. package/node_modules/isexe/mode.js +0 -41
  43. package/node_modules/isexe/package.json +0 -35
  44. package/node_modules/isexe/test/basic.js +0 -221
  45. package/node_modules/isexe/windows.js +0 -42
  46. package/node_modules/which/CHANGELOG.md +0 -166
  47. package/node_modules/which/LICENSE +0 -15
  48. package/node_modules/which/README.md +0 -54
  49. package/node_modules/which/bin/node-which +0 -52
  50. package/node_modules/which/package.json +0 -47
  51. package/node_modules/which/which.js +0 -125
@@ -1,166 +0,0 @@
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
@@ -1,15 +0,0 @@
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.
@@ -1,54 +0,0 @@
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.
@@ -1,52 +0,0 @@
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))
@@ -1,47 +0,0 @@
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
- }
@@ -1,125 +0,0 @@
1
- const isWindows = process.platform === 'win32' ||
2
- process.env.OSTYPE === 'cygwin' ||
3
- process.env.OSTYPE === 'msys'
4
-
5
- const path = require('path')
6
- const COLON = isWindows ? ';' : ':'
7
- const isexe = require('isexe')
8
-
9
- const getNotFoundError = (cmd) =>
10
- Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
11
-
12
- const getPathInfo = (cmd, opt) => {
13
- const colon = opt.colon || COLON
14
-
15
- // If it has a slash, then we don't bother searching the pathenv.
16
- // just check the file itself, and that's it.
17
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? ['']
18
- : (
19
- [
20
- // windows always checks the cwd first
21
- ...(isWindows ? [process.cwd()] : []),
22
- ...(opt.path || process.env.PATH ||
23
- /* istanbul ignore next: very unusual */ '').split(colon),
24
- ]
25
- )
26
- const pathExtExe = isWindows
27
- ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'
28
- : ''
29
- const pathExt = isWindows ? pathExtExe.split(colon) : ['']
30
-
31
- if (isWindows) {
32
- if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
33
- pathExt.unshift('')
34
- }
35
-
36
- return {
37
- pathEnv,
38
- pathExt,
39
- pathExtExe,
40
- }
41
- }
42
-
43
- const which = (cmd, opt, cb) => {
44
- if (typeof opt === 'function') {
45
- cb = opt
46
- opt = {}
47
- }
48
- if (!opt)
49
- opt = {}
50
-
51
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
52
- const found = []
53
-
54
- const step = i => new Promise((resolve, reject) => {
55
- if (i === pathEnv.length)
56
- return opt.all && found.length ? resolve(found)
57
- : reject(getNotFoundError(cmd))
58
-
59
- const ppRaw = pathEnv[i]
60
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
61
-
62
- const pCmd = path.join(pathPart, cmd)
63
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
64
- : pCmd
65
-
66
- resolve(subStep(p, i, 0))
67
- })
68
-
69
- const subStep = (p, i, ii) => new Promise((resolve, reject) => {
70
- if (ii === pathExt.length)
71
- return resolve(step(i + 1))
72
- const ext = pathExt[ii]
73
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
74
- if (!er && is) {
75
- if (opt.all)
76
- found.push(p + ext)
77
- else
78
- return resolve(p + ext)
79
- }
80
- return resolve(subStep(p, i, ii + 1))
81
- })
82
- })
83
-
84
- return cb ? step(0).then(res => cb(null, res), cb) : step(0)
85
- }
86
-
87
- const whichSync = (cmd, opt) => {
88
- opt = opt || {}
89
-
90
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
91
- const found = []
92
-
93
- for (let i = 0; i < pathEnv.length; i ++) {
94
- const ppRaw = pathEnv[i]
95
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
96
-
97
- const pCmd = path.join(pathPart, cmd)
98
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
99
- : pCmd
100
-
101
- for (let j = 0; j < pathExt.length; j ++) {
102
- const cur = p + pathExt[j]
103
- try {
104
- const is = isexe.sync(cur, { pathExt: pathExtExe })
105
- if (is) {
106
- if (opt.all)
107
- found.push(cur)
108
- else
109
- return cur
110
- }
111
- } catch (ex) {}
112
- }
113
- }
114
-
115
- if (opt.all && found.length)
116
- return found
117
-
118
- if (opt.nothrow)
119
- return null
120
-
121
- throw getNotFoundError(cmd)
122
- }
123
-
124
- module.exports = which
125
- which.sync = whichSync