@mark1russell7/conventions 0.38.0 → 0.38.2
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 +2 -0
- package/build/cli.js +1 -1
- package/build/index.d.ts +12 -26
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/{run-CWh6SR2w.js → run-DJGaAV-C.js} +59 -149
- package/build/run-DJGaAV-C.js.map +1 -0
- package/build/workspace-BMtl0EQf.d.ts +33 -0
- package/build/workspace-BMtl0EQf.d.ts.map +1 -0
- package/build/workspace-Cx7p7bWn.js +156 -0
- package/build/workspace-Cx7p7bWn.js.map +1 -0
- package/build/workspace.d.ts +2 -0
- package/build/workspace.js +1 -0
- package/package.json +13 -9
- package/build/run-CWh6SR2w.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function gives a regular expression for a glob of `/` paths. `*` matches a part of one path
|
|
3
|
+
* segment, `?` matches one character, `**` matches zero or more segments, and `{a,b}` matches one of
|
|
4
|
+
* its parts. The function escapes each other special character.
|
|
5
|
+
*/
|
|
6
|
+
declare function globToRegExp(glob: string): RegExp;
|
|
7
|
+
/**
|
|
8
|
+
* This function gives the folders under `root` that a glob names, as `/` paths relative to `root`,
|
|
9
|
+
* in the order of the code units. It does not go into `node_modules` or a folder that starts with `.`.
|
|
10
|
+
*/
|
|
11
|
+
declare function globFolders(root: string, glob: string): string[];
|
|
12
|
+
/**
|
|
13
|
+
* This function gives the globs of the workspace at `root`: the `packages` list of
|
|
14
|
+
* `pnpm-workspace.yaml`, then the `workspaces` field of `package.json`. The result is undefined when
|
|
15
|
+
* the repository has no workspace.
|
|
16
|
+
*/
|
|
17
|
+
declare function workspaceGlobs(root: string): string[] | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* This function gives the package folders of the repository at `root`: the folders of the globs
|
|
20
|
+
* that have a `package.json` file. A glob that starts with `!` removes folders. Without globs, the
|
|
21
|
+
* function reads the globs of the workspace, and a repository with no workspace is one package.
|
|
22
|
+
* The result has absolute paths, in the order of the code units.
|
|
23
|
+
*/
|
|
24
|
+
declare function packageFolders(root: string, globs?: readonly string[] | undefined): string[];
|
|
25
|
+
/**
|
|
26
|
+
* This function gives the folders of the reports when the command names no folder. With `globs`, these are the package
|
|
27
|
+
* folders of the globs. Without `globs`, these are the package folders of the workspace, and also the root when its
|
|
28
|
+
* package is public and the globs leave it out. A repository can publish its root and keep a private site in its
|
|
29
|
+
* workspace. The result has absolute paths, in the order of the code units.
|
|
30
|
+
*/
|
|
31
|
+
declare function reportFolders(root: string, globs?: readonly string[]): string[];
|
|
32
|
+
export { workspaceGlobs as a, reportFolders as i, globToRegExp as n, packageFolders as r, globFolders as t };
|
|
33
|
+
//# sourceMappingURL=workspace-BMtl0EQf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-BMtl0EQf.d.ts","names":[],"sources":["../src/workspace.ts"],"mappings":";;;;;iBAsBgB,aAAa,eAAe;;;;;iBAsD5B,YAAY,cAAc;;;;;;iBA8B1B,eAAe;;;;;;;iBAwCf,eAAe,cAAc;;;;;;;iBAkB7B,cAAc,cAAc"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
3
|
+
// src/workspace.ts
|
|
4
|
+
/**
|
|
5
|
+
* The package folders of a repository: the folders that the globs of the workspace name, with a
|
|
6
|
+
* `package.json` file. This file is the one home of this code. The subpath
|
|
7
|
+
* `@mark1russell7/conventions/workspace` exports it, and `@mark1russell7/api-report` imports it from there.
|
|
8
|
+
*/
|
|
9
|
+
/** This function compares two strings by their code units, as the default sort does. */
|
|
10
|
+
const byCode = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
11
|
+
/** This function gives a path relative to `root`, with `/`. */
|
|
12
|
+
const relativePath = (root, file) => relative(root, file).split(sep).join("/");
|
|
13
|
+
/** The characters that have a meaning in a regular expression. */
|
|
14
|
+
const SPECIAL = /* @__PURE__ */ new Set([..."\\^$.|+()[]{}*?/"]);
|
|
15
|
+
/**
|
|
16
|
+
* This function gives a regular expression for a glob of `/` paths. `*` matches a part of one path
|
|
17
|
+
* segment, `?` matches one character, `**` matches zero or more segments, and `{a,b}` matches one of
|
|
18
|
+
* its parts. The function escapes each other special character.
|
|
19
|
+
*/
|
|
20
|
+
function globToRegExp(glob) {
|
|
21
|
+
let source = "";
|
|
22
|
+
let braces = 0;
|
|
23
|
+
for (let index = 0; index < glob.length; index++) {
|
|
24
|
+
const char = glob.charAt(index);
|
|
25
|
+
if (char === "/" && glob.slice(index + 1) === "**") {
|
|
26
|
+
source += "(?:/.*)?";
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
if (char === "*" && glob.charAt(index + 1) === "*") {
|
|
30
|
+
const atStart = index === 0 || glob.charAt(index - 1) === "/";
|
|
31
|
+
const after = glob.charAt(index + 2);
|
|
32
|
+
if (atStart && after === "/") {
|
|
33
|
+
source += "(?:[^/]+/)*";
|
|
34
|
+
index += 2;
|
|
35
|
+
} else if (atStart && after === "") {
|
|
36
|
+
source += ".*";
|
|
37
|
+
index += 1;
|
|
38
|
+
} else {
|
|
39
|
+
source += "[^/]*";
|
|
40
|
+
index += 1;
|
|
41
|
+
}
|
|
42
|
+
} else if (char === "*") source += "[^/]*";
|
|
43
|
+
else if (char === "?") source += "[^/]";
|
|
44
|
+
else if (char === "{") {
|
|
45
|
+
braces++;
|
|
46
|
+
source += "(?:";
|
|
47
|
+
} else if (char === "}" && braces > 0) {
|
|
48
|
+
braces--;
|
|
49
|
+
source += ")";
|
|
50
|
+
} else if (char === "," && braces > 0) source += "|";
|
|
51
|
+
else if (SPECIAL.has(char)) source += `\\${char}`;
|
|
52
|
+
else source += char;
|
|
53
|
+
}
|
|
54
|
+
if (braces > 0) throw new Error(`A glob with a "{" that has no "}": ${glob}`);
|
|
55
|
+
return new RegExp(`^${source}$`);
|
|
56
|
+
}
|
|
57
|
+
/** The characters that make a path segment a pattern. */
|
|
58
|
+
const GLOB_CHARS = /[*?{]/;
|
|
59
|
+
/** This function removes the `/` characters at the end of a path, with a loop in place of a regular expression. */
|
|
60
|
+
function trimEndSlashes(path) {
|
|
61
|
+
let end = path.length;
|
|
62
|
+
while (end > 0 && path.charAt(end - 1) === "/") end -= 1;
|
|
63
|
+
return path.slice(0, end);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* This function gives the folders under `root` that a glob names, as `/` paths relative to `root`,
|
|
67
|
+
* in the order of the code units. It does not go into `node_modules` or a folder that starts with `.`.
|
|
68
|
+
*/
|
|
69
|
+
function globFolders(root, glob) {
|
|
70
|
+
const clean = trimEndSlashes(glob.startsWith("./") ? glob.slice(2) : glob);
|
|
71
|
+
const segments = clean.split("/");
|
|
72
|
+
const firstPattern = segments.findIndex((segment) => GLOB_CHARS.test(segment));
|
|
73
|
+
if (firstPattern < 0) return existsSync(join(root, clean)) ? [clean] : [];
|
|
74
|
+
const base = segments.slice(0, firstPattern).join("/");
|
|
75
|
+
const depth = clean.includes("**") ? Number.POSITIVE_INFINITY : segments.length - firstPattern;
|
|
76
|
+
const pattern = globToRegExp(clean);
|
|
77
|
+
const start = join(root, base);
|
|
78
|
+
if (!existsSync(start)) return [];
|
|
79
|
+
const found = [];
|
|
80
|
+
const walk = (folder, level) => {
|
|
81
|
+
for (const entry of readdirSync(folder, { withFileTypes: true })) {
|
|
82
|
+
if (!entry.isDirectory() || entry.name === "node_modules" || entry.name.startsWith(".")) continue;
|
|
83
|
+
const path = join(folder, entry.name);
|
|
84
|
+
if (pattern.test(relativePath(root, path))) found.push(relativePath(root, path));
|
|
85
|
+
if (level < depth) walk(path, level + 1);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
if (base !== "" && pattern.test(base)) found.push(base);
|
|
89
|
+
walk(start, 1);
|
|
90
|
+
return found.sort(byCode);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* This function gives the globs of the workspace at `root`: the `packages` list of
|
|
94
|
+
* `pnpm-workspace.yaml`, then the `workspaces` field of `package.json`. The result is undefined when
|
|
95
|
+
* the repository has no workspace.
|
|
96
|
+
*/
|
|
97
|
+
function workspaceGlobs(root) {
|
|
98
|
+
const yaml = join(root, "pnpm-workspace.yaml");
|
|
99
|
+
if (existsSync(yaml)) {
|
|
100
|
+
const lines = readFileSync(yaml, "utf8").split(/\r?\n/);
|
|
101
|
+
const start = lines.findIndex((line) => /^packages\s*:/.test(line));
|
|
102
|
+
if (start >= 0) {
|
|
103
|
+
const unquote = (text) => text.replace(/\s+#.*$/, "").trim().replace(/^["']|["']$/g, "");
|
|
104
|
+
const inline = /^packages\s*:\s*\[(.*)\]/.exec(lines[start] ?? "");
|
|
105
|
+
if (inline) return (inline[1] ?? "").split(",").map(unquote).filter(Boolean);
|
|
106
|
+
const globs = [];
|
|
107
|
+
for (const line of lines.slice(start + 1)) {
|
|
108
|
+
if (/^\s*(#.*)?$/.test(line)) continue;
|
|
109
|
+
const item = /^\s+-\s+(.+)$/.exec(line);
|
|
110
|
+
if (!item) break;
|
|
111
|
+
globs.push(unquote(item[1] ?? ""));
|
|
112
|
+
}
|
|
113
|
+
return globs;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const manifestFile = join(root, "package.json");
|
|
117
|
+
if (existsSync(manifestFile)) {
|
|
118
|
+
const { workspaces } = JSON.parse(readFileSync(manifestFile, "utf8"));
|
|
119
|
+
if (Array.isArray(workspaces)) return workspaces.filter((glob) => typeof glob === "string");
|
|
120
|
+
if (typeof workspaces === "object" && workspaces !== null && "packages" in workspaces && Array.isArray(workspaces.packages)) return workspaces.packages.filter((glob) => typeof glob === "string");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* This function gives the package folders of the repository at `root`: the folders of the globs
|
|
125
|
+
* that have a `package.json` file. A glob that starts with `!` removes folders. Without globs, the
|
|
126
|
+
* function reads the globs of the workspace, and a repository with no workspace is one package.
|
|
127
|
+
* The result has absolute paths, in the order of the code units.
|
|
128
|
+
*/
|
|
129
|
+
function packageFolders(root, globs = workspaceGlobs(root)) {
|
|
130
|
+
if (globs === void 0) return existsSync(join(root, "package.json")) ? [root] : [];
|
|
131
|
+
const included = /* @__PURE__ */ new Set();
|
|
132
|
+
for (const glob of globs.filter((item) => !item.startsWith("!"))) for (const folder of globFolders(root, glob)) included.add(folder);
|
|
133
|
+
for (const glob of globs.filter((item) => item.startsWith("!"))) for (const folder of globFolders(root, glob.slice(1))) included.delete(folder);
|
|
134
|
+
return [...included].filter((folder) => existsSync(join(root, folder, "package.json"))).sort(byCode).map((folder) => join(root, folder));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* This function gives the folders of the reports when the command names no folder. With `globs`, these are the package
|
|
138
|
+
* folders of the globs. Without `globs`, these are the package folders of the workspace, and also the root when its
|
|
139
|
+
* package is public and the globs leave it out. A repository can publish its root and keep a private site in its
|
|
140
|
+
* workspace. The result has absolute paths, in the order of the code units.
|
|
141
|
+
*/
|
|
142
|
+
function reportFolders(root, globs) {
|
|
143
|
+
if (globs !== void 0) return packageFolders(root, globs);
|
|
144
|
+
const folders = packageFolders(root);
|
|
145
|
+
const top = resolve(root);
|
|
146
|
+
const manifest = join(top, "package.json");
|
|
147
|
+
if (workspaceGlobs(root) === void 0 || !existsSync(manifest) || folders.some((folder) => resolve(folder) === top)) return folders;
|
|
148
|
+
let isPrivate = false;
|
|
149
|
+
try {
|
|
150
|
+
isPrivate = JSON.parse(readFileSync(manifest, "utf8")).private === true;
|
|
151
|
+
} catch {}
|
|
152
|
+
return isPrivate ? folders : [top, ...folders];
|
|
153
|
+
}
|
|
154
|
+
export { relativePath as a, packageFolders as i, globFolders as n, reportFolders as o, globToRegExp as r, workspaceGlobs as s, byCode as t };
|
|
155
|
+
|
|
156
|
+
//# sourceMappingURL=workspace-Cx7p7bWn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-Cx7p7bWn.js","names":[],"sources":["../src/workspace.ts"],"sourcesContent":["/**\n * The package folders of a repository: the folders that the globs of the workspace name, with a\n * `package.json` file. This file is the one home of this code. The subpath\n * `@mark1russell7/conventions/workspace` exports it, and `@mark1russell7/api-report` imports it from there.\n */\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { join, relative, resolve, sep } from \"node:path\";\n\n/** This function compares two strings by their code units, as the default sort does. */\nexport const byCode = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0);\n\n/** This function gives a path relative to `root`, with `/`. */\nexport const relativePath = (root: string, file: string): string => relative(root, file).split(sep).join(\"/\");\n\n/** The characters that have a meaning in a regular expression. */\nconst SPECIAL = new Set([...\"\\\\^$.|+()[]{}*?/\"]);\n\n/**\n * This function gives a regular expression for a glob of `/` paths. `*` matches a part of one path\n * segment, `?` matches one character, `**` matches zero or more segments, and `{a,b}` matches one of\n * its parts. The function escapes each other special character.\n */\nexport function globToRegExp(glob: string): RegExp {\n let source = \"\";\n let braces = 0;\n for (let index = 0; index < glob.length; index++) {\n const char = glob.charAt(index);\n if (char === \"/\" && glob.slice(index + 1) === \"**\") {\n // `a/**` matches `a` and each path under it\n source += \"(?:/.*)?\";\n break;\n }\n if (char === \"*\" && glob.charAt(index + 1) === \"*\") {\n const atStart = index === 0 || glob.charAt(index - 1) === \"/\";\n const after = glob.charAt(index + 2);\n if (atStart && after === \"/\") {\n // `**/` matches zero or more whole segments\n source += \"(?:[^/]+/)*\";\n index += 2;\n } else if (atStart && after === \"\") {\n source += \".*\";\n index += 1;\n } else {\n source += \"[^/]*\";\n index += 1;\n }\n } else if (char === \"*\") source += \"[^/]*\";\n else if (char === \"?\") source += \"[^/]\";\n else if (char === \"{\") {\n braces++;\n source += \"(?:\";\n } else if (char === \"}\" && braces > 0) {\n braces--;\n source += \")\";\n } else if (char === \",\" && braces > 0) source += \"|\";\n else if (SPECIAL.has(char)) source += `\\\\${char}`;\n else source += char;\n }\n if (braces > 0) throw new Error(`A glob with a \"{\" that has no \"}\": ${glob}`);\n return new RegExp(`^${source}$`);\n}\n\n/** The characters that make a path segment a pattern. */\nconst GLOB_CHARS = /[*?{]/;\n\n/** This function removes the `/` characters at the end of a path, with a loop in place of a regular expression. */\nfunction trimEndSlashes(path: string): string {\n let end = path.length;\n while (end > 0 && path.charAt(end - 1) === \"/\") end -= 1;\n return path.slice(0, end);\n}\n\n/**\n * This function gives the folders under `root` that a glob names, as `/` paths relative to `root`,\n * in the order of the code units. It does not go into `node_modules` or a folder that starts with `.`.\n */\nexport function globFolders(root: string, glob: string): string[] {\n const clean = trimEndSlashes(glob.startsWith(\"./\") ? glob.slice(2) : glob);\n const segments = clean.split(\"/\");\n const firstPattern = segments.findIndex((segment) => GLOB_CHARS.test(segment));\n if (firstPattern < 0) return existsSync(join(root, clean)) ? [clean] : [];\n const base = segments.slice(0, firstPattern).join(\"/\");\n const depth = clean.includes(\"**\") ? Number.POSITIVE_INFINITY : segments.length - firstPattern;\n const pattern = globToRegExp(clean);\n const start = join(root, base);\n if (!existsSync(start)) return [];\n const found: string[] = [];\n const walk = (folder: string, level: number): void => {\n for (const entry of readdirSync(folder, { withFileTypes: true })) {\n if (!entry.isDirectory() || entry.name === \"node_modules\" || entry.name.startsWith(\".\")) continue;\n const path = join(folder, entry.name);\n if (pattern.test(relativePath(root, path))) found.push(relativePath(root, path));\n if (level < depth) walk(path, level + 1);\n }\n };\n // `a/**` also names `a`\n if (base !== \"\" && pattern.test(base)) found.push(base);\n walk(start, 1);\n return found.sort(byCode);\n}\n\n/**\n * This function gives the globs of the workspace at `root`: the `packages` list of\n * `pnpm-workspace.yaml`, then the `workspaces` field of `package.json`. The result is undefined when\n * the repository has no workspace.\n */\nexport function workspaceGlobs(root: string): string[] | undefined {\n const yaml = join(root, \"pnpm-workspace.yaml\");\n if (existsSync(yaml)) {\n const lines = readFileSync(yaml, \"utf8\").split(/\\r?\\n/);\n const start = lines.findIndex((line) => /^packages\\s*:/.test(line));\n if (start >= 0) {\n const unquote = (text: string): string =>\n text\n .replace(/\\s+#.*$/, \"\")\n .trim()\n .replace(/^[\"']|[\"']$/g, \"\");\n const inline = /^packages\\s*:\\s*\\[(.*)\\]/.exec(lines[start] ?? \"\");\n if (inline) return (inline[1] ?? \"\").split(\",\").map(unquote).filter(Boolean);\n const globs: string[] = [];\n for (const line of lines.slice(start + 1)) {\n if (/^\\s*(#.*)?$/.test(line)) continue;\n const item = /^\\s+-\\s+(.+)$/.exec(line);\n if (!item) break;\n globs.push(unquote(item[1] ?? \"\"));\n }\n return globs;\n }\n }\n const manifestFile = join(root, \"package.json\");\n if (existsSync(manifestFile)) {\n const { workspaces } = JSON.parse(readFileSync(manifestFile, \"utf8\")) as { workspaces?: unknown };\n if (Array.isArray(workspaces)) return workspaces.filter((glob): glob is string => typeof glob === \"string\");\n if (typeof workspaces === \"object\" && workspaces !== null && \"packages\" in workspaces && Array.isArray(workspaces.packages)) {\n return workspaces.packages.filter((glob): glob is string => typeof glob === \"string\");\n }\n }\n return undefined;\n}\n\n/**\n * This function gives the package folders of the repository at `root`: the folders of the globs\n * that have a `package.json` file. A glob that starts with `!` removes folders. Without globs, the\n * function reads the globs of the workspace, and a repository with no workspace is one package.\n * The result has absolute paths, in the order of the code units.\n */\nexport function packageFolders(root: string, globs: readonly string[] | undefined = workspaceGlobs(root)): string[] {\n if (globs === undefined) return existsSync(join(root, \"package.json\")) ? [root] : [];\n const included = new Set<string>();\n // As in pnpm, a `!` glob removes its folders in each position of the list\n for (const glob of globs.filter((item) => !item.startsWith(\"!\"))) for (const folder of globFolders(root, glob)) included.add(folder);\n for (const glob of globs.filter((item) => item.startsWith(\"!\"))) for (const folder of globFolders(root, glob.slice(1))) included.delete(folder);\n return [...included]\n .filter((folder) => existsSync(join(root, folder, \"package.json\")))\n .sort(byCode)\n .map((folder) => join(root, folder));\n}\n\n/**\n * This function gives the folders of the reports when the command names no folder. With `globs`, these are the package\n * folders of the globs. Without `globs`, these are the package folders of the workspace, and also the root when its\n * package is public and the globs leave it out. A repository can publish its root and keep a private site in its\n * workspace. The result has absolute paths, in the order of the code units.\n */\nexport function reportFolders(root: string, globs?: readonly string[]): string[] {\n if (globs !== undefined) return packageFolders(root, globs);\n const folders = packageFolders(root);\n const top = resolve(root);\n const manifest = join(top, \"package.json\");\n if (workspaceGlobs(root) === undefined || !existsSync(manifest) || folders.some((folder) => resolve(folder) === top)) return folders;\n let isPrivate = false;\n try {\n isPrivate = (JSON.parse(readFileSync(manifest, \"utf8\")) as { private?: unknown }).private === true;\n } catch {\n // The run reads the file again and tells the error of the root\n }\n return isPrivate ? folders : [top, ...folders];\n}\n"],"mappings":";;;;;;;;;AASA,MAAa,UAAU,GAAW,MAAuB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;;AAGlF,MAAa,gBAAgB,MAAc,SAAyB,SAAS,MAAM,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG;;AAG5G,MAAM,0BAAU,IAAI,IAAI,CAAC,GAAG,kBAAkB,CAAC;;;;;;AAO/C,SAAgB,aAAa,MAAsB;CACjD,IAAI,SAAS;CACb,IAAI,SAAS;CACb,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,MAAM,OAAO,KAAK,OAAO,KAAK;EAC9B,IAAI,SAAS,OAAO,KAAK,MAAM,QAAQ,CAAC,MAAM,MAAM;GAElD,UAAU;GACV;EACF;EACA,IAAI,SAAS,OAAO,KAAK,OAAO,QAAQ,CAAC,MAAM,KAAK;GAClD,MAAM,UAAU,UAAU,KAAK,KAAK,OAAO,QAAQ,CAAC,MAAM;GAC1D,MAAM,QAAQ,KAAK,OAAO,QAAQ,CAAC;GACnC,IAAI,WAAW,UAAU,KAAK;IAE5B,UAAU;IACV,SAAS;GACX,OAAO,IAAI,WAAW,UAAU,IAAI;IAClC,UAAU;I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ACzC,IAAI,eAAe,IAAI,MAAM,KAAA,KAAa,CAAC,WAAW,QAAQ,KAAK,QAAQ,MAAM,WAAW,QAAQ,MAAM,MAAM,GAAG,GAAG,OAAO;CAC7H,IAAI,YAAY;CAChB,IAAI;EACF,YAAa,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC,CAAC,CAA2B,YAAY;CAChG,QAAQ,CAER;CACA,OAAO,YAAY,UAAU,CAAC,KAAK,GAAG,OAAO;AAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as globFolders, r as globToRegExp, i as packageFolders, o as reportFolders, s as workspaceGlobs } from "./workspace-Cx7p7bWn.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/conventions",
|
|
4
|
-
"version": "0.38.
|
|
4
|
+
"version": "0.38.2",
|
|
5
5
|
"description": "One check in CI for the conventions of a pnpm workspace that docs tell in prose: pinned git dependencies, source packages, tsconfig.test.json, no build output in git and more.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"conventions",
|
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
"author": "Mark Russell (https://github.com/mark1russell7)",
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./build/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./build/index.d.ts",
|
|
32
|
+
"import": "./build/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./workspace": {
|
|
35
|
+
"types": "./build/workspace.d.ts",
|
|
36
|
+
"import": "./build/workspace.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
29
40
|
"bin": {
|
|
30
41
|
"conventions": "./build/cli.js"
|
|
31
42
|
},
|
|
@@ -56,12 +67,5 @@
|
|
|
56
67
|
"test:watch": "vitest",
|
|
57
68
|
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json"
|
|
58
69
|
},
|
|
59
|
-
"types": "./build/index.d.ts"
|
|
60
|
-
"exports": {
|
|
61
|
-
".": {
|
|
62
|
-
"types": "./build/index.d.ts",
|
|
63
|
-
"import": "./build/index.js"
|
|
64
|
-
},
|
|
65
|
-
"./package.json": "./package.json"
|
|
66
|
-
}
|
|
70
|
+
"types": "./build/index.d.ts"
|
|
67
71
|
}
|