@stryke/path 0.3.1 → 0.3.4
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/file-path-fns.cjs +105 -0
- package/dist/{utilities/file-path-fns.d.ts → file-path-fns.d.ts} +1 -1
- package/dist/file-path-fns.mjs +1 -0
- package/dist/{workspace/get-workspace-root.cjs → get-workspace-root.cjs} +3 -3
- package/dist/get-workspace-root.mjs +1 -0
- package/dist/index.cjs +100 -12
- package/dist/index.d.ts +10 -2
- package/dist/index.mjs +1 -1
- package/dist/join-paths.cjs +17 -0
- package/dist/join-paths.d.ts +11 -0
- package/dist/join-paths.mjs +1 -0
- package/dist/{utilities/normalize-path.cjs → normalize-path.cjs} +23 -21
- package/dist/{utilities/normalize-path.d.ts → normalize-path.d.ts} +2 -17
- package/dist/normalize-path.mjs +1 -0
- package/dist/{resolve/resolve.cjs → resolve.cjs} +2 -2
- package/dist/{resolve/resolve.d.ts → resolve.d.ts} +7 -7
- package/package.json +83 -168
- package/dist/resolve/index.cjs +0 -16
- package/dist/resolve/index.d.ts +0 -1
- package/dist/resolve/index.mjs +0 -1
- package/dist/utilities/file-path-fns.cjs +0 -105
- package/dist/utilities/file-path-fns.mjs +0 -1
- package/dist/utilities/index.cjs +0 -93
- package/dist/utilities/index.d.ts +0 -8
- package/dist/utilities/index.mjs +0 -1
- package/dist/utilities/join-paths.cjs +0 -16
- package/dist/utilities/join-paths.d.ts +0 -7
- package/dist/utilities/join-paths.mjs +0 -1
- package/dist/utilities/normalize-path.mjs +0 -1
- package/dist/workspace/get-workspace-root.mjs +0 -1
- package/dist/workspace/index.cjs +0 -27
- package/dist/workspace/index.d.ts +0 -2
- package/dist/workspace/index.mjs +0 -1
- /package/dist/{workspace/asset-extensions.cjs → asset-extensions.cjs} +0 -0
- /package/dist/{workspace/asset-extensions.d.ts → asset-extensions.d.ts} +0 -0
- /package/dist/{workspace/asset-extensions.mjs → asset-extensions.mjs} +0 -0
- /package/dist/{utilities/delimiter.cjs → delimiter.cjs} +0 -0
- /package/dist/{utilities/delimiter.d.ts → delimiter.d.ts} +0 -0
- /package/dist/{utilities/delimiter.mjs → delimiter.mjs} +0 -0
- /package/dist/{utilities/exists.cjs → exists.cjs} +0 -0
- /package/dist/{utilities/exists.d.ts → exists.d.ts} +0 -0
- /package/dist/{utilities/exists.mjs → exists.mjs} +0 -0
- /package/dist/{utilities/get-parent-path.cjs → get-parent-path.cjs} +0 -0
- /package/dist/{utilities/get-parent-path.d.ts → get-parent-path.d.ts} +0 -0
- /package/dist/{utilities/get-parent-path.mjs → get-parent-path.mjs} +0 -0
- /package/dist/{workspace/get-workspace-root.d.ts → get-workspace-root.d.ts} +0 -0
- /package/dist/{utilities/is-file.cjs → is-file.cjs} +0 -0
- /package/dist/{utilities/is-file.d.ts → is-file.d.ts} +0 -0
- /package/dist/{utilities/is-file.mjs → is-file.mjs} +0 -0
- /package/dist/{utilities/is-root-dir.cjs → is-root-dir.cjs} +0 -0
- /package/dist/{utilities/is-root-dir.d.ts → is-root-dir.d.ts} +0 -0
- /package/dist/{utilities/is-root-dir.mjs → is-root-dir.mjs} +0 -0
- /package/dist/{resolve/resolve.mjs → resolve.mjs} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/path",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various utilities that expand the functionality of NodeJs's `path` module",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"stryke",
|
|
29
29
|
"typescript",
|
|
30
30
|
"utilities",
|
|
31
|
-
"storm-stack",
|
|
32
31
|
"storm-software",
|
|
33
32
|
"storm",
|
|
34
33
|
"storm-ops",
|
|
@@ -60,208 +59,166 @@
|
|
|
60
59
|
}
|
|
61
60
|
],
|
|
62
61
|
"exports": {
|
|
63
|
-
"./
|
|
64
|
-
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
65
|
-
"require": {
|
|
66
|
-
"types": "./dist/index.d.ts",
|
|
67
|
-
"default": "./dist/index.cjs"
|
|
68
|
-
},
|
|
69
|
-
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
70
|
-
},
|
|
71
|
-
"./workspace/index": {
|
|
72
|
-
"import": {
|
|
73
|
-
"types": "./dist/workspace/index.d.ts",
|
|
74
|
-
"default": "./dist/workspace/index.mjs"
|
|
75
|
-
},
|
|
76
|
-
"require": {
|
|
77
|
-
"types": "./dist/workspace/index.d.ts",
|
|
78
|
-
"default": "./dist/workspace/index.cjs"
|
|
79
|
-
},
|
|
80
|
-
"default": {
|
|
81
|
-
"types": "./dist/workspace/index.d.ts",
|
|
82
|
-
"default": "./dist/workspace/index.mjs"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"./workspace/get-workspace-root": {
|
|
86
|
-
"import": {
|
|
87
|
-
"types": "./dist/workspace/get-workspace-root.d.ts",
|
|
88
|
-
"default": "./dist/workspace/get-workspace-root.mjs"
|
|
89
|
-
},
|
|
90
|
-
"require": {
|
|
91
|
-
"types": "./dist/workspace/get-workspace-root.d.ts",
|
|
92
|
-
"default": "./dist/workspace/get-workspace-root.cjs"
|
|
93
|
-
},
|
|
94
|
-
"default": {
|
|
95
|
-
"types": "./dist/workspace/get-workspace-root.d.ts",
|
|
96
|
-
"default": "./dist/workspace/get-workspace-root.mjs"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"./workspace/asset-extensions": {
|
|
62
|
+
"./resolve": {
|
|
100
63
|
"import": {
|
|
101
|
-
"types": "./dist/
|
|
102
|
-
"default": "./dist/
|
|
64
|
+
"types": "./dist/resolve.d.ts",
|
|
65
|
+
"default": "./dist/resolve.mjs"
|
|
103
66
|
},
|
|
104
67
|
"require": {
|
|
105
|
-
"types": "./dist/
|
|
106
|
-
"default": "./dist/
|
|
68
|
+
"types": "./dist/resolve.d.ts",
|
|
69
|
+
"default": "./dist/resolve.cjs"
|
|
107
70
|
},
|
|
108
71
|
"default": {
|
|
109
|
-
"types": "./dist/
|
|
110
|
-
"default": "./dist/
|
|
72
|
+
"types": "./dist/resolve.d.ts",
|
|
73
|
+
"default": "./dist/resolve.mjs"
|
|
111
74
|
}
|
|
112
75
|
},
|
|
113
|
-
"./
|
|
76
|
+
"./normalize-path": {
|
|
114
77
|
"import": {
|
|
115
|
-
"types": "./dist/
|
|
116
|
-
"default": "./dist/
|
|
78
|
+
"types": "./dist/normalize-path.d.ts",
|
|
79
|
+
"default": "./dist/normalize-path.mjs"
|
|
117
80
|
},
|
|
118
81
|
"require": {
|
|
119
|
-
"types": "./dist/
|
|
120
|
-
"default": "./dist/
|
|
82
|
+
"types": "./dist/normalize-path.d.ts",
|
|
83
|
+
"default": "./dist/normalize-path.cjs"
|
|
121
84
|
},
|
|
122
85
|
"default": {
|
|
123
|
-
"types": "./dist/
|
|
124
|
-
"default": "./dist/
|
|
86
|
+
"types": "./dist/normalize-path.d.ts",
|
|
87
|
+
"default": "./dist/normalize-path.mjs"
|
|
125
88
|
}
|
|
126
89
|
},
|
|
127
|
-
"./
|
|
90
|
+
"./join-paths": {
|
|
128
91
|
"import": {
|
|
129
|
-
"types": "./dist/
|
|
130
|
-
"default": "./dist/
|
|
92
|
+
"types": "./dist/join-paths.d.ts",
|
|
93
|
+
"default": "./dist/join-paths.mjs"
|
|
131
94
|
},
|
|
132
95
|
"require": {
|
|
133
|
-
"types": "./dist/
|
|
134
|
-
"default": "./dist/
|
|
96
|
+
"types": "./dist/join-paths.d.ts",
|
|
97
|
+
"default": "./dist/join-paths.cjs"
|
|
135
98
|
},
|
|
136
99
|
"default": {
|
|
137
|
-
"types": "./dist/
|
|
138
|
-
"default": "./dist/
|
|
100
|
+
"types": "./dist/join-paths.d.ts",
|
|
101
|
+
"default": "./dist/join-paths.mjs"
|
|
139
102
|
}
|
|
140
103
|
},
|
|
141
|
-
"./
|
|
104
|
+
"./is-root-dir": {
|
|
142
105
|
"import": {
|
|
143
|
-
"types": "./dist/
|
|
144
|
-
"default": "./dist/
|
|
106
|
+
"types": "./dist/is-root-dir.d.ts",
|
|
107
|
+
"default": "./dist/is-root-dir.mjs"
|
|
145
108
|
},
|
|
146
109
|
"require": {
|
|
147
|
-
"types": "./dist/
|
|
148
|
-
"default": "./dist/
|
|
110
|
+
"types": "./dist/is-root-dir.d.ts",
|
|
111
|
+
"default": "./dist/is-root-dir.cjs"
|
|
149
112
|
},
|
|
150
113
|
"default": {
|
|
151
|
-
"types": "./dist/
|
|
152
|
-
"default": "./dist/
|
|
114
|
+
"types": "./dist/is-root-dir.d.ts",
|
|
115
|
+
"default": "./dist/is-root-dir.mjs"
|
|
153
116
|
}
|
|
154
117
|
},
|
|
155
|
-
"./
|
|
118
|
+
"./is-file": {
|
|
156
119
|
"import": {
|
|
157
|
-
"types": "./dist/
|
|
158
|
-
"default": "./dist/
|
|
120
|
+
"types": "./dist/is-file.d.ts",
|
|
121
|
+
"default": "./dist/is-file.mjs"
|
|
159
122
|
},
|
|
160
123
|
"require": {
|
|
161
|
-
"types": "./dist/
|
|
162
|
-
"default": "./dist/
|
|
124
|
+
"types": "./dist/is-file.d.ts",
|
|
125
|
+
"default": "./dist/is-file.cjs"
|
|
163
126
|
},
|
|
164
127
|
"default": {
|
|
165
|
-
"types": "./dist/
|
|
166
|
-
"default": "./dist/
|
|
128
|
+
"types": "./dist/is-file.d.ts",
|
|
129
|
+
"default": "./dist/is-file.mjs"
|
|
167
130
|
}
|
|
168
131
|
},
|
|
169
|
-
"./
|
|
170
|
-
"import": {
|
|
171
|
-
"types": "./dist/utilities/index.d.ts",
|
|
172
|
-
"default": "./dist/utilities/index.mjs"
|
|
173
|
-
},
|
|
132
|
+
"./index": {
|
|
133
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
174
134
|
"require": {
|
|
175
|
-
"types": "./dist/
|
|
176
|
-
"default": "./dist/
|
|
135
|
+
"types": "./dist/index.d.ts",
|
|
136
|
+
"default": "./dist/index.cjs"
|
|
177
137
|
},
|
|
178
|
-
"default": {
|
|
179
|
-
"types": "./dist/utilities/index.d.ts",
|
|
180
|
-
"default": "./dist/utilities/index.mjs"
|
|
181
|
-
}
|
|
138
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
182
139
|
},
|
|
183
|
-
"./
|
|
140
|
+
"./get-workspace-root": {
|
|
184
141
|
"import": {
|
|
185
|
-
"types": "./dist/
|
|
186
|
-
"default": "./dist/
|
|
142
|
+
"types": "./dist/get-workspace-root.d.ts",
|
|
143
|
+
"default": "./dist/get-workspace-root.mjs"
|
|
187
144
|
},
|
|
188
145
|
"require": {
|
|
189
|
-
"types": "./dist/
|
|
190
|
-
"default": "./dist/
|
|
146
|
+
"types": "./dist/get-workspace-root.d.ts",
|
|
147
|
+
"default": "./dist/get-workspace-root.cjs"
|
|
191
148
|
},
|
|
192
149
|
"default": {
|
|
193
|
-
"types": "./dist/
|
|
194
|
-
"default": "./dist/
|
|
150
|
+
"types": "./dist/get-workspace-root.d.ts",
|
|
151
|
+
"default": "./dist/get-workspace-root.mjs"
|
|
195
152
|
}
|
|
196
153
|
},
|
|
197
|
-
"./
|
|
154
|
+
"./get-parent-path": {
|
|
198
155
|
"import": {
|
|
199
|
-
"types": "./dist/
|
|
200
|
-
"default": "./dist/
|
|
156
|
+
"types": "./dist/get-parent-path.d.ts",
|
|
157
|
+
"default": "./dist/get-parent-path.mjs"
|
|
201
158
|
},
|
|
202
159
|
"require": {
|
|
203
|
-
"types": "./dist/
|
|
204
|
-
"default": "./dist/
|
|
160
|
+
"types": "./dist/get-parent-path.d.ts",
|
|
161
|
+
"default": "./dist/get-parent-path.cjs"
|
|
205
162
|
},
|
|
206
163
|
"default": {
|
|
207
|
-
"types": "./dist/
|
|
208
|
-
"default": "./dist/
|
|
164
|
+
"types": "./dist/get-parent-path.d.ts",
|
|
165
|
+
"default": "./dist/get-parent-path.mjs"
|
|
209
166
|
}
|
|
210
167
|
},
|
|
211
|
-
"./
|
|
168
|
+
"./file-path-fns": {
|
|
212
169
|
"import": {
|
|
213
|
-
"types": "./dist/
|
|
214
|
-
"default": "./dist/
|
|
170
|
+
"types": "./dist/file-path-fns.d.ts",
|
|
171
|
+
"default": "./dist/file-path-fns.mjs"
|
|
215
172
|
},
|
|
216
173
|
"require": {
|
|
217
|
-
"types": "./dist/
|
|
218
|
-
"default": "./dist/
|
|
174
|
+
"types": "./dist/file-path-fns.d.ts",
|
|
175
|
+
"default": "./dist/file-path-fns.cjs"
|
|
219
176
|
},
|
|
220
177
|
"default": {
|
|
221
|
-
"types": "./dist/
|
|
222
|
-
"default": "./dist/
|
|
178
|
+
"types": "./dist/file-path-fns.d.ts",
|
|
179
|
+
"default": "./dist/file-path-fns.mjs"
|
|
223
180
|
}
|
|
224
181
|
},
|
|
225
|
-
"./
|
|
182
|
+
"./exists": {
|
|
226
183
|
"import": {
|
|
227
|
-
"types": "./dist/
|
|
228
|
-
"default": "./dist/
|
|
184
|
+
"types": "./dist/exists.d.ts",
|
|
185
|
+
"default": "./dist/exists.mjs"
|
|
229
186
|
},
|
|
230
187
|
"require": {
|
|
231
|
-
"types": "./dist/
|
|
232
|
-
"default": "./dist/
|
|
188
|
+
"types": "./dist/exists.d.ts",
|
|
189
|
+
"default": "./dist/exists.cjs"
|
|
233
190
|
},
|
|
234
191
|
"default": {
|
|
235
|
-
"types": "./dist/
|
|
236
|
-
"default": "./dist/
|
|
192
|
+
"types": "./dist/exists.d.ts",
|
|
193
|
+
"default": "./dist/exists.mjs"
|
|
237
194
|
}
|
|
238
195
|
},
|
|
239
|
-
"./
|
|
196
|
+
"./delimiter": {
|
|
240
197
|
"import": {
|
|
241
|
-
"types": "./dist/
|
|
242
|
-
"default": "./dist/
|
|
198
|
+
"types": "./dist/delimiter.d.ts",
|
|
199
|
+
"default": "./dist/delimiter.mjs"
|
|
243
200
|
},
|
|
244
201
|
"require": {
|
|
245
|
-
"types": "./dist/
|
|
246
|
-
"default": "./dist/
|
|
202
|
+
"types": "./dist/delimiter.d.ts",
|
|
203
|
+
"default": "./dist/delimiter.cjs"
|
|
247
204
|
},
|
|
248
205
|
"default": {
|
|
249
|
-
"types": "./dist/
|
|
250
|
-
"default": "./dist/
|
|
206
|
+
"types": "./dist/delimiter.d.ts",
|
|
207
|
+
"default": "./dist/delimiter.mjs"
|
|
251
208
|
}
|
|
252
209
|
},
|
|
253
|
-
"./
|
|
210
|
+
"./asset-extensions": {
|
|
254
211
|
"import": {
|
|
255
|
-
"types": "./dist/
|
|
256
|
-
"default": "./dist/
|
|
212
|
+
"types": "./dist/asset-extensions.d.ts",
|
|
213
|
+
"default": "./dist/asset-extensions.mjs"
|
|
257
214
|
},
|
|
258
215
|
"require": {
|
|
259
|
-
"types": "./dist/
|
|
260
|
-
"default": "./dist/
|
|
216
|
+
"types": "./dist/asset-extensions.d.ts",
|
|
217
|
+
"default": "./dist/asset-extensions.cjs"
|
|
261
218
|
},
|
|
262
219
|
"default": {
|
|
263
|
-
"types": "./dist/
|
|
264
|
-
"default": "./dist/
|
|
220
|
+
"types": "./dist/asset-extensions.d.ts",
|
|
221
|
+
"default": "./dist/asset-extensions.mjs"
|
|
265
222
|
}
|
|
266
223
|
},
|
|
267
224
|
".": {
|
|
@@ -272,48 +229,6 @@
|
|
|
272
229
|
},
|
|
273
230
|
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
274
231
|
},
|
|
275
|
-
"./workspace": {
|
|
276
|
-
"import": {
|
|
277
|
-
"types": "./dist/workspace/index.d.ts",
|
|
278
|
-
"default": "./dist/workspace/index.mjs"
|
|
279
|
-
},
|
|
280
|
-
"require": {
|
|
281
|
-
"types": "./dist/workspace/index.d.ts",
|
|
282
|
-
"default": "./dist/workspace/index.cjs"
|
|
283
|
-
},
|
|
284
|
-
"default": {
|
|
285
|
-
"types": "./dist/workspace/index.d.ts",
|
|
286
|
-
"default": "./dist/workspace/index.mjs"
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
"./utilities": {
|
|
290
|
-
"import": {
|
|
291
|
-
"types": "./dist/utilities/index.d.ts",
|
|
292
|
-
"default": "./dist/utilities/index.mjs"
|
|
293
|
-
},
|
|
294
|
-
"require": {
|
|
295
|
-
"types": "./dist/utilities/index.d.ts",
|
|
296
|
-
"default": "./dist/utilities/index.cjs"
|
|
297
|
-
},
|
|
298
|
-
"default": {
|
|
299
|
-
"types": "./dist/utilities/index.d.ts",
|
|
300
|
-
"default": "./dist/utilities/index.mjs"
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
"./resolve": {
|
|
304
|
-
"import": {
|
|
305
|
-
"types": "./dist/resolve/index.d.ts",
|
|
306
|
-
"default": "./dist/resolve/index.mjs"
|
|
307
|
-
},
|
|
308
|
-
"require": {
|
|
309
|
-
"types": "./dist/resolve/index.d.ts",
|
|
310
|
-
"default": "./dist/resolve/index.cjs"
|
|
311
|
-
},
|
|
312
|
-
"default": {
|
|
313
|
-
"types": "./dist/resolve/index.d.ts",
|
|
314
|
-
"default": "./dist/resolve/index.mjs"
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
232
|
"./package.json": "./package.json"
|
|
318
233
|
},
|
|
319
234
|
"main": "./dist/index.cjs",
|
package/dist/resolve/index.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _resolve = require("./resolve.cjs");
|
|
7
|
-
Object.keys(_resolve).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _resolve[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _resolve[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
package/dist/resolve/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./resolve";
|
package/dist/resolve/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./resolve";
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.findFileExtension = findFileExtension;
|
|
7
|
-
exports.findFileName = findFileName;
|
|
8
|
-
exports.findFilePath = findFilePath;
|
|
9
|
-
exports.findFolderName = findFolderName;
|
|
10
|
-
exports.hasFileName = hasFileName;
|
|
11
|
-
exports.hasFilePath = hasFilePath;
|
|
12
|
-
exports.parsePath = parsePath;
|
|
13
|
-
exports.relativePath = relativePath;
|
|
14
|
-
exports.relativeToWorkspaceRoot = relativeToWorkspaceRoot;
|
|
15
|
-
exports.renameFile = renameFile;
|
|
16
|
-
exports.resolvePath = resolvePath;
|
|
17
|
-
exports.resolvePaths = resolvePaths;
|
|
18
|
-
var _base = require("@stryke/types/utility-types/base");
|
|
19
|
-
var _getWorkspaceRoot = require("../workspace/get-workspace-root.cjs");
|
|
20
|
-
var _isFile = require("./is-file.cjs");
|
|
21
|
-
var _joinPaths = require("./join-paths.cjs");
|
|
22
|
-
var _normalizePath = require("./normalize-path.cjs");
|
|
23
|
-
function findFileName(t, {
|
|
24
|
-
requireExtension: e,
|
|
25
|
-
withExtension: r
|
|
26
|
-
} = {}) {
|
|
27
|
-
const n = (0, _normalizePath.normalizeWindowsPath)(t)?.split(t?.includes(_normalizePath.sep) ? _normalizePath.sep : t?.includes("/") ? "/" : "\\")?.pop() ?? "";
|
|
28
|
-
return e === !0 && !n.includes(".") ? _base.EMPTY_STRING : r === !1 && n.includes(".") ? n.split(".").shift() || _base.EMPTY_STRING : n;
|
|
29
|
-
}
|
|
30
|
-
function findFilePath(t) {
|
|
31
|
-
const e = (0, _normalizePath.normalizeWindowsPath)(t);
|
|
32
|
-
return e.replace(findFileName(e, {
|
|
33
|
-
requireExtension: !0
|
|
34
|
-
}), "");
|
|
35
|
-
}
|
|
36
|
-
function findFolderName(t) {
|
|
37
|
-
const e = findFilePath(t).split("/");
|
|
38
|
-
let r = "";
|
|
39
|
-
for (let n = e.length - 1; n >= 0; n--) {
|
|
40
|
-
const i = e[n];
|
|
41
|
-
if (i) {
|
|
42
|
-
r = i;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return r ?? _base.EMPTY_STRING;
|
|
47
|
-
}
|
|
48
|
-
function findFileExtension(t) {
|
|
49
|
-
if (t === "..") return "";
|
|
50
|
-
const e = /.(\.[^./]+|\.)$/.exec((0, _normalizePath.normalizeWindowsPath)(t));
|
|
51
|
-
return e && e[1] || _base.EMPTY_STRING;
|
|
52
|
-
}
|
|
53
|
-
function hasFileName(t) {
|
|
54
|
-
return !!findFileName(t);
|
|
55
|
-
}
|
|
56
|
-
function hasFilePath(t) {
|
|
57
|
-
return !!findFilePath(t);
|
|
58
|
-
}
|
|
59
|
-
function resolvePath(t, e = (0, _getWorkspaceRoot.getWorkspaceRoot)()) {
|
|
60
|
-
const r = (0, _normalizePath.normalizeWindowsPath)(t).split("/");
|
|
61
|
-
let n = "",
|
|
62
|
-
i = !1;
|
|
63
|
-
for (let o = r.length - 1; o >= -1 && !i; o--) {
|
|
64
|
-
const s = o >= 0 ? r[o] : e;
|
|
65
|
-
!s || s.length === 0 || (n = (0, _joinPaths.joinPaths)(s, n), i = (0, _isFile.isAbsolutePath)(s));
|
|
66
|
-
}
|
|
67
|
-
return n = (0, _normalizePath.normalizeString)(n, !i), i && !(0, _isFile.isAbsolutePath)(n) ? `/${n}` : n.length > 0 ? n : ".";
|
|
68
|
-
}
|
|
69
|
-
function resolvePaths(...t) {
|
|
70
|
-
return resolvePath((0, _joinPaths.joinPaths)(...t.map(e => (0, _normalizePath.normalizeWindowsPath)(e))));
|
|
71
|
-
}
|
|
72
|
-
function relativePath(t, e) {
|
|
73
|
-
const r = resolvePath(t).replace(/^\/([A-Z]:)?$/i, "$1").split("/"),
|
|
74
|
-
n = resolvePath(e).replace(/^\/([A-Z]:)?$/i, "$1").split("/");
|
|
75
|
-
if (n[0][1] === ":" && r[0][1] === ":" && r[0] !== n[0]) return n.join("/");
|
|
76
|
-
const i = [...r];
|
|
77
|
-
for (const o of i) {
|
|
78
|
-
if (n[0] !== o) break;
|
|
79
|
-
r.shift(), n.shift();
|
|
80
|
-
}
|
|
81
|
-
return [...r.map(() => ".."), ...n].join("/");
|
|
82
|
-
}
|
|
83
|
-
function relativeToWorkspaceRoot(t) {
|
|
84
|
-
return relativePath(t, (0, _getWorkspaceRoot.getWorkspaceRoot)());
|
|
85
|
-
}
|
|
86
|
-
function parsePath(t) {
|
|
87
|
-
const e = /^[/\\]|^[a-z]:[/\\]/i.exec(t)?.[0]?.replace(/\\/g, "/") || "",
|
|
88
|
-
r = (0, _normalizePath.normalizeWindowsPath)(t),
|
|
89
|
-
n = r.replace(/\/$/, "").split("/").slice(0, -1);
|
|
90
|
-
n.length === 1 && /^[A-Z]:$/i.test(n[0]) && (n[0] += "/");
|
|
91
|
-
const i = findFolderName(r),
|
|
92
|
-
o = n.join("/") || ((0, _isFile.isAbsolutePath)(t) ? "/" : "."),
|
|
93
|
-
s = findFileExtension(t);
|
|
94
|
-
return {
|
|
95
|
-
root: e,
|
|
96
|
-
dir: o,
|
|
97
|
-
base: i,
|
|
98
|
-
ext: s,
|
|
99
|
-
name: i.slice(0, i.length - s.length)
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
function renameFile(t, e) {
|
|
103
|
-
const r = parsePath(t);
|
|
104
|
-
return (0, _joinPaths.joinPaths)(r.dir, e.includes(".") ? e : e + r.ext);
|
|
105
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{EMPTY_STRING as a}from"@stryke/types/utility-types/base";import{getWorkspaceRoot as f}from"../workspace/get-workspace-root";import{isAbsolutePath as c}from"./is-file";import{joinPaths as u}from"./join-paths";import{normalizeString as g,normalizeWindowsPath as l,sep as p}from"./normalize-path";export function findFileName(t,{requireExtension:e,withExtension:r}={}){const n=l(t)?.split(t?.includes(p)?p:t?.includes("/")?"/":"\\")?.pop()??"";return e===!0&&!n.includes(".")?a:r===!1&&n.includes(".")?n.split(".").shift()||a:n}export function findFilePath(t){const e=l(t);return e.replace(findFileName(e,{requireExtension:!0}),"")}export function findFolderName(t){const e=findFilePath(t).split("/");let r="";for(let n=e.length-1;n>=0;n--){const i=e[n];if(i){r=i;break}}return r??a}export function findFileExtension(t){if(t==="..")return"";const e=/.(\.[^./]+|\.)$/.exec(l(t));return e&&e[1]||a}export function hasFileName(t){return!!findFileName(t)}export function hasFilePath(t){return!!findFilePath(t)}export function resolvePath(t,e=f()){const r=l(t).split("/");let n="",i=!1;for(let o=r.length-1;o>=-1&&!i;o--){const s=o>=0?r[o]:e;!s||s.length===0||(n=u(s,n),i=c(s))}return n=g(n,!i),i&&!c(n)?`/${n}`:n.length>0?n:"."}export function resolvePaths(...t){return resolvePath(u(...t.map(e=>l(e))))}export function relativePath(t,e){const r=resolvePath(t).replace(/^\/([A-Z]:)?$/i,"$1").split("/"),n=resolvePath(e).replace(/^\/([A-Z]:)?$/i,"$1").split("/");if(n[0][1]===":"&&r[0][1]===":"&&r[0]!==n[0])return n.join("/");const i=[...r];for(const o of i){if(n[0]!==o)break;r.shift(),n.shift()}return[...r.map(()=>".."),...n].join("/")}export function relativeToWorkspaceRoot(t){return relativePath(t,f())}export function parsePath(t){const e=/^[/\\]|^[a-z]:[/\\]/i.exec(t)?.[0]?.replace(/\\/g,"/")||"",r=l(t),n=r.replace(/\/$/,"").split("/").slice(0,-1);n.length===1&&/^[A-Z]:$/i.test(n[0])&&(n[0]+="/");const i=findFolderName(r),o=n.join("/")||(c(t)?"/":"."),s=findFileExtension(t);return{root:e,dir:o,base:i,ext:s,name:i.slice(0,i.length-s.length)}}export function renameFile(t,e){const r=parsePath(t);return u(r.dir,e.includes(".")?e:e+r.ext)}
|
package/dist/utilities/index.cjs
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _delimiter = require("./delimiter.cjs");
|
|
7
|
-
Object.keys(_delimiter).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _delimiter[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _delimiter[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _exists = require("./exists.cjs");
|
|
18
|
-
Object.keys(_exists).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _exists[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _exists[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _filePathFns = require("./file-path-fns.cjs");
|
|
29
|
-
Object.keys(_filePathFns).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _filePathFns[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _filePathFns[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _getParentPath = require("./get-parent-path.cjs");
|
|
40
|
-
Object.keys(_getParentPath).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _getParentPath[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _getParentPath[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _isFile = require("./is-file.cjs");
|
|
51
|
-
Object.keys(_isFile).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _isFile[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _isFile[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _isRootDir = require("./is-root-dir.cjs");
|
|
62
|
-
Object.keys(_isRootDir).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _isRootDir[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _isRootDir[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
var _joinPaths = require("./join-paths.cjs");
|
|
73
|
-
Object.keys(_joinPaths).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _joinPaths[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _joinPaths[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var _normalizePath = require("./normalize-path.cjs");
|
|
84
|
-
Object.keys(_normalizePath).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _normalizePath[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _normalizePath[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
package/dist/utilities/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./delimiter";export*from"./exists";export*from"./file-path-fns";export*from"./get-parent-path";export*from"./is-file";export*from"./is-root-dir";export*from"./join-paths";export*from"./normalize-path";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.joinPaths = joinPaths;
|
|
7
|
-
var _normalizePath = require("./normalize-path.cjs");
|
|
8
|
-
function joinPaths(...i) {
|
|
9
|
-
let t = "";
|
|
10
|
-
for (const n of i) if (n) if (t.length > 0) {
|
|
11
|
-
const o = t.at(-1) === "/",
|
|
12
|
-
e = n[0] === "/";
|
|
13
|
-
o && e ? t += n.slice(1) : t += o || e ? n : `/${n}`;
|
|
14
|
-
} else t += n;
|
|
15
|
-
return (0, _normalizePath.normalizePath)(t);
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{normalizePath as s}from"./normalize-path";export function joinPaths(...i){let t="";for(const n of i)if(n)if(t.length>0){const o=t.at(-1)==="/",e=n[0]==="/";o&&e?t+=n.slice(1):t+=o||e?n:`/${n}`}else t+=n;return s(t)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isAbsolutePath as g}from"./is-file";export function slash(e){return e.replace(/\\/g,"/")}export function normalizeWindowsPath(e=""){return e&&e.replace(/\\/g,"/").replace(/^[A-Z]:\//i,s=>s.toUpperCase())}export const sep="/";export function normalizeString(e,s){let n="",t=0,i=-1,r=0,o=null;for(let l=0;l<=e.length;++l){if(l<e.length)o=e[l];else{if(o==="/")break;o="/"}if(o==="/"){if(!(i===l-1||r===1))if(r===2){if(n.length<2||t!==2||n.at(-1)!=="."||n.at(-2)!=="."){if(n.length>2){const f=n.lastIndexOf("/");f===-1?(n="",t=0):(n=n.slice(0,f),t=n.length-1-n.lastIndexOf("/")),i=l,r=0;continue}else if(n.length>0){n="",t=0,i=l,r=0;continue}}s&&(n+=n.length>0?"/..":"..",t=2)}else n.length>0?n+=`/${e.slice(i+1,l)}`:n=e.slice(i+1,l),t=l-i-1;i=l,r=0}else o==="."&&r!==-1?++r:r=-1}return n}export function normalizePath(e){if(!e||e.length===0)return".";e=normalizeWindowsPath(e);const s=e.match(/^[/\\]{2}/),n=g(e),t=e.at(-1)==="/";return e=normalizeString(e,!n),e.length===0?n?"/":t?"./":".":(t&&(e+="/"),/^[A-Z]:$/i.test(e)&&(e+="/"),s?n?`//${e}`:`//./${e}`:n&&!g(e)?`/${e}`:e)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{findWorkspaceRootSafe as c}from"@storm-software/config-tools";import{PackageManagerLockFiles as e}from"@stryke/types/utility-types/package-manager";import{getParentPath as s}from"../utilities/get-parent-path";import{isSystemRoot as n}from"../utilities/is-root-dir";export const getWorkspaceRoot=(r=process.cwd())=>{if(process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH)return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH;const t=c(r);if(t)return t;let o=s([e.NPM,e.YARN,e.PNPM,e.BUN,"nx.json","knip.json","pnpm-workspace.yaml","LICENSE",".all-contributorsrc",".whitesource","syncpack.config.js","syncpack.json","socket.yaml","lefthook.yaml",".npmrc",".log4brains.yml",".huskyrc",".husky",".lintstagedrc",".commitlintrc","lefthook.yml",".github",".nx",".vscode","patches"],r);if(o)return o;for(o=r;o&&!n(o);)if(o=s("storm.json",o,{skipCwd:!0}),o)return o;return r},getProjectRoot=(r=process.cwd())=>{const t=s(["project.json","package.json",".storm"],r);return t||r};
|