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

Commit

Permalink
Merge branch 'dynamic-brand-link' of https://github.com/bbc/psammead
Browse files Browse the repository at this point in the history
…into dynamic-brand-link
  • Loading branch information
sadick254 committed May 17, 2019
2 parents 9a0ab1f + 3beb492 commit f65fac8
Show file tree
Hide file tree
Showing 21 changed files with 1,222 additions and 1,339 deletions.
6 changes: 5 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
* @benjaminhobbs @dr3 @hindsc52 @jamesdonoh @jblaut @pjlee11 @sareh
/scripts/* @hindsc52 @jamesdonoh
/packages/* @dr3 @jblaut @pjlee11 @sareh
Jenkinsfile @hindsc52 @jamesdonoh

**/*CODEOWNERS* @benjaminhobbs @jamesdonoh
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.11.3
v10.15.3
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.1.6 | [PR#514](https://github.com/BBC/psammead/pull/514) Upgrade to Node 10
| 1.1.5 | [PR#484](https://github.com/BBC/psammead/pull/484) Add default labels to GitHub issue templates |
| 1.1.4 | [PR#444](https://github.com/BBC/psammead/pull/444) Include stories in utilities |
| 1.1.3 | [PR#423](https://github.com/BBC/psammead/pull/423) Update Storybook to version 5.0.6 |
Expand Down
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env groovy

def dockerRegistry = "329802642264.dkr.ecr.eu-west-1.amazonaws.com"
def nodeImageVersion = "0.0.8"
def nodeImage = "${dockerRegistry}/bbc-news/node-8-lts:${nodeImageVersion}"
def nodeImageVersion = "0.0.2"
def nodeImage = "${dockerRegistry}/bbc-news/node-10-lts:${nodeImageVersion}"

def nodeName
def slackChannel = "#si_repo-psammead"
def stageName = "Unknown"
Expand Down
2,396 changes: 1,169 additions & 1,227 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead",
"version": "1.1.5",
"version": "1.1.6",
"description": "Core Components Library Developed & Maintained By The Articles and Reach & Languages Team",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-caption/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.1.5 | [PR#524](https://github.com/bbc/psammead/pull/524) Add spacing for nested paragraph |
| 1.1.4 | [PR#515](https://github.com/bbc/psammead/pull/515) Update story to use dirDecorator |
| 1.1.3 | [PR#491](https://github.com/bbc/psammead/pull/491) Remove bottom padding from paragraphs within Caption |
| 1.1.2 | [PR#498](https://github.com/bbc/psammead/pull/498) Update stories to use new input provider |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-caption/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 packages/components/psammead-caption/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-caption",
"version": "1.1.4",
"version": "1.1.5",
"main": "dist/index.js",
"description": "React styled components for a Caption",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ exports[`Caption should render with some offscreen text 1`] = `
width: 100%;
}
.c0 > p {
padding-bottom: 1.5rem;
margin: 0;
}
.c0 > p:last-child {
padding-bottom: 0;
}
Expand Down Expand Up @@ -90,6 +95,11 @@ exports[`Caption should render with some offscreen text and arabic script typogr
width: 100%;
}
.c0 > p {
padding-bottom: 1.5rem;
margin: 0;
}
.c0 > p:last-child {
padding-bottom: 0;
}
Expand Down
5 changes: 5 additions & 0 deletions packages/components/psammead-caption/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styled, { css } from 'styled-components';
import { shape } from 'prop-types';
import {
GEL_SPACING,
GEL_SPACING_TRPL,
GEL_MARGIN_ABOVE_400PX,
GEL_MARGIN_BELOW_400PX,
} from '@bbc/gel-foundations/spacings';
Expand Down Expand Up @@ -36,6 +37,10 @@ const Caption = styled.figcaption`
@media (min-width: ${GEL_GROUP_4_SCREEN_WIDTH_MIN}) {
padding: ${GEL_SPACING} 0 0;
}
& > p {
padding-bottom: ${GEL_SPACING_TRPL};
margin: 0; /* reset */
}
& > p:last-child {
padding-bottom: 0;
}
Expand Down
7 changes: 3 additions & 4 deletions packages/components/psammead-caption/src/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';
import { inputProvider, dirDecorator } from '@bbc/psammead-storybook-helpers';
import InlineLink from '@bbc/psammead-inline-link';
import Paragraph from '@bbc/psammead-paragraph';
import VisuallyHiddenText from '@bbc/psammead-visually-hidden-text';
import notes from '../README.md';
import Caption from '.';
Expand Down Expand Up @@ -66,10 +65,10 @@ storiesOf('Caption', module)
'containing multiple paragraphs',
inputProvider([], (inputs, script) => (
<Caption script={script}>
<Paragraph>Paragraph with padding bottom.</Paragraph>
<Paragraph>
<p>Paragraph with padding bottom.</p>
<p>
Last paragraph - <i>without padding bottom</i>.
</Paragraph>
</p>
</Caption>
)),
{ notes, knobs: { escapeHTML: false } },
Expand Down
1 change: 1 addition & 0 deletions packages/utilities/gel-foundations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Version | Description |
|---------|-------------|
| 2.0.0 | [PR#517](https://github.com/bbc/psammead/pull/517) Remove unused GEL Types |
| 1.2.0 | [PR#431](https://github.com/bbc/psammead/pull/431) Add custom scripts propTypes |
| 1.1.0 | [PR#424](https://github.com/bbc/psammead/pull/424) Add Snyk badge to readme |
| 1.0.0 | [PR#353](https://github.com/BBC/psammead/pull/353) Add support for different scripts typographies |
Expand Down
5 changes: 0 additions & 5 deletions packages/utilities/gel-foundations/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ const typographyExpectedExports = {
getLongPrimer: 'function',
getBrevier: 'function',
getMinion: 'function',
getAtlas: 'function',
getElephant: 'function',
getImperial: 'function',
getRoyal: 'function',
getFoolscap: 'function',
};

const scriptsExpectedExports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/utilities/gel-foundations/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 packages/utilities/gel-foundations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/gel-foundations",
"version": "1.2.0",
"version": "2.0.0",
"description": "A range of string constants for use in CSS, intended to help implement BBC GEL-compliant webpages and components.",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ const scriptPropTypes = {
longPrimer: shape(groupPropTypes).isRequired,
brevier: shape(groupPropTypes).isRequired,
minion: shape(groupPropTypes).isRequired,
atlas: shape(groupPropTypes),
elephant: shape(groupPropTypes),
imperial: shape(groupPropTypes),
royal: shape(groupPropTypes),
foolscap: shape(groupPropTypes),
};

export default scriptPropTypes;
Original file line number Diff line number Diff line change
Expand Up @@ -142,76 +142,6 @@ const latinAndCyrillicTypography = {
lineHeight: '16',
},
},
atlas: {
groupA: {
fontSize: '78',
lineHeight: '84',
},
groupB: {
fontSize: '96',
lineHeight: '104',
},
groupD: {
fontSize: '140',
lineHeight: '148',
},
},
elephant: {
groupA: {
fontSize: '60',
lineHeight: '64',
},
groupB: {
fontSize: '78',
lineHeight: '84',
},
groupD: {
fontSize: '116',
lineHeight: '124',
},
},
imperial: {
groupA: {
fontSize: '50',
lineHeight: '54',
},
groupB: {
fontSize: '64',
lineHeight: '72',
},
groupD: {
fontSize: '96',
lineHeight: '104',
},
},
royal: {
groupA: {
fontSize: '40',
lineHeight: '44',
},
groupB: {
fontSize: '52',
lineHeight: '60',
},
groupD: {
fontSize: '76',
lineHeight: '84',
},
},
foolscap: {
groupA: {
fontSize: '32',
lineHeight: '36',
},
groupB: {
fontSize: '40',
lineHeight: '44',
},
groupD: {
fontSize: '56',
lineHeight: '60',
},
},
};

export default latinAndCyrillicTypography;
10 changes: 0 additions & 10 deletions packages/utilities/gel-foundations/src/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ export const getBrevier = script => getTypeSizes('brevier', script);

export const getMinion = script => getTypeSizes('minion', script);

export const getAtlas = script => getTypeSizes('atlas', script);

export const getElephant = script => getTypeSizes('elephant', script);

export const getImperial = script => getTypeSizes('imperial', script);

export const getRoyal = script => getTypeSizes('royal', script);

export const getFoolscap = script => getTypeSizes('foolscap', script);

/* ORIGINAL CONSTANTS */
export const GEL_ATLAS = `
font-size: 4.875rem;
Expand Down
13 changes: 11 additions & 2 deletions scripts/publish/src/getRegistryVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ const { exec } = require('shelljs');

// Get version of package in NPM regsitry. Returns 0.0.0 if doesn't exist.
module.exports = name => {
const npmVersion = exec(`npm show ${name} version`, { silent: true }).stdout;
return npmVersion ? npmVersion.split('\n')[0] : '0.0.0';
let packageVersions = [];
const npmVersion = exec(`npm view ${name} versions -json`, { silent: true })
.stdout;

if (typeof npmVersion === 'string' && JSON.parse(npmVersion)) {
const jsonResponse = JSON.parse(npmVersion);
packageVersions = Array.isArray(jsonResponse) ? jsonResponse : [];
}

const latestPublishedVersion = packageVersions.pop(); // removes the last element from the array and returns it i.e. the latest published version
return latestPublishedVersion || '0.0.0';
};
14 changes: 7 additions & 7 deletions scripts/publish/test/getRegistryVersion.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ describe(`Publish Script - getRegistry`, () => {
jest.resetModules();
});

it('returns registry version with newline in response', () => {
it('returns latest registry version from array', () => {
jest.mock('shelljs', () => ({
exec: () => ({
stdout: '1.3.2\n ',
stdout: JSON.stringify(['1.0.0', '1.1.0', '1.1.1']),
}),
}));

const getRegistry = require('../src/getRegistryVersion');

expect(getRegistry('foobar')).toEqual('1.3.2');
expect(getRegistry('foobar')).toEqual('1.1.1');
});

it('returns registry version without newline in response', () => {
it('returns single registry version ', () => {
jest.mock('shelljs', () => ({
exec: () => ({
stdout: '3.2.1',
stdout: JSON.stringify(['1.3.2']),
}),
}));

const getRegistry = require('../src/getRegistryVersion');

expect(getRegistry('foobar')).toEqual('3.2.1');
expect(getRegistry('foobar')).toEqual('1.3.2');
});

it('returns default version when there is no output', () => {
it('returns default version when an array of versions is not returned', () => {
jest.mock('shelljs', () => ({
exec: () => ({}),
}));
Expand Down

0 comments on commit f65fac8

Please sign in to comment.