@financial-times/n-conversion-forms 39.3.0 → 40.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +13 -44
- package/.toolkitrc.yml +19 -14
- package/.toolkitstate/ci.json +3 -2
- package/.toolkitstate/install.json +5 -0
- package/components/__snapshots__/debug.spec.js.snap +1303 -10
- package/components/debug.jsx +53 -6
- package/components/debug.stories.js +7 -0
- package/components/payment-term.jsx +1 -11
- package/components/payment-term.stories.js +0 -11
- package/dist/debug.jsx +28 -4
- package/dist/payment-term.jsx +0 -9
- package/main.scss +4 -0
- package/package.json +10 -11
- package/toolkit/run-storybook/.toolkitrc.yml +4 -1
- package/toolkit/run-storybook/index.js +2 -4
package/components/debug.jsx
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { allSupportedPostcodeExamples } from '../helpers/supportedPostcodeExamples';
|
|
4
|
+
import { getCountries } from '../utils/countries';
|
|
3
5
|
|
|
4
|
-
export function Debug({
|
|
6
|
+
export function Debug({
|
|
7
|
+
isTest = false,
|
|
8
|
+
showHelpers = false,
|
|
9
|
+
links = {},
|
|
10
|
+
countries = [],
|
|
11
|
+
}) {
|
|
5
12
|
// Strings are used rather than JSX as this component is injected into HTML
|
|
6
13
|
// along with onclick handlers, styles and javascript. JSX will escape and
|
|
7
14
|
// modify the HTML which we do not want. Once our applications are on JSX
|
|
@@ -26,11 +33,43 @@ export function Debug({ isTest = false, showHelpers = false, links = {} }) {
|
|
|
26
33
|
(link) =>
|
|
27
34
|
`<a key=${link} class="ncf__button ncf__button--inverse ncf__link" href="${links[link]}">${link}</a>`
|
|
28
35
|
);
|
|
36
|
+
|
|
37
|
+
// Builds a Country dropdown component to allow the user to select a country and reload the page with the selected country
|
|
38
|
+
// This is useful for testing the form with different countries without having to change the URL manually
|
|
39
|
+
// The dropdown is built using the getCountries function which groups countries into frequently used and alphabetical
|
|
40
|
+
const filteredCountries = getCountries({ filter: countries });
|
|
41
|
+
|
|
42
|
+
const createOption = (country) =>
|
|
43
|
+
`<option key="${country.code}" value="${country.code}">${country.name}</option>`;
|
|
44
|
+
|
|
45
|
+
const createOptGroup = (countryGroup) =>
|
|
46
|
+
`<optgroup key="${countryGroup.label}" label="${countryGroup.label}">
|
|
47
|
+
${countryGroup.countries.reduce(
|
|
48
|
+
(options, country) => `${options} ${createOption(country)}`
|
|
49
|
+
)}
|
|
50
|
+
</optgroup>`;
|
|
51
|
+
|
|
52
|
+
const optionsToRender = filteredCountries.reduce(
|
|
53
|
+
(options, country) =>
|
|
54
|
+
`${options} ${
|
|
55
|
+
country.label ? createOptGroup(country) : createOption(country)
|
|
56
|
+
}`,
|
|
57
|
+
''
|
|
58
|
+
);
|
|
59
|
+
const countriesDropDown = `
|
|
60
|
+
<select class="ncf__button ncf__button--debug ncf__button--inverse ncf__button--max-with" id="ncf-country" onchange="reloadWithSelectedCountry();">
|
|
61
|
+
<option value="">Change country</option>
|
|
62
|
+
<hr />
|
|
63
|
+
${optionsToRender}
|
|
64
|
+
</select>
|
|
65
|
+
`;
|
|
66
|
+
|
|
29
67
|
const helpers = `
|
|
30
68
|
<span class="ncf__debug-helpers">
|
|
31
69
|
<button class="ncf__button ncf__button--debug ncf__button--inverse" onclick="logout();" title="Logout and refresh">Logout</button>
|
|
32
70
|
<button class="ncf__button ncf__button--debug ncf__button--inverse" onclick="fillForm();" title="Fill form with debug data">Fill</button>
|
|
33
71
|
<button class="ncf__button ncf__button--debug ncf__button--inverse" onclick="fillForm(); submitForm();" title="Fill form with debug data and submit">Fill & Submit</button>
|
|
72
|
+
${countriesDropDown}
|
|
34
73
|
${isTest ? testCards : ''}
|
|
35
74
|
${links.length ? linksString : ''}
|
|
36
75
|
</span>
|
|
@@ -52,11 +91,7 @@ export function Debug({ isTest = false, showHelpers = false, links = {} }) {
|
|
|
52
91
|
var SYSTEM_CODE = document.documentElement.getAttribute('data-next-app') || 'n-conversion-forms';
|
|
53
92
|
var COUNTRY_CODE = window.FT && window.FT.country || 'GBR';
|
|
54
93
|
|
|
55
|
-
var postcodeByCountry = {
|
|
56
|
-
GBR: 'EC4M9BT',
|
|
57
|
-
USA: '10028',
|
|
58
|
-
CAN: 'K0E 9Z9'
|
|
59
|
-
};
|
|
94
|
+
var postcodeByCountry = ${JSON.stringify(allSupportedPostcodeExamples)};
|
|
60
95
|
|
|
61
96
|
var debugData = {
|
|
62
97
|
billingCity: 'London',
|
|
@@ -140,6 +175,17 @@ export function Debug({ isTest = false, showHelpers = false, links = {} }) {
|
|
|
140
175
|
document.cookie = 'next-flags=' + flags + '%2C' + flag + state + '; path=/; domain=.ft.com;';
|
|
141
176
|
window.location.reload();
|
|
142
177
|
}
|
|
178
|
+
|
|
179
|
+
function reloadWithSelectedCountry () {
|
|
180
|
+
var countryBox = document.getElementById("ncf-country");
|
|
181
|
+
var selectedValue = countryBox.options[countryBox.selectedIndex].value;
|
|
182
|
+
if (selectedValue) {
|
|
183
|
+
const url = new URL(window.location);
|
|
184
|
+
url.searchParams.set("countryCode", selectedValue);
|
|
185
|
+
history.pushState({}, "", url);
|
|
186
|
+
window.location.reload();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
143
189
|
`,
|
|
144
190
|
};
|
|
145
191
|
const style = {
|
|
@@ -185,4 +231,5 @@ Debug.propTypes = {
|
|
|
185
231
|
isTest: PropTypes.bool,
|
|
186
232
|
showHelpers: PropTypes.bool,
|
|
187
233
|
links: PropTypes.object,
|
|
234
|
+
countries: PropTypes.array,
|
|
188
235
|
};
|
|
@@ -11,3 +11,10 @@ Basic.args = {
|
|
|
11
11
|
isTest: true,
|
|
12
12
|
showHelpers: true,
|
|
13
13
|
};
|
|
14
|
+
|
|
15
|
+
export const WithCustomCountries = (args) => <Debug {...args} />;
|
|
16
|
+
WithCustomCountries.args = {
|
|
17
|
+
isTest: true,
|
|
18
|
+
showHelpers: true,
|
|
19
|
+
countries: ['GBR', 'USA', 'JPN', 'FRA', 'CAN'],
|
|
20
|
+
};
|
|
@@ -190,15 +190,6 @@ export function PaymentTerm({
|
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
const createDiscount = () => {
|
|
193
|
-
// We need to display a specific text in the discount tile for H2 campaign offers.
|
|
194
|
-
// This is a TEMPORARY hack and will be removed once the campaign is over (Monday, October 28th).
|
|
195
|
-
// A ticket has been raised to deal with the clean-up: https://financialtimes.atlassian.net/browse/ACQ-2970.
|
|
196
|
-
if (option.specialOffer) {
|
|
197
|
-
return (
|
|
198
|
-
<span className="ncf__payment-term__discount">Special offer</span>
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
193
|
return (
|
|
203
194
|
option.discount && (
|
|
204
195
|
<span className="ncf__payment-term__discount">
|
|
@@ -254,7 +245,7 @@ export function PaymentTerm({
|
|
|
254
245
|
option.amount,
|
|
255
246
|
option.currency,
|
|
256
247
|
option.value
|
|
257
|
-
|
|
248
|
+
)
|
|
258
249
|
)}
|
|
259
250
|
{nameMap['custom'].renewsText(getTimeFromPeriod(option.value))}
|
|
260
251
|
</div>
|
|
@@ -429,7 +420,6 @@ PaymentTerm.propTypes = {
|
|
|
429
420
|
title: PropTypes.string,
|
|
430
421
|
subTitle: PropTypes.string,
|
|
431
422
|
bestOffer: PropTypes.bool,
|
|
432
|
-
specialOffer: PropTypes.bool,
|
|
433
423
|
chargeOnText: PropTypes.string,
|
|
434
424
|
fulfilmentOption: PropTypes.string,
|
|
435
425
|
})
|
|
@@ -132,17 +132,6 @@ RenewOffers.args = {
|
|
|
132
132
|
selected: false,
|
|
133
133
|
chargeOnText: 'You will be charged on May 1, 2021',
|
|
134
134
|
},
|
|
135
|
-
{
|
|
136
|
-
title: 'Annual',
|
|
137
|
-
subTitle: '(Renews annually unless cancelled)',
|
|
138
|
-
price: '€ 150.00',
|
|
139
|
-
value: 150.0,
|
|
140
|
-
isTrial: false,
|
|
141
|
-
discount: '25%',
|
|
142
|
-
specialOffer: true,
|
|
143
|
-
selected: false,
|
|
144
|
-
chargeOnText: 'You will be charged on May 1, 2021',
|
|
145
|
-
},
|
|
146
135
|
{
|
|
147
136
|
title: '12 Month Subscription',
|
|
148
137
|
price: '€ 300.00',
|
package/dist/debug.jsx
CHANGED
|
@@ -7,13 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.Debug = Debug;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _supportedPostcodeExamples = require("../helpers/supportedPostcodeExamples");
|
|
11
|
+
var _countries = require("../utils/countries");
|
|
10
12
|
function Debug(_ref) {
|
|
11
13
|
var _ref$isTest = _ref.isTest,
|
|
12
14
|
isTest = _ref$isTest === void 0 ? false : _ref$isTest,
|
|
13
15
|
_ref$showHelpers = _ref.showHelpers,
|
|
14
16
|
showHelpers = _ref$showHelpers === void 0 ? false : _ref$showHelpers,
|
|
15
17
|
_ref$links = _ref.links,
|
|
16
|
-
links = _ref$links === void 0 ? {} : _ref$links
|
|
18
|
+
links = _ref$links === void 0 ? {} : _ref$links,
|
|
19
|
+
_ref$countries = _ref.countries,
|
|
20
|
+
countries = _ref$countries === void 0 ? [] : _ref$countries;
|
|
17
21
|
// Strings are used rather than JSX as this component is injected into HTML
|
|
18
22
|
// along with onclick handlers, styles and javascript. JSX will escape and
|
|
19
23
|
// modify the HTML which we do not want. Once our applications are on JSX
|
|
@@ -24,12 +28,31 @@ function Debug(_ref) {
|
|
|
24
28
|
var linksString = Object.keys(links).map(function (link) {
|
|
25
29
|
return "<a key=".concat(link, " class=\"ncf__button ncf__button--inverse ncf__link\" href=\"").concat(links[link], "\">").concat(link, "</a>");
|
|
26
30
|
});
|
|
27
|
-
|
|
31
|
+
|
|
32
|
+
// Builds a Country dropdown component to allow the user to select a country and reload the page with the selected country
|
|
33
|
+
// This is useful for testing the form with different countries without having to change the URL manually
|
|
34
|
+
// The dropdown is built using the getCountries function which groups countries into frequently used and alphabetical
|
|
35
|
+
var filteredCountries = (0, _countries.getCountries)({
|
|
36
|
+
filter: countries
|
|
37
|
+
});
|
|
38
|
+
var createOption = function createOption(country) {
|
|
39
|
+
return "<option key=\"".concat(country.code, "\" value=\"").concat(country.code, "\">").concat(country.name, "</option>");
|
|
40
|
+
};
|
|
41
|
+
var createOptGroup = function createOptGroup(countryGroup) {
|
|
42
|
+
return "<optgroup key=\"".concat(countryGroup.label, "\" label=\"").concat(countryGroup.label, "\">\n\t\t\t").concat(countryGroup.countries.reduce(function (options, country) {
|
|
43
|
+
return "".concat(options, " ").concat(createOption(country));
|
|
44
|
+
}), "\n\t\t</optgroup>");
|
|
45
|
+
};
|
|
46
|
+
var optionsToRender = filteredCountries.reduce(function (options, country) {
|
|
47
|
+
return "".concat(options, " ").concat(country.label ? createOptGroup(country) : createOption(country));
|
|
48
|
+
}, '');
|
|
49
|
+
var countriesDropDown = "\n\t\t<select class=\"ncf__button ncf__button--debug ncf__button--inverse ncf__button--max-with\" id=\"ncf-country\" onchange=\"reloadWithSelectedCountry();\">\n\t\t\t<option value=\"\">Change country</option>\n\t\t\t<hr />\n\t\t\t".concat(optionsToRender, "\n\t\t</select>\n\t");
|
|
50
|
+
var helpers = "\n\t\t<span class=\"ncf__debug-helpers\">\n\t\t\t<button class=\"ncf__button ncf__button--debug ncf__button--inverse\" onclick=\"logout();\" title=\"Logout and refresh\">Logout</button>\n\t\t\t<button class=\"ncf__button ncf__button--debug ncf__button--inverse\" onclick=\"fillForm();\" title=\"Fill form with debug data\">Fill</button>\n\t\t\t<button class=\"ncf__button ncf__button--debug ncf__button--inverse\" onclick=\"fillForm(); submitForm();\" title=\"Fill form with debug data and submit\">Fill & Submit</button>\n\t\t\t".concat(countriesDropDown, "\n\t\t\t").concat(isTest ? testCards : '', "\n\t\t\t").concat(links.length ? linksString : '', "\n\t\t</span>\n\t");
|
|
28
51
|
var html = {
|
|
29
52
|
__html: "".concat(isTest ? testEnvironment : productionEnvironment).concat(showHelpers ? helpers : '')
|
|
30
53
|
};
|
|
31
54
|
var javascript = {
|
|
32
|
-
__html: "\n\tvar FORM_SELECTOR = 'form.ncf';\n\tvar INPUT_SELECTOR = FORM_SELECTOR + ' input:not([type=\"checkbox\"]):not([type=\"radio\"])';\n\tvar SELECT_SELECTOR = FORM_SELECTOR + ' select';\n\tvar CHECKBOX_SELECTOR = FORM_SELECTOR + ' input[type=\"checkbox\"]';\n\tvar RADIO_SELECTOR = FORM_SELECTOR + ' input[type=\"radio\"]';\n\t// This env var gets set in production. We use this when creating email addresses in case any\n\t// get into production so Membership know who to come to about deleting them.\n\tvar SYSTEM_CODE = document.documentElement.getAttribute('data-next-app') || 'n-conversion-forms';\n\tvar COUNTRY_CODE = window.FT && window.FT.country || 'GBR';\n\n\tvar postcodeByCountry =
|
|
55
|
+
__html: "\n\tvar FORM_SELECTOR = 'form.ncf';\n\tvar INPUT_SELECTOR = FORM_SELECTOR + ' input:not([type=\"checkbox\"]):not([type=\"radio\"])';\n\tvar SELECT_SELECTOR = FORM_SELECTOR + ' select';\n\tvar CHECKBOX_SELECTOR = FORM_SELECTOR + ' input[type=\"checkbox\"]';\n\tvar RADIO_SELECTOR = FORM_SELECTOR + ' input[type=\"radio\"]';\n\t// This env var gets set in production. We use this when creating email addresses in case any\n\t// get into production so Membership know who to come to about deleting them.\n\tvar SYSTEM_CODE = document.documentElement.getAttribute('data-next-app') || 'n-conversion-forms';\n\tvar COUNTRY_CODE = window.FT && window.FT.country || 'GBR';\n\n\tvar postcodeByCountry = ".concat(JSON.stringify(_supportedPostcodeExamples.allSupportedPostcodeExamples), ";\n\n\tvar debugData = {\n\t\tbillingCity: 'London',\n\t\tbillingCountry: COUNTRY_CODE,\n\t\tbillingPostcode: postcodeByCountry[COUNTRY_CODE],\n\t\tcountry: COUNTRY_CODE,\n\t\tdeliveryAddressLine1: 'delivery test1',\n\t\tdeliveryAddressLine2: 'delivery test2',\n\t\tdeliveryAddressLine3: 'APT 2C',\n\t\tdeliveryCity: 'delivery city',\n\t\tdeliveryCounty: 'delivery county',\n\t\tdeliveryPostcode: postcodeByCountry[COUNTRY_CODE],\n\t\temail: SYSTEM_CODE + '-' + Date.now() + '@ftqa.org',\n\t\tfirstName: 'Test',\n\t\tindustry: 'DEF',\n\t\tlastName: 'Test',\n\t\tjobTitle: 'CEO',\n\t\torganisation: 'ft-org',\n\t\tpassword: 'password123',\n\t\tposition: 'AS',\n\t\tpostCode: postcodeByCountry[COUNTRY_CODE],\n\t\tprimaryTelephone: '0987654321',\n\t\tresponsibility: 'ADL',\n\t\tukVisaWorldpay: '4111111111111111',\n\t\tusAmex: '378282246310005',\n\t\tusVisaWorldpay: '4112344112344113',\n\t\tcheckoutVisa: '4242424242424242',\n\t\tcheckout3dsChallenge: 'Checkout1!',\n\t\tchaseVisa: '4011361100000010',\n\t\tverificationEmail: SYSTEM_CODE + '-' + Date.now() + '@ftqa.org',\n\t};\n\n\tfunction logout () {\n\t\tconst options = {\n\t\t\tmode: 'no-cors',\n\t\t\tcredentials: 'include'\n\t\t};\n\t\tfetch('https://www.ft.com/logout', options).then(function () {\n\t\t\twindow.location.reload();\n\t\t});\n\t}\n\n\tfunction fillForm () {\n\t\tvar changeEvent = document.createEvent('HTMLEvents');\n\t\tchangeEvent.initEvent('change', false, true);\n\n\t\tvar inputs = document.querySelectorAll(INPUT_SELECTOR + ', ' + SELECT_SELECTOR);\n\t\tinputs.forEach(function (input) {\n\t\t\tif (!/hidden/i.test(input.type) && input.disabled === false) {\n\t\t\t\tvar value = debugData[input.name];\n\t\t\t\tinput.value = value;\n\t\t\t\tinput.dispatchEvent(changeEvent);\n\t\t\t}\n\t\t});\n\t\tvar checkboxes = document.querySelectorAll(CHECKBOX_SELECTOR + ', ' + RADIO_SELECTOR);\n\t\tcheckboxes.forEach(function (checkbox) {\n\t\t\tcheckbox.checked = true;\n\t\t\tcheckbox.dispatchEvent(changeEvent);\n\t\t});\n\t}\n\n\tfunction submitForm () {\n\t\tdocument.querySelector(FORM_SELECTOR).submit();\n\t}\n\n\tfunction copyToClipboard (name) {\n\t\tvar string = debugData[name];\n\t\tvar textarea = document.createElement('textarea');\n\t\ttextarea.value = string;\n\t\tdocument.body.appendChild(textarea);\n\t\ttextarea.select();\n\t\tdocument.execCommand('copy');\n\t\tdocument.body.removeChild(textarea);\n\t}\n\n\tfunction setTestEnvironment (state) {\n\t\tvar flags = document.cookie.match('(^|[^;]+)\\\\s*next-flags\\\\s*=\\\\s*([^;]+)').pop();\n\t\tvar flag = 'conversionSandbox%3A';\n\t\tflags = flags.replace(flag + 'on', '');\n\t\tflags = flags.replace(flag + 'off', '');\n\t\tdocument.cookie = 'next-flags=' + flags + '%2C' + flag + state + '; path=/; domain=.ft.com;';\n\t\twindow.location.reload();\n\t}\n\t\n\tfunction reloadWithSelectedCountry () {\n\t\tvar countryBox = document.getElementById(\"ncf-country\");\n\t\tvar selectedValue = countryBox.options[countryBox.selectedIndex].value;\n\t\tif (selectedValue) {\n\t\t\tconst url = new URL(window.location);\n\t\t\turl.searchParams.set(\"countryCode\", selectedValue);\n\t\t\thistory.pushState({}, \"\", url);\n\t\t\twindow.location.reload();\n\t\t}\n\t}\n\t")
|
|
33
56
|
};
|
|
34
57
|
var style = {
|
|
35
58
|
__html: "\n\t.ncf__debug-panel {\n\t\tposition: absolute;\n\t\tbackground-color: #262a33;\n\t\tcolor: #ffffff;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\tpadding: 10px;\n\t\tposition: fixed;\n\t\tz-index: 1000;\n\t\topacity: 0.8;\n\t}\n\t.ncf__debug-button--test {\n\t\tbackground-color: #008040;\n\t}\n\t.ncf__debug-button--production {\n\t\tbackground-color: #990000;\n\t}\n\t.ncf__button--debug {\n\t\tpadding: 0px 5px;\n\t}\n\t"
|
|
@@ -46,5 +69,6 @@ function Debug(_ref) {
|
|
|
46
69
|
Debug.propTypes = {
|
|
47
70
|
isTest: _propTypes["default"].bool,
|
|
48
71
|
showHelpers: _propTypes["default"].bool,
|
|
49
|
-
links: _propTypes["default"].object
|
|
72
|
+
links: _propTypes["default"].object,
|
|
73
|
+
countries: _propTypes["default"].array
|
|
50
74
|
};
|
package/dist/payment-term.jsx
CHANGED
|
@@ -185,14 +185,6 @@ function PaymentTerm(_ref) {
|
|
|
185
185
|
defaultChecked: true
|
|
186
186
|
});
|
|
187
187
|
var createDiscount = function createDiscount() {
|
|
188
|
-
// We need to display a specific text in the discount tile for H2 campaign offers.
|
|
189
|
-
// This is a TEMPORARY hack and will be removed once the campaign is over (Monday, October 28th).
|
|
190
|
-
// A ticket has been raised to deal with the clean-up: https://financialtimes.atlassian.net/browse/ACQ-2970.
|
|
191
|
-
if (option.specialOffer) {
|
|
192
|
-
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
193
|
-
className: "ncf__payment-term__discount"
|
|
194
|
-
}, "Special offer");
|
|
195
|
-
}
|
|
196
188
|
return option.discount && /*#__PURE__*/_react["default"].createElement("span", {
|
|
197
189
|
className: "ncf__payment-term__discount"
|
|
198
190
|
}, option.bestOffer ? 'Best offer' : "Save ".concat(option.discount, " off RRP"));
|
|
@@ -314,7 +306,6 @@ PaymentTerm.propTypes = {
|
|
|
314
306
|
title: _propTypes["default"].string,
|
|
315
307
|
subTitle: _propTypes["default"].string,
|
|
316
308
|
bestOffer: _propTypes["default"].bool,
|
|
317
|
-
specialOffer: _propTypes["default"].bool,
|
|
318
309
|
chargeOnText: _propTypes["default"].string,
|
|
319
310
|
fulfilmentOption: _propTypes["default"].string
|
|
320
311
|
})),
|
package/main.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/n-conversion-forms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "40.0.0",
|
|
4
4
|
"description": "Containing jsx components and styles for forms included on Accounts and Acquisition apps (next-signup, next-profile, next-retention, etc).",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,14 +37,13 @@
|
|
|
37
37
|
"@babel/plugin-transform-runtime": "^7.23.9",
|
|
38
38
|
"@babel/preset-env": "^7.23.9",
|
|
39
39
|
"@babel/preset-react": "^7.23.3",
|
|
40
|
-
"@dotcom-tool-kit/babel": "
|
|
41
|
-
"@dotcom-tool-kit/component": "
|
|
42
|
-
"@dotcom-tool-kit/eslint": "
|
|
43
|
-
"@dotcom-tool-kit/
|
|
44
|
-
"@dotcom-tool-kit/
|
|
45
|
-
"@dotcom-tool-kit/
|
|
46
|
-
"@dotcom-tool-kit/
|
|
47
|
-
"@dotcom-tool-kit/prettier": "3.2.1",
|
|
40
|
+
"@dotcom-tool-kit/babel": "^4.0.2",
|
|
41
|
+
"@dotcom-tool-kit/component": "^5.0.3",
|
|
42
|
+
"@dotcom-tool-kit/eslint": "^4.0.2",
|
|
43
|
+
"@dotcom-tool-kit/jest": "^4.0.2",
|
|
44
|
+
"@dotcom-tool-kit/lint-staged-npm": "^4.0.2",
|
|
45
|
+
"@dotcom-tool-kit/logger": "^4.0.0",
|
|
46
|
+
"@dotcom-tool-kit/prettier": "^4.0.2",
|
|
48
47
|
"@financial-times/eslint-config-next": "7.1.0",
|
|
49
48
|
"@financial-times/jest-browser-resolver": "^1.0.2",
|
|
50
49
|
"@snyk/protect": "1.1278.0",
|
|
@@ -54,7 +53,7 @@
|
|
|
54
53
|
"@storybook/react-webpack5": "^7.6.13",
|
|
55
54
|
"@sucrase/jest-plugin": "^3.0.0",
|
|
56
55
|
"check-engines": "^1.6.0",
|
|
57
|
-
"dotcom-tool-kit": "
|
|
56
|
+
"dotcom-tool-kit": "^4.0.6",
|
|
58
57
|
"enzyme": "^3.11.0",
|
|
59
58
|
"enzyme-adapter-react-16": "^1.15.7",
|
|
60
59
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -85,7 +84,7 @@
|
|
|
85
84
|
"npm": "8.x || 9.x || 10.x"
|
|
86
85
|
},
|
|
87
86
|
"volta": {
|
|
88
|
-
"node": "22.
|
|
87
|
+
"node": "22.11.0"
|
|
89
88
|
},
|
|
90
89
|
"lint-staged": {
|
|
91
90
|
"**/*.{js,jsx,json,scss}": "dotcom-tool-kit format:staged test:staged --"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { Task } = require('@dotcom-tool-kit/
|
|
1
|
+
const { Task } = require('@dotcom-tool-kit/base');
|
|
2
2
|
const { exec } = require('child_process');
|
|
3
3
|
const { hookFork, waitOnExit } = require('@dotcom-tool-kit/logger');
|
|
4
4
|
|
|
@@ -12,6 +12,4 @@ class RunStorybook extends Task {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports.tasks = [RunStorybook];
|
|
15
|
+
module.exports = RunStorybook;
|