open-index/open-npm huggingface dataset:
npm package: @lit-labs/analyzer
Description: A static analyzer for Lit
Author: Google LLC
Latest version: 0.14.0

# @lit-labs/analyzer

A static analyzer for Lit

> [!WARNING]
>
> This package is part of [Lit Labs](https://lit.dev/docs/libraries/labs/). It
> is published in order to get feedback on the design and may receive breaking
> changes or stop being supported.
>
> Please read our [Lit Labs documentation](https://lit.dev/docs/libraries/labs/)
> before using this library in production.

## Overview

This package contains static analysis utilities for analyzing source code that contain Lit templates and elements, that might be useful for other programs like linters, IDE plugins, code generators, etc.

This is a very early stage Lit Labs package and is not ready for use.

## Usage

_This section is incomplete_

### Node

```ts
import {createPackageAnalyzer} from '@lit-labs/analyzer/package-analyzer.js';
import * as path from 'path';

const packagePath = path.resolve('./my-package');
const analyzer = createPackageAnalyzer(packagePath);
const module = analyzer.getModule(
  path.resolve(packagePath, 'src/my-element.ts')
);
```

### Browser

You must use a bundler to bundle TypeScript, such as Rollup with the CommonJS plugin.

With `@rollup/plugin-commonjs` you need to ignore built-in libraries like `os`, `fs`, etc. You can isgnore these in your Rollup config:

rollup.config.js:

```ts
import commonjs from '@rollup/plugin-commonjs';

// ...
    plugins: [
      commonjs({
          ignore: (id) => ['fs', 'os', 'inspector'].includes(id),
      }),
    ],
// ...
```

You may need to install the `'path'` package:

```sh
npm i path
```

Then you can make an Analyzer using these imports:

```ts
import {Analyzer} from '@lit-labs/analyzer/lib/analyzer.js';
import {AbsolutePath} from '@lit-labs/analyzer/lib/paths.js';
import ts from 'typescript';
import * as path from 'path';

// TODO: show constructing an Analyzer in browser contexts
```

## Contributing

Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
npm package: @lit-labs/cli
Description: Tooling for Lit development
Author: Google LLC
Latest version: 0.6.6

# @lit-labs/cli

The `lit` command line tool for Lit.

The Lit CLI is a common place for utilities maintained by the Lit team.

> IMPORTANT: ⚠️ `@lit-labs/cli` is currently available only as a _pre-release_
> for early testing. Feel free to try it out, but expect occasional bugs,
> missing features, and frequent breaking changes! ⚠️

## Installation

Install globally, so you can run the `lit` command anywhere on your system:

```sh
npm i -g @lit-labs/cli
```

Or install into a project, so that the correct version is installed with other dependencies:

```sh
cd my-project
npm i -D @lit-labs/cli
```

## Commands

- [`help`](#help)
- [`localize`](#localize)
- [`labs gen`](#gen)

### `help`

Displays a help message with available commands.

#### Usage

```sh
$ lit help
```

### `localize`

Extract localization messages or build a localized application.

#### Usage

```sh
$ lit localize extract
$ lit localize build
```

### `labs gen`

Generate framework wrappers.

#### Usage

```sh
$ lit labs gen --framework=react
```

#### Flags

| Flag          | Description                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| `--framework` | Framework(s) to generate wrappers for. Supported frameworks: `react`, `vue`. Can be specified multiple times. |
| `--package`   | Folder(s) containing a package to generate wrappers for. Default: `./`. Can be specified multiple times.      |
| `--out`       | Folder to output generated packages to. Default: `./gen/`                                                     |
npm package: @lit-labs/cli-localize
Description: Implements the `lit localize` command. Use from @lit-labs/cli
Author: Google LLC
Latest version: 0.2.2

# @lit-labs/cli-localize

Powers the `lit localize` command.

Don't use this directly, but install `@lit-labs/cli` and run `lit localize` from it.

That command will load this package from the nearest node_modules directory, or offer to install it if it's not found.
npm package: @lit-labs/context
Description: Helpers and controllers for using Context protocol
Author: Google LLC
Latest version: 0.5.1

# @lit-labs/context

An implementation of the Context Protocol, that allows data to be passed down the DOM tree indirectly, without having to be passed via 'prop drilling'.

This package has graduated from labs! It is now available as `@lit/context`. This package is just a proxy that re-exports `@lit/context`. As a result, while it will no longer be updated, it will continue to work and get updates through the ^1.0.0 version range of `@lit/context`. This should reduce duplication of code while the ecosystem migrates their imports away from `@lit-labs/context`.

If you're looking at this locally or on GitHub, you can now find the README here: [README.md](../../context/README.md).

If you're looking at this online, you can also find its README on npmjs: https://www.npmjs.com/package/@lit/context
npm package: @lit-labs/gen-manifest
Description: Code generator for generating Custom Elements Manifests for Lit components
Author: Google LLC
Latest version: 0.3.5

# @lit-labs/gen-manifest

Utility library for generating a [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest) for Lit components.

For a command-line interface to using the generator, see `@lit-labs/cli`.
npm package: @lit-labs/react
Description: A React component wrapper for web components.
Author: Google LLC
Latest version: 2.1.3

# @lit-labs/react

React integration for Web Components and Reactive Controllers.

This package has graduated from labs! It is now available as `@lit/react`. This package is just a proxy that re-exports `@lit/react`. As a result, while it will no longer be updated, it will continue to work and get updates through the ^1.0.0 version range of `@lit/react`. This should reduce duplication of code while the ecosystem migrates their imports away from `@lit-labs/react`.

If you're looking at this locally or on GitHub, you can now find the README here: [README.md](../../react/README.md).

If you're looking at this online, you can also find its README on npmjs: https://www.npmjs.com/package/@lit/react
npm package: @lit-labs/rollup-plugin-minify-html-literals
Description: Rollup plugin to minify HTML template literal strings
Author: Google LLC
Latest version: 0.1.1

# @lit-labs/rollup-plugin-minify-html-literals

A Rollup plugin to minify HTML and CSS markup inside JavaScript template literal strings.

## Usage

```js
import babel from 'rollup-plugin-babel';
import minifyHTML from '@lit-labs/rollup-plugin-minify-html-literals';
import {uglify} from 'rollup-plugin-uglify';

export default {
  entry: 'index.js',
  dest: 'dist/index.js',
  plugins: [
    minifyHTML(),
    // Order plugin before transpilers and other minifiers
    babel(),
    uglify(),
  ],
};
```

By default, this will minify any tagged template literal string whose tag contains "html" or "css" (case insensitive). [Additional options](#options) may be specified to control what templates should be minified.

## Options

```js
export default {
  entry: 'index.js',
  dest: 'dist/index.js',
  plugins: [
    minifyHTML({
      // minimatch of files to minify
      include: [],
      // minimatch of files not to minify
      exclude: [],
      // set to `true` to abort bundling on a minification error
      failOnError: false,
      // minify-html-literals options
      // https://www.npmjs.com/package/minify-html-literals#options
      options: null,

      // Advanced Options
      // Override minify-html-literals function
      minifyHTMLLiterals: null,
      // Override rollup-pluginutils filter from include/exclude
      filter: null,
    }),
  ],
};
```

## Examples

### Minify Polymer Templates

```js
import minifyHTML from '@lit-labs/rollup-plugin-minify-html-literals';
import {defaultShouldMinify} from '@lit-labs/rollup-plugin-minify-html-literals/lib/minify-html-literals.js';

export default {
  entry: 'index.js',
  dest: 'dist/index.js',
  plugins: [
    minifyHTML({
      options: {
        shouldMinify(template) {
          return (
            defaultShouldMinify(template) ||
            template.parts.some((part) => {
              // Matches Polymer templates that are not tagged
              return (
                part.text.includes('<style') ||
                part.text.includes('<dom-module')
              );
            })
          );
        },
      },
    }),
  ],
};
```

# Acknowledgements

This is a combination and continuation of three previous projects:

1. [rollup-plugin-minify-html-literals](https://github.com/asyncLiz/rollup-plugin-minify-html-literals)
2. [minify html literals](https://github.com/asyncLiz/minify-html-literals)
3. [parse literals](https://github.com/asyncLiz/parse-literals)
npm package: @lit-labs/scoped-registry-mixin
Description: A mixin for using speculative "scoped CustomElementRegistry" with LitElement.
Author: Google LLC
Latest version: 1.0.4

# @lit-labs/scoped-registry-mixin

`ScopedRegistryHost` mixin for `LitElement` that integrates with the speculative [Scoped CustomElementRegistry polyfill](https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry).

> [!WARNING]
>
> This package is part of [Lit Labs](https://lit.dev/docs/libraries/labs/). It
> is published in order to get feedback on the design and may receive breaking
> changes or stop being supported.
>
> Please read our [Lit Labs documentation](https://lit.dev/docs/libraries/labs/)
> before using this library in production.
>
> Give feedback: https://github.com/lit/lit/discussions/3364

> [!WARNING]
>
> Scoped Custom Element Registries is a proposed browser API. It has not been
> finalized nor shipped in any browser. This mixin is provided to evaluate the
> proposal and facilitate feedback. Use this feature, and the polyfill in
> production code at your own risk.

## Overview

The [Scoped Custom Element Registries](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Scoped-Custom-Element-Registries.md) WICG proposal introduces new APIs for scoping custom element definitions to shadow roots, such that the mapping of tag names to custom element class doesn't rely on a single global registry.

When new elements are created within a shadow root with a scoped custom element registry, the browser will use the scoped registry rather than the global registry to look up custom element definitions. When using a scoped element registry, all used custom element elements must be defined within that scope.

`ScopedRegistryHost` adds the following features to LitElement:

1. Automatically creates a scoped CustomElementRegistry for the class
2. Provides sugar for defining custom elements in the scoped registry
3. Passes the registry to `attachShadow()` to enable scoping
4. Passes the shadow root to lit-html to create DOM within the scope

A speculative [Scoped CustomElementRegistry polyfill](https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry) is being developed. Because the proposal is not implemented natively, `ScopedRegistryHost` requires the polyfill.

## Usage

The mixin adds a declarative `static elementDefinitions` property for declaring the custom elements to be scoped locally to its Shadow DOM.

Basic usage is as follows:

```js
import {LitElement, html} from 'lit';
import {ScopedRegistryHost} from '@lit-labs/scoped-registry-mixin';

import {SimpleGreeting} from './simple-greeting.js';

class ScopedComponent extends ScopedRegistryHost(LitElement) {
  // Elements here will be registered against the tag names provided only
  // in the shadow root for this element
  static elementDefinitions = {
    'simple-greeting': SimpleGreeting,
  };

  render() {
    return html` <simple-greeting
      id="greeting"
      name="scoped world"
    ></simple-greeting>`;
  }
}
```

## Contributing

Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
npm package: @lit-labs/ssr-client
Description: Client package for @lit-labs/ssr.
Author: Google LLC
Latest version: 1.1.8

# @lit-labs/ssr-client

A set of client-side support modules for rendering Lit components and templates
on the server using `@lit-labs/ssr`.

## Overview

Package contents:

- `directives/render-light.js`: A child-position directive that invokes and
  renders the parent custom element's `renderLight` method as its value.

## Contributing

Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
npm package: @lit-labs/task
Description: A controller for Lit that renders asynchronous tasks.
Author: Google LLC
Latest version: 3.1.0

# @lit-labs/task

A controller for Lit that renders asynchronous tasks.

This package has graduated from labs! It is now available as `@lit/task`. This package is just a proxy that re-exports `@lit/task`. As a result, while it will no longer be updated, it will continue to work and get updates through the ^1.0.0 version range of `@lit/task`. This should reduce duplication of code while the ecosystem migrates their imports away from `@lit-labs/task`.

If you're looking at this locally or on GitHub, you can now find the README here: [README.md](../../task/README.md).

If you're looking at this online, you can also find its README on npmjs: https://www.npmjs.com/package/@lit/task
npm package: @lit-labs/vue-utils
Description: Utilities for generating a Vue component wrapper for a LitElement.
Author: Google LLC
Latest version: 0.1.3

# @lit-labs/vue-utils

Utilities for generating a Vue component wrapper for a LitElement.

> [!WARNING]
>
> This package is part of [Lit Labs](https://lit.dev/docs/libraries/labs/). It
> is published in order to get feedback on the design and may receive breaking
> changes or stop being supported.
>
> Please read our [Lit Labs documentation](https://lit.dev/docs/libraries/labs/)
> before using this library in production.

## Contributing

Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md).