@stryke/fs 0.9.1 → 0.9.2
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/dist/copy-file.cjs +11 -0
- package/dist/{files/copy-files.d.ts → copy-file.d.ts} +1 -1
- package/dist/copy-file.mjs +1 -0
- package/dist/get-tsconfig.cjs +112 -0
- package/dist/get-tsconfig.mjs +4 -0
- package/dist/{files/helpers.cjs → helpers.cjs} +1 -1
- package/dist/helpers.mjs +1 -0
- package/dist/index.cjs +118 -8
- package/dist/index.d.ts +12 -2
- package/dist/index.mjs +1 -1
- package/dist/{package/install.cjs → install.cjs} +5 -5
- package/dist/{package/install.d.ts → install.d.ts} +1 -1
- package/dist/install.mjs +1 -0
- package/dist/{files/list-files.cjs → list-files.cjs} +2 -2
- package/dist/list-files.mjs +1 -0
- package/dist/{package/package-fns.cjs → package-fns.cjs} +17 -17
- package/dist/{package/package-fns.d.ts → package-fns.d.ts} +3 -3
- package/dist/package-fns.mjs +1 -0
- package/dist/{files/read-file.cjs → read-file.cjs} +1 -1
- package/dist/read-file.mjs +1 -0
- package/dist/{package/semver-fns.d.ts → semver-fns.d.ts} +2 -2
- package/dist/{files/write-file.cjs → write-file.cjs} +3 -3
- package/dist/write-file.mjs +3 -0
- package/package.json +94 -148
- package/dist/files/copy-files.cjs +0 -15
- package/dist/files/copy-files.mjs +0 -1
- package/dist/files/helpers.mjs +0 -1
- package/dist/files/index.cjs +0 -93
- package/dist/files/index.d.ts +0 -8
- package/dist/files/index.mjs +0 -1
- package/dist/files/list-files.mjs +0 -1
- package/dist/files/read-file.mjs +0 -1
- package/dist/files/write-file.mjs +0 -3
- package/dist/package/get-tsconfig.cjs +0 -110
- package/dist/package/get-tsconfig.mjs +0 -4
- package/dist/package/index.cjs +0 -49
- package/dist/package/index.d.ts +0 -4
- package/dist/package/index.mjs +0 -1
- package/dist/package/install.mjs +0 -1
- package/dist/package/package-fns.mjs +0 -1
- /package/dist/{files/chmod-x.cjs → chmod-x.cjs} +0 -0
- /package/dist/{files/chmod-x.d.ts → chmod-x.d.ts} +0 -0
- /package/dist/{files/chmod-x.mjs → chmod-x.mjs} +0 -0
- /package/dist/{files/constants.cjs → constants.cjs} +0 -0
- /package/dist/{files/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{files/constants.mjs → constants.mjs} +0 -0
- /package/dist/{package/get-tsconfig.d.ts → get-tsconfig.d.ts} +0 -0
- /package/dist/{files/helpers.d.ts → helpers.d.ts} +0 -0
- /package/dist/{files/list-files.d.ts → list-files.d.ts} +0 -0
- /package/dist/{files/read-file.d.ts → read-file.d.ts} +0 -0
- /package/dist/{files/remove-file.cjs → remove-file.cjs} +0 -0
- /package/dist/{files/remove-file.d.ts → remove-file.d.ts} +0 -0
- /package/dist/{files/remove-file.mjs → remove-file.mjs} +0 -0
- /package/dist/{package/semver-fns.cjs → semver-fns.cjs} +0 -0
- /package/dist/{package/semver-fns.mjs → semver-fns.mjs} +0 -0
- /package/dist/{files/write-file.d.ts → write-file.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/fs",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various file system utilities that expand the functionality of NodeJs's `fs` module.",
|
|
6
6
|
"repository": {
|
|
@@ -18,13 +18,15 @@
|
|
|
18
18
|
"nanotar": "^0.2.0",
|
|
19
19
|
"picomatch": "^4.0.2",
|
|
20
20
|
"semver": "7.7.1",
|
|
21
|
-
"@stryke/json": ">=0.4.
|
|
22
|
-
"@stryke/path": ">=0.3.
|
|
21
|
+
"@stryke/json": ">=0.4.3",
|
|
22
|
+
"@stryke/path": ">=0.3.4",
|
|
23
|
+
"@stryke/type-checks": ">=0.0.1",
|
|
23
24
|
"@stryke/types": ">=0.5.1"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@types/node": "^22.13.1",
|
|
27
28
|
"@types/picomatch": "^3.0.2",
|
|
29
|
+
"@types/semver": "^7.5.8",
|
|
28
30
|
"nx": "^20.5.0",
|
|
29
31
|
"tinyexec": "^0.3.2"
|
|
30
32
|
},
|
|
@@ -72,208 +74,180 @@
|
|
|
72
74
|
}
|
|
73
75
|
],
|
|
74
76
|
"exports": {
|
|
75
|
-
"./
|
|
76
|
-
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
77
|
-
"require": {
|
|
78
|
-
"types": "./dist/index.d.ts",
|
|
79
|
-
"default": "./dist/index.cjs"
|
|
80
|
-
},
|
|
81
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
82
|
-
},
|
|
83
|
-
"./package/semver-fns": {
|
|
77
|
+
"./write-file": {
|
|
84
78
|
"import": {
|
|
85
|
-
"types": "./dist/
|
|
86
|
-
"default": "./dist/
|
|
79
|
+
"types": "./dist/write-file.d.ts",
|
|
80
|
+
"default": "./dist/write-file.mjs"
|
|
87
81
|
},
|
|
88
82
|
"require": {
|
|
89
|
-
"types": "./dist/
|
|
90
|
-
"default": "./dist/
|
|
83
|
+
"types": "./dist/write-file.d.ts",
|
|
84
|
+
"default": "./dist/write-file.cjs"
|
|
91
85
|
},
|
|
92
86
|
"default": {
|
|
93
|
-
"types": "./dist/
|
|
94
|
-
"default": "./dist/
|
|
87
|
+
"types": "./dist/write-file.d.ts",
|
|
88
|
+
"default": "./dist/write-file.mjs"
|
|
95
89
|
}
|
|
96
90
|
},
|
|
97
|
-
"./
|
|
91
|
+
"./semver-fns": {
|
|
98
92
|
"import": {
|
|
99
|
-
"types": "./dist/
|
|
100
|
-
"default": "./dist/
|
|
93
|
+
"types": "./dist/semver-fns.d.ts",
|
|
94
|
+
"default": "./dist/semver-fns.mjs"
|
|
101
95
|
},
|
|
102
96
|
"require": {
|
|
103
|
-
"types": "./dist/
|
|
104
|
-
"default": "./dist/
|
|
97
|
+
"types": "./dist/semver-fns.d.ts",
|
|
98
|
+
"default": "./dist/semver-fns.cjs"
|
|
105
99
|
},
|
|
106
100
|
"default": {
|
|
107
|
-
"types": "./dist/
|
|
108
|
-
"default": "./dist/
|
|
101
|
+
"types": "./dist/semver-fns.d.ts",
|
|
102
|
+
"default": "./dist/semver-fns.mjs"
|
|
109
103
|
}
|
|
110
104
|
},
|
|
111
|
-
"./
|
|
105
|
+
"./remove-file": {
|
|
112
106
|
"import": {
|
|
113
|
-
"types": "./dist/
|
|
114
|
-
"default": "./dist/
|
|
107
|
+
"types": "./dist/remove-file.d.ts",
|
|
108
|
+
"default": "./dist/remove-file.mjs"
|
|
115
109
|
},
|
|
116
110
|
"require": {
|
|
117
|
-
"types": "./dist/
|
|
118
|
-
"default": "./dist/
|
|
111
|
+
"types": "./dist/remove-file.d.ts",
|
|
112
|
+
"default": "./dist/remove-file.cjs"
|
|
119
113
|
},
|
|
120
114
|
"default": {
|
|
121
|
-
"types": "./dist/
|
|
122
|
-
"default": "./dist/
|
|
115
|
+
"types": "./dist/remove-file.d.ts",
|
|
116
|
+
"default": "./dist/remove-file.mjs"
|
|
123
117
|
}
|
|
124
118
|
},
|
|
125
|
-
"./
|
|
119
|
+
"./read-file": {
|
|
126
120
|
"import": {
|
|
127
|
-
"types": "./dist/
|
|
128
|
-
"default": "./dist/
|
|
121
|
+
"types": "./dist/read-file.d.ts",
|
|
122
|
+
"default": "./dist/read-file.mjs"
|
|
129
123
|
},
|
|
130
124
|
"require": {
|
|
131
|
-
"types": "./dist/
|
|
132
|
-
"default": "./dist/
|
|
125
|
+
"types": "./dist/read-file.d.ts",
|
|
126
|
+
"default": "./dist/read-file.cjs"
|
|
133
127
|
},
|
|
134
128
|
"default": {
|
|
135
|
-
"types": "./dist/
|
|
136
|
-
"default": "./dist/
|
|
129
|
+
"types": "./dist/read-file.d.ts",
|
|
130
|
+
"default": "./dist/read-file.mjs"
|
|
137
131
|
}
|
|
138
132
|
},
|
|
139
|
-
"./package
|
|
133
|
+
"./package-fns": {
|
|
140
134
|
"import": {
|
|
141
|
-
"types": "./dist/package
|
|
142
|
-
"default": "./dist/package
|
|
135
|
+
"types": "./dist/package-fns.d.ts",
|
|
136
|
+
"default": "./dist/package-fns.mjs"
|
|
143
137
|
},
|
|
144
138
|
"require": {
|
|
145
|
-
"types": "./dist/package
|
|
146
|
-
"default": "./dist/package
|
|
139
|
+
"types": "./dist/package-fns.d.ts",
|
|
140
|
+
"default": "./dist/package-fns.cjs"
|
|
147
141
|
},
|
|
148
142
|
"default": {
|
|
149
|
-
"types": "./dist/package
|
|
150
|
-
"default": "./dist/package
|
|
143
|
+
"types": "./dist/package-fns.d.ts",
|
|
144
|
+
"default": "./dist/package-fns.mjs"
|
|
151
145
|
}
|
|
152
146
|
},
|
|
153
|
-
"./files
|
|
147
|
+
"./list-files": {
|
|
154
148
|
"import": {
|
|
155
|
-
"types": "./dist/files
|
|
156
|
-
"default": "./dist/files
|
|
149
|
+
"types": "./dist/list-files.d.ts",
|
|
150
|
+
"default": "./dist/list-files.mjs"
|
|
157
151
|
},
|
|
158
152
|
"require": {
|
|
159
|
-
"types": "./dist/files
|
|
160
|
-
"default": "./dist/files
|
|
153
|
+
"types": "./dist/list-files.d.ts",
|
|
154
|
+
"default": "./dist/list-files.cjs"
|
|
161
155
|
},
|
|
162
156
|
"default": {
|
|
163
|
-
"types": "./dist/files
|
|
164
|
-
"default": "./dist/files
|
|
157
|
+
"types": "./dist/list-files.d.ts",
|
|
158
|
+
"default": "./dist/list-files.mjs"
|
|
165
159
|
}
|
|
166
160
|
},
|
|
167
|
-
"./
|
|
161
|
+
"./install": {
|
|
168
162
|
"import": {
|
|
169
|
-
"types": "./dist/
|
|
170
|
-
"default": "./dist/
|
|
163
|
+
"types": "./dist/install.d.ts",
|
|
164
|
+
"default": "./dist/install.mjs"
|
|
171
165
|
},
|
|
172
166
|
"require": {
|
|
173
|
-
"types": "./dist/
|
|
174
|
-
"default": "./dist/
|
|
167
|
+
"types": "./dist/install.d.ts",
|
|
168
|
+
"default": "./dist/install.cjs"
|
|
175
169
|
},
|
|
176
170
|
"default": {
|
|
177
|
-
"types": "./dist/
|
|
178
|
-
"default": "./dist/
|
|
171
|
+
"types": "./dist/install.d.ts",
|
|
172
|
+
"default": "./dist/install.mjs"
|
|
179
173
|
}
|
|
180
174
|
},
|
|
181
|
-
"./
|
|
182
|
-
"import": {
|
|
183
|
-
"types": "./dist/files/read-file.d.ts",
|
|
184
|
-
"default": "./dist/files/read-file.mjs"
|
|
185
|
-
},
|
|
186
|
-
"require": {
|
|
187
|
-
"types": "./dist/files/read-file.d.ts",
|
|
188
|
-
"default": "./dist/files/read-file.cjs"
|
|
189
|
-
},
|
|
190
|
-
"default": {
|
|
191
|
-
"types": "./dist/files/read-file.d.ts",
|
|
192
|
-
"default": "./dist/files/read-file.mjs"
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
"./files/list-files": {
|
|
196
|
-
"import": {
|
|
197
|
-
"types": "./dist/files/list-files.d.ts",
|
|
198
|
-
"default": "./dist/files/list-files.mjs"
|
|
199
|
-
},
|
|
175
|
+
"./index": {
|
|
176
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
200
177
|
"require": {
|
|
201
|
-
"types": "./dist/
|
|
202
|
-
"default": "./dist/
|
|
178
|
+
"types": "./dist/index.d.ts",
|
|
179
|
+
"default": "./dist/index.cjs"
|
|
203
180
|
},
|
|
204
|
-
"default": {
|
|
205
|
-
"types": "./dist/files/list-files.d.ts",
|
|
206
|
-
"default": "./dist/files/list-files.mjs"
|
|
207
|
-
}
|
|
181
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
208
182
|
},
|
|
209
|
-
"./
|
|
183
|
+
"./helpers": {
|
|
210
184
|
"import": {
|
|
211
|
-
"types": "./dist/
|
|
212
|
-
"default": "./dist/
|
|
185
|
+
"types": "./dist/helpers.d.ts",
|
|
186
|
+
"default": "./dist/helpers.mjs"
|
|
213
187
|
},
|
|
214
188
|
"require": {
|
|
215
|
-
"types": "./dist/
|
|
216
|
-
"default": "./dist/
|
|
189
|
+
"types": "./dist/helpers.d.ts",
|
|
190
|
+
"default": "./dist/helpers.cjs"
|
|
217
191
|
},
|
|
218
192
|
"default": {
|
|
219
|
-
"types": "./dist/
|
|
220
|
-
"default": "./dist/
|
|
193
|
+
"types": "./dist/helpers.d.ts",
|
|
194
|
+
"default": "./dist/helpers.mjs"
|
|
221
195
|
}
|
|
222
196
|
},
|
|
223
|
-
"./
|
|
197
|
+
"./get-tsconfig": {
|
|
224
198
|
"import": {
|
|
225
|
-
"types": "./dist/
|
|
226
|
-
"default": "./dist/
|
|
199
|
+
"types": "./dist/get-tsconfig.d.ts",
|
|
200
|
+
"default": "./dist/get-tsconfig.mjs"
|
|
227
201
|
},
|
|
228
202
|
"require": {
|
|
229
|
-
"types": "./dist/
|
|
230
|
-
"default": "./dist/
|
|
203
|
+
"types": "./dist/get-tsconfig.d.ts",
|
|
204
|
+
"default": "./dist/get-tsconfig.cjs"
|
|
231
205
|
},
|
|
232
206
|
"default": {
|
|
233
|
-
"types": "./dist/
|
|
234
|
-
"default": "./dist/
|
|
207
|
+
"types": "./dist/get-tsconfig.d.ts",
|
|
208
|
+
"default": "./dist/get-tsconfig.mjs"
|
|
235
209
|
}
|
|
236
210
|
},
|
|
237
|
-
"./
|
|
211
|
+
"./copy-file": {
|
|
238
212
|
"import": {
|
|
239
|
-
"types": "./dist/
|
|
240
|
-
"default": "./dist/
|
|
213
|
+
"types": "./dist/copy-file.d.ts",
|
|
214
|
+
"default": "./dist/copy-file.mjs"
|
|
241
215
|
},
|
|
242
216
|
"require": {
|
|
243
|
-
"types": "./dist/
|
|
244
|
-
"default": "./dist/
|
|
217
|
+
"types": "./dist/copy-file.d.ts",
|
|
218
|
+
"default": "./dist/copy-file.cjs"
|
|
245
219
|
},
|
|
246
220
|
"default": {
|
|
247
|
-
"types": "./dist/
|
|
248
|
-
"default": "./dist/
|
|
221
|
+
"types": "./dist/copy-file.d.ts",
|
|
222
|
+
"default": "./dist/copy-file.mjs"
|
|
249
223
|
}
|
|
250
224
|
},
|
|
251
|
-
"./
|
|
225
|
+
"./constants": {
|
|
252
226
|
"import": {
|
|
253
|
-
"types": "./dist/
|
|
254
|
-
"default": "./dist/
|
|
227
|
+
"types": "./dist/constants.d.ts",
|
|
228
|
+
"default": "./dist/constants.mjs"
|
|
255
229
|
},
|
|
256
230
|
"require": {
|
|
257
|
-
"types": "./dist/
|
|
258
|
-
"default": "./dist/
|
|
231
|
+
"types": "./dist/constants.d.ts",
|
|
232
|
+
"default": "./dist/constants.cjs"
|
|
259
233
|
},
|
|
260
234
|
"default": {
|
|
261
|
-
"types": "./dist/
|
|
262
|
-
"default": "./dist/
|
|
235
|
+
"types": "./dist/constants.d.ts",
|
|
236
|
+
"default": "./dist/constants.mjs"
|
|
263
237
|
}
|
|
264
238
|
},
|
|
265
|
-
"./
|
|
239
|
+
"./chmod-x": {
|
|
266
240
|
"import": {
|
|
267
|
-
"types": "./dist/
|
|
268
|
-
"default": "./dist/
|
|
241
|
+
"types": "./dist/chmod-x.d.ts",
|
|
242
|
+
"default": "./dist/chmod-x.mjs"
|
|
269
243
|
},
|
|
270
244
|
"require": {
|
|
271
|
-
"types": "./dist/
|
|
272
|
-
"default": "./dist/
|
|
245
|
+
"types": "./dist/chmod-x.d.ts",
|
|
246
|
+
"default": "./dist/chmod-x.cjs"
|
|
273
247
|
},
|
|
274
248
|
"default": {
|
|
275
|
-
"types": "./dist/
|
|
276
|
-
"default": "./dist/
|
|
249
|
+
"types": "./dist/chmod-x.d.ts",
|
|
250
|
+
"default": "./dist/chmod-x.mjs"
|
|
277
251
|
}
|
|
278
252
|
},
|
|
279
253
|
".": {
|
|
@@ -284,34 +258,6 @@
|
|
|
284
258
|
},
|
|
285
259
|
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
286
260
|
},
|
|
287
|
-
"./package": {
|
|
288
|
-
"import": {
|
|
289
|
-
"types": "./dist/package/index.d.ts",
|
|
290
|
-
"default": "./dist/package/index.mjs"
|
|
291
|
-
},
|
|
292
|
-
"require": {
|
|
293
|
-
"types": "./dist/package/index.d.ts",
|
|
294
|
-
"default": "./dist/package/index.cjs"
|
|
295
|
-
},
|
|
296
|
-
"default": {
|
|
297
|
-
"types": "./dist/package/index.d.ts",
|
|
298
|
-
"default": "./dist/package/index.mjs"
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
"./files": {
|
|
302
|
-
"import": {
|
|
303
|
-
"types": "./dist/files/index.d.ts",
|
|
304
|
-
"default": "./dist/files/index.mjs"
|
|
305
|
-
},
|
|
306
|
-
"require": {
|
|
307
|
-
"types": "./dist/files/index.d.ts",
|
|
308
|
-
"default": "./dist/files/index.cjs"
|
|
309
|
-
},
|
|
310
|
-
"default": {
|
|
311
|
-
"types": "./dist/files/index.d.ts",
|
|
312
|
-
"default": "./dist/files/index.mjs"
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
261
|
"./package.json": "./package.json"
|
|
316
262
|
},
|
|
317
263
|
"main": "./dist/index.cjs",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.copyFiles = exports.copyFile = void 0;
|
|
7
|
-
var _nodeFs = require("node:fs");
|
|
8
|
-
const copyFiles = (n, o, t) => {
|
|
9
|
-
(0, _nodeFs.cpSync)(n, o, t);
|
|
10
|
-
},
|
|
11
|
-
copyFile = (n, o) => {
|
|
12
|
-
(0, _nodeFs.copyFileSync)(n, o, _nodeFs.constants.COPYFILE_FICLONE);
|
|
13
|
-
};
|
|
14
|
-
exports.copyFile = copyFile;
|
|
15
|
-
exports.copyFiles = copyFiles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{constants as p,copyFileSync as c,cpSync as s}from"node:fs";export const copyFiles=(n,o,t)=>{s(n,o,t)},copyFile=(n,o)=>{c(n,o,p.COPYFILE_FICLONE)};
|
package/dist/files/helpers.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{exists as c,existsSync as s}from"@stryke/path/utilities/exists";import{parseTar as y,parseTarGzip as g}from"nanotar";import{createWriteStream as u,mkdirSync as p,rmSync as w}from"node:fs";import{mkdir as a,readFile as o,rm as x}from"node:fs/promises";export function createDirectorySync(r){if(!s(r))return p(r,{recursive:!0})}export async function createDirectory(r){if(!await c(r))return a(r,{recursive:!0})}export function removeDirectorySync(r){if(s(r))return w(r,{recursive:!0})}export async function removeDirectory(r){if(s(r))return x(r,{recursive:!0})}export async function extractFileFromTar(r,i,t){const e=y(await o(r)).find(n=>n.name===i);if(!e?.data)return;await c(t)||await a(t,{recursive:!0}),u(t).write(e.data)}export async function extractFileFromTarGzip(r,i,t){const e=(await g(await o(r))).find(n=>n.name===i);if(!e?.data)return;await c(t)||await a(t,{recursive:!0}),u(t).write(e.data)}
|
package/dist/files/index.cjs
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _chmodX = require("./chmod-x.cjs");
|
|
7
|
-
Object.keys(_chmodX).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _chmodX[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _chmodX[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _constants = require("./constants.cjs");
|
|
18
|
-
Object.keys(_constants).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _constants[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _constants[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _copyFiles = require("./copy-files.cjs");
|
|
29
|
-
Object.keys(_copyFiles).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _copyFiles[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _copyFiles[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _helpers = require("./helpers.cjs");
|
|
40
|
-
Object.keys(_helpers).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _helpers[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _helpers[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _listFiles = require("./list-files.cjs");
|
|
51
|
-
Object.keys(_listFiles).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _listFiles[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _listFiles[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _readFile = require("./read-file.cjs");
|
|
62
|
-
Object.keys(_readFile).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _readFile[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _readFile[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
var _removeFile = require("./remove-file.cjs");
|
|
73
|
-
Object.keys(_removeFile).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _removeFile[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _removeFile[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var _writeFile = require("./write-file.cjs");
|
|
84
|
-
Object.keys(_writeFile).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _writeFile[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _writeFile[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
package/dist/files/index.d.ts
DELETED
package/dist/files/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./chmod-x";export*from"./constants";export*from"./copy-files";export*from"./helpers";export*from"./list-files";export*from"./read-file";export*from"./remove-file";export*from"./write-file";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isDirectory as m}from"@stryke/path/utilities/is-file";import{joinPaths as l}from"@stryke/path/utilities/join-paths";import{readdir as p}from"node:fs/promises";import o from"picomatch";export async function listFiles(e,a={}){const{ignored:t=[]}=a,r=[],n=async s=>{if(!o(s,t)){const c=await p(s);await Promise.all(c.map(async f=>{const i=l(s,f);o(i,t)||(m(i)?await n(i):r.push(i))}))}};return await n(e),r}
|
package/dist/files/read-file.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{StormJSON as o}from"@stryke/json/storm-json";import{isError as i}from"@stryke/types/type-checks/is-error";import{existsSync as s,readFileSync as a}from"node:fs";import{readFile as c}from"node:fs/promises";export const readFileSync=e=>{try{if(!e)throw new Error("No file path provided to read data");return a(e,{encoding:"utf8"})}catch{throw new Error("An error occurred writing data to file")}},readFile=async e=>{try{if(!e)throw new Error("No file path provided to read data");return await c(e,{encoding:"utf8"})}catch{throw new Error("An error occurred writing data to file")}};export function readJsonFileSync(e,n){const t=readFileSync(e);n&&(n.endsWithNewline=t.codePointAt(t.length-1)===10);try{return o.parseJson(t,n)}catch(r){throw i(r)?(r.message=r.message.replace("JSON",e),r):new Error(`Failed to parse JSON: ${e}`)}}export async function readJsonFile(e,n){const t=await readFile(e);n&&(n.endsWithNewline=t.codePointAt(t.length-1)===10);try{return o.parseJson(t,n)}catch(r){throw i(r)?(r.message=r.message.replace("JSON",e),r):new Error(`Failed to parse JSON: ${e}`)}}export function readYamlFileSync(e,n){const t=readFileSync(e),{load:r}=require("@zkochan/js-yaml");return r(t,{...n,filename:e})}export async function readYamlFile(e,n){const t=await readFile(e),{load:r}=require("@zkochan/js-yaml");return r(t,{...n,filename:e})}export function readFileIfExistingSync(e){return s(e)?readFileSync(e):""}export async function readFileIfExisting(e){return s(e)?readFile(e):""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{StormJSON as i}from"@stryke/json/storm-json";import{existsSync as n}from"@stryke/path/utilities/exists";import{findFilePath as s}from"@stryke/path/utilities/file-path-fns";import{normalizePath as p}from"@stryke/path/utilities/normalize-path";import{writeFileSync as c}from"node:fs";import{writeFile as d}from"node:fs/promises";import{createDirectory as a,createDirectorySync as f}from"./helpers";export const writeFileSync=(r,o,t)=>{if(!r)throw new Error("No file path provided to write data");const e=s(p(r));if(!n(e))if(t?.createDirectory!==!1)f(e);else throw new Error(`Directory ${e} does not exist`);c(r,o||"",t)},writeFile=async(r,o,t)=>{if(!r)throw new Error("No file path provided to read data");const e=s(p(r));if(!n(e))if(t?.createDirectory!==!1)await a(e);else throw new Error(`Directory ${e} does not exist`);return d(r,o||"",t)};export function writeJsonFileSync(r,o,t){const e=i.stringify(o,t);return writeFileSync(r,t?.appendNewLine?`${e}
|
|
2
|
-
`:e)}export async function writeJsonFile(r,o,t){const e=i.stringify(o);return writeFile(r,t?.appendNewLine?`${e}
|
|
3
|
-
`:e)}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.loadTsConfigFile = exports.loadTsConfig = void 0;
|
|
7
|
-
var _filePathFns = require("@stryke/path/utilities/file-path-fns");
|
|
8
|
-
var _base = require("@stryke/types/utility-types/base");
|
|
9
|
-
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
10
|
-
var _nodeModule = require("node:module");
|
|
11
|
-
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const h = Symbol("singleComment"),
|
|
14
|
-
y = Symbol("multiComment"),
|
|
15
|
-
T = () => "",
|
|
16
|
-
W = (e, i, c) => e.slice(i, c).replace(/\S/g, " "),
|
|
17
|
-
E = (e, i) => {
|
|
18
|
-
let c = i - 1,
|
|
19
|
-
l = 0;
|
|
20
|
-
for (; e[c] === "\\";) c -= 1, l += 1;
|
|
21
|
-
return !!(l % 2);
|
|
22
|
-
},
|
|
23
|
-
w = (e, {
|
|
24
|
-
whitespace: i = !0,
|
|
25
|
-
trailingCommas: c = !1
|
|
26
|
-
} = {}) => {
|
|
27
|
-
if (typeof e != "string") throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof e}\``);
|
|
28
|
-
const l = i ? W : T;
|
|
29
|
-
let f = !1,
|
|
30
|
-
o = !1,
|
|
31
|
-
n = 0,
|
|
32
|
-
s = "",
|
|
33
|
-
m = "",
|
|
34
|
-
p = -1;
|
|
35
|
-
for (let t = 0; t < e.length; t++) {
|
|
36
|
-
const r = e[t],
|
|
37
|
-
d = e[t + 1];
|
|
38
|
-
!o && r === '"' && (E(e, t) || (f = !f)), !f && (!o && r + (d ?? _base.EMPTY_STRING) === "//" ? (s += e.slice(n, t), n = t, o = h, t++) : o === h && r + (d ?? _base.EMPTY_STRING) === `\r
|
|
39
|
-
` ? (t++, o = !1, s += l(e, n, t), n = t) : o === h && r === `
|
|
40
|
-
` ? (o = !1, s += l(e, n, t), n = t) : !o && r + (d ?? _base.EMPTY_STRING) === "/*" ? (s += e.slice(n, t), n = t, o = y, t++) : o === y && r + (d ?? _base.EMPTY_STRING) === "*/" ? (t++, o = !1, s += l(e, n, t + 1), n = t + 1) : c && !o && (p !== -1 ? r === "}" || r === "]" ? (s += e.slice(n, t), m += l(s, 0, 1) + s.slice(1), s = "", n = t, p = -1) : r !== " " && r !== " " && r !== "\r" && r !== `
|
|
41
|
-
` && (s += e.slice(n, t), n = t, p = -1) : r === "," && (m += s + e.slice(n, t), s = "", n = t, p = t)));
|
|
42
|
-
}
|
|
43
|
-
return m + s + (o ? l(e.slice(n)) : e.slice(n));
|
|
44
|
-
},
|
|
45
|
-
I = e => {
|
|
46
|
-
try {
|
|
47
|
-
return new Function(`return ${w(e).trim()}`)();
|
|
48
|
-
} catch {
|
|
49
|
-
return {};
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
A = (0, _nodeModule.createRequire)(require('url').pathToFileURL(__filename).toString()),
|
|
53
|
-
g = (e, i, c = _nodePath.default.parse(i).root) => {
|
|
54
|
-
let l = i;
|
|
55
|
-
for (; l !== c;) {
|
|
56
|
-
const f = _nodePath.default.join(l, e);
|
|
57
|
-
if (_nodeFs.default.existsSync(f)) return f;
|
|
58
|
-
if (!f.endsWith(".json")) {
|
|
59
|
-
const o = `${f}.json`;
|
|
60
|
-
if (_nodeFs.default.existsSync(o)) return o;
|
|
61
|
-
}
|
|
62
|
-
l = _nodePath.default.dirname(l);
|
|
63
|
-
}
|
|
64
|
-
return null;
|
|
65
|
-
},
|
|
66
|
-
U = (e, i) => _nodePath.default.isAbsolute(i) ? _nodeFs.default.existsSync(i) ? i : null : g(i, e),
|
|
67
|
-
P = (e, i) => _nodePath.default.isAbsolute(i) ? _nodeFs.default.existsSync(i) ? i : null : i.startsWith(".") ? g(i, e) : A.resolve(i, {
|
|
68
|
-
paths: [e]
|
|
69
|
-
}),
|
|
70
|
-
C = (e = process.cwd(), i = "tsconfig.json", c = !1) => {
|
|
71
|
-
let l, f;
|
|
72
|
-
const o = _nodePath.default.resolve(e),
|
|
73
|
-
n = c ? P(o, i) : U(o, i);
|
|
74
|
-
if (!n) return null;
|
|
75
|
-
const s = I(_nodeFs.default.readFileSync(n, "utf8")),
|
|
76
|
-
m = _nodePath.default.dirname(n);
|
|
77
|
-
(l = s.compilerOptions) !== null && l.baseUrl && (s.compilerOptions.baseUrl = _nodePath.default.join(m, s.compilerOptions.baseUrl));
|
|
78
|
-
const p = [];
|
|
79
|
-
if (s.extends) {
|
|
80
|
-
const t = Array.isArray(s.extends) ? s.extends : [s.extends],
|
|
81
|
-
r = {};
|
|
82
|
-
for (const d of t) {
|
|
83
|
-
const u = C(m, d, !0);
|
|
84
|
-
u && (Object.assign(r, {
|
|
85
|
-
...(u === null ? void 0 : u.data),
|
|
86
|
-
compilerOptions: {
|
|
87
|
-
...r.compilerOptions,
|
|
88
|
-
...((f = u === null ? void 0 : u.data) === null ? void 0 : f.compilerOptions)
|
|
89
|
-
}
|
|
90
|
-
}), p.push(...u.files));
|
|
91
|
-
}
|
|
92
|
-
Object.assign(s, {
|
|
93
|
-
...r,
|
|
94
|
-
...s,
|
|
95
|
-
compilerOptions: {
|
|
96
|
-
...r.compilerOptions,
|
|
97
|
-
...s.compilerOptions
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return s.extends = void 0, {
|
|
102
|
-
path: n,
|
|
103
|
-
data: s,
|
|
104
|
-
files: [...p, n]
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
const loadTsConfig = (e, i = "tsconfig.json") => C(e, i),
|
|
108
|
-
loadTsConfigFile = e => loadTsConfig((0, _filePathFns.findFilePath)(e), (0, _filePathFns.findFileName)(e));
|
|
109
|
-
exports.loadTsConfigFile = loadTsConfigFile;
|
|
110
|
-
exports.loadTsConfig = loadTsConfig;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{findFileName as O,findFilePath as F}from"@stryke/path/utilities/file-path-fns";import{EMPTY_STRING as b}from"@stryke/types/utility-types/base";import x from"node:fs";import{createRequire as v}from"node:module";import a from"node:path";const h=Symbol("singleComment"),y=Symbol("multiComment"),T=()=>"",W=(e,i,c)=>e.slice(i,c).replace(/\S/g," "),E=(e,i)=>{let c=i-1,l=0;for(;e[c]==="\\";)c-=1,l+=1;return!!(l%2)},w=(e,{whitespace:i=!0,trailingCommas:c=!1}={})=>{if(typeof e!="string")throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof e}\``);const l=i?W:T;let f=!1,o=!1,n=0,s="",m="",p=-1;for(let t=0;t<e.length;t++){const r=e[t],d=e[t+1];!o&&r==='"'&&(E(e,t)||(f=!f)),!f&&(!o&&r+(d??b)==="//"?(s+=e.slice(n,t),n=t,o=h,t++):o===h&&r+(d??b)===`\r
|
|
2
|
-
`?(t++,o=!1,s+=l(e,n,t),n=t):o===h&&r===`
|
|
3
|
-
`?(o=!1,s+=l(e,n,t),n=t):!o&&r+(d??b)==="/*"?(s+=e.slice(n,t),n=t,o=y,t++):o===y&&r+(d??b)==="*/"?(t++,o=!1,s+=l(e,n,t+1),n=t+1):c&&!o&&(p!==-1?r==="}"||r==="]"?(s+=e.slice(n,t),m+=l(s,0,1)+s.slice(1),s="",n=t,p=-1):r!==" "&&r!==" "&&r!=="\r"&&r!==`
|
|
4
|
-
`&&(s+=e.slice(n,t),n=t,p=-1):r===","&&(m+=s+e.slice(n,t),s="",n=t,p=t)))}return m+s+(o?l(e.slice(n)):e.slice(n))},I=e=>{try{return new Function(`return ${w(e).trim()}`)()}catch{return{}}},A=v(import.meta.url),g=(e,i,c=a.parse(i).root)=>{let l=i;for(;l!==c;){const f=a.join(l,e);if(x.existsSync(f))return f;if(!f.endsWith(".json")){const o=`${f}.json`;if(x.existsSync(o))return o}l=a.dirname(l)}return null},U=(e,i)=>a.isAbsolute(i)?x.existsSync(i)?i:null:g(i,e),P=(e,i)=>a.isAbsolute(i)?x.existsSync(i)?i:null:i.startsWith(".")?g(i,e):A.resolve(i,{paths:[e]}),C=(e=process.cwd(),i="tsconfig.json",c=!1)=>{let l,f;const o=a.resolve(e),n=c?P(o,i):U(o,i);if(!n)return null;const s=I(x.readFileSync(n,"utf8")),m=a.dirname(n);(l=s.compilerOptions)!==null&&l.baseUrl&&(s.compilerOptions.baseUrl=a.join(m,s.compilerOptions.baseUrl));const p=[];if(s.extends){const t=Array.isArray(s.extends)?s.extends:[s.extends],r={};for(const d of t){const u=C(m,d,!0);u&&(Object.assign(r,{...u===null?void 0:u.data,compilerOptions:{...r.compilerOptions,...(f=u===null?void 0:u.data)===null?void 0:f.compilerOptions}}),p.push(...u.files))}Object.assign(s,{...r,...s,compilerOptions:{...r.compilerOptions,...s.compilerOptions}})}return s.extends=void 0,{path:n,data:s,files:[...p,n]}};export const loadTsConfig=(e,i="tsconfig.json")=>C(e,i),loadTsConfigFile=e=>loadTsConfig(F(e),O(e));
|