Skip to content

Commit

Permalink
Merge pull request #692 from WPMedia/sandbox
Browse files Browse the repository at this point in the history
Sandbox to prod
  • Loading branch information
rmbrntt authored Mar 21, 2024
2 parents 2638b59 + d2d5439 commit bf946be
Show file tree
Hide file tree
Showing 166 changed files with 23,182 additions and 19,016 deletions.
31 changes: 31 additions & 0 deletions .changeset/forty-pears-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
"@wpmedia/feeds-source-content-api-by-day2-block": major
"@wpmedia/feeds-source-content-api-by-day3-block": major
"@wpmedia/feeds-source-content-api-by-day-block": major
"@wpmedia/sitemap-section-index-feature-block": major
"@wpmedia/sitemap-index-by-day-feature-block": major
"@wpmedia/feeds-source-single-content-block": major
"@wpmedia/feeds-source-collections-block": major
"@wpmedia/feeds-source-content-api-block": major
"@wpmedia/rss-google-news-feature-block": major
"@wpmedia/sitemap-section-feature-block": major
"@wpmedia/feeds-source-video-api-block": major
"@wpmedia/rss-flipboard-feature-block": major
"@wpmedia/sitemap-index-feature-block": major
"@wpmedia/sitemap-video-feature-block": major
"@wpmedia/sitemap-news-feature-block": major
"@wpmedia/rss-alexa-feature-block": major
"@wpmedia/rss-fbia-feature-block": major
"@wpmedia/rss-msn-feature-block": major
"@wpmedia/sitemap-feature-block": major
"@wpmedia/mrss-feature-block": major
"@wpmedia/ans-feature-block": major
"@wpmedia/rss-feature-block": major
"@wpmedia/feeds-content-elements": major
"@wpmedia/feeds-promo-items": major
"@wpmedia/feeds-prop-types": major
"@wpmedia/feeds-xml-output": major
"@wpmedia/feeds-resizer": major
---

Adds resizer v2 support.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
plugins: ['standard', 'prettier', 'react'],
rules: {
'react/prop-types': 'warn',
'object-shorthand': 'off',
},
settings: {
react: {
Expand All @@ -12,7 +13,6 @@ module.exports = {
overrides: [
{
files: ['*.test.js', '__mocks__/**'],

},
],
env: {
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 18.x
registry-url: https://npm.pkg.github.com
scope: '@wpmedia'
- run: npm install && npm run ci
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/publish-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Setup Node.js 10.x
uses: actions/setup-node@master
- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 10.x
node-version: 18.x
registry-url: https://npm.pkg.github.com
scope: '@wpmedia'

Expand All @@ -27,6 +27,12 @@ jobs:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Utils
run: npm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Create new branch in order to persist changesets through to prod branch
- name: Create snapshot develop branch
run: git checkout -b develop-tag
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/publish-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Setup Node.js 10.x
uses: actions/setup-node@master
- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 10.x
node-version: 18.x
registry-url: https://npm.pkg.github.com
scope: '@wpmedia'

Expand All @@ -27,8 +27,14 @@ jobs:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Utils
run: npm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@master
uses: changesets/action@v1
with:
# this runs release:<branch name> which calls changeset publish --tag [beta|stable]
publish: npm run release:prod
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/publish-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Setup Node.js 10.x
uses: actions/setup-node@master
- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 10.x
node-version: 18.x
registry-url: https://npm.pkg.github.com
scope: '@wpmedia'

Expand All @@ -27,6 +27,12 @@ jobs:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Utils
run: npm run build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Create new branch in order to persist changesets through to prod branch
- name: Create snapshot sandbox branch
run: git checkout -b sandbox-tag
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ There are a set of common utilities used in the blocks. These are located in th

If you would like to create a custom block, you can start with one of the existing OBF blocks or create something new. More details can be found [here](https://redirector.arcpublishing.com/alc/arc-products/arcio/user-docs/ejecting-a-block/)

## Local Development
preconstruct is used to handle the dependency of packages depending on one another. It's set as postinstall and will likely run. If not follow the below:
After `npm i`
Run `npm run postinstall`
```
> postinstall
> preconstruct dev
🎁 info project is valid!
🎁 success created links!
```

That should resolve any missing module/import errors from dependencies in the utils called in blocks.
4 changes: 2 additions & 2 deletions __mocks__/fusion:content-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ module.exports = (options, ...moreSchemas) => {
const args = !(options instanceof Object)
? { schemas: [options].concat(...moreSchemas) }
: Array.isArray(options)
? { schemas: options.concat(...moreSchemas) }
: options
? { schemas: options.concat(...moreSchemas) }
: options

return taggablePrimitive(instance, 'contentConfig', args)
}
16 changes: 8 additions & 8 deletions __mocks__/fusion:prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ function _stringify(value) {
return Array.isArray(value)
? `[${value.map(_stringify).join(',')}]`
: value instanceof Object
? `{${Object.keys(value)
.filter(ignorePropTypeMethods)
.filter(exists)
.map((key) => {
return `"${key}":${_stringify(value[key])}`
})
.join(',')}}`
: JSON.stringify(value)
? `{${Object.keys(value)
.filter(ignorePropTypeMethods)
.filter(exists)
.map((key) => {
return `"${key}":${_stringify(value[key])}`
})
.join(',')}}`
: JSON.stringify(value)
}
FusionPropTypes.stringify = function stringify(value, replacer, space) {
const str = _stringify(value)
Expand Down
10 changes: 9 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
module.exports = {
presets: ['@babel/preset-env', '@babel/preset-react'],
presets: [
[
'@babel/preset-env',
{
targets: { esmodules: false, node: 'current' },
},
],
'@babel/preset-react',
],
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ANS undefined test 1`] = `
Array [
Object {},
[
{},
]
`;

exports[`returns ANS for story 1`] = `
Array [
Object {
[
{
"_id": "ABCD1234",
"content_elements": Array [
Object {
"content_elements": [
{
"content": "body goes here",
"type": "text",
},
Object {
{
"content": "second paragraph goes here",
"type": "text",
},
],
"last_updated_date": "2020-04-07T15:02:08.918Z",
"promo_items": Object {
"basic": Object {
"promo_items": {
"basic": {
"title": "Hand Washing",
"url": "hi/abcdefghijklmnopqrstuvwxyz=/arc-anglerfish-arc2-prod-demo.s3.amazonaws.com/public/JTWX7EUOLJE4FCHYGN2COQAERY.png",
},
Expand All @@ -34,32 +34,32 @@ Array [
`;

exports[`returns ANS from navigation set 1`] = `
Array [
Array [
Object {
[
[
{
"_id": "/channels",
"_website": "demo",
"children": Array [
Object {
"children": [
{
"_id": "/channels/ms-teams",
"_website": "demo",
"children": Array [],
"children": [],
"inactive": false,
"name": "MS Teams",
"node_type": "section",
},
Object {
{
"_id": "/channels/slack",
"_website": "demo",
"children": Array [],
"children": [],
"inactive": false,
"name": "Slack",
"node_type": "section",
},
Object {
{
"_id": "/channels/twitter",
"_website": "demo",
"children": Array [],
"children": [],
"inactive": false,
"name": "Twitter",
"node_type": "section",
Expand All @@ -74,22 +74,22 @@ Array [
`;

exports[`returns ANS from results set 1`] = `
Array [
Array [
Object {
[
[
{
"last_updated_date": "2020-04-07T15:02:08.918Z",
"promo_items": Object {
"basic": Object {
"promo_items": {
"basic": {
"title": "Hand Washing",
"url": "hi/abcdefghijklmnopqrstuvwxyz=/arc-anglerfish-arc2-prod-demo.s3.amazonaws.com/public/JTWX7EUOLJE4FCHYGN2COQAERY.png",
},
},
"type": "story",
"website_url": "/food/2020/04/07/tips-for-safe-hand-washing",
},
Object {
"content_elements": Array [
Object {
{
"content_elements": [
{
"type": "image",
"url": "hi/abcdefghijklmnopqrstuvwxyz=/arc-anglerfish-arc2-prod-demo.s3.amazonaws.com/public/JTWX7EUOLJE4FCHYGN2COQAERY.png",
},
Expand All @@ -98,14 +98,14 @@ Array [
"type": "story",
"website_url": "/food/2021/04/07/will-we-ever-stop-hand-washing",
},
Object {
{
"last_updated_date": "2021-04-03T13:02:08.918Z",
"promo_image": Object {
"promo_image": {
"title": "No kneed recipes",
"url": "hi/abcdefghijklmnopqrstuvwxyz=/arc-anglerfish-arc2-prod-demo.s3.amazonaws.com/public/JTWX7EUOLJE4FCHYGN2COQAERY.png",
},
"promo_items": Object {
"basic": Object {
"promo_items": {
"basic": {
"type": "video",
},
},
Expand Down
1 change: 1 addition & 0 deletions blocks/ans-feature-block/features/ans/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function ANSFeed({ globalContent = {}, customFields, arcSite }) {
resizerURL,
width,
height,
img,
)
}
return img
Expand Down
1 change: 0 additions & 1 deletion blocks/ans-feature-block/index.js

This file was deleted.

Loading

0 comments on commit bf946be

Please sign in to comment.