format: cover folded skills' js/ts scripts with repo prettier
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
The repo format:check glob covers ts/js alongside md; four non-markdown scripts inside the folded tree were flagged after the md pass. Same pinned prettier 3.8.1, same markup-only class (verified: node --check still passes on the js files).
This commit is contained in:
@@ -72,12 +72,10 @@ function draw() {
|
|||||||
// - Generate everything in setup()
|
// - Generate everything in setup()
|
||||||
// - Call noLoop() in setup()
|
// - Call noLoop() in setup()
|
||||||
// - draw() doesn't do much or can be empty
|
// - draw() doesn't do much or can be empty
|
||||||
|
|
||||||
// Option 2: Animated generation (continuous)
|
// Option 2: Animated generation (continuous)
|
||||||
// - Update your system each frame
|
// - Update your system each frame
|
||||||
// - Common patterns: particle movement, growth, evolution
|
// - Common patterns: particle movement, growth, evolution
|
||||||
// - Can optionally call noLoop() after N frames
|
// - Can optionally call noLoop() after N frames
|
||||||
|
|
||||||
// Option 3: User-triggered regeneration
|
// Option 3: User-triggered regeneration
|
||||||
// - Use noLoop() by default
|
// - Use noLoop() by default
|
||||||
// - Call redraw() when parameters change
|
// - Call redraw() when parameters change
|
||||||
@@ -131,11 +129,13 @@ class Entity {
|
|||||||
// Color utilities
|
// Color utilities
|
||||||
function hexToRgb(hex) {
|
function hexToRgb(hex) {
|
||||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||||
return result ? {
|
return result
|
||||||
|
? {
|
||||||
r: parseInt(result[1], 16),
|
r: parseInt(result[1], 16),
|
||||||
g: parseInt(result[2], 16),
|
g: parseInt(result[2], 16),
|
||||||
b: parseInt(result[3], 16)
|
b: parseInt(result[3], 16),
|
||||||
} : null;
|
}
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function colorFromPalette(index) {
|
function colorFromPalette(index) {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function parseFrontmatter(content: string): { frontmatter: RuleFrontmatter | nul
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
frontmatter: frontmatter as RuleFrontmatter,
|
frontmatter: frontmatter as RuleFrontmatter,
|
||||||
body: body.trim()
|
body: body.trim(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +118,7 @@ function readMetadata(): any {
|
|||||||
|
|
||||||
function readRules(): Rule[] {
|
function readRules(): Rule[] {
|
||||||
const rulesDir = path.join(__dirname, '..', 'rules');
|
const rulesDir = path.join(__dirname, '..', 'rules');
|
||||||
const files = fs.readdirSync(rulesDir)
|
const files = fs.readdirSync(rulesDir).filter((f) => f.endsWith('.md') && !f.startsWith('_'));
|
||||||
.filter(f => f.endsWith('.md') && !f.startsWith('_'));
|
|
||||||
|
|
||||||
const rules: Rule[] = [];
|
const rules: Rule[] = [];
|
||||||
|
|
||||||
@@ -144,7 +143,7 @@ function readRules(): Rule[] {
|
|||||||
frontmatter,
|
frontmatter,
|
||||||
content: body,
|
content: body,
|
||||||
category: category.name,
|
category: category.name,
|
||||||
categorySection: category.section
|
categorySection: category.section,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -21,7 +21,7 @@ export function waitForEvent(
|
|||||||
threadManager: ThreadManager,
|
threadManager: ThreadManager,
|
||||||
threadId: string,
|
threadId: string,
|
||||||
eventType: LaceEventType,
|
eventType: LaceEventType,
|
||||||
timeoutMs = 5000
|
timeoutMs = 5000,
|
||||||
): Promise<LaceEvent> {
|
): Promise<LaceEvent> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
@@ -62,7 +62,7 @@ export function waitForEventCount(
|
|||||||
threadId: string,
|
threadId: string,
|
||||||
eventType: LaceEventType,
|
eventType: LaceEventType,
|
||||||
count: number,
|
count: number,
|
||||||
timeoutMs = 5000
|
timeoutMs = 5000,
|
||||||
): Promise<LaceEvent[]> {
|
): Promise<LaceEvent[]> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
@@ -76,8 +76,8 @@ export function waitForEventCount(
|
|||||||
} else if (Date.now() - startTime > timeoutMs) {
|
} else if (Date.now() - startTime > timeoutMs) {
|
||||||
reject(
|
reject(
|
||||||
new Error(
|
new Error(
|
||||||
`Timeout waiting for ${count} ${eventType} events after ${timeoutMs}ms (got ${matchingEvents.length})`
|
`Timeout waiting for ${count} ${eventType} events after ${timeoutMs}ms (got ${matchingEvents.length})`,
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(check, 10);
|
setTimeout(check, 10);
|
||||||
@@ -113,7 +113,7 @@ export function waitForEventMatch(
|
|||||||
threadId: string,
|
threadId: string,
|
||||||
predicate: (event: LaceEvent) => boolean,
|
predicate: (event: LaceEvent) => boolean,
|
||||||
description: string,
|
description: string,
|
||||||
timeoutMs = 5000
|
timeoutMs = 5000,
|
||||||
): Promise<LaceEvent> {
|
): Promise<LaceEvent> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ function combineGraphs(blocks, skillName) {
|
|||||||
// Wrap each subgraph in a cluster for visual grouping
|
// Wrap each subgraph in a cluster for visual grouping
|
||||||
return ` subgraph cluster_${i} {
|
return ` subgraph cluster_${i} {
|
||||||
label="${block.name}";
|
label="${block.name}";
|
||||||
${body.split('\n').map(line => ' ' + line).join('\n')}
|
${body
|
||||||
|
.split('\n')
|
||||||
|
.map((line) => ' ' + line)
|
||||||
|
.join('\n')}
|
||||||
}`;
|
}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -72,7 +75,7 @@ function renderToSvg(dotContent) {
|
|||||||
return execSync('dot -Tsvg', {
|
return execSync('dot -Tsvg', {
|
||||||
input: dotContent,
|
input: dotContent,
|
||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
maxBuffer: 10 * 1024 * 1024
|
maxBuffer: 10 * 1024 * 1024,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error running dot:', err.message);
|
console.error('Error running dot:', err.message);
|
||||||
@@ -84,7 +87,7 @@ function renderToSvg(dotContent) {
|
|||||||
function main() {
|
function main() {
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
const combine = args.includes('--combine');
|
const combine = args.includes('--combine');
|
||||||
const skillDirArg = args.find(a => !a.startsWith('--'));
|
const skillDirArg = args.find((a) => !a.startsWith('--'));
|
||||||
|
|
||||||
if (!skillDirArg) {
|
if (!skillDirArg) {
|
||||||
console.error('Usage: render-graphs.js <skill-directory> [--combine]');
|
console.error('Usage: render-graphs.js <skill-directory> [--combine]');
|
||||||
|
|||||||
Reference in New Issue
Block a user