-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from lens-protocol/release/0.1.0-alpha.16
Release/0.1.0-alpha.16
- Loading branch information
Showing
21 changed files
with
766 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lens-protocol/metadata': patch | ||
--- | ||
|
||
**Added** metadata builder functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@lens-protocol/metadata", | ||
"version": "0.1.0-alpha.15", | ||
"version": "0.1.0-alpha.16", | ||
"description": "Lens Protocol Metadata Standards", | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
|
@@ -64,6 +64,7 @@ | |
"@jest/globals": "^29.6.2", | ||
"@types/fs-extra": "^11.0.1", | ||
"@types/node": "^20.5.0", | ||
"@types/uuid": "^9.0.4", | ||
"@typescript-eslint/eslint-plugin": "^6.4.0", | ||
"@typescript-eslint/parser": "^6.4.0", | ||
"eslint": "^8.47.0", | ||
|
@@ -96,5 +97,8 @@ | |
"pnpm": "^8.0.0", | ||
"npm": "^8.19.2" | ||
}, | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"uuid": "^9.0.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Given the publication metadata builders when using the article builder should return a valid TextOnlyMetadata 1`] = ` | ||
{ | ||
"$schema": "https://json-schemas.lens.dev/publications/article/3.0.0.json", | ||
"lens": { | ||
"content": "GM!", | ||
"id": Any<String>, | ||
"locale": "en", | ||
"mainContentFocus": "ARTICLE", | ||
}, | ||
} | ||
`; | ||
exports[`Given the publication metadata builders when using the textOnly builder should return a valid TextOnlyMetadata 1`] = ` | ||
{ | ||
"$schema": "https://json-schemas.lens.dev/publications/text-only/3.0.0.json", | ||
"lens": { | ||
"content": "GM!", | ||
"id": Any<String>, | ||
"locale": "en", | ||
"mainContentFocus": "TEXT_ONLY", | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { describe, expect, it } from '@jest/globals'; | ||
|
||
import { ValidationError, article, textOnly } from '../builders.js'; | ||
|
||
describe(`Given the publication metadata builders`, () => { | ||
describe(`when using the ${article.name} builder`, () => { | ||
it('should return a valid TextOnlyMetadata', () => { | ||
const metadata = article({ content: 'GM!' }); | ||
|
||
expect(metadata).toMatchSnapshot({ | ||
lens: { | ||
id: expect.any(String), | ||
}, | ||
}); | ||
}); | ||
|
||
it(`should throw a "${ValidationError.name}" in case of invalid input`, () => { | ||
expect(() => article({ content: '' })).toThrowError(ValidationError); | ||
}); | ||
}); | ||
|
||
describe(`when using the ${textOnly.name} builder`, () => { | ||
it('should return a valid TextOnlyMetadata', () => { | ||
const metadata = textOnly({ content: 'GM!' }); | ||
|
||
expect(metadata).toMatchSnapshot({ | ||
lens: { | ||
id: expect.any(String), | ||
}, | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.