-
Notifications
You must be signed in to change notification settings - Fork 1
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
DOP-5036 Refactor Search-Manifest integration #10
Changes from 33 commits
0a023cb
fe44e16
18c4b40
35fafb3
6625f51
a2fd57e
c126e41
eaa2126
1e75874
10ace66
99567dc
752f767
1858820
7a67d3e
c0b0847
f213067
2efa9f4
a0609b5
0557a19
b6f3b0a
95e14f7
c3658d3
6134626
bf1dc81
bb05afe
6697b85
9c13000
ce383b4
fc3abd7
3018c26
e6f8e5f
8afdc8c
6365a05
dc607e0
95cc815
663b355
13777ec
da8735e
69c51cc
4550273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": true | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["*/.ntli/*"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "tab" | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "single", | ||
"trailingCommas": "all" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { envVars } from "./types"; | ||
|
||
const assertEnvVars = (vars: envVars) => { | ||
const missingVars = Object.entries(vars) | ||
.filter(([, value]) => !value) | ||
.map(([key]) => `- ${key}`) | ||
.join("\n"); | ||
if (missingVars) | ||
throw new Error(`Missing env var(s) ${JSON.stringify(missingVars)}`); | ||
return vars; | ||
}; | ||
|
||
export const getEnvVars = () => { | ||
const environmentVariables = assertEnvVars({ | ||
ATLAS_CLUSTER0_URI: `mongodb+srv://${process.env.MONGO_ATLAS_USERNAME}:${process.env.MONGO_ATLAS_PASSWORD}@${process.env.MONGO_ATLAS_CLUSTER0_HOST}/?retryWrites=true&w=majority`, | ||
SNOOTY_DB_NAME: `${process.env.MONGO_ATLAS_POOL_DB_NAME}`, | ||
ATLAS_SEARCH_URI: `mongodb+srv://${process.env.MONGO_ATLAS_USERNAME}:${process.env.MONGO_ATLAS_PASSWORD}@${process.env.MONGO_ATLAS_SEARCH_HOST}/?retryWrites=true&w=majority`, | ||
SEARCH_DB_NAME: `${process.env.MONGO_ATLAS_SEARCH_DB_NAME}`, | ||
REPOS_BRANCHES_COLLECTION: "repos_branches", | ||
DOCSETS_COLLECTION: "docsets", | ||
DOCUMENTS_COLLECTION: "documents", | ||
}); | ||
return environmentVariables; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
import { NetlifyIntegration } from '@netlify/sdk'; | ||
import { NetlifyIntegration } from "@netlify/sdk"; | ||
|
||
export class Facet { | ||
category: any; | ||
value: any; | ||
subFacets: any; | ||
category: string; | ||
value: string; | ||
subFacets: Array<Facet>; | ||
|
||
constructor(category: string, value: string, subFacets: []) { | ||
this.category = category; | ||
this.value = value; | ||
this.subFacets = []; | ||
|
||
if (subFacets) { | ||
for (const subFacet of subFacets) { | ||
this.subFacets.push( | ||
new Facet( | ||
subFacet['category'], | ||
subFacet['value'], | ||
subFacet['sub_facets'] ?? [], | ||
), | ||
); | ||
} | ||
} | ||
} | ||
constructor(category: string, value: string, subFacets: Array<Facet>) { | ||
this.category = category; | ||
this.value = value; | ||
this.subFacets = subFacets; | ||
if (subFacets) { | ||
for (const subFacet of subFacets) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this if statement as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually, |
||
this.subFacets.push( | ||
new Facet(subFacet.category, subFacet.value, subFacet.subFacets ?? []) | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for catching this as well- There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha! I was also wondering if it makes sense to create a new interface Facet {
category: string;
value: string;
subFacet: Array<Facet>;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed! |
||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need a
biome.json
for this directory as it finds the nearestbiome.json
in the project structure.I think it would be preferable to use the single top level one so that the configurations are consistent, but I'm not opposed to adding one here if there's a specific need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No specific need!