open-index/open-npm huggingface dataset:
npm package: @react-pug/react-pug-core
Description: Shared transformation and mapping engine for the `react-pug` toolchain.
Latest version: 0.1.15

# @react-pug/react-pug-core

Shared transformation and mapping engine for the `react-pug` toolchain.

This package is the low-level core used by:

- `@react-pug/typescript-plugin-react-pug`
- `@react-pug/babel-plugin-react-pug`
- `@react-pug/swc-plugin-react-pug`
- `@react-pug/esbuild-plugin-react-pug`
- `@react-pug/eslint-plugin-react-pug`

## Install

```bash
npm i @react-pug/react-pug-core
```

## What It Provides

- extraction of `pug\`...\`` template regions from JS/TS files
- compilation of Pug to JSX/TSX-compatible output
- shadow document generation for editor tooling
- source range and diagnostic remapping back to original Pug locations
- compiler-facing source map generation for downstream transforms

## Main Exports

- `transformSourceFile(...)`
- `buildShadowDocument(...)`
- `createTransformSourceMap(...)`
- mapping helpers from `mapping`, `positionMapping`, and `diagnosticMapping`

## Common Options

Core transforms expose:

- `tagFunction`: tagged template function name, default `pug`
- `requirePugImport`: boolean, default `false`
- `removeTagImport`: boolean, default `true`
- `classShorthandProperty`: `auto | className | class | styleName`
- `classShorthandMerge`: `auto | concatenate | classnames`
- `startupjsCssxjs`: `never | auto | force`
- `componentPathFromUppercaseClassShorthand`: boolean, default `true`

When `removeTagImport` is enabled, used `pug` imports are removed from transformed/shadow output. If the removed specifier was the only runtime import from that module, the declaration is rewritten to a side-effect import.

## Intended Audience

Most users should use one of the higher-level packages instead of consuming this package directly.

Use this package directly if you are building:

- an editor integration
- a custom compiler adapter
- a lint/diagnostic pipeline that needs original Pug positions

## Notes

Published output is in `dist/`.
npm package: @react-pug/swc-plugin-react-pug
Description: Programmatic SWC helper for transforming `pug\`...\`` tagged template literals before passing code to SWC.
Latest version: 0.1.15

# @react-pug/swc-plugin-react-pug

Programmatic SWC helper for transforming `pug\`...\`` tagged template literals before passing code to SWC.

## Install

```bash
npm i -D @react-pug/swc-plugin-react-pug @swc/core
```

## Usage

```ts
import { transformWithSwcReactPug } from '@react-pug/swc-plugin-react-pug'

const result = transformWithSwcReactPug(sourceCode, fileName, {
  jsc: {
    parser: { syntax: 'typescript', tsx: true },
    transform: { react: { runtime: 'automatic' } }
  },
  sourceMaps: true
})
```

## Options

- `tagFunction`: tagged template function name, default `pug`
- `mode`: `runtime | languageService`, default `runtime`
- `requirePugImport`: boolean, default `false`
- `classShorthandProperty`: `auto | className | class | styleName`
- `classShorthandMerge`: `auto | concatenate | classnames`
- `startupjsCssxjs`: `never | auto | force`
- `componentPathFromUppercaseClassShorthand`: boolean, default `true`

Used `pug` import bindings are removed from transformed output automatically.

## Exports

- `transformWithSwcReactPug(...)`
- `transformReactPugSourceForSwc(...)`
- diagnostic/range remapping helpers

Published output is in `dist/`.
npm package: @react-pug/typescript-plugin-react-pug
Description: TypeScript language-service plugin for `pug\`...\`` tagged template literals in React files.
Latest version: 0.1.15

# @react-pug/typescript-plugin-react-pug

TypeScript language-service plugin for `pug\`...\`` tagged template literals in React files.

## Install

```bash
npm i -D @react-pug/typescript-plugin-react-pug
```

## tsconfig.json

```json
{
  "compilerOptions": {
    "plugins": [
      { "name": "@react-pug/typescript-plugin-react-pug" }
    ]
  }
}
```

## Important

This is a TypeScript language-service plugin. It is used by editor hosts such as VS Code TypeScript support. Plain `tsc` does not execute language-service plugins during a normal CLI build.

For VS Code users, the `vscode-react-pug-tsx` extension already wires this plugin into the editor host.

## Config Options

The plugin accepts the same core options exposed by the VS Code extension:

- `enabled`
- `diagnostics.enabled`
- `tagFunction`
- `requirePugImport`: boolean
- `injectCssxjsTypes`: `never | auto | force`
- `classShorthandProperty`: `auto | className | class | styleName`
- `classShorthandMerge`: `auto | concatenate | classnames`
- `componentPathFromUppercaseClassShorthand`: boolean

When `requirePugImport` is enabled, the plugin reports an editor diagnostic if a file uses the configured tag without importing it explicitly. Used `pug` imports are removed from the shadow document to avoid false unused-import diagnostics.

Published output is in `dist/`.