Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3 #470

Draft
wants to merge 182 commits into
base: master
Choose a base branch
from
Draft

Version 3 #470

wants to merge 182 commits into from

Commits on Aug 8, 2020

  1. refactor(server): move most server code to be self-contained

    Move configuration for TypeScript, configuration for NYC, and tests to
    inside of the server/ directory.
    ethanwu10 committed Aug 8, 2020
    Configuration menu
    Copy the full SHA
    e18d060 View commit details
    Browse the repository at this point in the history
  2. feat(client): add initial client webpack setup

    Hoist shared TS ESLint config options to project root
    
    Import from react / use react types to make typescript happy.
    
    Add prefresh config: Webpack 5 support for prefresh has not yet landed,
    but set up the configuration anyways.
    ginkoid authored and ethanwu10 committed Aug 8, 2020
    Configuration menu
    Copy the full SHA
    f45e55f View commit details
    Browse the repository at this point in the history
  3. chore: clean up lint & config

    Split lint script into separate server and client lint jobs, use `types`
    option in tsconfig to restrict global type loading, explicitly define
    `process.env` in client.
    ethanwu10 committed Aug 8, 2020
    Configuration menu
    Copy the full SHA
    99eda61 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2020

  1. feat(client): initial storybook/jest setup

    Roll back to Webpack 4 because Storybook does not support Webpack 5 for
    the near future (see
    storybookjs/storybook#11326 (comment)).
    
    Use @storybook/react (which includes React as a dependency) instead of
    Preact because the Storybook build breaks when using theme-ui (most
    likely because of the bundled React dependency).
    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    7db6f0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1df715a View commit details
    Browse the repository at this point in the history
  3. feat(client): finish setting up Jest

    Factor out Babel config to babel.config.js so Jest can also use it. Also
    set up globals handled by ProvidePlugin in Jest.
    
    @types/history@2 added as a dependency to force yarn to not hoist
    @types/history@^4.7 required by @types/reach__router, which is required
    by storybook somewhere. This ensures TypeScript resolves 'history' as
    @types/history@^4.7 instead of history@^5, which would otherwise happen
    if yarn hoisted @types/history.
    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    664c787 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    474b680 View commit details
    Browse the repository at this point in the history
  5. refactor(server): switch to Jest for tests

    Jest is running with TypeScript Babel preset to transpile server code
    and run against the TS sources; as a result, the leaderboard worker
    needed to be mocked out, since worker_process bypasses the transpiler.
    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    b9aa83b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b116605 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fff6b23 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8b37554 View commit details
    Browse the repository at this point in the history
  9. fix: fix CI jobs harder

    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    e174530 View commit details
    Browse the repository at this point in the history
  10. fix: fix CI jobs harderer

    Always run codecov collect step if the tests ran (regardless of success
    / failure), and run client tests too.
    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    6f1df1b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2ae2d84 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d49195d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c75672f View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    5e02035 View commit details
    Browse the repository at this point in the history
  15. ci: enable jest color

    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    e949f32 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    0032e9a View commit details
    Browse the repository at this point in the history
  17. refactor: clean up typescript config

    Use project references for server (source and test), and also pull
    shared config options up where possible.
    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    55f5aaf View commit details
    Browse the repository at this point in the history
  18. refactor(server): modularize config loading

    Split config loading steps into individual exported functions; this
    allows for fine-grained control over config in tests by mocking the
    `load` module. Tests are set up to load config from its own conf.d, but
    inherit critical environment settings like database connections from the
    current (actual) config.
    ethanwu10 committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    7e398c0 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2020

  1. Configuration menu
    Copy the full SHA
    87ed1ab View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b210dbe View commit details
    Browse the repository at this point in the history
  3. fix(client): switch snapshot renderer

    Use preact-render-to-string since preact-render-to-json does not
    actually render components in Preact X. Also add stories for navbar
    components.
    ethanwu10 committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    90b1456 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    65a3f69 View commit details
    Browse the repository at this point in the history
  5. chore: improve Jest config

    Make client Jest config explicitly specifiy CWD for babel, so it can be
    run from any directory. Set top-level `test` script to use `--projects`,
    and also add a pre-commit hook to run Jest in only-changed mode.
    ethanwu10 committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    7e3f39a View commit details
    Browse the repository at this point in the history
  6. test(server): improve config mocking

    Use mock factory to ensure config mocking works in all environments;
    this fixes crashes with the full app startup integration test (and
    therefore also fixes CI tests). Also add `--forceExit` to lint-staged
    command.
    ethanwu10 committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    23c36eb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    16bc62c View commit details
    Browse the repository at this point in the history
  8. fix: fix watch:ts script

    ginkoid committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    2980861 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    eb77872 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2020

  1. Configuration menu
    Copy the full SHA
    83a7ce5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e067e5f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2bfff94 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    457e43b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a81e70d View commit details
    Browse the repository at this point in the history
  6. feat(client): improve TextInput

    Add handler for `invalid` event, clear user-agent styles on invalid, and
    make cursor when mousing over empty TextInput more consistent.
    ethanwu10 committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    b33c821 View commit details
    Browse the repository at this point in the history
  7. feat(client): add disabled state to TextInput

    Also fix label positioning when TextInput has content - this now uses an
    extra span for positioning.
    ethanwu10 committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    1610960 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6cd54ad View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    71d6bd2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    df58df8 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b44a247 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e3a9a60 View commit details
    Browse the repository at this point in the history
  13. chore: run Jest pre-commit hook in CI mode

    This ensures that missing snapshots fail the pre-commit hook
    ethanwu10 committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    24b90a9 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e3b4a24 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    27e04b9 View commit details
    Browse the repository at this point in the history
  16. docs: add env config docs

    ginkoid committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    e85d3f3 View commit details
    Browse the repository at this point in the history
  17. refactor(client): update stories to Args/Controls format

    Update storybook to release 6.0.2, and use new Args CSF in stories. Also
    set default values in component function declarations instead of using
    `??` for defaults.
    ethanwu10 committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    ce2d5ba View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1a24905 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    c74913b View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2020

  1. Configuration menu
    Copy the full SHA
    7bd5af1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c299a9 View commit details
    Browse the repository at this point in the history
  3. chore: fix package.json details

    Fix license and author information
    ethanwu10 committed Aug 12, 2020
    Configuration menu
    Copy the full SHA
    9520783 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2020

  1. Configuration menu
    Copy the full SHA
    3bf1e24 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b3316e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aedff6d View commit details
    Browse the repository at this point in the history
  4. refactor: use lerna / yarn workspaces

    Move all sources to exist as packages linked through lerna / yarn
    workspaces.
    
    Most lint / test dependencies are kept in the top-level package.json.
    
    Code changes:
    - server now recursively searches its parent directories for a conf.d if
      the path is not explicitly provided
    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    7099384 View commit details
    Browse the repository at this point in the history
  5. fix: fix dev scripts

    Running a build is now a prerequisite for the `dev` script (instead of
    being invoked directly).
    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    66ebeb7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    02bb0da View commit details
    Browse the repository at this point in the history
  7. ci: fix migrate script

    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    6b6d870 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6513503 View commit details
    Browse the repository at this point in the history
  9. fix(build): fix Dockerfile

    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    45b0cbb View commit details
    Browse the repository at this point in the history
  10. fix(build): improve Docker build

    Update Node version, use Alpine for prepare step, and pretty-print the
    final package.json.
    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    4c45b3c View commit details
    Browse the repository at this point in the history
  11. ci: run Docker build (but don't push) on all CI runs

    This change should ensure that the Docker build isn't broken by PRs.
    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    63f0bd7 View commit details
    Browse the repository at this point in the history
  12. fix(deps-dev): clean up root devDeps

    Copy Babel deps used by Jest to root, and move webpack loaders to
    client.
    ethanwu10 committed Aug 16, 2020
    Configuration menu
    Copy the full SHA
    64f6b71 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2020

  1. build(client): centralize Babel config

    Load Storybook Babel config from main client babel.config.js, and move
    react-refresh plugin to be inline inside the webpack config (since that
    is the only place where it is used).
    
    This fixes Storybook failing to load stories.
    
    Also enable bugfixes mode in @babel/preset-env for smaller bundle sizes.
    ethanwu10 committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    29fc9ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e710a02 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6571b22 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    874fc3a View commit details
    Browse the repository at this point in the history
  5. Merge pull request #487 from redpwn/refactor/lerna

    refactor: use lerna / yarn workspaces
    ethanwu10 authored Aug 17, 2020
    Configuration menu
    Copy the full SHA
    918efce View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0dce9f7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    64acb2f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5254025 View commit details
    Browse the repository at this point in the history
  9. fix(client): fix @types/history hoist-blocking dep

    @types/history must be kept at an outdated / incompatible version to
    prevent hoisting of @types/reach__router#@types/history to root; fix
    this, and add a typechecking job to CI.
    ethanwu10 committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    f29c931 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    78643eb View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    84bb072 View commit details
    Browse the repository at this point in the history
  12. Merge pull request #495 from redpwn/feature/card

    feat(client): add Card component
    ethanwu10 authored Aug 17, 2020
    Configuration menu
    Copy the full SHA
    0989e42 View commit details
    Browse the repository at this point in the history
  13. feat(client): login card

    chen-robert authored and ethanwu10 committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    ac2b981 View commit details
    Browse the repository at this point in the history
  14. feat(client): add form handling to login card

    This ensures pressing Enter on the input will work as intended.
    ethanwu10 committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    3f1f216 View commit details
    Browse the repository at this point in the history
  15. fix(client): improve LoginCard styling

    Add more space in card, and make CTF title a prop. Also adjust theme to
    use base preset.
    ethanwu10 committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    673e400 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2020

  1. refactor(client): clean up LoginCard styling

    Use Box with margin top instead of abusing grid for positioning recover
    link, and disable submit button when no code has been entered.
    ethanwu10 committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    864e7ce View commit details
    Browse the repository at this point in the history
  2. feat(client): improve base theme styles

    Add hover / click styles to links, set cursor to pointer on buttons.
    ethanwu10 committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    47c62aa View commit details
    Browse the repository at this point in the history
  3. fix(client): prevent layout shift with showError on TextInput

    When showError is true, always display the div for the error message,
    even if the message is currently empty, to minimize layout shift when an
    error appears.
    ethanwu10 committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    7303a3d View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2020

  1. fix(client): add pre-commit hook to check snapshots

    Fix an un-updated snapshot from previous commit, and add snapshot tests
    explicitly to test in pre-commit hook. This may cause a duplicate test
    run of snapshot tests, but it seems the majority of the time, the
    snapshot test does *not* run when it should.
    ethanwu10 committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    6472557 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2622ec0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dbdf0fa View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8fcf458 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3328c1d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a83ad67 View commit details
    Browse the repository at this point in the history
  7. Merge branch 'refactor/ts-leaderboard' of https://github.com/redpwn/rctf

     into refactor/ts-leaderboard
    ginkoid committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    ca479c9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    218cc5e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ad13e16 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2020

  1. Configuration menu
    Copy the full SHA
    7bb882f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e373240 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'refactor/ts-leaderboard' of https://github.com/redpwn/rctf

     into refactor/ts-leaderboard
    ginkoid committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    2ab5425 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    efe9a32 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cd573a3 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #496 from redpwn/feat/login-card

    Add login card
    ethanwu10 authored Aug 20, 2020
    Configuration menu
    Copy the full SHA
    d253c67 View commit details
    Browse the repository at this point in the history
  7. fix(server): misc cleanup + const enum support

    Pull out common Redis client options into object, use const enum for
    Opaque tag type, and set up Jest / Babel to support const enums. Also
    add the Babel plugin to client build.
    ethanwu10 committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    5aa1596 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    22e1dc8 View commit details
    Browse the repository at this point in the history
  9. Merge pull request #500 from redpwn/refactor/ts-leaderboard

    refactor(server): refactor all cache and leaderboard to use TS
    ethanwu10 authored Aug 20, 2020
    Configuration menu
    Copy the full SHA
    1158945 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2020

  1. Configuration menu
    Copy the full SHA
    b7248bf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5a1c111 View commit details
    Browse the repository at this point in the history
  3. chore: revert Prettier formatting on HTML

    Prettier messes with our HTML (which contains Mustache templating, EJS,
    templating, and code which must be minified) unacceptably; revert this.
    ethanwu10 committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    fd8b2ba View commit details
    Browse the repository at this point in the history
  4. ci: add Prettier job

    ethanwu10 committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    2ce782b View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2020

  1. Merge pull request #499 from redpwn/chore/formatting-overhaul

    chore: formatting overhaul
    ethanwu10 authored Sep 9, 2020
    Configuration menu
    Copy the full SHA
    1608e9c View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2020

  1. build(deps): update dependencies

    Important major version upgrades:
    typescript 3.9.7 -> 4.0.2
    ethanwu10 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    2a49693 View commit details
    Browse the repository at this point in the history
  2. docs: fix markdown syntax

    Pipes inside inline code are interpreted literally by python-markdown,
    but are interpreted as table separators by Prettier. Switch to placing
    the pipes outside the inline code so both Prettier and mkdocs parse them
    the same.
    ethanwu10 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    17d89ec View commit details
    Browse the repository at this point in the history
  3. ci: enforce commit message conventions on PRs

    Add script to run in CI on pull request to enforce commit message
    summary lines match the conventions specified in CONTRIBUTING.md.
    ethanwu10 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    aa642f5 View commit details
    Browse the repository at this point in the history
  4. docs: update branch naming conventions

    Remove branch name examples with prefixes / conventions that are no
    longer used.
    ethanwu10 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    01cce9f View commit details
    Browse the repository at this point in the history
  5. fix(ci): fix refs for commit check job

    Use full commit SHAs as arguments and fetch the entire git history in
    the commit message check CI job. Also make sure the script dies
    correctly if the `git log` command fails.
    ethanwu10 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    725e859 View commit details
    Browse the repository at this point in the history
  6. docs: add docs for sponsors cards

    Added description about the options that were missing.
    
    Cherry-picked and squashed from PR #520
    
    Co-authored-by: Ethan Wu <[email protected]>
    pr0PM and ethanwu10 committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    72127ff View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2020

  1. Merge pull request #522 from redpwn/ci/commit-check

    ci: enforce commit message conventions
    ethanwu10 authored Sep 11, 2020
    Configuration menu
    Copy the full SHA
    b6fe3a2 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #523 from redpwn/docs/sponsor-card

    docs: add docs for sponsors cards
    ethanwu10 authored Sep 11, 2020
    Configuration menu
    Copy the full SHA
    d14e66e View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2020

  1. ci: update node to 14

    Docker images use node 14, so update CI jobs to match.
    ethanwu10 committed Sep 16, 2020
    Configuration menu
    Copy the full SHA
    ac4da21 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2020

  1. Merge pull request #528 from redpwn/ci/update-node

    ci: update node to 14
    ethanwu10 authored Sep 17, 2020
    Configuration menu
    Copy the full SHA
    8b44d87 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2020

  1. fix(server): fix type on cache leaderboard.getRange

    `division` was incorrectly marked as required.
    ethanwu10 committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    5d5b8b5 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2020

  1. test(server): switch to inline snapshots

    Change restrict exception snapshots to be inline.
    ethanwu10 committed Nov 9, 2020
    Configuration menu
    Copy the full SHA
    6b3fd01 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b5f0a3 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2020

  1. test(server): add some restrict test cases

    No coverage change, but add tests that would catch substring-only
    matchers that don't ensure that there are no extra bits in emails.
    ethanwu10 committed Nov 25, 2020
    Configuration menu
    Copy the full SHA
    4dcffb9 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2021

  1. fix(server): fix type on leaderboard cache args

    `division` was incorrectly marked as required in `getRange` and
    `getGraph`.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    5e11701 View commit details
    Browse the repository at this point in the history
  2. fix(server): correct nullability on some argument types

    Some functions' arguments which were typed using properties of `User`
    inadvertently copied those properties as being potentially undefined;
    fix this via `NonNullable`/`SetRequired`.
    
    `getUserByNameOrCtftimeId`, which needs at least one of `name` or
    `ctftimeId`, has not been properly typed and is currently left as both
    properties nullable.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    c9b564f View commit details
    Browse the repository at this point in the history
  3. fix(server): allow partial object when updating challenge

    Change types for `updateChallenge` to allow a partial `Challenge`
    object.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    65ec330 View commit details
    Browse the repository at this point in the history
  4. build(types): set up api-type builder

    Ignore file shenanigans: duplicate api-types ignore rules to root with
    correct paths, symlink root eslintignore into each (relevant) package
    directory, and run the code generation in the CI lint job so linting of
    other packages has correct type information.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    e660662 View commit details
    Browse the repository at this point in the history
  5. feat(server): implement route handler helpers

    Implement `makeFastifyRoute` to create a fastify route object from a
    route object and a handler function.
    
    The handler function takes the same arguments as before, except with an
    added `res` property which contains factory functions for all valid
    response kinds.
    
    Schema transformer for fast-json-schema removes the entire schema when
    there is a `oneOf` at the top level with `rawJson`, because
    fast-json-schema does not support it, and pushes the `oneOf` down for
    standard format responses.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    7aa257a View commit details
    Browse the repository at this point in the history
  6. feat(server): add route configuration and a few definitions

    A small set of routes and responses added by hand for testing.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    5f1d5d9 View commit details
    Browse the repository at this point in the history
  7. feat(server): autogenerate responses and routes

    Generated responses do not have schemas (some were added manually);
    schemas still need to be written for most responses.
    
    Generated routes do not have permissions.
    
    Co-authored-by: Robert Chen <[email protected]>
    ethanwu10 and chen-robert committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    70b6c2f View commit details
    Browse the repository at this point in the history
  8. refactor(server): migrate route handlers + write schemas

    BREAKING:
    - GET /leaderboard/graph -> changed success response kind for route from
      `goodLeaderboard` to `goodLeaderboardGraph`
    - GET /users/me -> changed success response kind for route from
      `goodUserData` to `goodUserSelfData`
    - GET /admin/challs -> changed success response type for route from
      `goodChallenges` to `goodAdminChallenges`
    - GET /admin/challs/:id -> changed success response type for route from
      `goodChallenges` to `goodAdminChallenge`
    
    Other:
    - DELETE /admin/challs/:id -> Removed `void` response payload.
    - Also typed user utilities.
    
    Routes in the registration flow have not been converted to TS yet due to
    issues with typing their implementation - they are migrated to the new
    route declaration mechanism, but remain as JS.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    c0a086b View commit details
    Browse the repository at this point in the history
  9. refactor(server): finalize migration

    Migrate API fastify plugin, tests, and delete old responses file.
    
    Refactored helper functions to export utilities to allow the use of
    response factories outside of routes; changed how the casting of the
    factory return methods is done.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    bdff9a2 View commit details
    Browse the repository at this point in the history
  10. feat(server): allow for overriding of route schemas

    Merge the `schema` property on the `extraOptions` argument of
    `makeFastifyRoute` to allow for schemas with constraints based on
    config.
    
    Also move some object-related utility functions into util/object, and
    add tests.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    7273fb5 View commit details
    Browse the repository at this point in the history
  11. fix(server): add back config-based parameter constraints

    Add back elements of request parameter schemas which were based on
    server config.
    ethanwu10 committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    13e9e8a View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2021

  1. Configuration menu
    Copy the full SHA
    5c5100d View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2021

  1. fix(server): add periods to all response messages

    Add periods to response messages which were lacking them.
    ethanwu10 committed Jan 19, 2021
    Configuration menu
    Copy the full SHA
    4c26f5d View commit details
    Browse the repository at this point in the history
  2. fix(server): ensure failure responses are in schemas

    For response kinds which are not part of the declared route (`badBody`
    and `errorInternal`, which both should not occur when the API is used
    correctly and is functioning correctly, and thus aren't included in the
    definitions for generating types), ensure they are added to the response
    schema fed to fast-json-stringify when appropriate.
    
    Without this, such implicit kinds which contain `data` can fail to
    serialize correctly.
    ethanwu10 committed Jan 19, 2021
    Configuration menu
    Copy the full SHA
    46b5074 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6dbf4f5 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2021

  1. Merge pull request #544 from redpwn/refactor/api-types

    Put API route definitions and types into a shared package
    ethanwu10 authored Jan 20, 2021
    Configuration menu
    Copy the full SHA
    3e73b55 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2021

  1. Configuration menu
    Copy the full SHA
    c80d1c9 View commit details
    Browse the repository at this point in the history
  2. refactor(server): clean up getting array element types

    When getting the element type of an array type, use `Type[number]` where
    applicable. One instance of `ArrayValue` in database/util.ts was kept
    to work with the type potentially not being an array.
    ethanwu10 committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    7e02306 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2021

  1. Merge pull request #552 from redpwn/refactor/array-index

    refactor(server): clean up getting array element types
    chen-robert authored Mar 28, 2021
    Configuration menu
    Copy the full SHA
    c04a945 View commit details
    Browse the repository at this point in the history
  2. build(deps): batch dependency upgrade (incomplete)

    Batch upgrade dependencies and fix a few low-hanging-fruit issues
    (mostly types related). Major upgrade to webpack 5 (storybook currently
    broken as a result).
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    e665e4d View commit details
    Browse the repository at this point in the history
  3. build(client): webpack config improvements

    Load preact/debug automatically, and add some other small improvements.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    1aceeba View commit details
    Browse the repository at this point in the history
  4. build(client): add size-plugin

    Add size-plugin in production builds with writing to file disabled.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    1e4ec09 View commit details
    Browse the repository at this point in the history
  5. fix(client): fix jest config for new jsx runtime

    Make sure new runtime entrypoints are properly aliased, and remove
    redundant / now unused global definitions.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    a6a0611 View commit details
    Browse the repository at this point in the history
  6. build(client): initial sb6.2/builder-webpack5 migration

    Migrate to storybook 6.2 beta with webpack 5 builder.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    9100cd1 View commit details
    Browse the repository at this point in the history
  7. build(client): fix SB emotion conflicts

    Storybook uses emotion v10 while theme-ui uses v11, causing conflicts
    (see system-ui/theme-ui#1530). Work around this by aliasing emotion
    packages to the v11 equivalents inside storybook's manager.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    b3aedfc View commit details
    Browse the repository at this point in the history
  8. fix(client): update Card for theme-ui 0.6

    Update tests to test when running theme-ui both with and without CSS
    variables, update Card to use functional form of ThemeProvider theme and
    also update `rawColors` accordingly when theme-ui is running with CSS
    variables.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    3ec9d47 View commit details
    Browse the repository at this point in the history
  9. test(client): remove storyshots due to bad output

    Currently the effort of maintaining storyshots snapshots is not worth
    the benefit they give due to the low quality of the snapshots produced
    from Preact (shallow rendering often doesn't render the important parts,
    and internal props from various libraries tend to leak out; using enzyme
    and emotion's seralizer has a whole other set of issues including no
    top-level fragments and implementation detail leakage; hooks at the top
    level in the story function seem to crash all test renderers). Remove
    storyshots entirely for now.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    ff6c56f View commit details
    Browse the repository at this point in the history
  10. build(deps): remove unnecessary @types/history

    We used to have an outdated @types/history to prevent hoisting of the
    dep on @types/history from @types/reach__router (see commit f29c931);
    however, now @types/reach__router does not depend on @types/history, so
    we can safely remove it without breaking type resolution for `history`
    proper.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    c9c6ea1 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    60be0ed View commit details
    Browse the repository at this point in the history
  12. fix(api-types): make sure schemas are not modified by compiler

    json-schema-to-typescript seems to mutate the schema it's compiling, so
    clone it before passing it to the `compile()` function to ensure nothing
    on the original gets modified. This fixes `id` properties mysteriously
    showing up.
    ethanwu10 committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    eb667ce View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2021

  1. fix(deps): add missing dep from server to @rctf/api-types

    Also remove empty `dependencies` in root package.json
    ethanwu10 committed Mar 29, 2021
    Configuration menu
    Copy the full SHA
    0e66f7e View commit details
    Browse the repository at this point in the history
  2. Merge pull request #559 from redpwn/dependencies/batch

    batch dependency upgrade + related fixes
    ethanwu10 authored Mar 29, 2021
    Configuration menu
    Copy the full SHA
    4594c42 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2021

  1. build(deps): upgrade to yarn 2

    No package version changes, only Yarn 2 migration (without pnp)
    ethanwu10 committed May 9, 2021
    Configuration menu
    Copy the full SHA
    66e57e1 View commit details
    Browse the repository at this point in the history
  2. build(deps): upgrade most deps

    A few majors held back for another commit, Prettier re-run; theme-ui was
    upgraded with a breaking deprecation that will be fixed in the next
    commit.
    ethanwu10 committed May 9, 2021
    Configuration menu
    Copy the full SHA
    72a1577 View commit details
    Browse the repository at this point in the history
  3. test(client): update deprecated theme-ui key

    `useCustomProperties` is now under `theme.config`.
    ethanwu10 committed May 9, 2021
    Configuration menu
    Copy the full SHA
    e67f2e6 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2021

  1. build: update tooling for yarn 2

    Fix CI and Docker build to use yarn 2 commands, run `yarn dedupe` on
    pre-commit and CI, and update a few more configs for yarn 2 paths and
    conventions.
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    c348869 View commit details
    Browse the repository at this point in the history
  2. chore: update git config for yarn 2

    Disable diffs and auto merging on vendored yarn code, disable diffs on
    yarn.lock, and remove .yarn/sdks from repo.
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    b4eaf41 View commit details
    Browse the repository at this point in the history
  3. fix(server): sync request serializer with upstream

    Merge in changes to Fastify request log serializer from upstream
    Fastify. This fixes a deprecation warning.
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    4682e1e View commit details
    Browse the repository at this point in the history
  4. test(client): use screen queries

    Instead of using the object returned by `render`, query using the global
    `screen` as recommended by Kent C. Dodds.
    https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    f2623b1 View commit details
    Browse the repository at this point in the history
  5. test(client): use getBy* when target is expected to exist

    Since the `getBy*` functions throw when they cannot find an element,
    prefer them for querying for elements that should exist (except when the
    test is explicitly for whether or not the element exists). This removes
    most of the null checks in the test code.
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    a8318fc View commit details
    Browse the repository at this point in the history
  6. build: remove cross-env

    Since yarn 2 uses an internal shell parser[1] which supports environment
    variables, we no longer need to use cross-env for cross-platform
    environment variable setting.
    
    [1]: https://github.com/yarnpkg/berry/tree/%40yarnpkg/shell%2F2.4.1/packages/yarnpkg-shell
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    4e693ba View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    35c8258 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    de549a1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1c9b6f2 View commit details
    Browse the repository at this point in the history
  10. build(docker): docker build bugfixes

    Fix .yarn being included twice, add dockerignore entries for yarn to
    hopefully prevent some churn (using the ignore list recommended for
    PnP zero-install).
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    f5e28fe View commit details
    Browse the repository at this point in the history
  11. refactor(server): derive handler type off of FastifyInstance

    When casting the handler functions exported from individual routes,
    derive the target type by inspecting the `route` method of the
    FastifyInstance we are registering them on. Since we adjust the instance
    type to better match `http.Server`, this fixes a type mismatch that
    appears when compiling on some platforms when trying to register the
    handlers.
    ethanwu10 committed May 10, 2021
    Configuration menu
    Copy the full SHA
    b0c5d50 View commit details
    Browse the repository at this point in the history
  12. Merge pull request #566 from redpwn/dependencies/yarn-2-batch

    migrate to yarn 2 + batch dependency upgrade
    ethanwu10 authored May 10, 2021
    Configuration menu
    Copy the full SHA
    d5b7219 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2021

  1. fix(docs): small error

    0xflotus authored and ethanwu10 committed May 27, 2021
    Configuration menu
    Copy the full SHA
    1a144b1 View commit details
    Browse the repository at this point in the history
  2. docs: add support discord link

    ginkoid authored and ethanwu10 committed May 27, 2021
    Configuration menu
    Copy the full SHA
    bd66c14 View commit details
    Browse the repository at this point in the history
  3. docs: clarify rcds in readme

    ginkoid authored and ethanwu10 committed May 27, 2021
    Configuration menu
    Copy the full SHA
    105c1f7 View commit details
    Browse the repository at this point in the history
  4. docs: fix restricted divisions example

    dwang authored and ethanwu10 committed May 27, 2021
    Configuration menu
    Copy the full SHA
    ee7433c View commit details
    Browse the repository at this point in the history
  5. feat(server): rank users with only tiebreakEligible: false

    Break ties between users with solves on challenges not marked
    `tiebreakEligible: false` the same, but also rank users with only solves
    on challenges marked `tiebreakEligible: false` via solve times on those
    challenges. This does not change existing rankings, but adds users with
    only solves on these challenges to the leaderboard as well.
    
    Co-authored-by: Philip Papurt <[email protected]>
    ethanwu10 and ginkoid committed May 27, 2021
    Configuration menu
    Copy the full SHA
    6ea38c0 View commit details
    Browse the repository at this point in the history
  6. refactor(server): hide leaderboard intermediate info

    Remove intermediate calculation bookkeeping data from the types returned
    out of the leaderboard worker. This change also strips the data from the
    objects, resulting in the creation of a new JS object per leaderboard
    entry, but keeps snapshots cleaner. We may wish to consider doing this
    in only snapshot serialization in the future.
    ethanwu10 committed May 27, 2021
    Configuration menu
    Copy the full SHA
    459e651 View commit details
    Browse the repository at this point in the history
  7. refactor(server): leverage narrowing on cache typing

    Small refactor of implementation of leaderboard cache `getRange` to
    leverage type narrowing on the range parameters to eliminate a pair of
    casts. Also restrict the `all` parameter to `true` only.
    ethanwu10 committed May 27, 2021
    Configuration menu
    Copy the full SHA
    edd3fda View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2021

  1. Merge pull request #572 from redpwn/chore/cherrypick-master

    chore: cherry-pick changes from master
    chen-robert authored Jun 3, 2021
    Configuration menu
    Copy the full SHA
    f07ce6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0340e71 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c7177be View commit details
    Browse the repository at this point in the history
  4. Merge pull request #574 from redpwn/refactor/improve-cache-typing

    refactor(server): leverage narrowing on cache typing
    chen-robert authored Jun 3, 2021
    Configuration menu
    Copy the full SHA
    a0db61c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7073b67 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8f9a369 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #573 from redpwn/chore/backport-543

    chore: backport ranking users with only tiebreakEligible: false
    chen-robert authored Jun 3, 2021
    Configuration menu
    Copy the full SHA
    57cfb66 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2021

  1. refactor(server): remove cast for now-fixed fastify bug

    `fastify-static`'s types have been fixed, making the previous cast
    unnecessary now; remove it.
    ethanwu10 committed Jun 16, 2021
    Configuration menu
    Copy the full SHA
    d2bcc01 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2021

  1. test(server): fix test config endTime being in past

    Previously `endTime` was set to 2021-06-10, which is now in the past and
    causing tests regarding flag submission to fail since the CTF is now
    closed. Year 3000 should be good enough right?
    ethanwu10 committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    eedd1e8 View commit details
    Browse the repository at this point in the history