Added MDN docs command #20

Closed
DedShotTM wants to merge 10 commits from mdn into dev
DedShotTM commented 2020-04-23 19:48:59 -04:00 (Migrated from gitlab.libraryofcode.org)
There is no content yet.
DedShotTM commented 2020-04-24 03:49:24 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

  • 3c86875e - Deleted mdn.ts because it's in the wrong place

Compare with previous version

added 1 commit <ul><li>3c86875e - Deleted mdn.ts because it&#39;s in the wrong place</li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=335&start_sha=6be5c2d48c496ab66d3780041e7384f71f094acc)
DedShotTM commented 2020-04-24 03:50:52 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

  • 399a32a4 - Changed location of mdn.ts to the correct one

Compare with previous version

added 1 commit <ul><li>399a32a4 - Changed location of mdn.ts to the correct one</li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=336&start_sha=3c86875e200f096cfe03a026ae6b18ca6ea2aecb)
DedShotTM commented 2020-04-24 03:51:51 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

  • 28783684 - Delete mdn.ts cuz its still in the wrong place

Compare with previous version

added 1 commit <ul><li>28783684 - Delete mdn.ts cuz its still in the wrong place </li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=337&start_sha=399a32a48b0a3f9a29ccfebb97e7b41acab5b6a3)
DedShotTM commented 2020-04-24 03:52:58 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

Compare with previous version

added 1 commit <ul><li>933e5805 - correct location 2</li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=338&start_sha=28783684f7084f10497283ace9dfd59a8c9c0b49)
DedShotTM commented 2020-04-28 07:57:54 -04:00 (Migrated from gitlab.libraryofcode.org)

It's not working out perfectly yet, so please don't merge request.
It worked at first, but then I discovered some problems I hadn't seen before.

It's not working out perfectly yet, so please don't merge request. It worked at first, but then I discovered some problems I hadn't seen before.
matthew commented 2020-04-30 19:46:16 -04:00 (Migrated from gitlab.libraryofcode.org)

Let me know when this is ready for review.

Let me know when this is ready for review.
DedShotTM commented 2020-05-05 06:54:43 -04:00 (Migrated from gitlab.libraryofcode.org)

The API that I was going to use for this command seems to be back up online again, so this is ready for review.

The API that I was going to use for this command seems to be back up online again, so this is ready for review.
DedShotTM commented 2020-05-05 06:55:44 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

  • b9f789e6 - mdn command returns help when no args specified

Compare with previous version

added 1 commit <ul><li>b9f789e6 - mdn command returns help when no args specified</li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=351&start_sha=933e58051dbb1b9ff558c8b9715c61b18ab7b1e5)
DedShotTM commented 2020-05-09 22:33:37 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

  • cd86c3f7 - used await instead of .then().catch() (KhaaZ)

Compare with previous version

added 1 commit <ul><li>cd86c3f7 - used await instead of .then().catch() (KhaaZ)</li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=355&start_sha=b9f789e62836401d27b751964caabe8ea1a20aef)
Khaazz commented 2020-05-12 15:49:49 -04:00 (Migrated from gitlab.libraryofcode.org)

I guess this whole parsing here is just ugly. But this would need quite a lot of changes and this should work so I guess it will do

I guess this whole parsing here is just ugly. But this would need quite a lot of changes and this should work so I guess it will do
Khaazz commented 2020-05-12 15:50:00 -04:00 (Migrated from gitlab.libraryofcode.org)

approved this merge request

approved this merge request
Bsian commented 2020-05-16 19:42:44 -04:00 (Migrated from gitlab.libraryofcode.org)

Include a type definition here please

Include a type definition here please
Bsian commented 2020-05-16 19:44:32 -04:00 (Migrated from gitlab.libraryofcode.org)

Also following try catch is useless

      const { data } = await axios.get(`https://mdn.pleb.xyz/search?q=${args[0]}`);
Also following try catch is useless ```suggestion:-0+7 const { data } = await axios.get(`https://mdn.pleb.xyz/search?q=${args[0]}`); ```
Bsian commented 2020-05-16 19:47:26 -04:00 (Migrated from gitlab.libraryofcode.org)

What's with the replacing? All it does is just switch them around

What's with the replacing? All it does is just switch them around
Bsian commented 2020-05-16 19:51:45 -04:00 (Migrated from gitlab.libraryofcode.org)
      data.Summary = data.Summary.replace(/<code>|<\/code>/g, '`');
      data.Summary = data.Summary.replace(`/<strong>|<\/strong>/g, '**');`
```suggestion:-0+3 data.Summary = data.Summary.replace(/<code>|<\/code>/g, '`'); data.Summary = data.Summary.replace(`/<strong>|<\/strong>/g, '**');` ```
Bsian commented 2020-05-16 20:03:57 -04:00 (Migrated from gitlab.libraryofcode.org)

Could probably just do this without checking if there's an actual URL, since all you're doing is just replacing

Could probably just do this without checking if there's an actual URL, since all you're doing is just replacing
Bsian commented 2020-05-16 20:04:40 -04:00 (Migrated from gitlab.libraryofcode.org)
Apply same changes as https://gitlab.libraryofcode.org/engineering/communityrelations/-/merge_requests/7#note_960 please
Bsian commented 2020-05-16 20:05:40 -04:00 (Migrated from gitlab.libraryofcode.org)
      embed.setURL(`https://developer.mozilla.org${data.URL}`);
```suggestion:-0+0 embed.setURL(`https://developer.mozilla.org${data.URL}`); ```
Bsian commented 2020-05-16 20:06:38 -04:00 (Migrated from gitlab.libraryofcode.org)

Include command in index.ts export please

Include command in index.ts export please
Bsian commented 2020-05-16 20:07:40 -04:00 (Migrated from gitlab.libraryofcode.org)

Would rather this in a separate PR tbh

Would rather this in a separate PR tbh
Bsian commented 2020-05-16 20:07:51 -04:00 (Migrated from gitlab.libraryofcode.org)

This isn't github. MR*

This isn't github. MR*
Bsian commented 2020-05-16 20:10:27 -04:00 (Migrated from gitlab.libraryofcode.org)

Also update your branch please, see instructions in !6

Also update your branch please, see instructions in !6
DedShotTM commented 2020-05-17 18:05:26 -04:00 (Migrated from gitlab.libraryofcode.org)

Try it, it will error

Try it, it will error
Bsian commented 2020-05-17 20:37:36 -04:00 (Migrated from gitlab.libraryofcode.org)

Just checked, you are correct here, it will automatically add the prefix if you didn't include it. However the error being caused is due to a bug, this should be fixed separately

Just checked, you are correct here, it will automatically add the prefix if you didn't include it. However the error being caused is due to a bug, this should be fixed separately
DedShotTM commented 2020-05-18 23:53:47 -04:00 (Migrated from gitlab.libraryofcode.org)

Nah it's used to check if the API works/doesn't return a error code

Nah it's used to check if the API works/doesn't return a error code
DedShotTM commented 2020-05-18 23:57:12 -04:00 (Migrated from gitlab.libraryofcode.org)
@matthew
matthew commented 2020-05-19 00:20:07 -04:00 (Migrated from gitlab.libraryofcode.org)

Agreed, but what's the purpose of this again?

Agreed, but what's the purpose of this again?
Bsian commented 2020-05-19 05:32:01 -04:00 (Migrated from gitlab.libraryofcode.org)

The handle error function is used to log any unexpected errors and disable the command, what you're doing is sending 2 error messages, and either way we will need logs for when this happens.

The handle error function is used to log any unexpected errors and disable the command, what you're doing is sending 2 error messages, and either way we will need logs for when this happens.
Bsian commented 2020-05-20 06:49:15 -04:00 (Migrated from gitlab.libraryofcode.org)

changed this line in version 9 of the diff

changed this line in [version 9 of the diff](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=372&start_sha=cd86c3f7ee5f0f0ddd935ffbbdcd8f48fe7d7b75#e6e665728cb8c58ddc3a27b0080a754af8c00c8c_36_36)
Bsian commented 2020-05-20 06:49:19 -04:00 (Migrated from gitlab.libraryofcode.org)

added 1 commit

  • d71a1590 - Apply suggestion to src/commands/mdn.ts

Compare with previous version

added 1 commit <ul><li>d71a1590 - Apply suggestion to src/commands/mdn.ts</li></ul> [Compare with previous version](/engineering/communityrelations/-/merge_requests/7/diffs?diff_id=372&start_sha=cd86c3f7ee5f0f0ddd935ffbbdcd8f48fe7d7b75)
DedShotTM commented 2020-05-26 19:39:36 -04:00 (Migrated from gitlab.libraryofcode.org)

Will be totally rewrote

Will be totally rewrote
DedShotTM commented 2020-05-26 19:39:38 -04:00 (Migrated from gitlab.libraryofcode.org)

closed

closed

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: engineering/community-relations#20
There is no content yet.