Skip to content

Commit

Permalink
Merge pull request #4 from StauroXYZ/docs
Browse files Browse the repository at this point in the history
feat: develop
  • Loading branch information
talentlessguy authored Nov 19, 2023
2 parents c44aa12 + 6ff9bf6 commit 78ade5c
Show file tree
Hide file tree
Showing 27 changed files with 1,371 additions and 242 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ jobs:
version: 8.x
- run: pnpm install
- name: build
run: pnpm build
run: pnpm build
- name: lint
run: pnpm lint
87 changes: 2 additions & 85 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,105 +26,22 @@ coverage
# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
site/.vitepress/cache
dist
26 changes: 1 addition & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

[![CI](https://github.com/StauroXYZ/blumen/actions/workflows/ci.yml/badge.svg)](https://github.com/StauroXYZ/blumen/actions/workflows/ci.yml) ![npm](https://img.shields.io/npm/dt/blumen?style=for-the-badge&logo=npm&color=%232B4AD4&label)


<sub>Self-custodial decentralized deployments</sub>
</div>

Expand Down Expand Up @@ -122,27 +121,4 @@ $ BLUMEN_PK=0x2... blumen ens bafybeibp54tslsez36quqptgzwyda3vo66za3rraujksmsb3
# Open in a browser: https://app.safe.global/transactions/queue?safe=eth:0x0000000000000000000000000000000000000000
```

After submitting the transaction, open your Safe app and approve it.

### API

Blumen exposes some of the functionality as well.

```js
import { walk, packCAR, uploadOnW3S } from 'blumen'
import { assert } from 'node:assert/strict'

const [files, total] = await walk('./dist')

const { blob, cid: actualCid } = await packCAR(files)

const { cid } = await uploadOnW3S({ token: process.env.W3S_TOKEN, car: blob })

assert.equal(cid, actualCid)

const { pin } = await statusOnW3S(cid)

console.log(`Pin status: ${pin}, CID: ${cid}`)
```

This example demonstrates how to use the Blumen API to walk through a directory, prepare your files for upload, upload it to web3.storage, and check the IPFS pinning status.
After submitting the transaction, open your Safe app and approve it.
9 changes: 3 additions & 6 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import js from '@eslint/js'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
{ files: ['src/**/*.ts', 'eslint.config.js'], ...js.configs.recommended },
{ files: ['src/**/*.ts', 'eslint.config.js'],
languageOptions: {
globals: {
...globals.node,
Expand All @@ -20,11 +19,9 @@ export default [
ecmaVersion: 'latest',
},
},
},
stylistic.configs['recommended-flat'],
{
rules: {
'no-unused-vars': 'off',
},
},
{ files: ['src/**/*.ts', 'eslint.config.js'], ...stylistic.configs['recommended-flat'] },
]
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"bin": {
"blumen": "./dist/cli.js"
},
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/StauroXYZ/blumen.git"
Expand All @@ -17,7 +15,8 @@
"dev": "tsx src/index.ts",
"build": "tsc",
"postbuild": "chmod +x ./dist/cli.js",
"prepublishOnly": "pnpm build"
"prepublishOnly": "pnpm build",
"lint": "eslint . --config eslint.config.js"
},
"keywords": [
"ipfs",
Expand All @@ -30,7 +29,7 @@
],
"author": "v1rtl <[email protected]>",
"engines": {
"node": ">=16.8"
"node": ">=16.14"
},
"license": "MIT",
"dependencies": {
Expand All @@ -50,12 +49,14 @@
"viem": "^1.19.3"
},
"devDependencies": {
"@eslint/js": "^8.54.0",
"@stylistic/eslint-plugin": "^1.4.0",
"@types/node": "^20.9.1",
"@types/semver": "^7.5.5",
"@types/varint": "^6.0.3",
"@typescript-eslint/parser": "^6.11.0",
"colorette": "^2.0.20",
"eslint": "^8.54.0",
"globals": "^13.23.0",
"semantic-release": "^22.0.8",
"typescript": "^5.2.2"
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions site/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Blumen',
description: 'a CLI and API library to deploy apps on the decentralized web using IPFS and Ethereum.',
themeConfig: {
nav: [{ text: 'Docs', link: '/' }],
search: {
provider: 'local',
},

sidebar: [
{
text: 'Introduction',
items: [
{
text: 'Getting Started',
link: '/',
},
{
text: 'Providers',
link: '/docs/providers',
},
],
},
{
text: 'CLI',
items: [
{
text: 'Deploy',
link: '/docs/cli/deploy',
},
{
text: 'Status',
link: '/docs/cli/status',
},
{
text: 'ENS',
link: '/docs/cli/ens',
},
],
},
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/StauroXYZ/blumen' },
],
},
})
12 changes: 12 additions & 0 deletions site/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import './style.css'
import Theme from 'vitepress/theme'
import { h } from 'vue'

export default {
extends: Theme,
Layout: () => {
return h(Theme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
}
Loading

0 comments on commit 78ade5c

Please sign in to comment.