@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.js
CHANGED
|
@@ -557,7 +557,7 @@ var symbols2 = {
|
|
|
557
557
|
where: {}
|
|
558
558
|
};
|
|
559
559
|
var external_dependencies2 = {
|
|
560
|
-
select: ["id", "package", "subpath", "name", "state", "error"],
|
|
560
|
+
select: ["id", "package", "subpath", "name", "is_builtin", "state", "error"],
|
|
561
561
|
order_by: ["id", "asc"],
|
|
562
562
|
limit: 20,
|
|
563
563
|
offset: 0,
|
|
@@ -2912,12 +2912,23 @@ var describe = new Command3("describe");
|
|
|
2912
2912
|
describe.description("Show the next item to describe");
|
|
2913
2913
|
describe.action(async () => {
|
|
2914
2914
|
const wiki = await load_wiki();
|
|
2915
|
-
const
|
|
2916
|
-
if (
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2915
|
+
const result = wiki.to_describe(1);
|
|
2916
|
+
if (result.type === "none") {
|
|
2917
|
+
return env.log("All items are described!");
|
|
2918
|
+
}
|
|
2919
|
+
if (result.type === "dependencies" && result.items.length > 0) {
|
|
2920
|
+
return describe_dependency(result.items[0]);
|
|
2921
|
+
}
|
|
2922
|
+
if (result.type === "symbols" && result.items.length > 0) {
|
|
2923
|
+
return describe_symbol(wiki, result.items[0]);
|
|
2924
|
+
}
|
|
2925
|
+
if (result.type === "files" && result.items.length > 0) {
|
|
2926
|
+
return describe_file(result.items[0]);
|
|
2927
|
+
}
|
|
2928
|
+
if (result.type === "directories" && result.items.length > 0) {
|
|
2929
|
+
return describe_directory(result.items[0]);
|
|
2930
|
+
}
|
|
2931
|
+
env.log("No items to describe.");
|
|
2921
2932
|
});
|
|
2922
2933
|
function describe_dependency(dep) {
|
|
2923
2934
|
env.log(dedent2`
|
|
@@ -2933,40 +2944,42 @@ function describe_dependency(dep) {
|
|
|
2933
2944
|
\`codewiki dependencies set-description ${dep.id} <markdown-file>\`
|
|
2934
2945
|
`);
|
|
2935
2946
|
}
|
|
2936
|
-
function
|
|
2937
|
-
const
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2947
|
+
function describe_symbol(wiki, sym) {
|
|
2948
|
+
const file = wiki.files.get(sym.file_id);
|
|
2949
|
+
env.log(dedent2`
|
|
2950
|
+
Your task is to describe the following symbol:
|
|
2951
|
+
|
|
2952
|
+
name: ${sym.name}
|
|
2953
|
+
type: ${sym.type}
|
|
2954
|
+
file: ${file?.path || "unknown"}
|
|
2955
|
+
exported: ${sym.is_exported}
|
|
2956
|
+
|
|
2957
|
+
Write a concise developer documentation for this ${sym.type} into a markdown file, then run:
|
|
2958
|
+
|
|
2959
|
+
codewiki symbols set-description ${sym.id} <markdown-file>
|
|
2960
|
+
`);
|
|
2961
|
+
}
|
|
2962
|
+
function describe_file(file) {
|
|
2963
|
+
env.log(dedent2`
|
|
2964
|
+
Your task is to describe the following file:
|
|
2965
|
+
|
|
2966
|
+
path: ${file.path}
|
|
2967
|
+
|
|
2968
|
+
Write a concise description of this file's purpose and contents into a markdown file, then run:
|
|
2969
|
+
|
|
2970
|
+
codewiki files set-description ${file.id} <markdown-file>
|
|
2971
|
+
`);
|
|
2972
|
+
}
|
|
2973
|
+
function describe_directory(dir) {
|
|
2974
|
+
env.log(dedent2`
|
|
2975
|
+
Your task is to describe the following directory:
|
|
2976
|
+
|
|
2977
|
+
path: ${dir.path}
|
|
2978
|
+
|
|
2979
|
+
Write a concise description of this directory's purpose and contents into a markdown file, then run:
|
|
2980
|
+
|
|
2981
|
+
codewiki directories set-description ${dir.id} <markdown-file>
|
|
2982
|
+
`);
|
|
2970
2983
|
}
|
|
2971
2984
|
|
|
2972
2985
|
// src/cli/commands/files/index.ts
|