stackscan 0.1.6 → 0.1.9
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/add.js +2 -2
- package/dist/add.mjs +1 -1
- package/dist/chunk-4WANII4B.mjs +158 -0
- package/dist/chunk-ACCTMJVS.mjs +49 -0
- package/dist/chunk-DYBWKLM7.mjs +158 -0
- package/dist/chunk-GI46Z5RR.mjs +158 -0
- package/dist/chunk-UJM3S22V.mjs +179 -0
- package/dist/chunk-WAXGOBY2.mjs +0 -0
- package/dist/chunk-XS2LU2MN.mjs +158 -0
- package/dist/cli.js +7 -7
- package/dist/cli.mjs +7 -7
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5956 -0
- package/dist/index.mjs +37 -0
- package/dist/output.mjs +2 -2
- package/dist/scan.js +3 -3
- package/dist/scan.mjs +4 -4
- package/dist/sync.js +3 -3
- package/dist/sync.mjs +6 -154
- package/dist/types.mjs +1 -0
- package/package.json +3 -3
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "./chunk-WAXGOBY2.mjs";
|
|
2
|
+
import {
|
|
3
|
+
add
|
|
4
|
+
} from "./chunk-ACCTMJVS.mjs";
|
|
5
|
+
import {
|
|
6
|
+
scan
|
|
7
|
+
} from "./chunk-DYBWKLM7.mjs";
|
|
8
|
+
import {
|
|
9
|
+
sync
|
|
10
|
+
} from "./chunk-XS2LU2MN.mjs";
|
|
11
|
+
import {
|
|
12
|
+
techMap
|
|
13
|
+
} from "./chunk-LSUI3VI4.mjs";
|
|
14
|
+
import {
|
|
15
|
+
techDefinitions
|
|
16
|
+
} from "./chunk-LB3L25FS.mjs";
|
|
17
|
+
import {
|
|
18
|
+
copyAssets,
|
|
19
|
+
generateMarkdown,
|
|
20
|
+
writeOutput
|
|
21
|
+
} from "./chunk-UJM3S22V.mjs";
|
|
22
|
+
import {
|
|
23
|
+
DEFAULT_CATEGORY_ICONS
|
|
24
|
+
} from "./chunk-NGEKE4DQ.mjs";
|
|
25
|
+
import "./chunk-EOKQCSHI.mjs";
|
|
26
|
+
import "./chunk-EH2SEQZP.mjs";
|
|
27
|
+
export {
|
|
28
|
+
DEFAULT_CATEGORY_ICONS,
|
|
29
|
+
add,
|
|
30
|
+
copyAssets,
|
|
31
|
+
generateMarkdown,
|
|
32
|
+
scan,
|
|
33
|
+
sync,
|
|
34
|
+
techDefinitions,
|
|
35
|
+
techMap,
|
|
36
|
+
writeOutput
|
|
37
|
+
};
|
package/dist/output.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
copyAssets,
|
|
3
3
|
generateMarkdown,
|
|
4
4
|
writeOutput
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UJM3S22V.mjs";
|
|
6
6
|
import "./chunk-NGEKE4DQ.mjs";
|
|
7
|
-
import "./chunk-EH2SEQZP.mjs";
|
|
8
7
|
import "./chunk-EOKQCSHI.mjs";
|
|
8
|
+
import "./chunk-EH2SEQZP.mjs";
|
|
9
9
|
export {
|
|
10
10
|
copyAssets,
|
|
11
11
|
generateMarkdown,
|
package/dist/scan.js
CHANGED
|
@@ -5579,7 +5579,7 @@ function generateMarkdown(techs, assetsPath, availableLogos) {
|
|
|
5579
5579
|
}
|
|
5580
5580
|
|
|
5581
5581
|
// src/scan.ts
|
|
5582
|
-
var BASE_DIR = import_path2.default.join(process.cwd(), "stackscan");
|
|
5582
|
+
var BASE_DIR = import_path2.default.join(process.cwd(), "public", "stackscan");
|
|
5583
5583
|
var SKIPPED_TECHS = [
|
|
5584
5584
|
"react-dom"
|
|
5585
5585
|
];
|
|
@@ -5591,13 +5591,13 @@ async function scan(options = {}) {
|
|
|
5591
5591
|
if (!import_fs.default.existsSync(BASE_DIR)) {
|
|
5592
5592
|
console.log(`Creating stackscan directory at: ${BASE_DIR}`);
|
|
5593
5593
|
import_fs.default.mkdirSync(BASE_DIR, { recursive: true });
|
|
5594
|
-
console.log('Please place your project folders inside "stackscan/" and run this command again.');
|
|
5594
|
+
console.log('Please place your project folders inside "public/stackscan/" and run this command again.');
|
|
5595
5595
|
process.exit(0);
|
|
5596
5596
|
}
|
|
5597
5597
|
const entries = import_fs.default.readdirSync(BASE_DIR, { withFileTypes: true });
|
|
5598
5598
|
const projectDirs = entries.filter((dirent) => dirent.isDirectory() && dirent.name !== "input" && dirent.name !== "output");
|
|
5599
5599
|
if (projectDirs.length === 0) {
|
|
5600
|
-
console.log('\u26A0\uFE0F No project directories found in "stackscan/".');
|
|
5600
|
+
console.log('\u26A0\uFE0F No project directories found in "public/stackscan/".');
|
|
5601
5601
|
return;
|
|
5602
5602
|
}
|
|
5603
5603
|
console.log(`Found ${projectDirs.length} projects to process.
|
package/dist/scan.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
scan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DYBWKLM7.mjs";
|
|
4
4
|
import "./chunk-LSUI3VI4.mjs";
|
|
5
|
-
import "./chunk-ZH22D4SN.mjs";
|
|
6
|
-
import "./chunk-NGEKE4DQ.mjs";
|
|
7
|
-
import "./chunk-EH2SEQZP.mjs";
|
|
8
5
|
import "./chunk-LB3L25FS.mjs";
|
|
6
|
+
import "./chunk-UJM3S22V.mjs";
|
|
7
|
+
import "./chunk-NGEKE4DQ.mjs";
|
|
9
8
|
import "./chunk-EOKQCSHI.mjs";
|
|
9
|
+
import "./chunk-EH2SEQZP.mjs";
|
|
10
10
|
export {
|
|
11
11
|
scan
|
|
12
12
|
};
|
package/dist/sync.js
CHANGED
|
@@ -5579,7 +5579,7 @@ function generateMarkdown(techs, assetsPath, availableLogos) {
|
|
|
5579
5579
|
}
|
|
5580
5580
|
|
|
5581
5581
|
// src/sync.ts
|
|
5582
|
-
var BASE_DIR = import_path2.default.join(process.cwd(), "stackscan");
|
|
5582
|
+
var BASE_DIR = import_path2.default.join(process.cwd(), "public", "stackscan");
|
|
5583
5583
|
var SKIPPED_TECHS = [
|
|
5584
5584
|
"react-dom"
|
|
5585
5585
|
];
|
|
@@ -5591,13 +5591,13 @@ async function sync(options = {}) {
|
|
|
5591
5591
|
if (!import_fs.default.existsSync(BASE_DIR)) {
|
|
5592
5592
|
console.log(`Creating stackscan directory at: ${BASE_DIR}`);
|
|
5593
5593
|
import_fs.default.mkdirSync(BASE_DIR, { recursive: true });
|
|
5594
|
-
console.log('Please place your project folders inside "stackscan/" and run this command again.');
|
|
5594
|
+
console.log('Please place your project folders inside "public/stackscan/" and run this command again.');
|
|
5595
5595
|
process.exit(0);
|
|
5596
5596
|
}
|
|
5597
5597
|
const entries = import_fs.default.readdirSync(BASE_DIR, { withFileTypes: true });
|
|
5598
5598
|
const projectDirs = entries.filter((dirent) => dirent.isDirectory() && dirent.name !== "input" && dirent.name !== "output");
|
|
5599
5599
|
if (projectDirs.length === 0) {
|
|
5600
|
-
console.log('\u26A0\uFE0F No project directories found in "stackscan/".');
|
|
5600
|
+
console.log('\u26A0\uFE0F No project directories found in "public/stackscan/".');
|
|
5601
5601
|
return;
|
|
5602
5602
|
}
|
|
5603
5603
|
console.log(`Found ${projectDirs.length} projects to process.
|
package/dist/sync.mjs
CHANGED
|
@@ -1,160 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import
|
|
5
|
-
copyAssets,
|
|
6
|
-
generateMarkdown
|
|
7
|
-
} from "./chunk-ZH22D4SN.mjs";
|
|
8
|
-
import "./chunk-NGEKE4DQ.mjs";
|
|
9
|
-
import {
|
|
10
|
-
simple_icons_hex_default
|
|
11
|
-
} from "./chunk-EH2SEQZP.mjs";
|
|
2
|
+
sync
|
|
3
|
+
} from "./chunk-XS2LU2MN.mjs";
|
|
4
|
+
import "./chunk-LSUI3VI4.mjs";
|
|
12
5
|
import "./chunk-LB3L25FS.mjs";
|
|
6
|
+
import "./chunk-UJM3S22V.mjs";
|
|
7
|
+
import "./chunk-NGEKE4DQ.mjs";
|
|
13
8
|
import "./chunk-EOKQCSHI.mjs";
|
|
14
|
-
|
|
15
|
-
// src/sync.ts
|
|
16
|
-
import fs from "fs";
|
|
17
|
-
import path from "path";
|
|
18
|
-
var BASE_DIR = path.join(process.cwd(), "stackscan");
|
|
19
|
-
var SKIPPED_TECHS = [
|
|
20
|
-
"react-dom"
|
|
21
|
-
];
|
|
22
|
-
async function sync(options = {}) {
|
|
23
|
-
console.log("\u{1F680} Starting Sync...");
|
|
24
|
-
if (options.color) {
|
|
25
|
-
console.log(`\u{1F3A8} Color mode: ${options.color}`);
|
|
26
|
-
}
|
|
27
|
-
if (!fs.existsSync(BASE_DIR)) {
|
|
28
|
-
console.log(`Creating stackscan directory at: ${BASE_DIR}`);
|
|
29
|
-
fs.mkdirSync(BASE_DIR, { recursive: true });
|
|
30
|
-
console.log('Please place your project folders inside "stackscan/" and run this command again.');
|
|
31
|
-
process.exit(0);
|
|
32
|
-
}
|
|
33
|
-
const entries = fs.readdirSync(BASE_DIR, { withFileTypes: true });
|
|
34
|
-
const projectDirs = entries.filter((dirent) => dirent.isDirectory() && dirent.name !== "input" && dirent.name !== "output");
|
|
35
|
-
if (projectDirs.length === 0) {
|
|
36
|
-
console.log('\u26A0\uFE0F No project directories found in "stackscan/".');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
console.log(`Found ${projectDirs.length} projects to process.
|
|
40
|
-
`);
|
|
41
|
-
const allProjects = [];
|
|
42
|
-
const allTechs = [];
|
|
43
|
-
for (const dir of projectDirs) {
|
|
44
|
-
const projectPath = path.join(BASE_DIR, dir.name);
|
|
45
|
-
const packageJsonPath = path.join(projectPath, "package.json");
|
|
46
|
-
if (fs.existsSync(packageJsonPath)) {
|
|
47
|
-
try {
|
|
48
|
-
const content = fs.readFileSync(packageJsonPath, "utf-8");
|
|
49
|
-
const pkg = JSON.parse(content);
|
|
50
|
-
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
51
|
-
const detectedTechs = [];
|
|
52
|
-
Object.keys(allDeps).forEach((dep) => {
|
|
53
|
-
if (SKIPPED_TECHS.includes(dep)) return;
|
|
54
|
-
if (techMap[dep]) {
|
|
55
|
-
const tech = techMap[dep];
|
|
56
|
-
let color = null;
|
|
57
|
-
if (options.color === "white") color = "#FFFFFF";
|
|
58
|
-
else if (options.color === "black") color = "#000000";
|
|
59
|
-
else if (options.color && options.color.startsWith("#")) color = options.color;
|
|
60
|
-
else {
|
|
61
|
-
const depSlug = dep.toLowerCase();
|
|
62
|
-
const nameSlug = tech.name.toLowerCase();
|
|
63
|
-
const nameSlugNoSpaces = tech.name.toLowerCase().replace(/\s+/g, "");
|
|
64
|
-
const hex = simple_icons_hex_default[depSlug] || simple_icons_hex_default[nameSlug] || simple_icons_hex_default[nameSlugNoSpaces];
|
|
65
|
-
if (hex) color = `#${hex}`;
|
|
66
|
-
}
|
|
67
|
-
detectedTechs.push({
|
|
68
|
-
name: tech.name,
|
|
69
|
-
slug: dep,
|
|
70
|
-
logo: tech.logo,
|
|
71
|
-
// Raw path for resolution
|
|
72
|
-
color
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
let uniqueTechs = Array.from(new Set(detectedTechs.map((t) => t.slug))).map((slug) => detectedTechs.find((t) => t.slug === slug));
|
|
77
|
-
const seenLogos = /* @__PURE__ */ new Set();
|
|
78
|
-
uniqueTechs = uniqueTechs.filter((t) => {
|
|
79
|
-
if (seenLogos.has(t.logo)) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
seenLogos.add(t.logo);
|
|
83
|
-
return true;
|
|
84
|
-
});
|
|
85
|
-
const assetsDir = path.join(process.cwd(), "public", "assets", "logos");
|
|
86
|
-
if (options.copyAssets !== false) {
|
|
87
|
-
await copyAssets(uniqueTechs, assetsDir, { colorMode: options.color });
|
|
88
|
-
}
|
|
89
|
-
const techsWithUrls = uniqueTechs.map((t) => ({
|
|
90
|
-
...t,
|
|
91
|
-
logo: `https://raw.githubusercontent.com/benjamindotdev/stackscan/main/public/assets/logos/${t.logo}`,
|
|
92
|
-
relativePath: `./public/assets/logos/${t.logo}`
|
|
93
|
-
}));
|
|
94
|
-
allTechs.push(...techsWithUrls);
|
|
95
|
-
fs.writeFileSync(
|
|
96
|
-
path.join(projectPath, "stack.json"),
|
|
97
|
-
JSON.stringify(techsWithUrls, null, 2)
|
|
98
|
-
);
|
|
99
|
-
const mdContent = generateMarkdown(techsWithUrls);
|
|
100
|
-
fs.writeFileSync(path.join(projectPath, "stack.md"), mdContent);
|
|
101
|
-
allProjects.push({
|
|
102
|
-
name: dir.name,
|
|
103
|
-
techs: techsWithUrls
|
|
104
|
-
});
|
|
105
|
-
console.log(`\u2705 ${dir.name.padEnd(20)} -> stack.json (${uniqueTechs.length} techs)`);
|
|
106
|
-
} catch (err) {
|
|
107
|
-
console.error(`\u274C Error processing ${dir.name}:`, err.message);
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
console.warn(`\u26A0\uFE0F Skipping "${dir.name}": No package.json found.`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (allProjects.length > 0) {
|
|
114
|
-
updateRootReadme(allProjects);
|
|
115
|
-
}
|
|
116
|
-
console.log("\n\u2728 Sync complete.");
|
|
117
|
-
}
|
|
118
|
-
function updateRootReadme(projects) {
|
|
119
|
-
const readmePath = path.join(process.cwd(), "README.md");
|
|
120
|
-
if (!fs.existsSync(readmePath)) {
|
|
121
|
-
console.log("\u26A0\uFE0F No root README.md found to update.");
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
let readmeContent = fs.readFileSync(readmePath, "utf-8");
|
|
125
|
-
const startMarker = "<!-- STACKSYNC_START -->";
|
|
126
|
-
const endMarker = "<!-- STACKSYNC_END -->";
|
|
127
|
-
let newSection = `${startMarker}
|
|
128
|
-
## My Projects
|
|
129
|
-
|
|
130
|
-
`;
|
|
131
|
-
for (const p of projects) {
|
|
132
|
-
newSection += `### ${p.name}
|
|
133
|
-
`;
|
|
134
|
-
newSection += `<p>
|
|
135
|
-
`;
|
|
136
|
-
for (const t of p.techs) {
|
|
137
|
-
const src = t.relativePath || t.logo;
|
|
138
|
-
newSection += ` <img src="${src}" alt="${t.name}" height="25" style="margin-right: 10px;" />
|
|
139
|
-
`;
|
|
140
|
-
}
|
|
141
|
-
newSection += `</p>
|
|
142
|
-
|
|
143
|
-
`;
|
|
144
|
-
}
|
|
145
|
-
newSection += `${endMarker}`;
|
|
146
|
-
if (readmeContent.includes(startMarker) && readmeContent.includes(endMarker)) {
|
|
147
|
-
const regex = new RegExp(`${startMarker}[\\s\\S]*?${endMarker}`);
|
|
148
|
-
readmeContent = readmeContent.replace(regex, newSection);
|
|
149
|
-
console.log(`\u{1F4DD} Updated root README.md with ${projects.length} projects.`);
|
|
150
|
-
} else {
|
|
151
|
-
readmeContent += `
|
|
152
|
-
|
|
153
|
-
${newSection}`;
|
|
154
|
-
console.log(`\u{1F4DD} Appended projects to root README.md.`);
|
|
155
|
-
}
|
|
156
|
-
fs.writeFileSync(readmePath, readmeContent);
|
|
157
|
-
}
|
|
9
|
+
import "./chunk-EH2SEQZP.mjs";
|
|
158
10
|
export {
|
|
159
11
|
sync
|
|
160
12
|
};
|
package/dist/types.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stackscan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Automatically detect tech stacks from repositories and generate logos, JSON, and markdown for portfolios.",
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
9
|
"stackscan": "./dist/cli.js"
|