1.0.24 • Published 5 months ago

@yaro.page/nano-db v1.0.24

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

šŸ“– Nano-DB Usage Guide

This guide covers how to set up, manage, and use the nano-db package, a lightweight database abstraction for the nanoweb ecosystem.

šŸ“Œ Project Structure

The nano-db package follows a modular structure:

nano-db/
ā”œā”€ā”€ lib/            # Source code
│   ā”œā”€ā”€ Manifest.js
│   ā”œā”€ā”€ ManifestChange.js
│   ā”œā”€ā”€ ManifestNode.js
│   ā”œā”€ā”€ ManifestNodes.js
│   ā”œā”€ā”€ NANODb.js
│   ā”œā”€ā”€ NANODbOptions.js
│   ā”œā”€ā”€ SearchEntries.js
│   ā”œā”€ā”€ SearchEntry.js
│   ā”œā”€ā”€ SearchIndex.js
│   ā”œā”€ā”€ index.js
ā”œā”€ā”€ test/           # Test files
|   ā”œā”€ā”€ 00-README.md.test.js  # Document generator and tester
│   ā”œā”€ā”€ Manifest.test.js
│   ā”œā”€ā”€ NANODb.test.js
ā”œā”€ā”€ package.json    # Package metadata and scripts
ā”œā”€ā”€ vitest.config.js # Vitest configuration
└── README.md      # This documentation

šŸ”— Requirements

  1. Node.js runtime environment You must have Node v22+ installed.
  2. pnpm package manager You must have the pnpm package manager installed.
  3. nano-format The nano-format package is a peer dependency and must be installed.

šŸ”§ Setting Up the Package

  1. Install the package:

    pnpm add nano-db
  2. Install peer dependencies:

    pnpm add nano-format
  3. Build the package:

    pnpm build

šŸš— Running the Development Environment

  • Start the development server:

    pnpm dev
  • Run tests:

    pnpm test
  • Build the package:

    pnpm build
  • Lint the code:

    pnpm lint

šŸ”„ Managing Dependencies & Versions

Updating Dependencies

Before committing, ensure all workspace dependencies are resolved:

pnpm ws:latest

To use workspace versions during development:

pnpm ws:workspace

Checking for Issues Before Commit

pnpm ws:check

šŸ— Releasing the Package

  1. Ensure all changes are committed and pushed.
  2. Run the release script:
    pnpm release
    This will:
    • Run tests and linting
    • Build the package
    • Tag the new version in Git
    • Publish to npm
    • Push commits and tags

šŸ›ø Contributing

  1. Create a new branch:
    git checkout -b feature/my-update
  2. Make changes and commit:
    git commit -m "Add new feature"
  3. Push your branch and open a pull request.

āš™ļø Useful Utility Scripts

CommandDescription
pnpm buildBuild the package (generates documentation)
pnpm testRun tests
pnpm lintLint the code
pnpm devStart development server
pnpm releaseRelease the package
pnpm ws:checkValidate package.json & pre-commit hooks
pnpm ws:latestReplace workspace:* with actual versions
pnpm ws:workspaceConvert all versions to workspace:*

šŸ› ļø Troubleshooting

  • Dependency Issues: Run pnpm install and pnpm ws:latest.
  • Build Errors: Ensure nano-format is installed and run pnpm build.
  • Test Failures: Check test files and run pnpm test.
  • Pre-commit Hook Failures: Verify .husky/pre-commit and run pnpm ws:check.

With these steps, you can efficiently use and maintain nano-db! šŸš€

1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

5 months ago

1.0.22

5 months ago

1.0.21

5 months ago

1.0.20

5 months ago

1.0.24

5 months ago

1.0.23

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago