@techninja/clearstack 0.4.23 → 0.4.25
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/lib/check.js +1 -1
- package/lib/spec-config.js +11 -2
- package/package.json +1 -1
package/lib/check.js
CHANGED
|
@@ -53,7 +53,7 @@ export async function buildChecks(dir, cfg, cmds) {
|
|
|
53
53
|
{ key: 'tests', name: `Tests (max ${cfg.testMax} lines)`,
|
|
54
54
|
run: (o) => checkFileLines(dir, cfg.codeExt, cfg.testMax, cfg.ignore, `Tests (max ${cfg.testMax} lines)`, { include: cfg.testPattern, ...o }) },
|
|
55
55
|
{ key: 'docs', name: `Docs (max ${cfg.docsMax} lines)`,
|
|
56
|
-
run: (o) => checkFileLines(dir, cfg.docsExt, cfg.docsMax, cfg.ignore, `Docs (max ${cfg.docsMax} lines)`, o) },
|
|
56
|
+
run: (o) => checkFileLines(dir, cfg.docsExt, cfg.docsMax, cfg.ignore, `Docs (max ${cfg.docsMax} lines)`, { exclude: cfg.docsIgnore.length ? cfg.docsIgnore : undefined, ...o }) },
|
|
57
57
|
{ key: 'imports', name: 'Import map aliases (no ../ imports)',
|
|
58
58
|
run: (o) => checkImports(dir, cfg.ignore, 'Import map aliases (no ../ imports)', o) },
|
|
59
59
|
...findTypeConfigs(dir, runner, cfg.ignore),
|
package/lib/spec-config.js
CHANGED
|
@@ -53,6 +53,7 @@ export function loadConfig(projectDir) {
|
|
|
53
53
|
testPattern: env.SPEC_TEST_PATTERN || '.test.js',
|
|
54
54
|
ignore: ignoreDirs,
|
|
55
55
|
watchDirs: watchDirs,
|
|
56
|
+
docsIgnore: env.SPEC_DOCS_IGNORE ? mergeList('SPEC_DOCS_IGNORE') : [],
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -110,8 +111,16 @@ export function buildCmds(projectDir, opts) {
|
|
|
110
111
|
const audit = runner === 'pnpm exec'
|
|
111
112
|
? 'pnpm audit --prod --ignore-registry-errors'
|
|
112
113
|
: 'npm audit --omit=dev';
|
|
113
|
-
const
|
|
114
|
-
const
|
|
114
|
+
const cfg = loadConfig(projectDir);
|
|
115
|
+
const extraIgnoreGlobs = cfg.rawEnv.SPEC_PRETTIER_IGNORE
|
|
116
|
+
? cfg.rawEnv.SPEC_PRETTIER_IGNORE.split(',').map((p) => `"!${p.trim()}"`).join(' ')
|
|
117
|
+
: '';
|
|
118
|
+
const prettier = (cmd) => `${runner} prettier --config .configs/.prettierrc --ignore-path .configs/.prettierignore --${cmd} "src/**/*.{js,css}" "!src/vendor/**" "!src/icons.json"${extraIgnoreGlobs ? ' ' + extraIgnoreGlobs : ''} scripts`;
|
|
119
|
+
const stylelintIgnore = cfg.ignore
|
|
120
|
+
.filter((d) => d.startsWith('src/'))
|
|
121
|
+
.map((d) => ` "!${d.endsWith('/**') ? d : d + '/**'}"`)
|
|
122
|
+
.join('');
|
|
123
|
+
const stylelint = (extra = '') => `${runner} stylelint --config .configs/.stylelintrc.json "src/**/*.css"${stylelintIgnore}${extra}`;
|
|
115
124
|
if (opts?.watch) return {
|
|
116
125
|
lint: `${runner} eslint --config .configs/eslint.config.js .`,
|
|
117
126
|
stylelint: stylelint(),
|
package/package.json
CHANGED