@csark0812/skeleton 1.1.0 → 1.1.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/cli.js
CHANGED
|
@@ -16536,7 +16536,8 @@ var $visitAsync = visit.visitAsync;
|
|
|
16536
16536
|
// src/audit/config/load.ts
|
|
16537
16537
|
var SCHEMA_CANDIDATES = [
|
|
16538
16538
|
join(dirname2(fileURLToPath2(import.meta.url)), "../../../schemas/config.schema.json"),
|
|
16539
|
-
join(dirname2(fileURLToPath2(import.meta.url)), "../schemas/config.schema.json")
|
|
16539
|
+
join(dirname2(fileURLToPath2(import.meta.url)), "../schemas/config.schema.json"),
|
|
16540
|
+
join(dirname2(fileURLToPath2(import.meta.url)), "../../schemas/config.schema.json")
|
|
16540
16541
|
];
|
|
16541
16542
|
function resolveSchemaPath() {
|
|
16542
16543
|
for (const candidate of SCHEMA_CANDIDATES) {
|
|
@@ -29022,10 +29023,13 @@ function runAudit(options) {
|
|
|
29022
29023
|
|
|
29023
29024
|
// src/customize/resolve.ts
|
|
29024
29025
|
import { existsSync as existsSync11, readFileSync as readFileSync10 } from "node:fs";
|
|
29025
|
-
import { join as join11, relative as relative8 } from "node:path";
|
|
29026
|
+
import { basename as basename2, join as join11, relative as relative8 } from "node:path";
|
|
29026
29027
|
var CUSTOMIZE_PREFIX = "Customize: ";
|
|
29028
|
+
function customizeDir(root2) {
|
|
29029
|
+
return join11(root2, REGISTRY_DIR_REL, "customize");
|
|
29030
|
+
}
|
|
29027
29031
|
function customizePathForSlug(root2, slug2) {
|
|
29028
|
-
return join11(root2,
|
|
29032
|
+
return join11(customizeDir(root2), `${slug2}.md`);
|
|
29029
29033
|
}
|
|
29030
29034
|
function findCustomizeViaRegistry(root2, slug2) {
|
|
29031
29035
|
for (const rel of parseRegistryPaths(root2)) {
|
|
@@ -29036,11 +29040,10 @@ function findCustomizeViaRegistry(root2, slug2) {
|
|
|
29036
29040
|
}
|
|
29037
29041
|
return null;
|
|
29038
29042
|
}
|
|
29039
|
-
function
|
|
29043
|
+
function resolveSlugFile(root2, slug2) {
|
|
29040
29044
|
const direct = customizePathForSlug(root2, slug2);
|
|
29041
29045
|
if (existsSync11(direct)) {
|
|
29042
29046
|
return {
|
|
29043
|
-
slug: slug2,
|
|
29044
29047
|
content: readFileSync10(direct, "utf8"),
|
|
29045
29048
|
path: normalizeRelPath(relative8(root2, direct))
|
|
29046
29049
|
};
|
|
@@ -29049,12 +29052,64 @@ function resolveCustomize(root2, slug2) {
|
|
|
29049
29052
|
if (registryPath) {
|
|
29050
29053
|
const abs = join11(root2, registryPath);
|
|
29051
29054
|
return {
|
|
29052
|
-
slug: slug2,
|
|
29053
29055
|
content: readFileSync10(abs, "utf8"),
|
|
29054
29056
|
path: registryPath
|
|
29055
29057
|
};
|
|
29056
29058
|
}
|
|
29057
|
-
return {
|
|
29059
|
+
return { content: null, path: null };
|
|
29060
|
+
}
|
|
29061
|
+
function alwaysIncludeBasenames(root2) {
|
|
29062
|
+
try {
|
|
29063
|
+
const config = loadConfig(root2);
|
|
29064
|
+
return config.customize?.alwaysInclude ?? [];
|
|
29065
|
+
} catch {
|
|
29066
|
+
return [];
|
|
29067
|
+
}
|
|
29068
|
+
}
|
|
29069
|
+
function readAlwaysInclude(root2, basenames, skipBasename) {
|
|
29070
|
+
const parts = [];
|
|
29071
|
+
const paths = [];
|
|
29072
|
+
const dir = customizeDir(root2);
|
|
29073
|
+
for (const name of basenames) {
|
|
29074
|
+
const file = basename2(name);
|
|
29075
|
+
if (skipBasename && file === skipBasename)
|
|
29076
|
+
continue;
|
|
29077
|
+
const abs = join11(dir, file);
|
|
29078
|
+
if (!existsSync11(abs))
|
|
29079
|
+
continue;
|
|
29080
|
+
parts.push(readFileSync10(abs, "utf8").trimEnd());
|
|
29081
|
+
paths.push(normalizeRelPath(relative8(root2, abs)));
|
|
29082
|
+
}
|
|
29083
|
+
return { parts, paths };
|
|
29084
|
+
}
|
|
29085
|
+
function resolveCustomize(root2, slug2) {
|
|
29086
|
+
const slugFile = resolveSlugFile(root2, slug2);
|
|
29087
|
+
const alwaysNames = alwaysIncludeBasenames(root2);
|
|
29088
|
+
const skip = slugFile.path != null ? basename2(slugFile.path) : null;
|
|
29089
|
+
const always = readAlwaysInclude(root2, alwaysNames, skip);
|
|
29090
|
+
const parts = [];
|
|
29091
|
+
const included = [];
|
|
29092
|
+
if (slugFile.content != null && slugFile.content.trim().length > 0) {
|
|
29093
|
+
parts.push(slugFile.content.trimEnd());
|
|
29094
|
+
if (slugFile.path)
|
|
29095
|
+
included.push(slugFile.path);
|
|
29096
|
+
}
|
|
29097
|
+
parts.push(...always.parts);
|
|
29098
|
+
included.push(...always.paths);
|
|
29099
|
+
if (parts.length === 0) {
|
|
29100
|
+
return { slug: slug2, content: null, path: slugFile.path, included: [] };
|
|
29101
|
+
}
|
|
29102
|
+
return {
|
|
29103
|
+
slug: slug2,
|
|
29104
|
+
content: parts.join(`
|
|
29105
|
+
|
|
29106
|
+
---
|
|
29107
|
+
|
|
29108
|
+
`) + `
|
|
29109
|
+
`,
|
|
29110
|
+
path: slugFile.path ?? always.paths[0] ?? null,
|
|
29111
|
+
included
|
|
29112
|
+
};
|
|
29058
29113
|
}
|
|
29059
29114
|
function resolveCustomizeFromRoot(slug2, startDir) {
|
|
29060
29115
|
const root2 = findRepoRoot(startDir);
|
|
@@ -29610,7 +29665,7 @@ function registerPath(options) {
|
|
|
29610
29665
|
|
|
29611
29666
|
// src/validate/changed.ts
|
|
29612
29667
|
import { existsSync as existsSync17, readFileSync as readFileSync14 } from "node:fs";
|
|
29613
|
-
import { basename as
|
|
29668
|
+
import { basename as basename3, extname, join as join17 } from "node:path";
|
|
29614
29669
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
29615
29670
|
|
|
29616
29671
|
// src/validate/git-diff.ts
|
|
@@ -29641,7 +29696,7 @@ var COMMAND_CONFIG_NAMES = new Set(["package.json", "project.json"]);
|
|
|
29641
29696
|
function bucketFor(relPath2, root2) {
|
|
29642
29697
|
const normalized = normalizeRelPath(relPath2);
|
|
29643
29698
|
const ext = extname(normalized).toLowerCase();
|
|
29644
|
-
const name =
|
|
29699
|
+
const name = basename3(normalized);
|
|
29645
29700
|
if (SKIP_EXTENSIONS.has(ext))
|
|
29646
29701
|
return "skip";
|
|
29647
29702
|
if (COMMAND_CONFIG_NAMES.has(name))
|