@shift72/core-template 0.4.4 → 0.6.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/.nvmrc +1 -0
  2. package/CHANGELOG.md +68 -16
  3. package/kibble.json +108 -29
  4. package/package.json +21 -9
  5. package/scripts/core-template-version.js +30 -0
  6. package/scripts/language-file-to-csv/language-file-to-csv.js +2 -2
  7. package/scripts/language-file-validator.js +1 -1
  8. package/scripts/translate.mjs +51 -0
  9. package/site/ar_LB.all.json +1316 -595
  10. package/site/ca_ES.all.json +491 -417
  11. package/site/da_DK.all.json +360 -220
  12. package/site/de_DE.all.json +1173 -459
  13. package/site/el_EL.all.json +1166 -459
  14. package/site/en_AU.all.json +1213 -467
  15. package/site/es_ES.all.json +1159 -452
  16. package/site/es_MX.all.json +1213 -478
  17. package/site/et_ET.all.json +1317 -0
  18. package/site/fi_FI.all.json +1167 -460
  19. package/site/fr_FR.all.json +1159 -454
  20. package/site/hr_HR.all.json +1223 -464
  21. package/site/hu_HU.all.json +1315 -599
  22. package/site/it_IT.all.json +1166 -458
  23. package/site/ja_JP.all.json +1168 -460
  24. package/site/lt_LT.all.json +1166 -454
  25. package/site/nl_BE.all.json +1166 -456
  26. package/site/no_NO.all.json +1306 -596
  27. package/site/pl_PL.all.json +1144 -447
  28. package/site/plans.html.jet +17 -17
  29. package/site/pt_BR.all.json +487 -430
  30. package/site/pt_PT.all.json +1306 -602
  31. package/site/ru_RU.all.json +1142 -449
  32. package/site/sr_SR.all.json +1308 -0
  33. package/site/static/fonts/fa-s72.woff +0 -0
  34. package/site/static/js/main.js +1 -0
  35. package/site/static/scripts/main.js.map +1 -1
  36. package/site/styles/_availability-tags.scss +63 -31
  37. package/site/styles/_awards.scss +8 -2
  38. package/site/styles/_buttons.scss +36 -1
  39. package/site/styles/_carousel.scss +29 -24
  40. package/site/styles/_forms.scss +85 -13
  41. package/site/styles/_icons.scss +180 -9
  42. package/site/styles/_legacy.scss +0 -7
  43. package/site/styles/_meta-detail.scss +67 -42
  44. package/site/styles/_meta-item-tagline.scss +1 -1
  45. package/site/styles/_nav.scss +11 -10
  46. package/site/styles/_pages.scss +0 -2
  47. package/site/styles/_plans.scss +15 -17
  48. package/site/styles/_poster.scss +3 -9
  49. package/site/styles/_search.scss +1 -1
  50. package/site/styles/_share-modal.scss +86 -0
  51. package/site/styles/_shift72.scss +10 -3
  52. package/site/styles/_shopping.scss +1 -2
  53. package/site/styles/_skip-link.scss +19 -0
  54. package/site/styles/_tooltips.scss +7 -0
  55. package/site/styles/_variables.scss +18 -13
  56. package/site/styles/_wishlist.scss +21 -13
  57. package/site/styles/main.scss +4 -2
  58. package/site/subscriptions.html.jet +11 -0
  59. package/site/templates/application/application.jet +11 -14
  60. package/site/templates/application/google.jet +27 -16
  61. package/site/templates/application/nav/user_logged_in.jet +7 -2
  62. package/site/templates/collection/carousel_item.jet +5 -3
  63. package/site/templates/common/awards/carousel.jet +7 -1
  64. package/site/templates/common/awards/item.jet +2 -2
  65. package/site/templates/common/social-media-buttons.jet +1 -37
  66. package/site/templates/common/sponsor-image.jet +18 -0
  67. package/site/templates/film/item.jet +98 -85
  68. package/site/templates/page/curated.jet +1 -1
  69. package/site/templates/page/page-content.jet +1 -23
  70. package/site/templates/page/page-header.jet +25 -6
  71. package/site/templates/tv/detail.jet +30 -21
  72. package/site/tr_TR.all.json +1306 -602
  73. package/site/uk_UA.all.json +582 -451
  74. package/site/zh_TW.all.json +492 -419
  75. package/site/ee_EE.all.json +0 -602
  76. package/site/se_SE.all.json +0 -601
  77. package/site/static/fonts/FontAwesome.otf +0 -0
  78. package/site/static/fonts/fontawesome-webfont.eot +0 -0
  79. package/site/static/fonts/fontawesome-webfont.svg +0 -565
  80. package/site/static/fonts/fontawesome-webfont.ttf +0 -0
  81. package/site/static/fonts/fontawesome-webfont.woff +0 -0
  82. package/site/static/fonts/fontawesome-webfont.woff2 +0 -0
  83. package/site/styles/_social-media-buttons.scss +0 -159
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 16.13.1
package/CHANGELOG.md CHANGED
@@ -1,36 +1,88 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/shift72/core-template/compare/0.4.4...HEAD)
3
+ ## [Unreleased](https://github.com/shift72/core-template/compare/0.6.0-alpha.0...HEAD)
4
+
5
+ ## [0.6.0-alpha.0](https://github.com/shift72/core-template/compare/0.5.1...0.6.0-alpha.0)
6
+
7
+ ### Added
8
+ - If the signed in user has plans to show, they will now be visible in `subscriptions.html.jet` with a link from "My Subscriptions" in the menu.
9
+ - Styling and translations to support SVOD subscriptions.
10
+ - `.nvmrc` to pin versions of Node/NPM.
11
+ - Developer tool to fetch translations from Google Translate.
12
+ - Social media buttons replaced with share modal.
13
+ - Relish now loads the `urlmap.json`.
14
+ - Sponsor image in carousel and meta detail.
15
+
16
+ ### Changed
17
+ - Default Font Awesome removed. A trimmed icons file is now in `fa-s72.woff` being used by `_icons.scss`.
18
+ - Styling changes to awards and availability label/status.
19
+
20
+ ### Fixed
21
+ - Removed some redundant wishlist CSS.
22
+ - Improved and translated element switcher.
23
+ - Removed suffixed `plan` from subscription translations.
24
+ - Changed incorrect language code for Estonia.
25
+ - Donate button hover color.
26
+ - Google scripts respect cookie consents and only load when accepted.
27
+
28
+ ## [0.5.1](https://github.com/shift72/core-template/compare/0.5.0...0.5.1)
29
+
30
+ ### Changed
31
+ - Upgrade to kibble `0.16.7`.
32
+
33
+ ### Fixed
34
+ - Sentence casing for `en_AU` translation about passes.
35
+
36
+ ## [0.5.0](https://github.com/shift72/core-template/compare/0.4.4...0.5.0)
37
+
38
+ ### Added
39
+ - Start the site with an admin build: `npm start --admin`.
40
+ - Added Core template version to `<head>` and `kibble.json`.
41
+ - Added styling for floating donate button to use button sass variables.
42
+ - A bunch of missing language keys across language files.
43
+ - Automated translation command.
44
+
45
+ ### Changed
46
+ - Upgrade to kibble `0.16.6`.
47
+ - Moved references from `film.Images` to `film.ImageMap`.
48
+ - Removed minimum page height from content pages.
49
+ - Moved skip link above cookie consent banner
50
+
51
+ ### Fixed
52
+ - Can now override the cookie consent styling.
53
+ - Can now send analytics data to both GA4 and UA Legacy google analytics (GA4 previously not supported).
4
54
 
5
55
  ## [0.4.4](https://github.com/shift72/core-template/compare/0.4.3...0.4.4)
6
- - Fixed usage of obsolete $primary var for trailer button
7
56
 
8
57
  ### Added
9
- - Awards categories
58
+ - Awards categories.
59
+
60
+ ### Fixed
61
+ - Fixed obsolete `$primary` var for trailer button.
10
62
 
11
63
  ## [0.4.3](https://github.com/shift72/core-template/compare/0.4.2...0.4.3)
12
64
 
13
65
  ### Added
14
- - Awards categories
15
- - Floating donate button
66
+ - Awards categories.
67
+ - Floating donate button.
16
68
  - External custom CSS link in head.
17
69
  - Scripts for downloading/uploading custom CSS files for use with local development.
18
70
 
19
71
  ### Changed
20
- - Replaced various SASS variables with CSS variables.
21
- - Added workarounds for SASS and Bootstrap functions that don't understand CSS variables.
22
- - Kibble 0.16.4
23
- - Split CC and Subtitles
24
- - Moved engagement icons
72
+ - Replaced various Sass variables with CSS variables.
73
+ - Added workarounds for Sass and Bootstrap functions that don't understand CSS variables.
74
+ - Kibble `0.16.4`.
75
+ - Split CC and Subtitles.
76
+ - Moved engagement icons.
25
77
 
26
78
  ## [0.4.2](https://github.com/shift72/core-template/compare/0.4.1...0.4.2)
27
79
 
28
80
  ### Added
29
- - Lang files updated with entries for purchasing one-off passes
30
- - Sponsor banner that can be enabled/disabled in Uber Admin
81
+ - Lang files updated with entries for purchasing one-off passes.
82
+ - Sponsor banner.
31
83
 
32
- ### Changed
33
- - Typo in English lang file
84
+ ### Fixed
85
+ - Typo in English language file.
34
86
 
35
87
  ## [0.4.1](https://github.com/shift72/core-template/compare/0.4.0...0.4.1)
36
88
 
@@ -51,11 +103,11 @@ No changes from RC0.
51
103
 
52
104
  ### Changed
53
105
  - Moved separator line from footer jet into app badge jet.
54
- - Kibble upgraded to v0.15.22.
106
+ - Kibble upgraded to `0.15.22`.
55
107
  - Application templates moved to `/site/templates/application/`.
56
108
  - Links (`<a>` tags) without a `class` attribute have `text-decoration: underline`.
57
109
 
58
- ## Fixed
110
+ ### Fixed
59
111
  - Curated pages with a collection no longer has a `min-height` that was forcing a gap before the collection.
60
112
 
61
113
  ## [0.3.8](https://github.com/shift72/core-template/compare/0.3.7...0.3.8)
package/kibble.json CHANGED
@@ -2,35 +2,113 @@
2
2
  "name": "core-template",
3
3
  "version": "0.0.1",
4
4
  "siteUrl": "https://abccinemas.screenplus.co",
5
- "builderVersion": "0.16.4",
5
+ "builderVersion": "0.16.6",
6
6
  "defaultLanguage": "en",
7
7
  "languages": {
8
- "ar": { "code": "ar_LB", "name": "عربى" },
9
- "ca": { "code": "ca_ES", "name": "Català" },
10
- "da": { "code": "da_DK", "name": "Dansk" },
11
- "de": { "code": "de_DE", "name": "Deutsch" },
12
- "ee": { "code": "ee_EE", "name": "Eestlane" },
13
- "el": { "code": "el_EL", "name": "Ελληνικά" },
14
- "en": { "code": "en_AU", "name": "English" },
15
- "es": { "code": "es_ES", "name": "Español" },
16
- "es-mx": { "code": "es_MX", "name": "Español" },
17
- "fi": { "code": "fi_FI", "name": "Suomi" },
18
- "fr": { "code": "fr_FR", "name": "Français" },
19
- "hr": { "code": "hr_HR", "name": "Hrvatski" },
20
- "hu": { "code": "hu_HU", "name": "Magyar" },
21
- "it": { "code": "it_IT", "name": "Italiano" },
22
- "ja": { "code": "ja_JP", "name": "日本語" },
23
- "lt": { "code": "lt_LT", "name": "Lietuvių Kalba" },
24
- "nl": { "code": "nl_BE", "name": "Nederlands" },
25
- "no": { "code": "no_NO", "name": "Norsk" },
26
- "pl": { "code": "pl_PL", "name": "Polski" },
27
- "pt": { "code": "pt_PT", "name": "Português" },
28
- "pt-br": { "code": "pt_BR", "name": "Português do Brasil" },
29
- "ru": { "code": "ru_RU", "name": "Pусский" },
30
- "se": { "code": "se_SE", "name": "Српски" },
31
- "tr": { "code": "tr_TR", "name": "Türk" },
32
- "uk": { "code": "uk_UA", "name": "Український" },
33
- "zh-tw": { "code": "zh_TW", "name": "中文" }
8
+ "ar": {
9
+ "code": "ar_LB",
10
+ "name": "عربى"
11
+ },
12
+ "ca": {
13
+ "code": "ca_ES",
14
+ "name": "Català"
15
+ },
16
+ "da": {
17
+ "code": "da_DK",
18
+ "name": "Dansk"
19
+ },
20
+ "de": {
21
+ "code": "de_DE",
22
+ "name": "Deutsch"
23
+ },
24
+ "et": {
25
+ "code": "et_ET",
26
+ "name": "Eestlane"
27
+ },
28
+ "el": {
29
+ "code": "el_EL",
30
+ "name": "Ελληνικά"
31
+ },
32
+ "en": {
33
+ "code": "en_AU",
34
+ "name": "English"
35
+ },
36
+ "es": {
37
+ "code": "es_ES",
38
+ "name": "Español"
39
+ },
40
+ "es-mx": {
41
+ "code": "es_MX",
42
+ "name": "Español"
43
+ },
44
+ "fi": {
45
+ "code": "fi_FI",
46
+ "name": "Suomi"
47
+ },
48
+ "fr": {
49
+ "code": "fr_FR",
50
+ "name": "Français"
51
+ },
52
+ "hr": {
53
+ "code": "hr_HR",
54
+ "name": "Hrvatski"
55
+ },
56
+ "hu": {
57
+ "code": "hu_HU",
58
+ "name": "Magyar"
59
+ },
60
+ "it": {
61
+ "code": "it_IT",
62
+ "name": "Italiano"
63
+ },
64
+ "ja": {
65
+ "code": "ja_JP",
66
+ "name": "日本語"
67
+ },
68
+ "lt": {
69
+ "code": "lt_LT",
70
+ "name": "Lietuvių Kalba"
71
+ },
72
+ "nl": {
73
+ "code": "nl_BE",
74
+ "name": "Nederlands"
75
+ },
76
+ "no": {
77
+ "code": "no_NO",
78
+ "name": "Norsk"
79
+ },
80
+ "pl": {
81
+ "code": "pl_PL",
82
+ "name": "Polski"
83
+ },
84
+ "pt": {
85
+ "code": "pt_PT",
86
+ "name": "Português"
87
+ },
88
+ "pt-br": {
89
+ "code": "pt_BR",
90
+ "name": "Português do Brasil"
91
+ },
92
+ "ru": {
93
+ "code": "ru_RU",
94
+ "name": "Pусский"
95
+ },
96
+ "sr": {
97
+ "code": "sr_SR",
98
+ "name": "Српски"
99
+ },
100
+ "tr": {
101
+ "code": "tr_TR",
102
+ "name": "Türk"
103
+ },
104
+ "uk": {
105
+ "code": "uk_UA",
106
+ "name": "Український"
107
+ },
108
+ "zh-tw": {
109
+ "code": "zh_TW",
110
+ "name": "中文"
111
+ }
34
112
  },
35
113
  "siteRootPath": "site",
36
114
  "liveReload": {
@@ -106,5 +184,6 @@
106
184
  "datasource": "Collection",
107
185
  "pageSize": 0
108
186
  }
109
- ]
110
- }
187
+ ],
188
+ "coreTemplateVersion": "0.6.0-alpha.0"
189
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@shift72/core-template",
3
- "version": "0.4.4",
3
+ "version": "0.6.0-alpha.0",
4
4
  "description": "Shift72 core template",
5
5
  "license": "MIT",
6
6
  "scripts": {
7
- "start": "npm run init && npm-run-all --parallel css:watch js:watch kibble:watch",
8
- "init": "npm-run-all css css:local:get js",
7
+ "start": "run-s -l init && run-p -l css:watch js:watch kibble:start",
8
+ "init": "run-p -l css css:local:get js",
9
9
  "css": "sass ./site/styles/main.scss ./site/static/styles/main.css --load-path=node_modules",
10
10
  "css:lint": "prettier 'site/styles/*.scss' --write && stylelint ./site/styles/*.scss --fix",
11
11
  "css:watch": "npm run css -- --watch",
@@ -13,15 +13,21 @@
13
13
  "css:local:get": "node scripts/css-local-get.js",
14
14
  "css:local:put": "node scripts/css-local-put.js",
15
15
  "js": "rollup -c",
16
- "js:lint": "prettier '{scripts,site/static/js}/**/!(modernizr-custom).js' --write && eslint ./site/static/js/*.js ./scripts --fix",
16
+ "js:lint": "prettier '{scripts,site/static/js}/**/!(modernizr-custom).*js' --write && eslint ./site/static/js/*.*js ./scripts --fix",
17
17
  "js:watch": "rollup -c -w",
18
18
  "js:build": "rollup -c",
19
19
  "kibble": "kibble render",
20
+ "kibble:start": "mkdir -p .kibble && test -n \"$npm_config_admin\" && npm run kibble:watch -- --admin || npm run kibble:watch",
20
21
  "kibble:watch": "kibble render --watch --port 8081",
21
22
  "kibble:build": "kibble publish",
22
- "build": "npm-run-all css js:build css:build kibble:build",
23
+ "build": "run-s -l css js:build css:build kibble:build",
23
24
  "language:csv": "node scripts/language-file-to-csv/language-file-to-csv.js site/en_AU.all.json",
24
- "language:validate": "node scripts/language-file-validator.js"
25
+ "language:validate": "node scripts/language-file-validator.js",
26
+ "version": "node scripts/core-template-version.js",
27
+ "prestart": "npm run version",
28
+ "prebuild": "npm run version",
29
+ "prepare": "npm run version",
30
+ "translate": "node scripts/translate.mjs"
25
31
  },
26
32
  "repository": {
27
33
  "type": "git",
@@ -40,14 +46,13 @@
40
46
  "concat": "^1.0.3",
41
47
  "cssnano": "^5.0.8",
42
48
  "del": "^6.0.0",
43
- "font-awesome": "^4.7.0",
44
49
  "minify": "^4.1.1",
45
50
  "npm-run-all": "^4.0.2",
46
51
  "postcss": "^8.3.11",
47
52
  "postcss-cli": "^9.0.1",
48
53
  "rollup": "^2.23.0",
49
54
  "rollup-plugin-terser": "^6.1.0",
50
- "s72-kibble": "^0.16.4",
55
+ "s72-kibble": "^0.16.7",
51
56
  "sass": "^1.36.0"
52
57
  },
53
58
  "devDependencies": {
@@ -63,9 +68,16 @@
63
68
  "stylelint-config-prettier": "^8.0.2",
64
69
  "stylelint-config-sass-guidelines": "^8.0.0",
65
70
  "stylelint-prettier": "^1.2.0",
66
- "stylelint-scss": "^3.19.0"
71
+ "stylelint-scss": "^3.19.0",
72
+ "glob": "^7.2.0",
73
+ "node-fetch": "^3.2.3"
67
74
  },
68
75
  "eslintConfig": {
76
+ "settings": {
77
+ "jest": {
78
+ "version": 26
79
+ }
80
+ },
69
81
  "env": {
70
82
  "browser": true,
71
83
  "es6": true
@@ -0,0 +1,30 @@
1
+ const fs = require('fs');
2
+
3
+ let version, kibbleJSON;
4
+
5
+ try {
6
+ version = JSON.parse(fs.readFileSync('package.json'))['version'];
7
+ } catch(e) {
8
+ exitWithError(`Failed to parse package.json: ${e}`);
9
+ }
10
+
11
+ try {
12
+ kibbleJSON = JSON.parse(fs.readFileSync('kibble.json'));
13
+ } catch(e) {
14
+ exitWithError(`Failed to parse kibble.json: ${e}`);
15
+ }
16
+
17
+ kibbleJSON['coreTemplateVersion'] = version;
18
+
19
+ try {
20
+ fs.writeFileSync('kibble.json', JSON.stringify(kibbleJSON, null, 2));
21
+ } catch(e) {
22
+ exitWithError(`Failed to write kibble.json: ${e}`);
23
+ }
24
+
25
+ console.log(`Core-Template Version ${version} written to kibble.json`);
26
+
27
+ function exitWithError(message) {
28
+ console.error(message);
29
+ process.exit();
30
+ }
@@ -7,7 +7,7 @@ if (!fs.existsSync(outputDir)) {
7
7
 
8
8
  if (process.argv.length < 3) {
9
9
  console.error('ERROR - Language file path argument missing!');
10
- return;
10
+ process.exit();
11
11
  }
12
12
 
13
13
  let languageFilePath = process.argv[2];
@@ -15,7 +15,7 @@ let validLanguageFilePath = /site\/[a-z]{2}_[A-Z]{2}.all.json/;
15
15
 
16
16
  if (!languageFilePath.match(validLanguageFilePath)) {
17
17
  console.error(`ERROR - Language file path argument '${languageFilePath}' invalid!`);
18
- return;
18
+ process.exit();
19
19
  }
20
20
 
21
21
  let rawdata = fs.readFileSync(languageFilePath);
@@ -116,4 +116,4 @@ function testValueNotKey(translation, key) {
116
116
  console.error(`${key} - key is value.`);
117
117
  errors.push(e);
118
118
  }
119
- }
119
+ }
@@ -0,0 +1,51 @@
1
+ import fetch from 'node-fetch';
2
+ import glob from 'glob';
3
+ import * as fs from 'fs';
4
+ const key = process.argv[2];
5
+ const value = process.argv[3];
6
+ const nestedKey = process.argv[4];
7
+
8
+ if (!key || !value) {
9
+ console.log('Should be \'npm run translate key value\'');
10
+ process.exit(1);
11
+ }
12
+ glob('./site/*.json', {}, (err, files) => {
13
+ files.forEach(pathName => {
14
+ function writeTranslationFile(translatedValue) {
15
+ if (!content[key]) {
16
+ content[key] = {};
17
+ }
18
+
19
+ content[key][nestedKey ? nestedKey : 'other'] = translatedValue;
20
+ fs.writeFileSync(pathName, JSON.stringify(content, null, 2));
21
+ }
22
+ const file_content = fs.readFileSync(pathName);
23
+ const content = JSON.parse(file_content);
24
+ let languageCode = pathName.slice(7, 9);
25
+ if (languageCode == 'ee') languageCode = 'et';
26
+ if (value.trim() === '') {
27
+ writeTranslationFile(value);
28
+ } else {
29
+ fetch(
30
+ `https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${languageCode}&dt=t&q=${encodeURI(
31
+ value
32
+ )}`
33
+ )
34
+ .then(res => {
35
+ const contentType = res.headers.get('content-type');
36
+ if (contentType && contentType.indexOf('application/json') !== -1) {
37
+ return res.json();
38
+ }
39
+ console.log(`translation failed for ${languageCode}`);
40
+ })
41
+ .then(translated => {
42
+ if (translated) {
43
+ let translatedValue = '';
44
+ translated[0].forEach(each => translatedValue += each[0]);
45
+ writeTranslationFile(translatedValue);
46
+ }
47
+ });
48
+ }
49
+
50
+ });
51
+ });