Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

Conformance cases /

pack-namespaces

Tests pack namespaces.

Our implementation passes this case when its check --json output for the input below equals the expected output.

Input

nodes/foo--thing.md
---
id: foo--thing
type: t
fields:
  pack: foo@1
---
nodes/lone.md
---
id: lone
type: t
fields:
  pack: system-design-lite@0.1.0
---
nodes/old2--pack.md
---
id: old2--pack
type: pack
fields:
  name: old2
  version: 1
---
nodes/pack-nameless.md
---
id: pack-nameless
type: pack
fields:
  version: 1
---
nodes/pack-old.md
---
id: pack-old
type: pack
fields:
  name: old
  version: 1
---
nodes/sdl--pack.md
---
id: sdl--pack
type: pack
fields:
  name: system-design-lite
  namespace: sdl
  version: 0.1.0
---
nodes/sdl--stray.md
---
id: sdl--stray
type: t
---
nodes/sdl--type-actor.md
---
id: sdl--type-actor
type: type
fields:
  name: actor
  pack: system-design-lite@0.1.0
---
nodes/weird.md
---
id: weird
type: t
fields:
  pack: 3
---
nodes/xyz--type-x.md
---
id: xyz--type-x
type: type
fields:
  pack: system-design-lite@0.1.0
---

Expected output

0 ghosts · 0 load errors · 10 nodes · 0 results

expected.json
{
 "ghosts": [],
 "load_errors": [],
 "nodes": [
  {
   "body": "",
   "fields": {
    "pack": "foo@1"
   },
   "id": "foo--thing",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "foo--thing",
   "type": "t"
  },
  {
   "body": "",
   "fields": {
    "pack": "system-design-lite@0.1.0"
   },
   "id": "lone",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "lone",
   "type": "t"
  },
  {
   "body": "",
   "fields": {
    "name": "old2",
    "version": 1
   },
   "id": "old2--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "old2--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "version": 1
   },
   "id": "pack-nameless",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "pack-nameless",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "old",
    "version": 1
   },
   "id": "pack-old",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "pack-old",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {
    "name": "system-design-lite",
    "namespace": "sdl",
    "version": "0.1.0"
   },
   "id": "sdl--pack",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "sdl--pack",
   "type": "pack"
  },
  {
   "body": "",
   "fields": {},
   "id": "sdl--stray",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "sdl--stray",
   "type": "t"
  },
  {
   "body": "",
   "fields": {
    "name": "actor",
    "pack": "system-design-lite@0.1.0"
   },
   "id": "sdl--type-actor",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "sdl--type-actor",
   "type": "type"
  },
  {
   "body": "",
   "fields": {
    "pack": 3
   },
   "id": "weird",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "weird",
   "type": "t"
  },
  {
   "body": "",
   "fields": {
    "pack": "system-design-lite@0.1.0"
   },
   "id": "xyz--type-x",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "xyz--type-x",
   "type": "type"
  }
 ],
 "results": [],
 "structure": {
  "errors": [],
  "warnings": [
   {
    "kind": "namespace_mismatch",
    "node": "lone",
    "ref": null
   },
   {
    "kind": "namespace_mismatch",
    "node": "pack-old",
    "ref": null
   },
   {
    "kind": "namespace_mismatch",
    "node": "sdl--stray",
    "ref": null
   },
   {
    "kind": "namespace_mismatch",
    "node": "xyz--type-x",
    "ref": null
   }
  ]
 }
}