-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from rycont/create-document
Create document
- Loading branch information
Showing
92 changed files
with
1,407 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
yaksok.js | ||
runtest.ts | ||
.vscode | ||
cov | ||
cov | ||
docs/api/ | ||
node_modules/ | ||
docs/.vitepress/cache/ | ||
docs/.vitepress/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import typedoc from 'typedoc' | ||
|
||
const app = await typedoc.Application.bootstrapWithPlugins({ | ||
entryPoints: ['./src/index.ts'], | ||
name: 'yaksok.ts', | ||
}) | ||
|
||
const outputDir = 'docs/api' | ||
const VALID_OPERATIONS = ['create', 'modify', 'rename', 'remove'] | ||
|
||
const isWatch = Deno.args.includes('--watch') | ||
const CWD = Deno.cwd() | ||
|
||
async function buildMarkdownDocs() { | ||
const project = await app.convert() | ||
if (project) { | ||
await app.generateDocs(project, outputDir) | ||
} | ||
} | ||
|
||
await buildMarkdownDocs() | ||
|
||
if (!isWatch) { | ||
Deno.exit(0) | ||
} | ||
|
||
console.log('Waiting for file changes...') | ||
|
||
const watcher = Deno.watchFs('./src', { | ||
recursive: true, | ||
}) | ||
|
||
for await (const event of watcher) { | ||
const type = event.kind | ||
const isValidOperation = VALID_OPERATIONS.includes(type) | ||
|
||
const paths = event.paths.map(clarifyPath) | ||
const message = `[${type}] ${paths.join(', ')}` | ||
|
||
if (!isValidOperation) { | ||
continue | ||
} | ||
|
||
console.log(message) | ||
buildMarkdownDocs() | ||
} | ||
|
||
function clarifyPath(path: string) { | ||
if (path.startsWith(CWD)) { | ||
path = path.slice(CWD.length) | ||
} | ||
|
||
while (true) { | ||
if (path.startsWith('/')) { | ||
path = path.slice(1) | ||
continue | ||
} | ||
|
||
if (path.startsWith('./')) { | ||
path = path.slice(1) | ||
continue | ||
} | ||
|
||
break | ||
} | ||
|
||
return path | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
{ | ||
"imports": { | ||
"assert": "https://deno.land/[email protected]/assert/mod.ts" | ||
"@vue/runtime-dom": "npm:@vue/runtime-dom@^3.5.12", | ||
"@vueuse/core": "npm:@vueuse/core@^11.2.0", | ||
"ansi-to-html": "npm:ansi-to-html@^0.7.2", | ||
"assert": "https://deno.land/[email protected]/assert/mod.ts", | ||
"quickjs-emscripten": "npm:quickjs-emscripten@^0.31.0", | ||
"quickjs-emscripten-core": "npm:quickjs-emscripten-core@^0.31.0", | ||
"typedoc": "npm:[email protected]", | ||
"typedoc-plugin-markdown": "npm:typedoc-plugin-markdown@^4.2.10", | ||
"vitepress": "npm:vitepress@^1.4.3", | ||
"vitepress-plugin-auto-sidebar": "npm:vitepress-plugin-auto-sidebar@^1.2.0", | ||
"vue": "npm:vue@^3.5.12" | ||
}, | ||
"tasks": { | ||
"coverage": "rm -rf ./cov && deno test --allow-read --parallel --coverage=cov && deno coverage --detailed ./cov && rm -rf ./cov", | ||
"coverage-list": "rm -rf ./cov && deno test --allow-read --parallel --coverage=cov && deno coverage ./cov && rm -rf ./cov", | ||
"build": "deno run --allow-net --allow-write --allow-read --allow-env --allow-run ./bundle.ts", | ||
"build-demo": "deno task build && mv ./dist/index.js ./demo/yaksok.js" | ||
"typedoc": "deno run --allow-read --allow-write --allow-env --allow-run ./create-docs.ts", | ||
"vitepress-dev": "deno run -A npm:vitepress dev docs", | ||
"vitepress-build": "deno run -A npm:vitepress build docs", | ||
"docs-dev": "deno task typedoc --watch & deno task vitepress-dev", | ||
"docs-build": "deno task typedoc && deno task vitepress-build" | ||
}, | ||
"lint": { | ||
"rules": { | ||
|
@@ -16,6 +29,7 @@ | |
} | ||
}, | ||
"name": "@yaksok-ts/core", | ||
"version": "0.1.10", | ||
"exports": "./index.ts" | ||
"version": "0.1.11", | ||
"exports": "./src/index.ts", | ||
"nodeModulesDir": "auto" | ||
} |
Oops, something went wrong.