-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
Obf 1.15 sandbox
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
'@wpmedia/feeds-source-content-api-by-day-block': minor | ||
'@wpmedia/feeds-source-content-api-by-day2-block': minor | ||
'@wpmedia/feeds-source-content-api-by-day3-block': minor | ||
'@wpmedia/mrss-feature-block': minor | ||
'@wpmedia/rss-alexa-feature-block': minor | ||
'@wpmedia/rss-fbia-feature-block': minor | ||
'@wpmedia/rss-feature-block': minor | ||
'@wpmedia/rss-flipboard-feature-block': minor | ||
'@wpmedia/rss-google-news-feature-block': minor | ||
'@wpmedia/rss-msn-feature-block': minor | ||
'@wpmedia/sitemap-index-by-day-feature-block': minor | ||
'@wpmedia/sitemap-section-feature-block': minor | ||
'@wpmedia/text-output-block': minor | ||
'@wpmedia/textfile-block': minor | ||
'@wpmedia/feeds-xml-output': minor | ||
'@wpmedia/ans-feature-block': minor | ||
'@wpmedia/feeds-source-collections-block': minor | ||
'@wpmedia/feeds-source-content-api-block': minor | ||
'@wpmedia/feeds-source-single-content-block': minor | ||
'@wpmedia/feeds-source-video-api-block': minor | ||
'@wpmedia/json-output-block': minor | ||
'@wpmedia/sitemap-feature-block': minor | ||
'@wpmedia/sitemap-index-feature-block': minor | ||
'@wpmedia/sitemap-news-feature-block': minor | ||
'@wpmedia/sitemap-section-index-feature-block': minor | ||
'@wpmedia/sitemap-video-feature-block': minor | ||
'@wpmedia/story-feed-querybuilder-content-source-block': minor | ||
--- | ||
|
||
OBF 1.15 release |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@wpmedia/text-output-block": patch | ||
--- | ||
|
||
Added text output block |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
|
||
--- | ||
|
||
Added textfile block |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@wpmedia/feeds-xml-output': patch | ||
--- | ||
|
||
Corrected options parameter for building xml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Text Output Type | ||
|
||
Used to generate text output |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const base = require("../../jest/jest.config.base"); | ||
|
||
module.exports = { | ||
...base, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.test.jsx |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should match the snapshot 1`] = `"hello world"`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import PropTypes from 'prop-types' | ||
import Consumer from 'fusion:consumer' | ||
|
||
export function TextOutputType(children){ | ||
const generateText = (child) => { | ||
if (Array.isArray(child)) return child.map(generateText).join('\n') | ||
return child | ||
} | ||
return generateText(children) | ||
}; | ||
|
||
TextOutputType.contentType = "text/plain"; | ||
|
||
TextOutputType.fallback = false; | ||
|
||
TextOutputType.propTypes = { | ||
children: PropTypes.node, | ||
} | ||
export default Consumer(TextOutputType) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* this is for mocking node env | ||
* will not have window attribute, testing ssr | ||
* https://jestjs.io/docs/en/configuration.html#testenvironment-string | ||
* @jest-environment node | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
import Consumer from 'fusion:consumer' | ||
import {TextOutputType} from "./text"; | ||
|
||
it('should match the snapshot', () => { | ||
const videoSitemap = TextOutputType("hello world") | ||
expect(videoSitemap).toMatchSnapshot() | ||
}) | ||
|
||
it("should render array of children as plain text", () => { | ||
const videoSitemap = TextOutputType(["hello world", "print output"]) | ||
expect(videoSitemap).toEqual("hello world\nprint output"); | ||
}); | ||
|