@storm-software/eslint 0.170.155 → 0.170.157
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/README.md +1 -1
- package/dist/astro-CKzo6xci.d.mts +5 -0
- package/dist/banner-YnHf4ewf.d.mts +5 -0
- package/dist/bun-OJPLvfnX.d.mts +5 -0
- package/dist/cspell-CfGd6g7m.d.mts +8 -0
- package/dist/disables-Dx5b56Fi.d.mts +5 -0
- package/dist/find-workspace-root-D3UHWbgn.mjs +211 -0
- package/dist/formatters-VU6Zu_ju.d.mts +5 -0
- package/dist/graphql-ClFinA5J.d.mts +5 -0
- package/dist/helpers-mce_MNwt.mjs +72 -0
- package/dist/ignores-CPeru9Fz.d.mts +5 -0
- package/dist/imports-CQToT7JW.d.mts +5 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.mjs +42 -0
- package/dist/javascript-BR8uv0Wr.d.mts +5 -0
- package/dist/jsdoc-Dy8bHykP.d.mts +5 -0
- package/dist/jsonc-YqDXTIOi.d.mts +5 -0
- package/dist/jsx-DzqEJSYd.d.mts +5 -0
- package/dist/markdown-C5lFEI83.d.mts +5 -0
- package/dist/mdx-CDEhveb1.d.mts +5 -0
- package/dist/next-DGhspeMc.d.mts +8 -0
- package/dist/node-CQgsZ8nv.d.mts +5 -0
- package/dist/nx-CLRc6QRM.d.mts +8 -0
- package/dist/perfectionist-CgSgqAjV.d.mts +10 -0
- package/dist/plugins-CZWNS7l4.mjs +8291 -0
- package/dist/plugins.d.mts +616 -0
- package/dist/plugins.mjs +2 -0
- package/dist/pnpm-Cp9VzsCv.d.mts +5 -0
- package/dist/preset-x6MId9-7.mjs +265 -0
- package/dist/preset.d.mts +30 -0
- package/dist/preset.mjs +3 -0
- package/dist/prettier-CboafVRp.d.mts +8 -0
- package/dist/react-C5HWHYPh.d.mts +5 -0
- package/dist/react-native-DjQo3PXB.d.mts +8 -0
- package/dist/regexp-D2Fm6vg7.d.mts +5 -0
- package/dist/rolldown-runtime-CMFfr-1z.mjs +26 -0
- package/dist/secrets-DfvPNLCF.d.mts +10 -0
- package/dist/sort-9_xeGmal.d.mts +16 -0
- package/dist/storybook-DqDJ5exI.d.mts +5 -0
- package/dist/stylistic-9jDGqsHH.d.mts +9 -0
- package/dist/test-Dw-h86ig.d.mts +5 -0
- package/dist/toml-ConAZLXy.d.mts +5 -0
- package/dist/tsdoc-DcYWMVl0.d.mts +5 -0
- package/dist/{types.d.ts → typegen.d.mts} +8536 -11156
- package/dist/types-XIthLTox.d.mts +852 -0
- package/dist/types.d.mts +3 -0
- package/dist/types.mjs +2 -0
- package/dist/typescript-BFiiMXDt.d.mts +5 -0
- package/dist/unicorn-CQ3PTdfT.d.mts +5 -0
- package/dist/unocss-Uw-vEvNU.d.mts +5 -0
- package/dist/yaml-Ddbh49WY.d.mts +5 -0
- package/dist/zod-7F7dUsU5.d.mts +8 -0
- package/package.json +58 -79
- package/dist/chunk-2TYJ2VM7.js +0 -46
- package/dist/chunk-F7ZJ6N35.js +0 -43
- package/dist/chunk-I4ZWVHOG.js +0 -220
- package/dist/chunk-JBIA43L4.js +0 -75
- package/dist/chunk-T6GDWDAB.js +0 -167
- package/dist/chunk-XFFMMX6A.js +0 -96
- package/dist/chunk-XSM4AYON.js +0 -19822
- package/dist/chunk-Y5JY2DPL.js +0 -19
- package/dist/index.cjs +0 -21965
- package/dist/index.d.cts +0 -127
- package/dist/index.d.ts +0 -127
- package/dist/index.js +0 -15
- package/dist/preset.cjs +0 -21922
- package/dist/preset.d.cts +0 -34
- package/dist/preset.d.ts +0 -34
- package/dist/preset.js +0 -8
- package/dist/src-TAWYAYRW.js +0 -887
- package/dist/src-XRFRLUCW.js +0 -57
- package/dist/src-YPCQHGJY.js +0 -91
- package/dist/types.cjs +0 -2
- package/dist/types.d.cts +0 -19537
- package/dist/types.js +0 -4
- package/dist/utils/combine.cjs +0 -9
- package/dist/utils/combine.d.cts +0 -14
- package/dist/utils/combine.d.ts +0 -14
- package/dist/utils/combine.js +0 -10
- package/dist/utils/correct-paths.cjs +0 -232
- package/dist/utils/correct-paths.d.cts +0 -30
- package/dist/utils/correct-paths.d.ts +0 -30
- package/dist/utils/correct-paths.js +0 -2
- package/dist/utils/find-workspace-root.cjs +0 -201
- package/dist/utils/find-workspace-root.d.cts +0 -16
- package/dist/utils/find-workspace-root.d.ts +0 -16
- package/dist/utils/find-workspace-root.js +0 -3
- package/dist/utils/format-config.cjs +0 -20
- package/dist/utils/format-config.d.cts +0 -5
- package/dist/utils/format-config.d.ts +0 -5
- package/dist/utils/format-config.js +0 -21
- package/dist/utils/helpers.cjs +0 -87
- package/dist/utils/helpers.d.cts +0 -55
- package/dist/utils/helpers.d.ts +0 -55
- package/dist/utils/helpers.js +0 -2
- package/dist/utils/package-manager.cjs +0 -199
- package/dist/utils/package-manager.d.cts +0 -8
- package/dist/utils/package-manager.d.ts +0 -8
- package/dist/utils/package-manager.js +0 -4
- package/dist/utils/tsconfig.cjs +0 -297
- package/dist/utils/tsconfig.d.cts +0 -25
- package/dist/utils/tsconfig.d.ts +0 -25
- package/dist/utils/tsconfig.js +0 -4
package/dist/types.js
DELETED
package/dist/utils/combine.cjs
DELETED
package/dist/utils/combine.d.cts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Awaitable } from 'eslint-flat-config-utils';
|
|
2
|
-
import { TypedFlatConfigItem } from '../types.cjs';
|
|
3
|
-
import '@storm-software/eslint-plugin-banner/rules/banner';
|
|
4
|
-
import '@stylistic/eslint-plugin';
|
|
5
|
-
import '@typescript-eslint/parser';
|
|
6
|
-
import 'eslint';
|
|
7
|
-
import 'eslint-config-flat-gitignore';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Combine array and non-array configs into a single array.
|
|
11
|
-
*/
|
|
12
|
-
declare function combine(...configs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[]>[]): Promise<TypedFlatConfigItem[]>;
|
|
13
|
-
|
|
14
|
-
export { combine };
|
package/dist/utils/combine.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Awaitable } from 'eslint-flat-config-utils';
|
|
2
|
-
import { TypedFlatConfigItem } from '../types.js';
|
|
3
|
-
import '@storm-software/eslint-plugin-banner/rules/banner';
|
|
4
|
-
import '@stylistic/eslint-plugin';
|
|
5
|
-
import '@typescript-eslint/parser';
|
|
6
|
-
import 'eslint';
|
|
7
|
-
import 'eslint-config-flat-gitignore';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Combine array and non-array configs into a single array.
|
|
11
|
-
*/
|
|
12
|
-
declare function combine(...configs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[]>[]): Promise<TypedFlatConfigItem[]>;
|
|
13
|
-
|
|
14
|
-
export { combine };
|
package/dist/utils/combine.js
DELETED
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/utils/correct-paths.ts
|
|
4
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
5
|
-
function normalizeWindowsPath(input = "") {
|
|
6
|
-
if (!input) {
|
|
7
|
-
return input;
|
|
8
|
-
}
|
|
9
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
10
|
-
}
|
|
11
|
-
var _UNC_REGEX = /^[/\\]{2}/;
|
|
12
|
-
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
13
|
-
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
14
|
-
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
15
|
-
var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
16
|
-
var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
17
|
-
var sep = "/";
|
|
18
|
-
var correctPaths = function(path) {
|
|
19
|
-
if (!path || path.length === 0) {
|
|
20
|
-
return ".";
|
|
21
|
-
}
|
|
22
|
-
path = normalizeWindowsPath(path);
|
|
23
|
-
const isUNCPath = path.match(_UNC_REGEX);
|
|
24
|
-
const isPathAbsolute = isAbsolute(path);
|
|
25
|
-
const trailingSeparator = path[path.length - 1] === "/";
|
|
26
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
27
|
-
if (path.length === 0) {
|
|
28
|
-
if (isPathAbsolute) {
|
|
29
|
-
return "/";
|
|
30
|
-
}
|
|
31
|
-
return trailingSeparator ? "./" : ".";
|
|
32
|
-
}
|
|
33
|
-
if (trailingSeparator) {
|
|
34
|
-
path += "/";
|
|
35
|
-
}
|
|
36
|
-
if (_DRIVE_LETTER_RE.test(path)) {
|
|
37
|
-
path += "/";
|
|
38
|
-
}
|
|
39
|
-
if (isUNCPath) {
|
|
40
|
-
if (!isPathAbsolute) {
|
|
41
|
-
return `//./${path}`;
|
|
42
|
-
}
|
|
43
|
-
return `//${path}`;
|
|
44
|
-
}
|
|
45
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
46
|
-
};
|
|
47
|
-
var joinPaths = function(...segments) {
|
|
48
|
-
let path = "";
|
|
49
|
-
for (const seg of segments) {
|
|
50
|
-
if (!seg) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (path.length > 0) {
|
|
54
|
-
const pathTrailing = path[path.length - 1] === "/";
|
|
55
|
-
const segLeading = seg[0] === "/";
|
|
56
|
-
const both = pathTrailing && segLeading;
|
|
57
|
-
if (both) {
|
|
58
|
-
path += seg.slice(1);
|
|
59
|
-
} else {
|
|
60
|
-
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
path += seg;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return correctPaths(path);
|
|
67
|
-
};
|
|
68
|
-
function cwd() {
|
|
69
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
70
|
-
return process.cwd().replace(/\\/g, "/");
|
|
71
|
-
}
|
|
72
|
-
return "/";
|
|
73
|
-
}
|
|
74
|
-
var resolve = function(...arguments_) {
|
|
75
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
76
|
-
let resolvedPath = "";
|
|
77
|
-
let resolvedAbsolute = false;
|
|
78
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
79
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
80
|
-
if (!path || path.length === 0) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
84
|
-
resolvedAbsolute = isAbsolute(path);
|
|
85
|
-
}
|
|
86
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
87
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
88
|
-
return `/${resolvedPath}`;
|
|
89
|
-
}
|
|
90
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
91
|
-
};
|
|
92
|
-
function normalizeString(path, allowAboveRoot) {
|
|
93
|
-
let res = "";
|
|
94
|
-
let lastSegmentLength = 0;
|
|
95
|
-
let lastSlash = -1;
|
|
96
|
-
let dots = 0;
|
|
97
|
-
let char = null;
|
|
98
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
99
|
-
if (index < path.length) {
|
|
100
|
-
char = path[index];
|
|
101
|
-
} else if (char === "/") {
|
|
102
|
-
break;
|
|
103
|
-
} else {
|
|
104
|
-
char = "/";
|
|
105
|
-
}
|
|
106
|
-
if (char === "/") {
|
|
107
|
-
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
108
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
109
|
-
if (res.length > 2) {
|
|
110
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
111
|
-
if (lastSlashIndex === -1) {
|
|
112
|
-
res = "";
|
|
113
|
-
lastSegmentLength = 0;
|
|
114
|
-
} else {
|
|
115
|
-
res = res.slice(0, lastSlashIndex);
|
|
116
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
117
|
-
}
|
|
118
|
-
lastSlash = index;
|
|
119
|
-
dots = 0;
|
|
120
|
-
continue;
|
|
121
|
-
} else if (res.length > 0) {
|
|
122
|
-
res = "";
|
|
123
|
-
lastSegmentLength = 0;
|
|
124
|
-
lastSlash = index;
|
|
125
|
-
dots = 0;
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (allowAboveRoot) {
|
|
130
|
-
res += res.length > 0 ? "/.." : "..";
|
|
131
|
-
lastSegmentLength = 2;
|
|
132
|
-
}
|
|
133
|
-
} else {
|
|
134
|
-
if (res.length > 0) {
|
|
135
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
136
|
-
} else {
|
|
137
|
-
res = path.slice(lastSlash + 1, index);
|
|
138
|
-
}
|
|
139
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
140
|
-
}
|
|
141
|
-
lastSlash = index;
|
|
142
|
-
dots = 0;
|
|
143
|
-
} else if (char === "." && dots !== -1) {
|
|
144
|
-
++dots;
|
|
145
|
-
} else {
|
|
146
|
-
dots = -1;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return res;
|
|
150
|
-
}
|
|
151
|
-
var isAbsolute = function(p) {
|
|
152
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
153
|
-
};
|
|
154
|
-
var toNamespacedPath = function(p) {
|
|
155
|
-
return normalizeWindowsPath(p);
|
|
156
|
-
};
|
|
157
|
-
var extname = function(p) {
|
|
158
|
-
if (p === "..") return "";
|
|
159
|
-
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
160
|
-
return match && match[1] || "";
|
|
161
|
-
};
|
|
162
|
-
var relative = function(from, to) {
|
|
163
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
164
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
165
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
166
|
-
return _to.join("/");
|
|
167
|
-
}
|
|
168
|
-
const _fromCopy = [..._from];
|
|
169
|
-
for (const segment of _fromCopy) {
|
|
170
|
-
if (_to[0] !== segment) {
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
_from.shift();
|
|
174
|
-
_to.shift();
|
|
175
|
-
}
|
|
176
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
177
|
-
};
|
|
178
|
-
var dirname = function(p) {
|
|
179
|
-
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
180
|
-
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
181
|
-
segments[0] += "/";
|
|
182
|
-
}
|
|
183
|
-
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
184
|
-
};
|
|
185
|
-
var format = function(p) {
|
|
186
|
-
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
187
|
-
const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
188
|
-
Boolean
|
|
189
|
-
);
|
|
190
|
-
return normalizeWindowsPath(
|
|
191
|
-
p.root ? resolve(...segments) : segments.join("/")
|
|
192
|
-
);
|
|
193
|
-
};
|
|
194
|
-
var basename = function(p, extension) {
|
|
195
|
-
const segments = normalizeWindowsPath(p).split("/");
|
|
196
|
-
let lastSegment = "";
|
|
197
|
-
for (let i = segments.length - 1; i >= 0; i--) {
|
|
198
|
-
const val = segments[i];
|
|
199
|
-
if (val) {
|
|
200
|
-
lastSegment = val;
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
205
|
-
};
|
|
206
|
-
var parse = function(p) {
|
|
207
|
-
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
208
|
-
const base = basename(p);
|
|
209
|
-
const extension = extname(base);
|
|
210
|
-
return {
|
|
211
|
-
root,
|
|
212
|
-
dir: dirname(p),
|
|
213
|
-
base,
|
|
214
|
-
ext: extension,
|
|
215
|
-
name: base.slice(0, base.length - extension.length)
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
exports.basename = basename;
|
|
220
|
-
exports.correctPaths = correctPaths;
|
|
221
|
-
exports.dirname = dirname;
|
|
222
|
-
exports.extname = extname;
|
|
223
|
-
exports.format = format;
|
|
224
|
-
exports.isAbsolute = isAbsolute;
|
|
225
|
-
exports.joinPaths = joinPaths;
|
|
226
|
-
exports.normalizeString = normalizeString;
|
|
227
|
-
exports.normalizeWindowsPath = normalizeWindowsPath;
|
|
228
|
-
exports.parse = parse;
|
|
229
|
-
exports.relative = relative;
|
|
230
|
-
exports.resolve = resolve;
|
|
231
|
-
exports.sep = sep;
|
|
232
|
-
exports.toNamespacedPath = toNamespacedPath;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
|
|
3
|
-
declare function normalizeWindowsPath(input?: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Constant for path separator.
|
|
6
|
-
*
|
|
7
|
-
* Always equals to `"/"`.
|
|
8
|
-
*/
|
|
9
|
-
declare const sep = "/";
|
|
10
|
-
declare const correctPaths: (path?: string) => string;
|
|
11
|
-
declare const joinPaths: typeof path.join;
|
|
12
|
-
declare const resolve: typeof path.resolve;
|
|
13
|
-
/**
|
|
14
|
-
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
15
|
-
*
|
|
16
|
-
* @param path - The path to normalise.
|
|
17
|
-
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
18
|
-
* @returns the normalised path string.
|
|
19
|
-
*/
|
|
20
|
-
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
|
21
|
-
declare const isAbsolute: typeof path.isAbsolute;
|
|
22
|
-
declare const toNamespacedPath: typeof path.toNamespacedPath;
|
|
23
|
-
declare const extname: typeof path.extname;
|
|
24
|
-
declare const relative: typeof path.relative;
|
|
25
|
-
declare const dirname: typeof path.dirname;
|
|
26
|
-
declare const format: typeof path.format;
|
|
27
|
-
declare const basename: typeof path.basename;
|
|
28
|
-
declare const parse: typeof path.parse;
|
|
29
|
-
|
|
30
|
-
export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
|
|
3
|
-
declare function normalizeWindowsPath(input?: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* Constant for path separator.
|
|
6
|
-
*
|
|
7
|
-
* Always equals to `"/"`.
|
|
8
|
-
*/
|
|
9
|
-
declare const sep = "/";
|
|
10
|
-
declare const correctPaths: (path?: string) => string;
|
|
11
|
-
declare const joinPaths: typeof path.join;
|
|
12
|
-
declare const resolve: typeof path.resolve;
|
|
13
|
-
/**
|
|
14
|
-
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
15
|
-
*
|
|
16
|
-
* @param path - The path to normalise.
|
|
17
|
-
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
18
|
-
* @returns the normalised path string.
|
|
19
|
-
*/
|
|
20
|
-
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
|
21
|
-
declare const isAbsolute: typeof path.isAbsolute;
|
|
22
|
-
declare const toNamespacedPath: typeof path.toNamespacedPath;
|
|
23
|
-
declare const extname: typeof path.extname;
|
|
24
|
-
declare const relative: typeof path.relative;
|
|
25
|
-
declare const dirname: typeof path.dirname;
|
|
26
|
-
declare const format: typeof path.format;
|
|
27
|
-
declare const basename: typeof path.basename;
|
|
28
|
-
declare const parse: typeof path.parse;
|
|
29
|
-
|
|
30
|
-
export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath };
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
var path = require('path');
|
|
5
|
-
|
|
6
|
-
// src/utils/find-workspace-root.ts
|
|
7
|
-
|
|
8
|
-
// src/utils/correct-paths.ts
|
|
9
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
10
|
-
function normalizeWindowsPath(input = "") {
|
|
11
|
-
if (!input) {
|
|
12
|
-
return input;
|
|
13
|
-
}
|
|
14
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
15
|
-
}
|
|
16
|
-
var _UNC_REGEX = /^[/\\]{2}/;
|
|
17
|
-
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
18
|
-
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
19
|
-
var correctPaths = function(path) {
|
|
20
|
-
if (!path || path.length === 0) {
|
|
21
|
-
return ".";
|
|
22
|
-
}
|
|
23
|
-
path = normalizeWindowsPath(path);
|
|
24
|
-
const isUNCPath = path.match(_UNC_REGEX);
|
|
25
|
-
const isPathAbsolute = isAbsolute(path);
|
|
26
|
-
const trailingSeparator = path[path.length - 1] === "/";
|
|
27
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
28
|
-
if (path.length === 0) {
|
|
29
|
-
if (isPathAbsolute) {
|
|
30
|
-
return "/";
|
|
31
|
-
}
|
|
32
|
-
return trailingSeparator ? "./" : ".";
|
|
33
|
-
}
|
|
34
|
-
if (trailingSeparator) {
|
|
35
|
-
path += "/";
|
|
36
|
-
}
|
|
37
|
-
if (_DRIVE_LETTER_RE.test(path)) {
|
|
38
|
-
path += "/";
|
|
39
|
-
}
|
|
40
|
-
if (isUNCPath) {
|
|
41
|
-
if (!isPathAbsolute) {
|
|
42
|
-
return `//./${path}`;
|
|
43
|
-
}
|
|
44
|
-
return `//${path}`;
|
|
45
|
-
}
|
|
46
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
47
|
-
};
|
|
48
|
-
function normalizeString(path, allowAboveRoot) {
|
|
49
|
-
let res = "";
|
|
50
|
-
let lastSegmentLength = 0;
|
|
51
|
-
let lastSlash = -1;
|
|
52
|
-
let dots = 0;
|
|
53
|
-
let char = null;
|
|
54
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
55
|
-
if (index < path.length) {
|
|
56
|
-
char = path[index];
|
|
57
|
-
} else if (char === "/") {
|
|
58
|
-
break;
|
|
59
|
-
} else {
|
|
60
|
-
char = "/";
|
|
61
|
-
}
|
|
62
|
-
if (char === "/") {
|
|
63
|
-
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
64
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
65
|
-
if (res.length > 2) {
|
|
66
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
67
|
-
if (lastSlashIndex === -1) {
|
|
68
|
-
res = "";
|
|
69
|
-
lastSegmentLength = 0;
|
|
70
|
-
} else {
|
|
71
|
-
res = res.slice(0, lastSlashIndex);
|
|
72
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
73
|
-
}
|
|
74
|
-
lastSlash = index;
|
|
75
|
-
dots = 0;
|
|
76
|
-
continue;
|
|
77
|
-
} else if (res.length > 0) {
|
|
78
|
-
res = "";
|
|
79
|
-
lastSegmentLength = 0;
|
|
80
|
-
lastSlash = index;
|
|
81
|
-
dots = 0;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (allowAboveRoot) {
|
|
86
|
-
res += res.length > 0 ? "/.." : "..";
|
|
87
|
-
lastSegmentLength = 2;
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
if (res.length > 0) {
|
|
91
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
92
|
-
} else {
|
|
93
|
-
res = path.slice(lastSlash + 1, index);
|
|
94
|
-
}
|
|
95
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
96
|
-
}
|
|
97
|
-
lastSlash = index;
|
|
98
|
-
dots = 0;
|
|
99
|
-
} else if (char === "." && dots !== -1) {
|
|
100
|
-
++dots;
|
|
101
|
-
} else {
|
|
102
|
-
dots = -1;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return res;
|
|
106
|
-
}
|
|
107
|
-
var isAbsolute = function(p) {
|
|
108
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// src/utils/find-workspace-root.ts
|
|
112
|
-
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
113
|
-
var depth = 0;
|
|
114
|
-
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
115
|
-
const _startPath = startPath ?? process.cwd();
|
|
116
|
-
if (endDirectoryNames.some(
|
|
117
|
-
(endDirName) => fs.existsSync(path.join(_startPath, endDirName))
|
|
118
|
-
)) {
|
|
119
|
-
return _startPath;
|
|
120
|
-
}
|
|
121
|
-
if (endFileNames.some((endFileName) => fs.existsSync(path.join(_startPath, endFileName)))) {
|
|
122
|
-
return _startPath;
|
|
123
|
-
}
|
|
124
|
-
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
125
|
-
const parent = path.join(_startPath, "..");
|
|
126
|
-
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
127
|
-
}
|
|
128
|
-
return void 0;
|
|
129
|
-
}
|
|
130
|
-
var rootFiles = [
|
|
131
|
-
"storm-workspace.json",
|
|
132
|
-
"storm-workspace.json",
|
|
133
|
-
"storm-workspace.yaml",
|
|
134
|
-
"storm-workspace.yml",
|
|
135
|
-
"storm-workspace.js",
|
|
136
|
-
"storm-workspace.ts",
|
|
137
|
-
".storm-workspace.json",
|
|
138
|
-
".storm-workspace.yaml",
|
|
139
|
-
".storm-workspace.yml",
|
|
140
|
-
".storm-workspace.js",
|
|
141
|
-
".storm-workspace.ts",
|
|
142
|
-
"lerna.json",
|
|
143
|
-
"nx.json",
|
|
144
|
-
"turbo.json",
|
|
145
|
-
"npm-workspace.json",
|
|
146
|
-
"yarn-workspace.json",
|
|
147
|
-
"pnpm-workspace.json",
|
|
148
|
-
"npm-workspace.yaml",
|
|
149
|
-
"yarn-workspace.yaml",
|
|
150
|
-
"pnpm-workspace.yaml",
|
|
151
|
-
"npm-workspace.yml",
|
|
152
|
-
"yarn-workspace.yml",
|
|
153
|
-
"pnpm-workspace.yml",
|
|
154
|
-
"npm-lock.json",
|
|
155
|
-
"yarn-lock.json",
|
|
156
|
-
"pnpm-lock.json",
|
|
157
|
-
"npm-lock.yaml",
|
|
158
|
-
"yarn-lock.yaml",
|
|
159
|
-
"pnpm-lock.yaml",
|
|
160
|
-
"npm-lock.yml",
|
|
161
|
-
"yarn-lock.yml",
|
|
162
|
-
"pnpm-lock.yml",
|
|
163
|
-
"bun.lockb"
|
|
164
|
-
];
|
|
165
|
-
var rootDirectories = [
|
|
166
|
-
".storm-workspace",
|
|
167
|
-
".nx",
|
|
168
|
-
".github",
|
|
169
|
-
".vscode",
|
|
170
|
-
".verdaccio"
|
|
171
|
-
];
|
|
172
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
173
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
174
|
-
return correctPaths(
|
|
175
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
return correctPaths(
|
|
179
|
-
findFolderUp(
|
|
180
|
-
pathInsideMonorepo ?? process.cwd(),
|
|
181
|
-
rootFiles,
|
|
182
|
-
rootDirectories
|
|
183
|
-
)
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
187
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
188
|
-
if (!result) {
|
|
189
|
-
throw new Error(
|
|
190
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
191
|
-
${rootFiles.join(
|
|
192
|
-
"\n"
|
|
193
|
-
)}
|
|
194
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
return result;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
exports.findWorkspaceRoot = findWorkspaceRoot;
|
|
201
|
-
exports.findWorkspaceRootSafe = findWorkspaceRootSafe;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Find the monorepo root directory, searching upwards from `path`.
|
|
3
|
-
*
|
|
4
|
-
* @param pathInsideMonorepo - The path inside the monorepo to start searching from
|
|
5
|
-
* @returns The monorepo root directory
|
|
6
|
-
*/
|
|
7
|
-
declare function findWorkspaceRootSafe(pathInsideMonorepo?: string): string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Find the monorepo root directory, searching upwards from `path`.
|
|
10
|
-
*
|
|
11
|
-
* @param pathInsideMonorepo - The path inside the monorepo to start searching from
|
|
12
|
-
* @returns The monorepo root directory
|
|
13
|
-
*/
|
|
14
|
-
declare function findWorkspaceRoot(pathInsideMonorepo?: string): string;
|
|
15
|
-
|
|
16
|
-
export { findWorkspaceRoot, findWorkspaceRootSafe };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Find the monorepo root directory, searching upwards from `path`.
|
|
3
|
-
*
|
|
4
|
-
* @param pathInsideMonorepo - The path inside the monorepo to start searching from
|
|
5
|
-
* @returns The monorepo root directory
|
|
6
|
-
*/
|
|
7
|
-
declare function findWorkspaceRootSafe(pathInsideMonorepo?: string): string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Find the monorepo root directory, searching upwards from `path`.
|
|
10
|
-
*
|
|
11
|
-
* @param pathInsideMonorepo - The path inside the monorepo to start searching from
|
|
12
|
-
* @returns The monorepo root directory
|
|
13
|
-
*/
|
|
14
|
-
declare function findWorkspaceRoot(pathInsideMonorepo?: string): string;
|
|
15
|
-
|
|
16
|
-
export { findWorkspaceRoot, findWorkspaceRootSafe };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/utils/format-config.ts
|
|
4
|
-
var formatConfig = (name, config = []) => {
|
|
5
|
-
return config.map((config2, index) => {
|
|
6
|
-
if (!config2 || config2.name) {
|
|
7
|
-
return config2 ?? {};
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
...config2,
|
|
11
|
-
name: `Storm Software (${config2.name ? config2.name : name}) #${index + 1}`,
|
|
12
|
-
settings: {
|
|
13
|
-
"import/resolver": "node",
|
|
14
|
-
...config2.settings ?? {}
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.formatConfig = formatConfig;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from '../chunk-2TYJ2VM7.js';
|
|
2
|
-
|
|
3
|
-
// src/utils/format-config.ts
|
|
4
|
-
init_esm_shims();
|
|
5
|
-
var formatConfig = (name, config = []) => {
|
|
6
|
-
return config.map((config2, index) => {
|
|
7
|
-
if (!config2 || config2.name) {
|
|
8
|
-
return config2 ?? {};
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
...config2,
|
|
12
|
-
name: `Storm Software (${config2.name ? config2.name : name}) #${index + 1}`,
|
|
13
|
-
settings: {
|
|
14
|
-
"import/resolver": "node",
|
|
15
|
-
...config2.settings ?? {}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { formatConfig };
|