From f78266e0c3b922d4635d52551b318c672f647fbd Mon Sep 17 00:00:00 2001 From: Steven Vandevelde Date: Fri, 15 Dec 2023 14:52:09 +0100 Subject: [PATCH] docs: write readmes --- README.md | 21 ++++++++------------- package.json | 15 ++++----------- packages/nest/package.json | 4 ++-- packages/nest/readme.md | 22 ++++++++++++++-------- packages/nest/src/class.ts | 3 +++ 5 files changed, 31 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 3c07f9d..b0bd037 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,25 @@ -__⚠️ Work in progress!__ +# Nest 🪺 -A layer around the `wnfs` package that provides a `FileSystem` class, transactions, a root tree and some other essentials. +A layer around the `wnfs` package that provides a `FileSystem` class, a root tree, mounts, transactions and some other essentials. -## Features - -- A file system class that allows for an easy-to-use mutable API. -- A transaction system, rewinding the state if an error occurs. -- Creates a private forest automatically with a RSA modules using the Web Crypto API (supported on multiple platforms) +_More info in the [package readme](https://github.com/wnfs-wg/nest/tree/main/packages/nest/readme.md)._ ## Packages -- [package1](https://github.com/fission-codes/js-template/tree/master/packages/package1) - description -- [package2](https://github.com/fission-codes/js-template/tree/master/packages/package2) - description +- [nest](https://github.com/wnfs-wg/nest/tree/main/packages/nest) - The primary `nest` package. ## Examples -- [`demo`](https://github.com/fission-codes/js-template/tree/master/examples/demo) - description +- [`demo`](https://github.com/wnfs-wg/nest/tree/main/examples/demo) - A simple demo of how the `nest` package is used. ### Checkout examples -You can use Codesandbox and start hacking right away. +You can use Codesandbox and start hacking right away. To clone it locally: ```bash -npx tiged fission-codes/js-template/examples/demo demo +npx tiged wnfs-wg/nest/examples/demo demo cd demo pnpm install pnpm dev @@ -36,7 +31,7 @@ You can try any of the examples by replacing `demo` with the name of the example Read contributing guidelines [here](.github/CONTRIBUTING.md). -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/hd-template/examples) +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/wnfs-wg/nest) ## License diff --git a/package.json b/package.json index cb58484..5afe20b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,8 @@ { - "name": "js-template", + "name": "@wnfs-wg/nest-root", "version": "0.0.0", "private": true, - "workspaces": [ - "packages/*", - "examples/*" - ], + "workspaces": ["packages/*", "examples/*"], "packageManager": "pnpm@8.6.1", "engines": { "node": ">=18" @@ -40,11 +37,7 @@ }, "prettier": "@fission-codes/eslint-config/prettier.config.js", "eslintConfig": { - "extends": [ - "@fission-codes" - ], - "ignorePatterns": [ - "docs" - ] + "extends": ["@fission-codes"], + "ignorePatterns": ["docs"] } } diff --git a/packages/nest/package.json b/packages/nest/package.json index e216c1a..ada914f 100644 --- a/packages/nest/package.json +++ b/packages/nest/package.json @@ -1,7 +1,7 @@ { - "name": "package1", + "name": "@wnfs-wg/nest", "type": "module", - "version": "0.0.1", + "version": "0.1.0", "description": "Example package description.", "author": "Steven Vandevelde (tokono.ma)", "license": "(Apache-2.0 AND MIT)", diff --git a/packages/nest/readme.md b/packages/nest/readme.md index f17148c..e0d8dbf 100644 --- a/packages/nest/readme.md +++ b/packages/nest/readme.md @@ -1,23 +1,29 @@ -# Package 1 +# Nest 🪺 [![npm (scoped)](https://img.shields.io/npm/v/%40fission-codes/eslint-config)](https://www.npmjs.com/package/@fission-codes/eslint-config) [![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/fission-codes/stack/eslint-config.yml)](https://github.com/fission-codes/stack/actions/workflows/eslint-config.yml) -[![Built by FISSION](https://img.shields.io/badge/built_by-⌘_Fission-purple.svg)](https://fission.codes) -[![Discord](https://img.shields.io/discord/478735028319158273?&color=mediumslateblue)](https://discord.gg/zAQBDEq) -[![Discourse users]()](https://talk.fission.codes) -Fission eslint, ts and prettier config. +## Features + +- A file system class that allows for an easy-to-use mutable API. +- A root tree, holding references to all the needed individual parts (public fs, private forest, exchange, etc) +- A unix-fs compatibility layer for the public file system (allows for public files to be viewed through, for example, IPFS gateways) +- A mounting system for private nodes, mount specific paths. +- Provides a transaction system, rewinding the state if an error occurs. +- Creates a private forest automatically with a RSA modules using the Web Crypto API (supported on multiple platforms) +- Ability to verify commits to the file system. If a commit, aka. modification, is not verified, it will result in a no-op. +- And more: typed paths, events, path helpers, data casting, … ## Installation ```bash -pnpm install package1 +pnpm install @wnfs-wg/nest ``` ## Usage ```js -import { module } from 'package1' +import { module } from '@wnfs-wg/nest' ``` ## Docs @@ -28,7 +34,7 @@ Check Read contributing guidelines [here](../../.github/CONTRIBUTING.md). -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/hugomrdias/hd-template) +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/@wnfs-wg/nest) ## License diff --git a/packages/nest/src/class.ts b/packages/nest/src/class.ts index 68ea939..176d108 100644 --- a/packages/nest/src/class.ts +++ b/packages/nest/src/class.ts @@ -232,6 +232,9 @@ export class FileSystem { /** * Mount private nodes onto the file system. * + * When a `capsuleKey` is not given, + * it will create the given path instead of trying to load it. + * * @group Mounting */ async mountPrivateNodes(