@storm-software/eslint 0.170.155 → 0.170.156
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/index.cjs +12 -21953
- package/dist/index.js +3 -11
- package/dist/preset.cjs +81 -21649
- package/dist/preset.js +344 -8
- package/dist/types.cjs +10 -0
- package/dist/types.js +1 -4
- package/dist/utils/combine.cjs +0 -1
- package/dist/utils/combine.js +0 -4
- package/dist/utils/correct-paths.cjs +19 -20
- package/dist/utils/correct-paths.js +216 -2
- package/dist/utils/find-workspace-root.cjs +12 -117
- package/dist/utils/find-workspace-root.js +93 -3
- package/dist/utils/format-config.cjs +1 -2
- package/dist/utils/format-config.js +1 -5
- package/dist/utils/helpers.cjs +5 -6
- package/dist/utils/helpers.js +72 -2
- package/dist/utils/package-manager.cjs +6 -187
- package/dist/utils/package-manager.js +16 -4
- package/dist/utils/tsconfig.cjs +14 -268
- package/dist/utils/tsconfig.js +40 -4
- package/package.json +10 -10
- 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/src-TAWYAYRW.js +0 -887
- package/dist/src-XRFRLUCW.js +0 -57
- package/dist/src-YPCQHGJY.js +0 -91
package/dist/chunk-F7ZJ6N35.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { findWorkspaceRoot } from './chunk-XFFMMX6A.js';
|
|
2
|
-
import { relative, joinPaths } from './chunk-I4ZWVHOG.js';
|
|
3
|
-
import { init_esm_shims } from './chunk-2TYJ2VM7.js';
|
|
4
|
-
import { existsSync, statSync } from 'node:fs';
|
|
5
|
-
|
|
6
|
-
// src/utils/tsconfig.ts
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
function getTsConfigPath(tsconfigPath, type) {
|
|
9
|
-
const workspaceRoot = findWorkspaceRoot();
|
|
10
|
-
if (tsconfigPath && existsSync(tsconfigPath) && statSync(tsconfigPath).isFile()) {
|
|
11
|
-
return relative(workspaceRoot, tsconfigPath);
|
|
12
|
-
}
|
|
13
|
-
let result = checkTsConfigPath(process.cwd());
|
|
14
|
-
if (result) {
|
|
15
|
-
return relative(workspaceRoot, joinPaths(process.cwd(), result));
|
|
16
|
-
}
|
|
17
|
-
result = checkTsConfigPath(workspaceRoot);
|
|
18
|
-
if (result) {
|
|
19
|
-
return relative(workspaceRoot, joinPaths(workspaceRoot, result));
|
|
20
|
-
}
|
|
21
|
-
console.warn(
|
|
22
|
-
`No tsconfig.json found${tsconfigPath ? ` provided: ${tsconfigPath}` : ""}. Consider adding a tsconfig.json file to your project's ESLint configuration.`
|
|
23
|
-
);
|
|
24
|
-
return workspaceRoot?.replace(/\\/g, "/").replaceAll(/\/$/g, "") === process.cwd().replace(/\\/g, "/").replaceAll(/\/$/g, "") ? "tsconfig.base.json" : type ? `tsconfig.${type}.json` : "tsconfig.json";
|
|
25
|
-
}
|
|
26
|
-
function checkTsConfigPath(root) {
|
|
27
|
-
if (existsSync(joinPaths(root, "tsconfig.json"))) {
|
|
28
|
-
return "tsconfig.json";
|
|
29
|
-
} else if (existsSync(joinPaths(root, "tsconfig.base.json"))) {
|
|
30
|
-
return "tsconfig.base.json";
|
|
31
|
-
} else if (existsSync(joinPaths(root, "tsconfig.app.json"))) {
|
|
32
|
-
return "tsconfig.app.json";
|
|
33
|
-
} else if (existsSync(joinPaths(root, "tsconfig.lib.json"))) {
|
|
34
|
-
return "tsconfig.lib.json";
|
|
35
|
-
} else if (existsSync(joinPaths(root, "tsconfig.eslint.json"))) {
|
|
36
|
-
return "tsconfig.eslint.json";
|
|
37
|
-
} else if (existsSync(joinPaths(root, "tsconfig.lint.json"))) {
|
|
38
|
-
return "tsconfig.lint.json";
|
|
39
|
-
}
|
|
40
|
-
return void 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { checkTsConfigPath, getTsConfigPath };
|
package/dist/chunk-I4ZWVHOG.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-2TYJ2VM7.js';
|
|
2
|
-
|
|
3
|
-
// src/utils/correct-paths.ts
|
|
4
|
-
init_esm_shims();
|
|
5
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
6
|
-
function normalizeWindowsPath(input = "") {
|
|
7
|
-
if (!input) {
|
|
8
|
-
return input;
|
|
9
|
-
}
|
|
10
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
11
|
-
}
|
|
12
|
-
var _UNC_REGEX = /^[/\\]{2}/;
|
|
13
|
-
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
14
|
-
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
15
|
-
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
16
|
-
var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
17
|
-
var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
18
|
-
var sep = "/";
|
|
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
|
-
var joinPaths = function(...segments) {
|
|
49
|
-
let path = "";
|
|
50
|
-
for (const seg of segments) {
|
|
51
|
-
if (!seg) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (path.length > 0) {
|
|
55
|
-
const pathTrailing = path[path.length - 1] === "/";
|
|
56
|
-
const segLeading = seg[0] === "/";
|
|
57
|
-
const both = pathTrailing && segLeading;
|
|
58
|
-
if (both) {
|
|
59
|
-
path += seg.slice(1);
|
|
60
|
-
} else {
|
|
61
|
-
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
path += seg;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return correctPaths(path);
|
|
68
|
-
};
|
|
69
|
-
function cwd() {
|
|
70
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
71
|
-
return process.cwd().replace(/\\/g, "/");
|
|
72
|
-
}
|
|
73
|
-
return "/";
|
|
74
|
-
}
|
|
75
|
-
var resolve = function(...arguments_) {
|
|
76
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
77
|
-
let resolvedPath = "";
|
|
78
|
-
let resolvedAbsolute = false;
|
|
79
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
80
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
81
|
-
if (!path || path.length === 0) {
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
85
|
-
resolvedAbsolute = isAbsolute(path);
|
|
86
|
-
}
|
|
87
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
88
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
89
|
-
return `/${resolvedPath}`;
|
|
90
|
-
}
|
|
91
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
92
|
-
};
|
|
93
|
-
function normalizeString(path, allowAboveRoot) {
|
|
94
|
-
let res = "";
|
|
95
|
-
let lastSegmentLength = 0;
|
|
96
|
-
let lastSlash = -1;
|
|
97
|
-
let dots = 0;
|
|
98
|
-
let char = null;
|
|
99
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
100
|
-
if (index < path.length) {
|
|
101
|
-
char = path[index];
|
|
102
|
-
} else if (char === "/") {
|
|
103
|
-
break;
|
|
104
|
-
} else {
|
|
105
|
-
char = "/";
|
|
106
|
-
}
|
|
107
|
-
if (char === "/") {
|
|
108
|
-
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
109
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
110
|
-
if (res.length > 2) {
|
|
111
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
112
|
-
if (lastSlashIndex === -1) {
|
|
113
|
-
res = "";
|
|
114
|
-
lastSegmentLength = 0;
|
|
115
|
-
} else {
|
|
116
|
-
res = res.slice(0, lastSlashIndex);
|
|
117
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
118
|
-
}
|
|
119
|
-
lastSlash = index;
|
|
120
|
-
dots = 0;
|
|
121
|
-
continue;
|
|
122
|
-
} else if (res.length > 0) {
|
|
123
|
-
res = "";
|
|
124
|
-
lastSegmentLength = 0;
|
|
125
|
-
lastSlash = index;
|
|
126
|
-
dots = 0;
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (allowAboveRoot) {
|
|
131
|
-
res += res.length > 0 ? "/.." : "..";
|
|
132
|
-
lastSegmentLength = 2;
|
|
133
|
-
}
|
|
134
|
-
} else {
|
|
135
|
-
if (res.length > 0) {
|
|
136
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
137
|
-
} else {
|
|
138
|
-
res = path.slice(lastSlash + 1, index);
|
|
139
|
-
}
|
|
140
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
141
|
-
}
|
|
142
|
-
lastSlash = index;
|
|
143
|
-
dots = 0;
|
|
144
|
-
} else if (char === "." && dots !== -1) {
|
|
145
|
-
++dots;
|
|
146
|
-
} else {
|
|
147
|
-
dots = -1;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return res;
|
|
151
|
-
}
|
|
152
|
-
var isAbsolute = function(p) {
|
|
153
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
154
|
-
};
|
|
155
|
-
var toNamespacedPath = function(p) {
|
|
156
|
-
return normalizeWindowsPath(p);
|
|
157
|
-
};
|
|
158
|
-
var extname = function(p) {
|
|
159
|
-
if (p === "..") return "";
|
|
160
|
-
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
161
|
-
return match && match[1] || "";
|
|
162
|
-
};
|
|
163
|
-
var relative = function(from, to) {
|
|
164
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
165
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
166
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
167
|
-
return _to.join("/");
|
|
168
|
-
}
|
|
169
|
-
const _fromCopy = [..._from];
|
|
170
|
-
for (const segment of _fromCopy) {
|
|
171
|
-
if (_to[0] !== segment) {
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
_from.shift();
|
|
175
|
-
_to.shift();
|
|
176
|
-
}
|
|
177
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
178
|
-
};
|
|
179
|
-
var dirname = function(p) {
|
|
180
|
-
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
181
|
-
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
182
|
-
segments[0] += "/";
|
|
183
|
-
}
|
|
184
|
-
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
185
|
-
};
|
|
186
|
-
var format = function(p) {
|
|
187
|
-
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
188
|
-
const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
189
|
-
Boolean
|
|
190
|
-
);
|
|
191
|
-
return normalizeWindowsPath(
|
|
192
|
-
p.root ? resolve(...segments) : segments.join("/")
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
var basename = function(p, extension) {
|
|
196
|
-
const segments = normalizeWindowsPath(p).split("/");
|
|
197
|
-
let lastSegment = "";
|
|
198
|
-
for (let i = segments.length - 1; i >= 0; i--) {
|
|
199
|
-
const val = segments[i];
|
|
200
|
-
if (val) {
|
|
201
|
-
lastSegment = val;
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
206
|
-
};
|
|
207
|
-
var parse = function(p) {
|
|
208
|
-
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
209
|
-
const base = basename(p);
|
|
210
|
-
const extension = extname(base);
|
|
211
|
-
return {
|
|
212
|
-
root,
|
|
213
|
-
dir: dirname(p),
|
|
214
|
-
base,
|
|
215
|
-
ext: extension,
|
|
216
|
-
name: base.slice(0, base.length - extension.length)
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath };
|
package/dist/chunk-JBIA43L4.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-2TYJ2VM7.js';
|
|
2
|
-
import { isPackageExists } from 'local-pkg';
|
|
3
|
-
import process from 'node:process';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
|
|
6
|
-
// src/utils/helpers.ts
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
var scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
9
|
-
var isCwdInScope = isPackageExists("@storm-software/eslint");
|
|
10
|
-
var parserPlain = {
|
|
11
|
-
meta: {
|
|
12
|
-
name: "parser-plain"
|
|
13
|
-
},
|
|
14
|
-
parseForESLint: (code) => ({
|
|
15
|
-
ast: {
|
|
16
|
-
body: [],
|
|
17
|
-
comments: [],
|
|
18
|
-
loc: { end: code.length, start: 0 },
|
|
19
|
-
range: [0, code.length],
|
|
20
|
-
tokens: [],
|
|
21
|
-
type: "Program"
|
|
22
|
-
},
|
|
23
|
-
scopeManager: null,
|
|
24
|
-
services: { isPlain: true },
|
|
25
|
-
visitorKeys: {
|
|
26
|
-
Program: []
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
};
|
|
30
|
-
function isInGitHooksOrLintStaged() {
|
|
31
|
-
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged") || process.env.npm_lifecycle_script?.startsWith("lefthook") || process.env.npm_lifecycle_script === "push");
|
|
32
|
-
}
|
|
33
|
-
function isInEditorEnv() {
|
|
34
|
-
if (process.env.CI) return false;
|
|
35
|
-
if (isInGitHooksOrLintStaged()) return false;
|
|
36
|
-
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
|
|
37
|
-
}
|
|
38
|
-
async function interopDefault(m) {
|
|
39
|
-
const resolved = await m;
|
|
40
|
-
return resolved.default || resolved;
|
|
41
|
-
}
|
|
42
|
-
function isPackageInScope(name) {
|
|
43
|
-
return isPackageExists(name, { paths: [scopeUrl] });
|
|
44
|
-
}
|
|
45
|
-
async function ensurePackages(packages) {
|
|
46
|
-
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false)
|
|
47
|
-
return;
|
|
48
|
-
const nonExistingPackages = packages.filter(
|
|
49
|
-
(i) => i && !isPackageInScope(i)
|
|
50
|
-
);
|
|
51
|
-
if (nonExistingPackages.length === 0) return;
|
|
52
|
-
const p = await import('@clack/prompts');
|
|
53
|
-
const result = await p.confirm({
|
|
54
|
-
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(
|
|
55
|
-
", "
|
|
56
|
-
)}. Do you want to install them?`
|
|
57
|
-
});
|
|
58
|
-
if (result)
|
|
59
|
-
await import('@antfu/install-pkg').then(
|
|
60
|
-
(i) => i.installPackage(nonExistingPackages, { dev: true })
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
function renameRules(rules, map) {
|
|
64
|
-
return Object.fromEntries(
|
|
65
|
-
Object.entries(rules).map(([key, value]) => {
|
|
66
|
-
for (const [from, to] of Object.entries(map)) {
|
|
67
|
-
if (key.startsWith(`${from}/`))
|
|
68
|
-
return [to + key.slice(from.length), value];
|
|
69
|
-
}
|
|
70
|
-
return [key, value];
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export { ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, renameRules };
|
package/dist/chunk-T6GDWDAB.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-2TYJ2VM7.js';
|
|
2
|
-
|
|
3
|
-
// ../package-constants/src/globs.ts
|
|
4
|
-
init_esm_shims();
|
|
5
|
-
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
6
|
-
var GLOB_SRC_FILE = `*.${GLOB_SRC_EXT}`;
|
|
7
|
-
var GLOB_SRC = `**/${GLOB_SRC_FILE}`;
|
|
8
|
-
var GLOB_JSX_EXT = "?([cm])jsx";
|
|
9
|
-
var GLOB_JSX_FILE = `*.${GLOB_JSX_EXT}`;
|
|
10
|
-
var GLOB_JSX = `**/${GLOB_JSX_FILE}`;
|
|
11
|
-
var GLOB_TS_EXT = "?([cm])ts";
|
|
12
|
-
var GLOB_TS_FILE = `*.${GLOB_TS_EXT}`;
|
|
13
|
-
var GLOB_TS = `**/${GLOB_TS_FILE}`;
|
|
14
|
-
var GLOB_TSX_EXT = "?([cm])tsx";
|
|
15
|
-
var GLOB_TSX_FILE = `*.${GLOB_TSX_EXT}`;
|
|
16
|
-
var GLOB_TSX = `**/${GLOB_TSX_FILE}`;
|
|
17
|
-
var GLOB_CSS_EXT = "css";
|
|
18
|
-
var GLOB_CSS_FILE = `*.${GLOB_CSS_EXT}`;
|
|
19
|
-
var GLOB_CSS = `**/${GLOB_CSS_FILE}`;
|
|
20
|
-
var GLOB_POSTCSS_EXT = "{p,post}css";
|
|
21
|
-
var GLOB_POSTCSS_FILE = `*.${GLOB_POSTCSS_EXT}`;
|
|
22
|
-
var GLOB_POSTCSS = `**/${GLOB_POSTCSS_FILE}`;
|
|
23
|
-
var GLOB_LESS_EXT = "less";
|
|
24
|
-
var GLOB_LESS_FILE = `*.${GLOB_LESS_EXT}`;
|
|
25
|
-
var GLOB_LESS = `**/${GLOB_LESS_FILE}`;
|
|
26
|
-
var GLOB_SCSS_EXT = "scss";
|
|
27
|
-
var GLOB_SCSS_FILE = `*.${GLOB_SCSS_EXT}`;
|
|
28
|
-
var GLOB_SCSS = `**/${GLOB_SCSS_FILE}`;
|
|
29
|
-
var GLOB_JSON_EXT = "json";
|
|
30
|
-
var GLOB_JSON_FILE = `*.${GLOB_JSON_EXT}`;
|
|
31
|
-
var GLOB_JSON = `**/${GLOB_JSON_FILE}`;
|
|
32
|
-
var GLOB_JSON5_EXT = "json5";
|
|
33
|
-
var GLOB_JSON5_FILE = `*.${GLOB_JSON5_EXT}`;
|
|
34
|
-
var GLOB_JSON5 = `**/${GLOB_JSON5_FILE}`;
|
|
35
|
-
var GLOB_JSONC_EXT = "jsonc";
|
|
36
|
-
var GLOB_JSONC_FILE = `*.${GLOB_JSONC_EXT}`;
|
|
37
|
-
var GLOB_JSONC = `**/${GLOB_JSONC_FILE}`;
|
|
38
|
-
var GLOB_MARKDOWN_EXT = "md";
|
|
39
|
-
var GLOB_MARKDOWN_FILE = `*.${GLOB_MARKDOWN_EXT}`;
|
|
40
|
-
var GLOB_MARKDOWN = `**/${GLOB_MARKDOWN_FILE}`;
|
|
41
|
-
var GLOB_MDX_EXT = "mdx";
|
|
42
|
-
var GLOB_MDX_FILE = `*.${GLOB_MDX_EXT}`;
|
|
43
|
-
var GLOB_MDX = `**/${GLOB_MDX_FILE}`;
|
|
44
|
-
var GLOB_MARKDOWN_IN_MARKDOWN = `${GLOB_MARKDOWN}/${GLOB_MARKDOWN_FILE}`;
|
|
45
|
-
var GLOB_YAML_EXT = "y?(a)ml";
|
|
46
|
-
var GLOB_YAML_FILE = `*.${GLOB_YAML_EXT}`;
|
|
47
|
-
var GLOB_YAML = `**/${GLOB_YAML_FILE}`;
|
|
48
|
-
var GLOB_TOML_EXT = "toml";
|
|
49
|
-
var GLOB_TOML_FILE = `*.${GLOB_TOML_EXT}`;
|
|
50
|
-
var GLOB_TOML = `**/${GLOB_TOML_FILE}`;
|
|
51
|
-
var GLOB_XML_EXT = "xml";
|
|
52
|
-
var GLOB_XML_FILE = `*.${GLOB_XML_EXT}`;
|
|
53
|
-
var GLOB_XML = `**/${GLOB_XML_FILE}`;
|
|
54
|
-
var GLOB_SVG_EXT = "svg";
|
|
55
|
-
var GLOB_SVG_FILE = `*.${GLOB_SVG_EXT}`;
|
|
56
|
-
var GLOB_SVG = `**/${GLOB_SVG_FILE}`;
|
|
57
|
-
var GLOB_HTML_EXT = "htm?(l)";
|
|
58
|
-
var GLOB_HTML_FILE = `*.${GLOB_HTML_EXT}`;
|
|
59
|
-
var GLOB_HTML = `**/${GLOB_HTML_FILE}`;
|
|
60
|
-
var GLOB_ASTRO_EXT = "astro";
|
|
61
|
-
var GLOB_ASTRO_FILE = `*.${GLOB_ASTRO_EXT}`;
|
|
62
|
-
var GLOB_ASTRO = `**/${GLOB_ASTRO_FILE}`;
|
|
63
|
-
var GLOB_ASTRO_TS = `${GLOB_ASTRO}/*.ts`;
|
|
64
|
-
var GLOB_GRAPHQL_EXT = "{g,graph}ql";
|
|
65
|
-
var GLOB_GRAPHQL_FILE = `*.${GLOB_GRAPHQL_EXT}`;
|
|
66
|
-
var GLOB_GRAPHQL = `**/${GLOB_GRAPHQL_FILE}`;
|
|
67
|
-
var GLOB_TESTS = [
|
|
68
|
-
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
69
|
-
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
70
|
-
`**/*.test.${GLOB_SRC_EXT}`,
|
|
71
|
-
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
72
|
-
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
73
|
-
];
|
|
74
|
-
var GLOB_EXCLUDE = [
|
|
75
|
-
"**/.git",
|
|
76
|
-
"**/node_modules",
|
|
77
|
-
"**/dist",
|
|
78
|
-
"**/tmp",
|
|
79
|
-
"**/coverage",
|
|
80
|
-
"**/bench",
|
|
81
|
-
"**/__snapshots__",
|
|
82
|
-
"**/__test__",
|
|
83
|
-
"**/__mocks__",
|
|
84
|
-
"**/__generated__",
|
|
85
|
-
"**/.wrangler",
|
|
86
|
-
"**/.rolldown",
|
|
87
|
-
"**/.docusaurus",
|
|
88
|
-
"**/.tamagui",
|
|
89
|
-
"**/tamagui.css",
|
|
90
|
-
"**/.nx",
|
|
91
|
-
"**/.next",
|
|
92
|
-
"**/.storm",
|
|
93
|
-
"**/.powerlines",
|
|
94
|
-
"**/.shell-shock",
|
|
95
|
-
"**/.earthquake",
|
|
96
|
-
"**/.aftershock",
|
|
97
|
-
"**/workbox*.js",
|
|
98
|
-
"**/sw*.js",
|
|
99
|
-
"**/service-worker.js",
|
|
100
|
-
"**/fallback*.js",
|
|
101
|
-
"**/ios",
|
|
102
|
-
"**/.android",
|
|
103
|
-
"**/.DS_Store",
|
|
104
|
-
"**/Thumbs.db",
|
|
105
|
-
"**/.cspellcache",
|
|
106
|
-
"**/package-lock.*",
|
|
107
|
-
"**/npm-lock.*",
|
|
108
|
-
"**/pnpm-lock.*",
|
|
109
|
-
"**/bun.lockb",
|
|
110
|
-
"**/cargo.lock",
|
|
111
|
-
"**/next-env.d.ts",
|
|
112
|
-
"**/CODEOWNERS",
|
|
113
|
-
"**/yarn.lock",
|
|
114
|
-
"**/jest.preset.{js,ts,cjs,cts,mjs,mts,json}",
|
|
115
|
-
"**/vitest.preset.{js,ts,cjs,cts,mjs,mts,json}",
|
|
116
|
-
"**/jest.config.{js,ts,cjs,cts,mjs,mts,json}",
|
|
117
|
-
"**/vitest.config.{js,ts,cjs,cts,mjs,mts,json}",
|
|
118
|
-
"**/vitest.workspace.{js,ts,cjs,cts,mjs,mts,json}",
|
|
119
|
-
"**/*.spec.{ts,tsx}",
|
|
120
|
-
"**/*.test.{ts,tsx}",
|
|
121
|
-
"**/temp",
|
|
122
|
-
"**/.temp",
|
|
123
|
-
"**/.output",
|
|
124
|
-
"**/.history",
|
|
125
|
-
"**/.vitepress/cache",
|
|
126
|
-
"**/.nuxt",
|
|
127
|
-
"**/.svelte-kit",
|
|
128
|
-
"**/.vercel",
|
|
129
|
-
"**/.changeset",
|
|
130
|
-
"**/.idea",
|
|
131
|
-
"**/.cache",
|
|
132
|
-
"**/.vite-inspect",
|
|
133
|
-
"**/.yarn",
|
|
134
|
-
"**/*.min.*",
|
|
135
|
-
"**/CHANGELOG*.md",
|
|
136
|
-
"**/CONTRIBUTING.md",
|
|
137
|
-
"**/SECURITY.md",
|
|
138
|
-
"**/CODE_OF_CONDUCT.md",
|
|
139
|
-
"**/PULL_REQUEST_TEMPLATE.md",
|
|
140
|
-
"**/LICENSE*",
|
|
141
|
-
"**/auto-import?(s).d.ts",
|
|
142
|
-
"**/components.d.ts",
|
|
143
|
-
"**/vite.config.*.timestamp-*",
|
|
144
|
-
"**/webpack.config.*.timestamp-*",
|
|
145
|
-
"**/rollup.config.*.timestamp-*",
|
|
146
|
-
"**/nx/**/schema.d.ts",
|
|
147
|
-
"**/nx/**/schema.json",
|
|
148
|
-
"**/nx/**/schema.md",
|
|
149
|
-
"**/nx/**/*.schema.d.ts",
|
|
150
|
-
"**/nx/**/*.schema.json",
|
|
151
|
-
"**/nx/**/*.schema.md",
|
|
152
|
-
"**/nx/**/generators/**/files",
|
|
153
|
-
".agents/**/*",
|
|
154
|
-
"**/.agents/**/*",
|
|
155
|
-
".claude/**/*",
|
|
156
|
-
"**/.claude/**/*",
|
|
157
|
-
".codex/**/*",
|
|
158
|
-
"**/.codex/**/*",
|
|
159
|
-
".cursor/**/*",
|
|
160
|
-
"**/.cursor/**/*",
|
|
161
|
-
".opencode/**/*",
|
|
162
|
-
"**/.opencode/**/*",
|
|
163
|
-
".nx/**/*",
|
|
164
|
-
"**/.nx/**/*"
|
|
165
|
-
];
|
|
166
|
-
|
|
167
|
-
export { GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_SRC_FILE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML };
|
package/dist/chunk-XFFMMX6A.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { correctPaths } from './chunk-I4ZWVHOG.js';
|
|
2
|
-
import { init_esm_shims } from './chunk-2TYJ2VM7.js';
|
|
3
|
-
import { existsSync } from 'node:fs';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
|
|
6
|
-
// src/utils/find-workspace-root.ts
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
9
|
-
var depth = 0;
|
|
10
|
-
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
11
|
-
const _startPath = startPath ?? process.cwd();
|
|
12
|
-
if (endDirectoryNames.some(
|
|
13
|
-
(endDirName) => existsSync(join(_startPath, endDirName))
|
|
14
|
-
)) {
|
|
15
|
-
return _startPath;
|
|
16
|
-
}
|
|
17
|
-
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
18
|
-
return _startPath;
|
|
19
|
-
}
|
|
20
|
-
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
21
|
-
const parent = join(_startPath, "..");
|
|
22
|
-
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
23
|
-
}
|
|
24
|
-
return void 0;
|
|
25
|
-
}
|
|
26
|
-
var rootFiles = [
|
|
27
|
-
"storm-workspace.json",
|
|
28
|
-
"storm-workspace.json",
|
|
29
|
-
"storm-workspace.yaml",
|
|
30
|
-
"storm-workspace.yml",
|
|
31
|
-
"storm-workspace.js",
|
|
32
|
-
"storm-workspace.ts",
|
|
33
|
-
".storm-workspace.json",
|
|
34
|
-
".storm-workspace.yaml",
|
|
35
|
-
".storm-workspace.yml",
|
|
36
|
-
".storm-workspace.js",
|
|
37
|
-
".storm-workspace.ts",
|
|
38
|
-
"lerna.json",
|
|
39
|
-
"nx.json",
|
|
40
|
-
"turbo.json",
|
|
41
|
-
"npm-workspace.json",
|
|
42
|
-
"yarn-workspace.json",
|
|
43
|
-
"pnpm-workspace.json",
|
|
44
|
-
"npm-workspace.yaml",
|
|
45
|
-
"yarn-workspace.yaml",
|
|
46
|
-
"pnpm-workspace.yaml",
|
|
47
|
-
"npm-workspace.yml",
|
|
48
|
-
"yarn-workspace.yml",
|
|
49
|
-
"pnpm-workspace.yml",
|
|
50
|
-
"npm-lock.json",
|
|
51
|
-
"yarn-lock.json",
|
|
52
|
-
"pnpm-lock.json",
|
|
53
|
-
"npm-lock.yaml",
|
|
54
|
-
"yarn-lock.yaml",
|
|
55
|
-
"pnpm-lock.yaml",
|
|
56
|
-
"npm-lock.yml",
|
|
57
|
-
"yarn-lock.yml",
|
|
58
|
-
"pnpm-lock.yml",
|
|
59
|
-
"bun.lockb"
|
|
60
|
-
];
|
|
61
|
-
var rootDirectories = [
|
|
62
|
-
".storm-workspace",
|
|
63
|
-
".nx",
|
|
64
|
-
".github",
|
|
65
|
-
".vscode",
|
|
66
|
-
".verdaccio"
|
|
67
|
-
];
|
|
68
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
69
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
70
|
-
return correctPaths(
|
|
71
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
return correctPaths(
|
|
75
|
-
findFolderUp(
|
|
76
|
-
pathInsideMonorepo ?? process.cwd(),
|
|
77
|
-
rootFiles,
|
|
78
|
-
rootDirectories
|
|
79
|
-
)
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
83
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
84
|
-
if (!result) {
|
|
85
|
-
throw new Error(
|
|
86
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
87
|
-
${rootFiles.join(
|
|
88
|
-
"\n"
|
|
89
|
-
)}
|
|
90
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { findWorkspaceRoot, findWorkspaceRootSafe };
|