@financial-times/n-conversion-forms 30.1.0 → 31.0.1

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.
Files changed (94) hide show
  1. package/.circleci/config.yml +97 -150
  2. package/.github/workflows/gh-pages-deploy.yml +3 -3
  3. package/.toolkitrc.yml +19 -0
  4. package/.toolkitstate/ci.json +6 -0
  5. package/CONTRIBUTING.md +1 -1
  6. package/README.md +2 -2
  7. package/components/accept-terms-subscription.jsx +7 -5
  8. package/jest.config.js +2 -0
  9. package/package.json +30 -16
  10. package/.circleci/shared-helpers/.github/settings.yml +0 -1
  11. package/.circleci/shared-helpers/CODEOWNERS +0 -3
  12. package/.circleci/shared-helpers/README.md +0 -72
  13. package/.circleci/shared-helpers/helper-check-service-ready +0 -37
  14. package/.circleci/shared-helpers/helper-configure-awscli +0 -20
  15. package/.circleci/shared-helpers/helper-generate-build-state-artifacts +0 -29
  16. package/.circleci/shared-helpers/helper-install-awscli +0 -14
  17. package/.circleci/shared-helpers/helper-install-puppeteer-deps +0 -25
  18. package/.circleci/shared-helpers/helper-npm-install-peer-deps +0 -40
  19. package/.circleci/shared-helpers/helper-npm-store-auth-token +0 -14
  20. package/.circleci/shared-helpers/helper-npm-update +0 -26
  21. package/.circleci/shared-helpers/helper-npm-version-and-publish-public +0 -19
  22. package/.circleci/shared-helpers/helper-publish-github-pages +0 -43
  23. package/.circleci/shared-helpers/helper-setup-heroku-cli +0 -46
  24. package/.circleci/shared-helpers/helper-setup-s3-upload +0 -17
  25. package/.circleci/shared-helpers/helper-upload-assets-to-s3 +0 -69
  26. package/.circleci/shared-helpers/helper.example +0 -13
  27. package/build-state/npm-shrinkwrap.json +0 -58461
  28. package/dist/accept-terms-business.js +0 -74
  29. package/dist/accept-terms-business.spec.js +0 -40
  30. package/dist/accept-terms-privacy-policy.js +0 -71
  31. package/dist/accept-terms-subscription.js +0 -150
  32. package/dist/accept-terms.js +0 -217
  33. package/dist/app-banner.js +0 -51
  34. package/dist/b2c-partnership-confirmation.js +0 -64
  35. package/dist/billing-city.js +0 -58
  36. package/dist/billing-country.js +0 -43
  37. package/dist/billing-postcode.js +0 -76
  38. package/dist/company-name.js +0 -78
  39. package/dist/confirmation.js +0 -117
  40. package/dist/continue-reading.js +0 -45
  41. package/dist/country.js +0 -106
  42. package/dist/customer-care.js +0 -52
  43. package/dist/debug.js +0 -50
  44. package/dist/decision-maker.js +0 -72
  45. package/dist/deferred-billing-terms.js +0 -112
  46. package/dist/delivery-address-map.js +0 -184
  47. package/dist/delivery-address-type.js +0 -74
  48. package/dist/delivery-address.js +0 -123
  49. package/dist/delivery-city.js +0 -70
  50. package/dist/delivery-county.js +0 -48
  51. package/dist/delivery-instructions.js +0 -123
  52. package/dist/delivery-option.js +0 -77
  53. package/dist/delivery-po-box.js +0 -75
  54. package/dist/delivery-postcode.js +0 -116
  55. package/dist/delivery-security-instructions.js +0 -72
  56. package/dist/delivery-start-date.js +0 -77
  57. package/dist/education-job-title.js +0 -67
  58. package/dist/email.js +0 -90
  59. package/dist/error-page.js +0 -45
  60. package/dist/fieldset.js +0 -58
  61. package/dist/first-name.js +0 -73
  62. package/dist/form.js +0 -29
  63. package/dist/google-sign-in.js +0 -24
  64. package/dist/graduation-date.js +0 -112
  65. package/dist/index.js +0 -432
  66. package/dist/industry.js +0 -81
  67. package/dist/job-title.js +0 -65
  68. package/dist/last-name.js +0 -73
  69. package/dist/licence-confirmation.js +0 -67
  70. package/dist/licence-header.js +0 -52
  71. package/dist/licence-sign-in.js +0 -36
  72. package/dist/licence-title.js +0 -46
  73. package/dist/lite-sub-confirmation.js +0 -118
  74. package/dist/loader.js +0 -54
  75. package/dist/message.js +0 -101
  76. package/dist/message.spec.js +0 -96
  77. package/dist/organisation.js +0 -73
  78. package/dist/package-change.js +0 -38
  79. package/dist/password.js +0 -95
  80. package/dist/payment-term.js +0 -328
  81. package/dist/payment-type.js +0 -213
  82. package/dist/personal-title.js +0 -94
  83. package/dist/phone.js +0 -85
  84. package/dist/position.js +0 -86
  85. package/dist/progress-indicator.js +0 -66
  86. package/dist/province.js +0 -80
  87. package/dist/registration-confirmation.js +0 -108
  88. package/dist/responsibility.js +0 -84
  89. package/dist/section.js +0 -20
  90. package/dist/seven-day-pass-experiment-confirmation.js +0 -93
  91. package/dist/state.js +0 -80
  92. package/dist/submit.js +0 -52
  93. package/dist/text-input.js +0 -78
  94. package/dist/trial-banner.js +0 -29
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # HELPER PURPOSE
4
-
5
- # Workaround for a bug in npm where it doesn't correctly
6
- # resolve conflicting peer dependencies.
7
- #
8
- # Parses errors for missing peer dependencies from
9
- # the output of `npm ls` and then pipes the package
10
- # names to `npm install`.
11
- #
12
- # Why we pass the flags we do to `npm install`:
13
- #
14
- # --no-package-lock - While we now use package-lock.json
15
- # in our repos, skip package-lock.json in this instance
16
- # as we don't want to accidentally modify the file
17
- # for subsequent steps in the workflow, e.g cache keys
18
- # and artefact generation.
19
- #
20
- # --no-save - We don't want to modify package.json as we
21
- # use its checksum for some CI tasks e.g. naming node_module caches
22
- #
23
-
24
- # Set error handling
25
- #
26
- # Do *not* set `-o pipefail` as `npm ls --production --parseable`
27
- # will have an exit code of 1 when there are missing peer
28
- # dependencies, but that's what we're expecting to happen
29
- set -eu
30
-
31
- # HELPER COMMANDS
32
-
33
- if [ -e package.json ]; then
34
-
35
- npm ls --production --parseable 2>&1 >/dev/null | \
36
- sed -n -e 's/^npm ERR! peer dep missing: \(.*\),.*/\1/p' | \
37
- xargs -I{} echo -n '"{}" ' | \
38
- xargs npm install --no-package-lock --no-save
39
-
40
- fi
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # HELPER PURPOSE
4
- #
5
- # Store npmjs registry auth token so npm can authenticate with it
6
- # e.g. for `npm publish` (see `helper-npm-publish`)
7
- #
8
-
9
- # Set error handling
10
- set -eu -o pipefail
11
-
12
- # HELPER COMMANDS
13
-
14
- echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc
@@ -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
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # HELPER PURPOSE
4
- #
5
- # TODO: Make this example a bit more useful
6
- #
7
-
8
- # Set error handling
9
- set -eu -o pipefail
10
-
11
- # HELPER COMMANDS
12
-
13
- # ...