diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48162a5..d56c0ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,16 +11,20 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: latest - name: Install dependencies - run: yarn install + run: npm install - name: Run tests - run: yarn run test + run: npm run test - - name: Upload reports - run: npx codecov + - name: Upload Codecov reports + uses: codecov/codecov-action@main + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.github/workflows/gh-pages-main.yml b/.github/workflows/gh-pages-main.yml index 2de32e8..47f743a 100644 --- a/.github/workflows/gh-pages-main.yml +++ b/.github/workflows/gh-pages-main.yml @@ -22,10 +22,10 @@ jobs: node-version: 16.x - name: Install dependencies - run: yarn install - + run: npm install + - name: Create build files for gh-pages deploy - run: yarn ghpages:build + run: npm run ghpages:build # Reference: https://github.com/JamesIves/github-pages-deploy-action - name: Deploy 🚀 diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 28ec290..36e5346 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -27,8 +27,8 @@ jobs: - name: Install and Build run: | - yarn install - yarn ghpages:build + npm install + npm run ghpages:build # Reference: https://github.com/rossjrw/pr-preview-action - name: Deploy preview diff --git a/README.md b/README.md index 3b25cc1..4d7970c 100644 --- a/README.md +++ b/README.md @@ -24,45 +24,45 @@ const iaItem = ; ## Local Demo with `web-dev-server` ```bash -yarn start +npm run start ``` To run a local development server that serves the basic demo located in `demo/index.html` ## Testing with Web Test Runner To run the suite of Web Test Runner tests, run ```bash -yarn run test +npm run test ``` To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run ```bash -yarn run test:watch +npm run test:watch ``` ## Linting with ESLint, Prettier, and Types To scan the project for linting errors, run ```bash -yarn run lint +npm run lint ``` You can lint with ESLint and Prettier individually as well ```bash -yarn run lint:eslint +npm run lint:eslint ``` ```bash -yarn run lint:prettier +npm run lint:prettier ``` To automatically fix many linting errors, run ```bash -yarn run format +npm run format ``` You can format using ESLint and Prettier individually as well ```bash -yarn run format:eslint +npm run format:eslint ``` ```bash -yarn run format:prettier +npm run format:prettier ``` diff --git a/demo/app-root.ts b/demo/app-root.ts index b969efe..20400c9 100644 --- a/demo/app-root.ts +++ b/demo/app-root.ts @@ -1,13 +1,13 @@ /* eslint-disable no-restricted-globals */ import { html, css, LitElement, TemplateResult } from 'lit'; import { customElement, property, query } from 'lit/decorators.js'; -import { - MetadataResponse, - SearchService, -} from '@internetarchive/search-service'; import { SharedResizeObserver } from '@internetarchive/shared-resize-observer'; import { ModalManager } from '@internetarchive/modal-manager'; import '@internetarchive/modal-manager'; +import { + MetadataResponse, + MetadataService, +} from '@internetarchive/metadata-service'; import type { ItemNavigator } from '../src/iaux-item-navigator'; import '../src/iaux-item-navigator'; import '../src/menus/share-panel'; @@ -147,7 +147,7 @@ export class AppRoot extends LitElement { @property({ type: String }) encodedManifest = ''; - @property({ attribute: false }) sharedObserver = new SharedResizeObserver(); + sharedObserver = new SharedResizeObserver(); @property({ type: Array, attribute: false }) menuContents: MenuProviderInterface[] = []; @@ -203,11 +203,11 @@ export class AppRoot extends LitElement { } async fetchItemMD() { - const searchService = SearchService.default; + const metadataService = MetadataService.default; // masterbookofamericanfolksong00shep => multiple files // ux-team-books => item - const mdResponse = await searchService.fetchMetadata( + const mdResponse = await metadataService.fetchMetadata( 'masterbookofamericanfolksong00shep', ); @@ -441,7 +441,7 @@ export class AppRoot extends LitElement { .item=${this.itemMD} .modal=${this.modalMgr} .sharedObserver=${this.sharedObserver} - .loaded=${this.loaded} + ?loaded=${this.loaded} ?viewAvailable=${!!this.showTheaterExample} .menuContents=${this.menuContents} .menuShortcuts=${this.menuShortcuts} diff --git a/demo/index.html b/demo/index.html index df5a734..c0ed03d 100644 --- a/demo/index.html +++ b/demo/index.html @@ -2,9 +2,6 @@ - - -