diff --git a/packages/extension-api-explorer/README.md b/packages/extension-api-explorer/README.md index 3f4a545fc..dbb1e3a0c 100644 --- a/packages/extension-api-explorer/README.md +++ b/packages/extension-api-explorer/README.md @@ -3,36 +3,14 @@ The API Explorer extension can be manually installed and run with a Looker instance using the following steps: 1. create a new LookML project called `apix` -2. create a new model. In `apix.model`, put: +1. create a new model. In `apix.model`, put: ```lookml connection: "" ``` -3. in `manifest.lkml` put: - ```lookml - project_name: "api-explorer" - application: api-explorer { - label: "API Explorer" - # file: "bundle.js" - url: "https://localhost:8080/dist/bundle.js" - entitlements: { - local_storage: yes - navigation: no - new_window: yes - new_window_external_urls: ["https://looker.com/*", "https://developer.mozilla.org/*", "https://docs.looker.com/*"] - raw_api_request: yes - use_form_submit: yes - use_embeds: yes - use_clipboard: yes - core_api_methods: ["versions", "api_spec"] - external_api_urls : ["https://raw.githubusercontent.com","http://localhost:30000","https://localhost:8080","https://static-a.cdn.looker.app","https://docs.looker.com","https://developer.mozilla.org/"] - oauth2_urls: [] - } - } - ``` - the `http://localhost:30000` is for when you want to use the [API Explorer file server](/apix-files/README.md) -4. save all changes and deploy to production -5. in the root of `sdk-codegen`: +1. Use the contents of the linked [`manifest.lkml`](manifest.lkml) as the project's `manifest.lkml`. The `http://localhost:30000` url is for the optional [API Explorer file server](/apix-files/README.md) +1. save all changes and deploy to production +1. in the root of `sdk-codegen`: ```sh yarn && yarn build && yarn dev:xapix ``` -6. on the Looker web page, click `Browse|API Explorer` to view the API Explorer +1. on the Looker web page, click `Browse|API Explorer` to view the API Explorer diff --git a/packages/extension-api-explorer/bin/deploy b/packages/extension-api-explorer/bin/deploy index 8f0337568..7b64230a8 100755 --- a/packages/extension-api-explorer/bin/deploy +++ b/packages/extension-api-explorer/bin/deploy @@ -28,6 +28,7 @@ rm -rf dist/ echo "Creating extension-api-explorer production bundle" yarn bundle BUNDLE=$(pwd)"/dist/bundle.js" +MANIFEST=$(pwd)"/manifest.lkml" cd "${ROOT}"/.. if [ -d "extension-api-explorer" ] @@ -42,7 +43,8 @@ fi echo "Copying extension bundle into repo" git checkout main || { echo "Error checking out branch"; exit 1; } cp "${BUNDLE}" . +cp "${MANIFEST}" . echo "Pushing changes to remote" -git add bundle.js && git commit -m "${commit_msg}" && git push || { exit 1; } +git add bundle.js manifest.lkml && git commit -m "${commit_msg}" && git push || { exit 1; } echo "The extension's bundle commit hash is:" git rev-parse HEAD diff --git a/packages/extension-api-explorer/manifest.lkml b/packages/extension-api-explorer/manifest.lkml new file mode 100644 index 000000000..428df45ef --- /dev/null +++ b/packages/extension-api-explorer/manifest.lkml @@ -0,0 +1,25 @@ +project_name: "api-explorer" + +application: api-explorer { + label: "API Explorer" + # file: "bundle.js" + url: "https://localhost:8080/dist/bundle.js" + entitlements: { + local_storage: yes + navigation: no + new_window: yes + new_window_external_urls: ["https://looker.com/*", "https://developer.mozilla.org/*", "https://docs.looker.com/*"] + raw_api_request: yes + use_form_submit: yes + use_embeds: yes + use_clipboard: yes + core_api_methods: ["versions", "api_spec"] + external_api_urls : ["https://raw.githubusercontent.com","http://localhost:30000","https://localhost:8080","https://static-a.cdn.looker.app","https://docs.looker.com","https://developer.mozilla.org/"] + oauth2_urls: [] + } +} + +constant: CONNECTION_NAME { + value: "" + export: override_optional +}