Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Adds amp script in amp boilerplate #4636

Merged
merged 5 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions packages/components/psammead-bulletin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 5.0.60 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 5.0.59 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 5.0.58 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 5.0.57 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
4 changes: 2 additions & 2 deletions packages/components/psammead-bulletin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-bulletin",
"version": "5.0.59",
"version": "5.0.60",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand All @@ -20,7 +20,7 @@
"homepage": "https://github.com/BBC-News/psammead/blob/latest/packages/components/psammead-bulletin/README.md",
"dependencies": {
"@bbc/gel-foundations": "7.0.0",
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-live-label": "2.0.35",
"@bbc/psammead-story-promo": "8.0.38",
"@bbc/psammead-styles": "8.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-embed-error/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Version | Description |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3.0.37 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 3.0.36 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 3.0.35 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 3.0.34 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
4 changes: 2 additions & 2 deletions packages/components/psammead-embed-error/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-embed-error",
"version": "3.0.36",
"version": "3.0.37",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand All @@ -26,7 +26,7 @@
],
"dependencies": {
"@bbc/gel-foundations": "7.0.0",
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-styles": "8.1.1"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 3.4.15 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 3.4.14 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 3.4.13 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 3.4.12 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
4 changes: 2 additions & 2 deletions packages/components/psammead-image-placeholder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-image-placeholder",
"version": "3.4.14",
"version": "3.4.15",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand All @@ -19,7 +19,7 @@
},
"homepage": "https://github.com/bbc/psammead/blob/latest/packages/components/psammead-image-placeholder/README.md",
"dependencies": {
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-styles": "8.1.1"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-media-indicator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------- | ----------- |
| 6.1.18 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 6.1.17 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 6.1.16 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 6.1.15 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
4 changes: 2 additions & 2 deletions packages/components/psammead-media-indicator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-media-indicator",
"version": "6.1.17",
"version": "6.1.18",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand All @@ -20,7 +20,7 @@
"homepage": "https://github.com/bbc/psammead/blob/latest/packages/components/psammead-media-indicator/README.md",
"dependencies": {
"@bbc/gel-foundations": "7.0.0",
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-styles": "8.1.1"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-media-player/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| 6.0.10 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 6.0.9 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 6.0.8 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 6.0.7 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
8 changes: 4 additions & 4 deletions packages/components/psammead-media-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-media-player",
"version": "6.0.9",
"version": "6.0.10",
"description": "Provides a media player with optional placeholder",
"main": "dist/index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -29,10 +29,10 @@
"react": ">=16.9.0"
},
"dependencies": {
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-image": "3.1.3",
"@bbc/psammead-image-placeholder": "3.4.14",
"@bbc/psammead-play-button": "3.0.36"
"@bbc/psammead-image-placeholder": "3.4.15",
"@bbc/psammead-play-button": "3.0.37"
},
"devDependencies": {
"@emotion/styled": "^11.3.0",
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-navigation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 9.2.22 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 9.2.21 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 9.2.20 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 9.2.19 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
4 changes: 2 additions & 2 deletions packages/components/psammead-navigation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-navigation",
"version": "9.2.21",
"version": "9.2.22",
"description": "A navigation bar to use on index pages",
"main": "dist/index.js",
"module": "esm/index.js",
Expand All @@ -20,7 +20,7 @@
"homepage": "https://github.com/bbc/psammead/blob/latest/packages/components/psammead-navigation/README.md",
"dependencies": {
"@bbc/gel-foundations": "7.0.0",
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-styles": "8.1.1",
"@bbc/psammead-visually-hidden-text": "2.0.7"
},
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-play-button/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
| ------------- | ----------- |
| 3.0.37 | [PR#4636](https://github.com/bbc/psammead/pull/4636) Bumps from psammead-assets |
| 3.0.36 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Bumps psammead-assets |
| 3.0.35 | [PR#4633](https://github.com/bbc/psammead/pull/4633) bump psammead-styles |
| 3.0.34 | [PR#4632](https://github.com/bbc/psammead/pull/4632) psammead-styles bump |
Expand Down
4 changes: 2 additions & 2 deletions packages/components/psammead-play-button/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-play-button",
"version": "3.0.36",
"version": "3.0.37",
"description": "Provides a play button, with optional duration, for playable media.",
"main": "dist/index.js",
"module": "esm/index.js",
Expand All @@ -19,7 +19,7 @@
"homepage": "https://github.com/bbc/psammead/blob/latest/packages/components/psammead-play-button/README.md",
"dependencies": {
"@bbc/gel-foundations": "7.0.0",
"@bbc/psammead-assets": "3.2.0",
"@bbc/psammead-assets": "3.3.0",
"@bbc/psammead-styles": "8.1.1"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/utilities/psammead-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 3.3.0 | [PR#](https://github.com/bbc/psammead/pull/) Add AMP_SCRIPT_JS script |
| 3.2.0 | [PR#4634](https://github.com/bbc/psammead/pull/4634) Reduces dark mode BBC block size |
| 3.1.10 | [PR#4601](https://github.com/bbc/psammead/pull/4601) SVG size adjustments |
| 3.1.9 | [PR#4486](https://github.com/bbc/psammead/pull/4486) upgrade minor/patch dependencies |
Expand Down
1 change: 1 addition & 0 deletions packages/utilities/psammead-assets/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ampBoilerplateExpectedExports = {
AMP_MUSTACHE_JS: 'object',
AMP_ADS_JS: 'object',
AMP_AD: 'object',
AMP_SCRIPT_JS: 'object',
};

const svgsExpectedExports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/psammead-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-assets",
"version": "3.2.0",
"version": "3.3.0",
"sideEffects": false,
"description": "A collection of common assets that are likely to be required by many Psammead components or users, such as SVGs or small scripts.",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ exports[`AMP Boilerplate JavaScript should render AMP Mustache JS 1`] = `
</div>
`;

exports[`AMP Boilerplate JavaScript should render AMP SCRIPT JS 1`] = `
<div>
<script
async=""
custom-element="amp-script"
src="https://cdn.ampproject.org/v0/amp-script-0.1.js"
/>
</div>
`;

exports[`AMP Boilerplate JavaScript should render AMP ads JS 1`] = `
<div>
<script
Expand Down
8 changes: 8 additions & 0 deletions packages/utilities/psammead-assets/src/amp-boilerplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ export const AMP_AD = (
src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"
/>
);

export const AMP_SCRIPT_JS = (
<script
async
custom-element="amp-script"
src="https://cdn.ampproject.org/v0/amp-script-0.1.js"
/>
);
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ describe('AMP Boilerplate', () => {
);
shouldMatchSnapshot('should render AMP ads JS', boilerplate.AMP_ADS_JS);
shouldMatchSnapshot('should render AMP AD', boilerplate.AMP_AD);
shouldMatchSnapshot(
'should render AMP SCRIPT JS',
boilerplate.AMP_SCRIPT_JS,
);
});
});
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ __metadata:
languageName: unknown
linkType: soft

"@bbc/psammead-assets@3.2.0, @bbc/psammead-assets@workspace:packages/utilities/psammead-assets":
"@bbc/psammead-assets@3.3.0, @bbc/psammead-assets@workspace:packages/utilities/psammead-assets":
version: 0.0.0-use.local
resolution: "@bbc/psammead-assets@workspace:packages/utilities/psammead-assets"
dependencies:
Expand Down Expand Up @@ -1691,7 +1691,7 @@ __metadata:
resolution: "@bbc/psammead-bulletin@workspace:packages/components/psammead-bulletin"
dependencies:
"@bbc/gel-foundations": 7.0.0
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-live-label": 2.0.35
"@bbc/psammead-story-promo": 8.0.38
"@bbc/psammead-styles": 8.1.1
Expand Down Expand Up @@ -1805,7 +1805,7 @@ __metadata:
resolution: "@bbc/psammead-embed-error@workspace:packages/components/psammead-embed-error"
dependencies:
"@bbc/gel-foundations": 7.0.0
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-styles": 8.1.1
"@emotion/styled": ^11.3.0
react: ^17.0.2
Expand Down Expand Up @@ -1862,11 +1862,11 @@ __metadata:
languageName: unknown
linkType: soft

"@bbc/[email protected].14, @bbc/psammead-image-placeholder@workspace:packages/components/psammead-image-placeholder":
"@bbc/[email protected].15, @bbc/psammead-image-placeholder@workspace:packages/components/psammead-image-placeholder":
version: 0.0.0-use.local
resolution: "@bbc/psammead-image-placeholder@workspace:packages/components/psammead-image-placeholder"
dependencies:
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-styles": 8.1.1
"@emotion/styled": ^11.3.0
react: ^17.0.2
Expand Down Expand Up @@ -1938,7 +1938,7 @@ __metadata:
resolution: "@bbc/psammead-media-indicator@workspace:packages/components/psammead-media-indicator"
dependencies:
"@bbc/gel-foundations": 7.0.0
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-styles": 8.1.1
"@emotion/styled": ^11.3.0
react: ^17.0.2
Expand All @@ -1952,10 +1952,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@bbc/psammead-media-player@workspace:packages/components/psammead-media-player"
dependencies:
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-image": 3.1.3
"@bbc/psammead-image-placeholder": 3.4.14
"@bbc/psammead-play-button": 3.0.36
"@bbc/psammead-image-placeholder": 3.4.15
"@bbc/psammead-play-button": 3.0.37
"@emotion/styled": ^11.3.0
react: ^17.0.2
peerDependencies:
Expand All @@ -1969,7 +1969,7 @@ __metadata:
resolution: "@bbc/psammead-navigation@workspace:packages/components/psammead-navigation"
dependencies:
"@bbc/gel-foundations": 7.0.0
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-styles": 8.1.1
"@bbc/psammead-visually-hidden-text": 2.0.7
"@emotion/styled": ^11.3.0
Expand Down Expand Up @@ -2005,12 +2005,12 @@ __metadata:
languageName: unknown
linkType: soft

"@bbc/[email protected].36, @bbc/psammead-play-button@workspace:packages/components/psammead-play-button":
"@bbc/[email protected].37, @bbc/psammead-play-button@workspace:packages/components/psammead-play-button":
version: 0.0.0-use.local
resolution: "@bbc/psammead-play-button@workspace:packages/components/psammead-play-button"
dependencies:
"@bbc/gel-foundations": 7.0.0
"@bbc/psammead-assets": 3.2.0
"@bbc/psammead-assets": 3.3.0
"@bbc/psammead-styles": 8.1.1
"@emotion/styled": ^11.3.0
react: ^17.0.2
Expand Down