open-index/open-npm huggingface dataset:
npm package: @stratware/pathify
Description: Workspace-aware module aliasing hook for local Node packages.
Latest version: 0.1.7

# Pathify

Workspace-aware module aliasing for local Node packages. Pathify walks your project tree, builds `pathify@name` aliases for every in-development package, installs a Node resolver hook, and keeps your editor config in sync so working on multi-package workspaces feels like consuming published modules.

## Install

```bash
npm install @reaxion/pathify
```

## Quick Start

```js
const pathify = require('@reaxion/pathify')
pathify.install({ prefix: 'reaxion@' })

const reglet = require('reaxion@reglet')
```

`install()` scans your workspace, registers each package behind the configured prefix, patches Node’s module resolver, and updates `jsconfig.json` (or the path you supply) with matching `paths` entries.

## Options

```js
pathify.install({
  root: __dirname,         // defaults to process.cwd()
  namespaceDirs: ['src'],  // additional directories to scan
  roots: ['packages'],     // extra roots for custom layouts
  scanNodeModules: false,  // set true to include node_modules
  syncEditor: true,        // disable if you don’t want jsconfig updates
  editorConfigPath: './jsconfig.json'
})
```

All packages discovered under `root`, `root/src`, and any extra roots will be available via `prefix + packageName`. Scoped directories (`@scope/name`) are supported.

## API

- `pathify.install(options?)` – install the resolver hook and optionally rescan.
- `pathify.uninstall()` – remove the hook (restores the previous resolver).
- `pathify.resolve(spec)` – resolve a `pathify@` specifier to an absolute path.
- `pathify.require(spec)` – require via the Pathify resolution.
- `pathify.isInstalled()` – check whether the hook is active.
- `pathify.create(options?)` – build a standalone `Pathify` instance without installing the global hook.

## Editor Sync

Pathify writes the alias map into `jsconfig.json`/`tsconfig.json` so IntelliSense, Go-To Definition, and refactors understand the same prefixes. If you want to customize the generated config, supply `editorConfigPath` or set `syncEditor: false` and manage the file yourself.

## Why Pathify?

- Works out of the box for monorepos without `npm link` gymnastics.
- Keeps runtime + editor state aligned; no more divergent alias configs.
- Supports hot prefix swapping (`pathify.pathify.setPrefix('new@')`) with automatic config refresh.
- Safe resolver chaining: uninstalling Pathify restores the previous hook without clobbering other tools.

## License

MIT © Reaxion
npm package: @stratware/swrules
Description: Firebase security rules generator and validator for people by Stratware
Author: Team Stratware
Latest version: 0.1.1

## firerules

### Purpose

`firerules` is a small JavaScript builder for generating **Firebase Firestore security rules** programmatically. It lets you define rules in a structured way and emits a valid Firestore rules file as a string.

---

### How it works

Call the exported `firerules` function with a `define` callback.
The callback receives an object containing `match` and `helpers`, which you use to declare match blocks and allow rules.

`firerules` returns an object with a `build()` method that produces the complete Firestore rules text.

---

### Minimal usage

```js
import { firerules } from './index.js';

const rules = firerules(({ match, helpers }) => {
  match('/posts/{postId}', ({ allow }) => {
    allow('read').when(helpers.authenticated);
    allow(['create', 'update']).when(helpers.owner('ownerId'));
  });
});

console.log(rules.build());
```

---

### API summary

* **`firerules(define)`**
  Main entry point. Calls `define` with `{ match, helpers }`.

* **`match(path, buildCallback)`**
  Declares a Firestore `match` block.
  `path` must follow the builder’s Firestore-style pattern (leading slash, path segments with alphanumerics, underscores, hyphens, and `{vars}`).
  `buildCallback` receives an object exposing `allow`.

* **`allow(ops)`**
  Declares an `allow` rule inside a match block.
  `ops` may be a single operation or an array of operations.
  Chain `.when(condition)`, `.if(condition)`, or `.then(condition)` to attach the rule condition. These methods are aliases with identical behavior.

* **`helpers`**
  A collection of predefined helper expressions that can be passed to `.when()`, `.if()`, or `.then()`.

* **`build()`**
  Returns the final Firestore rules string, including:

  * `rules_version`
  * `service cloud.firestore`
  * Generated helper functions
  * All declared match blocks and rules

---

### Built-in helpers

* Authentication and identity
  `authenticated`, `uid`, `admin`, `denyAll`

* Operation state
  `creating`, `updating`, `deleting`

* Ownership
  `owner(field)`, `ownerOnCreate(field)`

* Field immutability and change control
  `immutable(fields[])`, `changedOnly(fields[])`, `unchanged(fields[])`

* Field presence constraints
  `fieldsOnly(fields[])`, `fieldsAtLeast(fields[])`

* Size limits
  `maxArray(field, size)`, `maxString(field, size)`

* Composition and utilities
  `pathVarEquals(varName, expr)`, `and(...)`, `or(...)`, `not(cond)`

---

### Important details

* Valid operations are: `read`, `get`, `list`, `create`, `update`, `delete`, `write`.
  The `write` operation expands to `create`, `update`, and `delete`.

* Helper expressions are de-duplicated. Identical expressions are emitted once as generated Firestore functions:

  ```text
  function f_xxx() { return <expr>; }
  ```

* The builder logs warnings when:

  * A very large number of match blocks is produced
  * The generated rules text exceeds approximately 200 KB

---