Skip to content

Commit

Permalink
wayyyyy closer
Browse files Browse the repository at this point in the history
  • Loading branch information
brekk committed Jan 29, 2024
1 parent 6f58dde commit 4b27ce9
Show file tree
Hide file tree
Showing 10 changed files with 623 additions and 781 deletions.
905 changes: 319 additions & 586 deletions apps/docs/dr-generated.json

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions packages/doctor-general/__snapshots__/comment.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`processCurriedComment 1`] = `
[
{
"addTo": "",
"end": 49,
"fileGroup": "",
"keywords": [
"@curried",
"@example",
"@future",
],
"lines": [
"/**",
"Consume external commands as a Future-wrapped value.",
"@future",
"@curried",
" 1. execWithConfig - Passes all possible configuration values plus a cancellation function.",
" *",
" @example",
" \`\`\`js",
" import { execWithConfig } from 'kiddo'",
" import { fork } from 'fluture'",
" fork(console.warn)(console.log)(",
" execWithConfig(",
" function customCancellationFunction() {},",
" 'echo',",
" { cleanup: true },",
" ['ahoy']",
" )",
" )",
" \`\`\`",
" *",
" 2. execWithCancel - Eschews any configuration and instead only expects a cancellation function, command and arguments.",
" *",
" @example",
" \`\`\`js",
" import { execWithCancel } from 'kiddo'",
" import { fork } from 'fluture'",
" fork(console.warn)(console.log)(",
" execWithCancel(",
" function customCancellationFunction() {},",
" 'echo',",
" ['ahoy']",
" )",
" )",
" \`\`\`",
" *",
" 3. exec - Eschews any configuration or cancellation function. Needs only command and arguments.",
" *",
" @example",
" \`\`\`js test=true",
" import { fork } from 'fluture'",
" // drgen-import-above",
" const blah = Math.round(Math.random() * 100000)",
" fork(done)(z => {",
" expect(z.stdout).toEqual('' + blah)",
" done()",
" })(exec('echo', [blah]))",
" \`\`\`",
],
"links": [],
"start": 1,
"structure": {
"curried": [
{
"lines": "\`\`\`js
import { execWithConfig } from 'kiddo'
import { fork } from 'fluture'
fork(console.warn)(console.log)(
execWithConfig(
function customCancellationFunction() {},
'echo',
{ cleanup: true },
['ahoy']
)
)
\`\`\`",
"name": "execWithConfig",
"summary": "Passes all possible configuration values plus a cancellation function.",
},
{
"lines": "\`\`\`js
import { execWithCancel } from 'kiddo'
import { fork } from 'fluture'
fork(console.warn)(console.log)(
execWithCancel(
function customCancellationFunction() {},
'echo',
['ahoy']
)
)
\`\`\`",
"name": "execWithCancel",
"summary": "Eschews any configuration and instead only expects a cancellation function, command and arguments.",
},
{
"lines": "\`\`\`js test=true
import { fork } from 'fluture'
// drgen-import-above
const blah = Math.round(Math.random() * 100000)
fork(done)(z => {
expect(z.stdout).toEqual('' + blah)
done()
})(exec('echo', [blah]))
\`\`\`",
"name": "exec",
"summary": "Eschews any configuration or cancellation function. Needs only command and arguments.",
},
],
"description": "Consume external commands as a Future-wrapped value.",
"future": true,
},
"summary": "Consume external commands as a Future-wrapped value.",
},
]
`;
10 changes: 8 additions & 2 deletions packages/doctor-general/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ exports[`default export 1`] = `
"MAGIC_COMMENT_START": "/**",
"MAGIC_IMPORT_KEY": "drgen-import-above",
"TESTABLE_EXAMPLE": "test=true",
"WHITESPACE_PRESERVING_TAGS": [
"example",
"curried",
],
"addLineNumbers": [Function],
"capitalToKebab": [Function],
"cleanupKeywords": [Function],
"drgen": [Function],
"findJSDocKeywords": [Function],
"formatComment": [Function],
"getCurriedDefinition": [Function],
"getExample": [Function],
"getImportsForTests": [Function],
"getPageSummary": [Function],
"groupContiguousBlocks": [Function],
"handleEphemeralKeywords": [Function],
"handleMatches": [Function],
"hasExample": [Function],
"histogramBy": [Function],
Expand All @@ -45,14 +47,18 @@ exports[`default export 1`] = `
"matchLinks": [Function],
"monorepoRunner": [Function],
"nixKeyword": [Function],
"objectifyAllComments": [Function],
"objectifyComments": [Function],
"parse": [Function],
"parseFile": [Function],
"processComments": [Function],
"processCurriedComment": [Function],
"processEphemeral": [Function],
"rarestBy": [Function],
"readPackageJsonWorkspaces": [Function],
"renderComments": [Function],
"safeTrim": [Function],
"segmentBlock": [Function],
"stripEmptyCommentLines": [Function],
"stripLeadingComment": [Function],
"stripLeadingHyphen": [Function],
Expand Down
Loading

0 comments on commit 4b27ce9

Please sign in to comment.