Skip to content

Commit

Permalink
feat: support project-specific skills
Browse files Browse the repository at this point in the history
  • Loading branch information
missionmike committed Oct 30, 2024
1 parent 0d292ad commit f6751f5
Show file tree
Hide file tree
Showing 8 changed files with 268 additions and 147 deletions.
48 changes: 29 additions & 19 deletions sanity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,15 @@ export type Education = {
dateAwarded?: string;
};

export type Skill = {
_id: string;
_type: "skill";
_createdAt: string;
_updatedAt: string;
_rev: string;
title?: string;
icon?: string;
yearStart?: string;
totalYears?: number;
description?: BlockContent;
export type ProjectSkill = {
_type: "projectSkill";
skill?: {
_ref: string;
_type: "reference";
_weak?: boolean;
[internalGroqTypeReferenceTo]?: "skill";
};
projectSkillDescription?: BlockContent;
};

export type Project = {
Expand All @@ -139,13 +137,11 @@ export type Project = {
_updatedAt: string;
_rev: string;
title?: string;
skills?: Array<{
_ref: string;
_type: "reference";
_weak?: boolean;
_key: string;
[internalGroqTypeReferenceTo]?: "skill";
}>;
skills?: Array<
{
_key: string;
} & ProjectSkill
>;
body?: BlockContent;
};

Expand Down Expand Up @@ -191,6 +187,19 @@ export type Company = {
}>;
};

export type Skill = {
_id: string;
_type: "skill";
_createdAt: string;
_updatedAt: string;
_rev: string;
title?: string;
icon?: string;
yearStart?: string;
totalYears?: number;
description?: BlockContent;
};

export type ThemeOptions = {
_id: string;
_type: "themeOptions";
Expand Down Expand Up @@ -282,10 +291,11 @@ export type AllSanitySchemaTypes =
| Slug
| BlockContent
| Education
| Skill
| ProjectSkill
| Project
| Position
| Company
| Skill
| ThemeOptions
| SanityImageCrop
| SanityImageHotspot
Expand Down
216 changes: 124 additions & 92 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -662,75 +662,56 @@
}
},
{
"name": "skill",
"type": "document",
"attributes": {
"_id": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_type": {
"type": "objectAttribute",
"value": {
"type": "string",
"value": "skill"
}
},
"_createdAt": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_updatedAt": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_rev": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"title": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"icon": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"yearStart": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"totalYears": {
"type": "objectAttribute",
"value": {
"type": "number"
"name": "projectSkill",
"type": "type",
"value": {
"type": "object",
"attributes": {
"_type": {
"type": "objectAttribute",
"value": {
"type": "string",
"value": "projectSkill"
}
},
"optional": true
},
"description": {
"type": "objectAttribute",
"value": {
"type": "inline",
"name": "blockContent"
"skill": {
"type": "objectAttribute",
"value": {
"type": "object",
"attributes": {
"_ref": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_type": {
"type": "objectAttribute",
"value": {
"type": "string",
"value": "reference"
}
},
"_weak": {
"type": "objectAttribute",
"value": {
"type": "boolean"
},
"optional": true
}
},
"dereferencesTo": "skill"
},
"optional": true
},
"optional": true
"projectSkillDescription": {
"type": "objectAttribute",
"value": {
"type": "inline",
"name": "blockContent"
},
"optional": true
}
}
}
},
Expand Down Expand Up @@ -783,38 +764,16 @@
"of": {
"type": "object",
"attributes": {
"_ref": {
"_key": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_type": {
"type": "objectAttribute",
"value": {
"type": "string",
"value": "reference"
}
},
"_weak": {
"type": "objectAttribute",
"value": {
"type": "boolean"
},
"optional": true
}
},
"dereferencesTo": "skill",
"rest": {
"type": "object",
"attributes": {
"_key": {
"type": "objectAttribute",
"value": {
"type": "string"
}
}
}
"type": "inline",
"name": "projectSkill"
}
}
},
Expand Down Expand Up @@ -1064,6 +1023,79 @@
}
}
},
{
"name": "skill",
"type": "document",
"attributes": {
"_id": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_type": {
"type": "objectAttribute",
"value": {
"type": "string",
"value": "skill"
}
},
"_createdAt": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_updatedAt": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"_rev": {
"type": "objectAttribute",
"value": {
"type": "string"
}
},
"title": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"icon": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"yearStart": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"totalYears": {
"type": "objectAttribute",
"value": {
"type": "number"
},
"optional": true
},
"description": {
"type": "objectAttribute",
"value": {
"type": "inline",
"name": "blockContent"
},
"optional": true
}
}
},
{
"name": "themeOptions",
"type": "document",
Expand Down
Loading

0 comments on commit f6751f5

Please sign in to comment.