@chemx/starter-kit 26.9.9-700 → 26.9.9-720
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/cli/audit.js +16 -4
- package/cli/index.js +3 -2
- package/docs/CHANGELOG.md +3 -0
- package/package.json +1 -1
package/cli/audit.js
CHANGED
|
@@ -183,6 +183,18 @@ export const auditFile = (filePath, relativePath) => {
|
|
|
183
183
|
return violations;
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
+
const IGNORED_DIRS = new Set(['node_modules', 'dist', 'build', 'vendor', '.git', '.next', '.turbo', '.output', 'out']);
|
|
187
|
+
|
|
188
|
+
const isSourceFile = (name) => {
|
|
189
|
+
return (
|
|
190
|
+
/\.(tsx|ts|jsx|js|vue)$/.test(name) &&
|
|
191
|
+
!name.endsWith('.d.ts') &&
|
|
192
|
+
!name.includes('.test.') &&
|
|
193
|
+
!name.includes('.spec.') &&
|
|
194
|
+
!name.includes('.min.')
|
|
195
|
+
);
|
|
196
|
+
};
|
|
197
|
+
|
|
186
198
|
export const scanDirectory = (targetDir, baseDir) => {
|
|
187
199
|
let results = [];
|
|
188
200
|
if (!fs.existsSync(targetDir)) return results;
|
|
@@ -193,10 +205,10 @@ export const scanDirectory = (targetDir, baseDir) => {
|
|
|
193
205
|
const relPath = path.relative(baseDir, fullPath);
|
|
194
206
|
|
|
195
207
|
if (entry.isDirectory()) {
|
|
196
|
-
if (!
|
|
208
|
+
if (!IGNORED_DIRS.has(entry.name)) {
|
|
197
209
|
results = results.concat(scanDirectory(fullPath, baseDir));
|
|
198
210
|
}
|
|
199
|
-
} else if (
|
|
211
|
+
} else if (isSourceFile(entry.name)) {
|
|
200
212
|
results = results.concat(auditFile(fullPath, relPath));
|
|
201
213
|
}
|
|
202
214
|
}
|
|
@@ -211,10 +223,10 @@ const countTotalScannedFiles = (targetDir) => {
|
|
|
211
223
|
for (const entry of entries) {
|
|
212
224
|
const fullPath = path.join(targetDir, entry.name);
|
|
213
225
|
if (entry.isDirectory()) {
|
|
214
|
-
if (!
|
|
226
|
+
if (!IGNORED_DIRS.has(entry.name)) {
|
|
215
227
|
count += countTotalScannedFiles(fullPath);
|
|
216
228
|
}
|
|
217
|
-
} else if (
|
|
229
|
+
} else if (isSourceFile(entry.name)) {
|
|
218
230
|
count += 1;
|
|
219
231
|
}
|
|
220
232
|
}
|
package/cli/index.js
CHANGED
|
@@ -41,10 +41,11 @@ const hasGum = () => {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const gumChoose = (options, header = '') => {
|
|
44
|
-
const args = ['choose'
|
|
44
|
+
const args = ['choose'];
|
|
45
45
|
if (header) {
|
|
46
|
-
args.
|
|
46
|
+
args.push(`--header=${header}`, '--header.foreground=81');
|
|
47
47
|
}
|
|
48
|
+
args.push('--cursor.foreground=81', ...options);
|
|
48
49
|
const res = spawnSync('gum', args, { encoding: 'utf-8', stdio: ['inherit', 'pipe', 'inherit'] });
|
|
49
50
|
return (res.stdout || '').trim();
|
|
50
51
|
};
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -43,5 +43,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
43
43
|
- Removed embedded offline blueprint fallbacks and preview bypass keys from CLI executable (`cli/index.js`).
|
|
44
44
|
- Restricted npm package distribution via `files` whitelist and `.npmignore` to prevent leaking private blueprints and hooks in public tarballs.
|
|
45
45
|
- Added explicit `--tag` support and automatic default fallback for prerelease/CalVer versions in multi-target publisher (`scripts/publish-both.mjs`).
|
|
46
|
+
- Removed unscoped `chem-x` target from publisher script due to npm registry similarity protection with `chemx`.
|
|
47
|
+
- Excluded 3rd-party `vendor` and `build` directories, as well as minified bundles (`*.min.*`), from the AST context hazard audit to eliminate false positives on bundled external libraries.
|
|
48
|
+
- Fixed argument ordering in `gumChoose` to pass `--header` and styling flags to the `choose` subcommand rather than prepending to the parent binary.
|
|
46
49
|
|
|
47
50
|
|