hof 22.9.0-beta.v1 → 22.9.0-beta.v3
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/config/hof-defaults.js +1 -0
- package/frontend/template-partials/views/cookies.html +6 -6
- package/frontend/template-partials/views/partials/cookie-banner.html +11 -6
- package/lib/settings.js +1 -0
- package/package.json +1 -1
- package/package/.eslintignore +0 -1
- package/package/CHANGELOG.md +0 -232
- package/package/LICENSE +0 -21
- package/package/README.md +0 -1887
- package/package/bin/hof-build +0 -10
- package/package/bin/hof-transpiler +0 -12
- package/package/build/helpers/importer.js +0 -29
- package/package/build/helpers/local.js +0 -35
- package/package/build/helpers/resolver/import.js +0 -32
- package/package/build/helpers/resolver/nearest-package-root.js +0 -33
- package/package/build/helpers/resolver/package.js +0 -29
- package/package/build/helpers/resolver.js +0 -16
- package/package/build/index.js +0 -49
- package/package/build/lib/env.js +0 -36
- package/package/build/lib/mkdir.js +0 -9
- package/package/build/lib/run.js +0 -17
- package/package/build/lib/spawn.js +0 -18
- package/package/build/tasks/browserify/compress.js +0 -15
- package/package/build/tasks/browserify/index.js +0 -48
- package/package/build/tasks/build/index.js +0 -6
- package/package/build/tasks/images/index.js +0 -27
- package/package/build/tasks/index.js +0 -8
- package/package/build/tasks/sass/index.js +0 -67
- package/package/build/tasks/translate/index.js +0 -20
- package/package/build/tasks/watch/index.js +0 -161
- package/package/components/address-lookup/default-model.js +0 -76
- package/package/components/address-lookup/defaults.js +0 -25
- package/package/components/address-lookup/index.js +0 -251
- package/package/components/address-lookup/templates/address-lookup.html +0 -14
- package/package/components/address-lookup/templates/address.html +0 -22
- package/package/components/address-lookup/templates/postcode.html +0 -9
- package/package/components/clear-session/Readme.md +0 -46
- package/package/components/clear-session/index.js +0 -26
- package/package/components/combine-and-loop-fields/Readme.md +0 -42
- package/package/components/combine-and-loop-fields/index.js +0 -156
- package/package/components/date/fields.js +0 -16
- package/package/components/date/index.js +0 -172
- package/package/components/date/templates/date.html +0 -20
- package/package/components/emailer/assets/images/govuk_logotype_email.png +0 -0
- package/package/components/emailer/assets/images/ho_crest_27px.png +0 -0
- package/package/components/emailer/assets/images/spacer.gif +0 -0
- package/package/components/emailer/email-service.js +0 -51
- package/package/components/emailer/emailer.js +0 -53
- package/package/components/emailer/index.js +0 -74
- package/package/components/emailer/transports/debug.js +0 -74
- package/package/components/emailer/transports/index.js +0 -8
- package/package/components/emailer/transports/ses.js +0 -36
- package/package/components/emailer/transports/smtp.js +0 -26
- package/package/components/emailer/transports/stub.js +0 -5
- package/package/components/emailer/views/layout.html +0 -63
- package/package/components/homeoffice-countries/index.js +0 -22
- package/package/components/index.js +0 -13
- package/package/components/notify/index.js +0 -62
- package/package/components/notify/notify.js +0 -51
- package/package/components/session-timeout-warning/index.js +0 -67
- package/package/components/summary/index.js +0 -237
- package/package/config/builder-defaults.js +0 -45
- package/package/config/component-defaults.js +0 -13
- package/package/config/hof-defaults.js +0 -65
- package/package/config/rate-limits.js +0 -20
- package/package/config/sanitisation-rules.js +0 -32
- package/package/controller/base-controller.js +0 -296
- package/package/controller/behaviour-hooks.js +0 -51
- package/package/controller/behaviour-session.js +0 -64
- package/package/controller/controller.js +0 -258
- package/package/controller/deprecate-error.js +0 -10
- package/package/controller/formatting/formatters.js +0 -70
- package/package/controller/formatting/index.js +0 -32
- package/package/controller/index.js +0 -17
- package/package/controller/validation/email.js +0 -30
- package/package/controller/validation/index.js +0 -101
- package/package/controller/validation/validators.js +0 -181
- package/package/controller/validation-error.js +0 -14
- package/package/frontend/govuk-template/build/config.js +0 -24
- package/package/frontend/govuk-template/build/govuk_template.html +0 -102
- package/package/frontend/govuk-template/build/index.js +0 -23
- package/package/frontend/govuk-template/govuk_template_generated.html +0 -102
- package/package/frontend/govuk-template/index.js +0 -29
- package/package/frontend/index.js +0 -9
- package/package/frontend/template-mixins/mixins/helpers.js +0 -103
- package/package/frontend/template-mixins/mixins/index.js +0 -37
- package/package/frontend/template-mixins/mixins/render.js +0 -12
- package/package/frontend/template-mixins/mixins/template-mixins.js +0 -520
- package/package/frontend/template-mixins/partials/forms/checkbox-group.html +0 -47
- package/package/frontend/template-mixins/partials/forms/checkbox.html +0 -16
- package/package/frontend/template-mixins/partials/forms/input-submit.html +0 -1
- package/package/frontend/template-mixins/partials/forms/input-text-date.html +0 -37
- package/package/frontend/template-mixins/partials/forms/input-text-group.html +0 -45
- package/package/frontend/template-mixins/partials/forms/option-group.html +0 -43
- package/package/frontend/template-mixins/partials/forms/select.html +0 -17
- package/package/frontend/template-mixins/partials/forms/textarea-group.html +0 -37
- package/package/frontend/template-mixins/partials/mixins/panel.html +0 -4
- package/package/frontend/template-partials/index.js +0 -9
- package/package/frontend/template-partials/translations/index.js +0 -26
- package/package/frontend/template-partials/translations/src/cy/base.json +0 -4
- package/package/frontend/template-partials/translations/src/cy/buttons.json +0 -6
- package/package/frontend/template-partials/translations/src/cy/cookies.json +0 -104
- package/package/frontend/template-partials/translations/src/cy/errorlist.json +0 -6
- package/package/frontend/template-partials/translations/src/cy/errors.json +0 -18
- package/package/frontend/template-partials/translations/src/cy/terms.json +0 -28
- package/package/frontend/template-partials/translations/src/en/accessibility.json +0 -43
- package/package/frontend/template-partials/translations/src/en/base.json +0 -5
- package/package/frontend/template-partials/translations/src/en/buttons.json +0 -10
- package/package/frontend/template-partials/translations/src/en/cookies.json +0 -116
- package/package/frontend/template-partials/translations/src/en/errorlist.json +0 -7
- package/package/frontend/template-partials/translations/src/en/errors.json +0 -35
- package/package/frontend/template-partials/translations/src/en/exit.json +0 -5
- package/package/frontend/template-partials/translations/src/en/fields.json +0 -5
- package/package/frontend/template-partials/translations/src/en/journey.json +0 -6
- package/package/frontend/template-partials/translations/src/en/save-and-exit.json +0 -4
- package/package/frontend/template-partials/translations/src/en/terms.json +0 -28
- package/package/frontend/template-partials/views/404.html +0 -9
- package/package/frontend/template-partials/views/accessibility.html +0 -55
- package/package/frontend/template-partials/views/confirm.html +0 -8
- package/package/frontend/template-partials/views/confirmation.html +0 -19
- package/package/frontend/template-partials/views/content/en/what-happens-next.md +0 -0
- package/package/frontend/template-partials/views/cookie-error.html +0 -1
- package/package/frontend/template-partials/views/cookies.html +0 -84
- package/package/frontend/template-partials/views/email/data-row.html +0 -4
- package/package/frontend/template-partials/views/email/formatted.html +0 -12
- package/package/frontend/template-partials/views/email/layout.html +0 -63
- package/package/frontend/template-partials/views/email/raw.html +0 -11
- package/package/frontend/template-partials/views/email/section-row.html +0 -3
- package/package/frontend/template-partials/views/error.html +0 -20
- package/package/frontend/template-partials/views/exit.html +0 -9
- package/package/frontend/template-partials/views/feedback-submitted.html +0 -11
- package/package/frontend/template-partials/views/layout.html +0 -55
- package/package/frontend/template-partials/views/partials/analytics-table.html +0 -25
- package/package/frontend/template-partials/views/partials/back.html +0 -5
- package/package/frontend/template-partials/views/partials/bullet-list.html +0 -7
- package/package/frontend/template-partials/views/partials/confirmation-alert.html +0 -6
- package/package/frontend/template-partials/views/partials/continue.html +0 -5
- package/package/frontend/template-partials/views/partials/cookie-banner.html +0 -29
- package/package/frontend/template-partials/views/partials/cookie-notification.html +0 -4
- package/package/frontend/template-partials/views/partials/cookie-settings-button.html +0 -1
- package/package/frontend/template-partials/views/partials/cookie-settings-radio.html +0 -8
- package/package/frontend/template-partials/views/partials/details-summary.html +0 -8
- package/package/frontend/template-partials/views/partials/external-link.html +0 -1
- package/package/frontend/template-partials/views/partials/form.html +0 -10
- package/package/frontend/template-partials/views/partials/gatag.html +0 -60
- package/package/frontend/template-partials/views/partials/head.html +0 -31
- package/package/frontend/template-partials/views/partials/heading.html +0 -11
- package/package/frontend/template-partials/views/partials/items-table.html +0 -32
- package/package/frontend/template-partials/views/partials/maincontent-left.html +0 -10
- package/package/frontend/template-partials/views/partials/navigation.html +0 -8
- package/package/frontend/template-partials/views/partials/page.html +0 -23
- package/package/frontend/template-partials/views/partials/panel-indent.html +0 -3
- package/package/frontend/template-partials/views/partials/session-cookies-table.html +0 -28
- package/package/frontend/template-partials/views/partials/session-timeout-warning.html +0 -38
- package/package/frontend/template-partials/views/partials/summary-table-row.html +0 -14
- package/package/frontend/template-partials/views/partials/summary-table.html +0 -8
- package/package/frontend/template-partials/views/partials/table.html +0 -18
- package/package/frontend/template-partials/views/partials/validation-list.html +0 -3
- package/package/frontend/template-partials/views/partials/validation-summary.html +0 -25
- package/package/frontend/template-partials/views/partials/warn.html +0 -7
- package/package/frontend/template-partials/views/rate-limit-error.html +0 -10
- package/package/frontend/template-partials/views/save-and-exit.html +0 -17
- package/package/frontend/template-partials/views/service-unavailable.html +0 -13
- package/package/frontend/template-partials/views/session-timeout.html +0 -7
- package/package/frontend/template-partials/views/step.html +0 -14
- package/package/frontend/template-partials/views/terms.html +0 -26
- package/package/frontend/themes/gov-uk/client-js/cookieSettings.js +0 -145
- package/package/frontend/themes/gov-uk/client-js/govuk-cookies.js +0 -121
- package/package/frontend/themes/gov-uk/client-js/index.js +0 -27
- package/package/frontend/themes/gov-uk/client-js/session-timeout-dialog.js +0 -348
- package/package/frontend/themes/gov-uk/client-js/skip-to-main.js +0 -19
- package/package/frontend/themes/gov-uk/index.js +0 -9
- package/package/frontend/themes/gov-uk/styles/_base.scss +0 -17
- package/package/frontend/themes/gov-uk/styles/_check_your_answers.scss +0 -155
- package/package/frontend/themes/gov-uk/styles/_cookie-banner.scss +0 -111
- package/package/frontend/themes/gov-uk/styles/_cookie-settings.scss +0 -33
- package/package/frontend/themes/gov-uk/styles/_govuk_frontend_toolkit.scss +0 -23
- package/package/frontend/themes/gov-uk/styles/_helpers.scss +0 -5
- package/package/frontend/themes/gov-uk/styles/_layout.scss +0 -125
- package/package/frontend/themes/gov-uk/styles/_panel-indent.scss +0 -27
- package/package/frontend/themes/gov-uk/styles/_pdf.scss +0 -42
- package/package/frontend/themes/gov-uk/styles/_session-timeout-dialog.scss +0 -121
- package/package/frontend/themes/gov-uk/styles/_typography.scss +0 -27
- package/package/frontend/themes/gov-uk/styles/_variables.scss +0 -11
- package/package/frontend/themes/gov-uk/styles/govuk.scss +0 -43
- package/package/frontend/themes/gov-uk/styles/mixins.scss +0 -16
- package/package/frontend/themes/gov-uk/styles/modules/_alerts.scss +0 -73
- package/package/frontend/themes/gov-uk/styles/modules/_buttons.scss +0 -5
- package/package/frontend/themes/gov-uk/styles/modules/_character-count.scss +0 -8
- package/package/frontend/themes/gov-uk/styles/modules/_confirm-page.scss +0 -20
- package/package/frontend/themes/gov-uk/styles/modules/_lists.scss +0 -5
- package/package/frontend/themes/gov-uk/styles/modules/_progressive-reveal.scss +0 -17
- package/package/frontend/themes/gov-uk/styles/modules/_validation.scss +0 -51
- package/package/frontend/themes/index.js +0 -5
- package/package/frontend/toolkit/assets/images/passports/new-window-link-blue.png +0 -0
- package/package/frontend/toolkit/assets/images/passports/new-window-link.png +0 -0
- package/package/frontend/toolkit/assets/images/spinner.gif +0 -0
- package/package/frontend/toolkit/assets/javascript/character-count.js +0 -99
- package/package/frontend/toolkit/assets/javascript/form-focus.js +0 -101
- package/package/frontend/toolkit/assets/javascript/helpers.js +0 -177
- package/package/frontend/toolkit/assets/javascript/progressive-reveal.js +0 -72
- package/package/frontend/toolkit/assets/javascript/validation.js +0 -71
- package/package/frontend/toolkit/assets/javascript/vendor/details.polyfill.js +0 -189
- package/package/frontend/toolkit/assets/javascript/vendor/indexof.polyfill.js +0 -39
- package/package/frontend/toolkit/assets/javascript/vendor/safari-cachebuster.js +0 -6
- package/package/frontend/toolkit/assets/stylesheets/_base.scss +0 -17
- package/package/frontend/toolkit/assets/stylesheets/_helpers.scss +0 -5
- package/package/frontend/toolkit/assets/stylesheets/_layout.scss +0 -118
- package/package/frontend/toolkit/assets/stylesheets/_typography.scss +0 -27
- package/package/frontend/toolkit/assets/stylesheets/_variables.scss +0 -11
- package/package/frontend/toolkit/assets/stylesheets/app.scss +0 -30
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_buttons.scss +0 -47
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_details.scss +0 -38
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_elements-typography.scss +0 -175
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_forms.scss +0 -167
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_helpers.scss +0 -39
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_layout.scss +0 -67
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_lists.scss +0 -40
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_panels.scss +0 -29
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_reset.scss +0 -33
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_tables.scss +0 -33
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-block-labels.scss +0 -63
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-date.scss +0 -39
- package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-validation.scss +0 -63
- package/package/frontend/toolkit/assets/stylesheets/mixins.scss +0 -16
- package/package/frontend/toolkit/assets/stylesheets/modules/_alerts.scss +0 -73
- package/package/frontend/toolkit/assets/stylesheets/modules/_buttons.scss +0 -5
- package/package/frontend/toolkit/assets/stylesheets/modules/_confirm-page.scss +0 -20
- package/package/frontend/toolkit/assets/stylesheets/modules/_lists.scss +0 -5
- package/package/frontend/toolkit/assets/stylesheets/modules/_progressive-reveal.scss +0 -17
- package/package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +0 -51
- package/package/frontend/toolkit/index.js +0 -10
- package/package/index.js +0 -351
- package/package/lib/deindex.js +0 -18
- package/package/lib/encryption.js +0 -23
- package/package/lib/ga-tag.js +0 -89
- package/package/lib/health.js +0 -26
- package/package/lib/helpers.js +0 -66
- package/package/lib/logger.js +0 -65
- package/package/lib/markdown.js +0 -46
- package/package/lib/router.js +0 -111
- package/package/lib/serve-static.js +0 -12
- package/package/lib/sessions.js +0 -82
- package/package/lib/settings.js +0 -74
- package/package/lib/which.js +0 -28
- package/package/middleware/cookies.js +0 -43
- package/package/middleware/deep-translate.js +0 -32
- package/package/middleware/errors.js +0 -119
- package/package/middleware/index.js +0 -10
- package/package/middleware/not-found.js +0 -38
- package/package/middleware/rate-limiter.js +0 -98
- package/package/middleware/service-unavailable.js +0 -64
- package/package/model/apis/axios-settings.js +0 -21
- package/package/model/apis/html-to-pdf-converter.js +0 -35
- package/package/model/apis/index.js +0 -5
- package/package/model/index.js +0 -348
- package/package/package.json +0 -147
- package/package/sandbox/README.md +0 -66
- package/package/sandbox/apps/sandbox/behaviours/clear-session.js +0 -8
- package/package/sandbox/apps/sandbox/behaviours/country-select.js +0 -10
- package/package/sandbox/apps/sandbox/behaviours/international-number.js +0 -22
- package/package/sandbox/apps/sandbox/fields.js +0 -128
- package/package/sandbox/apps/sandbox/index.js +0 -99
- package/package/sandbox/apps/sandbox/lib/staticAppealStages.js +0 -189
- package/package/sandbox/apps/sandbox/sections/summary-data-sections.js +0 -43
- package/package/sandbox/apps/sandbox/translations/src/en/errors.json +0 -5
- package/package/sandbox/apps/sandbox/translations/src/en/exit.json +0 -4
- package/package/sandbox/apps/sandbox/translations/src/en/fields.json +0 -101
- package/package/sandbox/apps/sandbox/translations/src/en/journey.json +0 -7
- package/package/sandbox/apps/sandbox/translations/src/en/pages.json +0 -72
- package/package/sandbox/apps/sandbox/translations/src/en/validation.json +0 -54
- package/package/sandbox/apps/sandbox/views/form-guidance-link.html +0 -8
- package/package/sandbox/apps/sandbox/views/save-and-exit.html +0 -19
- package/package/sandbox/assets/images/icons/icon-caret-left.png +0 -0
- package/package/sandbox/assets/images/icons/icon-complete.png +0 -0
- package/package/sandbox/assets/images/icons/icon-cross-remove-sign.png +0 -0
- package/package/sandbox/assets/js/index.js +0 -70
- package/package/sandbox/assets/scss/app.scss +0 -27
- package/package/sandbox/codecept.conf.js +0 -15
- package/package/sandbox/config.js +0 -17
- package/package/sandbox/package.json +0 -26
- package/package/sandbox/server.js +0 -23
- package/package/sandbox/yarn.lock +0 -262
- package/package/transpiler/index.js +0 -2
- package/package/transpiler/lib/aggregate.js +0 -32
- package/package/transpiler/lib/build.js +0 -15
- package/package/transpiler/lib/compile.js +0 -12
- package/package/transpiler/lib/expand-dirs.js +0 -14
- package/package/transpiler/lib/write-files.js +0 -24
- package/package/utilities/autofill/index.js +0 -189
- package/package/utilities/autofill/inputs.js +0 -60
- package/package/utilities/countries.js +0 -12
- package/package/utilities/helpers/index.js +0 -189
- package/package/utilities/index.js +0 -9
- package/package/utilities/reqres/index.js +0 -18
- package/package/utilities/test-data/data/domain.json +0 -7
- package/package/utilities/test-data/data/firstname.json +0 -16
- package/package/utilities/test-data/data/lastname.json +0 -10
- package/package/utilities/test-data/data/postcode.json +0 -12
- package/package/utilities/test-data/data/streetname.json +0 -8
- package/package/utilities/test-data/data/streetsuffix.json +0 -7
- package/package/utilities/test-data/data/town.json +0 -9
- package/package/utilities/test-data/index.js +0 -67
- package/package/wizard/behaviours/complete.js +0 -20
- package/package/wizard/behaviours/index.js +0 -5
- package/package/wizard/index.js +0 -124
- package/package/wizard/middleware/back-links.js +0 -68
- package/package/wizard/middleware/check-complete.js +0 -13
- package/package/wizard/middleware/check-progress.js +0 -139
- package/package/wizard/middleware/check-session.js +0 -17
- package/package/wizard/middleware/csrf.js +0 -47
- package/package/wizard/middleware/session-model.js +0 -11
- package/package/wizard/middleware/session.js +0 -9
- package/package/wizard/model.js +0 -29
- package/package/wizard/util/constants.js +0 -5
- package/package/wizard/util/helpers.js +0 -19
@@ -1,262 +0,0 @@
|
|
1
|
-
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
2
|
-
# yarn lockfile v1
|
3
|
-
|
4
|
-
|
5
|
-
abbrev@1:
|
6
|
-
version "1.1.1"
|
7
|
-
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
|
8
|
-
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
|
9
|
-
|
10
|
-
anymatch@~3.1.2:
|
11
|
-
version "3.1.2"
|
12
|
-
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
|
13
|
-
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
|
14
|
-
dependencies:
|
15
|
-
normalize-path "^3.0.0"
|
16
|
-
picomatch "^2.0.4"
|
17
|
-
|
18
|
-
balanced-match@^1.0.0:
|
19
|
-
version "1.0.2"
|
20
|
-
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
21
|
-
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
22
|
-
|
23
|
-
binary-extensions@^2.0.0:
|
24
|
-
version "2.2.0"
|
25
|
-
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
|
26
|
-
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
|
27
|
-
|
28
|
-
brace-expansion@^1.1.7:
|
29
|
-
version "1.1.11"
|
30
|
-
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
31
|
-
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
32
|
-
dependencies:
|
33
|
-
balanced-match "^1.0.0"
|
34
|
-
concat-map "0.0.1"
|
35
|
-
|
36
|
-
braces@~3.0.2:
|
37
|
-
version "3.0.3"
|
38
|
-
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
|
39
|
-
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
|
40
|
-
dependencies:
|
41
|
-
fill-range "^7.1.1"
|
42
|
-
|
43
|
-
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.2:
|
44
|
-
version "3.5.3"
|
45
|
-
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
|
46
|
-
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
|
47
|
-
dependencies:
|
48
|
-
anymatch "~3.1.2"
|
49
|
-
braces "~3.0.2"
|
50
|
-
glob-parent "~5.1.2"
|
51
|
-
is-binary-path "~2.1.0"
|
52
|
-
is-glob "~4.0.1"
|
53
|
-
normalize-path "~3.0.0"
|
54
|
-
readdirp "~3.6.0"
|
55
|
-
optionalDependencies:
|
56
|
-
fsevents "~2.3.2"
|
57
|
-
|
58
|
-
concat-map@0.0.1:
|
59
|
-
version "0.0.1"
|
60
|
-
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
61
|
-
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
62
|
-
|
63
|
-
debug@^3.2.7:
|
64
|
-
version "3.2.7"
|
65
|
-
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
|
66
|
-
integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
|
67
|
-
dependencies:
|
68
|
-
ms "^2.1.1"
|
69
|
-
|
70
|
-
fill-range@^7.1.1:
|
71
|
-
version "7.1.1"
|
72
|
-
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
|
73
|
-
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
|
74
|
-
dependencies:
|
75
|
-
to-regex-range "^5.0.1"
|
76
|
-
|
77
|
-
fsevents@~2.3.2:
|
78
|
-
version "2.3.2"
|
79
|
-
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
80
|
-
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
81
|
-
|
82
|
-
glob-parent@~5.1.2:
|
83
|
-
version "5.1.2"
|
84
|
-
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
85
|
-
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
|
86
|
-
dependencies:
|
87
|
-
is-glob "^4.0.1"
|
88
|
-
|
89
|
-
govuk-frontend@3.14:
|
90
|
-
version "3.14.0"
|
91
|
-
resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-3.14.0.tgz#d3a9c54437c08f5188f87b1f4480ba60e95c8eb6"
|
92
|
-
integrity sha512-y7FTuihCSA8Hty+e9h0uPhCoNanCAN+CLioNFlPmlbeHXpbi09VMyxTcH+XfnMPY4Cp++7096v0rLwwdapTXnA==
|
93
|
-
|
94
|
-
has-flag@^3.0.0:
|
95
|
-
version "3.0.0"
|
96
|
-
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
97
|
-
integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==
|
98
|
-
|
99
|
-
ignore-by-default@^1.0.1:
|
100
|
-
version "1.0.1"
|
101
|
-
resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
|
102
|
-
integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==
|
103
|
-
|
104
|
-
immutable@^4.0.0:
|
105
|
-
version "4.1.0"
|
106
|
-
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef"
|
107
|
-
integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==
|
108
|
-
|
109
|
-
is-binary-path@~2.1.0:
|
110
|
-
version "2.1.0"
|
111
|
-
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
|
112
|
-
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
|
113
|
-
dependencies:
|
114
|
-
binary-extensions "^2.0.0"
|
115
|
-
|
116
|
-
is-extglob@^2.1.1:
|
117
|
-
version "2.1.1"
|
118
|
-
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
119
|
-
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
|
120
|
-
|
121
|
-
is-glob@^4.0.1, is-glob@~4.0.1:
|
122
|
-
version "4.0.3"
|
123
|
-
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
|
124
|
-
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
|
125
|
-
dependencies:
|
126
|
-
is-extglob "^2.1.1"
|
127
|
-
|
128
|
-
is-number@^7.0.0:
|
129
|
-
version "7.0.0"
|
130
|
-
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
|
131
|
-
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
|
132
|
-
|
133
|
-
jquery@>=1.11:
|
134
|
-
version "3.6.0"
|
135
|
-
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470"
|
136
|
-
integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==
|
137
|
-
|
138
|
-
jquery@^3.7.1:
|
139
|
-
version "3.7.1"
|
140
|
-
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de"
|
141
|
-
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==
|
142
|
-
|
143
|
-
minimatch@^3.0.4:
|
144
|
-
version "3.1.2"
|
145
|
-
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
146
|
-
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
147
|
-
dependencies:
|
148
|
-
brace-expansion "^1.1.7"
|
149
|
-
|
150
|
-
ms@^2.1.1:
|
151
|
-
version "2.1.3"
|
152
|
-
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
153
|
-
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
154
|
-
|
155
|
-
nodemon@^2.0.15:
|
156
|
-
version "2.0.19"
|
157
|
-
resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.19.tgz#cac175f74b9cb8b57e770d47841995eebe4488bd"
|
158
|
-
integrity sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A==
|
159
|
-
dependencies:
|
160
|
-
chokidar "^3.5.2"
|
161
|
-
debug "^3.2.7"
|
162
|
-
ignore-by-default "^1.0.1"
|
163
|
-
minimatch "^3.0.4"
|
164
|
-
pstree.remy "^1.1.8"
|
165
|
-
semver "^5.7.1"
|
166
|
-
simple-update-notifier "^1.0.7"
|
167
|
-
supports-color "^5.5.0"
|
168
|
-
touch "^3.1.0"
|
169
|
-
undefsafe "^2.0.5"
|
170
|
-
|
171
|
-
nopt@~1.0.10:
|
172
|
-
version "1.0.10"
|
173
|
-
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
|
174
|
-
integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==
|
175
|
-
dependencies:
|
176
|
-
abbrev "1"
|
177
|
-
|
178
|
-
normalize-path@^3.0.0, normalize-path@~3.0.0:
|
179
|
-
version "3.0.0"
|
180
|
-
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
|
181
|
-
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
|
182
|
-
|
183
|
-
picomatch@^2.0.4, picomatch@^2.2.1:
|
184
|
-
version "2.3.1"
|
185
|
-
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
186
|
-
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
187
|
-
|
188
|
-
pstree.remy@^1.1.8:
|
189
|
-
version "1.1.8"
|
190
|
-
resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a"
|
191
|
-
integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==
|
192
|
-
|
193
|
-
readdirp@~3.6.0:
|
194
|
-
version "3.6.0"
|
195
|
-
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
|
196
|
-
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
|
197
|
-
dependencies:
|
198
|
-
picomatch "^2.2.1"
|
199
|
-
|
200
|
-
sass@^1.53.0:
|
201
|
-
version "1.54.5"
|
202
|
-
resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.5.tgz#93708f5560784f6ff2eab8542ade021a4a947b3a"
|
203
|
-
integrity sha512-p7DTOzxkUPa/63FU0R3KApkRHwcVZYC0PLnLm5iyZACyp15qSi32x7zVUhRdABAATmkALqgGrjCJAcWvobmhHw==
|
204
|
-
dependencies:
|
205
|
-
chokidar ">=3.0.0 <4.0.0"
|
206
|
-
immutable "^4.0.0"
|
207
|
-
source-map-js ">=0.6.2 <2.0.0"
|
208
|
-
|
209
|
-
semver@^5.7.1:
|
210
|
-
version "5.7.2"
|
211
|
-
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
|
212
|
-
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
|
213
|
-
|
214
|
-
semver@~7.0.0:
|
215
|
-
version "7.0.0"
|
216
|
-
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
|
217
|
-
integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==
|
218
|
-
|
219
|
-
simple-update-notifier@^1.0.7:
|
220
|
-
version "1.0.7"
|
221
|
-
resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz#7edf75c5bdd04f88828d632f762b2bc32996a9cc"
|
222
|
-
integrity sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==
|
223
|
-
dependencies:
|
224
|
-
semver "~7.0.0"
|
225
|
-
|
226
|
-
"source-map-js@>=0.6.2 <2.0.0":
|
227
|
-
version "1.0.2"
|
228
|
-
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
|
229
|
-
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
|
230
|
-
|
231
|
-
supports-color@^5.5.0:
|
232
|
-
version "5.5.0"
|
233
|
-
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
|
234
|
-
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
|
235
|
-
dependencies:
|
236
|
-
has-flag "^3.0.0"
|
237
|
-
|
238
|
-
to-regex-range@^5.0.1:
|
239
|
-
version "5.0.1"
|
240
|
-
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
|
241
|
-
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
|
242
|
-
dependencies:
|
243
|
-
is-number "^7.0.0"
|
244
|
-
|
245
|
-
touch@^3.1.0:
|
246
|
-
version "3.1.0"
|
247
|
-
resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"
|
248
|
-
integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==
|
249
|
-
dependencies:
|
250
|
-
nopt "~1.0.10"
|
251
|
-
|
252
|
-
typeahead-aria@^1.0.4:
|
253
|
-
version "1.0.4"
|
254
|
-
resolved "https://registry.yarnpkg.com/typeahead-aria/-/typeahead-aria-1.0.4.tgz#d2829cc01c0226a367627f3098a468c4e0343f00"
|
255
|
-
integrity sha512-6g0XtcM1AiPMlyXOuAb90Lg0WGi9PdbH68La7kUJmZwxUdpE80IC6tewBg0a/ug1Betoz1xCfEqTgkhuN6wo4w==
|
256
|
-
dependencies:
|
257
|
-
jquery ">=1.11"
|
258
|
-
|
259
|
-
undefsafe@^2.0.5:
|
260
|
-
version "2.0.5"
|
261
|
-
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c"
|
262
|
-
integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==
|
@@ -1,32 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const path = require('path');
|
4
|
-
const fs = require('fs');
|
5
|
-
const mapValues = require('lodash').mapValues;
|
6
|
-
|
7
|
-
/**
|
8
|
-
* Traverse over a directory and build an object containing all the translations within that directory
|
9
|
-
*/
|
10
|
-
|
11
|
-
module.exports = (dir, nsp) => {
|
12
|
-
const namespace = nsp || 'default';
|
13
|
-
|
14
|
-
const langs = fs.readdirSync(dir);
|
15
|
-
|
16
|
-
const resources = langs.reduce((map, lang) => {
|
17
|
-
const stat = fs.statSync(path.resolve(dir, lang));
|
18
|
-
if (stat.isDirectory()) {
|
19
|
-
map[lang] = { default: {} };
|
20
|
-
const files = fs.readdirSync(path.resolve(dir, lang));
|
21
|
-
files.forEach(file => {
|
22
|
-
if (path.extname(file) === '.json') {
|
23
|
-
const name = path.basename(file, '.json');
|
24
|
-
map[lang].default[name] = require(path.resolve(dir, lang, file));
|
25
|
-
}
|
26
|
-
});
|
27
|
-
}
|
28
|
-
return map;
|
29
|
-
}, {});
|
30
|
-
|
31
|
-
return mapValues(resources, lang => ({ [namespace]: lang.default }));
|
32
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const expand = require('./expand-dirs');
|
4
|
-
const aggregate = require('./aggregate');
|
5
|
-
const _ = require('lodash');
|
6
|
-
|
7
|
-
module.exports = options => {
|
8
|
-
const directories = expand(options.sources);
|
9
|
-
const shared = expand([].concat(options.shared || [])).map(dir => aggregate(dir));
|
10
|
-
|
11
|
-
return _.zipObject(directories, directories.map(dir => {
|
12
|
-
const inputs = [{}].concat(shared).concat([aggregate(dir)]);
|
13
|
-
return _.merge.apply(null, inputs);
|
14
|
-
}));
|
15
|
-
};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const glob = require('glob');
|
4
|
-
const flatten = require('lodash').flatten;
|
5
|
-
const path = require('path');
|
6
|
-
|
7
|
-
/**
|
8
|
-
* Takes an array of globs and returns an array of absolute paths of matching directories
|
9
|
-
*/
|
10
|
-
|
11
|
-
module.exports = gls => {
|
12
|
-
const globs = gls || [];
|
13
|
-
return flatten(globs.map(dir => glob.sync(dir))).map(dir => path.resolve(process.cwd(), dir));
|
14
|
-
};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const fs = require('fs');
|
4
|
-
const path = require('path');
|
5
|
-
const rm = require('rimraf').sync;
|
6
|
-
|
7
|
-
const debug = require('debug')('hof:transpiler');
|
8
|
-
|
9
|
-
module.exports = (dir, data) => {
|
10
|
-
const langs = Object.keys(data);
|
11
|
-
|
12
|
-
debug(`Compiled content from ${dir} in ${langs.join(', ')}`);
|
13
|
-
|
14
|
-
langs.forEach(lang => {
|
15
|
-
const outputDir = path.resolve(dir, '..', lang);
|
16
|
-
rm(outputDir);
|
17
|
-
debug(`Emptied directory ${outputDir}`);
|
18
|
-
fs.mkdirSync(outputDir);
|
19
|
-
debug(`Made directory ${outputDir}`);
|
20
|
-
Object.keys(data[lang]).forEach(namespace => {
|
21
|
-
fs.writeFileSync(path.resolve(outputDir, `${namespace}.json`), JSON.stringify(data[lang][namespace], null, ' '));
|
22
|
-
});
|
23
|
-
});
|
24
|
-
};
|
@@ -1,189 +0,0 @@
|
|
1
|
-
/* eslint-disable consistent-return, node/no-deprecated-api */
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
const url = require('url');
|
5
|
-
const Inputs = require('./inputs');
|
6
|
-
const Promise = require('bluebird');
|
7
|
-
|
8
|
-
const debug = require('debug')('hof:util:autofill');
|
9
|
-
|
10
|
-
const MAX_LOOPS = 3;
|
11
|
-
|
12
|
-
module.exports = browser => (target, input, opts) => {
|
13
|
-
const options = opts || {};
|
14
|
-
options.maxLoops = options.maxLoops || MAX_LOOPS;
|
15
|
-
|
16
|
-
const getValue = Inputs(input);
|
17
|
-
|
18
|
-
let last;
|
19
|
-
let count = 0;
|
20
|
-
|
21
|
-
function completeTextField(element, name) {
|
22
|
-
const value = getValue(name, 'text');
|
23
|
-
debug(`Filling field: ${name} with value: ${value}`);
|
24
|
-
return browser
|
25
|
-
.elementIdClear(element)
|
26
|
-
.elementIdValue(element, value)
|
27
|
-
.catch(() => {
|
28
|
-
// any error here is *probably* because the field is hidden
|
29
|
-
// ignore and hope for the best
|
30
|
-
});
|
31
|
-
}
|
32
|
-
|
33
|
-
function completeFileField(element, name) {
|
34
|
-
const value = getValue(name, 'file');
|
35
|
-
if (value) {
|
36
|
-
debug(`Uploading file: ${value}`);
|
37
|
-
return browser.uploadFile(value)
|
38
|
-
.then(response => {
|
39
|
-
debug(`Uploaded file: ${value} - remote path ${response.value}`);
|
40
|
-
return browser
|
41
|
-
.addValue(`input[name="${name}"]`, response.value);
|
42
|
-
});
|
43
|
-
}
|
44
|
-
debug(`No file specified for input ${name} - ignoring`);
|
45
|
-
}
|
46
|
-
|
47
|
-
function completeRadio(element, name) {
|
48
|
-
const value = getValue(name, 'radio');
|
49
|
-
if (!value) {
|
50
|
-
return browser.elements(`input[type="radio"][name="${name}"]`)
|
51
|
-
.then(radios => {
|
52
|
-
debug(`Checking random radio: ${name}`);
|
53
|
-
const index = 1 + Math.floor(Math.random() * (radios.value.length - 1));
|
54
|
-
return browser.elementIdClick(radios.value[index].ELEMENT);
|
55
|
-
});
|
56
|
-
}
|
57
|
-
return browser.elementIdAttribute(element, 'value')
|
58
|
-
.then(val => {
|
59
|
-
if (val.value === value) {
|
60
|
-
debug(`Checking radio: ${name} with value: ${val.value}`);
|
61
|
-
browser.elementIdClick(element);
|
62
|
-
}
|
63
|
-
});
|
64
|
-
}
|
65
|
-
|
66
|
-
function completeCheckbox(element, name) {
|
67
|
-
const value = getValue(name, 'checkbox');
|
68
|
-
return browser.elementIdAttribute(element, 'value')
|
69
|
-
.then(val => browser.elementIdAttribute(element, 'checked')
|
70
|
-
.then(checked => {
|
71
|
-
if (value === null) {
|
72
|
-
if (!checked.value) {
|
73
|
-
debug(`Leaving checkbox: ${name} blank`);
|
74
|
-
return;
|
75
|
-
}
|
76
|
-
debug(`Unchecking checkbox: ${name}`);
|
77
|
-
return browser.elementIdClick(element);
|
78
|
-
}
|
79
|
-
if (!value && !checked.value) {
|
80
|
-
debug(`Checking checkbox: ${name} with value: ${val.value}`);
|
81
|
-
return browser.elementIdClick(element);
|
82
|
-
} else if (value && value.indexOf(val.value) > -1 && !checked.value) {
|
83
|
-
debug(`Checking checkbox: ${name} with value: ${val.value}`);
|
84
|
-
return browser.elementIdClick(element);
|
85
|
-
} else if (value && value.indexOf(val.value) === -1 && checked.value) {
|
86
|
-
debug(`Unchecking checkbox: ${name} with value: ${val.value}`);
|
87
|
-
return browser.elementIdClick(element);
|
88
|
-
}
|
89
|
-
debug(`Ignoring checkbox: ${name} with value: ${val.value} - looking for ${value}`);
|
90
|
-
}));
|
91
|
-
}
|
92
|
-
|
93
|
-
function completeSelectElement(element, name) {
|
94
|
-
const value = getValue(name, 'select');
|
95
|
-
if (!value) {
|
96
|
-
return browser.elementIdElements(element, 'option')
|
97
|
-
.then(o => {
|
98
|
-
const index = 1 + Math.floor(Math.random() * (o.value.length - 1));
|
99
|
-
debug(`Selecting option: ${index} from select box: ${name}`);
|
100
|
-
return browser.selectByIndex(`select[name="${name}"]`, index);
|
101
|
-
});
|
102
|
-
}
|
103
|
-
debug(`Selecting options: ${value} from select box: ${name}`);
|
104
|
-
return browser.selectByValue(`select[name="${name}"]`, value);
|
105
|
-
}
|
106
|
-
|
107
|
-
function completeStep(path) {
|
108
|
-
return browser
|
109
|
-
.elements('input')
|
110
|
-
.then(fields => {
|
111
|
-
debug(`Found ${fields.value.length} <input> elements`);
|
112
|
-
return Promise.map(fields.value, field => browser.elementIdAttribute(field.ELEMENT, 'type')
|
113
|
-
.then(type => browser.elementIdAttribute(field.ELEMENT, 'name')
|
114
|
-
.then(name => {
|
115
|
-
if (type.value === 'radio') {
|
116
|
-
return completeRadio(field.ELEMENT, name.value);
|
117
|
-
} else if (type.value === 'checkbox') {
|
118
|
-
return completeCheckbox(field.ELEMENT, name.value);
|
119
|
-
} else if (type.value === 'file') {
|
120
|
-
return completeFileField(field.ELEMENT, name.value);
|
121
|
-
} else if (type.value === 'text') {
|
122
|
-
return completeTextField(field.ELEMENT, name.value);
|
123
|
-
}
|
124
|
-
debug(`Ignoring field of type ${type.value}`);
|
125
|
-
})), {concurrency: 1});
|
126
|
-
})
|
127
|
-
.elements('select')
|
128
|
-
.then(fields => {
|
129
|
-
debug(`Found ${fields.value.length} <select> elements`);
|
130
|
-
return Promise.map(fields.value, field => browser.elementIdAttribute(field.ELEMENT, 'name')
|
131
|
-
.then(name => completeSelectElement(field.ELEMENT, name.value)));
|
132
|
-
})
|
133
|
-
.elements('textarea')
|
134
|
-
.then(fields => {
|
135
|
-
debug(`Found ${fields.value.length} <textarea> elements`);
|
136
|
-
return Promise.map(fields.value, field => browser.elementIdAttribute(field.ELEMENT, 'name')
|
137
|
-
.then(name => completeTextField(field.ELEMENT, name.value)));
|
138
|
-
})
|
139
|
-
.then(() => {
|
140
|
-
if (options.screenshots) {
|
141
|
-
const screenshot = require('path').resolve(options.screenshots, 'hof-autofill.pre-submit.png');
|
142
|
-
return browser.saveScreenshot(screenshot);
|
143
|
-
}
|
144
|
-
})
|
145
|
-
.then(() => {
|
146
|
-
debug('Submitting form');
|
147
|
-
return browser.$('input[type="submit"]').click();
|
148
|
-
})
|
149
|
-
.then(() => browser.getUrl()
|
150
|
-
.then(p => {
|
151
|
-
const u = url.parse(p);
|
152
|
-
debug(`New page is: ${u.path}`);
|
153
|
-
if (u.path !== path) {
|
154
|
-
debug(`Checking current path ${u.path} against last path ${last}`);
|
155
|
-
if (last === u.path) {
|
156
|
-
count++;
|
157
|
-
debug(`Stuck on path ${u.path} for ${count} iterations`);
|
158
|
-
if (count === options.maxLoops) {
|
159
|
-
if (options.screenshots) {
|
160
|
-
const screenshot = require('path').resolve(options.screenshots, 'hof-autofill.debug.png');
|
161
|
-
return browser.saveScreenshot(screenshot)
|
162
|
-
.then(() => {
|
163
|
-
throw new Error(`Progress stuck at ${u.path} - screenshot saved to ${screenshot}`);
|
164
|
-
});
|
165
|
-
}
|
166
|
-
throw new Error(`Progress stuck at ${u.path}`);
|
167
|
-
}
|
168
|
-
} else {
|
169
|
-
count = 0;
|
170
|
-
}
|
171
|
-
last = u.path;
|
172
|
-
return completeStep(path);
|
173
|
-
}
|
174
|
-
debug(`Arrived at ${path}. Done.`);
|
175
|
-
}))
|
176
|
-
.catch(e => browser.getText('#content')
|
177
|
-
.then(text => {
|
178
|
-
debug('PAGE CONTENT >>>>>>');
|
179
|
-
debug(text);
|
180
|
-
debug('END PAGE CONTENT >>>>>>');
|
181
|
-
})
|
182
|
-
.catch(() => null)
|
183
|
-
.then(() => {
|
184
|
-
throw e;
|
185
|
-
}));
|
186
|
-
}
|
187
|
-
|
188
|
-
return completeStep(target);
|
189
|
-
};
|
@@ -1,60 +0,0 @@
|
|
1
|
-
/* eslint-disable consistent-return */
|
2
|
-
'use strict';
|
3
|
-
/* eslint complexity: 0 */
|
4
|
-
|
5
|
-
const Data = require('../test-data');
|
6
|
-
|
7
|
-
module.exports = i => {
|
8
|
-
const input = i || {};
|
9
|
-
input.default = input.default || 'abc';
|
10
|
-
|
11
|
-
const getDefault = (name, t) => {
|
12
|
-
const type = t || 'text';
|
13
|
-
if (name.indexOf('name') > -1) {
|
14
|
-
if (name.indexOf('last') > -1 || name.indexOf('surname') > -1) {
|
15
|
-
return Data.lastname;
|
16
|
-
}
|
17
|
-
if (name.indexOf('first') > -1) {
|
18
|
-
return Data.firstname;
|
19
|
-
}
|
20
|
-
return Data.name;
|
21
|
-
}
|
22
|
-
if (name.indexOf('country') > -1 || name.indexOf('nationality') > -1) {
|
23
|
-
return Data.country;
|
24
|
-
}
|
25
|
-
if (name.indexOf('postcode') > -1) {
|
26
|
-
return Data.postcode;
|
27
|
-
}
|
28
|
-
if (name.indexOf('day') > -1) {
|
29
|
-
return Data.number(1, 28).toString();
|
30
|
-
}
|
31
|
-
if (name.indexOf('month') > -1) {
|
32
|
-
return Data.number(1, 12).toString();
|
33
|
-
}
|
34
|
-
if (name.indexOf('year') > -1) {
|
35
|
-
return Data.number(1950, 1990).toString();
|
36
|
-
}
|
37
|
-
|
38
|
-
if (name.indexOf('email') > -1) {
|
39
|
-
return Data.email;
|
40
|
-
}
|
41
|
-
if (name.indexOf('phone') > -1) {
|
42
|
-
return Data.phone;
|
43
|
-
}
|
44
|
-
// don't provide a default value for field types with defined options
|
45
|
-
if (['select', 'radio', 'checkbox', 'file'].indexOf(type) === -1) {
|
46
|
-
return input.default;
|
47
|
-
}
|
48
|
-
};
|
49
|
-
|
50
|
-
return (name, type) => {
|
51
|
-
const value = input[name] !== undefined ? input[name] : getDefault(name, type);
|
52
|
-
if (typeof value === 'function') {
|
53
|
-
return value();
|
54
|
-
}
|
55
|
-
if (value && type === 'checkbox') {
|
56
|
-
return [].concat(value);
|
57
|
-
}
|
58
|
-
return value;
|
59
|
-
};
|
60
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const countries = require('homeoffice-countries');
|
4
|
-
|
5
|
-
const transform = (list, options) => {
|
6
|
-
const opts = options || {};
|
7
|
-
const parse = opts.parse || (country => country);
|
8
|
-
const filter = opts.filter || (() => true);
|
9
|
-
return list.filter(filter).map(country => ({ value: country, label: parse(country) }));
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports = options => transform(countries.allCountries, options);
|