33 Commits

Author SHA1 Message Date
Mats Jun Larsen
5eea63328f Migrate to Biome for linting and formatting (#7033) 2025-02-02 17:54:31 +00:00
Matt Godbolt
fd3dd917f5 Vitest (#6219)
Port to vitest. Port everything to typescript. Remove chai, mocha and
chai-as-promised. Adds some docs.
2024-03-08 22:25:09 -06:00
Matt Godbolt
b23e60460e Remove apparently deprecated test class in favour of the new one (#5306) 2023-07-30 19:01:16 -05:00
Patrick Quist
9b983d6965 Load and show creation_date of shortlink (#5236) 2023-07-17 23:36:36 +02:00
Matt Godbolt
2b6500203e Update to latest AWS SDK (#4818)
We're not using the new `send` functionality, but this gets everything
running and tests passing. It has _not_ been tested against real AWS
yet. That's next. I might move stuff over to the new `send` API, but
also I might not if it's just working.
2023-03-07 18:10:56 -06:00
Mats Jun Larsen
633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Matt Godbolt
a34a20e876 TSify storage-tests (#4738)
I suspect I could do better but...
2023-02-13 21:54:47 -06:00
Matt Godbolt
f2c1e0bd31 The Grand Reformat (#3643)
* The Grand Reformat

- everything made prettier...literally
- some tweaks to include a few more files, including documentation
- minor changes to format style
- some tiny `// prettier-ignore` changes to keep a few things the way we like them
- a couple of super minor tweaks to embedded document types to ensure they format correctly
2022-05-09 23:13:50 -05:00
Matt Godbolt
21b764f392 Unify comma configuration; and apply format to some files. (#3559) 2022-04-25 18:22:11 -05:00
Austin Morton
dc49b67741 Fix sinon lint warnings in tests 2021-10-03 14:16:57 -04:00
Matt Godbolt
259b72e16a Add some tests to s3 storage 2021-04-12 17:46:53 -05:00
Austin Morton
a194b5a591 Always store shortlinks with a 6 character prefix in dynamodb 2021-04-09 20:06:06 -04:00
Austin Morton
80fa894cd0 Store shortlinks with both 6 and 9 character prefixs in dynamodb 2021-04-09 17:47:14 -04:00
Matt Godbolt
6fcf5d758f Increase the number of characters in s3 URLs
We used to use 6. This gives 32^6 possible URLs.
As we increase the number of URLs the godbolt.org site
stores, the chance of an attacker being able to guess
existing URLs has increased. To stay one step ahead,
we bump to 9 characetrs here: 32^9 possible is 35 trillion
possibilities.
2021-03-21 15:06:53 -05:00
Austin Morton
044dcfbf88 Use ES6 Modules (#2132) 2020-09-26 16:59:26 -04:00
Austin Morton
dde5ef02fa Move some files in preparation for es6 modules 2020-09-23 04:30:15 -04:00
Rubén Rincón Blanco
ccff4b9ee5 Add new eslint rules (#2121)
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible

In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules

This PR attempts to not change code behavior when possible.  In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the 
code base to silence the error.  You can find these by searching for `eslint-disable-next-line`.

Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2020-08-04 16:39:02 -04:00
Rubén Rincón Blanco
1106db4939 Make url hash a base32 encode (#2062)
Avoids most of the problems present with the current base64 impl
2020-07-06 08:33:10 -04:00
Matt Godbolt
84e9b282fd Canonical URLs now https://github.com/compiler-explorer/compiler-explorer! Hooray :) 2020-05-16 11:09:30 -05:00
RabsRincon
a26cdf2cf4 Use better word for profanity check test
This is a bit more family friendly :)
2020-03-29 14:05:36 +02:00
Austin Morton
1b7fe24990 Perform some general maintenance on the test suite (#1840) 2020-02-18 00:03:15 -05:00
Rubén Rincón
a99531b14d Add i to list of banned letters
Fixes tests
2019-11-04 18:11:01 +01:00
Rubén Rincón
2364ecac75 Disallow confusing leters to appear in short urls
Closes #1661
2019-11-04 18:03:02 +01:00
Matt Godbolt
43c69be29d Moving things about to keep the host and subdomain from the original request 2019-05-31 22:03:27 -05:00
RabsRincon
13d9ab5d6d Fix Node DEP0005 2019-04-12 15:01:02 +02:00
Matt Godbolt
2011c840ce Rename thing we add as nonce, add tests. Fix logic error 2019-03-17 22:02:04 -05:00
Matt Godbolt
08cd1edc69 Use binary buffers for hash; safe64 encode results. Addresses #1056 2018-08-18 10:02:28 -05:00
RabsRincon
895369f932 Move to on-the-fly parsing 2018-08-17 21:07:51 +02:00
RabsRincon
9d02f2ed65 Restructure open graph metadata 2018-08-17 20:33:39 +02:00
RabsRincon
e31daa71c2 Try to fix page reload behaviour seen in beta 2018-08-12 20:16:35 +02:00
RabsRincon
466a53293f Move metadata to top level to make it indexable 2018-08-12 19:41:52 +02:00
RabsRincon
482f388832 Add more metadata to each link 2018-08-12 17:13:41 +02:00
Matt Godbolt
d33afe157c Add some tests. Fiddle around AWS stuff 2018-08-11 11:24:17 -05:00