MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / addBuildFilesFromPackageJson

Function addBuildFilesFromPackageJson

scripts/create-github-source-zip.js:32–52  ·  view source on GitHub ↗
(set)

Source from the content-addressed store, hash-verified

30}
31
32function addBuildFilesFromPackageJson(set) {
33 const pkg = JSON.parse(fs.readFileSync(path.join(projectRoot, 'package.json'), 'utf8'));
34 const files = pkg.build?.files || [];
35 for (const pattern of files) {
36 if (pattern.startsWith('node_modules/')) continue;
37 if (pattern === 'guide/*') {
38 const acc = [];
39 walkDirFiles(path.join(projectRoot, 'guide'), 'guide', acc);
40 acc.forEach((r) => set.add(r));
41 continue;
42 }
43 if (pattern === 'vendor/**' || pattern === 'vendor/**/*') {
44 const acc = [];
45 walkDirFiles(path.join(projectRoot, 'vendor'), 'vendor', acc);
46 acc.forEach((r) => set.add(r));
47 continue;
48 }
49 if (pattern.includes('*')) continue;
50 set.add(pattern);
51 }
52}
53
54function addRootMediaForDocker(set) {
55 let names;

Callers 1

mainFunction · 0.85

Calls 2

walkDirFilesFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected