@alint-js/config 0.2.0 → 0.3.1
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/index.mjs +7 -4
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -41,7 +41,8 @@ function getStatsDir(env = process.env, options = {}) {
|
|
|
41
41
|
return join$1(resolveAlintHome(env, options), "stats");
|
|
42
42
|
}
|
|
43
43
|
function resolveAlintHome(env, options) {
|
|
44
|
-
|
|
44
|
+
const configHome = env.XDG_CONFIG_HOME ?? resolveDefaultConfigHome(options);
|
|
45
|
+
return join$1(configHome, "alint");
|
|
45
46
|
}
|
|
46
47
|
function resolveDefaultConfigHome(options) {
|
|
47
48
|
if (options.isMacOS ?? process.platform === "darwin") return join$1(homedir(), ".config");
|
|
@@ -222,7 +223,7 @@ function toScopedRelativePath(cwd, filePath) {
|
|
|
222
223
|
}
|
|
223
224
|
//#endregion
|
|
224
225
|
//#region src/agents/presets/basic-structured.ts
|
|
225
|
-
const maxSupplementalFileBytes =
|
|
226
|
+
const maxSupplementalFileBytes = 65536;
|
|
226
227
|
const maxSupplementalFiles = 12;
|
|
227
228
|
function createBasicStructuredRule(rule) {
|
|
228
229
|
return {
|
|
@@ -661,13 +662,15 @@ function createLockEntry(installed, options) {
|
|
|
661
662
|
async function install(options) {
|
|
662
663
|
const { name, segments, version } = options.specifier;
|
|
663
664
|
const npmRegistry = options.npmRegistry.endsWith("/") ? options.npmRegistry : `${options.npmRegistry}/`;
|
|
664
|
-
const
|
|
665
|
+
const metadataUrl = `${npmRegistry.replace(/\/$/u, "")}/${options.specifier.registryPath}`;
|
|
666
|
+
const dist = (await ofetch(metadataUrl)).versions?.[version]?.dist;
|
|
665
667
|
if (dist?.tarball === void 0) throw new Error(`Npm metadata for "${name}" does not include a tarball for version ${version}.`);
|
|
666
668
|
if (dist.integrity === void 0 || dist.integrity.trim() === "") throw new Error(`Npm metadata for "${name}" does not include integrity for version ${version}.`);
|
|
667
669
|
const storePath = getProjectPluginStorePath(options.cwd);
|
|
668
670
|
const packageDir = join(storePath, ...segments, version, "package");
|
|
669
671
|
if (!isPathInside(resolve(packageDir), resolve(storePath))) throw new Error(`Static plugin package "${name}" resolves outside the project plugin store.`);
|
|
670
|
-
const
|
|
672
|
+
const packageParentDir = dirname(packageDir);
|
|
673
|
+
const stagingPackageDir = join(packageParentDir, `package-staging-${randomUUID()}`);
|
|
671
674
|
let relativeEntry;
|
|
672
675
|
try {
|
|
673
676
|
const tarball = Buffer.from(await ofetch(dist.tarball, { responseType: "arrayBuffer" }));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alint-js/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.mts",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"apeira": "^0.0.7",
|
|
19
19
|
"c12": "^4.0.0-beta.5",
|
|
20
20
|
"chokidar": "^5.0.0",
|
|
21
|
-
"es-toolkit": "^1.
|
|
21
|
+
"es-toolkit": "^1.50.0",
|
|
22
22
|
"jiti": "^2.7.0",
|
|
23
|
-
"minimatch": "^10.2.
|
|
23
|
+
"minimatch": "^10.2.6",
|
|
24
24
|
"ofetch": "^1.5.1",
|
|
25
25
|
"pathe": "^2.0.3",
|
|
26
26
|
"resolve.exports": "2.0.3",
|
|
27
|
-
"smol-toml": "^1.7.
|
|
27
|
+
"smol-toml": "^1.7.1",
|
|
28
28
|
"tar-stream": "^3.2.0",
|
|
29
29
|
"valibot": "^1.4.2",
|
|
30
30
|
"xdg-basedir": "^5.1.0",
|
|
31
|
-
"@alint-js/core": "0.
|
|
32
|
-
"@alint-js/tools-fs": "0.
|
|
31
|
+
"@alint-js/core": "0.3.1",
|
|
32
|
+
"@alint-js/tools-fs": "0.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/tar-stream": "^3.1.4",
|