Skip to content

Commit

Permalink
Merge pull request #658 from WPMedia/OBF-1.15_sandbox
Browse files Browse the repository at this point in the history
Obf 1.15 sandbox
  • Loading branch information
vgalatro authored Jan 24, 2024
2 parents 4c9b40c + a5039bd commit babd83a
Show file tree
Hide file tree
Showing 46 changed files with 519 additions and 53 deletions.
31 changes: 31 additions & 0 deletions .changeset/curvy-rats-deny.md
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
5 changes: 5 additions & 0 deletions .changeset/fluffy-elephants-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpmedia/text-output-block": patch
---

Added text output block
5 changes: 5 additions & 0 deletions .changeset/soft-jeans-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

Added textfile block
5 changes: 5 additions & 0 deletions .changeset/sweet-moles-sell.md
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
7 changes: 4 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ module.exports = {
overrides: [
{
files: ['*.test.js', '__mocks__/**'],
env: {
jest: true,
},

},
],
env: {
jest: true,
},
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/feeds-source-content-api-by-day-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"homepage": "https://github.com/WPMedia/feed-components#readme",
"dependencies": {
"@wpmedia/feeds-content-source-utils": "1.0.8",
"moment": "^2.29.2"
"moment": "^2.29.4"
},
"devDependencies": {
"prop-types": "^15.7.2"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/feeds-source-content-api-by-day2-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"homepage": "https://github.com/WPMedia/feed-components#readme",
"dependencies": {
"@wpmedia/feeds-content-source-utils": "1.0.8",
"moment": "^2.29.2"
"moment": "^2.29.4"
},
"devDependencies": {
"prop-types": "^15.7.2"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/feeds-source-content-api-by-day3-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"homepage": "https://github.com/WPMedia/feed-components#readme",
"dependencies": {
"@wpmedia/feeds-content-source-utils": "1.0.8",
"moment": "^2.29.2"
"moment": "^2.29.4"
},
"devDependencies": {
"prop-types": "^15.7.2"
Expand Down
6 changes: 3 additions & 3 deletions blocks/mrss-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/mrss-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"@wpmedia/feeds-prop-types": "1.0.10",
"@wpmedia/feeds-resizer": "^1.0.8",
"jmespath": "^0.15.0",
"moment": "^2.29.2"
"moment": "^2.29.4"
}
}
6 changes: 3 additions & 3 deletions blocks/rss-alexa-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/rss-alexa-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@wpmedia/feeds-resizer": "^1.0.8",
"cheerio": "^1.0.0-rc.10",
"jmespath": "^0.15.0",
"moment": "^2.29.2"
"moment": "^2.29.4"
}
}
6 changes: 3 additions & 3 deletions blocks/rss-fbia-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/rss-fbia-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@wpmedia/feeds-prop-types": "1.0.10",
"@wpmedia/feeds-resizer": "^1.0.8",
"jmespath": "^0.15.0",
"moment": "^2.29.2",
"moment": "^2.29.4",
"xmlbuilder2": "2.1.7"
}
}
6 changes: 3 additions & 3 deletions blocks/rss-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/rss-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@wpmedia/feeds-prop-types": "1.0.10",
"@wpmedia/feeds-resizer": "^1.0.8",
"jmespath": "^0.15.0",
"moment": "^2.29.2"
"moment": "^2.29.4"
}
}
6 changes: 3 additions & 3 deletions blocks/rss-flipboard-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/rss-flipboard-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"@wpmedia/feeds-prop-types": "1.0.10",
"@wpmedia/feeds-resizer": "^1.0.8",
"jmespath": "^0.15.0",
"moment": "^2.29.2"
"moment": "^2.29.4"
}
}
6 changes: 3 additions & 3 deletions blocks/rss-google-news-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/rss-google-news-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@wpmedia/feeds-prop-types": "1.0.10",
"@wpmedia/feeds-resizer": "^1.0.8",
"jmespath": "^0.15.0",
"moment": "^2.29.2"
"moment": "^2.29.4"
}
}
6 changes: 3 additions & 3 deletions blocks/rss-msn-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/rss-msn-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@wpmedia/feeds-prop-types": "1.0.10",
"@wpmedia/feeds-resizer": "^1.0.8",
"jmespath": "^0.15.0",
"moment": "^2.29.2"
"moment": "^2.29.4"
}
}
6 changes: 3 additions & 3 deletions blocks/sitemap-index-by-day-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/sitemap-index-by-day-feature-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"homepage": "https://github.com/WPMedia/feed-components#readme",
"dependencies": {
"moment": "^2.29.2"
"moment": "^2.29.4"
},
"devDependencies": {
"prop-types": "^15.7.2"
Expand Down
2 changes: 1 addition & 1 deletion blocks/sitemap-section-feature-block/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions blocks/text-output-block/CHANGELOG.md
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.
3 changes: 3 additions & 0 deletions blocks/text-output-block/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Text Output Type

Used to generate text output
1 change: 1 addition & 0 deletions blocks/text-output-block/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
5 changes: 5 additions & 0 deletions blocks/text-output-block/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const base = require("../../jest/jest.config.base");

module.exports = {
...base,
};
1 change: 1 addition & 0 deletions blocks/text-output-block/output-types/.npmignore
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"`;
19 changes: 19 additions & 0 deletions blocks/text-output-block/output-types/text.js
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)
20 changes: 20 additions & 0 deletions blocks/text-output-block/output-types/text.test.jsx
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");
});

Loading

0 comments on commit babd83a

Please sign in to comment.