@financial-times/n-conversion-forms 30.1.0 → 31.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 +97 -150
- package/.toolkitrc.yml +19 -0
- package/.toolkitstate/ci.json +6 -0
- package/README.md +2 -2
- package/jest.config.js +2 -0
- package/package.json +30 -16
- package/.circleci/shared-helpers/.github/settings.yml +0 -1
- package/.circleci/shared-helpers/CODEOWNERS +0 -3
- package/.circleci/shared-helpers/README.md +0 -72
- package/.circleci/shared-helpers/helper-check-service-ready +0 -37
- package/.circleci/shared-helpers/helper-configure-awscli +0 -20
- package/.circleci/shared-helpers/helper-generate-build-state-artifacts +0 -29
- package/.circleci/shared-helpers/helper-install-awscli +0 -14
- package/.circleci/shared-helpers/helper-install-puppeteer-deps +0 -25
- package/.circleci/shared-helpers/helper-npm-install-peer-deps +0 -40
- package/.circleci/shared-helpers/helper-npm-store-auth-token +0 -14
- package/.circleci/shared-helpers/helper-npm-update +0 -26
- package/.circleci/shared-helpers/helper-npm-version-and-publish-public +0 -19
- package/.circleci/shared-helpers/helper-publish-github-pages +0 -43
- package/.circleci/shared-helpers/helper-setup-heroku-cli +0 -46
- package/.circleci/shared-helpers/helper-setup-s3-upload +0 -17
- package/.circleci/shared-helpers/helper-upload-assets-to-s3 +0 -69
- package/.circleci/shared-helpers/helper.example +0 -13
- package/build-state/npm-shrinkwrap.json +0 -58461
- package/dist/accept-terms-business.js +0 -74
- package/dist/accept-terms-business.spec.js +0 -40
- package/dist/accept-terms-privacy-policy.js +0 -71
- package/dist/accept-terms-subscription.js +0 -150
- package/dist/accept-terms.js +0 -217
- package/dist/app-banner.js +0 -51
- package/dist/b2c-partnership-confirmation.js +0 -64
- package/dist/billing-city.js +0 -58
- package/dist/billing-country.js +0 -43
- package/dist/billing-postcode.js +0 -76
- package/dist/company-name.js +0 -78
- package/dist/confirmation.js +0 -117
- package/dist/continue-reading.js +0 -45
- package/dist/country.js +0 -106
- package/dist/customer-care.js +0 -52
- package/dist/debug.js +0 -50
- package/dist/decision-maker.js +0 -72
- package/dist/deferred-billing-terms.js +0 -112
- package/dist/delivery-address-map.js +0 -184
- package/dist/delivery-address-type.js +0 -74
- package/dist/delivery-address.js +0 -123
- package/dist/delivery-city.js +0 -70
- package/dist/delivery-county.js +0 -48
- package/dist/delivery-instructions.js +0 -123
- package/dist/delivery-option.js +0 -77
- package/dist/delivery-po-box.js +0 -75
- package/dist/delivery-postcode.js +0 -116
- package/dist/delivery-security-instructions.js +0 -72
- package/dist/delivery-start-date.js +0 -77
- package/dist/education-job-title.js +0 -67
- package/dist/email.js +0 -90
- package/dist/error-page.js +0 -45
- package/dist/fieldset.js +0 -58
- package/dist/first-name.js +0 -73
- package/dist/form.js +0 -29
- package/dist/google-sign-in.js +0 -24
- package/dist/graduation-date.js +0 -112
- package/dist/index.js +0 -432
- package/dist/industry.js +0 -81
- package/dist/job-title.js +0 -65
- package/dist/last-name.js +0 -73
- package/dist/licence-confirmation.js +0 -67
- package/dist/licence-header.js +0 -52
- package/dist/licence-sign-in.js +0 -36
- package/dist/licence-title.js +0 -46
- package/dist/lite-sub-confirmation.js +0 -118
- package/dist/loader.js +0 -54
- package/dist/message.js +0 -101
- package/dist/message.spec.js +0 -96
- package/dist/organisation.js +0 -73
- package/dist/package-change.js +0 -38
- package/dist/password.js +0 -95
- package/dist/payment-term.js +0 -328
- package/dist/payment-type.js +0 -213
- package/dist/personal-title.js +0 -94
- package/dist/phone.js +0 -85
- package/dist/position.js +0 -86
- package/dist/progress-indicator.js +0 -66
- package/dist/province.js +0 -80
- package/dist/registration-confirmation.js +0 -108
- package/dist/responsibility.js +0 -84
- package/dist/section.js +0 -20
- package/dist/seven-day-pass-experiment-confirmation.js +0 -93
- package/dist/state.js +0 -80
- package/dist/submit.js +0 -52
- package/dist/text-input.js +0 -78
- package/dist/trial-banner.js +0 -29
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# HELPER PURPOSE
|
|
4
|
-
#
|
|
5
|
-
# Run npm update to ensure npm packages in node_modules are the latest.
|
|
6
|
-
#
|
|
7
|
-
# Why we pass the flags we do to `npm update`:
|
|
8
|
-
#
|
|
9
|
-
# --dev - Also update devDependencies
|
|
10
|
-
#
|
|
11
|
-
# --no-package-lock - While we now use package-lock.json
|
|
12
|
-
# in our repos, skip package-lock.json in this instance
|
|
13
|
-
# as we don't want to accidentally modify the file
|
|
14
|
-
# for subsequent steps in the workflow, e.g cache keys
|
|
15
|
-
# and artefact generation.
|
|
16
|
-
#
|
|
17
|
-
# --no-save - We don't want to modify package.json as we
|
|
18
|
-
# use its checksum for some CI tasks e.g. naming node_module caches
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
# Set error handling
|
|
22
|
-
set -eu -o pipefail
|
|
23
|
-
|
|
24
|
-
# HELPER COMMANDS
|
|
25
|
-
|
|
26
|
-
npm update --dev --no-package-lock --no-save
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# HELPER PURPOSE
|
|
4
|
-
#
|
|
5
|
-
# Bump package version and publicly publish to npm
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
# Set error handling
|
|
9
|
-
set -eu -o pipefail
|
|
10
|
-
|
|
11
|
-
# HELPER COMMANDS
|
|
12
|
-
|
|
13
|
-
PRERELEASE_IDENTIFIER="-[a-z-]+"
|
|
14
|
-
RELEASE_TAG="latest"
|
|
15
|
-
|
|
16
|
-
if [[ $CIRCLE_TAG =~ $PRERELEASE_IDENTIFIER ]]; then RELEASE_TAG="pre-release"; fi
|
|
17
|
-
|
|
18
|
-
npm version --no-git-tag-version ${CIRCLE_TAG}
|
|
19
|
-
npm publish --access public --tag=${RELEASE_TAG}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# HELPER PURPOSE
|
|
4
|
-
#
|
|
5
|
-
# Deploy to Github Pages
|
|
6
|
-
# Your project should set the GITHUB_EMAIL, GITHUB_NAME and TARGET_DIR variables in Vault
|
|
7
|
-
|
|
8
|
-
TARGET_BRANCH=gh-pages
|
|
9
|
-
TEMP_DIR=tmp
|
|
10
|
-
|
|
11
|
-
# Set error handling
|
|
12
|
-
set -eu -o pipefail
|
|
13
|
-
|
|
14
|
-
# Set GitHub user information (the email must match the SSH key provided to Circle)
|
|
15
|
-
git config --global user.email $GITHUB_EMAIL
|
|
16
|
-
git config --global user.name $GITHUB_NAME
|
|
17
|
-
|
|
18
|
-
# HACK: Add GitHub to known hosts to avoid an interactive prompt when cloning over SSH
|
|
19
|
-
mkdir -p ~/.ssh
|
|
20
|
-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
|
|
21
|
-
|
|
22
|
-
# Clone only the branch we need so we don't download all of the project history
|
|
23
|
-
git clone $CIRCLE_REPOSITORY_URL $TEMP_DIR --single-branch --branch $TARGET_BRANCH
|
|
24
|
-
|
|
25
|
-
# Remove all of the files, -q prevents logging every filename
|
|
26
|
-
cd $TEMP_DIR
|
|
27
|
-
git rm -rf .
|
|
28
|
-
cd ..
|
|
29
|
-
|
|
30
|
-
# Copy contents of target directory to the deployment directory
|
|
31
|
-
cp -R -L $TARGET_DIR $TEMP_DIR
|
|
32
|
-
|
|
33
|
-
# Copy CI config (which should instruct Circle to ignore this branch)
|
|
34
|
-
cp -r .circleci $TEMP_DIR
|
|
35
|
-
|
|
36
|
-
cd $TEMP_DIR
|
|
37
|
-
|
|
38
|
-
# Stage and commit all of the files
|
|
39
|
-
git add -A &> /dev/null
|
|
40
|
-
git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty
|
|
41
|
-
|
|
42
|
-
# Push to the target branch, staying quiet unless something goes wrong
|
|
43
|
-
git push -q origin $TARGET_BRANCH
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# HELPER PURPOSE
|
|
4
|
-
#
|
|
5
|
-
# Download heroku-cli tool, config auth with .netrc
|
|
6
|
-
#
|
|
7
|
-
# Based on standalone script from https://devcenter.heroku.com/articles/heroku-cli#standalone-installation
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
# Set error handling
|
|
11
|
-
set -eu -o pipefail
|
|
12
|
-
|
|
13
|
-
# HELPER COMMANDS
|
|
14
|
-
|
|
15
|
-
# Install Heroku CLI
|
|
16
|
-
wget https://cli-assets.heroku.com/channels/stable/heroku-linux-x64.tar.gz
|
|
17
|
-
sudo mkdir -p /usr/local/lib /usr/local/bin
|
|
18
|
-
sudo tar -xzf heroku-linux-x64.tar.gz -C /usr/local/lib
|
|
19
|
-
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
|
|
20
|
-
|
|
21
|
-
# Output heroku-cli version so user can see in
|
|
22
|
-
# build log what version is being used
|
|
23
|
-
heroku --version
|
|
24
|
-
|
|
25
|
-
# Heroku Repo plugin allows us to clear the git repo, so we can force deploys on circle rebuild
|
|
26
|
-
heroku plugins:install heroku-repo
|
|
27
|
-
|
|
28
|
-
# Heroku CLI Authentication - Netrc file format
|
|
29
|
-
# https://devcenter.heroku.com/articles/authentication#netrc-file-format
|
|
30
|
-
|
|
31
|
-
cat > ~/.netrc << EOF
|
|
32
|
-
machine api.heroku.com
|
|
33
|
-
login $HEROKU_LOGIN
|
|
34
|
-
password $HEROKU_AUTH_TOKEN
|
|
35
|
-
|
|
36
|
-
machine git.heroku.com
|
|
37
|
-
login $HEROKU_LOGIN
|
|
38
|
-
password $HEROKU_AUTH_TOKEN
|
|
39
|
-
|
|
40
|
-
machine code.heroku.com
|
|
41
|
-
login $HEROKU_LOGIN
|
|
42
|
-
password $HEROKU_AUTH_TOKEN
|
|
43
|
-
EOF
|
|
44
|
-
|
|
45
|
-
# Set umask - owner r+w only
|
|
46
|
-
chmod 0600 ~/.netrc
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# HELPER PURPOSE
|
|
4
|
-
#
|
|
5
|
-
# Download s3up for uploading files to Amazon S3 buckets
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
# Set error handling
|
|
9
|
-
set -eu -o pipefail
|
|
10
|
-
|
|
11
|
-
# HELPER COMMANDS
|
|
12
|
-
|
|
13
|
-
# Install S3UP binary
|
|
14
|
-
sudo mkdir -p /usr/local/bin
|
|
15
|
-
|
|
16
|
-
sudo curl -sfL https://github.com/matthew-andrews/s3up/releases/download/v1.0.5/s3up_linux_386 -o /usr/local/bin/s3up
|
|
17
|
-
sudo chmod +x /usr/local/bin/s3up
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# HELPER PURPOSE
|
|
4
|
-
#
|
|
5
|
-
# Uploads the compressed assets generated by apps using Page kit to S3
|
|
6
|
-
#
|
|
7
|
-
# This helper will be executed in place of the current deploy-hashed-assets
|
|
8
|
-
# command in n-heroku-tools for all apps that are using Page Kit.
|
|
9
|
-
#
|
|
10
|
-
# It uploads JavaScipt, CSS, sourcemaps and compressed files to the EU and US
|
|
11
|
-
# regions, making the assets available to our CDN layer.
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
# Set error handling
|
|
15
|
-
set -eu -o pipefail
|
|
16
|
-
|
|
17
|
-
# HELPER COMMANDS
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
SOURCE_FOLDER=${1:-"public"}
|
|
21
|
-
DESTINATION_FOLDER=${2:-"hashed-assets/uploads"}
|
|
22
|
-
DESTINATION_BUCKET_EU="ft-next-hashed-assets-prod"
|
|
23
|
-
DESTINATION_BUCKET_US="ft-next-hashed-assets-prod-us"
|
|
24
|
-
|
|
25
|
-
upload_file() {
|
|
26
|
-
local FILE="$1"
|
|
27
|
-
local BASENAME=$(basename $FILE)
|
|
28
|
-
local DESTINATION_BUCKET="$2"
|
|
29
|
-
local ENCODING="identity"
|
|
30
|
-
local TYPE
|
|
31
|
-
|
|
32
|
-
if [[ "$FILE" == *".gz" ]]; then
|
|
33
|
-
ENCODING="gzip"
|
|
34
|
-
elif [[ "$FILE" == *".br" ]]; then
|
|
35
|
-
ENCODING="br"
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
# the AWS CLI can guess content types but not the original type of compressed files
|
|
39
|
-
# <https://github.com/aws/aws-cli/issues/3817>
|
|
40
|
-
case "$FILE" in
|
|
41
|
-
*".js"|*".js.gz"|*".js.br")
|
|
42
|
-
TYPE="application/javascript"
|
|
43
|
-
;;
|
|
44
|
-
*".css"|*".css.gz"|*".css.br")
|
|
45
|
-
TYPE="text/css"
|
|
46
|
-
;;
|
|
47
|
-
*".map")
|
|
48
|
-
TYPE="application/octet-stream"
|
|
49
|
-
;;
|
|
50
|
-
esac
|
|
51
|
-
|
|
52
|
-
aws s3 cp $FILE "s3://$DESTINATION_BUCKET/$DESTINATION_FOLDER/$BASENAME" \
|
|
53
|
-
--cache-control=31536000 \
|
|
54
|
-
--content-type="$TYPE; charset=utf-8" \
|
|
55
|
-
--content-encoding="$ENCODING" \
|
|
56
|
-
--acl="public-read"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
upload_files() {
|
|
60
|
-
local SOURCE_FILES=($(find $SOURCE_FOLDER/*.{js,css,gz,br,map} 2>/dev/null))
|
|
61
|
-
|
|
62
|
-
for FILE in ${SOURCE_FILES[@]}; do
|
|
63
|
-
# Uploading to both regions to remove the dependency on our AWS poller
|
|
64
|
-
upload_file "$FILE" $DESTINATION_BUCKET_EU
|
|
65
|
-
upload_file "$FILE" $DESTINATION_BUCKET_US
|
|
66
|
-
done
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
upload_files
|