govuk_tech_docs 6.6.0.rc.local.tested → 6.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -4
- data/Rakefile +3 -3
- data/govuk_tech_docs.gemspec +82 -24
- data/lib/assets/javascripts/_modules/collapsible-navigation.js +3 -0
- data/lib/assets/javascripts/_modules/in-page-navigation.js +36 -5
- data/lib/assets/stylesheets/modules/_app-pane.scss +18 -31
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/tasks/lint.rake +24 -30
- data/node_modules/.bin/nunjucks-precompile +1 -0
- data/node_modules/.package-lock.json +62 -0
- data/{documentation → node_modules/a-sync-waterfall}/LICENSE +8 -8
- data/node_modules/a-sync-waterfall/README.md +95 -0
- data/node_modules/a-sync-waterfall/index.js +83 -0
- data/node_modules/a-sync-waterfall/package.json +21 -0
- data/node_modules/a-sync-waterfall/test.js +77 -0
- data/node_modules/asap/CHANGES.md +70 -0
- data/node_modules/asap/LICENSE.md +21 -0
- data/node_modules/asap/README.md +237 -0
- data/node_modules/asap/asap.js +65 -0
- data/node_modules/asap/browser-asap.js +66 -0
- data/node_modules/asap/browser-raw.js +223 -0
- data/node_modules/asap/package.json +58 -0
- data/node_modules/asap/raw.js +101 -0
- data/node_modules/commander/CHANGELOG.md +385 -0
- data/node_modules/commander/LICENSE +22 -0
- data/node_modules/commander/Readme.md +737 -0
- data/node_modules/commander/index.js +1756 -0
- data/node_modules/commander/package.json +48 -0
- data/node_modules/commander/typings/index.d.ts +386 -0
- data/node_modules/govuk-frontend/README.md +92 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/create-element.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +377 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/macro-options.json +142 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-default.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-additional-descriptions.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-all-sections-already-open.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-long-content-and-description.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template.njk +67 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +86 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-default.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-inverse.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +258 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro-options.json +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-inverse.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-collapse-on-mobile.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-last-breadcrumb-as-current-page.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-one-level.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-without-the-home-section.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template.njk +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +496 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +74 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-link.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-start.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +630 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +206 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-default.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-length.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-rows.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-default-value-exceeding-limit.html +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-default-value.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-hint-and-error.html +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-hint.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-label-as-page-heading.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-maxwords.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +128 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +1344 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +229 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +25 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +44 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +40 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +122 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +543 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-accepted-confirmation-banner.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-rejected-confirmation-banner.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template.njk +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +1314 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +213 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-day-and-month-using-items.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-day-and-month.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-default.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-month-and-year-using-items.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-month-and-year.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-classes.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items-and-classes.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-items.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-translations.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-and-name-prefix.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-name-prefix-and-custom-names.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template.njk +161 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +133 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/implementation.md +87 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/macro-options.json +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template-expanded.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template-with-html.html +18 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template.njk +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +113 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/template-translated.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/template.njk +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +326 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/macro-options.json +82 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-default.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-mixed-with-and-without-links.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-with-description-only.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-with-everything.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-without-links.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template.njk +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/macro-options.json +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template.njk +25 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/fixtures.json +95 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/macro-options.json +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template-silly-example.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template.njk +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +260 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/macro-options.json +70 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-l.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-m.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-s.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-without-class.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-xl.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-large-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-medium-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-small-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-xl-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template.njk +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +416 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +179 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-custom-wrapper-classes-and-attributes.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-error-message-and-hint.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-hint-text.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-label-as-page-heading.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +90 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +773 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +164 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +233 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +167 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +105 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +117 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +41 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +80 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +104 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/fixtures.json +90 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-default.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-full-width.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-image-logo.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-text-and-image-logo.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template.njk +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +73 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +23 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/template-with-html.html +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +832 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +245 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-and-hint.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-message.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-extra-letter-spacing.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-hint-text.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-label-as-page-heading.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-suffix-and-error.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-suffix-and-width-modifier.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-suffix.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-suffix.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-10-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-2-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-20-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-3-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-30-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-4-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-5-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +133 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +76 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template-with-html.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +210 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-l.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-m.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-s.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-without-class.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-xl.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-large-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-medium-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-small-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-xl-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-with-bold-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template.njk +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/fixtures.json +482 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/macro-options.json +88 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-inverse.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-language-description.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-large-amount-of-multiple-languages.html +99 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-mixed-text-directions.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-multiple-languages.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-translated-navigation-label.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template.njk +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +260 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/macro-options.json +74 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-long-heading.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-lots-of-content.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-text-as-html.html +21 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-type-as-success.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template.njk +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +415 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/macro-options.json +140 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +65 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +87 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +353 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro-options.json +108 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-default.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-content-with-long-line-length.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-headings-content-and-lists.html +23 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template.njk +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +215 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +181 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-error-message.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-hint-text.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-input-width-class.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-label-as-page-heading.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +93 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/macro-options.json +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +1339 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +211 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +21 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +31 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +40 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-without-fieldset.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +115 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +550 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +163 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-full-width-override.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-hint-text-and-error-message.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-label-as-page-heading.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +68 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +777 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +164 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse-with-language-navigation.html +72 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-collapsenavigationonmobile-set-to-false.html +60 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-inline-end-slot.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-language-navigation.html +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +153 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-long-service-name.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-right-aligned-language-navigation.html +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-link.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name.html +18 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +111 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +113 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template-default.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template-with-focus.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +1528 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/macro-options.json +248 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html +106 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-html-header.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-text-header.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-actions-plus-summary-list-actions.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-actions.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-default.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-extreme.html +261 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-no-border-on-last-row.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-no-border.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-actions.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template.njk +94 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +651 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/macro-options.json +132 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-default.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-head-and-caption.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-head.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template.njk +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +333 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/macro-options.json +84 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/template-default.html +117 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/template-tabs-with-anchor-in-panel.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/template.njk +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +149 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/macro-options.json +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-green.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-grey.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-orange.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-pink.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-purple.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-red.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-turquoise.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-yellow.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +563 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/macro-options.json +119 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-default.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-forced-hover-state.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-all-possible-colours.html +131 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-hint-text-and-additional-states.html +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-very-long-single-word-tags.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template.njk +41 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +316 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +143 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-custom-rows.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-default-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-error-message.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-hint.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-label-as-page-heading.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +101 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template-default.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template-multiple-lines.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template.njk +10 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +3 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +110 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/i18n.njk +21 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +56 -0
- data/node_modules/govuk-frontend/dist/govuk/template.njk +107 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +188 -0
- data/node_modules/govuk-frontend/package.json +99 -0
- data/node_modules/nunjucks/LICENSE +26 -0
- data/node_modules/nunjucks/README.md +58 -0
- data/node_modules/nunjucks/bin/precompile +58 -0
- data/node_modules/nunjucks/bin/precompile.cmd +5 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.js +3709 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.js.map +1 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.min.js +3 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.min.js.map +1 -0
- data/node_modules/nunjucks/browser/nunjucks.js +7021 -0
- data/node_modules/nunjucks/browser/nunjucks.js.map +1 -0
- data/node_modules/nunjucks/browser/nunjucks.min.js +3 -0
- data/node_modules/nunjucks/browser/nunjucks.min.js.map +1 -0
- data/node_modules/nunjucks/index.js +82 -0
- data/node_modules/nunjucks/package.json +112 -0
- data/node_modules/nunjucks/src/compiler.js +1027 -0
- data/node_modules/nunjucks/src/environment.js +548 -0
- data/node_modules/nunjucks/src/express-app.js +23 -0
- data/node_modules/nunjucks/src/filters.js +546 -0
- data/node_modules/nunjucks/src/globals.js +65 -0
- data/node_modules/nunjucks/src/jinja-compat.js +293 -0
- data/node_modules/nunjucks/src/lexer.js +474 -0
- data/node_modules/nunjucks/src/lib.js +325 -0
- data/node_modules/nunjucks/src/loader.js +21 -0
- data/node_modules/nunjucks/src/loaders.js +5 -0
- data/node_modules/nunjucks/src/node-loaders.js +139 -0
- data/node_modules/nunjucks/src/nodes.js +350 -0
- data/node_modules/nunjucks/src/object.js +100 -0
- data/node_modules/nunjucks/src/parser.js +1028 -0
- data/node_modules/nunjucks/src/precompile-global.js +17 -0
- data/node_modules/nunjucks/src/precompile.js +108 -0
- data/node_modules/nunjucks/src/precompiled-loader.js +31 -0
- data/node_modules/nunjucks/src/runtime.js +333 -0
- data/node_modules/nunjucks/src/tests.js +265 -0
- data/node_modules/nunjucks/src/transformer.js +166 -0
- data/node_modules/nunjucks/src/web-loaders.js +94 -0
- metadata +609 -67
- data/.github/ISSUE_TEMPLATE/bug.yaml +0 -69
- data/.github/ISSUE_TEMPLATE/config.yaml +0 -6
- data/.github/ISSUE_TEMPLATE/documentation.yaml +0 -29
- data/.github/ISSUE_TEMPLATE/enhancement.yaml +0 -25
- data/.github/dependabot.yml +0 -67
- data/.github/pull_request_template.md +0 -28
- data/.github/workflows/build-middleman-artifact.yaml +0 -41
- data/.github/workflows/check-documentation-updates.yaml +0 -33
- data/.github/workflows/check-gem-version.yaml +0 -36
- data/.github/workflows/npm-vulnerability-scanner.yaml +0 -55
- data/.github/workflows/pipeline.yaml +0 -58
- data/.github/workflows/publish-gem.yaml +0 -52
- data/.github/workflows/publish-github-pages.yaml +0 -38
- data/.github/workflows/ruby-vulnerability-scanner.yaml +0 -44
- data/.github/workflows/test.yaml +0 -48
- data/documentation/.nvmrc +0 -1
- data/documentation/Gemfile +0 -11
- data/documentation/README.md +0 -30
- data/documentation/Staticfile +0 -4
- data/documentation/config/tech-docs.yml +0 -56
- data/documentation/config.rb +0 -21
- data/documentation/source/accessibility/index.html.md.erb +0 -64
- data/documentation/source/configure_project/frontmatter/index.html.md.erb +0 -206
- data/documentation/source/configure_project/global_configuration/index.html.md.erb +0 -386
- data/documentation/source/configure_project/index.html.md.erb +0 -17
- data/documentation/source/configure_project/page_expiry_and_review/index.html.md.erb +0 -93
- data/documentation/source/configure_project/structure_docs/index.html.md.erb +0 -117
- data/documentation/source/create_project/build/index.html.md.erb +0 -20
- data/documentation/source/create_project/create_new_project/index.html.md.erb +0 -23
- data/documentation/source/create_project/get_started/index.html.md.erb +0 -58
- data/documentation/source/create_project/index.html.md.erb +0 -17
- data/documentation/source/create_project/preview/index.html.md.erb +0 -26
- data/documentation/source/images/Basic multipage.svg +0 -1
- data/documentation/source/images/Basic_multipage.svg +0 -1
- data/documentation/source/images/Nested multipage.svg +0 -1
- data/documentation/source/images/Nested_multipage.svg +0 -1
- data/documentation/source/images/Single_page.svg +0 -1
- data/documentation/source/images/core-layout-without-sidebar.png +0 -0
- data/documentation/source/images/core-layout.png +0 -0
- data/documentation/source/images/daniel-the-manual-spaniel-screenshot.svg +0 -1
- data/documentation/source/images/expired-page.png +0 -0
- data/documentation/source/images/last-reviewed-only.png +0 -0
- data/documentation/source/images/last-reviewed-only.svg +0 -1
- data/documentation/source/images/layout-layout.png +0 -0
- data/documentation/source/images/multipage.svg +0 -3
- data/documentation/source/images/not-expired-page.png +0 -0
- data/documentation/source/index.html.md.erb +0 -19
- data/documentation/source/javascripts/application.js +0 -1
- data/documentation/source/maintain_project/index.html.md.erb +0 -18
- data/documentation/source/maintain_project/redirects/index.html.md.erb +0 -22
- data/documentation/source/maintain_project/review_content/index.html.md.erb +0 -45
- data/documentation/source/maintain_project/use_latest_template/index.html.md.erb +0 -34
- data/documentation/source/partials/_links.erb +0 -81
- data/documentation/source/publish_project/deploy/index.html.md.erb +0 -44
- data/documentation/source/publish_project/index.html.md.erb +0 -15
- data/documentation/source/publish_project/version/index.html.md.erb +0 -12
- data/documentation/source/stylesheets/print.css.scss +0 -3
- data/documentation/source/stylesheets/screen-old-ie.css.scss +0 -4
- data/documentation/source/stylesheets/screen.css.scss +0 -1
- data/documentation/source/support/index.html.md.erb +0 -46
- data/documentation/source/write_docs/add_openapi_spec/index.html.md.erb +0 -48
- data/documentation/source/write_docs/content/index.html.md.erb +0 -144
- data/documentation/source/write_docs/index.html.md.erb +0 -15
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# a-sync-waterfall
|
|
2
|
+
|
|
3
|
+
Simple, isolated sync/async waterfall module for JavaScript.
|
|
4
|
+
|
|
5
|
+
Runs an array of functions in series, each passing their results to the next in
|
|
6
|
+
the array. However, if any of the functions pass an error to the callback, the
|
|
7
|
+
next function is not executed and the main callback is immediately called with
|
|
8
|
+
the error.
|
|
9
|
+
|
|
10
|
+
For browsers and node.js.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
* Just include a-sync-waterfall before your scripts.
|
|
14
|
+
* `npm install a-sync-waterfall` if you’re using node.js.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
* `waterfall(tasks, optionalCallback, forceAsync);`
|
|
20
|
+
* **tasks** - An array of functions to run, each function is passed a
|
|
21
|
+
`callback(err, result1, result2, ...)` it must call on completion. The first
|
|
22
|
+
argument is an error (which can be null) and any further arguments will be
|
|
23
|
+
passed as arguments in order to the next task.
|
|
24
|
+
* **optionalCallback** - An optional callback to run once all the functions have
|
|
25
|
+
completed. This will be passed the results of the last task's callback.
|
|
26
|
+
* **forceAsync** An optional flag that force tasks run asynchronously even if they are sync.
|
|
27
|
+
|
|
28
|
+
##### Node.js:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
var waterfall = require('a-sync-waterfall');
|
|
32
|
+
waterfall(tasks, callback);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
##### Browser:
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
var waterfall = require('a-sync-waterfall');
|
|
39
|
+
waterfall(tasks, callback);
|
|
40
|
+
|
|
41
|
+
// Default:
|
|
42
|
+
window.waterfall(tasks, callback);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
##### Tasks as Array of Functions
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
waterfall([
|
|
49
|
+
function(callback){
|
|
50
|
+
callback(null, 'one', 'two');
|
|
51
|
+
},
|
|
52
|
+
function(arg1, arg2, callback){
|
|
53
|
+
callback(null, 'three');
|
|
54
|
+
},
|
|
55
|
+
function(arg1, callback){
|
|
56
|
+
// arg1 now equals 'three'
|
|
57
|
+
callback(null, 'done');
|
|
58
|
+
}
|
|
59
|
+
], function (err, result) {
|
|
60
|
+
// result now equals 'done'
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
##### Derive Tasks from an Array.map
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
/* basic - no arguments */
|
|
68
|
+
waterfall(myArray.map(function (arrayItem) {
|
|
69
|
+
return function (nextCallback) {
|
|
70
|
+
// same execution for each item, call the next one when done
|
|
71
|
+
doAsyncThingsWith(arrayItem, nextCallback);
|
|
72
|
+
}}));
|
|
73
|
+
|
|
74
|
+
/* with arguments, initializer function, and final callback */
|
|
75
|
+
waterfall([function initializer (firstMapFunction) {
|
|
76
|
+
firstMapFunction(null, initialValue);
|
|
77
|
+
}].concat(myArray.map(function (arrayItem) {
|
|
78
|
+
return function (lastItemResult, nextCallback) {
|
|
79
|
+
// same execution for each item in the array
|
|
80
|
+
var itemResult = doThingsWith(arrayItem, lastItemResult);
|
|
81
|
+
// results carried along from each to the next
|
|
82
|
+
nextCallback(null, itemResult);
|
|
83
|
+
}})), function (err, finalResult) {
|
|
84
|
+
// final callback
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Acknowledgements
|
|
89
|
+
Hat tip to [Caolan McMahon](https://github.com/caolan) and
|
|
90
|
+
[Paul Miller](https://github.com/paulmillr), whose prior contributions this is
|
|
91
|
+
based upon.
|
|
92
|
+
Also [Elan Shanker](https://github.com/es128) from which this rep is forked
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
[MIT](https://raw.github.com/hydiak/a-sync-waterfall/master/LICENSE)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// MIT license (by Elan Shanker).
|
|
2
|
+
(function(globals) {
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var executeSync = function(){
|
|
6
|
+
var args = Array.prototype.slice.call(arguments);
|
|
7
|
+
if (typeof args[0] === 'function'){
|
|
8
|
+
args[0].apply(null, args.splice(1));
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var executeAsync = function(fn){
|
|
13
|
+
if (typeof setImmediate === 'function') {
|
|
14
|
+
setImmediate(fn);
|
|
15
|
+
} else if (typeof process !== 'undefined' && process.nextTick) {
|
|
16
|
+
process.nextTick(fn);
|
|
17
|
+
} else {
|
|
18
|
+
setTimeout(fn, 0);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var makeIterator = function (tasks) {
|
|
23
|
+
var makeCallback = function (index) {
|
|
24
|
+
var fn = function () {
|
|
25
|
+
if (tasks.length) {
|
|
26
|
+
tasks[index].apply(null, arguments);
|
|
27
|
+
}
|
|
28
|
+
return fn.next();
|
|
29
|
+
};
|
|
30
|
+
fn.next = function () {
|
|
31
|
+
return (index < tasks.length - 1) ? makeCallback(index + 1): null;
|
|
32
|
+
};
|
|
33
|
+
return fn;
|
|
34
|
+
};
|
|
35
|
+
return makeCallback(0);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var _isArray = Array.isArray || function(maybeArray){
|
|
39
|
+
return Object.prototype.toString.call(maybeArray) === '[object Array]';
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var waterfall = function (tasks, callback, forceAsync) {
|
|
43
|
+
var nextTick = forceAsync ? executeAsync : executeSync;
|
|
44
|
+
callback = callback || function () {};
|
|
45
|
+
if (!_isArray(tasks)) {
|
|
46
|
+
var err = new Error('First argument to waterfall must be an array of functions');
|
|
47
|
+
return callback(err);
|
|
48
|
+
}
|
|
49
|
+
if (!tasks.length) {
|
|
50
|
+
return callback();
|
|
51
|
+
}
|
|
52
|
+
var wrapIterator = function (iterator) {
|
|
53
|
+
return function (err) {
|
|
54
|
+
if (err) {
|
|
55
|
+
callback.apply(null, arguments);
|
|
56
|
+
callback = function () {};
|
|
57
|
+
} else {
|
|
58
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
59
|
+
var next = iterator.next();
|
|
60
|
+
if (next) {
|
|
61
|
+
args.push(wrapIterator(next));
|
|
62
|
+
} else {
|
|
63
|
+
args.push(callback);
|
|
64
|
+
}
|
|
65
|
+
nextTick(function () {
|
|
66
|
+
iterator.apply(null, args);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
wrapIterator(makeIterator(tasks))();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (typeof define !== 'undefined' && define.amd) {
|
|
75
|
+
define([], function () {
|
|
76
|
+
return waterfall;
|
|
77
|
+
}); // RequireJS
|
|
78
|
+
} else if (typeof module !== 'undefined' && module.exports) {
|
|
79
|
+
module.exports = waterfall; // CommonJS
|
|
80
|
+
} else {
|
|
81
|
+
globals.waterfall = waterfall; // <script>
|
|
82
|
+
}
|
|
83
|
+
})(this);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "a-sync-waterfall",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Runs a list of async tasks, passing the results of each into the next one",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Gleb Khudyakov",
|
|
7
|
+
"url": "https://github.com/hydiak/a-sync-waterfall"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "https://github.com/hydiak/a-sync-waterfall",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git@github.com:hydiak/a-sync-waterfall.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/hydiak/a-sync-waterfall/issues"
|
|
17
|
+
},
|
|
18
|
+
"main": "./index",
|
|
19
|
+
"keywords": ["async", "sync", "waterfall", "tasks", "control", "flow"],
|
|
20
|
+
"dependencies": {}
|
|
21
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const waterfall = require('./index');
|
|
3
|
+
|
|
4
|
+
var generateSyncTask = function(index) {
|
|
5
|
+
return function (x){
|
|
6
|
+
return function(cb){
|
|
7
|
+
console.log(x);
|
|
8
|
+
cb(null);
|
|
9
|
+
};
|
|
10
|
+
}(index);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var generateAsyncTask = function(index) {
|
|
15
|
+
return function (x){
|
|
16
|
+
return function(cb){
|
|
17
|
+
setTimeout(function(){
|
|
18
|
+
console.log(x);
|
|
19
|
+
cb(null);
|
|
20
|
+
}, 0);
|
|
21
|
+
};
|
|
22
|
+
}(index);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var generateSyncTasks = function(count){
|
|
26
|
+
var tasks = [];
|
|
27
|
+
for(var i=0; i<count; i++) {
|
|
28
|
+
tasks.push(generateSyncTask(i));
|
|
29
|
+
}
|
|
30
|
+
return tasks;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var generateAsyncTasks = function(count){
|
|
34
|
+
var tasks = [];
|
|
35
|
+
for(var i=0; i<count; i++) {
|
|
36
|
+
tasks.push(generateAsyncTask(i));
|
|
37
|
+
}
|
|
38
|
+
return tasks;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var generateRandomTasks = function(count){
|
|
43
|
+
var tasks = [];
|
|
44
|
+
for(var i=0; i<count; i++) {
|
|
45
|
+
Math.random() > .5 ? tasks.push(generateAsyncTask(i)) : tasks.push(generateSyncTask(i))
|
|
46
|
+
}
|
|
47
|
+
return tasks;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var done = function(){
|
|
51
|
+
console.log('done');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var testSync = function(){
|
|
55
|
+
waterfall(generateSyncTasks(10), done);
|
|
56
|
+
console.log('this text should be after waterfall');
|
|
57
|
+
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var testAsync = function(){
|
|
61
|
+
waterfall(generateAsyncTasks(5), done);
|
|
62
|
+
console.log('this text should be before waterfall');
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var testMixed = function(){
|
|
66
|
+
waterfall(generateRandomTasks(20), done);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
console.log('testSync:');
|
|
71
|
+
testSync();
|
|
72
|
+
|
|
73
|
+
// console.log('\ntestAsync: ');
|
|
74
|
+
// testAsync();
|
|
75
|
+
|
|
76
|
+
console.log('\ntestMixed: ');
|
|
77
|
+
testMixed();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
## 2.0.6
|
|
3
|
+
|
|
4
|
+
Version 2.0.4 adds support for React Native by clarifying in package.json that
|
|
5
|
+
the browser environment does not support Node.js domains.
|
|
6
|
+
Why this is necessary, we leave as an exercise for the user.
|
|
7
|
+
|
|
8
|
+
## 2.0.3
|
|
9
|
+
|
|
10
|
+
Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
|
|
11
|
+
|
|
12
|
+
## 2.0.1-2.02
|
|
13
|
+
|
|
14
|
+
Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
|
|
15
|
+
function of Browserify, but which Mr would tolerate.
|
|
16
|
+
|
|
17
|
+
## 2.0.0
|
|
18
|
+
|
|
19
|
+
Version 2 of ASAP is a full rewrite with a few salient changes.
|
|
20
|
+
First, the ASAP source is CommonJS only and designed with [Browserify][] and
|
|
21
|
+
[Browserify-compatible][Mr] module loaders in mind.
|
|
22
|
+
|
|
23
|
+
[Browserify]: https://github.com/substack/node-browserify
|
|
24
|
+
[Mr]: https://github.com/montagejs/mr
|
|
25
|
+
|
|
26
|
+
The new version has been refactored in two dimensions.
|
|
27
|
+
Support for Node.js and browsers have been separated, using Browserify
|
|
28
|
+
redirects and ASAP has been divided into two modules.
|
|
29
|
+
The "raw" layer depends on the tasks to catch thrown exceptions and unravel
|
|
30
|
+
Node.js domains.
|
|
31
|
+
|
|
32
|
+
The full implementation of ASAP is loadable as `require("asap")` in both Node.js
|
|
33
|
+
and browsers.
|
|
34
|
+
|
|
35
|
+
The raw layer that lacks exception handling overhead is loadable as
|
|
36
|
+
`require("asap/raw")`.
|
|
37
|
+
The interface is the same for both layers.
|
|
38
|
+
|
|
39
|
+
Tasks are no longer required to be functions, but can rather be any object that
|
|
40
|
+
implements `task.call()`.
|
|
41
|
+
With this feature you can recycle task objects to avoid garbage collector churn
|
|
42
|
+
and avoid closures in general.
|
|
43
|
+
|
|
44
|
+
The implementation has been rigorously documented so that our successors can
|
|
45
|
+
understand the scope of the problem that this module solves and all of its
|
|
46
|
+
nuances, ensuring that the next generation of implementations know what details
|
|
47
|
+
are essential.
|
|
48
|
+
|
|
49
|
+
- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
|
|
50
|
+
- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
|
|
51
|
+
- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
|
|
52
|
+
- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
|
|
53
|
+
|
|
54
|
+
The new version has also been rigorously tested across a broad spectrum of
|
|
55
|
+
browsers, in both the window and worker context.
|
|
56
|
+
The following charts capture the browser test results for the most recent
|
|
57
|
+
release.
|
|
58
|
+
The first chart shows test results for ASAP running in the main window context.
|
|
59
|
+
The second chart shows test results for ASAP running in a web worker context.
|
|
60
|
+
Test results are inconclusive (grey) on browsers that do not support web
|
|
61
|
+
workers.
|
|
62
|
+
These data are captured automatically by [Continuous
|
|
63
|
+
Integration][].
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
|
|
70
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright 2009–2014 Contributors. All rights reserved.
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to
|
|
6
|
+
deal in the Software without restriction, including without limitation the
|
|
7
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
8
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
19
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
20
|
+
IN THE SOFTWARE.
|
|
21
|
+
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# ASAP
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/kriskowal/asap)
|
|
4
|
+
|
|
5
|
+
Promise and asynchronous observer libraries, as well as hand-rolled callback
|
|
6
|
+
programs and libraries, often need a mechanism to postpone the execution of a
|
|
7
|
+
callback until the next available event.
|
|
8
|
+
(See [Designing API’s for Asynchrony][Zalgo].)
|
|
9
|
+
The `asap` function executes a task **as soon as possible** but not before it
|
|
10
|
+
returns, waiting only for the completion of the current event and previously
|
|
11
|
+
scheduled tasks.
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
asap(function () {
|
|
15
|
+
// ...
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
|
|
20
|
+
|
|
21
|
+
This CommonJS package provides an `asap` module that exports a function that
|
|
22
|
+
executes a task function *as soon as possible*.
|
|
23
|
+
|
|
24
|
+
ASAP strives to schedule events to occur before yielding for IO, reflow,
|
|
25
|
+
or redrawing.
|
|
26
|
+
Each event receives an independent stack, with only platform code in parent
|
|
27
|
+
frames and the events run in the order they are scheduled.
|
|
28
|
+
|
|
29
|
+
ASAP provides a fast event queue that will execute tasks until it is
|
|
30
|
+
empty before yielding to the JavaScript engine's underlying event-loop.
|
|
31
|
+
When a task gets added to a previously empty event queue, ASAP schedules a flush
|
|
32
|
+
event, preferring for that event to occur before the JavaScript engine has an
|
|
33
|
+
opportunity to perform IO tasks or rendering, thus making the first task and
|
|
34
|
+
subsequent tasks semantically indistinguishable.
|
|
35
|
+
ASAP uses a variety of techniques to preserve this invariant on different
|
|
36
|
+
versions of browsers and Node.js.
|
|
37
|
+
|
|
38
|
+
By design, ASAP prevents input events from being handled until the task
|
|
39
|
+
queue is empty.
|
|
40
|
+
If the process is busy enough, this may cause incoming connection requests to be
|
|
41
|
+
dropped, and may cause existing connections to inform the sender to reduce the
|
|
42
|
+
transmission rate or stall.
|
|
43
|
+
ASAP allows this on the theory that, if there is enough work to do, there is no
|
|
44
|
+
sense in looking for trouble.
|
|
45
|
+
As a consequence, ASAP can interfere with smooth animation.
|
|
46
|
+
If your task should be tied to the rendering loop, consider using
|
|
47
|
+
`requestAnimationFrame` instead.
|
|
48
|
+
A long sequence of tasks can also effect the long running script dialog.
|
|
49
|
+
If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to
|
|
50
|
+
break long processes into shorter intervals and periodically allow the browser
|
|
51
|
+
to breathe.
|
|
52
|
+
`setImmediate` will yield for IO, reflow, and repaint events.
|
|
53
|
+
It also returns a handler and can be canceled.
|
|
54
|
+
For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
|
|
55
|
+
|
|
56
|
+
[setImmediate]: https://github.com/YuzuJS/setImmediate
|
|
57
|
+
|
|
58
|
+
Take care.
|
|
59
|
+
ASAP can sustain infinite recursive calls without warning.
|
|
60
|
+
It will not halt from a stack overflow, and it will not consume unbounded
|
|
61
|
+
memory.
|
|
62
|
+
This is behaviorally equivalent to an infinite loop.
|
|
63
|
+
Just as with infinite loops, you can monitor a Node.js process for this behavior
|
|
64
|
+
with a heart-beat signal.
|
|
65
|
+
As with infinite loops, a very small amount of caution goes a long way to
|
|
66
|
+
avoiding problems.
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
function loop() {
|
|
70
|
+
asap(loop);
|
|
71
|
+
}
|
|
72
|
+
loop();
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
In browsers, if a task throws an exception, it will not interrupt the flushing
|
|
76
|
+
of high-priority tasks.
|
|
77
|
+
The exception will be postponed to a later, low-priority event to avoid
|
|
78
|
+
slow-downs.
|
|
79
|
+
In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
|
|
80
|
+
only after—the error is handled by `domain.on("error")` or
|
|
81
|
+
`process.on("uncaughtException")`.
|
|
82
|
+
|
|
83
|
+
## Raw ASAP
|
|
84
|
+
|
|
85
|
+
Checking for exceptions comes at a cost.
|
|
86
|
+
The package also provides an `asap/raw` module that exports the underlying
|
|
87
|
+
implementation which is faster but stalls if a task throws an exception.
|
|
88
|
+
This internal version of the ASAP function does not check for errors.
|
|
89
|
+
If a task does throw an error, it will stall the event queue unless you manually
|
|
90
|
+
call `rawAsap.requestFlush()` before throwing the error, or any time after.
|
|
91
|
+
|
|
92
|
+
In Node.js, `asap/raw` also runs all tasks outside any domain.
|
|
93
|
+
If you need a task to be bound to your domain, you will have to do it manually.
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
if (process.domain) {
|
|
97
|
+
task = process.domain.bind(task);
|
|
98
|
+
}
|
|
99
|
+
rawAsap(task);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Tasks
|
|
103
|
+
|
|
104
|
+
A task may be any object that implements `call()`.
|
|
105
|
+
A function will suffice, but closures tend not to be reusable and can cause
|
|
106
|
+
garbage collector churn.
|
|
107
|
+
Both `asap` and `rawAsap` accept task objects to give you the option of
|
|
108
|
+
recycling task objects or using higher callable object abstractions.
|
|
109
|
+
See the `asap` source for an illustration.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Compatibility
|
|
113
|
+
|
|
114
|
+
ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
|
|
115
|
+
The following charts capture the browser test results for the most recent
|
|
116
|
+
release.
|
|
117
|
+
The first chart shows test results for ASAP running in the main window context.
|
|
118
|
+
The second chart shows test results for ASAP running in a web worker context.
|
|
119
|
+
Test results are inconclusive (grey) on browsers that do not support web
|
|
120
|
+
workers.
|
|
121
|
+
These data are captured automatically by [Continuous
|
|
122
|
+
Integration][].
|
|
123
|
+
|
|
124
|
+
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+
## Caveats
|
|
131
|
+
|
|
132
|
+
When a task is added to an empty event queue, it is not always possible to
|
|
133
|
+
guarantee that the task queue will begin flushing immediately after the current
|
|
134
|
+
event.
|
|
135
|
+
However, once the task queue begins flushing, it will not yield until the queue
|
|
136
|
+
is empty, even if the queue grows while executing tasks.
|
|
137
|
+
|
|
138
|
+
The following browsers allow the use of [DOM mutation observers][] to access
|
|
139
|
+
the HTML [microtask queue][], and thus begin flushing ASAP's task queue
|
|
140
|
+
immediately at the end of the current event loop turn, before any rendering or
|
|
141
|
+
IO:
|
|
142
|
+
|
|
143
|
+
[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
|
|
144
|
+
[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
|
|
145
|
+
|
|
146
|
+
- Android 4–4.3
|
|
147
|
+
- Chrome 26–34
|
|
148
|
+
- Firefox 14–29
|
|
149
|
+
- Internet Explorer 11
|
|
150
|
+
- iPad Safari 6–7.1
|
|
151
|
+
- iPhone Safari 7–7.1
|
|
152
|
+
- Safari 6–7
|
|
153
|
+
|
|
154
|
+
In the absense of mutation observers, there are a few browsers, and situations
|
|
155
|
+
like web workers in some of the above browsers, where [message channels][]
|
|
156
|
+
would be a useful way to avoid falling back to timers.
|
|
157
|
+
Message channels give direct access to the HTML [task queue][], so the ASAP
|
|
158
|
+
task queue would flush after any already queued rendering and IO tasks, but
|
|
159
|
+
without having the minimum delay imposed by timers.
|
|
160
|
+
However, among these browsers, Internet Explorer 10 and Safari do not reliably
|
|
161
|
+
dispatch messages, so they are not worth the trouble to implement.
|
|
162
|
+
|
|
163
|
+
[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
|
|
164
|
+
[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
|
|
165
|
+
|
|
166
|
+
- Internet Explorer 10
|
|
167
|
+
- Safair 5.0-1
|
|
168
|
+
- Opera 11-12
|
|
169
|
+
|
|
170
|
+
In the absense of mutation observers, these browsers and the following browsers
|
|
171
|
+
all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
|
|
172
|
+
occurs.
|
|
173
|
+
The implementation uses both and cancels whatever handler loses the race, since
|
|
174
|
+
`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
|
|
175
|
+
Timers generally delay the flushing of ASAP's task queue for four milliseconds.
|
|
176
|
+
|
|
177
|
+
- Firefox 3–13
|
|
178
|
+
- Internet Explorer 6–10
|
|
179
|
+
- iPad Safari 4.3
|
|
180
|
+
- Lynx 2.8.7
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
## Heritage
|
|
184
|
+
|
|
185
|
+
ASAP has been factored out of the [Q][] asynchronous promise library.
|
|
186
|
+
It originally had a naïve implementation in terms of `setTimeout`, but
|
|
187
|
+
[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
|
|
188
|
+
useful for creating a high-priority, no-delay event dispatch hack.
|
|
189
|
+
Since then, Internet Explorer proposed and implemented `setImmediate`.
|
|
190
|
+
Robert Katić began contributing to Q by measuring the performance of
|
|
191
|
+
the internal implementation of `asap`, paying particular attention to
|
|
192
|
+
error recovery.
|
|
193
|
+
Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
|
|
194
|
+
unrolling the high-priority event queue internally regardless of what strategy
|
|
195
|
+
we used to dispatch the potentially lower-priority flush event.
|
|
196
|
+
Domenic went on to make ASAP cooperate with Node.js domains.
|
|
197
|
+
|
|
198
|
+
[Q]: https://github.com/kriskowal/q
|
|
199
|
+
[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
|
|
200
|
+
|
|
201
|
+
For further reading, Nicholas Zakas provided a thorough article on [The
|
|
202
|
+
Case for setImmediate][NCZ].
|
|
203
|
+
|
|
204
|
+
[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
|
|
205
|
+
|
|
206
|
+
Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
|
|
207
|
+
further developed the implentation.
|
|
208
|
+
Particularly, The `MessagePort` implementation was abandoned due to interaction
|
|
209
|
+
[problems with Mobile Internet Explorer][IE Problems] in favor of an
|
|
210
|
+
implementation backed on the newer and more reliable DOM `MutationObserver`
|
|
211
|
+
interface.
|
|
212
|
+
These changes were back-ported into this library.
|
|
213
|
+
|
|
214
|
+
[IE Problems]: https://github.com/cujojs/when/issues/197
|
|
215
|
+
[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
|
|
216
|
+
|
|
217
|
+
In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
|
|
218
|
+
exception-safe, but `asap/raw` provided a tight kernel that could be used for
|
|
219
|
+
tasks that guaranteed that they would not throw exceptions.
|
|
220
|
+
This core is useful for promise implementations that capture thrown errors in
|
|
221
|
+
rejected promises and do not need a second safety net.
|
|
222
|
+
At the same time, the exception handling in `asap` was factored into separate
|
|
223
|
+
implementations for Node.js and browsers, using the the [Browserify][Browser
|
|
224
|
+
Config] `browser` property in `package.json` to instruct browser module loaders
|
|
225
|
+
and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
|
|
226
|
+
browser-only implementation.
|
|
227
|
+
|
|
228
|
+
[Browser Config]: https://gist.github.com/defunctzombie/4339901
|
|
229
|
+
[Browserify]: https://github.com/substack/node-browserify
|
|
230
|
+
[Mr]: https://github.com/montagejs/mr
|
|
231
|
+
[Mop]: https://github.com/montagejs/mop
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
Copyright 2009-2014 by Contributors
|
|
236
|
+
MIT License (enclosed)
|
|
237
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var rawAsap = require("./raw");
|
|
4
|
+
var freeTasks = [];
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Calls a task as soon as possible after returning, in its own event, with
|
|
8
|
+
* priority over IO events. An exception thrown in a task can be handled by
|
|
9
|
+
* `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
|
|
10
|
+
* crash the process. If the error is handled, all subsequent tasks will
|
|
11
|
+
* resume.
|
|
12
|
+
*
|
|
13
|
+
* @param {{call}} task A callable object, typically a function that takes no
|
|
14
|
+
* arguments.
|
|
15
|
+
*/
|
|
16
|
+
module.exports = asap;
|
|
17
|
+
function asap(task) {
|
|
18
|
+
var rawTask;
|
|
19
|
+
if (freeTasks.length) {
|
|
20
|
+
rawTask = freeTasks.pop();
|
|
21
|
+
} else {
|
|
22
|
+
rawTask = new RawTask();
|
|
23
|
+
}
|
|
24
|
+
rawTask.task = task;
|
|
25
|
+
rawTask.domain = process.domain;
|
|
26
|
+
rawAsap(rawTask);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function RawTask() {
|
|
30
|
+
this.task = null;
|
|
31
|
+
this.domain = null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
RawTask.prototype.call = function () {
|
|
35
|
+
if (this.domain) {
|
|
36
|
+
this.domain.enter();
|
|
37
|
+
}
|
|
38
|
+
var threw = true;
|
|
39
|
+
try {
|
|
40
|
+
this.task.call();
|
|
41
|
+
threw = false;
|
|
42
|
+
// If the task throws an exception (presumably) Node.js restores the
|
|
43
|
+
// domain stack for the next event.
|
|
44
|
+
if (this.domain) {
|
|
45
|
+
this.domain.exit();
|
|
46
|
+
}
|
|
47
|
+
} finally {
|
|
48
|
+
// We use try/finally and a threw flag to avoid messing up stack traces
|
|
49
|
+
// when we catch and release errors.
|
|
50
|
+
if (threw) {
|
|
51
|
+
// In Node.js, uncaught exceptions are considered fatal errors.
|
|
52
|
+
// Re-throw them to interrupt flushing!
|
|
53
|
+
// Ensure that flushing continues if an uncaught exception is
|
|
54
|
+
// suppressed listening process.on("uncaughtException") or
|
|
55
|
+
// domain.on("error").
|
|
56
|
+
rawAsap.requestFlush();
|
|
57
|
+
}
|
|
58
|
+
// If the task threw an error, we do not want to exit the domain here.
|
|
59
|
+
// Exiting the domain would prevent the domain from catching the error.
|
|
60
|
+
this.task = null;
|
|
61
|
+
this.domain = null;
|
|
62
|
+
freeTasks.push(this);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|