From da8d05cdcac9caf83d4a9965573817df27a32e1a Mon Sep 17 00:00:00 2001 From: Boxel Submission Bot Date: Tue, 14 Apr 2026 13:04:06 +0800 Subject: [PATCH] add Boom Person changes [boxel-content-hash:4c2f0365a76b] --- .../0c913960-4621-4ae7-a557-28dd19dc343f.json | 17 +++++ .../089e79da-8434-4784-9cd7-8b2e1ad03ee7.json | 69 +++++++++++++++++++ .../11bad32e-304b-440a-9b77-51ab49a5c79d.json | 40 +++++++++++ boom-pet.gts | 62 +++++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 BoomPerson/0c913960-4621-4ae7-a557-28dd19dc343f.json create mode 100644 CardListing/089e79da-8434-4784-9cd7-8b2e1ad03ee7.json create mode 100644 Spec/11bad32e-304b-440a-9b77-51ab49a5c79d.json create mode 100644 boom-pet.gts diff --git a/BoomPerson/0c913960-4621-4ae7-a557-28dd19dc343f.json b/BoomPerson/0c913960-4621-4ae7-a557-28dd19dc343f.json new file mode 100644 index 0000000..a10d037 --- /dev/null +++ b/BoomPerson/0c913960-4621-4ae7-a557-28dd19dc343f.json @@ -0,0 +1,17 @@ +{ + "data": { + "type": "card", + "attributes": { + "firstName": null, + "title": null, + "description": null, + "thumbnailURL": null + }, + "meta": { + "adoptsFrom": { + "module": "../boom-pet", + "name": "BoomPerson" + } + } + } +} \ No newline at end of file diff --git a/CardListing/089e79da-8434-4784-9cd7-8b2e1ad03ee7.json b/CardListing/089e79da-8434-4784-9cd7-8b2e1ad03ee7.json new file mode 100644 index 0000000..e526a2e --- /dev/null +++ b/CardListing/089e79da-8434-4784-9cd7-8b2e1ad03ee7.json @@ -0,0 +1,69 @@ +{ + "data": { + "meta": { + "adoptsFrom": { + "name": "CardListing", + "module": "https://realms-staging.stack.cards/catalog/catalog-app/listing/listing" + } + }, + "type": "card", + "attributes": { + "name": "Boom Person", + "images": [], + "summary": "The BoomPerson card definition represents a \"Person\" entity with a first name field. Its primary purpose is to serve as a data structure for person-related information within the system. It also includes an isolated component that displays a greeting with the person's first name. This definition is used for creating and managing person records in the card-based data framework.", + "cardInfo": { + "name": null, + "notes": null, + "summary": null, + "cardThumbnailURL": null + } + }, + "relationships": { + "tags.0": { + "links": { + "self": "https://realms-staging.stack.cards/catalog/Tag/51de249c-516a-4c4d-bd88-76e88274c483" + } + }, + "specs.0": { + "links": { + "self": "../Spec/11bad32e-304b-440a-9b77-51ab49a5c79d" + } + }, + "skills": { + "links": { + "self": null + } + }, + "license": { + "links": { + "self": "https://realms-staging.stack.cards/catalog/License/4c5a023b-a72c-4f90-930b-da60a1de5b2d" + } + }, + "publisher": { + "links": { + "self": null + } + }, + "categories.0": { + "links": { + "self": "https://realms-staging.stack.cards/catalog/Category/hardware-iot" + } + }, + "examples.0": { + "links": { + "self": "../BoomPerson/0c913960-4621-4ae7-a557-28dd19dc343f" + } + }, + "cardInfo.theme": { + "links": { + "self": null + } + }, + "cardInfo.cardThumbnail": { + "links": { + "self": null + } + } + } + } +} \ No newline at end of file diff --git a/Spec/11bad32e-304b-440a-9b77-51ab49a5c79d.json b/Spec/11bad32e-304b-440a-9b77-51ab49a5c79d.json new file mode 100644 index 0000000..3f62986 --- /dev/null +++ b/Spec/11bad32e-304b-440a-9b77-51ab49a5c79d.json @@ -0,0 +1,40 @@ +{ + "data": { + "meta": { + "adoptsFrom": { + "name": "Spec", + "module": "https://cardstack.com/base/spec" + } + }, + "type": "card", + "attributes": { + "ref": { + "name": "BoomPerson", + "module": "../boom-pet" + }, + "readMe": "# BoomPerson Card Spec\n\n## Summary\n\nThe `BoomPerson` card spec defines a card that represents a person, with a `firstName` field. It also contains a `BoomField` which is designed to explode when serialized.\n\n## Import\n\n```javascript\nimport { BoomPerson } from 'https://realms-staging.stack.cards/experiments/boom-pet';\n```\n\n## Usage as a Field\n\nTo use the `BoomPerson` card as a field within a consuming card or field, you can add it as a `contains` field:\n\n```javascript\nimport {\n contains,\n field,\n CardDef,\n FieldDef,\n StringField,\n} from 'https://cardstack.com/base/card-api';\n\nexport class ConsumingCard extends CardDef {\n @field boomPerson = contains(BoomPerson);\n}\n```\n\n## Template Usage\n\nTo display a `BoomPerson` card within a template, you can use the `@fields.firstName` helper:\n\n```html\n\n```", + "cardInfo": { + "name": null, + "notes": null, + "summary": null, + "cardThumbnailURL": null + }, + "specType": "card", + "cardTitle": "Boom Person", + "cardDescription": null, + "containedExamples": [] + }, + "relationships": { + "cardInfo.theme": { + "links": { + "self": null + } + }, + "linkedExamples": { + "links": { + "self": null + } + } + } + } +} \ No newline at end of file diff --git a/boom-pet.gts b/boom-pet.gts new file mode 100644 index 0000000..303124f --- /dev/null +++ b/boom-pet.gts @@ -0,0 +1,62 @@ +import { + contains, + field, + CardDef, + Component, + FieldDef, + StringField, + serialize, +} from 'https://cardstack.com/base/card-api'; + +// this field explodes when serialized (saved) +export class BoomField extends FieldDef { + @field cardTitle = contains(StringField); + static [serialize](_boom: any) { + throw new Error('Boom!'); + } + static embedded = class Embedded extends Component { + + }; +} + +export class BoomPet extends CardDef { + static displayName = 'Boom Pet'; + @field boom = contains(BoomField); +} + +export class BoomPerson extends CardDef { + static displayName = 'Boom Person'; + @field firstName = contains(StringField); + static isolated = class Isolated extends Component { + + // causeError = () => fn(); + }; +} + +export class WorkingCard extends CardDef { + static displayName = 'Working Card'; + static isolated = class Isolated extends Component { + + }; +} + +export class FailingField extends FieldDef { + static displayName = 'Failing Field'; + @field cardTitle = contains(StringField); + static embedded = class Embedded extends Component { + + boom = () => { + throw new Error('boom!'); + }; + }; +}