-
Notifications
You must be signed in to change notification settings - Fork 192
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
feat: add source declaration links to API Explorer #578
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d410067
Resolve partial mining path to full path
jkaster 21b480b
Added type/method declaration links
josephaxisa 1fffecc
Merge branch 'jk/miner_updates' into jax/declaration-links
josephaxisa 5b44e7b
minor miner tweaks
josephaxisa 815638c
Make declaration links open in new tabs
josephaxisa f096250
Warn when lode server does not respond
josephaxisa df27d7a
Warn when lode server does not respond
josephaxisa ea67ee6
WIP Added apix-files server
jkaster 28b9f52
Moved apix-files out of packages folder
jkaster ac58fab
Source code navigation links open in new browser tabs now
jkaster 027522c
Tweaks to the miner
jkaster 4860b62
Added tooltip to source links
jkaster 00ce7ec
Address PR feedback
jkaster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,3 +70,7 @@ csharp/*.cache | |
|
||
# hackathon | ||
**/google-creds.json | ||
|
||
# apix indexes | ||
declarationsIndex.json | ||
/apix-files/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# API Explorer file server | ||
|
||
API Explorer (aka APIX) uses some JSON-formatted "index" files to augment the information provided in a specification. | ||
|
||
To use this server, clone this repository and: | ||
|
||
```sh | ||
yarn && yarn build | ||
yarn mine | ||
cd apix-files | ||
yarn serve | ||
``` | ||
|
||
This will start the API Explorer file server at `http://localhost:30000` | ||
|
||
## Mining the source code | ||
|
||
`yarn mine` runs two specific miners: | ||
- `yarn mine:examples` | ||
- `yarn mine:declarations` | ||
|
||
which are briefly explained below | ||
|
||
### Example mining | ||
|
||
The source code in this repository is mined to find examples of using the Looker SDKs. | ||
|
||
```sh | ||
yarn mine:examples | ||
``` | ||
produces [examplesIndex.json](/examplesIndex.json), which is checked in. | ||
|
||
### Declaration mining | ||
|
||
```sh | ||
yarn mine:declarations | ||
``` | ||
|
||
produces [declarationsIndex.json](/declarationsIndex.json), which is not checked in (so it will be missing unless you've modified the declaration miner configuration to find your spec implementation). | ||
This file is used internally by Looker to provide direct links from API Explorer to the source code that defines our endpoints and API types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "@looker/apix-files", | ||
"version": "21.0.11", | ||
"description": "Looker File Server for API Explorer", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"author": "Looker", | ||
"license": "MIT", | ||
"private": true, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/looker-open-source/sdk-codegen.git", | ||
"directory": "packages/sdk-codegen-utils" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/looker-open-source/sdk-codegen/issues" | ||
}, | ||
"homepage": "https://github.com/looker-open-source/sdk-codegen/tree/main/packages/sdk-codegen-utils", | ||
"keywords": [ | ||
"Looker", | ||
"SDK", | ||
"API", | ||
"Explorer", | ||
"Files" | ||
], | ||
"dependencies": { | ||
"http-server": "^0.12.3" | ||
}, | ||
"scripts": { | ||
"serve": "http-server ../ -p 30000 --cors" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to house this under
packages/
? I realize there are no dependencies in either direction but still kind of seems to me like maybe we should keep all our typescript sdk-codegen packages underpackages/
(and who knows, maybe there will be a dependency some day?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is not a monorepo package and doesn't need all the baggage associated with that. If it ever becomes something we customize, we'll move it into
packages/apix-files
. Currently, it's basically just a node script that needs to be isolated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, all those places were changed to support this so the CHANGELOG entry is appropriate.