@webneat/codewiki 0.0.5 → 0.0.6
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/README.md +173 -24
- package/dist/bin.cjs +54 -41
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +54 -41
- package/dist/bin.js.map +1 -1
- package/dist/cli.cjs +54 -41
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +54 -41
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -578,7 +578,7 @@ var symbols2 = {
|
|
|
578
578
|
where: {}
|
|
579
579
|
};
|
|
580
580
|
var external_dependencies2 = {
|
|
581
|
-
select: ["id", "package", "subpath", "name", "state", "error"],
|
|
581
|
+
select: ["id", "package", "subpath", "name", "is_builtin", "state", "error"],
|
|
582
582
|
order_by: ["id", "asc"],
|
|
583
583
|
limit: 20,
|
|
584
584
|
offset: 0,
|
|
@@ -2933,12 +2933,23 @@ var describe = new import_commander3.Command("describe");
|
|
|
2933
2933
|
describe.description("Show the next item to describe");
|
|
2934
2934
|
describe.action(async () => {
|
|
2935
2935
|
const wiki = await load_wiki();
|
|
2936
|
-
const
|
|
2937
|
-
if (
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2936
|
+
const result = wiki.to_describe(1);
|
|
2937
|
+
if (result.type === "none") {
|
|
2938
|
+
return env.log("All items are described!");
|
|
2939
|
+
}
|
|
2940
|
+
if (result.type === "dependencies" && result.items.length > 0) {
|
|
2941
|
+
return describe_dependency(result.items[0]);
|
|
2942
|
+
}
|
|
2943
|
+
if (result.type === "symbols" && result.items.length > 0) {
|
|
2944
|
+
return describe_symbol(wiki, result.items[0]);
|
|
2945
|
+
}
|
|
2946
|
+
if (result.type === "files" && result.items.length > 0) {
|
|
2947
|
+
return describe_file(result.items[0]);
|
|
2948
|
+
}
|
|
2949
|
+
if (result.type === "directories" && result.items.length > 0) {
|
|
2950
|
+
return describe_directory(result.items[0]);
|
|
2951
|
+
}
|
|
2952
|
+
env.log("No items to describe.");
|
|
2942
2953
|
});
|
|
2943
2954
|
function describe_dependency(dep) {
|
|
2944
2955
|
env.log(import_dedent2.default`
|
|
@@ -2954,40 +2965,42 @@ function describe_dependency(dep) {
|
|
|
2954
2965
|
\`codewiki dependencies set-description ${dep.id} <markdown-file>\`
|
|
2955
2966
|
`);
|
|
2956
2967
|
}
|
|
2957
|
-
function
|
|
2958
|
-
const
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2968
|
+
function describe_symbol(wiki, sym) {
|
|
2969
|
+
const file = wiki.files.get(sym.file_id);
|
|
2970
|
+
env.log(import_dedent2.default`
|
|
2971
|
+
Your task is to describe the following symbol:
|
|
2972
|
+
|
|
2973
|
+
name: ${sym.name}
|
|
2974
|
+
type: ${sym.type}
|
|
2975
|
+
file: ${file?.path || "unknown"}
|
|
2976
|
+
exported: ${sym.is_exported}
|
|
2977
|
+
|
|
2978
|
+
Write a concise developer documentation for this ${sym.type} into a markdown file, then run:
|
|
2979
|
+
|
|
2980
|
+
codewiki symbols set-description ${sym.id} <markdown-file>
|
|
2981
|
+
`);
|
|
2982
|
+
}
|
|
2983
|
+
function describe_file(file) {
|
|
2984
|
+
env.log(import_dedent2.default`
|
|
2985
|
+
Your task is to describe the following file:
|
|
2986
|
+
|
|
2987
|
+
path: ${file.path}
|
|
2988
|
+
|
|
2989
|
+
Write a concise description of this file's purpose and contents into a markdown file, then run:
|
|
2990
|
+
|
|
2991
|
+
codewiki files set-description ${file.id} <markdown-file>
|
|
2992
|
+
`);
|
|
2993
|
+
}
|
|
2994
|
+
function describe_directory(dir) {
|
|
2995
|
+
env.log(import_dedent2.default`
|
|
2996
|
+
Your task is to describe the following directory:
|
|
2997
|
+
|
|
2998
|
+
path: ${dir.path}
|
|
2999
|
+
|
|
3000
|
+
Write a concise description of this directory's purpose and contents into a markdown file, then run:
|
|
3001
|
+
|
|
3002
|
+
codewiki directories set-description ${dir.id} <markdown-file>
|
|
3003
|
+
`);
|
|
2991
3004
|
}
|
|
2992
3005
|
|
|
2993
3006
|
// src/cli/commands/files/index.ts
|