@grove-dev/astro 0.8.0 → 0.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grove-dev/astro",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Astro integration + server view-models for Grove directories. UI ships from @grove-dev/registry, not from this package.",
6
6
  "license": "MIT",
@@ -33,6 +33,7 @@
33
33
  "src/index.ts",
34
34
  "src/styles.css",
35
35
  "README.md",
36
+ "LICENSE",
36
37
  "src/server/**/*.ts",
37
38
  "!src/server/**/*.test.ts"
38
39
  ],
@@ -46,18 +47,18 @@
46
47
  "./package.json": "./package.json"
47
48
  },
48
49
  "dependencies": {
49
- "astro": "^7.1.3",
50
50
  "marked": "^18.0.0",
51
51
  "sanitize-html": "^2.17.5",
52
52
  "shiki": "^1.29.2",
53
53
  "yaml": "^2.9.0",
54
- "@grove-dev/core": "0.8.0"
54
+ "@grove-dev/core": "0.10.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "astro": "^6.0.0 || ^7.0.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@types/sanitize-html": "^2.16.0"
60
+ "@types/sanitize-html": "^2.16.0",
61
+ "astro": "^7.1.3"
61
62
  },
62
63
  "scripts": {
63
64
  "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
@@ -613,7 +613,7 @@ export function getRecordDetailModel(
613
613
  siteName: site.name,
614
614
  });
615
615
  const description = seoDescription(
616
- (record.summary && record.summary.trim()) || record.description,
616
+ record.seo?.description || (record.summary && record.summary.trim()) || record.description,
617
617
  fallbackSentence,
618
618
  );
619
619
  const repoUrl = proj?.repoUrl ?? record.links?.github ?? '';
@@ -639,6 +639,9 @@ export function getRecordDetailModel(
639
639
  const reviewedAtLabel = record.curation?.reviewedAt
640
640
  ? new Date(String(record.curation.reviewedAt)).toLocaleDateString()
641
641
  : null;
642
+ const addedAtLabel = record.addedAt
643
+ ? new Date(String(record.addedAt)).toLocaleDateString()
644
+ : null;
642
645
  const isArchived = !!github?.archived;
643
646
  const isDisabled = !!github?.disabled;
644
647
  const ownerRepo = repoUrl ? getOwnerAndRepoFromRepoUrl(repoUrl) : null;
@@ -682,7 +685,11 @@ export function getRecordDetailModel(
682
685
  let recordLd: Record<string, unknown>;
683
686
  if (isProject && proj) {
684
687
  const sameAs = [repoUrl, homepageUrl].filter(Boolean);
685
- const dateCreated = record.curation?.reviewedAt;
688
+ // schema.org `dateCreated` is when the *work* was created, so the
689
+ // repository's own creation date is the honest answer. This used to
690
+ // read `curation.reviewedAt` and published the review date as the
691
+ // project's birthday — off by years on most records.
692
+ const dateCreated = github?.created_at ? String(github.created_at) : undefined;
686
693
  recordLd = {
687
694
  '@context': 'https://schema.org',
688
695
  '@type': 'SoftwareSourceCode',
@@ -756,13 +763,15 @@ export function getRecordDetailModel(
756
763
  }
757
764
 
758
765
  // "<Name> — <descriptor> | <Site>": the descriptor gives the search
759
- // snippet a reason to exist beyond the bare project name.
766
+ // snippet a reason to exist beyond the bare project name. A curator's
767
+ // `record.seo.title` (when set) is used verbatim, same override
768
+ // pattern as `getCollectionPageModel`'s `collection.seo?.title`.
760
769
  const descriptor = recordSeoDescriptor({
761
770
  summary: record.summary,
762
771
  ...(categoryLabel ? { categoryLabel } : {}),
763
772
  singular,
764
773
  });
765
- const title = seoTitle(`${name} — ${descriptor}`, site.name);
774
+ const title = record.seo?.title ?? seoTitle(`${name} — ${descriptor}`, site.name);
766
775
  const pluralTitle = titleCaseFirst(site.blueprintConfig?.labelPlural ?? itemLabelPlural());
767
776
  const jsonLd = [
768
777
  recordLd,
@@ -806,6 +815,7 @@ export function getRecordDetailModel(
806
815
  firstCommitYear,
807
816
  lastFetchedLabel,
808
817
  reviewedAtLabel,
818
+ addedAtLabel,
809
819
  ownerRepo,
810
820
  avatarSrc,
811
821
  initials: name
@@ -867,6 +877,7 @@ export function getRecordDetailModel(
867
877
  category: record.category,
868
878
  contributionSignals,
869
879
  reviewedAt: record.curation?.reviewedAt,
880
+ addedAt: record.addedAt,
870
881
  }),
871
882
  // ── Body-derived fields ──────────────────────────────────
872
883
  // Both depend on the sidecar Markdown; the body is re-read
@@ -976,6 +987,7 @@ export function computeSidebarVisibility(input: {
976
987
  category: string | undefined;
977
988
  contributionSignals: Array<{ key: string; label: string; ok: boolean }>;
978
989
  reviewedAt: string | undefined;
990
+ addedAt: string | undefined;
979
991
  }): {
980
992
  showActivity: boolean;
981
993
  showFreshness: boolean;
@@ -994,7 +1006,11 @@ export function computeSidebarVisibility(input: {
994
1006
  input.tags.length > 0 ||
995
1007
  !!input.category ||
996
1008
  input.contributionSignals.length > 0,
997
- showSource: !!input.reviewedAt,
1009
+ // Was `!!input.reviewedAt`, which hid the whole Source card — and
1010
+ // with it "Also in" and the notes word count — on every record a
1011
+ // curator had not stamped. `addedAt` is set on every record, so the
1012
+ // card now renders for all of them.
1013
+ showSource: !!input.addedAt || !!input.reviewedAt,
998
1014
  };
999
1015
  }
1000
1016