mirror of
https://github.com/hsjobeki/noogle.git
synced 2024-09-11 21:07:53 +03:00
resolve conflicts with main
This commit is contained in:
commit
d3c2864bbf
41
flake.lock
41
flake.lock
@ -90,11 +90,11 @@
|
||||
"pruned-racket-catalog": "pruned-racket-catalog"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1675238477,
|
||||
"narHash": "sha256-LM5GDNjLcmgZVQEeANWAOO09KppwGaYEzJBjYmuSwys=",
|
||||
"lastModified": 1676992344,
|
||||
"narHash": "sha256-TEn5kEi/jL9Dt6O+ZZ7kQwnlAgEv0r4VgQZnav/cfV4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "dream2nix",
|
||||
"rev": "f61d9311e224a2c5f6691f8f8d7411e7284650fb",
|
||||
"rev": "db72710500a80bdf4589b6807d2491a4a0dae3ad",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -144,14 +144,17 @@
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
"nixpkgs-lib": [
|
||||
"dream2nix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1668450977,
|
||||
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=",
|
||||
"lastModified": 1675933616,
|
||||
"narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa",
|
||||
"rev": "47478a4a003e745402acf63be7f9a092d51b83d7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -305,31 +308,13 @@
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1665349835,
|
||||
"narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-master": {
|
||||
"locked": {
|
||||
"lastModified": 1677161649,
|
||||
"narHash": "sha256-ypilUl4lX0VCZUxpnq650SzVvcI2cwQmuhhTVWJ3af0=",
|
||||
"lastModified": 1677165478,
|
||||
"narHash": "sha256-bWABTj9vlT26d3zpI+NQmuOwcXAzwJGNIgdgPfsnyk8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e3040b367c667525b614204d510ae0d09c59c8e0",
|
||||
"rev": "21d1c5425c1c0f4b4ae6203086951164920d9fab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -28,7 +28,7 @@ interface PreviewProps {
|
||||
|
||||
export const Preview = (props: PreviewProps) => {
|
||||
const { docItem, handleClose, closeComponent = undefined } = props;
|
||||
const { name, description, category, example, fn_type, id } = docItem;
|
||||
const { name, description, category, example, fn_type, id, line } = docItem;
|
||||
const theme = useTheme();
|
||||
|
||||
const prefix = category.split(/([\/.])/gm).at(4) || "builtins";
|
||||
@ -120,7 +120,7 @@ export const Preview = (props: PreviewProps) => {
|
||||
href={`https://github.com/NixOS/nixpkgs/blob/master/${category.replace(
|
||||
"./",
|
||||
""
|
||||
)}`}
|
||||
)}#L${line}`}
|
||||
>
|
||||
{"github:NixOS/nixpkgs/" + category.replace("./", "")}
|
||||
</MuiLink>
|
||||
|
@ -16,6 +16,7 @@ export type DocItem = {
|
||||
fn_type?: null | string;
|
||||
description?: null | string | string[];
|
||||
example?: null | string | string[];
|
||||
line?: null | number;
|
||||
};
|
||||
|
||||
export type MetaData = DocItem[];
|
@ -6,7 +6,7 @@ export const byQuery =
|
||||
const term = rawTerm.toLowerCase();
|
||||
return data.reduce((results: (DocItem & {relevance: number})[], docItem: DocItem)=>{
|
||||
const matchesOn = Object.keys(docItem).filter(key=>{
|
||||
const rawValue = docItem[key as keyof DocItem];
|
||||
const rawValue = String(docItem[key as keyof DocItem]);
|
||||
if(rawValue === null || rawValue === undefined){
|
||||
return false;
|
||||
}
|
||||
@ -31,6 +31,7 @@ const getRelevance = (matchesOn: (keyof DocItem)[]): number => {
|
||||
category: 3,
|
||||
example: 2,
|
||||
description: 1,
|
||||
line: 1,
|
||||
}
|
||||
return matchesOn.reduce((count,key)=>{
|
||||
return count + relevanceMap[key]
|
||||
|
@ -12,6 +12,9 @@ export const byType =
|
||||
({ name, fn_type }) => {
|
||||
if (fn_type) {
|
||||
const parsedType = getTypes(name, fn_type);
|
||||
// if(name === "derivation"){
|
||||
// console.log({name,parsedType,fn_type});
|
||||
// }
|
||||
return (
|
||||
parsedType.args.includes(from) && parsedType.types.includes(to)
|
||||
);
|
||||
|
@ -23,6 +23,9 @@
|
||||
"fn_type": "concatStringsSep :: String -> [String] -> String"
|
||||
},
|
||||
"deepSeq": { "fn_type": "deepSeq :: a -> b -> b" },
|
||||
"derivation": {
|
||||
"fn_type": "let \n Derivation :: {\n all :: [ Derivation ];\n builder :: String;\n drvAttrs :: {\n builder = String; \n name = String;\n outputs = [ output :: String ]; \n system = String;\n ${additionalArgs} :: String;\n }\n drvPath :: String;\n name :: String;\n outPath :: String;\n outputName :: String;\n outputs :: [ output :: String ];\n system :: String;\n type :: \"derivation\";\n ${output} :: Derivation;\n ${additionalArgs} :: String;\n };\nin\n builtins.derivation :: {\n name :: String;\n outputs :: [ output :: String ] ? [ \"out\" ];\n builder :: String;\n system :: String;\n ${additionalArgs} :: String;\n } -> Derivation"
|
||||
},
|
||||
"dirOf": { "fn_type": "dirOf :: String -> String" },
|
||||
"div": { "fn_type": "div :: Number -> Number -> Number" },
|
||||
"elem": { "fn_type": "elem :: a -> [b] -> Bool" },
|
||||
|
1
website/scripts/data/derivation-doc.txt
Normal file
1
website/scripts/data/derivation-doc.txt
Normal file
File diff suppressed because one or more lines are too long
29
website/scripts/data/derivation-signature.txt
Normal file
29
website/scripts/data/derivation-signature.txt
Normal file
@ -0,0 +1,29 @@
|
||||
let
|
||||
Derivation :: {
|
||||
all :: [ Derivation ];
|
||||
builder :: String;
|
||||
drvAttrs :: {
|
||||
builder = String;
|
||||
name = String;
|
||||
outputs = [ output :: String ];
|
||||
system = String;
|
||||
${additionalArgs} :: String;
|
||||
}
|
||||
drvPath :: String;
|
||||
name :: String;
|
||||
outPath :: String;
|
||||
outputName :: String;
|
||||
outputs :: [ output :: String ];
|
||||
system :: String;
|
||||
type :: "derivation";
|
||||
${output} :: Derivation;
|
||||
${additionalArgs} :: String;
|
||||
};
|
||||
in
|
||||
builtins.derivation :: {
|
||||
name :: String;
|
||||
outputs :: [ output :: String ] ? [ "out" ];
|
||||
builder :: String;
|
||||
system :: String;
|
||||
${additionalArgs} :: String;
|
||||
} -> Derivation
|
7
website/scripts/data/derivation.json
Normal file
7
website/scripts/data/derivation.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user