@gradientedge/cdk-utils 8.16.0 → 8.18.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.
- package/app/api-destined-function/layers/nodejs/node_modules/.yarn-integrity +2 -2
- package/app/api-destined-function/layers/nodejs/package.json +1 -1
- package/app/api-destined-function/node_modules/.yarn-integrity +52 -11
- package/app/api-destined-function/node_modules/mkdirp/LICENSE +1 -1
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/package.json +90 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/bin.d.ts +2 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/bin.js +73 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/bin.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/find-made.d.ts +3 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/find-made.js +35 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/find-made.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/index-cjs.d.ts +74 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/index-cjs.js +7 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/index-cjs.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/index.d.ts +30 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/index.js +49 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/index.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts +5 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js +79 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts +5 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js +50 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/opts-arg.d.ts +41 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/opts-arg.js +38 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/opts-arg.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/path-arg.js +28 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/path-arg.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/use-native.d.ts +5 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/use-native.js +17 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/cjs/src/use-native.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/find-made.d.ts +3 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/find-made.js +30 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/find-made.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/index.d.ts +30 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/index.js +39 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/index.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts +5 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/mkdirp-manual.js +75 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/mkdirp-manual.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts +5 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/mkdirp-native.js +46 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/mkdirp-native.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/opts-arg.d.ts +41 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/opts-arg.js +34 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/opts-arg.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/package.json +3 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/path-arg.d.ts +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/path-arg.js +24 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/path-arg.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/use-native.d.ts +5 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/use-native.js +14 -0
- package/app/api-destined-function/node_modules/mkdirp/dist/mjs/use-native.js.map +1 -0
- package/app/api-destined-function/node_modules/mkdirp/package.json +66 -20
- package/app/api-destined-function/node_modules/mkdirp/readme.markdown +104 -89
- package/app/api-destined-function/package.json +1 -1
- package/package.json +11 -11
- package/app/api-destined-function/node_modules/mkdirp/bin/cmd.js +0 -68
- package/app/api-destined-function/node_modules/mkdirp/index.js +0 -31
- package/app/api-destined-function/node_modules/mkdirp/lib/find-made.js +0 -29
- package/app/api-destined-function/node_modules/mkdirp/lib/mkdirp-manual.js +0 -64
- package/app/api-destined-function/node_modules/mkdirp/lib/mkdirp-native.js +0 -39
- package/app/api-destined-function/node_modules/mkdirp/lib/opts-arg.js +0 -23
- package/app/api-destined-function/node_modules/mkdirp/lib/path-arg.js +0 -29
- package/app/api-destined-function/node_modules/mkdirp/lib/use-native.js +0 -10
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mkdirp",
|
|
3
3
|
"description": "Recursively mkdir, like `mkdir -p`",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"main": "index.js",
|
|
4
|
+
"version": "2.1.3",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"mkdir",
|
|
8
7
|
"directory",
|
|
@@ -12,33 +11,80 @@
|
|
|
12
11
|
"recursive",
|
|
13
12
|
"native"
|
|
14
13
|
],
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
"main": "./dist/cjs/src/index-cjs.js",
|
|
15
|
+
"module": "./dist/mjs/index.js",
|
|
16
|
+
"bin": "./dist/cjs/src/bin.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": {
|
|
20
|
+
"types": "./dist/mjs/index.d.ts",
|
|
21
|
+
"default": "./dist/mjs/index.js"
|
|
22
|
+
},
|
|
23
|
+
"require": {
|
|
24
|
+
"types": "./dist/cjs/src/index-cjs.d.ts",
|
|
25
|
+
"default": "./dist/cjs/src/index-cjs.js"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
18
28
|
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
19
32
|
"scripts": {
|
|
20
|
-
"test": "tap",
|
|
21
|
-
"snap": "tap",
|
|
22
33
|
"preversion": "npm test",
|
|
23
34
|
"postversion": "npm publish",
|
|
24
|
-
"
|
|
35
|
+
"prepublishOnly": "git push origin --follow-tags",
|
|
36
|
+
"preprepare": "rm -rf dist",
|
|
37
|
+
"prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
|
|
38
|
+
"postprepare": "bash fixup.sh",
|
|
39
|
+
"pretest": "npm run prepare",
|
|
40
|
+
"presnap": "npm run prepare",
|
|
41
|
+
"test": "c8 tap",
|
|
42
|
+
"snap": "c8 tap",
|
|
43
|
+
"format": "prettier --write . --loglevel warn",
|
|
44
|
+
"benchmark": "node benchmark/index.js",
|
|
45
|
+
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts"
|
|
25
46
|
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
47
|
+
"prettier": {
|
|
48
|
+
"semi": false,
|
|
49
|
+
"printWidth": 80,
|
|
50
|
+
"tabWidth": 2,
|
|
51
|
+
"useTabs": false,
|
|
52
|
+
"singleQuote": true,
|
|
53
|
+
"jsxSingleQuote": false,
|
|
54
|
+
"bracketSameLine": true,
|
|
55
|
+
"arrowParens": "avoid",
|
|
56
|
+
"endOfLine": "lf"
|
|
29
57
|
},
|
|
30
58
|
"devDependencies": {
|
|
31
|
-
"
|
|
32
|
-
"
|
|
59
|
+
"@types/brace-expansion": "^1.1.0",
|
|
60
|
+
"@types/node": "^18.11.9",
|
|
61
|
+
"@types/tap": "^15.0.7",
|
|
62
|
+
"c8": "^7.12.0",
|
|
63
|
+
"eslint-config-prettier": "^8.6.0",
|
|
64
|
+
"prettier": "^2.8.2",
|
|
65
|
+
"tap": "^16.3.3",
|
|
66
|
+
"ts-node": "^10.9.1",
|
|
67
|
+
"typedoc": "^0.23.21",
|
|
68
|
+
"typescript": "^4.9.3"
|
|
69
|
+
},
|
|
70
|
+
"tap": {
|
|
71
|
+
"coverage": false,
|
|
72
|
+
"node-arg": [
|
|
73
|
+
"--no-warnings",
|
|
74
|
+
"--loader",
|
|
75
|
+
"ts-node/esm"
|
|
76
|
+
],
|
|
77
|
+
"ts": false
|
|
78
|
+
},
|
|
79
|
+
"funding": {
|
|
80
|
+
"url": "https://github.com/sponsors/isaacs"
|
|
81
|
+
},
|
|
82
|
+
"repository": {
|
|
83
|
+
"type": "git",
|
|
84
|
+
"url": "https://github.com/isaacs/node-mkdirp.git"
|
|
33
85
|
},
|
|
34
|
-
"bin": "bin/cmd.js",
|
|
35
86
|
"license": "MIT",
|
|
36
87
|
"engines": {
|
|
37
88
|
"node": ">=10"
|
|
38
|
-
}
|
|
39
|
-
"files": [
|
|
40
|
-
"bin",
|
|
41
|
-
"lib",
|
|
42
|
-
"index.js"
|
|
43
|
-
]
|
|
89
|
+
}
|
|
44
90
|
}
|
|
@@ -11,11 +11,15 @@ Now with a modern API and no\* bugs!
|
|
|
11
11
|
## pow.js
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
|
|
14
|
+
// hybrid module, import or require() both work
|
|
15
|
+
import { mkdirp } from 'mkdirp'
|
|
16
|
+
// or:
|
|
17
|
+
const { mkdirp } = require('mkdirp')
|
|
15
18
|
|
|
16
19
|
// return value is a Promise resolving to the first directory created
|
|
17
20
|
mkdirp('/tmp/foo/bar/baz').then(made =>
|
|
18
|
-
console.log(`made directories, starting with ${made}`)
|
|
21
|
+
console.log(`made directories, starting with ${made}`)
|
|
22
|
+
)
|
|
19
23
|
```
|
|
20
24
|
|
|
21
25
|
Output (where `/tmp/foo` already exists)
|
|
@@ -27,7 +31,7 @@ made directories, starting with /tmp/foo/bar
|
|
|
27
31
|
Or, if you don't have time to wait around for promises:
|
|
28
32
|
|
|
29
33
|
```js
|
|
30
|
-
|
|
34
|
+
import { mkdirp } from 'mkdirp'
|
|
31
35
|
|
|
32
36
|
// return value is the first directory created
|
|
33
37
|
const made = mkdirp.sync('/tmp/foo/bar/baz')
|
|
@@ -39,86 +43,88 @@ And now /tmp/foo/bar/baz exists, huzzah!
|
|
|
39
43
|
# methods
|
|
40
44
|
|
|
41
45
|
```js
|
|
42
|
-
|
|
46
|
+
import { mkdirp } from 'mkdirp'
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
## mkdirp(dir,
|
|
49
|
+
## `mkdirp(dir: string, opts?: MkdirpOptions) => Promise<string | undefined>`
|
|
46
50
|
|
|
47
|
-
Create a new directory and any necessary subdirectories at `dir`
|
|
48
|
-
permission string `opts.mode`. If `opts` is a string
|
|
49
|
-
treated as the `opts.mode`.
|
|
51
|
+
Create a new directory and any necessary subdirectories at `dir`
|
|
52
|
+
with octal permission string `opts.mode`. If `opts` is a string
|
|
53
|
+
or number, it will be treated as the `opts.mode`.
|
|
50
54
|
|
|
51
|
-
If `opts.mode` isn't specified, it defaults to `0o777
|
|
52
|
-
(~process.umask())`.
|
|
55
|
+
If `opts.mode` isn't specified, it defaults to `0o777`.
|
|
53
56
|
|
|
54
|
-
Promise resolves to first directory `made` that had to be
|
|
55
|
-
`undefined` if everything already exists.
|
|
56
|
-
are encountered.
|
|
57
|
-
directories _may_ have been created, as
|
|
58
|
-
an atomic operation.
|
|
57
|
+
Promise resolves to first directory `made` that had to be
|
|
58
|
+
created, or `undefined` if everything already exists. Promise
|
|
59
|
+
rejects if any errors are encountered. Note that, in the case of
|
|
60
|
+
promise rejection, some directories _may_ have been created, as
|
|
61
|
+
recursive directory creation is not an atomic operation.
|
|
59
62
|
|
|
60
|
-
You can optionally pass in an alternate `fs` implementation by
|
|
61
|
-
`opts.fs`. Your implementation should have
|
|
62
|
-
and `opts.fs.stat(path, cb)`.
|
|
63
|
+
You can optionally pass in an alternate `fs` implementation by
|
|
64
|
+
passing in `opts.fs`. Your implementation should have
|
|
65
|
+
`opts.fs.mkdir(path, opts, cb)` and `opts.fs.stat(path, cb)`.
|
|
63
66
|
|
|
64
|
-
You can also override just one or the other of `mkdir` and `stat`
|
|
65
|
-
passing in `opts.stat` or `opts.mkdir`, or providing an `fs`
|
|
66
|
-
only overrides one of these.
|
|
67
|
+
You can also override just one or the other of `mkdir` and `stat`
|
|
68
|
+
by passing in `opts.stat` or `opts.mkdir`, or providing an `fs`
|
|
69
|
+
option that only overrides one of these.
|
|
67
70
|
|
|
68
|
-
## mkdirp.sync(dir, opts)
|
|
71
|
+
## `mkdirp.sync(dir: string, opts: MkdirpOptions) => string|undefined`
|
|
69
72
|
|
|
70
|
-
Synchronously create a new directory and any necessary
|
|
71
|
-
`dir` with octal permission string `opts.mode`.
|
|
72
|
-
number, it will be treated as the
|
|
73
|
+
Synchronously create a new directory and any necessary
|
|
74
|
+
subdirectories at `dir` with octal permission string `opts.mode`.
|
|
75
|
+
If `opts` is a string or number, it will be treated as the
|
|
76
|
+
`opts.mode`.
|
|
73
77
|
|
|
74
|
-
If `opts.mode` isn't specified, it defaults to `0o777
|
|
75
|
-
(~process.umask())`.
|
|
78
|
+
If `opts.mode` isn't specified, it defaults to `0o777`.
|
|
76
79
|
|
|
77
|
-
Returns the first directory that had to be created, or undefined
|
|
78
|
-
everything already exists.
|
|
80
|
+
Returns the first directory that had to be created, or undefined
|
|
81
|
+
if everything already exists.
|
|
79
82
|
|
|
80
|
-
You can optionally pass in an alternate `fs` implementation by
|
|
81
|
-
`opts.fs`. Your implementation should have
|
|
82
|
-
and `opts.fs.statSync(path)`.
|
|
83
|
+
You can optionally pass in an alternate `fs` implementation by
|
|
84
|
+
passing in `opts.fs`. Your implementation should have
|
|
85
|
+
`opts.fs.mkdirSync(path, mode)` and `opts.fs.statSync(path)`.
|
|
83
86
|
|
|
84
|
-
You can also override just one or the other of `mkdirSync` and
|
|
85
|
-
by passing in `opts.statSync` or `opts.mkdirSync`, or
|
|
86
|
-
option that only overrides one of these.
|
|
87
|
+
You can also override just one or the other of `mkdirSync` and
|
|
88
|
+
`statSync` by passing in `opts.statSync` or `opts.mkdirSync`, or
|
|
89
|
+
providing an `fs` option that only overrides one of these.
|
|
87
90
|
|
|
88
|
-
## mkdirp.manual
|
|
91
|
+
## `mkdirp.manual`, `mkdirp.manualSync`
|
|
89
92
|
|
|
90
|
-
Use the manual implementation (not the native one).
|
|
91
|
-
when the native implementation is not available or the
|
|
92
|
-
implementation is overridden.
|
|
93
|
+
Use the manual implementation (not the native one). This is the
|
|
94
|
+
default when the native implementation is not available or the
|
|
95
|
+
stat/mkdir implementation is overridden.
|
|
93
96
|
|
|
94
|
-
## mkdirp.native
|
|
97
|
+
## `mkdirp.native`, `mkdirp.nativeSync`
|
|
95
98
|
|
|
96
|
-
Use the native implementation (not the manual one).
|
|
97
|
-
when the native implementation is available and
|
|
98
|
-
overridden.
|
|
99
|
+
Use the native implementation (not the manual one). This is the
|
|
100
|
+
default when the native implementation is available and
|
|
101
|
+
stat/mkdir are not overridden.
|
|
99
102
|
|
|
100
103
|
# implementation
|
|
101
104
|
|
|
102
105
|
On Node.js v10.12.0 and above, use the native `fs.mkdir(p,
|
|
103
|
-
{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has
|
|
104
|
-
overridden by an option.
|
|
106
|
+
{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has
|
|
107
|
+
been overridden by an option.
|
|
105
108
|
|
|
106
109
|
## native implementation
|
|
107
110
|
|
|
108
111
|
- If the path is a root directory, then pass it to the underlying
|
|
109
|
-
implementation and return the result/error.
|
|
110
|
-
succeed or fail, but we aren't actually creating
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
implementation and return the result/error. (In this case,
|
|
113
|
+
it'll either succeed or fail, but we aren't actually creating
|
|
114
|
+
any dirs.)
|
|
115
|
+
- Walk up the path statting each directory, to find the first
|
|
116
|
+
path that will be created, `made`.
|
|
113
117
|
- Call `fs.mkdir(path, { recursive: true })` (or `fs.mkdirSync`)
|
|
114
118
|
- If error, raise it to the caller.
|
|
115
119
|
- Return `made`.
|
|
116
120
|
|
|
117
121
|
## manual implementation
|
|
118
122
|
|
|
119
|
-
- Call underlying `fs.mkdir` implementation, with `recursive:
|
|
123
|
+
- Call underlying `fs.mkdir` implementation, with `recursive:
|
|
124
|
+
false`
|
|
120
125
|
- If error:
|
|
121
|
-
- If path is a root directory, raise to the caller and do not
|
|
126
|
+
- If path is a root directory, raise to the caller and do not
|
|
127
|
+
handle it
|
|
122
128
|
- If ENOENT, mkdirp parent dir, store result as `made`
|
|
123
129
|
- stat(path)
|
|
124
130
|
- If error, raise original `mkdir` error
|
|
@@ -129,67 +135,74 @@ overridden by an option.
|
|
|
129
135
|
|
|
130
136
|
## windows vs unix caveat
|
|
131
137
|
|
|
132
|
-
On Windows file systems, attempts to create a root directory (ie,
|
|
133
|
-
letter or root UNC path) will fail.
|
|
134
|
-
will fail with `EPERM`.
|
|
135
|
-
fail with `ENOENT`.
|
|
138
|
+
On Windows file systems, attempts to create a root directory (ie,
|
|
139
|
+
a drive letter or root UNC path) will fail. If the root
|
|
140
|
+
directory exists, then it will fail with `EPERM`. If the root
|
|
141
|
+
directory does not exist, then it will fail with `ENOENT`.
|
|
136
142
|
|
|
137
|
-
On posix file systems, attempts to create a root directory (in
|
|
138
|
-
mode) will succeed silently, as it is treated like just
|
|
139
|
-
that already exists.
|
|
140
|
-
`EEXIST`.)
|
|
143
|
+
On posix file systems, attempts to create a root directory (in
|
|
144
|
+
recursive mode) will succeed silently, as it is treated like just
|
|
145
|
+
another directory that already exists. (In non-recursive mode,
|
|
146
|
+
of course, it fails with `EEXIST`.)
|
|
141
147
|
|
|
142
|
-
In order to preserve this system-specific behavior (and because
|
|
143
|
-
if we can create the parent of a root directory
|
|
144
|
-
a root directory are passed directly
|
|
145
|
-
errors encountered are not
|
|
148
|
+
In order to preserve this system-specific behavior (and because
|
|
149
|
+
it's not as if we can create the parent of a root directory
|
|
150
|
+
anyway), attempts to create a root directory are passed directly
|
|
151
|
+
to the `fs` implementation, and any errors encountered are not
|
|
152
|
+
handled.
|
|
146
153
|
|
|
147
154
|
## native error caveat
|
|
148
155
|
|
|
149
|
-
The native implementation (as of at least Node.js v13.4.0) does
|
|
150
|
-
appropriate errors in some cases (see
|
|
151
|
-
[nodejs/node#31481](https://github.com/nodejs/node/issues/31481)
|
|
156
|
+
The native implementation (as of at least Node.js v13.4.0) does
|
|
157
|
+
not provide appropriate errors in some cases (see
|
|
158
|
+
[nodejs/node#31481](https://github.com/nodejs/node/issues/31481)
|
|
159
|
+
and
|
|
152
160
|
[nodejs/node#28015](https://github.com/nodejs/node/issues/28015)).
|
|
153
161
|
|
|
154
|
-
In order to work around this issue, the native implementation
|
|
155
|
-
back to the manual implementation if an `ENOENT` error
|
|
162
|
+
In order to work around this issue, the native implementation
|
|
163
|
+
will fall back to the manual implementation if an `ENOENT` error
|
|
164
|
+
is encountered.
|
|
156
165
|
|
|
157
166
|
# choosing a recursive mkdir implementation
|
|
158
167
|
|
|
159
|
-
There are a few to choose from!
|
|
168
|
+
There are a few to choose from! Use the one that suits your
|
|
169
|
+
needs best :D
|
|
160
170
|
|
|
161
171
|
## use `fs.mkdir(path, {recursive: true}, cb)` if:
|
|
162
172
|
|
|
163
|
-
- You wish to optimize performance even at the expense of other
|
|
173
|
+
- You wish to optimize performance even at the expense of other
|
|
174
|
+
factors.
|
|
164
175
|
- You don't need to know the first dir created.
|
|
165
|
-
- You are ok with getting `ENOENT` as the error when some other
|
|
166
|
-
the actual cause.
|
|
176
|
+
- You are ok with getting `ENOENT` as the error when some other
|
|
177
|
+
problem is the actual cause.
|
|
167
178
|
- You can limit your platforms to Node.js v10.12 and above.
|
|
168
179
|
- You're ok with using callbacks instead of promises.
|
|
169
180
|
- You don't need/want a CLI.
|
|
170
181
|
- You don't need to override the `fs` methods in use.
|
|
171
182
|
|
|
172
|
-
## use this module (mkdirp 1.x) if:
|
|
183
|
+
## use this module (mkdirp 1.x or 2.x) if:
|
|
173
184
|
|
|
174
185
|
- You need to know the first directory that was created.
|
|
175
|
-
- You wish to use the native implementation if available, but
|
|
176
|
-
when it's not.
|
|
186
|
+
- You wish to use the native implementation if available, but
|
|
187
|
+
fall back when it's not.
|
|
177
188
|
- You prefer promise-returning APIs to callback-taking APIs.
|
|
178
|
-
- You want more useful error messages than the native recursive
|
|
179
|
-
provides (at least as of Node.js v13.4), and are ok with
|
|
180
|
-
`ENOENT` to achieve this.
|
|
189
|
+
- You want more useful error messages than the native recursive
|
|
190
|
+
mkdir provides (at least as of Node.js v13.4), and are ok with
|
|
191
|
+
re-trying on `ENOENT` to achieve this.
|
|
181
192
|
- You need (or at least, are ok with) a CLI.
|
|
182
193
|
- You need to override the `fs` methods in use.
|
|
183
194
|
|
|
184
195
|
## use [`make-dir`](http://npm.im/make-dir) if:
|
|
185
196
|
|
|
186
|
-
- You do not need to know the first dir created (and wish to save
|
|
187
|
-
`stat` calls when using the native implementation for
|
|
188
|
-
|
|
189
|
-
|
|
197
|
+
- You do not need to know the first dir created (and wish to save
|
|
198
|
+
a few `stat` calls when using the native implementation for
|
|
199
|
+
this reason).
|
|
200
|
+
- You wish to use the native implementation if available, but
|
|
201
|
+
fall back when it's not.
|
|
190
202
|
- You prefer promise-returning APIs to callback-taking APIs.
|
|
191
|
-
- You are ok with occasionally getting `ENOENT` errors for
|
|
192
|
-
are actually related to something other than a
|
|
203
|
+
- You are ok with occasionally getting `ENOENT` errors for
|
|
204
|
+
failures that are actually related to something other than a
|
|
205
|
+
missing file system entry.
|
|
193
206
|
- You don't need/want a CLI.
|
|
194
207
|
- You need to override the `fs` methods in use.
|
|
195
208
|
|
|
@@ -199,11 +212,13 @@ There are a few to choose from! Use the one that suits your needs best :D
|
|
|
199
212
|
- You need (or at least, are ok with) a CLI.
|
|
200
213
|
- You need to override the `fs` methods in use.
|
|
201
214
|
- You're ok with using callbacks instead of promises.
|
|
202
|
-
- You are not running on Windows, where the root-level ENOENT
|
|
203
|
-
lead to infinite regress.
|
|
204
|
-
- You think vinyl just sounds warmer and richer for some weird
|
|
205
|
-
|
|
206
|
-
|
|
215
|
+
- You are not running on Windows, where the root-level ENOENT
|
|
216
|
+
errors can lead to infinite regress.
|
|
217
|
+
- You think vinyl just sounds warmer and richer for some weird
|
|
218
|
+
reason.
|
|
219
|
+
- You are supporting truly ancient Node.js versions, before even
|
|
220
|
+
the advent of a `Promise` language primitive. (Please don't.
|
|
221
|
+
You deserve better.)
|
|
207
222
|
|
|
208
223
|
# cli
|
|
209
224
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.18.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prettier": "npx prettier --check \"**/*.{ts,json,md}\"",
|
|
39
39
|
"prettify": "npx prettier --write \"**/*.{ts,json,md}\"",
|
|
40
40
|
"test": "rimraf coverage && npx jest --ci --maxWorkers=100%",
|
|
41
|
-
"update:deps": "ncu -u -x lerna
|
|
41
|
+
"update:deps": "ncu -u -x lerna,semantic-release",
|
|
42
42
|
"validate": "yarn prettier && yarn test"
|
|
43
43
|
},
|
|
44
44
|
"husky": {
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@types/lodash": "^4.14.191",
|
|
51
|
-
"@types/node": "^18.
|
|
51
|
+
"@types/node": "^18.13.0",
|
|
52
52
|
"app-root-path": "^3.1.0",
|
|
53
|
-
"aws-cdk-lib": "^2.
|
|
54
|
-
"aws-sdk": "^2.
|
|
55
|
-
"constructs": "^10.1.
|
|
53
|
+
"aws-cdk-lib": "^2.64.0",
|
|
54
|
+
"aws-sdk": "^2.1316.0",
|
|
55
|
+
"constructs": "^10.1.251",
|
|
56
56
|
"lodash": "^4.17.21",
|
|
57
57
|
"moment": "^2.29.4",
|
|
58
58
|
"nconf": "^0.12.0",
|
|
@@ -62,26 +62,26 @@
|
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
64
|
"@types/jest": "^29.4.0",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
66
|
-
"@typescript-eslint/parser": "^5.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.52.0",
|
|
66
|
+
"@typescript-eslint/parser": "^5.52.0",
|
|
67
67
|
"aws-cdk": "*",
|
|
68
68
|
"babel-eslint": "^10.1.0",
|
|
69
69
|
"better-docs": "^2.7.2",
|
|
70
70
|
"codecov": "^3.8.3",
|
|
71
71
|
"commitizen": "^4.3.0",
|
|
72
72
|
"dotenv": "^16.0.3",
|
|
73
|
-
"eslint": "^8.
|
|
73
|
+
"eslint": "^8.34.0",
|
|
74
74
|
"eslint-config-prettier": "^8.6.0",
|
|
75
75
|
"eslint-plugin-import": "^2.27.5",
|
|
76
76
|
"husky": "^8.0.3",
|
|
77
|
-
"jest": "^29.4.
|
|
77
|
+
"jest": "^29.4.3",
|
|
78
78
|
"jest-extended": "^3.2.3",
|
|
79
79
|
"jest-junit": "^15.0.0",
|
|
80
80
|
"jsdoc": "^4.0.0",
|
|
81
81
|
"jsdoc-babel": "^0.5.0",
|
|
82
82
|
"jsdoc-mermaid": "^1.0.0",
|
|
83
83
|
"lerna": "^5.6.2",
|
|
84
|
-
"prettier": "^2.8.
|
|
84
|
+
"prettier": "^2.8.4",
|
|
85
85
|
"prettier-plugin-organize-imports": "^3.2.2",
|
|
86
86
|
"rimraf": "^4.1.2",
|
|
87
87
|
"semantic-release": "^19.0.5",
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const usage = () => `
|
|
4
|
-
usage: mkdirp [DIR1,DIR2..] {OPTIONS}
|
|
5
|
-
|
|
6
|
-
Create each supplied directory including any necessary parent directories
|
|
7
|
-
that don't yet exist.
|
|
8
|
-
|
|
9
|
-
If the directory already exists, do nothing.
|
|
10
|
-
|
|
11
|
-
OPTIONS are:
|
|
12
|
-
|
|
13
|
-
-m<mode> If a directory needs to be created, set the mode as an octal
|
|
14
|
-
--mode=<mode> permission string.
|
|
15
|
-
|
|
16
|
-
-v --version Print the mkdirp version number
|
|
17
|
-
|
|
18
|
-
-h --help Print this helpful banner
|
|
19
|
-
|
|
20
|
-
-p --print Print the first directories created for each path provided
|
|
21
|
-
|
|
22
|
-
--manual Use manual implementation, even if native is available
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
const dirs = []
|
|
26
|
-
const opts = {}
|
|
27
|
-
let print = false
|
|
28
|
-
let dashdash = false
|
|
29
|
-
let manual = false
|
|
30
|
-
for (const arg of process.argv.slice(2)) {
|
|
31
|
-
if (dashdash)
|
|
32
|
-
dirs.push(arg)
|
|
33
|
-
else if (arg === '--')
|
|
34
|
-
dashdash = true
|
|
35
|
-
else if (arg === '--manual')
|
|
36
|
-
manual = true
|
|
37
|
-
else if (/^-h/.test(arg) || /^--help/.test(arg)) {
|
|
38
|
-
console.log(usage())
|
|
39
|
-
process.exit(0)
|
|
40
|
-
} else if (arg === '-v' || arg === '--version') {
|
|
41
|
-
console.log(require('../package.json').version)
|
|
42
|
-
process.exit(0)
|
|
43
|
-
} else if (arg === '-p' || arg === '--print') {
|
|
44
|
-
print = true
|
|
45
|
-
} else if (/^-m/.test(arg) || /^--mode=/.test(arg)) {
|
|
46
|
-
const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8)
|
|
47
|
-
if (isNaN(mode)) {
|
|
48
|
-
console.error(`invalid mode argument: ${arg}\nMust be an octal number.`)
|
|
49
|
-
process.exit(1)
|
|
50
|
-
}
|
|
51
|
-
opts.mode = mode
|
|
52
|
-
} else
|
|
53
|
-
dirs.push(arg)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const mkdirp = require('../')
|
|
57
|
-
const impl = manual ? mkdirp.manual : mkdirp
|
|
58
|
-
if (dirs.length === 0)
|
|
59
|
-
console.error(usage())
|
|
60
|
-
|
|
61
|
-
Promise.all(dirs.map(dir => impl(dir, opts)))
|
|
62
|
-
.then(made => print ? made.forEach(m => m && console.log(m)) : null)
|
|
63
|
-
.catch(er => {
|
|
64
|
-
console.error(er.message)
|
|
65
|
-
if (er.code)
|
|
66
|
-
console.error(' code: ' + er.code)
|
|
67
|
-
process.exit(1)
|
|
68
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const optsArg = require('./lib/opts-arg.js')
|
|
2
|
-
const pathArg = require('./lib/path-arg.js')
|
|
3
|
-
|
|
4
|
-
const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js')
|
|
5
|
-
const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js')
|
|
6
|
-
const {useNative, useNativeSync} = require('./lib/use-native.js')
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const mkdirp = (path, opts) => {
|
|
10
|
-
path = pathArg(path)
|
|
11
|
-
opts = optsArg(opts)
|
|
12
|
-
return useNative(opts)
|
|
13
|
-
? mkdirpNative(path, opts)
|
|
14
|
-
: mkdirpManual(path, opts)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const mkdirpSync = (path, opts) => {
|
|
18
|
-
path = pathArg(path)
|
|
19
|
-
opts = optsArg(opts)
|
|
20
|
-
return useNativeSync(opts)
|
|
21
|
-
? mkdirpNativeSync(path, opts)
|
|
22
|
-
: mkdirpManualSync(path, opts)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
mkdirp.sync = mkdirpSync
|
|
26
|
-
mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts))
|
|
27
|
-
mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts))
|
|
28
|
-
mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts))
|
|
29
|
-
mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts))
|
|
30
|
-
|
|
31
|
-
module.exports = mkdirp
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const {dirname} = require('path')
|
|
2
|
-
|
|
3
|
-
const findMade = (opts, parent, path = undefined) => {
|
|
4
|
-
// we never want the 'made' return value to be a root directory
|
|
5
|
-
if (path === parent)
|
|
6
|
-
return Promise.resolve()
|
|
7
|
-
|
|
8
|
-
return opts.statAsync(parent).then(
|
|
9
|
-
st => st.isDirectory() ? path : undefined, // will fail later
|
|
10
|
-
er => er.code === 'ENOENT'
|
|
11
|
-
? findMade(opts, dirname(parent), parent)
|
|
12
|
-
: undefined
|
|
13
|
-
)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const findMadeSync = (opts, parent, path = undefined) => {
|
|
17
|
-
if (path === parent)
|
|
18
|
-
return undefined
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
return opts.statSync(parent).isDirectory() ? path : undefined
|
|
22
|
-
} catch (er) {
|
|
23
|
-
return er.code === 'ENOENT'
|
|
24
|
-
? findMadeSync(opts, dirname(parent), parent)
|
|
25
|
-
: undefined
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = {findMade, findMadeSync}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const {dirname} = require('path')
|
|
2
|
-
|
|
3
|
-
const mkdirpManual = (path, opts, made) => {
|
|
4
|
-
opts.recursive = false
|
|
5
|
-
const parent = dirname(path)
|
|
6
|
-
if (parent === path) {
|
|
7
|
-
return opts.mkdirAsync(path, opts).catch(er => {
|
|
8
|
-
// swallowed by recursive implementation on posix systems
|
|
9
|
-
// any other error is a failure
|
|
10
|
-
if (er.code !== 'EISDIR')
|
|
11
|
-
throw er
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return opts.mkdirAsync(path, opts).then(() => made || path, er => {
|
|
16
|
-
if (er.code === 'ENOENT')
|
|
17
|
-
return mkdirpManual(parent, opts)
|
|
18
|
-
.then(made => mkdirpManual(path, opts, made))
|
|
19
|
-
if (er.code !== 'EEXIST' && er.code !== 'EROFS')
|
|
20
|
-
throw er
|
|
21
|
-
return opts.statAsync(path).then(st => {
|
|
22
|
-
if (st.isDirectory())
|
|
23
|
-
return made
|
|
24
|
-
else
|
|
25
|
-
throw er
|
|
26
|
-
}, () => { throw er })
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const mkdirpManualSync = (path, opts, made) => {
|
|
31
|
-
const parent = dirname(path)
|
|
32
|
-
opts.recursive = false
|
|
33
|
-
|
|
34
|
-
if (parent === path) {
|
|
35
|
-
try {
|
|
36
|
-
return opts.mkdirSync(path, opts)
|
|
37
|
-
} catch (er) {
|
|
38
|
-
// swallowed by recursive implementation on posix systems
|
|
39
|
-
// any other error is a failure
|
|
40
|
-
if (er.code !== 'EISDIR')
|
|
41
|
-
throw er
|
|
42
|
-
else
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
opts.mkdirSync(path, opts)
|
|
49
|
-
return made || path
|
|
50
|
-
} catch (er) {
|
|
51
|
-
if (er.code === 'ENOENT')
|
|
52
|
-
return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))
|
|
53
|
-
if (er.code !== 'EEXIST' && er.code !== 'EROFS')
|
|
54
|
-
throw er
|
|
55
|
-
try {
|
|
56
|
-
if (!opts.statSync(path).isDirectory())
|
|
57
|
-
throw er
|
|
58
|
-
} catch (_) {
|
|
59
|
-
throw er
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
module.exports = {mkdirpManual, mkdirpManualSync}
|