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

Rename catalog entry to boxel spec #2102

Merged
merged 16 commits into from
Feb 3, 2025
18 changes: 9 additions & 9 deletions packages/base/catalog-entry.gts → packages/base/boxel-spec.gts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class SpecType extends StringField {
static displayName = 'Spec Type';
}

export class CatalogEntry extends CardDef {
static displayName = 'Catalog Entry';
export class BoxelSpec extends CardDef {
static displayName = 'Boxel Spec';
static icon = BoxModel;
@field name = contains(StringField);
@field readMe = contains(MarkdownField);
Expand All @@ -46,13 +46,13 @@ export class CatalogEntry extends CardDef {
@field specType = contains(SpecType);

@field isField = contains(BooleanField, {
computeVia: function (this: CatalogEntry) {
computeVia: function (this: BoxelSpec) {
return this.specType === 'field';
},
});

@field isCard = contains(BooleanField, {
computeVia: function (this: CatalogEntry) {
computeVia: function (this: BoxelSpec) {
return (
this.specType === 'card' ||
this.specType === 'app' ||
Expand All @@ -61,14 +61,14 @@ export class CatalogEntry extends CardDef {
},
});
@field moduleHref = contains(StringField, {
computeVia: function (this: CatalogEntry) {
computeVia: function (this: BoxelSpec) {
return new URL(this.ref.module, this[relativeTo]).href;
},
});
@field linkedExamples = linksToMany(CardDef);
@field containedExamples = containsMany(FieldDef, { isUsed: true });
@field title = contains(StringField, {
computeVia: function (this: CatalogEntry) {
computeVia: function (this: BoxelSpec) {
if (this.name) {
return this.name;
}
Expand All @@ -78,14 +78,14 @@ export class CatalogEntry extends CardDef {

static fitted = class Fitted extends Component<typeof this> {
<template>
<CatalogEntryContainer class='fitted'>
<BoxelSpecContainer class='fitted'>
<header class='title' data-test-title>
<@fields.title />
</header>
<p class='description' data-test-description>
<@fields.description />
</p>
</CatalogEntryContainer>
</BoxelSpecContainer>
<style scoped>
.fitted > * {
white-space: nowrap;
Expand Down Expand Up @@ -337,7 +337,7 @@ interface Signature {
};
}

class CatalogEntryContainer extends GlimmerComponent<Signature> {
class BoxelSpecContainer extends GlimmerComponent<Signature> {
<template>
<div class='entry' ...attributes>
{{yield}}
Expand Down
2 changes: 1 addition & 1 deletion packages/base/card-api.gts
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ export class CardDef extends BaseDef {
// we need to be careful that we don't trigger the ambient recompute() in our setters
// when we are instantiating an instance that is placed in the identityMap that has
// not had it's field values set yet, as computeds will be run that may assume dependent
// fields are available when they are not (e.g. CatalogEntry.isPrimitive trying to load
// fields are available when they are not (e.g. BoxelSpec.isPrimitive trying to load
// it's 'ref' field). In this scenario, only the 'id' field is available. the rest of the fields
// will be filled in later, so just set the 'id' directly in the deserialized cache to avoid
// triggering the recompute.
Expand Down
10 changes: 5 additions & 5 deletions packages/base/cards-grid.gts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { IconList, IconGrid } from '@cardstack/boxel-ui/icons';
import { eq, cn } from '@cardstack/boxel-ui/helpers';
import {
chooseCard,
catalogEntryRef,
boxelSpecRef,
baseRealm,
isCardInstance,
SupportedMimeType,
Expand All @@ -36,7 +36,7 @@ import { tracked } from '@glimmer/tracking';
import { DropdownArrowDown } from '@cardstack/boxel-ui/icons';
// @ts-ignore no types
import cssUrl from 'ember-css-url';
import { type CatalogEntry } from './catalog-entry';
import { type BoxelSpec } from './boxel-spec';
import StringField from './string';
import { TrackedArray } from 'tracked-built-ins';
import { MenuItem } from '@cardstack/boxel-ui/helpers';
Expand Down Expand Up @@ -381,7 +381,7 @@ class Isolated extends Component<typeof CardsGrid> {
if (activeFilterRef) {
preselectedCardTypeQuery = {
filter: {
on: catalogEntryRef,
on: boxelSpecRef,
eq: { ref: activeFilterRef },
},
sort: [
Expand All @@ -392,10 +392,10 @@ class Isolated extends Component<typeof CardsGrid> {
],
};
}
let card = await chooseCard<CatalogEntry>(
let card = await chooseCard<BoxelSpec>(
{
filter: {
on: catalogEntryRef,
on: boxelSpecRef,
every: [{ eq: { isCard: true } }],
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/base64-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/biginteger-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/boolean-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/code-ref-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/date-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/datetime-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/ethereum-address-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/markdown-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/number-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/skill-card.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/string-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/fields/text-area-field.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/base/types/card.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/experiments-realm/CatalogEntry/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "card",
"attributes": {
"title": "Person",
"description": "Catalog entry for Person card",
"description": "Boxel spec for Person card",
"specType": "card",
"ref": {
"module": "../person",
Expand All @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/experiments-realm/CatalogEntry/10.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "card",
"attributes": {
"title": "Friends from ../friends",
"description": "Catalog entry for Friends from ../friends",
"description": "Boxel spec for Friends from ../friends",
"specType": "card",
"ref": {
"module": "../friends",
Expand All @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/experiments-realm/CatalogEntry/11.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "card",
"attributes": {
"title": "ContactCard",
"description": "Catalog entry for ContactCard",
"description": "Boxel spec for ContactCard",
"specType": "card",
"ref": {
"module": "../contact-card",
Expand All @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/experiments-realm/CatalogEntry/2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"data": {
"attributes": {
"title": "Pet",
"description": "Catalog entry for Pet card",
"description": "Boxel spec for Pet card",
"ref": {
"module": "../pet",
"name": "Pet"
Expand All @@ -11,8 +11,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
},
"type": "card"
Expand Down
6 changes: 3 additions & 3 deletions packages/experiments-realm/CatalogEntry/6.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "card",
"attributes": {
"title": "Friend from /friend",
"description": "Catalog entry for Friend from /friend",
"description": "Boxel spec for Friend from /friend",
"specType": "card",
"ref": {
"module": "../friend",
Expand All @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/experiments-realm/CatalogEntry/7.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "card",
"attributes": {
"title": "Booking Card",
"description": "Catalog entry for Booking Card",
"description": "Boxel spec for Booking Card",
"specType": "card",
"ref": {
"module": "../booking",
Expand All @@ -12,8 +12,8 @@
},
"meta": {
"adoptsFrom": {
"module": "https://cardstack.com/base/catalog-entry",
"name": "CatalogEntry"
"module": "https://cardstack.com/base/boxel-spec",
"name": "BoxelSpec"
}
}
}
Expand Down
Loading