get-llms 1.0.0
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/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/bin/defaults.d.ts +3 -0
- package/dist/bin/defaults.d.ts.map +1 -0
- package/dist/bin/defaults.js +17 -0
- package/dist/bin/defaults.js.map +1 -0
- package/dist/bin/index.d.ts +2 -0
- package/dist/bin/index.d.ts.map +1 -0
- package/dist/bin/index.js +169 -0
- package/dist/bin/index.js.map +1 -0
- package/dist/bin/llmsFetcher.d.ts +18 -0
- package/dist/bin/llmsFetcher.d.ts.map +1 -0
- package/dist/bin/llmsFetcher.js +259 -0
- package/dist/bin/llmsFetcher.js.map +1 -0
- package/dist/bin/types/npmRegistryType.d.ts +103 -0
- package/dist/bin/types/npmRegistryType.d.ts.map +1 -0
- package/dist/bin/types/npmRegistryType.js +2 -0
- package/dist/bin/types/npmRegistryType.js.map +1 -0
- package/dist/bin/types/packageJsonType.d.ts +74 -0
- package/dist/bin/types/packageJsonType.d.ts.map +1 -0
- package/dist/bin/types/packageJsonType.js +2 -0
- package/dist/bin/types/packageJsonType.js.map +1 -0
- package/dist/bin/types/types.d.ts +21 -0
- package/dist/bin/types/types.d.ts.map +1 -0
- package/dist/bin/types/types.js +2 -0
- package/dist/bin/types/types.js.map +1 -0
- package/dist/bin/utils/cliHelpers.d.ts +11 -0
- package/dist/bin/utils/cliHelpers.d.ts.map +1 -0
- package/dist/bin/utils/cliHelpers.js +45 -0
- package/dist/bin/utils/cliHelpers.js.map +1 -0
- package/dist/bin/utils/logger.d.ts +19 -0
- package/dist/bin/utils/logger.d.ts.map +1 -0
- package/dist/bin/utils/logger.js +56 -0
- package/dist/bin/utils/logger.js.map +1 -0
- package/dist/bin/utils/utils.d.ts +13 -0
- package/dist/bin/utils/utils.d.ts.map +1 -0
- package/dist/bin/utils/utils.js +38 -0
- package/dist/bin/utils/utils.js.map +1 -0
- package/package.json +48 -0
- package/tsconfig.json +21 -0
- package/vitest.config.ts +17 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { getPackageInfo } from "./utils/utils";
|
|
2
|
+
import { logger } from "./utils/logger";
|
|
3
|
+
/**
|
|
4
|
+
* Clean up a GitHub URL to extract owner/repo
|
|
5
|
+
* Handles various formats:
|
|
6
|
+
* - https://github.com/owner/repo
|
|
7
|
+
* - https://github.com/owner/repo.git
|
|
8
|
+
* - https://github.com/owner/repo#readme
|
|
9
|
+
* - git+https://github.com/owner/repo.git
|
|
10
|
+
*/
|
|
11
|
+
const parseGitHubUrl = (url) => {
|
|
12
|
+
// Remove git+ prefix if present
|
|
13
|
+
let cleanUrl = url.replace(/^git\+/, "");
|
|
14
|
+
// Remove .git suffix if present
|
|
15
|
+
cleanUrl = cleanUrl.replace(/\.git$/, "");
|
|
16
|
+
// Remove hash fragments
|
|
17
|
+
cleanUrl = cleanUrl.replace(/#.*$/, "");
|
|
18
|
+
const match = cleanUrl.match(/github\.com\/([^\/]+)\/([^\/]+)/);
|
|
19
|
+
if (!match)
|
|
20
|
+
return null;
|
|
21
|
+
return { owner: match[1], repo: match[2] };
|
|
22
|
+
};
|
|
23
|
+
// Check package.json "llms" key
|
|
24
|
+
export const checkPackage = async (s) => {
|
|
25
|
+
if (!s.llms)
|
|
26
|
+
return null;
|
|
27
|
+
const llmsValue = s.llms;
|
|
28
|
+
if (llmsValue.startsWith("http://") || llmsValue.startsWith("https://")) {
|
|
29
|
+
try {
|
|
30
|
+
logger.verbose(`Checking package llms field: ${llmsValue}`);
|
|
31
|
+
const response = await fetch(llmsValue);
|
|
32
|
+
const contentType = response.headers.get("content-type");
|
|
33
|
+
if (response.ok &&
|
|
34
|
+
(contentType?.includes("text/plain") ||
|
|
35
|
+
contentType?.includes("text/markdown"))) {
|
|
36
|
+
return { location: llmsValue, content: await response.text() };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
logger.debug(`Failed to fetch from package llms field: ${e}`);
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
46
|
+
export const checkStandardUrls = async (baseUrl) => {
|
|
47
|
+
// Ensure no trailing slash and clean URL
|
|
48
|
+
const url = new URL(baseUrl);
|
|
49
|
+
// Remove trailing slash from href
|
|
50
|
+
const cleanHref = url.href.replace(/\/+$/, "");
|
|
51
|
+
const possibilities = [
|
|
52
|
+
`${cleanHref}/llms.txt`,
|
|
53
|
+
`${cleanHref}/docs/llms.txt`,
|
|
54
|
+
`${url.origin}/llms.txt`,
|
|
55
|
+
`${url.origin}/docs/llms.txt`,
|
|
56
|
+
];
|
|
57
|
+
for (const url of possibilities) {
|
|
58
|
+
try {
|
|
59
|
+
logger.verbose(`Checking standard URL: ${url}`);
|
|
60
|
+
const response = await fetch(url, { method: "GET" });
|
|
61
|
+
const contentType = response.headers.get("content-type");
|
|
62
|
+
if (response.ok) {
|
|
63
|
+
const text = await response.text();
|
|
64
|
+
// Strict check: must be text/plain or markdown
|
|
65
|
+
if (contentType?.includes("text/plain") ||
|
|
66
|
+
contentType?.includes("text/markdown")) {
|
|
67
|
+
return { location: url, content: text };
|
|
68
|
+
}
|
|
69
|
+
// Fallback: Check content if content-type is generic or missing
|
|
70
|
+
// If it is text/html, it is likely a 404 page or SPA fallback.
|
|
71
|
+
if (contentType?.includes("text/html")) {
|
|
72
|
+
continue; // Skip HTML responses
|
|
73
|
+
}
|
|
74
|
+
// detailed check: shouldn't start with <!DOCTYPE html
|
|
75
|
+
if (text.trim().toLowerCase().startsWith("<!doctype html") ||
|
|
76
|
+
text.includes("<html")) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
return { location: url, content: text };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
logger.debug(`Failed to fetch ${url}: ${e}`);
|
|
84
|
+
// Ignore network errors, try next
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
};
|
|
89
|
+
export const fetchReadmeFromGithub = async (homepage) => {
|
|
90
|
+
const parsed = parseGitHubUrl(homepage);
|
|
91
|
+
if (!parsed)
|
|
92
|
+
return null;
|
|
93
|
+
const { owner, repo } = parsed;
|
|
94
|
+
const branches = ["main", "master"];
|
|
95
|
+
const filenames = ["README.md", "readme.md", "README.txt", "readme.txt"];
|
|
96
|
+
for (const branch of branches) {
|
|
97
|
+
for (const filename of filenames) {
|
|
98
|
+
const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filename}`;
|
|
99
|
+
try {
|
|
100
|
+
logger.verbose(`Checking GitHub README: ${rawUrl}`);
|
|
101
|
+
const res = await fetch(rawUrl);
|
|
102
|
+
if (res.ok) {
|
|
103
|
+
return {
|
|
104
|
+
location: rawUrl,
|
|
105
|
+
content: await res.text(),
|
|
106
|
+
isFallback: true,
|
|
107
|
+
fallbackType: "readme",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
};
|
|
118
|
+
export const handleGithub = async (homepage) => {
|
|
119
|
+
const parsed = parseGitHubUrl(homepage);
|
|
120
|
+
if (!parsed)
|
|
121
|
+
return null;
|
|
122
|
+
const { owner, repo } = parsed;
|
|
123
|
+
const branches = ["main", "master"];
|
|
124
|
+
const filenames = ["README.md", "readme.md", "README.txt", "readme.txt"];
|
|
125
|
+
let readmeContent = "";
|
|
126
|
+
// Try to find README
|
|
127
|
+
for (const branch of branches) {
|
|
128
|
+
if (readmeContent)
|
|
129
|
+
break;
|
|
130
|
+
for (const filename of filenames) {
|
|
131
|
+
const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filename}`;
|
|
132
|
+
try {
|
|
133
|
+
logger.verbose(`Checking GitHub for README: ${rawUrl}`);
|
|
134
|
+
const res = await fetch(rawUrl);
|
|
135
|
+
if (res.ok) {
|
|
136
|
+
readmeContent = await res.text();
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (!readmeContent)
|
|
146
|
+
return null;
|
|
147
|
+
// Look for links containing "docs"
|
|
148
|
+
// Markdown link regex: \[([^\]]*)\]\(([^)]+)\)
|
|
149
|
+
const linkRegex = /\[([^\]]*)\]\(([^)]+)\)/g;
|
|
150
|
+
let linkMatch = linkRegex.exec(readmeContent);
|
|
151
|
+
while (linkMatch !== null) {
|
|
152
|
+
const [_, text, url] = linkMatch;
|
|
153
|
+
linkMatch = linkRegex.exec(readmeContent);
|
|
154
|
+
// Check if text or url contains "docs" (flowchart says "mention the word 'docs' in a hyperlink")
|
|
155
|
+
// It implies the anchor text or the URL itself could hint at docs?
|
|
156
|
+
// "does the github 'readme.txt' mention the word 'docs' in a hyperlink?"
|
|
157
|
+
// Usually means the text is "Docs" or "Documentation" or URL has /docs
|
|
158
|
+
if (text.toLowerCase().includes("docs") ||
|
|
159
|
+
url.toLowerCase().includes("docs")) {
|
|
160
|
+
// Resolve relative URLs
|
|
161
|
+
let absoluteUrl = url;
|
|
162
|
+
if (!url.startsWith("http")) {
|
|
163
|
+
// Construct absolute URL relative to the repo's homepage or raw content?
|
|
164
|
+
// If it points to a website, it's likely absolute.
|
|
165
|
+
// If it points to a file in repo, it's relative.
|
|
166
|
+
// Flowchart: E -- yes --> FOUND
|
|
167
|
+
// E is "does 'link/llms.txt' return a txt file?"
|
|
168
|
+
// So 'link' acts as a base URL.
|
|
169
|
+
// If the link is relative (e.g. "docs/"), and we append "llms.txt", we get "docs/llms.txt".
|
|
170
|
+
// If the link is "https://mypackage.com", we get "https://mypackage.com/llms.txt".
|
|
171
|
+
if (!url.startsWith("/")) {
|
|
172
|
+
absoluteUrl = `https://github.com/${owner}/${repo}/blob/main/${url}`; // Approximate
|
|
173
|
+
// But if it's a website link in valid markdown, it's usually absolute.
|
|
174
|
+
// If it is relative, it points to a folder in the repo.
|
|
175
|
+
// The finding 'llms.txt' relative to a repo folder is valid.
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Check this URL
|
|
179
|
+
logger.verbose(`Found docs link, checking: ${absoluteUrl}`);
|
|
180
|
+
const result = await checkStandardUrls(absoluteUrl);
|
|
181
|
+
if (result)
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
};
|
|
187
|
+
export const checkHomepage = async (homepage) => {
|
|
188
|
+
if (!homepage)
|
|
189
|
+
return null;
|
|
190
|
+
if (homepage.includes("github.com")) {
|
|
191
|
+
const githubResult = await handleGithub(homepage);
|
|
192
|
+
if (githubResult)
|
|
193
|
+
return { location: githubResult.location, content: githubResult.content };
|
|
194
|
+
// Fallback to checking standard URLs on the repo if scraping fails?
|
|
195
|
+
// actually flowchart says: if github -> scrape README -> if link found -> check standard urls of THAT link
|
|
196
|
+
// -> if no link found -> NOFILE
|
|
197
|
+
// So we shouldn't check standard URLs of the github repo itself unless the logic implies it.
|
|
198
|
+
// Wait, reading flowchart:
|
|
199
|
+
// C{package homepage is github?} -- yes --> D{readme mentions 'docs'?}
|
|
200
|
+
// D -- yes --> E{link/llms.txt?}
|
|
201
|
+
// D -- no --> NOFILE
|
|
202
|
+
// So if it IS github, we ONLY check if we find a docs link. We don't check github.com/user/repo/llms.txt directly based on the flowchart.
|
|
203
|
+
// Although, the flowchart says "link/llms.txt" where 'link' comes from D.
|
|
204
|
+
// If C is NO (not github), it goes to E directly with the homepage.
|
|
205
|
+
return null; // Placeholder for now until handleGithub is real
|
|
206
|
+
}
|
|
207
|
+
// Not github, check standard URLs
|
|
208
|
+
return checkStandardUrls(homepage);
|
|
209
|
+
};
|
|
210
|
+
export const findLLMsTxt = async (packageName, options = {}) => {
|
|
211
|
+
const { fallback = "none" } = options;
|
|
212
|
+
try {
|
|
213
|
+
logger.verbose(`Fetching package info for: ${packageName}`);
|
|
214
|
+
const info = await getPackageInfo(packageName);
|
|
215
|
+
// 1. Check package.json "llms" key
|
|
216
|
+
const fromPackageJson = await checkPackage(info);
|
|
217
|
+
if (fromPackageJson)
|
|
218
|
+
return fromPackageJson;
|
|
219
|
+
// 2. Check homepage
|
|
220
|
+
if (info.homepage) {
|
|
221
|
+
const fromHomepage = await checkHomepage(info.homepage);
|
|
222
|
+
if (fromHomepage)
|
|
223
|
+
return fromHomepage;
|
|
224
|
+
}
|
|
225
|
+
// 3. Apply fallback strategy if no llms.txt found
|
|
226
|
+
if (fallback === "readme" && info.homepage) {
|
|
227
|
+
logger.verbose(`Applying readme fallback for: ${packageName}`);
|
|
228
|
+
// Try to fetch README from GitHub
|
|
229
|
+
if (info.homepage.includes("github.com")) {
|
|
230
|
+
const readmeResult = await fetchReadmeFromGithub(info.homepage);
|
|
231
|
+
if (readmeResult)
|
|
232
|
+
return readmeResult;
|
|
233
|
+
}
|
|
234
|
+
// Try to get README from repository field
|
|
235
|
+
const repoUrl = typeof info.repository === "string"
|
|
236
|
+
? info.repository
|
|
237
|
+
: info.repository?.url;
|
|
238
|
+
if (repoUrl && repoUrl.includes("github.com")) {
|
|
239
|
+
const readmeResult = await fetchReadmeFromGithub(repoUrl);
|
|
240
|
+
if (readmeResult)
|
|
241
|
+
return readmeResult;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (fallback === "empty") {
|
|
245
|
+
return {
|
|
246
|
+
location: "fallback:empty",
|
|
247
|
+
content: `# ${packageName}\n\nNo llms.txt found for this package.\n`,
|
|
248
|
+
isFallback: true,
|
|
249
|
+
fallbackType: "empty",
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
logger.debug(`Error fetching info for ${packageName}:`, error);
|
|
256
|
+
return null;
|
|
257
|
+
}
|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CAAC,2BAA2B,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface Author {
|
|
2
|
+
name: string;
|
|
3
|
+
email: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Zshy {
|
|
6
|
+
exports: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
conditions?: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ExportCondition {
|
|
14
|
+
types?: string;
|
|
15
|
+
import?: string;
|
|
16
|
+
require?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Repository {
|
|
19
|
+
type: string;
|
|
20
|
+
url: string;
|
|
21
|
+
}
|
|
22
|
+
export interface Bugs {
|
|
23
|
+
url: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Backing {
|
|
26
|
+
"npm-funding"?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface Support {
|
|
29
|
+
backing?: Backing;
|
|
30
|
+
}
|
|
31
|
+
export interface Provenance {
|
|
32
|
+
predicateType: string;
|
|
33
|
+
}
|
|
34
|
+
export interface Attestations {
|
|
35
|
+
url: string;
|
|
36
|
+
provenance?: Provenance;
|
|
37
|
+
}
|
|
38
|
+
export interface Signature {
|
|
39
|
+
keyid: string;
|
|
40
|
+
sig: string;
|
|
41
|
+
}
|
|
42
|
+
export interface Dist {
|
|
43
|
+
integrity: string;
|
|
44
|
+
shasum: string;
|
|
45
|
+
tarball: string;
|
|
46
|
+
fileCount: number;
|
|
47
|
+
unpackedSize: number;
|
|
48
|
+
attestations?: Attestations;
|
|
49
|
+
signatures?: Array<Signature>;
|
|
50
|
+
}
|
|
51
|
+
export interface NpmUser {
|
|
52
|
+
name: string;
|
|
53
|
+
email: string;
|
|
54
|
+
}
|
|
55
|
+
export interface Maintainer {
|
|
56
|
+
name: string;
|
|
57
|
+
email: string;
|
|
58
|
+
}
|
|
59
|
+
export interface NpmOperationalInternal {
|
|
60
|
+
host: string;
|
|
61
|
+
tmp: string;
|
|
62
|
+
}
|
|
63
|
+
export interface NpmRegistry {
|
|
64
|
+
name: string;
|
|
65
|
+
version: string;
|
|
66
|
+
type: string;
|
|
67
|
+
license: string;
|
|
68
|
+
author: Author;
|
|
69
|
+
description: string;
|
|
70
|
+
homepage: string;
|
|
71
|
+
llms?: string;
|
|
72
|
+
llmsFull?: string;
|
|
73
|
+
mcpServer?: string;
|
|
74
|
+
funding?: string;
|
|
75
|
+
sideEffects?: boolean;
|
|
76
|
+
keywords: string[];
|
|
77
|
+
main?: string;
|
|
78
|
+
types?: string;
|
|
79
|
+
module?: string;
|
|
80
|
+
zshy?: Zshy;
|
|
81
|
+
exports: {
|
|
82
|
+
[key: string]: string | ExportCondition;
|
|
83
|
+
};
|
|
84
|
+
repository: Repository;
|
|
85
|
+
bugs: Bugs;
|
|
86
|
+
support?: Support;
|
|
87
|
+
scripts?: {
|
|
88
|
+
[key: string]: string;
|
|
89
|
+
};
|
|
90
|
+
_id: string;
|
|
91
|
+
gitHead?: string;
|
|
92
|
+
_nodeVersion?: string;
|
|
93
|
+
_npmVersion?: string;
|
|
94
|
+
dist: Dist;
|
|
95
|
+
_npmUser?: NpmUser;
|
|
96
|
+
directories?: {
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
};
|
|
99
|
+
maintainers?: Array<Maintainer>;
|
|
100
|
+
_npmOperationalInternal?: NpmOperationalInternal;
|
|
101
|
+
_hasShrinkwrap?: boolean;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=npmRegistryType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npmRegistryType.d.ts","sourceRoot":"","sources":["../../../bin/types/npmRegistryType.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM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AW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACzC,WAAW,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,uBAAuB,CAAC,EAAE,sBAAsB,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npmRegistryType.js","sourceRoot":"","sources":["../../../bin/types/npmRegistryType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface Person {
|
|
2
|
+
name: string;
|
|
3
|
+
email?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Repository {
|
|
7
|
+
type: string;
|
|
8
|
+
url: string;
|
|
9
|
+
directory?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Bugs {
|
|
12
|
+
url?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Scripts {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Dependencies {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PackageJson {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
keywords?: string[];
|
|
26
|
+
homepage?: string;
|
|
27
|
+
bugs?: Bugs | string;
|
|
28
|
+
license?: string;
|
|
29
|
+
author?: Person | string;
|
|
30
|
+
contributors?: Array<Person | string>;
|
|
31
|
+
files?: string[];
|
|
32
|
+
main?: string;
|
|
33
|
+
bin?: string | {
|
|
34
|
+
[key: string]: string;
|
|
35
|
+
};
|
|
36
|
+
man?: string | string[];
|
|
37
|
+
directories?: {
|
|
38
|
+
bin?: string;
|
|
39
|
+
doc?: string;
|
|
40
|
+
lib?: string;
|
|
41
|
+
man?: string;
|
|
42
|
+
};
|
|
43
|
+
repository?: Repository | string;
|
|
44
|
+
scripts?: Scripts;
|
|
45
|
+
config?: {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
dependencies?: Dependencies;
|
|
49
|
+
devDependencies?: Dependencies;
|
|
50
|
+
peerDependencies?: Dependencies;
|
|
51
|
+
optionalDependencies?: Dependencies;
|
|
52
|
+
bundledDependencies?: Dependencies;
|
|
53
|
+
engines?: {
|
|
54
|
+
node?: string;
|
|
55
|
+
npm?: string;
|
|
56
|
+
[key: string]: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
os?: string[];
|
|
59
|
+
cpu?: string[];
|
|
60
|
+
private?: boolean;
|
|
61
|
+
publishConfig?: {
|
|
62
|
+
registry?: string;
|
|
63
|
+
access?: string;
|
|
64
|
+
tag?: string;
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
};
|
|
67
|
+
type?: "commonjs" | "module";
|
|
68
|
+
types?: string;
|
|
69
|
+
typings?: string;
|
|
70
|
+
workspaces?: string[] | {
|
|
71
|
+
packages: string[];
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=packageJsonType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageJsonType.d.ts","sourceRoot":"","sources":["../../../bin/types/packageJsonType.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,IAAI;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC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YAAY,CAAC;IACnC,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACnC,CAAC;IACF,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageJsonType.js","sourceRoot":"","sources":["../../../bin/types/packageJsonType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type DependencyType = "prod" | "dev" | "peer" | "optional" | "all";
|
|
2
|
+
export type FallbackStrategy = "none" | "readme" | "empty" | "skip";
|
|
3
|
+
export type VerbosityLevel = "quiet" | "normal" | "verbose";
|
|
4
|
+
export interface SanitizerOptions {
|
|
5
|
+
spaceReplacement: string;
|
|
6
|
+
slashReplacement: string;
|
|
7
|
+
atReplacement: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CLIOptions {
|
|
10
|
+
packagePath: string;
|
|
11
|
+
packages: string[];
|
|
12
|
+
deps: DependencyType[];
|
|
13
|
+
output: string;
|
|
14
|
+
filename: string;
|
|
15
|
+
extension: string;
|
|
16
|
+
dryRun: boolean;
|
|
17
|
+
verbosity: VerbosityLevel;
|
|
18
|
+
fallback: FallbackStrategy;
|
|
19
|
+
sanitizer: SanitizerOptions;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../bin/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IAEzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,cAAc,EAAE,CAAC;IAGvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAGlB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAG3B,SAAS,EAAE,gBAAgB,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../bin/types/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PackageJson } from "../types/packageJsonType";
|
|
2
|
+
import { DependencyType } from "../types/types";
|
|
3
|
+
/**
|
|
4
|
+
* Parse dependency types from a comma-separated string
|
|
5
|
+
*/
|
|
6
|
+
export declare const parseDeps: (depsString: string) => DependencyType[];
|
|
7
|
+
/**
|
|
8
|
+
* Extract dependencies from package.json based on the specified types
|
|
9
|
+
*/
|
|
10
|
+
export declare const getDependencies: (packageJson: PackageJson, depTypes: DependencyType[]) => Record<string, string>;
|
|
11
|
+
//# sourceMappingURL=cliHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../../../bin/utils/cliHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;GAEG;AACH,eAAO,MAAM,SAAS,eAAgB,MAAM,KAAG,cAAc,EAoB5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,gBACb,WAAW,YACd,cAAc,EAAE,KACzB,OAAO,MAAM,EAAE,MAAM,CAsBvB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { logger } from "./logger";
|
|
2
|
+
/**
|
|
3
|
+
* Parse dependency types from a comma-separated string
|
|
4
|
+
*/
|
|
5
|
+
export const parseDeps = (depsString) => {
|
|
6
|
+
const validDeps = [
|
|
7
|
+
"prod",
|
|
8
|
+
"dev",
|
|
9
|
+
"peer",
|
|
10
|
+
"optional",
|
|
11
|
+
"all",
|
|
12
|
+
];
|
|
13
|
+
const deps = depsString.split(",").map((d) => d.trim().toLowerCase());
|
|
14
|
+
const result = [];
|
|
15
|
+
for (const dep of deps) {
|
|
16
|
+
if (validDeps.includes(dep)) {
|
|
17
|
+
result.push(dep);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
logger.warn(`Unknown dependency type: ${dep}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return result.length > 0 ? result : ["all"];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Extract dependencies from package.json based on the specified types
|
|
27
|
+
*/
|
|
28
|
+
export const getDependencies = (packageJson, depTypes) => {
|
|
29
|
+
const result = {};
|
|
30
|
+
const includeAll = depTypes.includes("all");
|
|
31
|
+
if (includeAll || depTypes.includes("prod")) {
|
|
32
|
+
Object.assign(result, packageJson.dependencies || {});
|
|
33
|
+
}
|
|
34
|
+
if (includeAll || depTypes.includes("dev")) {
|
|
35
|
+
Object.assign(result, packageJson.devDependencies || {});
|
|
36
|
+
}
|
|
37
|
+
if (includeAll || depTypes.includes("peer")) {
|
|
38
|
+
Object.assign(result, packageJson.peerDependencies || {});
|
|
39
|
+
}
|
|
40
|
+
if (includeAll || depTypes.includes("optional")) {
|
|
41
|
+
Object.assign(result, packageJson.optionalDependencies || {});
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=cliHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliHelpers.js","sourceRoot":"","sources":["../../../bin/utils/cliHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,UAAkB,EAAoB,EAAE;IAChE,MAAM,SAAS,GAAqB;QAClC,MAAM;QACN,KAAK;QACL,MAAM;QACN,UAAU;QACV,KAAK;KACN,CAAC;IACF,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAqB,CAAC,EAAE;YAC7C,MAAM,C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;
|
|
4
|
+
setVerbosity(level: VerbosityLevel): void;
|
|
5
|
+
getVerbosity(): VerbosityLevel;
|
|
6
|
+
isQuiet(): boolean;
|
|
7
|
+
isVerbose(): boolean;
|
|
8
|
+
error(...args: unknown[]): void;
|
|
9
|
+
log(...args: unknown[]): void;
|
|
10
|
+
info(...args: unknown[]): void;
|
|
11
|
+
verbose(...args: unknown[]): void;
|
|
12
|
+
success(message: string): void;
|
|
13
|
+
fail(message: string): void;
|
|
14
|
+
warn(message: string): void;
|
|
15
|
+
debug(...args: unknown[]): void;
|
|
16
|
+
}
|
|
17
|
+
export declare const logger: Logger;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../bin/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAA4B;IAE7C,YAAY,CAAC,KAAK,EAAE,cAAc;IAIlC,YAAY,IAAI,cAAc;IAI9B,OAAO,IAAI,OAAO;IAIlB,SAAS,IAAI,OAAO;IAKpB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAKxB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAOtB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAKvB,OAAO,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAO1B,OAAO,CAAC,OAAO,EAAE,MAAM;IAIvB,IAAI,CAAC,OAAO,EAAE,MAAM;IAIpB,IAAI,CAAC,OAAO,EAAE,MAAM;IAOpB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;CAKzB;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
class Logger {
|
|
2
|
+
verbosity = "normal";
|
|
3
|
+
setVerbosity(level) {
|
|
4
|
+
this.verbosity = level;
|
|
5
|
+
}
|
|
6
|
+
getVerbosity() {
|
|
7
|
+
return this.verbosity;
|
|
8
|
+
}
|
|
9
|
+
isQuiet() {
|
|
10
|
+
return this.verbosity === "quiet";
|
|
11
|
+
}
|
|
12
|
+
isVerbose() {
|
|
13
|
+
return this.verbosity === "verbose";
|
|
14
|
+
}
|
|
15
|
+
// Always log errors
|
|
16
|
+
error(...args) {
|
|
17
|
+
console.error(...args);
|
|
18
|
+
}
|
|
19
|
+
// Log in normal and verbose modes
|
|
20
|
+
log(...args) {
|
|
21
|
+
if (this.verbosity !== "quiet") {
|
|
22
|
+
console.log(...args);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// Log in normal and verbose modes (alias for log)
|
|
26
|
+
info(...args) {
|
|
27
|
+
this.log(...args);
|
|
28
|
+
}
|
|
29
|
+
// Only log in verbose mode
|
|
30
|
+
verbose(...args) {
|
|
31
|
+
if (this.verbosity === "verbose") {
|
|
32
|
+
console.log(...args);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Log with color-coded prefixes
|
|
36
|
+
success(message) {
|
|
37
|
+
this.log(`✅ ${message}`);
|
|
38
|
+
}
|
|
39
|
+
fail(message) {
|
|
40
|
+
this.log(`❌ ${message}`);
|
|
41
|
+
}
|
|
42
|
+
warn(message) {
|
|
43
|
+
if (this.verbosity !== "quiet") {
|
|
44
|
+
console.warn(`⚠️ ${message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Debug-level logging (verbose only)
|
|
48
|
+
debug(...args) {
|
|
49
|
+
if (this.verbosity === "verbose") {
|
|
50
|
+
console.log("[DEBUG]", ...args);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Export a singleton instance
|
|
55
|
+
export const logger = new Logger();
|
|
56
|
+
//# sourceMappingURL=logger.js.map
|