Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add index schema for querying the vault #22

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion boundaries.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const libDir = "lib";

// EXPORTS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

export const ELEMENTS = [
{ type: "shared", pattern: "src/util", mode: "folder" },
{ type: "main", pattern: "src/main.tsx", mode: "full" },
Expand All @@ -16,6 +19,11 @@ export const ELEMENTS = [
capture: ["scope", "elementName", "lib"],
mode: "full",
},
{
type: "const",
pattern: "*.const.ts",
mode: "file",
},

defineFolderScope("model"),
];
Expand All @@ -24,16 +32,20 @@ export const ELEMENT_TYPE_RULES = [
{ from: "*", allow: "shared" },
{ from: "main", allow: [["lib", { lib: "obsidian" }]] },
{ from: "(lib|lib:scope)", allow: [["lib", { lib: "${from.lib}" }]] },
{ from: "const", disallow: "*" },

...fromScopeAllowItself("model"),
...fromScopeElementAllowTargetScopeElements("model", "index", [["model", "collection"]]),
];

export const EXTERNAL_RULES = [
{ from: "*", allow: ["assert", "lodash", "luxon", "path", "utility-types"] },
{ from: "*", allow: ["aggregate-error", "assert", "lodash", "luxon", "path", "utility-types"] },
{ from: "lib", allow: "${from.lib}" },
];

// HELPERS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function defineFolderScope(folderName) {
return { type: folderName, pattern: `src/(${folderName})/*`, capture: ["scope", "elementName"], mode: "folder" };
}
Expand Down
Loading