@stryke/fs 0.9.0 → 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 +96 -151
- 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": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"directory": "packages/fs"
|
|
10
10
|
},
|
|
11
11
|
"private": false,
|
|
12
|
-
"peerDependencies": { "nx": "^20.
|
|
12
|
+
"peerDependencies": { "nx": "^20.5.0" },
|
|
13
13
|
"peerDependenciesMeta": { "nx": { "optional": true } },
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@antfu/install-pkg": "^1.0.0",
|
|
@@ -18,14 +18,16 @@
|
|
|
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",
|
|
28
|
-
"
|
|
29
|
+
"@types/semver": "^7.5.8",
|
|
30
|
+
"nx": "^20.5.0",
|
|
29
31
|
"tinyexec": "^0.3.2"
|
|
30
32
|
},
|
|
31
33
|
"publishConfig": { "access": "public" },
|
|
@@ -41,7 +43,6 @@
|
|
|
41
43
|
"stryke",
|
|
42
44
|
"typescript",
|
|
43
45
|
"utilities",
|
|
44
|
-
"storm-stack",
|
|
45
46
|
"storm-software",
|
|
46
47
|
"storm",
|
|
47
48
|
"storm-ops",
|
|
@@ -73,208 +74,180 @@
|
|
|
73
74
|
}
|
|
74
75
|
],
|
|
75
76
|
"exports": {
|
|
76
|
-
"./
|
|
77
|
-
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
78
|
-
"require": {
|
|
79
|
-
"types": "./dist/index.d.ts",
|
|
80
|
-
"default": "./dist/index.cjs"
|
|
81
|
-
},
|
|
82
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
83
|
-
},
|
|
84
|
-
"./package/semver-fns": {
|
|
77
|
+
"./write-file": {
|
|
85
78
|
"import": {
|
|
86
|
-
"types": "./dist/
|
|
87
|
-
"default": "./dist/
|
|
79
|
+
"types": "./dist/write-file.d.ts",
|
|
80
|
+
"default": "./dist/write-file.mjs"
|
|
88
81
|
},
|
|
89
82
|
"require": {
|
|
90
|
-
"types": "./dist/
|
|
91
|
-
"default": "./dist/
|
|
83
|
+
"types": "./dist/write-file.d.ts",
|
|
84
|
+
"default": "./dist/write-file.cjs"
|
|
92
85
|
},
|
|
93
86
|
"default": {
|
|
94
|
-
"types": "./dist/
|
|
95
|
-
"default": "./dist/
|
|
87
|
+
"types": "./dist/write-file.d.ts",
|
|
88
|
+
"default": "./dist/write-file.mjs"
|
|
96
89
|
}
|
|
97
90
|
},
|
|
98
|
-
"./
|
|
91
|
+
"./semver-fns": {
|
|
99
92
|
"import": {
|
|
100
|
-
"types": "./dist/
|
|
101
|
-
"default": "./dist/
|
|
93
|
+
"types": "./dist/semver-fns.d.ts",
|
|
94
|
+
"default": "./dist/semver-fns.mjs"
|
|
102
95
|
},
|
|
103
96
|
"require": {
|
|
104
|
-
"types": "./dist/
|
|
105
|
-
"default": "./dist/
|
|
97
|
+
"types": "./dist/semver-fns.d.ts",
|
|
98
|
+
"default": "./dist/semver-fns.cjs"
|
|
106
99
|
},
|
|
107
100
|
"default": {
|
|
108
|
-
"types": "./dist/
|
|
109
|
-
"default": "./dist/
|
|
101
|
+
"types": "./dist/semver-fns.d.ts",
|
|
102
|
+
"default": "./dist/semver-fns.mjs"
|
|
110
103
|
}
|
|
111
104
|
},
|
|
112
|
-
"./
|
|
105
|
+
"./remove-file": {
|
|
113
106
|
"import": {
|
|
114
|
-
"types": "./dist/
|
|
115
|
-
"default": "./dist/
|
|
107
|
+
"types": "./dist/remove-file.d.ts",
|
|
108
|
+
"default": "./dist/remove-file.mjs"
|
|
116
109
|
},
|
|
117
110
|
"require": {
|
|
118
|
-
"types": "./dist/
|
|
119
|
-
"default": "./dist/
|
|
111
|
+
"types": "./dist/remove-file.d.ts",
|
|
112
|
+
"default": "./dist/remove-file.cjs"
|
|
120
113
|
},
|
|
121
114
|
"default": {
|
|
122
|
-
"types": "./dist/
|
|
123
|
-
"default": "./dist/
|
|
115
|
+
"types": "./dist/remove-file.d.ts",
|
|
116
|
+
"default": "./dist/remove-file.mjs"
|
|
124
117
|
}
|
|
125
118
|
},
|
|
126
|
-
"./
|
|
119
|
+
"./read-file": {
|
|
127
120
|
"import": {
|
|
128
|
-
"types": "./dist/
|
|
129
|
-
"default": "./dist/
|
|
121
|
+
"types": "./dist/read-file.d.ts",
|
|
122
|
+
"default": "./dist/read-file.mjs"
|
|
130
123
|
},
|
|
131
124
|
"require": {
|
|
132
|
-
"types": "./dist/
|
|
133
|
-
"default": "./dist/
|
|
125
|
+
"types": "./dist/read-file.d.ts",
|
|
126
|
+
"default": "./dist/read-file.cjs"
|
|
134
127
|
},
|
|
135
128
|
"default": {
|
|
136
|
-
"types": "./dist/
|
|
137
|
-
"default": "./dist/
|
|
129
|
+
"types": "./dist/read-file.d.ts",
|
|
130
|
+
"default": "./dist/read-file.mjs"
|
|
138
131
|
}
|
|
139
132
|
},
|
|
140
|
-
"./package
|
|
133
|
+
"./package-fns": {
|
|
141
134
|
"import": {
|
|
142
|
-
"types": "./dist/package
|
|
143
|
-
"default": "./dist/package
|
|
135
|
+
"types": "./dist/package-fns.d.ts",
|
|
136
|
+
"default": "./dist/package-fns.mjs"
|
|
144
137
|
},
|
|
145
138
|
"require": {
|
|
146
|
-
"types": "./dist/package
|
|
147
|
-
"default": "./dist/package
|
|
139
|
+
"types": "./dist/package-fns.d.ts",
|
|
140
|
+
"default": "./dist/package-fns.cjs"
|
|
148
141
|
},
|
|
149
142
|
"default": {
|
|
150
|
-
"types": "./dist/package
|
|
151
|
-
"default": "./dist/package
|
|
143
|
+
"types": "./dist/package-fns.d.ts",
|
|
144
|
+
"default": "./dist/package-fns.mjs"
|
|
152
145
|
}
|
|
153
146
|
},
|
|
154
|
-
"./files
|
|
147
|
+
"./list-files": {
|
|
155
148
|
"import": {
|
|
156
|
-
"types": "./dist/files
|
|
157
|
-
"default": "./dist/files
|
|
149
|
+
"types": "./dist/list-files.d.ts",
|
|
150
|
+
"default": "./dist/list-files.mjs"
|
|
158
151
|
},
|
|
159
152
|
"require": {
|
|
160
|
-
"types": "./dist/files
|
|
161
|
-
"default": "./dist/files
|
|
153
|
+
"types": "./dist/list-files.d.ts",
|
|
154
|
+
"default": "./dist/list-files.cjs"
|
|
162
155
|
},
|
|
163
156
|
"default": {
|
|
164
|
-
"types": "./dist/files
|
|
165
|
-
"default": "./dist/files
|
|
157
|
+
"types": "./dist/list-files.d.ts",
|
|
158
|
+
"default": "./dist/list-files.mjs"
|
|
166
159
|
}
|
|
167
160
|
},
|
|
168
|
-
"./
|
|
161
|
+
"./install": {
|
|
169
162
|
"import": {
|
|
170
|
-
"types": "./dist/
|
|
171
|
-
"default": "./dist/
|
|
163
|
+
"types": "./dist/install.d.ts",
|
|
164
|
+
"default": "./dist/install.mjs"
|
|
172
165
|
},
|
|
173
166
|
"require": {
|
|
174
|
-
"types": "./dist/
|
|
175
|
-
"default": "./dist/
|
|
167
|
+
"types": "./dist/install.d.ts",
|
|
168
|
+
"default": "./dist/install.cjs"
|
|
176
169
|
},
|
|
177
170
|
"default": {
|
|
178
|
-
"types": "./dist/
|
|
179
|
-
"default": "./dist/
|
|
171
|
+
"types": "./dist/install.d.ts",
|
|
172
|
+
"default": "./dist/install.mjs"
|
|
180
173
|
}
|
|
181
174
|
},
|
|
182
|
-
"./
|
|
183
|
-
"import": {
|
|
184
|
-
"types": "./dist/files/read-file.d.ts",
|
|
185
|
-
"default": "./dist/files/read-file.mjs"
|
|
186
|
-
},
|
|
187
|
-
"require": {
|
|
188
|
-
"types": "./dist/files/read-file.d.ts",
|
|
189
|
-
"default": "./dist/files/read-file.cjs"
|
|
190
|
-
},
|
|
191
|
-
"default": {
|
|
192
|
-
"types": "./dist/files/read-file.d.ts",
|
|
193
|
-
"default": "./dist/files/read-file.mjs"
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"./files/list-files": {
|
|
197
|
-
"import": {
|
|
198
|
-
"types": "./dist/files/list-files.d.ts",
|
|
199
|
-
"default": "./dist/files/list-files.mjs"
|
|
200
|
-
},
|
|
175
|
+
"./index": {
|
|
176
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
201
177
|
"require": {
|
|
202
|
-
"types": "./dist/
|
|
203
|
-
"default": "./dist/
|
|
178
|
+
"types": "./dist/index.d.ts",
|
|
179
|
+
"default": "./dist/index.cjs"
|
|
204
180
|
},
|
|
205
|
-
"default": {
|
|
206
|
-
"types": "./dist/files/list-files.d.ts",
|
|
207
|
-
"default": "./dist/files/list-files.mjs"
|
|
208
|
-
}
|
|
181
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
209
182
|
},
|
|
210
|
-
"./
|
|
183
|
+
"./helpers": {
|
|
211
184
|
"import": {
|
|
212
|
-
"types": "./dist/
|
|
213
|
-
"default": "./dist/
|
|
185
|
+
"types": "./dist/helpers.d.ts",
|
|
186
|
+
"default": "./dist/helpers.mjs"
|
|
214
187
|
},
|
|
215
188
|
"require": {
|
|
216
|
-
"types": "./dist/
|
|
217
|
-
"default": "./dist/
|
|
189
|
+
"types": "./dist/helpers.d.ts",
|
|
190
|
+
"default": "./dist/helpers.cjs"
|
|
218
191
|
},
|
|
219
192
|
"default": {
|
|
220
|
-
"types": "./dist/
|
|
221
|
-
"default": "./dist/
|
|
193
|
+
"types": "./dist/helpers.d.ts",
|
|
194
|
+
"default": "./dist/helpers.mjs"
|
|
222
195
|
}
|
|
223
196
|
},
|
|
224
|
-
"./
|
|
197
|
+
"./get-tsconfig": {
|
|
225
198
|
"import": {
|
|
226
|
-
"types": "./dist/
|
|
227
|
-
"default": "./dist/
|
|
199
|
+
"types": "./dist/get-tsconfig.d.ts",
|
|
200
|
+
"default": "./dist/get-tsconfig.mjs"
|
|
228
201
|
},
|
|
229
202
|
"require": {
|
|
230
|
-
"types": "./dist/
|
|
231
|
-
"default": "./dist/
|
|
203
|
+
"types": "./dist/get-tsconfig.d.ts",
|
|
204
|
+
"default": "./dist/get-tsconfig.cjs"
|
|
232
205
|
},
|
|
233
206
|
"default": {
|
|
234
|
-
"types": "./dist/
|
|
235
|
-
"default": "./dist/
|
|
207
|
+
"types": "./dist/get-tsconfig.d.ts",
|
|
208
|
+
"default": "./dist/get-tsconfig.mjs"
|
|
236
209
|
}
|
|
237
210
|
},
|
|
238
|
-
"./
|
|
211
|
+
"./copy-file": {
|
|
239
212
|
"import": {
|
|
240
|
-
"types": "./dist/
|
|
241
|
-
"default": "./dist/
|
|
213
|
+
"types": "./dist/copy-file.d.ts",
|
|
214
|
+
"default": "./dist/copy-file.mjs"
|
|
242
215
|
},
|
|
243
216
|
"require": {
|
|
244
|
-
"types": "./dist/
|
|
245
|
-
"default": "./dist/
|
|
217
|
+
"types": "./dist/copy-file.d.ts",
|
|
218
|
+
"default": "./dist/copy-file.cjs"
|
|
246
219
|
},
|
|
247
220
|
"default": {
|
|
248
|
-
"types": "./dist/
|
|
249
|
-
"default": "./dist/
|
|
221
|
+
"types": "./dist/copy-file.d.ts",
|
|
222
|
+
"default": "./dist/copy-file.mjs"
|
|
250
223
|
}
|
|
251
224
|
},
|
|
252
|
-
"./
|
|
225
|
+
"./constants": {
|
|
253
226
|
"import": {
|
|
254
|
-
"types": "./dist/
|
|
255
|
-
"default": "./dist/
|
|
227
|
+
"types": "./dist/constants.d.ts",
|
|
228
|
+
"default": "./dist/constants.mjs"
|
|
256
229
|
},
|
|
257
230
|
"require": {
|
|
258
|
-
"types": "./dist/
|
|
259
|
-
"default": "./dist/
|
|
231
|
+
"types": "./dist/constants.d.ts",
|
|
232
|
+
"default": "./dist/constants.cjs"
|
|
260
233
|
},
|
|
261
234
|
"default": {
|
|
262
|
-
"types": "./dist/
|
|
263
|
-
"default": "./dist/
|
|
235
|
+
"types": "./dist/constants.d.ts",
|
|
236
|
+
"default": "./dist/constants.mjs"
|
|
264
237
|
}
|
|
265
238
|
},
|
|
266
|
-
"./
|
|
239
|
+
"./chmod-x": {
|
|
267
240
|
"import": {
|
|
268
|
-
"types": "./dist/
|
|
269
|
-
"default": "./dist/
|
|
241
|
+
"types": "./dist/chmod-x.d.ts",
|
|
242
|
+
"default": "./dist/chmod-x.mjs"
|
|
270
243
|
},
|
|
271
244
|
"require": {
|
|
272
|
-
"types": "./dist/
|
|
273
|
-
"default": "./dist/
|
|
245
|
+
"types": "./dist/chmod-x.d.ts",
|
|
246
|
+
"default": "./dist/chmod-x.cjs"
|
|
274
247
|
},
|
|
275
248
|
"default": {
|
|
276
|
-
"types": "./dist/
|
|
277
|
-
"default": "./dist/
|
|
249
|
+
"types": "./dist/chmod-x.d.ts",
|
|
250
|
+
"default": "./dist/chmod-x.mjs"
|
|
278
251
|
}
|
|
279
252
|
},
|
|
280
253
|
".": {
|
|
@@ -285,34 +258,6 @@
|
|
|
285
258
|
},
|
|
286
259
|
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
287
260
|
},
|
|
288
|
-
"./package": {
|
|
289
|
-
"import": {
|
|
290
|
-
"types": "./dist/package/index.d.ts",
|
|
291
|
-
"default": "./dist/package/index.mjs"
|
|
292
|
-
},
|
|
293
|
-
"require": {
|
|
294
|
-
"types": "./dist/package/index.d.ts",
|
|
295
|
-
"default": "./dist/package/index.cjs"
|
|
296
|
-
},
|
|
297
|
-
"default": {
|
|
298
|
-
"types": "./dist/package/index.d.ts",
|
|
299
|
-
"default": "./dist/package/index.mjs"
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
"./files": {
|
|
303
|
-
"import": {
|
|
304
|
-
"types": "./dist/files/index.d.ts",
|
|
305
|
-
"default": "./dist/files/index.mjs"
|
|
306
|
-
},
|
|
307
|
-
"require": {
|
|
308
|
-
"types": "./dist/files/index.d.ts",
|
|
309
|
-
"default": "./dist/files/index.cjs"
|
|
310
|
-
},
|
|
311
|
-
"default": {
|
|
312
|
-
"types": "./dist/files/index.d.ts",
|
|
313
|
-
"default": "./dist/files/index.mjs"
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
261
|
"./package.json": "./package.json"
|
|
317
262
|
},
|
|
318
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));
|