Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandbox to prod #692

Merged
merged 81 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c85464d
Merge pull request #663 from WPMedia/prod
vgalatro Jan 24, 2024
cbdb46c
Merge pull request #664 from WPMedia/prod
vgalatro Jan 24, 2024
fbcc0ae
THEMES-704: Add Resizer V2
nschubach Feb 20, 2024
89b5f35
Update import and remove console.logs, add missed file
nschubach Feb 21, 2024
9a98ae2
Update feeds-source--single-content-block
nschubach Feb 22, 2024
8ef5822
fix v1 replace spaces
nschubach Feb 22, 2024
a9404be
ReplaceAll question marks
nschubach Feb 22, 2024
cd65cd6
feat: convert feeds-source-video-api-block to fetch
rmbrntt Feb 25, 2024
10ecfa8
refactor: shift component dependencies into resizer utils
rmbrntt Feb 25, 2024
3b0ec42
refactor: remove all theme and component dependencies
rmbrntt Feb 25, 2024
ad4cadb
chore: remove @wpmedia signing service from package.json
rmbrntt Feb 25, 2024
7b438ae
refactor: minimize diff in feeds-content-api and just convert to fetch
rmbrntt Feb 26, 2024
3f74c42
test: use axios in feeds-content-api.test.js
rmbrntt Feb 26, 2024
bd3adf3
test: use axios in feeds-video-api.test.js
rmbrntt Feb 26, 2024
ed3a7ab
fix: missed change to import
rmbrntt Feb 26, 2024
e44eb89
test: resizer buildResizerURL coverage for v2 and v1 logic
rmbrntt Feb 26, 2024
7692e0b
fix: shift transforms into axios promise chain
rmbrntt Feb 26, 2024
ede0cde
style: export all exportable functions on same line
rmbrntt Feb 26, 2024
80d0ee9
chore: update github action versions
rmbrntt Feb 26, 2024
b9157e0
Merge pull request #666 from WPMedia/THEMES-704--dependency-updates
rmbrntt Feb 26, 2024
c39ce40
chore: add changeset
rmbrntt Feb 26, 2024
780fa41
Add dependencies
nschubach Feb 26, 2024
6f70bad
Include 2.0 dependencies in packages that are marked for major update
nschubach Feb 26, 2024
6a81d59
Merge pull request #665 from WPMedia/themes-704
rmbrntt Feb 26, 2024
798d00c
fix: revert changes to package.json
rmbrntt Feb 26, 2024
c9931a6
Merge pull request #667 from WPMedia/revert-workspace-change
rmbrntt Feb 26, 2024
3659db5
fix: add peer deps for fusion:environment
rmbrntt Feb 26, 2024
9b15e4c
Merge pull request #668 from WPMedia/peer-deps-fusion
rmbrntt Feb 26, 2024
7f5cf5a
fix: use externals for fusion:environment
rmbrntt Feb 26, 2024
37a97d6
Merge pull request #669 from WPMedia/try-externals
rmbrntt Feb 26, 2024
26cddbe
remove externals
rmbrntt Feb 26, 2024
b795171
Merge pull request #670 from WPMedia/fix-preconstruct
rmbrntt Feb 26, 2024
9c46d4b
remove preconstruct, clean up workspaces
nschubach Feb 28, 2024
29202fb
Merge pull request #671 from WPMedia/themes-704-fix-packages
nschubach Feb 28, 2024
85f64cc
Actually remove preconstruct steps
nschubach Feb 28, 2024
316d7f8
Merge pull request #672 from WPMedia/themes-704-fix-packages
nschubach Feb 28, 2024
22bc83e
Update package.json
nschubach Feb 28, 2024
b070f11
Merge pull request #673 from WPMedia/module-test
nschubach Feb 28, 2024
8d222ff
Update package.json
nschubach Feb 28, 2024
89730e1
update package-lock
nschubach Feb 28, 2024
fb6b24e
Merge pull request #674 from WPMedia/update-cheerio-1
nschubach Feb 28, 2024
0408f25
Update modules and packages
nschubach Feb 28, 2024
490c99a
update package-lock
nschubach Feb 28, 2024
31c3bd6
Merge pull request #675 from WPMedia/module-updates
nschubach Feb 28, 2024
d3dfe6a
esm updates
nschubach Feb 28, 2024
254a2c6
Merge pull request #676 from WPMedia/module-updates
nschubach Feb 28, 2024
48a7997
path correction
nschubach Feb 28, 2024
2624817
Merge pull request #677 from WPMedia/module-updates
nschubach Feb 28, 2024
fd7887e
Revert back to 316d7f8afd2b9b6eb3cdde7622e3fa3ae24740ff
nschubach Feb 28, 2024
1a8972d
Merge pull request #678 from WPMedia/revert-changes
nschubach Feb 28, 2024
e0ad544
set prop-types as dev dependency
nschubach Feb 29, 2024
1cf97a7
Add rollup configs and precompile on build
nschubach Feb 29, 2024
a9c8186
Merge pull request #679 from WPMedia/fix-dependency
nschubach Feb 29, 2024
e0b8623
Merge pull request #680 from WPMedia/rollup
nschubach Feb 29, 2024
fed2ad1
Add postinstall script
nschubach Feb 29, 2024
5c84d0f
Merge pull request #681 from WPMedia/add-postinstall
nschubach Feb 29, 2024
324bb6b
Add build step to install script
nschubach Feb 29, 2024
cc40a1a
Merge pull request #682 from WPMedia/update_install_script
nschubach Feb 29, 2024
b384df3
Update xmlbuilder2
nschubach Feb 29, 2024
1694c9c
Merge pull request #683 from WPMedia/update-xmlbuilder2
nschubach Feb 29, 2024
0eef0e7
Fix an issue where xmlbuilder2 was being treated as an esmodule
nschubach Feb 29, 2024
f0b1d96
Merge pull request #684 from WPMedia/fix-commonjs
nschubach Feb 29, 2024
ae7058e
More commonjs fixes
nschubach Feb 29, 2024
de90bb5
Merge pull request #685 from WPMedia/fix-commonjs
nschubach Feb 29, 2024
fa42655
Pin the cheerio version to rc.10 to attempt to avoid a bug in 11/12
nschubach Feb 29, 2024
be151f4
Merge pull request #686 from WPMedia/fixed-cheerio-version
nschubach Feb 29, 2024
bacf6a4
revert an import change
nschubach Feb 29, 2024
f302afd
Merge pull request #687 from WPMedia/fixed-cheerio-version
nschubach Feb 29, 2024
11f6d5d
Revert some changes around xmlBuilder2
nschubach Mar 1, 2024
9b52a27
Merge pull request #688 from WPMedia/xmlbuilder-revert
nschubach Mar 1, 2024
887cfe5
Minimizing the changeset from where the resizer update started
nschubach Mar 1, 2024
e40263b
Merge pull request #689 from WPMedia/small-reversions
nschubach Mar 1, 2024
7fd6bdd
Add build step to github actions
nschubach Mar 7, 2024
b8d9bf3
Merge pull request #690 from WPMedia/update-actions
nschubach Mar 7, 2024
0175e25
Merge pull request #691 from WPMedia/develop
nschubach Mar 7, 2024
afdaac2
style: lint fixes
rmbrntt Mar 21, 2024
28fdee1
Merge pull request #693 from WPMedia/fix-lint
rmbrntt Mar 21, 2024
963eeab
style: run prettier
rmbrntt Mar 21, 2024
cfcaf0a
Merge pull request #694 from WPMedia/fix-linting-again
rmbrntt Mar 21, 2024
39e0a74
chore: add build step to ci script
rmbrntt Mar 21, 2024
d2d5439
Merge pull request #695 from WPMedia/update-scripts
rmbrntt Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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