Skip to content

Commit

Permalink
Merge pull request #666 from WPMedia/THEMES-704--dependency-updates
Browse files Browse the repository at this point in the history
refactor: shift component dependencies into resizer utils
  • Loading branch information
rmbrntt authored Feb 26, 2024
2 parents cd65cd6 + 80d0ee9 commit b9157e0
Show file tree
Hide file tree
Showing 45 changed files with 1,886 additions and 1,078 deletions.
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
8 changes: 4 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 Down
10 changes: 5 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 @@ -28,7 +28,7 @@ jobs:
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
8 changes: 4 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 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.
8 changes: 7 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
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
3 changes: 1 addition & 2 deletions blocks/feeds-source-collections-block/sources/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import {
resizerKey,
} from 'fusion:environment'

import signImagesInANSObject from '@wpmedia/arc-themes-components/src/utils/sign-images-in-ans-object'
import { signImagesInANSObject, resizerFetch } from '@wpmedia/feeds-resizer'
import { defaultANSFields } from '@wpmedia/feeds-content-source-utils'
import { fetch as resizerFetch } from '@wpmedia/signing-service-content-source-block'

const sortStories = (idsResp, collectionResp, ids, site) => {
idsResp.content_elements.forEach((item) => {
Expand Down
Loading

0 comments on commit b9157e0

Please sign in to comment.