@modernpoacher/deps 2.2.17 → 2.2.19

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.
@@ -1,11 +1,7 @@
1
1
  /**
2
- * A package
3
- * @typedef {import('../common/index.mjs').Package} Package
4
- */
5
-
6
- /**
7
- * A configuration
8
- * @typedef {import('../common/index.mjs').Configuration} Configuration
2
+ * @typedef {DepsTypes.DependencyDescriptor} DependencyDescriptor
3
+ * @typedef {DepsTypes.Package} Package
4
+ * @typedef {DepsTypes.Configuration} Configuration
9
5
  */
10
6
 
11
7
  import debug from 'debug'
@@ -51,7 +47,7 @@ log(`\`install\` (${VERSION} - ${PLATFORM}) is awake`)
51
47
  *
52
48
  * Get the `install --save-exact` commands as a string
53
49
  *
54
- * @param {Package} p - Package
50
+ * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
55
51
  * @param {boolean} s - Save
56
52
  * @param {string} r - Registry
57
53
  * @param {boolean} f - Force
@@ -74,7 +70,7 @@ export function getInstallSaveExactCommands (p, s, r, f) {
74
70
  *
75
71
  * Get the `install` commands as a string
76
72
  *
77
- * @param {Package} p - Package
73
+ * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
78
74
  * @param {boolean} s - Save
79
75
  * @param {string} r - Registry
80
76
  * @param {boolean} f - Force
@@ -98,10 +94,10 @@ export function getInstallCommands (p, s, r, f) {
98
94
  * Spawn the `install --save-exact` commands
99
95
  *
100
96
  * @param {string} d - Directory
101
- * @param {Package} p - Package
102
- * @param {Configuration} c - Configuration
97
+ * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
103
98
  * @param {boolean} s - Save
104
99
  * @param {string} r - Registry
100
+ * @param {boolean} f - Force
105
101
  * @returns {Promise<string>}
106
102
  */
107
103
  export function installSaveExact (d, p, s, r, f) {
@@ -109,7 +105,7 @@ export function installSaveExact (d, p, s, r, f) {
109
105
 
110
106
  const directory = normalize(d.trim())
111
107
 
112
- log(`Directory is "${directory}"`)
108
+ info(`Directory is "${directory}"`)
113
109
 
114
110
  return (
115
111
  new Promise((resolve, reject) => {
@@ -123,8 +119,8 @@ export function installSaveExact (d, p, s, r, f) {
123
119
  return (!e) ? resolve(v) : reject(e)
124
120
  })
125
121
 
126
- stdout.on('data', log)
127
- stderr.on('data', log)
122
+ if (stdout) stdout.on('data', log)
123
+ if (stderr) stderr.on('data', log)
128
124
  })
129
125
  )
130
126
  }
@@ -135,10 +131,10 @@ export function installSaveExact (d, p, s, r, f) {
135
131
  * Spawn the `install` commands
136
132
  *
137
133
  * @param {string} d - Directory
138
- * @param {Package} p - Package
139
- * @param {Configuration} c - Configuration
134
+ * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
140
135
  * @param {boolean} s - Save
141
136
  * @param {string} r - Registry
137
+ * @param {boolean} f - Force
142
138
  * @returns {Promise<string>}
143
139
  */
144
140
  export function install (d, p, s, r, f) {
@@ -146,7 +142,7 @@ export function install (d, p, s, r, f) {
146
142
 
147
143
  const directory = normalize(d.trim())
148
144
 
149
- log(`Directory is "${directory}"`)
145
+ info(`Directory is "${directory}"`)
150
146
 
151
147
  return (
152
148
  new Promise((resolve, reject) => {
@@ -160,8 +156,8 @@ export function install (d, p, s, r, f) {
160
156
  return (!e) ? resolve(v) : reject(e)
161
157
  })
162
158
 
163
- stdout.on('data', log)
164
- stderr.on('data', log)
159
+ if (stdout) stdout.on('data', log)
160
+ if (stderr) stderr.on('data', log)
165
161
  })
166
162
  )
167
163
  }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "target": "ESNext",
5
+ "allowJs": true,
6
+ "checkJs": true,
7
+ "noEmit": true,
8
+ "strict": true,
9
+ "baseUrl": "."
10
+ },
11
+ "include": [
12
+ "."
13
+ ],
14
+ "exclude": [
15
+ "test",
16
+ ".circleci",
17
+ ".github",
18
+ ".husky",
19
+ ]
20
+ }