@webneat/codewiki 0.0.5 → 0.0.7
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 +270 -246
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +270 -246
- package/dist/bin.js.map +1 -1
- package/dist/cli.cjs +270 -246
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +270 -246
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1643,6 +1643,7 @@ type EntitiesToDescribe = {
|
|
|
1643
1643
|
};
|
|
1644
1644
|
interface CodeWiki {
|
|
1645
1645
|
readonly config: Config;
|
|
1646
|
+
update_config(config: Partial<Config>): void;
|
|
1646
1647
|
update(): Promise<void>;
|
|
1647
1648
|
counts(): WikiCounts;
|
|
1648
1649
|
to_describe(limit: number): EntitiesToDescribe;
|
|
@@ -1685,10 +1686,7 @@ interface DependenciesWiki {
|
|
|
1685
1686
|
used_by_symbol<K extends keyof ExternalDependency>(symbol_id: number, options?: SelectOptions<ExternalDependency, K>): Array<Pick<ExternalDependency, K>>;
|
|
1686
1687
|
}
|
|
1687
1688
|
|
|
1688
|
-
declare function context_from_config(config: Config): Promise<Context>;
|
|
1689
|
-
declare function context_from_db(db_path: string): Promise<Context>;
|
|
1690
|
-
|
|
1691
1689
|
declare function create(config: Config): Promise<CodeWiki>;
|
|
1692
1690
|
declare function load(db_path: string): Promise<CodeWiki>;
|
|
1693
1691
|
|
|
1694
|
-
export { type CodeWiki, type Config, type Context, type ContextDependency, type DependenciesWiki, type DirectoriesWiki, type Directory, type EntitiesToDescribe, type ExternalDependency, type File, type FilesWiki, type RelationOptions, type SearchOptions, type SelectOptions, type Symbol, type SymbolsWiki, type WikiCounts,
|
|
1692
|
+
export { type CodeWiki, type Config, type Context, type ContextDependency, type DependenciesWiki, type DirectoriesWiki, type Directory, type EntitiesToDescribe, type ExternalDependency, type File, type FilesWiki, type RelationOptions, type SearchOptions, type SelectOptions, type Symbol, type SymbolsWiki, type WikiCounts, create, load };
|
package/dist/index.d.ts
CHANGED
|
@@ -1643,6 +1643,7 @@ type EntitiesToDescribe = {
|
|
|
1643
1643
|
};
|
|
1644
1644
|
interface CodeWiki {
|
|
1645
1645
|
readonly config: Config;
|
|
1646
|
+
update_config(config: Partial<Config>): void;
|
|
1646
1647
|
update(): Promise<void>;
|
|
1647
1648
|
counts(): WikiCounts;
|
|
1648
1649
|
to_describe(limit: number): EntitiesToDescribe;
|
|
@@ -1685,10 +1686,7 @@ interface DependenciesWiki {
|
|
|
1685
1686
|
used_by_symbol<K extends keyof ExternalDependency>(symbol_id: number, options?: SelectOptions<ExternalDependency, K>): Array<Pick<ExternalDependency, K>>;
|
|
1686
1687
|
}
|
|
1687
1688
|
|
|
1688
|
-
declare function context_from_config(config: Config): Promise<Context>;
|
|
1689
|
-
declare function context_from_db(db_path: string): Promise<Context>;
|
|
1690
|
-
|
|
1691
1689
|
declare function create(config: Config): Promise<CodeWiki>;
|
|
1692
1690
|
declare function load(db_path: string): Promise<CodeWiki>;
|
|
1693
1691
|
|
|
1694
|
-
export { type CodeWiki, type Config, type Context, type ContextDependency, type DependenciesWiki, type DirectoriesWiki, type Directory, type EntitiesToDescribe, type ExternalDependency, type File, type FilesWiki, type RelationOptions, type SearchOptions, type SelectOptions, type Symbol, type SymbolsWiki, type WikiCounts,
|
|
1692
|
+
export { type CodeWiki, type Config, type Context, type ContextDependency, type DependenciesWiki, type DirectoriesWiki, type Directory, type EntitiesToDescribe, type ExternalDependency, type File, type FilesWiki, type RelationOptions, type SearchOptions, type SelectOptions, type Symbol, type SymbolsWiki, type WikiCounts, create, load };
|
package/dist/index.js
CHANGED
|
@@ -594,7 +594,7 @@ var symbols2 = {
|
|
|
594
594
|
where: {}
|
|
595
595
|
};
|
|
596
596
|
var external_dependencies2 = {
|
|
597
|
-
select: ["id", "package", "subpath", "name", "state", "error"],
|
|
597
|
+
select: ["id", "package", "subpath", "name", "is_builtin", "state", "error"],
|
|
598
598
|
order_by: ["id", "asc"],
|
|
599
599
|
limit: 20,
|
|
600
600
|
offset: 0,
|
|
@@ -2327,6 +2327,21 @@ async function update6(ctx) {
|
|
|
2327
2327
|
await link_symbols(ctx);
|
|
2328
2328
|
}
|
|
2329
2329
|
|
|
2330
|
+
// src/update_config.ts
|
|
2331
|
+
function update_config(ctx, config, updates) {
|
|
2332
|
+
if (Object.keys(updates).length === 0) return;
|
|
2333
|
+
const new_config = { ...config, ...updates };
|
|
2334
|
+
err.or_throw(
|
|
2335
|
+
configs_exports.upsert(ctx, {
|
|
2336
|
+
project_path: new_config.project_path,
|
|
2337
|
+
description: new_config.description ?? null,
|
|
2338
|
+
package_json_path: new_config.package_json_path ?? null,
|
|
2339
|
+
node_modules_paths: new_config.node_modules_paths ? JSON.stringify(new_config.node_modules_paths) : null
|
|
2340
|
+
})
|
|
2341
|
+
);
|
|
2342
|
+
Object.assign(config, updates);
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2330
2345
|
// src/counts.ts
|
|
2331
2346
|
import { count as count10 } from "drizzle-orm";
|
|
2332
2347
|
function counts(ctx) {
|
|
@@ -2646,6 +2661,7 @@ async function create(config) {
|
|
|
2646
2661
|
const ctx = await context_from_config(config);
|
|
2647
2662
|
return {
|
|
2648
2663
|
config,
|
|
2664
|
+
update_config: (updates) => update_config(ctx, config, updates),
|
|
2649
2665
|
update: () => update6(ctx),
|
|
2650
2666
|
counts: () => counts(ctx),
|
|
2651
2667
|
to_describe: (limit) => to_describe(ctx, limit),
|
|
@@ -2667,6 +2683,7 @@ async function load(db_path) {
|
|
|
2667
2683
|
};
|
|
2668
2684
|
return {
|
|
2669
2685
|
config,
|
|
2686
|
+
update_config: (updates) => update_config(ctx, config, updates),
|
|
2670
2687
|
update: () => update6(ctx),
|
|
2671
2688
|
counts: () => counts(ctx),
|
|
2672
2689
|
to_describe: (limit) => to_describe(ctx, limit),
|
|
@@ -2677,8 +2694,6 @@ async function load(db_path) {
|
|
|
2677
2694
|
};
|
|
2678
2695
|
}
|
|
2679
2696
|
export {
|
|
2680
|
-
context_from_config,
|
|
2681
|
-
context_from_db,
|
|
2682
2697
|
create,
|
|
2683
2698
|
load
|
|
2684
2699
|
};
|