@davidsouther/jiffies 1.0.0-beta.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{build → lib/cjs}/assert.d.ts +0 -0
- package/lib/cjs/assert.js +40 -0
- package/{build → lib/cjs}/case.d.ts +0 -0
- package/lib/cjs/case.js +9 -0
- package/{build → lib/cjs}/components/button_bar.d.ts +1 -1
- package/lib/cjs/components/button_bar.js +29 -0
- package/{build → lib/cjs}/components/inline_edit.d.ts +1 -1
- package/lib/cjs/components/inline_edit.js +51 -0
- package/{build → lib/cjs}/components/logger.d.ts +2 -3
- package/lib/cjs/components/logger.js +27 -0
- package/lib/cjs/components/select.d.ts +10 -0
- package/lib/cjs/components/select.js +6 -0
- package/lib/cjs/components/test.d.ts +1 -0
- package/lib/cjs/components/test.js +7 -0
- package/{build → lib/cjs}/components/virtual_scroll.d.ts +3 -4
- package/lib/cjs/components/virtual_scroll.js +102 -0
- package/{build → lib/cjs}/components/virtual_scroll.test.d.ts +0 -0
- package/lib/cjs/components/virtual_scroll.test.js +22 -0
- package/{build → lib/cjs}/context.d.ts +0 -0
- package/lib/cjs/context.js +48 -0
- package/{build → lib/cjs}/context.test.d.ts +0 -0
- package/lib/cjs/context.test.js +48 -0
- package/{build → lib/cjs}/debounce.d.ts +0 -0
- package/lib/cjs/debounce.js +11 -0
- package/lib/cjs/diff.d.ts +15 -0
- package/lib/cjs/diff.js +58 -0
- package/{build/components/index.d.ts → lib/cjs/diff.test.d.ts} +0 -0
- package/lib/cjs/diff.test.js +41 -0
- package/{build → lib/cjs}/display.d.ts +0 -0
- package/lib/cjs/display.js +16 -0
- package/{build → lib/cjs}/dom/css/border.d.ts +0 -0
- package/lib/cjs/dom/css/border.js +33 -0
- package/{build → lib/cjs}/dom/css/constants.d.ts +0 -0
- package/lib/cjs/dom/css/constants.js +31 -0
- package/{build → lib/cjs}/dom/css/core.d.ts +0 -0
- package/lib/cjs/dom/css/core.js +31 -0
- package/{build → lib/cjs}/dom/css/fstyle.d.ts +0 -0
- package/lib/cjs/dom/css/fstyle.js +36 -0
- package/{build → lib/cjs}/dom/css/sizing.d.ts +0 -0
- package/lib/cjs/dom/css/sizing.js +14 -0
- package/lib/cjs/dom/dom.d.ts +27 -0
- package/lib/cjs/dom/dom.js +110 -0
- package/{build → lib/cjs}/dom/fc.d.ts +5 -5
- package/lib/cjs/dom/fc.js +39 -0
- package/{build → lib/cjs}/dom/fc.test.d.ts +0 -0
- package/lib/cjs/dom/fc.test.js +23 -0
- package/lib/cjs/dom/form/form.app.d.ts +1 -0
- package/lib/cjs/dom/form/form.app.js +27 -0
- package/lib/cjs/dom/form/form.d.ts +26 -0
- package/lib/cjs/dom/form/form.js +49 -0
- package/{build → lib/cjs}/dom/form/form.test.d.ts +0 -0
- package/{build → lib/cjs}/dom/form/form.test.js +0 -0
- package/lib/cjs/dom/html.d.ts +113 -0
- package/lib/cjs/dom/html.js +119 -0
- package/{build → lib/cjs}/dom/html.test.d.ts +0 -0
- package/lib/cjs/dom/html.test.js +60 -0
- package/lib/cjs/dom/observable.d.ts +2 -0
- package/lib/cjs/dom/observable.js +10 -0
- package/{build/components/index.js → lib/cjs/dom/observable.test.d.ts} +0 -0
- package/lib/cjs/dom/observable.test.js +35 -0
- package/lib/cjs/dom/provide.d.ts +3 -0
- package/lib/cjs/dom/provide.js +12 -0
- package/lib/cjs/dom/router/link.d.ts +6 -0
- package/lib/cjs/dom/router/link.js +7 -0
- package/{build → lib/cjs}/dom/router/router.d.ts +3 -3
- package/lib/cjs/dom/router/router.js +52 -0
- package/lib/cjs/dom/svg.d.ts +64 -0
- package/lib/cjs/dom/svg.js +69 -0
- package/lib/cjs/dom/test.d.ts +1 -0
- package/lib/cjs/dom/test.js +13 -0
- package/{build → lib/cjs}/dom/types/css.d.ts +0 -0
- package/lib/cjs/dom/types/css.js +24 -0
- package/{build → lib/cjs}/dom/types/dom.d.ts +0 -0
- package/{build → lib/cjs}/dom/types/dom.js +0 -0
- package/{build → lib/cjs}/dom/types/html.d.ts +1 -1
- package/lib/cjs/dom/types/html.js +2 -0
- package/{build → lib/cjs}/dom/xml.d.ts +0 -0
- package/lib/cjs/dom/xml.js +8 -0
- package/lib/cjs/equal.d.ts +5 -0
- package/lib/cjs/equal.js +43 -0
- package/{build → lib/cjs}/equal.test.d.ts +0 -0
- package/lib/cjs/equal.test.js +22 -0
- package/{build → lib/cjs}/flags.d.ts +0 -0
- package/lib/cjs/flags.js +52 -0
- package/{build → lib/cjs}/flags.test.d.ts +0 -0
- package/lib/cjs/flags.test.js +37 -0
- package/lib/cjs/fs.d.ts +48 -0
- package/lib/cjs/fs.js +151 -0
- package/{build/components/test.d.ts → lib/cjs/fs.test.d.ts} +0 -0
- package/lib/cjs/fs.test.js +45 -0
- package/{build → lib/cjs}/generator.d.ts +0 -0
- package/lib/cjs/generator.js +14 -0
- package/{build → lib/cjs}/generator.test.d.ts +0 -0
- package/lib/cjs/generator.test.js +26 -0
- package/{build → lib/cjs}/is_browser.d.ts +0 -0
- package/lib/cjs/is_browser.js +4 -0
- package/{build → lib/cjs}/loader.d.mts +0 -0
- package/lib/cjs/loader.mjs +40 -0
- package/{build → lib/cjs}/lock.d.ts +0 -0
- package/lib/cjs/lock.js +27 -0
- package/{build → lib/cjs}/lock.test.d.ts +0 -0
- package/lib/cjs/lock.test.js +18 -0
- package/{build → lib/cjs}/log.d.ts +0 -0
- package/lib/cjs/log.js +54 -0
- package/lib/cjs/observable/event.d.ts +35 -0
- package/lib/cjs/observable/event.js +61 -0
- package/lib/cjs/observable/observable.d.ts +132 -0
- package/lib/cjs/observable/observable.js +363 -0
- package/{build/dom/test.d.ts → lib/cjs/observable/observable.test.d.ts} +0 -0
- package/lib/cjs/observable/observable.test.js +65 -0
- package/{build → lib/cjs}/range.d.ts +0 -0
- package/lib/cjs/range.js +11 -0
- package/{build → lib/cjs}/result.d.ts +11 -11
- package/lib/cjs/result.js +80 -0
- package/{build → lib/cjs}/result.test.d.ts +0 -0
- package/lib/cjs/result.test.js +73 -0
- package/{build → lib/cjs}/safe.d.ts +0 -0
- package/lib/cjs/safe.js +14 -0
- package/{build → lib/cjs}/scope/describe.d.ts +4 -0
- package/lib/cjs/scope/describe.js +73 -0
- package/{build → lib/cjs}/scope/display/console.d.ts +0 -0
- package/lib/cjs/scope/display/console.js +25 -0
- package/{build → lib/cjs}/scope/display/dom.d.ts +2 -2
- package/lib/cjs/scope/display/dom.js +30 -0
- package/{build → lib/cjs}/scope/display/junit.d.ts +0 -0
- package/lib/cjs/scope/display/junit.js +21 -0
- package/{build → lib/cjs}/scope/execute.d.ts +1 -1
- package/lib/cjs/scope/execute.js +91 -0
- package/{build → lib/cjs}/scope/expect.d.ts +1 -1
- package/lib/cjs/scope/expect.js +114 -0
- package/{build → lib/cjs}/scope/fix.d.ts +0 -0
- package/lib/cjs/scope/fix.js +26 -0
- package/{build → lib/cjs}/scope/index.d.ts +0 -0
- package/lib/cjs/scope/index.js +15 -0
- package/{build → lib/cjs}/scope/scope.d.ts +0 -0
- package/lib/cjs/scope/scope.js +2 -0
- package/lib/cjs/scope/state.d.ts +1 -0
- package/lib/cjs/scope/state.js +11 -0
- package/{build → lib/cjs}/server/http/apps.d.ts +0 -0
- package/lib/cjs/server/http/apps.js +27 -0
- package/lib/cjs/server/http/css.d.ts +5 -0
- package/lib/cjs/server/http/css.js +54 -0
- package/{build → lib/cjs}/server/http/index.d.ts +0 -0
- package/lib/cjs/server/http/index.js +77 -0
- package/{build → lib/cjs}/server/http/response.d.ts +0 -0
- package/lib/cjs/server/http/response.js +45 -0
- package/{build → lib/cjs}/server/http/sitemap.d.ts +0 -0
- package/lib/cjs/server/http/sitemap.js +46 -0
- package/{build → lib/cjs}/server/http/static.d.ts +0 -0
- package/lib/cjs/server/http/static.js +25 -0
- package/{build → lib/cjs}/server/http/typescript.d.ts +0 -0
- package/lib/cjs/server/http/typescript.js +44 -0
- package/{build → lib/cjs}/server/main.d.ts +0 -0
- package/lib/cjs/server/main.js +14 -0
- package/{build → lib/cjs}/test.d.mts +0 -0
- package/lib/cjs/test.mjs +28 -0
- package/lib/cjs/test_all.d.ts +9 -0
- package/lib/cjs/test_all.js +30 -0
- package/{build → lib/cjs}/transpile.d.mts +0 -0
- package/lib/cjs/transpile.mjs +22 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -0
- package/lib/esm/assert.d.ts +23 -0
- package/{build → lib/esm}/assert.js +1 -1
- package/lib/esm/case.d.ts +1 -0
- package/{build → lib/esm}/case.js +0 -0
- package/lib/esm/components/button_bar.d.ts +8 -0
- package/lib/esm/components/button_bar.js +27 -0
- package/lib/esm/components/inline_edit.d.ts +12 -0
- package/{build → lib/esm}/components/inline_edit.js +3 -3
- package/lib/esm/components/logger.d.ts +6 -0
- package/{build → lib/esm}/components/logger.js +3 -3
- package/lib/esm/components/select.d.ts +10 -0
- package/{build → lib/esm}/components/select.js +2 -2
- package/lib/esm/components/test.d.ts +1 -0
- package/lib/esm/components/test.js +3 -0
- package/lib/esm/components/virtual_scroll.d.ts +40 -0
- package/{build → lib/esm}/components/virtual_scroll.js +3 -3
- package/{build/dom/types/html.js → lib/esm/components/virtual_scroll.test.d.ts} +0 -0
- package/{build → lib/esm}/components/virtual_scroll.test.js +3 -4
- package/lib/esm/context.d.ts +15 -0
- package/{build → lib/esm}/context.js +3 -3
- package/{build/scope/scope.js → lib/esm/context.test.d.ts} +0 -0
- package/{build → lib/esm}/context.test.js +0 -0
- package/lib/esm/debounce.d.ts +1 -0
- package/{build → lib/esm}/debounce.js +0 -0
- package/lib/esm/diff.d.ts +15 -0
- package/lib/esm/diff.js +54 -0
- package/{build/test_all.d.ts → lib/esm/diff.test.d.ts} +0 -0
- package/lib/esm/diff.test.js +39 -0
- package/lib/esm/display.d.ts +5 -0
- package/lib/esm/display.js +11 -0
- package/lib/esm/dom/css/border.d.ts +11 -0
- package/{build → lib/esm}/dom/css/border.js +0 -0
- package/lib/esm/dom/css/constants.d.ts +31 -0
- package/{build → lib/esm}/dom/css/constants.js +0 -0
- package/lib/esm/dom/css/core.d.ts +5 -0
- package/{build → lib/esm}/dom/css/core.js +0 -0
- package/lib/esm/dom/css/fstyle.d.ts +5 -0
- package/{build → lib/esm}/dom/css/fstyle.js +0 -0
- package/lib/esm/dom/css/sizing.d.ts +5 -0
- package/{build → lib/esm}/dom/css/sizing.js +0 -0
- package/lib/esm/dom/dom.d.ts +27 -0
- package/{build → lib/esm}/dom/dom.js +44 -34
- package/lib/esm/dom/fc.d.ts +14 -0
- package/{build → lib/esm}/dom/fc.js +1 -1
- package/lib/esm/dom/fc.test.d.ts +1 -0
- package/{build → lib/esm}/dom/fc.test.js +0 -0
- package/lib/esm/dom/form/form.app.d.ts +1 -0
- package/{build → lib/esm}/dom/form/form.app.js +0 -0
- package/lib/esm/dom/form/form.d.ts +26 -0
- package/{build → lib/esm}/dom/form/form.js +14 -5
- package/lib/esm/dom/form/form.test.d.ts +0 -0
- package/lib/esm/dom/form/form.test.js +1 -0
- package/lib/esm/dom/html.d.ts +113 -0
- package/{build → lib/esm}/dom/html.js +0 -0
- package/lib/esm/dom/html.test.d.ts +1 -0
- package/{build → lib/esm}/dom/html.test.js +4 -4
- package/lib/esm/dom/observable.d.ts +2 -0
- package/lib/esm/dom/observable.js +6 -0
- package/lib/esm/dom/observable.test.d.ts +1 -0
- package/lib/esm/dom/observable.test.js +33 -0
- package/lib/esm/dom/provide.d.ts +3 -0
- package/lib/esm/dom/provide.js +7 -0
- package/lib/esm/dom/router/link.d.ts +6 -0
- package/{build → lib/esm}/dom/router/link.js +0 -0
- package/lib/esm/dom/router/router.d.ts +12 -0
- package/{build → lib/esm}/dom/router/router.js +0 -0
- package/lib/esm/dom/svg.d.ts +64 -0
- package/{build → lib/esm}/dom/svg.js +0 -0
- package/lib/esm/dom/test.d.ts +1 -0
- package/lib/esm/dom/test.js +9 -0
- package/lib/esm/dom/types/css.d.ts +6612 -0
- package/{build → lib/esm}/dom/types/css.js +0 -0
- package/lib/esm/dom/types/dom.d.ts +0 -0
- package/lib/esm/dom/types/dom.js +1 -0
- package/lib/esm/dom/types/html.d.ts +616 -0
- package/lib/esm/dom/types/html.js +1 -0
- package/lib/esm/dom/xml.d.ts +1 -0
- package/{build → lib/esm}/dom/xml.js +1 -2
- package/lib/esm/equal.d.ts +5 -0
- package/lib/esm/equal.js +37 -0
- package/lib/esm/equal.test.d.ts +1 -0
- package/{build → lib/esm}/equal.test.js +0 -0
- package/lib/esm/flags.d.ts +7 -0
- package/{build → lib/esm}/flags.js +1 -1
- package/lib/esm/flags.test.d.ts +1 -0
- package/{build → lib/esm}/flags.test.js +0 -0
- package/lib/esm/fs.d.ts +48 -0
- package/lib/esm/fs.js +144 -0
- package/lib/esm/fs.test.d.ts +1 -0
- package/lib/esm/fs.test.js +43 -0
- package/lib/esm/generator.d.ts +1 -0
- package/{build → lib/esm}/generator.js +0 -0
- package/lib/esm/generator.test.d.ts +1 -0
- package/{build → lib/esm}/generator.test.js +0 -0
- package/lib/esm/is_browser.d.ts +1 -0
- package/{build → lib/esm}/is_browser.js +0 -0
- package/lib/esm/loader.d.mts +22 -0
- package/{build → lib/esm}/loader.mjs +0 -0
- package/lib/esm/lock.d.ts +1 -0
- package/{build → lib/esm}/lock.js +0 -0
- package/lib/esm/lock.test.d.ts +1 -0
- package/{build → lib/esm}/lock.test.js +0 -0
- package/lib/esm/log.d.ts +26 -0
- package/{build → lib/esm}/log.js +16 -4
- package/lib/esm/observable/event.d.ts +35 -0
- package/lib/esm/observable/event.js +46 -0
- package/lib/esm/observable/observable.d.ts +132 -0
- package/lib/esm/observable/observable.js +343 -0
- package/lib/esm/observable/observable.test.d.ts +1 -0
- package/lib/esm/observable/observable.test.js +63 -0
- package/lib/esm/range.d.ts +1 -0
- package/{build → lib/esm}/range.js +0 -0
- package/lib/esm/result.d.ts +31 -0
- package/{build → lib/esm}/result.js +3 -3
- package/lib/esm/result.test.d.ts +1 -0
- package/{build → lib/esm}/result.test.js +0 -0
- package/lib/esm/safe.d.ts +1 -0
- package/{build → lib/esm}/safe.js +0 -0
- package/lib/esm/scope/describe.d.ts +18 -0
- package/{build → lib/esm}/scope/describe.js +14 -6
- package/lib/esm/scope/display/console.d.ts +2 -0
- package/{build → lib/esm}/scope/display/console.js +0 -0
- package/lib/esm/scope/display/dom.d.ts +3 -0
- package/{build → lib/esm}/scope/display/dom.js +0 -0
- package/lib/esm/scope/display/junit.d.ts +2 -0
- package/{build → lib/esm}/scope/display/junit.js +0 -0
- package/lib/esm/scope/execute.d.ts +12 -0
- package/{build → lib/esm}/scope/execute.js +3 -3
- package/lib/esm/scope/expect.d.ts +23 -0
- package/{build → lib/esm}/scope/expect.js +4 -3
- package/lib/esm/scope/fix.d.ts +4 -0
- package/{build → lib/esm}/scope/fix.js +0 -0
- package/{build/scope/index.js → lib/esm/scope/index.d.ts} +0 -0
- package/lib/esm/scope/index.js +3 -0
- package/lib/esm/scope/scope.d.ts +17 -0
- package/lib/esm/scope/scope.js +1 -0
- package/lib/esm/scope/state.d.ts +1 -0
- package/lib/esm/scope/state.js +7 -0
- package/lib/esm/server/http/apps.d.ts +5 -0
- package/{build → lib/esm}/server/http/apps.js +0 -0
- package/lib/esm/server/http/css.d.ts +5 -0
- package/lib/esm/server/http/css.js +50 -0
- package/lib/esm/server/http/index.d.ts +21 -0
- package/{build → lib/esm}/server/http/index.js +4 -2
- package/lib/esm/server/http/response.d.ts +4 -0
- package/{build → lib/esm}/server/http/response.js +6 -3
- package/lib/esm/server/http/sitemap.d.ts +2 -0
- package/{build → lib/esm}/server/http/sitemap.js +0 -0
- package/lib/esm/server/http/static.d.ts +2 -0
- package/{build → lib/esm}/server/http/static.js +0 -0
- package/lib/esm/server/http/typescript.d.ts +5 -0
- package/{build → lib/esm}/server/http/typescript.js +0 -0
- package/lib/esm/server/main.d.ts +2 -0
- package/{build → lib/esm}/server/main.js +5 -2
- package/lib/esm/test.d.mts +2 -0
- package/lib/esm/test.mjs +26 -0
- package/lib/esm/test_all.d.ts +9 -0
- package/lib/esm/test_all.js +28 -0
- package/lib/esm/transpile.d.mts +3 -0
- package/{build → lib/esm}/transpile.mjs +0 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -0
- package/package.json +18 -16
- package/src/assert.ts +1 -1
- package/src/components/button_bar.ts +33 -27
- package/src/components/inline_edit.ts +3 -3
- package/src/components/logger.ts +5 -6
- package/src/components/select.ts +3 -3
- package/src/components/test.js +3 -2
- package/src/components/virtual_scroll.test.ts +4 -4
- package/src/components/virtual_scroll.ts +8 -8
- package/src/context.ts +3 -3
- package/src/diff.test.ts +48 -0
- package/src/diff.ts +84 -0
- package/src/display.ts +8 -2
- package/src/dom/css/border.ts +3 -3
- package/src/dom/css/core.ts +1 -1
- package/src/dom/css/fstyle.ts +2 -2
- package/src/dom/css/sizing.ts +1 -1
- package/src/dom/dom.ts +73 -60
- package/src/dom/fc.test.ts +3 -3
- package/src/dom/fc.ts +11 -10
- package/src/dom/form/form.app.ts +2 -2
- package/src/dom/form/form.ts +33 -10
- package/src/dom/html.test.ts +8 -8
- package/src/dom/html.ts +7 -10
- package/src/dom/observable.test.ts +43 -0
- package/src/dom/observable.ts +11 -0
- package/src/dom/provide.ts +11 -0
- package/src/dom/router/link.ts +2 -2
- package/src/dom/router/router.ts +5 -5
- package/src/dom/svg.ts +1 -1
- package/src/dom/test.ts +8 -2
- package/src/dom/types/html.ts +1 -1
- package/src/dom/xml.ts +1 -2
- package/src/equal.ts +22 -11
- package/src/flags.ts +1 -1
- package/src/fs.test.ts +53 -0
- package/src/fs.ts +180 -0
- package/src/index.html +16 -13
- package/src/log.ts +8 -4
- package/src/observable/_notes +21 -8
- package/src/observable/event.ts +93 -0
- package/src/observable/observable.test.ts +73 -0
- package/src/observable/observable.ts +463 -0
- package/src/pico/_variables.scss +66 -0
- package/src/pico/components/_accordion.scss +112 -0
- package/src/pico/components/_button-group.scss +51 -0
- package/src/pico/components/_card.scss +47 -0
- package/src/pico/components/_dropdown.scss +203 -0
- package/src/pico/components/_modal.scss +181 -0
- package/src/pico/components/_nav.scss +79 -0
- package/src/pico/components/_progress.scss +70 -0
- package/src/pico/components/_property.scss +34 -0
- package/src/pico/content/_button.scss +152 -0
- package/src/pico/content/_code.scss +63 -0
- package/src/pico/content/_embedded.scss +0 -0
- package/src/pico/content/_form-alt.scss +276 -0
- package/src/pico/content/_form.scss +259 -0
- package/src/pico/content/_misc.scss +0 -0
- package/src/pico/content/_table.scss +28 -0
- package/src/pico/content/_toggle.scss +132 -0
- package/src/pico/content/_typography.scss +232 -0
- package/src/pico/layout/_container.scss +40 -0
- package/src/pico/layout/_document.scss +0 -0
- package/src/pico/layout/_flex.scss +46 -0
- package/src/pico/layout/_grid.scss +24 -0
- package/src/pico/layout/_scroller.scss +16 -0
- package/src/pico/layout/_section.scss +8 -0
- package/src/pico/layout/_sectioning.scss +55 -0
- package/src/pico/pico.scss +60 -0
- package/src/pico/reset/_accessibility.scss +34 -0
- package/src/pico/reset/_button.scss +17 -0
- package/src/pico/reset/_code.scss +15 -0
- package/src/pico/reset/_document.scss +48 -0
- package/src/pico/reset/_embedded.scss +39 -0
- package/src/pico/reset/_form.scss +97 -0
- package/src/pico/reset/_misc.scss +23 -0
- package/src/pico/reset/_nav.scss +5 -0
- package/src/pico/reset/_progress.scss +4 -0
- package/src/pico/reset/_table.scss +8 -0
- package/src/pico/reset/_typography.scss +25 -0
- package/src/pico/themes/default/_colors.scss +65 -0
- package/src/pico/themes/default/_dark.scss +148 -0
- package/src/pico/themes/default/_light.scss +149 -0
- package/src/pico/themes/default/_styles.scss +272 -0
- package/src/pico/themes/default.scss +34 -0
- package/src/pico/utilities/_accessibility.scss +3 -0
- package/src/pico/utilities/_loading.scss +52 -0
- package/src/pico/utilities/_reduce-motion.scss +27 -0
- package/src/pico/utilities/_tooltip.scss +101 -0
- package/src/result.ts +17 -21
- package/src/scope/describe.ts +16 -6
- package/src/scope/display/console.ts +4 -4
- package/src/scope/display/dom.ts +7 -7
- package/src/scope/display/junit.ts +3 -3
- package/src/scope/execute.ts +5 -8
- package/src/scope/expect.ts +12 -11
- package/src/scope/state.ts +10 -0
- package/src/server/http/css.ts +65 -0
- package/src/server/http/index.ts +4 -2
- package/src/server/http/response.ts +7 -4
- package/src/server/http/sitemap.ts +1 -1
- package/src/server/main.ts +9 -2
- package/src/test.mjs +22 -18
- package/src/test_all.ts +20 -9
- package/src/zip/spec.txt +3260 -0
- package/build/components/button_bar.js +0 -16
- package/build/components/select.d.ts +0 -13
- package/build/components/test.js +0 -2
- package/build/display.js +0 -3
- package/build/dom/dom.d.ts +0 -27
- package/build/dom/form/form.app.d.ts +0 -1
- package/build/dom/form/form.d.ts +0 -25
- package/build/dom/html.d.ts +0 -117
- package/build/dom/router/link.d.ts +0 -6
- package/build/dom/svg.d.ts +0 -64
- package/build/dom/test.js +0 -2
- package/build/equal.d.ts +0 -4
- package/build/equal.js +0 -22
- package/build/index.d.ts +0 -13
- package/build/index.js +0 -13
- package/build/parcel_resolver.d.ts +0 -3
- package/build/parcel_resolver.js +0 -19
- package/build/test.mjs +0 -23
- package/build/test_all.js +0 -19
- package/src/observable/observable._js +0 -175
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@if $enable-transitions and $enable-important {
|
|
2
|
+
/**
|
|
3
|
+
* Reduce Motion Features
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Based on :
|
|
7
|
+
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
|
|
8
|
+
// ––––––––––––––––––––
|
|
9
|
+
|
|
10
|
+
// 1. Remove animations when motion is reduced (opinionated)
|
|
11
|
+
// 2. Remove fixed background attachments when motion is reduced (opinionated)
|
|
12
|
+
// 3. Remove timed scrolling behaviors when motion is reduced (opinionated)
|
|
13
|
+
// 4. Remove transitions when motion is reduced (opinionated)
|
|
14
|
+
@media (prefers-reduced-motion: reduce) {
|
|
15
|
+
*:not([aria-busy="true"]),
|
|
16
|
+
:not([aria-busy="true"])::before,
|
|
17
|
+
:not([aria-busy="true"])::after {
|
|
18
|
+
background-attachment: initial !important; // 2
|
|
19
|
+
animation-duration: 1ms !important; // 1
|
|
20
|
+
animation-delay: -1ms !important; // 1
|
|
21
|
+
animation-iteration-count: 1 !important; // 1
|
|
22
|
+
scroll-behavior: auto !important; // 3
|
|
23
|
+
transition-delay: 0s !important; // 4
|
|
24
|
+
transition-duration: 0s !important; // 4
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
[data-tooltip] {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
&:not(a):not(button):not(input) {
|
|
5
|
+
border-bottom: 1px dotted;
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
cursor: help;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&::before,
|
|
11
|
+
&::after {
|
|
12
|
+
display: block;
|
|
13
|
+
z-index: 99;
|
|
14
|
+
position: absolute;
|
|
15
|
+
bottom: 100%;
|
|
16
|
+
left: 50%;
|
|
17
|
+
padding: 0.25rem 0.5rem;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
transform: translate(-50%, -0.25rem);
|
|
20
|
+
border-radius: var(--border-radius);
|
|
21
|
+
background: var(--tooltip-background-color);
|
|
22
|
+
content: attr(data-tooltip);
|
|
23
|
+
color: var(--tooltip-color);
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: var(--font-weight);
|
|
26
|
+
font-size: 0.875rem;
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
opacity: 0;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Caret
|
|
35
|
+
&::after {
|
|
36
|
+
padding: 0;
|
|
37
|
+
transform: translate(-50%, 0rem);
|
|
38
|
+
border-top: 0.3rem solid;
|
|
39
|
+
border-right: 0.3rem solid transparent;
|
|
40
|
+
border-left: 0.3rem solid transparent;
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
content: "";
|
|
44
|
+
color: var(--tooltip-background-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Display
|
|
48
|
+
&:focus,
|
|
49
|
+
&:hover {
|
|
50
|
+
&::before,
|
|
51
|
+
&::after {
|
|
52
|
+
opacity: 1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Animations, excluding touch devices
|
|
57
|
+
@if $enable-transitions {
|
|
58
|
+
@media (hover: hover) and (pointer: fine) {
|
|
59
|
+
&:focus,
|
|
60
|
+
&:hover {
|
|
61
|
+
&::before,
|
|
62
|
+
&::after {
|
|
63
|
+
animation-duration: 0.2s;
|
|
64
|
+
animation-name: slide;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&::after {
|
|
68
|
+
animation-name: slideCaret;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Animations
|
|
76
|
+
@if $enable-transitions {
|
|
77
|
+
@keyframes slide {
|
|
78
|
+
from {
|
|
79
|
+
transform: translate(-50%, 0.75rem);
|
|
80
|
+
opacity: 0;
|
|
81
|
+
}
|
|
82
|
+
to {
|
|
83
|
+
transform: translate(-50%, -0.25rem);
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@keyframes slideCaret {
|
|
89
|
+
from {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
}
|
|
92
|
+
50% {
|
|
93
|
+
transform: translate(-50%, -0.25rem);
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
96
|
+
to {
|
|
97
|
+
transform: translate(-50%, 0rem);
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
package/src/result.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export type None = null;
|
|
2
2
|
export type Some<T> = T;
|
|
3
3
|
export type Option<T> = Some<T> | None;
|
|
4
|
-
export type Err<E
|
|
4
|
+
export type Err<E = Error> = {
|
|
5
5
|
err: E;
|
|
6
6
|
map: <U>(fn: (t: unknown) => Result<U>) => Result<U>;
|
|
7
7
|
};
|
|
8
8
|
export type Ok<T> = { ok: T; map: <U>(fn: (t: T) => Result<U>) => Result<U> };
|
|
9
|
-
export type Result<T, E
|
|
9
|
+
export type Result<T, E = Error> = Ok<T> | Err<E>;
|
|
10
10
|
|
|
11
|
-
export const isNone = <T>(s: Option<T>): s is None => s
|
|
11
|
+
export const isNone = <T>(s: Option<T>): s is None => s === null;
|
|
12
12
|
export const isSome = <T>(s: Option<T>): s is Some<T> => s != null;
|
|
13
13
|
|
|
14
14
|
export function None<T = unknown>(_?: T): Option<T> {
|
|
@@ -21,18 +21,17 @@ export function Some(t: any): any {
|
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const isOk = <T, E
|
|
24
|
+
export const isOk = <T, E>(t: Result<T, E>): t is Ok<T> =>
|
|
25
25
|
(t as Ok<T>).ok !== undefined;
|
|
26
|
-
export const isErr = <T, E
|
|
26
|
+
export const isErr = <T, E>(e: Result<T, E>): e is Err<E> =>
|
|
27
27
|
(e as Err<E>).err !== undefined;
|
|
28
|
-
export const isResult = <T, E
|
|
29
|
-
t
|
|
30
|
-
): t is Result<T, E> => isOk(t) || isErr(t);
|
|
28
|
+
export const isResult = <T, E>(t: Result<T, E>): t is Result<T, E> =>
|
|
29
|
+
isOk(t) || isErr(t);
|
|
31
30
|
|
|
32
31
|
// Beware: Order matters for correct inference.
|
|
33
32
|
export function Ok<T>(ok: Ok<T>): T;
|
|
34
33
|
export function Ok<T>(t: T): Ok<T>;
|
|
35
|
-
export function Ok<T, E
|
|
34
|
+
export function Ok<T, E>(t: any): any {
|
|
36
35
|
return t.ok
|
|
37
36
|
? t.ok
|
|
38
37
|
: {
|
|
@@ -44,21 +43,21 @@ export function Ok<T, E extends Error>(t: any): any {
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
// Beware: Order matters for correct inference.
|
|
47
|
-
export function Err<E
|
|
48
|
-
export function Err<E
|
|
49
|
-
export function Err<E
|
|
50
|
-
export function Err<T, E
|
|
46
|
+
export function Err<E>(e: Err<E>): E;
|
|
47
|
+
export function Err<E>(e: E): Err<E>;
|
|
48
|
+
export function Err<E>(e: string): Err<E>;
|
|
49
|
+
export function Err<T, E>(e: any): any {
|
|
51
50
|
return (
|
|
52
51
|
e.err ?? {
|
|
53
|
-
err:
|
|
54
|
-
map<U>(this: Result<T, E>,
|
|
52
|
+
err: e,
|
|
53
|
+
map<U>(this: Result<T, E>, _fn: (t: unknown) => Result<U>): Result<U, E> {
|
|
55
54
|
return this as Result<U, E>;
|
|
56
55
|
},
|
|
57
56
|
}
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
export function unwrap<T, E
|
|
60
|
+
export function unwrap<T, E>(result: Result<T, E>): T | never;
|
|
62
61
|
export function unwrap<O>(some: Option<O>): O | never;
|
|
63
62
|
export function unwrap(t: any): any {
|
|
64
63
|
if (isNone(t)) {
|
|
@@ -73,7 +72,7 @@ export function unwrap(t: any): any {
|
|
|
73
72
|
return t;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
export function unwrapOr<T, E
|
|
75
|
+
export function unwrapOr<T, E>(result: Result<T, E>, def: T): T;
|
|
77
76
|
export function unwrapOr<T>(some: Some<T>, def: T): T;
|
|
78
77
|
export function unwrapOr(t: any, def: any): any {
|
|
79
78
|
if (isNone(t)) {
|
|
@@ -88,10 +87,7 @@ export function unwrapOr(t: any, def: any): any {
|
|
|
88
87
|
return t;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
|
-
export function unwrapOrElse<T, E
|
|
92
|
-
result: Result<T, Error>,
|
|
93
|
-
def: () => T
|
|
94
|
-
): T;
|
|
90
|
+
export function unwrapOrElse<T, E>(result: Result<T, Error>, def: () => T): T;
|
|
95
91
|
export function unwrapOrElse<T>(some: Some<T>, def: () => T): T;
|
|
96
92
|
export function unwrapOrElse(t: any, def: any): any {
|
|
97
93
|
if (isNone(t)) {
|
package/src/scope/describe.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { assert } from "../assert.js";
|
|
1
2
|
import { getLogger } from "../log.js";
|
|
2
3
|
import { TestCase } from "./scope.js";
|
|
4
|
+
import * as state from "./state.js";
|
|
3
5
|
|
|
4
6
|
export const beforeall = Symbol("beforeAll");
|
|
5
7
|
export const beforeeach = Symbol("beforeEach");
|
|
@@ -11,9 +13,10 @@ const logger = getLogger("scope");
|
|
|
11
13
|
const CASES: TestCase = {};
|
|
12
14
|
let cases = [CASES];
|
|
13
15
|
let totalCases = 0;
|
|
16
|
+
let skippedCases = 0;
|
|
14
17
|
|
|
15
18
|
function push(title: string) {
|
|
16
|
-
const next = (cases[0][title] = {});
|
|
19
|
+
const next = (cases[0][title] = cases[0][title] ?? {}) as TestCase;
|
|
17
20
|
cases.unshift(next);
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -29,6 +32,10 @@ export function getTotalCases() {
|
|
|
29
32
|
return totalCases;
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
export function getSkippedCases() {
|
|
36
|
+
return skippedCases;
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
export function describe(title: string, block: Function) {
|
|
33
40
|
logger.debug(`describe(${title})`);
|
|
34
41
|
push(title);
|
|
@@ -38,10 +45,17 @@ export function describe(title: string, block: Function) {
|
|
|
38
45
|
|
|
39
46
|
export function it(title: string, block: Function) {
|
|
40
47
|
logger.debug(`it(${title})`);
|
|
48
|
+
assert(cases[0][title] == undefined, `Block already has test ${title}`);
|
|
41
49
|
totalCases += 1;
|
|
42
50
|
cases[0][title] = block;
|
|
43
51
|
}
|
|
44
52
|
|
|
53
|
+
it.skip = (title: string, _block: Function) => {
|
|
54
|
+
logger.debug(`it.skip(${title})`);
|
|
55
|
+
totalCases += 1;
|
|
56
|
+
skippedCases += 1;
|
|
57
|
+
};
|
|
58
|
+
|
|
45
59
|
export function beforeEach(fn: () => void) {
|
|
46
60
|
cases[0][beforeeach] = fn;
|
|
47
61
|
}
|
|
@@ -62,9 +76,5 @@ export function cleanState<State extends {}>(
|
|
|
62
76
|
init: () => State,
|
|
63
77
|
runner: (action: () => void) => void = beforeEach
|
|
64
78
|
): State {
|
|
65
|
-
|
|
66
|
-
runner(() => {
|
|
67
|
-
Object.assign(state, init());
|
|
68
|
-
});
|
|
69
|
-
return state as State;
|
|
79
|
+
return state.cleanState(init, runner);
|
|
70
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getLogger } from "../../log.js"
|
|
2
|
-
import { getTotalCases } from "../describe.js"
|
|
3
|
-
import { flattenResults } from "../execute.js"
|
|
4
|
-
import { TestResult } from "../scope.js"
|
|
1
|
+
import { getLogger } from "../../log.js"
|
|
2
|
+
import { getTotalCases } from "../describe.js"
|
|
3
|
+
import { flattenResults } from "../execute.js"
|
|
4
|
+
import { TestResult } from "../scope.js"
|
|
5
5
|
|
|
6
6
|
const logger = getLogger("Scope Test Runner");
|
|
7
7
|
|
package/src/scope/display/dom.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { isHTMLLogger, makeHTMLLogger } from "../../components/logger.js"
|
|
2
|
-
import { DOMElement
|
|
3
|
-
import { DEFAULT_LOGGER, LEVEL } from "../../log.js"
|
|
4
|
-
import { getTotalCases } from "../describe.js"
|
|
5
|
-
import { flattenResults } from "../execute.js"
|
|
6
|
-
import { TestResult } from "../scope.js"
|
|
1
|
+
import { isHTMLLogger, makeHTMLLogger } from "../../components/logger.js"
|
|
2
|
+
import { DOMElement } from "../../dom/dom.js"
|
|
3
|
+
import { DEFAULT_LOGGER, LEVEL } from "../../log.js"
|
|
4
|
+
import { getTotalCases } from "../describe.js"
|
|
5
|
+
import { flattenResults } from "../execute.js"
|
|
6
|
+
import { TestResult } from "../scope.js"
|
|
7
7
|
|
|
8
8
|
export function displayStatistics(
|
|
9
9
|
results: TestResult,
|
|
10
|
-
root:
|
|
10
|
+
root: DOMElement = document.body as DOMElement
|
|
11
11
|
) {
|
|
12
12
|
const { executed, failed } = results;
|
|
13
13
|
const logger = (() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { xml } from "../../dom/xml.js"
|
|
2
|
-
import { FlatResult, flattenResults } from "../execute.js"
|
|
3
|
-
import { TestResult } from "../scope.js"
|
|
1
|
+
import { xml } from "../../dom/xml.js"
|
|
2
|
+
import { FlatResult, flattenResults } from "../execute.js"
|
|
3
|
+
import { TestResult } from "../scope.js"
|
|
4
4
|
|
|
5
5
|
const cases = (results: TestResult) =>
|
|
6
6
|
Object.entries(results).filter(
|
package/src/scope/execute.ts
CHANGED
|
@@ -4,13 +4,10 @@ import {
|
|
|
4
4
|
beforeall,
|
|
5
5
|
beforeeach,
|
|
6
6
|
rootCases,
|
|
7
|
-
} from "./describe.js"
|
|
8
|
-
import { TestFailed, TestPassed, TestResult, TestSummary } from "./scope.js"
|
|
7
|
+
} from "./describe.js"
|
|
8
|
+
import { TestFailed, TestPassed, TestResult, TestSummary } from "./scope.js"
|
|
9
9
|
|
|
10
|
-
export async function execute(
|
|
11
|
-
prefix = "",
|
|
12
|
-
cases = rootCases()
|
|
13
|
-
): Promise<TestResult> {
|
|
10
|
+
export async function execute(cases = rootCases()): Promise<TestResult> {
|
|
14
11
|
const beforeallfn = cases[beforeall] ?? (() => {});
|
|
15
12
|
const beforeeachfn = cases[beforeeach] ?? (() => {});
|
|
16
13
|
const afterallfn = cases[afterall] ?? (() => {});
|
|
@@ -42,7 +39,7 @@ export async function execute(
|
|
|
42
39
|
result[title] = { error: /** @type Error */ e };
|
|
43
40
|
}
|
|
44
41
|
} else if (block) {
|
|
45
|
-
const run = await execute(
|
|
42
|
+
const run = await execute(block);
|
|
46
43
|
result.executed += run.executed;
|
|
47
44
|
result.passed += run.passed;
|
|
48
45
|
result.failed += run.failed;
|
|
@@ -87,7 +84,7 @@ function makeResult(
|
|
|
87
84
|
stats: { executed: 1, failed: 1 },
|
|
88
85
|
},
|
|
89
86
|
];
|
|
90
|
-
if ((result as TestPassed).passed) {
|
|
87
|
+
if ((result as TestPassed).passed === true) {
|
|
91
88
|
return [{ test, stats: { executed: 1, failed: 0 } }];
|
|
92
89
|
}
|
|
93
90
|
return flattenResults(result as TestResult, test);
|
package/src/scope/expect.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { assert } from "../assert.js"
|
|
2
|
-
import {
|
|
1
|
+
import { assert } from "../assert.js"
|
|
2
|
+
import { display } from "../display.js"
|
|
3
|
+
import { equals } from "../equal.js"
|
|
3
4
|
|
|
4
5
|
export class Matcher<T> {
|
|
5
6
|
actual: T;
|
|
@@ -15,13 +16,13 @@ export class Matcher<T> {
|
|
|
15
16
|
assert(this.actual === expected, () => `${this.actual} !== ${expected}`);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
toEqual(expected: T) {
|
|
19
|
+
toEqual(expected: T, partial = false) {
|
|
19
20
|
assert(
|
|
20
|
-
equals(this.actual, expected),
|
|
21
|
+
equals(this.actual, expected, partial),
|
|
21
22
|
() =>
|
|
22
|
-
`Objects are not equivalent: ${
|
|
23
|
-
|
|
24
|
-
)}
|
|
23
|
+
`Objects are not equivalent: ${display(this.actual)}, ${display(
|
|
24
|
+
expected
|
|
25
|
+
)}`
|
|
25
26
|
);
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -50,11 +51,11 @@ export class Matcher<T> {
|
|
|
50
51
|
// @ts-expect-error
|
|
51
52
|
const actual: Partial<T> = this.actual[k];
|
|
52
53
|
assert(
|
|
53
|
-
equals(actual, v),
|
|
54
|
+
equals(actual, v, true),
|
|
54
55
|
() =>
|
|
55
|
-
`Comparing ${k}, properties not equal: ${
|
|
56
|
-
|
|
57
|
-
)}
|
|
56
|
+
`Comparing ${k}, properties not equal: ${display(actual)}, ${display(
|
|
57
|
+
v
|
|
58
|
+
)}`
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as fs from "fs/promises";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { contentResponse } from "./response.js";
|
|
4
|
+
import { MiddlewareFactory } from "./index.js";
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import sass from "sass";
|
|
7
|
+
const { compileStringAsync } = sass;
|
|
8
|
+
|
|
9
|
+
function render(source: string) {
|
|
10
|
+
// Replace `from "@scope` with `from "/@scope`, for browsers
|
|
11
|
+
// source = source
|
|
12
|
+
// .replaceAll(`from "@`, 'from "/@')
|
|
13
|
+
// .replaceAll(`import("@`, 'import("/@');
|
|
14
|
+
return contentResponse(source, "text/css");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function compile(
|
|
18
|
+
filename: string,
|
|
19
|
+
root: string,
|
|
20
|
+
vars: string
|
|
21
|
+
): Promise<string> {
|
|
22
|
+
vars = vars.substring(1).replaceAll("=", ":");
|
|
23
|
+
filename = filename.replaceAll("\\", "/"); // Normalize for dart-sass
|
|
24
|
+
const sassString = `// Using variables: ${vars}\n${vars};\n@import "${filename}";`;
|
|
25
|
+
return (await compileStringAsync(sassString, { loadPaths: [root] })).css;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Serves .css files statically. Finds .sass files and transpiles them to css.
|
|
30
|
+
*/
|
|
31
|
+
export const cssFileServer: MiddlewareFactory =
|
|
32
|
+
async ({ root, scopes = {} }) =>
|
|
33
|
+
async (req) => {
|
|
34
|
+
const Url = new URL(req.url ?? "/", `http://${req.headers.host}`);
|
|
35
|
+
if (Url.pathname.endsWith(".css")) {
|
|
36
|
+
let scope = Object.entries(scopes).find(([s]) =>
|
|
37
|
+
Url.pathname.startsWith(`/${s}`)
|
|
38
|
+
);
|
|
39
|
+
// Expand url with found scope
|
|
40
|
+
Url.protocol = "file";
|
|
41
|
+
let url = scope ? Url.pathname.replace(scope[0], scope[1]) : Url.pathname;
|
|
42
|
+
let filename = path.join(root, url);
|
|
43
|
+
try {
|
|
44
|
+
const stat = await fs.stat(filename);
|
|
45
|
+
if (stat.isFile()) {
|
|
46
|
+
const css = (await fs.readFile(filename)).toString("utf-8");
|
|
47
|
+
return render(css);
|
|
48
|
+
}
|
|
49
|
+
} catch {}
|
|
50
|
+
|
|
51
|
+
filename = filename.replace(/\.css$/, ".scss");
|
|
52
|
+
try {
|
|
53
|
+
const stat = await fs.stat(filename);
|
|
54
|
+
if (stat.isFile()) {
|
|
55
|
+
const css = await compile(
|
|
56
|
+
filename.replace(root, "."),
|
|
57
|
+
root,
|
|
58
|
+
Url.search
|
|
59
|
+
);
|
|
60
|
+
return render(css);
|
|
61
|
+
}
|
|
62
|
+
} catch {}
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
};
|
package/src/server/http/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { AddressInfo } from "net";
|
|
|
10
10
|
import * as path from "path";
|
|
11
11
|
import { info } from "../../log.js";
|
|
12
12
|
import { findIndex } from "./apps.js";
|
|
13
|
+
import { cssFileServer } from "./css.js";
|
|
13
14
|
import { fileResponse } from "./response.js";
|
|
14
15
|
import { sitemap } from "./sitemap.js";
|
|
15
16
|
import { staticFileServer } from "./static.js";
|
|
@@ -48,6 +49,7 @@ const notFound: MiddlewareFactory =
|
|
|
48
49
|
const BASE_MIDDLEWARES: MiddlewareFactory[] = [
|
|
49
50
|
sitemap,
|
|
50
51
|
tsFileServer,
|
|
52
|
+
cssFileServer,
|
|
51
53
|
staticFileServer,
|
|
52
54
|
findIndex,
|
|
53
55
|
notFound,
|
|
@@ -65,8 +67,8 @@ const sendContent = async (
|
|
|
65
67
|
res: ServerResponse,
|
|
66
68
|
{ content, contentType, contentLength }: StaticResponse
|
|
67
69
|
) => {
|
|
68
|
-
res.setHeader("
|
|
69
|
-
res.setHeader("
|
|
70
|
+
res.setHeader("Content-Length", `${contentLength}`);
|
|
71
|
+
res.setHeader("Content-Type", contentType);
|
|
70
72
|
await res.write(content);
|
|
71
73
|
res.end();
|
|
72
74
|
return true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stats } from "fs";
|
|
2
2
|
import * as fs from "fs/promises";
|
|
3
|
-
import {
|
|
3
|
+
import { StaticResponse } from ".";
|
|
4
4
|
|
|
5
5
|
const MIME_TYPES: Record<string, string> = {
|
|
6
6
|
js: "text/javascript",
|
|
@@ -18,7 +18,9 @@ const MIME_TYPES: Record<string, string> = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const mime = (basename: string) => {
|
|
21
|
-
const extension = basename
|
|
21
|
+
const extension = basename
|
|
22
|
+
.substring(basename.lastIndexOf(".") + 1)
|
|
23
|
+
.toLowerCase();
|
|
22
24
|
return MIME_TYPES[extension] ?? "application/octet-stream";
|
|
23
25
|
};
|
|
24
26
|
|
|
@@ -34,13 +36,14 @@ export const fileResponse =
|
|
|
34
36
|
return { status, contentType, contentLength, content };
|
|
35
37
|
};
|
|
36
38
|
|
|
39
|
+
const CHARSET = "utf-8";
|
|
37
40
|
export const contentResponse =
|
|
38
41
|
(content: string, contentType: string, status: 200 | 404 | 500 = 200) =>
|
|
39
42
|
async (): Promise<StaticResponse> => {
|
|
40
|
-
const contentBuffer = Buffer.from(content,
|
|
43
|
+
const contentBuffer = Buffer.from(content, CHARSET);
|
|
41
44
|
return {
|
|
42
45
|
content: contentBuffer,
|
|
43
|
-
contentType,
|
|
46
|
+
contentType: contentType.split(";")[0] + "; charset=" + CHARSET,
|
|
44
47
|
status,
|
|
45
48
|
contentLength: contentBuffer.length,
|
|
46
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "fs/promises";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { info } from "../../log.js";
|
|
4
|
-
import { MiddlewareFactory
|
|
4
|
+
import { MiddlewareFactory } from "./index.js";
|
|
5
5
|
import { contentResponse } from "./response.js";
|
|
6
6
|
|
|
7
7
|
const findSiteMap = async (root: string, prefix = root) => {
|
package/src/server/main.ts
CHANGED
|
@@ -9,5 +9,12 @@ const FLAGS = parse(process.argv);
|
|
|
9
9
|
import { makeServer } from "./http/index.js";
|
|
10
10
|
import * as path from "node:path";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
server.
|
|
12
|
+
async function main() {
|
|
13
|
+
const server = await makeServer({ root: path.join(process.cwd(), "src") });
|
|
14
|
+
server.listen(
|
|
15
|
+
FLAGS.asNumber("port", 8080),
|
|
16
|
+
FLAGS.asString("host", "0.0.0.0")
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
main();
|
package/src/test.mjs
CHANGED
|
@@ -5,25 +5,29 @@ import { execute } from "./scope/execute.js";
|
|
|
5
5
|
import { asXML } from "./scope/display/junit.js";
|
|
6
6
|
import { onConsole } from "./scope/display/console.js";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
async function main() {
|
|
9
|
+
await import("./test_all.js");
|
|
9
10
|
|
|
10
|
-
(async function () {
|
|
11
|
-
|
|
11
|
+
(async function () {
|
|
12
|
+
const results = await execute();
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const FLAGS = parse(process.argv);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
switch (FLAGS.asString("mode", "console")) {
|
|
17
|
+
case "junit":
|
|
18
|
+
const xml = asXML(results);
|
|
19
|
+
console.log(xml);
|
|
20
|
+
break;
|
|
21
|
+
case "console":
|
|
22
|
+
default:
|
|
23
|
+
onConsole(results);
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})();
|
|
27
|
+
if (results.failed > 0) {
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
})();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
main();
|
package/src/test_all.ts
CHANGED
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
// discarded during transpilation.
|
|
3
3
|
import { describe, expect, it } from "./scope/index.js";
|
|
4
4
|
|
|
5
|
-
await Promise.all([
|
|
6
|
-
import("./context.test.js"),
|
|
7
|
-
import("./equal.test.js"),
|
|
8
|
-
import("./flags.test.js"),
|
|
9
|
-
import("./generator.test.js"),
|
|
10
|
-
import("./lock.test.js"),
|
|
11
|
-
import("./result.test.js"),
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
5
|
describe("Test executor", () => {
|
|
15
6
|
it("matches equality", () => {
|
|
16
7
|
expect(1).toBe(1);
|
|
@@ -20,3 +11,23 @@ describe("Test executor", () => {
|
|
|
20
11
|
expect(() => expect(1).toBe(2)).toThrow();
|
|
21
12
|
});
|
|
22
13
|
});
|
|
14
|
+
|
|
15
|
+
import "./context.test.js";
|
|
16
|
+
import "./diff.test.js";
|
|
17
|
+
import "./equal.test.js";
|
|
18
|
+
import "./flags.test.js";
|
|
19
|
+
import "./fs.test.js";
|
|
20
|
+
import "./generator.test.js";
|
|
21
|
+
import "./lock.test.js";
|
|
22
|
+
import "./result.test.js";
|
|
23
|
+
import "./observable/observable.test.js";
|
|
24
|
+
|
|
25
|
+
import * as components from "./components/test.js";
|
|
26
|
+
import * as dom from "./dom/test.js";
|
|
27
|
+
|
|
28
|
+
if (process?.env.CI?.toLowerCase() !== "true") {
|
|
29
|
+
(async () => {
|
|
30
|
+
await components.loadTests();
|
|
31
|
+
await dom.loadTests();
|
|
32
|
+
})();
|
|
33
|
+
}
|