Skip to content

Commit

Permalink
chore: add travis file and configure build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Feb 19, 2020
1 parent 6429c6c commit 5a25c87
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 95 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
*.lcov
.nyc_output
*.log
package-lock.json
19 changes: 16 additions & 3 deletions packages/ipfs-unixfs-exporter/.travis.yml → .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ stages:

node_js:
- '12'
- '13'

os:
- linux
Expand All @@ -21,20 +22,32 @@ jobs:
- stage: check
script:
- npx aegir commitlint --travis
- npx aegir dep-check
- npm run depcheck
- npm run lint

- stage: test
name: chrome
addons:
chrome: stable
script: npx aegir test -t browser -t webworker
script: npm run test:browser

- stage: test
name: chrome webworker
addons:
chrome: stable
script: npm run test:webworker

- stage: test
name: firefox
addons:
firefox: latest
script: npm run test:browser -- --browsers FirefoxHeadless

- stage: test
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
script: npm run test:webworker -- --browsers FirefoxHeadless

notifications:
email: false
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ipfs-unixfs JavaScript Implementation <!-- omit in toc -->

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Travis CI](https://flat.badgen.net/travis/ipfs/js-ipfs-unixfs)](https://travis-ci.com/ipfs/js-ipfs-unixfs)
[![Codecov](https://codecov.io/gh/ipfs/js-ipfs-unixfs/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
[![Deps](https://david-dm.org/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-unixfs)
[![Style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D8.0.0-orange.svg?style=flat-square)

> JavaScript implementation of IPFS' UnixFS (a Unix FileSystem files representation on top of a MerkleDAG)
The UnixFS spec can be found inside the [ipfs/specs repository](http://github.com/ipfs/specs)

## Lead Maintainer <!-- omit in toc -->

[Alex Potsides](https://github.com/achingbrain)

## Table of Contents <!-- omit in toc -->

- [Install](#install)
- [npm](#npm)
- [Use in Node.js](#use-in-nodejs)
- [Use in a browser with browserify, webpack or any other bundler](#use-in-a-browser-with-browserify-webpack-or-any-other-bundler)
- [Use in a browser Using a script tag](#use-in-a-browser-using-a-script-tag)
- [Usage](#usage)
- [Examples](#examples)
- [Create a file composed by several blocks](#create-a-file-composed-by-several-blocks)
- [Create a directory that contains several files](#create-a-directory-that-contains-several-files)
- [API](#api)
- [UnixFS Data Structure](#unixfs-data-structure)
- [create an unixfs Data element](#create-an-unixfs-data-element)
- [add and remove a block size to the block size list](#add-and-remove-a-block-size-to-the-block-size-list)
- [get total fileSize](#get-total-filesize)
- [marshal and unmarshal](#marshal-and-unmarshal)
- [is this UnixFS entry a directory?](#is-this-unixfs-entry-a-directory)
- [has an mtime been set?](#has-an-mtime-been-set)
- [Contribute](#contribute)
- [License](#license)

## Structure

* `/packages/ipfs-unixfs` Serialization/deserialization of UnixFS objects to protocol buffers
* `/packages/ipfs-unixfs-importer` Builds DAGs from files and directories
* `/packages/ipfs-unixfs-exporter` Exports DAGs

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs/issues)!

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)

## License

[MIT](LICENSE)
15 changes: 15 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"lerna": "3.20.2",
"packages": [
"packages/*"
],
"version": "independent",
"command": {
"bootstrap": {
"hoist": true
},
"run": {
"stream": true
}
}
}
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "js-ipfs-unixfs",
"version": "1.0.0",
"description": "JS implementation of the IPFS UnixFS",
"scripts": {
"postinstall": "lerna bootstrap",
"reset": "lerna run --parallel clean && rm -rf packages/*/node_modules packages/*/package-lock.json node_modules",
"test": "lerna run --parallel test",
"test:node": "lerna run --parallel test:node",
"test:browser": "lerna run --parallel test:browser",
"test:webworker": "lerna run --parallel test:webworker",
"coverage": "lerna run --parallel coverage",
"build": "lerna run --parallel build",
"deploy": "lerna run --parallel deploy",
"start": "NODE_ENV=development lerna run --parallel start",
"clean": "lerna run --parallel clean",
"lint": "lerna run --parallel lint",
"depcheck": "lerna run --parallel depcheck",
"publish": "lerna publish"
},
"devDependencies": {
"lerna": "^3.20.2"
}
}
6 changes: 2 additions & 4 deletions packages/ipfs-unixfs-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
"test:webworker": "aegir test -t webworker",
"build": "aegir build",
"lint": "aegir lint",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"prepublishOnly": "aegir release --test=false --lint=false --bump=false --publish=false",
"coverage": "nyc -s npm run test:node && nyc report --reporter=html",
"dep-check": "aegir dep-check"
"depcheck": "aegir dep-check"
},
"repository": {
"type": "git",
Expand Down
40 changes: 0 additions & 40 deletions packages/ipfs-unixfs-importer/.travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions packages/ipfs-unixfs-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
"test:webworker": "aegir test -t webworker",
"build": "aegir build",
"lint": "aegir lint",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"prepublishOnly": "aegir release --test=false --lint=false --bump=false --publish=false",
"coverage": "nyc -s npm run test:node && nyc report --reporter=html",
"dep-check": "aegir dep-check"
"depcheck": "aegir dep-check"
},
"repository": {
"type": "git",
Expand Down
40 changes: 0 additions & 40 deletions packages/ipfs-unixfs/.travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions packages/ipfs-unixfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"test:webworker": "aegir test -t webworker",
"build": "aegir build",
"lint": "aegir lint",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"coverage": "nyc -s aegir test -t node && nyc report --reporter=html"
"prepublishOnly": "aegir release --test=false --lint=false --bump=false --publish=false",
"coverage": "nyc -s aegir test -t node && nyc report --reporter=html",
"depcheck": "aegir dep-check"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 5a25c87

Please sign in to comment.