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

Add exports for scripts #2169

Merged
merged 2 commits into from
Sep 18, 2019
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/utilities/gel-foundations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 3.4.0 | [PR#2169](https://github.com/bbc/psammead/pull/2169) Add generic script exports - cyrillicAndLatin, devanagariAndGurmukhi & noAscendersOrDescenders |
| 3.3.3 | [PR#1847](https://github.com/bbc/psammead/pull/1847) Fixed Telugu typos |
| 3.3.2 | [PR#1806](https://github.com/bbc/psammead/pull/1806/) Change strings to booleans |
| 3.3.1 | [PR#1803](https://github.com/bbc/psammead/pull/1803/) Patches broken links on badges in documentation |
Expand Down
15 changes: 9 additions & 6 deletions packages/utilities/gel-foundations/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,24 @@ const typographyExpectedExports = {
};

const scriptsExpectedExports = {
latin: 'object',
cyrillic: 'object',
latinDiacritics: 'object',
arabic: 'object',
arabicPashto: 'object',
bengali: 'object',
burmese: 'object',
chinese: 'object',
cyrillic: 'object',
cyrillicAndLatin: 'object',
devanagariAndGurmukhi: 'object',
ethiopic: 'object',
hindi: 'object',
korean: 'object',
latin: 'object',
latinDiacritics: 'object',
nepali: 'object',
noAscendersOrDescenders: 'object',
sinhalese: 'object',
tamil: 'object',
thai: 'object',
chinese: 'object',
korean: 'object',
ethiopic: 'object',
};

const expectedExports = {
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": "3.3.3",
"version": "3.4.0",
"sideEffects": false,
"description": "A range of string constants for use in CSS, intended to help implement BBC GEL-compliant webpages and components.",
"repository": {
Expand Down
25 changes: 19 additions & 6 deletions packages/utilities/gel-foundations/src/scripts.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
export latin from './scripts/latin-and-cyrillic';
export cyrillic from './scripts/latin-and-cyrillic';
export latinDiacritics from './scripts/latin-with-diacritics';
export arabic from './scripts/arabic';

export arabicPashto from './scripts/arabic-pashto';

export bengali from './scripts/bengali';

export burmese from './scripts/burmese';

export devanagariAndGurmukhi from './scripts/devanagari-and-gurmukhi';
export hindi from './scripts/devanagari-and-gurmukhi';
export nepali from './scripts/devanagari-and-gurmukhi';

export cyrillic from './scripts/latin-and-cyrillic';
export cyrillicAndLatin from './scripts/latin-and-cyrillic';
export latin from './scripts/latin-and-cyrillic';

export latinDiacritics from './scripts/latin-with-diacritics';

export chinese from './scripts/no-ascenders-or-descenders';
Copy link
Contributor

@DenisHdz DenisHdz Sep 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, we decided to have this mapping, but at this point, should we still export several times the same script? E.g. chinese, ethiopic and korean?

Copy link
Contributor Author

@sareh sareh Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DenisHdz I'm going to remove the services names as exports from this gel-foundations in a future PR. But for now, I'm ensuring we are exporting the script values. This is so that I can use the scripts latinDiacritics and noAscendersOrDescenders etc in Simorgh, then removal of the service exports will not cause any issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to me, thanks :)

export ethiopic from './scripts/no-ascenders-or-descenders';
export korean from './scripts/no-ascenders-or-descenders';
export noAscendersOrDescenders from './scripts/no-ascenders-or-descenders';

export sinhalese from './scripts/sinhalese';

export tamil from './scripts/tamil';

export thai from './scripts/thai';
export chinese from './scripts/no-ascenders-or-descenders';
export korean from './scripts/no-ascenders-or-descenders';
export ethiopic from './scripts/no-ascenders-or-descenders';