Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
704416a
feat: add gRPC support to API endpoint documentation
alexpmule Dec 19, 2025
b244e00
feat: enhance gRPC functionality in AmfLoader
alexpmule Dec 19, 2025
d6fd2b6
6.1.3
alexpmule Dec 19, 2025
8d98af5
chore: update GitHub Actions workflow for deployment
alexpmule Dec 19, 2025
265e891
empty
alexpmule Dec 19, 2025
8215c8e
chore: remove Playwright browser installation step from deployment wo…
alexpmule Dec 19, 2025
04442e2
refactor: simplify web-test-runner configuration
alexpmule Dec 19, 2025
7b2f149
chore: update deployment workflow and web-test-runner configuration
alexpmule Dec 19, 2025
2f332e8
chore: simplify test command in deployment workflow
alexpmule Dec 19, 2025
ae466ca
chore: enhance deployment workflow with installation verification and…
alexpmule Dec 19, 2025
5e6a97a
chore: update deployment workflow to use npm install with legacy peer…
alexpmule Dec 19, 2025
d3d84bc
chore: update deployment workflow to support multiple OS and improve …
alexpmule Dec 19, 2025
6c63ef4
chore: update deployment workflow to use npm install for dependency m…
alexpmule Dec 19, 2025
6ee4702
chore: enhance deployment workflow with Playwright installation and v…
alexpmule Dec 19, 2025
0898e23
chore: optimize deployment workflow with npm cache cleaning and impro…
alexpmule Dec 19, 2025
27d72d3
chore: update deployment workflow to configure npm registry and strea…
alexpmule Dec 19, 2025
cfdce2c
chore: update package dependencies and streamline deployment workflow
alexpmule Dec 19, 2025
c64145e
chore: add Playwright browser installation step to deployment workflow
alexpmule Dec 19, 2025
83685ac
fix: update Playwright installation command in deployment workflow
alexpmule Dec 19, 2025
3a49a57
chore: enhance deployment workflow with Playwright version checks and…
alexpmule Dec 19, 2025
4bad414
chore: simplify Playwright browser installation in deployment workflow
alexpmule Dec 19, 2025
333b852
chore: update Playwright installation command in deployment workflow
alexpmule Dec 19, 2025
55bf435
chore: enhance deployment workflow with Playwright version caching an…
alexpmule Dec 19, 2025
034b07e
chore: upgrade Playwright to version 1.40.1 and update deployment wor…
alexpmule Dec 20, 2025
d9d4e78
chore: streamline deployment workflow by using npm ci and simplifying…
alexpmule Dec 20, 2025
0bfc335
chore: update deployment workflow to use actions/setup-node@v3 and en…
alexpmule Dec 20, 2025
809c4f2
chore: update package-lock.json with dependency version upgrades
alexpmule Dec 20, 2025
646efdd
small changes to deployment workflow
alexpmule Dec 20, 2025
13e3a90
chore: upgrade Playwright to version 1.57.0 in package.json and packa…
alexpmule Dec 20, 2025
f89321d
chore: update web-test-runner configuration to include CodeMirror scr…
alexpmule Dec 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 47 additions & 27 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,69 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
# os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14
- uses: microsoft/playwright-github-action@v1
- uses: actions/cache@v1
node-version: '18'
cache: 'npm'
- name: Cache Playwright browsers
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-1.57.0
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-playwright-
- name: Verify npm cache
run: npm cache verify || npm cache clean --force
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Verify Playwright browsers installation
run: ls -la ~/.cache/ms-playwright/ || echo "No playwright cache found"
- name: Run tests
run: npm test
test_win:
name: "Windows"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14
- uses: microsoft/playwright-github-action@v1
- uses: actions/cache@v1
node-version: '18'
cache: 'npm'
- name: Cache Playwright browsers
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-1.57.0
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-playwright-
- name: Verify npm cache
run: npm cache verify || npm cache clean --force
shell: pwsh
- name: Install dependencies
run: npm ci
shell: pwsh
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run tests
run: npm test
tag:
name: "Publishing release"
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
needs:
needs:
- test_linux
- test_win
runs-on: ubuntu-latest
Expand All @@ -67,17 +88,16 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: '18'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- name: Verify npm cache
run: npm cache verify || npm cache clean --force
- name: Install dependencies
run: npm ci
- name: Read version from package.json
uses: culshaw/read-package-node-version-actions@v1
id: package-node-version
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ dist/
# AMF models
/demo/*.json
!demo/apis.json

# gRPC test files
!/demo/grpc-test.json
4,490 changes: 4,490 additions & 0 deletions demo/grpc-test.json

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import '@anypoint-web-components/anypoint-checkbox/anypoint-checkbox.js';
import '@anypoint-web-components/anypoint-item/anypoint-item.js';
import '@advanced-rest-client/arc-demo-helper/arc-demo-helper.js';
import '@advanced-rest-client/arc-demo-helper/arc-interactive-demo.js';
// TODO: Update to api-navigation version with gRPC support once published (currently blocked by npm-token expiration)
// Current version (^4.2.7) doesn't support gRPC, causing workarounds in _autoSelectGrpcEndpoint() and __amfChanged()
import '@api-components/api-navigation/api-navigation.js';
import '@polymer/paper-toast/paper-toast.js';
import '@anypoint-web-components/anypoint-styles/colors.js';
Expand Down Expand Up @@ -51,6 +53,79 @@ class ComponentDemo extends ApiDemoPage {
this._serverHandler = this._serverHandler.bind(this);
}

/**
* TEMPORARY WORKAROUND: Auto-select first endpoint for gRPC APIs
*
* This method exists because the current published version of api-navigation
* doesn't support gRPC APIs and crashes when processing them.
*
* TODO: Remove this method once api-navigation is updated with gRPC support.
* The gRPC support has already been implemented in api-navigation but is pending
* publication due to npm-token expiration issues.
*
* Once api-navigation with gRPC support is published:
* 1. Remove this method
* 2. Remove the __amfChanged override below
* 3. Update package.json to use the new api-navigation version
* 4. The normal auto-selection flow will work for gRPC APIs
*/
_autoSelectGrpcEndpoint() {
if (!this.amf) {
return;
}
const webApi = this._computeWebApi(this.amf);
if (!webApi) {
return;
}

// Try multiple detection methods
const isGrpcMethod1 = typeof this._isGrpcApi === 'function' ? this._isGrpcApi(webApi) : false;
const isGrpcMethod2 = typeof this._isGrpcApi === 'function' ? this._isGrpcApi(this.amf) : false;

// Manual check: Look for endpoints and check if they have gRPC operations
const endpoints = this._computeEndpoints(webApi);

let isGrpcManual = false;
if (endpoints && endpoints.length > 0) {
const firstEndpoint = endpoints[0];
if (typeof this._isGrpcService === 'function') {
isGrpcManual = this._isGrpcService(firstEndpoint);
}
}

const isGrpc = isGrpcMethod1 || isGrpcMethod2 || isGrpcManual;

if (isGrpc) {
// Get gRPC services using the mixin's helper
let services = typeof this._computeGrpcServices === 'function'
? this._computeGrpcServices(webApi)
: null;

// Fallback to regular endpoints if gRPC services method doesn't work
if (!services || !services.length) {
services = endpoints;
}

if (services && services.length) {
const firstService = services[0];
// Auto-select the first service
this.setData(firstService['@id'], 'endpoint');
this.hasData = true;
}
}
}

/**
* TEMPORARY WORKAROUND: Override to trigger gRPC auto-selection
* TODO: Remove this override once api-navigation with gRPC support is published
*/
__amfChanged(amf) {
// @ts-ignore
super.__amfChanged(amf);
// Auto-select first endpoint for gRPC APIs
setTimeout(() => this._autoSelectGrpcEndpoint(), 100);
}

get server() {
const { serverValue, serverType, endpointId, methodId } = this;
if (serverType && serverType !== 'server') {
Expand Down Expand Up @@ -179,6 +254,7 @@ class ComponentDemo extends ApiDemoPage {

_apiListTemplate() {
return [
['grpc-test', 'GRPC Test'],
['google-drive-api', 'Google Drive'],
['multi-server', 'Multiple servers'],
['exchange-experience-api', 'Exchange xAPI'],
Expand Down
Loading