open-index/open-npm huggingface dataset:
npm package: @principal-ai/repository-abstraction
Description: Repository and file system abstraction layer
Latest version: 0.5.7

# @principal-ai/repository-abstraction

Repository and file system abstraction layer for the Principal AI ecosystem.

## Overview

This package provides abstractions for working with file systems and repositories in a simplified tree representation, offering a unified model for hierarchical file structures.

## Key Features

- **FileTree** - Abstract tree structure representing directories and files
- **FileInfo** - Abstracted file metadata and properties
- **DirectoryInfo** - Abstracted directory metadata and properties
- **createFileTreeFromPaths** - Convert raw paths into tree abstraction
- **mergeFileTrees** - Combine multiple tree abstractions
- **GitHub URL parsing** - Parse and identify GitHub repositories from URLs

## Installation

```bash
bun install @principal-ai/repository-abstraction
```

## Usage

```typescript
import { FileTree, createFileTreeFromPaths } from '@principal-ai/repository-abstraction';

// Create a file tree from paths
const paths = [
  '/src/index.ts',
  '/src/components/Button.tsx',
  '/package.json'
];

const fileTree = createFileTreeFromPaths(paths);
```

## Development

```bash
# Install dependencies
bun install

# Build the package
bun run build

# Run tests
bun test

# Type checking
bun run typecheck

# Watch mode for development
bun run dev
```

## License

Private package - not for public distribution.
npm package: @principalstudio/html-webpack-inject-preload
Description: A HTML Webpack plugin for injecting <link rel='preload'>
Author: Principal Studio
Latest version: 1.2.7

[![npm](https://img.shields.io/npm/dw/@principalstudio/html-webpack-inject-preload)](https://www.npmjs.com/package/@principalstudio/html-webpack-inject-preload) [![node-current](https://img.shields.io/node/v/@principalstudio/html-webpack-inject-preload)](https://nodejs.org/)



# HTML Webpack Inject Preload
A [HTML Webpack Plugin](https://github.com/jantimon/html-webpack-plugin) for injecting [&lt;link rel='preload'>](https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content)

This plugin allows to add preload links anywhere you want.

# Installation

You need to have HTMLWebpackPlugin v4 or v5 to make this plugin work.

```
npm i -D @principalstudio/html-webpack-inject-preload
```

**webpack.config.js**

```js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload');

module.exports = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin(),
    new HtmlWebpackInjectPreload({
      files: [
        {
          match: /.*\.woff2$/,
          attributes: {as: 'font', type: 'font/woff2', crossorigin: true },
        },
        {
          match: /vendors\.[a-z-0-9]*.css$/,
          attributes: {as: 'style' },
        },
      ]
    })
  ]
}
```

**Options**

* files: An array of files object
  * match: A regular expression to target files you want to preload
  * attributes: Any attributes you want to use. The plugin will add the attribute `rel="preload"` by default.

**Usage**

The plugin is really simple to use. The plugin injects in `headTags`, before any link, the preload elements.

For example

```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Webpack App</title>
    <%= htmlWebpackPlugin.tags.headTags %>
  </head>
  <body>
    <script src="index_bundle.js"></script>
  </body>
</html>
```

will generate

```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Webpack App</title>
    <link href="dist/fonts/font.woff2" rel="preload" type="font/woff2" crossorigin>
    <link href="dist/css/main.css">
  </head>
  <body>
    <script src="index_bundle.js"></script>
  </body>
</html>
```
npm package: @principalstudio/principal-purgecss-extractor
Description: Principal files extractor for PurgeCSS
Author: Principal Studio
Latest version: 1.0.7

# Principal Purgecss extractor

Improve version of [purgecss-from-pug](https://github.com/FullHuman/purgecss/tree/master/packages/purgecss-from-pug) with fix and support for BEM mixins.

**Currently, only support pug files**

## Installation

```bash
npm i -D @principalstudio/principal-purgecss-extractor
```

## Usage

See [https://purgecss.com/extractors.html](https://purgecss.com/extractors.html)


For example with PostCSS

```js
const principalExtractor = require('principal-purgecss-extractor');
const purgecss = require('@fullhuman/postcss-purgecss')

module.exports = {
  plugins: [
    purgecss({
      content: ['./**/*.pug'],
      extractors: [
        {
          extractor: principalExtractor,
          extensions: ['pug'],
        },
      ],
    }),
  ]
}
```