Commit Graph
45 Commits
Author SHA1 Message Date
Rubén Rincón Blanco 16dca9d307 Bring back old behaviour of 404 on missing compiler (#3981) 2022-08-25 21:51:10 +02:00
Jeremy Rifkin 4c2fe0a5ba Site templates feature (#3747)
* Baseline for the ui

* Backend system / frontend baseline

* Automated screenshot generation / integration

* added copyright

* Style improvements

* Reworked config / integrated images into webpack

* Added tree ide template and updated the screenshot generation script

* Added screenshots for each theme

* Updated screenshots to use embed mode and hide the site header

* Added test case, removed leftover console.log

* Renamed /api/getSiteTemplates to /api/siteTemplates

* Renamed site template type
2022-06-09 16:52:45 -04:00
Rubén Rincón Blanco f19bebcf4f Add 405 handlers for API endpoints (#3620) 2022-05-06 18:56:33 +02:00
RabsRincon 40fe769459 Set comma-dangle to always in server code and es5 in client code 2022-04-26 05:26:48 +02:00
Matt Godbolt 21b764f392 Unify comma configuration; and apply format to some files. (#3559) 2022-04-25 18:22:11 -05:00
Mats Larsen 9b890b1656 Refactor handling of Assembly Documentation Providers (#3247) 2022-01-31 14:05:21 +01:00
Mats Larsen d7c4eecbf7 Refactor and return 404 from AsmDocs APIs (#3143)
Refactors the handler for the AsmDocs API to reduce code duplication.

**Breaking changes proposed**

- API will now return 404. This used to return 200 with "Unknown opcode" which is what led to issue #3117. Following cases has been changed:
  1. archiecture was not found
  2. instruction opcode was not found
- API will now return 406 not acceptable when the accepted content type is not text or json
- There is no longer a `result` field on a 200 request, instead the assembly documentation object is returned.
- There is no longer a `found` field on any request, the HTTP codes indicate whether it was found or not (200 means found)

**New features**

- The frontend will only request the opcode for an instruction set at most once, caching every single outgoing request.
- The "There was an error fetching the documentation for this opcode" has been adjusted to contain what went wrong.

Relevant tests have been added and updated.
2021-12-07 11:43:08 +01:00
Mats LarsenandMatt Godbolt 53b9e0ac59 Support multiple formatter types for /api/format (#2818)
* Make /api/format handle multiple formatter types
* Ignore preferred style if the formatter is a 'one true style' formatter
* Add tests for base formatter
* Document /api/formats and /api/format/<formatter> usage
* Document adding a new formatter
* Update amazon config

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2021-08-24 18:46:38 -05:00
Mats Larsen b6c2380c56 Assembly API documentation for Java Bytecode (#2817)
* Add assembly documentation endpoint for Java bytecode
* Upstream asm docenizer for Java
* Remove jvms.html from gitattributes as it is never checked into vcs
* EOF line for docenizer-java.js
* Use find-node to locate nodejs
* Format code according to style guide
2021-08-14 12:56:33 -05:00
RabsRincon 16ff1a8a4b Add api/version and api/releaseBuild GET endpoints 2021-08-13 05:31:40 +02:00
Patrick Quist c0a45e754c Add CMake API (#2509)
And multifile support. No UI support.
2021-03-22 22:59:03 +01:00
Matt Godboltandpartouf 273017c431 Tweaks to new ASM stuff
* Update right-click menu item to be more general than x86
* mounts /asm/:arch/:opcode and handles unknown arch
* adds dummy aarch64 placeholder
* tags some stuff as aarch64
* tags some stuff as amd64
* uses a redirect from /asm/XXX -> /asm/amd64/XXX
* instructionset detection when property is not set

Co-authored-by: partouf <partouf@gmail.com>
2021-03-14 12:39:55 -05:00
Jeremy Overesch 11e470a8f7 Feature/jo/arm dockenizer (#2463)
* Update docenizer to python3
* Remove unused code in docenizer
* Create new asm-docs-arm and asm-docs-api-arm files for parsing and retrieving arm related opcodes.  Add conditional instruction switch.
* Rename docs files to specify instruction set
* Add arm32 at /api/asm/arm32/:opcode
* Add @jovere to contributor list
* Add `instructionSet` compiler option
* Update client to access correct instruction based on the `instructionSet` option
* Add `arm32` `instructionSet` option for ARM C++ compilers
* Add `arm32` instructionSet to obvious places in C/C++
2021-03-12 07:40:49 -06:00
Matt Godbolt 17b2bb8a58 Move /shortener to /api/shortener (#2426)
We still support /shortener (though will scrape logs to see when
we can remove).

The route under /api/shortener will have the CORS headers set up
properly for things like @foonathan's lexy visualiser.
2021-02-15 12:52:46 -06:00
Patrick Quist 8140936756 stop using exe field in compilers api (#2194) 2020-12-06 02:23:30 +01:00
Matt Godbolt f68198af9e Reassign copyright to Compiler Explorer Authors (#2233) 2020-09-26 17:50:40 -05:00
Austin Morton 044dcfbf88 Use ES6 Modules (#2132) 2020-09-26 16:59:26 -04:00
Patrick Quist 0f01b99846 Fix curl API (#2184)
* manually parse formdata to be compatible with curl examples

* only parse formdata when /noscript/compile, add unittests

* no need to parse formdata in these cases

* use specific handling per url
2020-09-05 12:22:44 +02:00
Partouf 6b6a9ef364 use underscore pick to filter compiler properties 2020-09-03 00:03:25 +02:00
Patrick Quist 9444b191bd extra default field to offer more backward compatibility 2020-09-02 22:56:53 +02:00
Patrick Quist ab2f8e209a Compilers API changes (#2170)
* dont return all compilerproperties always in /api/compilers

* fields=all ipv ?all

* use fields=all with remote instances

* add to documentation

* cover more paths with tests
2020-09-02 21:36:02 +02:00
Rubén Rincón BlancoandAustin Morton 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
Matt Godbolt 4cf5792491 Cache headers for API requests. Default to 5m caching. Closes #1770 2020-01-13 07:28:47 -06:00
Partouf 69a43f7fee optimizationArguments api 2019-08-13 22:15:53 +02:00
RabsRincon a492311cb5 Add a way to list all installed libraries 2019-01-28 08:22:54 +01:00
Partouf 01db837822 handlePop arg to exclude usedoptions, use separate url when needed 2019-01-21 20:17:50 +01:00
Partouf 865d217a2b test popular arguments 2018-10-26 13:33:42 +02:00
Partouf 7ba94cc687 refactor 2018-10-15 02:39:11 +02:00
Partouf 5556038e5c refactor 2018-10-15 02:36:39 +02:00
Partouf 8bb5e7d06c add defaultCompiler to api/languages, and add api/libraries 2018-10-15 02:32:31 +02:00
Partouf 27daaff30a bugfix 2018-10-02 22:04:49 +02:00
Partouf 652fd6b208 move shortlinkinfo to /api 2018-10-01 20:03:51 +02:00
RabsRincon 7c18ffe8cf Drop underscore-node in favour of underscore.js
After some suprises about how outdated the node version was compared to
	the main project, it became clear we needed to do something.
	@jaredwy suggested using the main project as there's now nothing
	stopping us from using it after the switch to webpack.

cc @mattgodbolDrop underscore-node in favour of underscore.js
2018-06-15 15:04:55 +02:00
RabsRincon bcdfd4673e Add list formatters handler test 2018-04-20 23:23:01 +02:00
RabsRincon b8c8c65020 Reimplement code formatting 2018-04-20 22:07:40 +02:00
RabsRincon 842984230d Avoid extra work for every api/languages query 2018-04-08 03:05:38 +02:00
RabsRincon 6ef87b5ef9 Fix copyright dates and normalize text 2018-02-27 14:58:21 +01:00
partouf 045c1722a0 codereview fixes + tests 2018-01-02 02:33:04 +01:00
partouf 2ef40c9151 make api match the documentation 2018-01-01 22:30:51 +01:00
RabsRincon fc75208dac New year, new date 2018-01-01 16:44:04 +01:00
Matt Godbolt d359122371 Move compile handler, add tests 2017-12-22 07:03:29 -06:00
Matt Godbolt 88a1e685e9 Slight AT&T asm doc improvement
Now uses case insensitive suffix removal. Added some tests, made
the handler an object. Partially addresses #695
2017-12-21 04:26:57 -06:00
Matt Godbolt 67e2ce1c41 Added work in progress on api tests 2017-12-19 07:55:24 -06:00
RabsRincon f529022483 Add eof newline 2017-12-12 13:00:03 +01:00
Matt Godbolt 1c3e94dbd5 Start extracting handlers into their own testable bits 2017-12-11 20:05:58 -06:00