npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@search-api-decoupled/client

v2.5.4

Published

UI client for the drupal search-api-decoupled ecosystem

Downloads

1,934

Readme

Search API decoupled / client

This app is meant to be UI agnostic search client for Search API decoupled module.

It's built with React and Typescript. And it expects to get layouts, regions, config, custom elements and results from the backend.

The app expects 3 interfaces:

  • window.drupalSettings.search_api_endpoint: for the ui and app config
  • the layout markup: for the region portals and rendering
  • the custom elements: attached separately as a library that reads the entrypoints and renders widgets

The rendering of elements is done using the tags provided by the backend or divs, on production, this app is totally independent and only expects the config, the backend responses and the layout markup.

The app will be used in the search api decoupled ui drupal module in order to consume the search api decoupled backend module, anyhow, it could also be used in decoupled websites as a static asset, config should still be provided via window variable.

More documentation can be found in the wiki for the project: https://git.drupalcode.org/project/search_api_decoupled_client/-/wikis/home

Local Setup

You only need to follow these steps to get the app running in your local machine.

  1. Cloning the monorepo:
  2. For development, you should use a UI library:
    • by default @search-api-decoupled/ui is used
    • soon we will also use @search-api-decoupled/wc-ui as a default custom element library
    • if you want to use another library change the dependency in package.json and ensure you add the required js and css files in public/index.html so they are available during development
    • if you are using custom element library update the mocks in elements.ts or use the decoupled layout on the development server settings
  3. Install app dependencies:
    • nvm use && npm i
  4. Development server:
    • we use mocked environments, there are npm commands offering the following:
      • use npm run dev to mock the config (RECOMMENDED) (you can adapt it in elements.ts and layouts.ts)
      • use npm run start to run the app without mocked config, you will need to set the window variable drupalSettings.search_api_endpoint with the config you want to use
    • you will be able to access your app under http://localhost:3000/
  5. Development tools
    • the development settings modal will be prompted by default until you specify the host to use as backend
    • the host can be local or external, but should have CORS open for the app to work
    • you can use the development tools in order to change host, layout, input, pager, results widgets and so on at any moment