popilot 0.2.0 → 0.2.1
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/adapters/claude-code/.claude/commands/start.md +38 -10
- package/lib/setup-wizard.mjs +72 -4
- package/package.json +5 -2
- package/scaffold/.context/project.yaml.example +11 -1
- package/scaffold/spec-site/package-lock.json +1522 -0
- package/scripts/lint.mjs +56 -0
- package/scripts/typecheck.mjs +24 -0
package/scripts/lint.mjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { readdir } from 'node:fs/promises';
|
|
2
|
+
import { extname, join, relative } from 'node:path';
|
|
3
|
+
import { cwd, exit } from 'node:process';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
const ROOT = cwd();
|
|
7
|
+
const TARGET_DIRS = ['bin', 'lib', 'test', 'scripts'];
|
|
8
|
+
const JS_EXTENSIONS = new Set(['.mjs', '.js']);
|
|
9
|
+
|
|
10
|
+
async function collectScriptFiles(dir) {
|
|
11
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
12
|
+
const files = [];
|
|
13
|
+
|
|
14
|
+
for (const entry of entries) {
|
|
15
|
+
const fullPath = join(dir, entry.name);
|
|
16
|
+
|
|
17
|
+
if (entry.isDirectory()) {
|
|
18
|
+
files.push(...await collectScriptFiles(fullPath));
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ext = extname(entry.name);
|
|
23
|
+
if (JS_EXTENSIONS.has(ext)) {
|
|
24
|
+
files.push(fullPath);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return files;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function main() {
|
|
32
|
+
const allFiles = [];
|
|
33
|
+
for (const dir of TARGET_DIRS) {
|
|
34
|
+
allFiles.push(...await collectScriptFiles(join(ROOT, dir)));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const errors = [];
|
|
38
|
+
for (const file of allFiles) {
|
|
39
|
+
const result = spawnSync('node', ['--check', file], { encoding: 'utf8' });
|
|
40
|
+
if (result.status !== 0) {
|
|
41
|
+
errors.push({ file, stderr: result.stderr || result.stdout || 'syntax check failed' });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (errors.length > 0) {
|
|
46
|
+
console.error(`❌ lint failed (${errors.length} files)`);
|
|
47
|
+
for (const { file, stderr } of errors) {
|
|
48
|
+
console.error(`\n- ${relative(ROOT, file)}\n${stderr.trim()}`);
|
|
49
|
+
}
|
|
50
|
+
exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
console.log(`✅ lint passed (${allFiles.length} files)`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
await main();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { exit } from 'node:process';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
|
|
4
|
+
function run(cmd, args) {
|
|
5
|
+
const result = spawnSync(cmd, args, { stdio: 'inherit' });
|
|
6
|
+
if (result.status !== 0) {
|
|
7
|
+
exit(result.status ?? 1);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Ensure template dependencies are installed from lockfile.
|
|
12
|
+
run('npm', ['--prefix', 'scaffold/spec-site', 'ci']);
|
|
13
|
+
|
|
14
|
+
// Validate scaffold/spec-site TypeScript sources.
|
|
15
|
+
run('npm', [
|
|
16
|
+
'--prefix',
|
|
17
|
+
'scaffold/spec-site',
|
|
18
|
+
'exec',
|
|
19
|
+
'--',
|
|
20
|
+
'vue-tsc',
|
|
21
|
+
'-p',
|
|
22
|
+
'scaffold/spec-site/tsconfig.json',
|
|
23
|
+
'--noEmit',
|
|
24
|
+
]);
|