1. 05 Feb, 2021 2 commits
  2. 03 Feb, 2021 6 commits
    • Robert Knight's avatar
      Add license and description to frontend-shared package · d90a4519
      Robert Knight authored
      All npm packages should have a license, and yarn complains if there
      isn't one. The license chosen here is the same as in the client's
      package.json.
      d90a4519
    • Robert Knight's avatar
      Generate `.d.ts` files as part of the frontend-shared package · 480b6d77
      Robert Knight authored
      Generate TypeScript definition files as part of the frontend-shared
      package so that TS can typecheck code that uses the package in other
      projects. Within the client repository we don't need to generate these files
      because TypeScript will read the JSDoc comments. When the package is
      consumed from other projects however, it seems that it does not read the
      JSDoc comments. Note that when these `.d.ts` files exist, they are used in preference
      to JSDoc comments by other code in the client repository. Therefore they
      need to be kept up to date when the files are recompiled in watch mode.
      
      In the process of adding this I discovered an issue that the method of
      running CLI commands in gulp tasks in `scripts/gulp/frontend-shared.js` did not
      fail if the exit status was non-zero. I created a `run` utility that
      handles this correctly along with providing the desired defaults.
      480b6d77
    • Robert Knight's avatar
      898e61b8
    • Robert Knight's avatar
      Adjust glob used to exclude frontend-shared tests from typechecking · f9b33888
      Robert Knight authored
      Change the glob to allow for `test/` dirs inside subdirectories of
      `frontend-shared/src`.
      f9b33888
    • Robert Knight's avatar
      Do not instrument `frontend-shared/lib` for code coverage · ce0f4599
      Robert Knight authored
      This directory contains the compiled version of code from `frontend-shared/src`.
      Only the source should be instrumented.
      ce0f4599
    • Robert Knight's avatar
      Move `useElementShouldClose` and `normalizeKeyName` into frontend-shared package · 9aa02026
      Robert Knight authored
      `useElementShouldClose` is a useful generic hook for implementing non-modal dialogs. We
      also use it in the LMS frontend, so it makes sense to share the implementation.
      
      This function depends on `normalizeKeyName`, so I moved that as well.
      
      `useElementShouldClose` also depended on a `listen` helper. This helper
      is not currently used by any other code so I moved it into
      `use-element-should-close.js` as a non-exported helper function and
      simplified it.
      
      In the process I found it was necessary to change the gulp task that
      builds the frontend-shared/lib/ directory to handle subdirectories under
      frontend-shared/src/.
      9aa02026
  3. 02 Feb, 2021 5 commits
  4. 01 Feb, 2021 12 commits
  5. 29 Jan, 2021 2 commits
  6. 26 Jan, 2021 11 commits
    • Kyle Keating's avatar
      34062d5d
    • Kyle Keating's avatar
      Add svg-icon to frontend-shared package · a6b77079
      Kyle Keating authored
      - Add babel presets for frontend-shared to transpile js/jsx
      - Add `build` script to transpile frontend-shared and output sourcemaps and transpiled js code to /lib
      - Add frontend-shared /src/index.js as a way to serve as a root import location for the frontend-shared lib
      - Fix up frontend-shared/package.json so publishing will work as expecting and include only intended files
      - Add a browserify config in the frontend-shared package.json file so that driving client will be able to bundle it and still import svg and html files that are nested inside /frontend-shared/src
      - Add svg-icon to serve as the first shared js component
      - Move several .svg files into the lib that are relaxant for testing svg-icon that also seem share-worthy
      - Make modifications to ensure that typechecking, linting, and testing all work as expected and ignore /lib folder
      - Change karma config so that tests will automatically run on /frontend-shared, driven from the client's gulp command
      - Added new gulp tasks to help with building and linking the frontend-shared package so that is it fully transparent with existing tooling
      - Add gulp-babel and gulp-sourcemaps packages to help with build tasks for /frontend-shared that are necessary for symlinking / building the package
      - Used new SvgIcon sidebar/index.js as a tester. This requires making two copies of registerIcons while we make the transition. Replacing all call sites of SvgIcon would be too large for an already overwhelming commit
      a6b77079
    • Kyle Keating's avatar
      Add frontend-shared sub-package · dff5882f
      Kyle Keating authored
      - Add basic bare bones frontend-shared package as a sub-package, not a workspace since they can not be "public"
      - Move the mixin/focus.scss file into this package
      - Update scss @use dependencies to reference the new package (this will point to node_module/@hypothesis/frontend-shared/... location)
      dff5882f
    • Eduardo Sanz García's avatar
      Added shadow DOM example page · daf40260
      Eduardo Sanz García authored
      This page will allow us to investigate if it is possible to capture the
      selection event from outside the shadow DOM, and if so, how can we do
      it.
      daf40260
    • Lyza Danger Gardner's avatar
      Move `service-config` into `config` · d2c75c20
      Lyza Danger Gardner authored
      d2c75c20
    • Lyza Danger Gardner's avatar
      Move `host-config` to `config` · e4d696a0
      Lyza Danger Gardner authored
      e4d696a0
    • Lyza Danger Gardner's avatar
      Move `fetch-config` to `config` · 3bcb6981
      Lyza Danger Gardner authored
      3bcb6981
    • Lyza Danger Gardner's avatar
      Move `get-api-url` to `config` · 921bbff2
      Lyza Danger Gardner authored
      Also: update tests for modern syntax
      921bbff2
    • Robert Knight's avatar
      Fix `decayingInterval` mock returning wrong result type · 0f765928
      Robert Knight authored
      The real function returns a function. The mock returned a number. This
      happened not to cause a failure currently but it could break with future
      changes in Preact.
      0f765928
    • Robert Knight's avatar
      Fix incorrect use of `assert.isEmpty()` in UI tests · b0fa3aee
      Robert Knight authored
      `assert.isEmpty()` checks the size of an array, map or set or counts the
      number of keys on an object. It doesn't know how to check that an Enzyme
      wrapper produced no output. `assert.isEmpty(wrapper)` passes due to
      implementation details of the Enzyme wrapper - it behaves like an object
      with no properties. However it _always_ passes regardless of the number of
      nodes in the wrapper, which is not the intended behavior here.
      b0fa3aee
    • Robert Knight's avatar
      Change `style` prop from string to object. · eb354982
      Robert Knight authored
      String styles are a Preact-specific feature which is likely to go away in future.
      Pass an object instead.
      eb354982
  7. 25 Jan, 2021 2 commits