@webneat/codewiki 0.0.6 → 0.0.8
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/dist/bin.cjs +217 -205
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +217 -205
- package/dist/bin.js.map +1 -1
- package/dist/cli.cjs +217 -205
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +217 -205
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +18 -4
- 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 -2
- 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
|
@@ -1381,6 +1381,7 @@ import ts4 from "typescript";
|
|
|
1381
1381
|
import path4 from "path";
|
|
1382
1382
|
import ts3 from "typescript";
|
|
1383
1383
|
function is_external_module(ctx, source_file, module_path) {
|
|
1384
|
+
if (module_path.startsWith("#")) return false;
|
|
1384
1385
|
const resolved = ts3.resolveModuleName(module_path, source_file.fileName, ctx.program.getCompilerOptions(), ts3.sys);
|
|
1385
1386
|
if (!resolved.resolvedModule) return true;
|
|
1386
1387
|
const resolved_path = path4.resolve(resolved.resolvedModule.resolvedFileName);
|
|
@@ -2327,6 +2328,21 @@ async function update6(ctx) {
|
|
|
2327
2328
|
await link_symbols(ctx);
|
|
2328
2329
|
}
|
|
2329
2330
|
|
|
2331
|
+
// src/update_config.ts
|
|
2332
|
+
function update_config(ctx, config, updates) {
|
|
2333
|
+
if (Object.keys(updates).length === 0) return;
|
|
2334
|
+
const new_config = { ...config, ...updates };
|
|
2335
|
+
err.or_throw(
|
|
2336
|
+
configs_exports.upsert(ctx, {
|
|
2337
|
+
project_path: new_config.project_path,
|
|
2338
|
+
description: new_config.description ?? null,
|
|
2339
|
+
package_json_path: new_config.package_json_path ?? null,
|
|
2340
|
+
node_modules_paths: new_config.node_modules_paths ? JSON.stringify(new_config.node_modules_paths) : null
|
|
2341
|
+
})
|
|
2342
|
+
);
|
|
2343
|
+
Object.assign(config, updates);
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2330
2346
|
// src/counts.ts
|
|
2331
2347
|
import { count as count10 } from "drizzle-orm";
|
|
2332
2348
|
function counts(ctx) {
|
|
@@ -2646,6 +2662,7 @@ async function create(config) {
|
|
|
2646
2662
|
const ctx = await context_from_config(config);
|
|
2647
2663
|
return {
|
|
2648
2664
|
config,
|
|
2665
|
+
update_config: (updates) => update_config(ctx, config, updates),
|
|
2649
2666
|
update: () => update6(ctx),
|
|
2650
2667
|
counts: () => counts(ctx),
|
|
2651
2668
|
to_describe: (limit) => to_describe(ctx, limit),
|
|
@@ -2667,6 +2684,7 @@ async function load(db_path) {
|
|
|
2667
2684
|
};
|
|
2668
2685
|
return {
|
|
2669
2686
|
config,
|
|
2687
|
+
update_config: (updates) => update_config(ctx, config, updates),
|
|
2670
2688
|
update: () => update6(ctx),
|
|
2671
2689
|
counts: () => counts(ctx),
|
|
2672
2690
|
to_describe: (limit) => to_describe(ctx, limit),
|
|
@@ -2677,8 +2695,6 @@ async function load(db_path) {
|
|
|
2677
2695
|
};
|
|
2678
2696
|
}
|
|
2679
2697
|
export {
|
|
2680
|
-
context_from_config,
|
|
2681
|
-
context_from_db,
|
|
2682
2698
|
create,
|
|
2683
2699
|
load
|
|
2684
2700
|
};
|