From 28f83acc2f3718367aa545d1e39a903bc91d7ac2 Mon Sep 17 00:00:00 2001 From: Oliverio Sousa <47525443+oliveriosousa@users.noreply.github.com> Date: Fri, 6 Aug 2021 14:21:31 +0100 Subject: [PATCH] feat: add example with nuxtjs --- examples/browser-nuxtjs/.editorconfig | 13 ++ examples/browser-nuxtjs/.gitignore | 90 +++++++++ examples/browser-nuxtjs/README.md | 190 ++++++++++++++++++ .../browser-nuxtjs/components/IpfsInfo.vue | 49 +++++ .../browser-nuxtjs/components/NuxtLogo.vue | 11 + .../browser-nuxtjs/components/Tutorial.vue | 119 +++++++++++ examples/browser-nuxtjs/nuxt.config.js | 51 +++++ examples/browser-nuxtjs/package.json | 26 +++ examples/browser-nuxtjs/pages/index.vue | 7 + examples/browser-nuxtjs/plugins/vue-ipfs.js | 10 + examples/browser-nuxtjs/static/favicon.ico | Bin 0 -> 8636 bytes examples/browser-nuxtjs/store/README.md | 10 + examples/browser-nuxtjs/tests/test.js | 27 +++ 13 files changed, 603 insertions(+) create mode 100644 examples/browser-nuxtjs/.editorconfig create mode 100644 examples/browser-nuxtjs/.gitignore create mode 100644 examples/browser-nuxtjs/README.md create mode 100644 examples/browser-nuxtjs/components/IpfsInfo.vue create mode 100644 examples/browser-nuxtjs/components/NuxtLogo.vue create mode 100644 examples/browser-nuxtjs/components/Tutorial.vue create mode 100644 examples/browser-nuxtjs/nuxt.config.js create mode 100644 examples/browser-nuxtjs/package.json create mode 100644 examples/browser-nuxtjs/pages/index.vue create mode 100644 examples/browser-nuxtjs/plugins/vue-ipfs.js create mode 100644 examples/browser-nuxtjs/static/favicon.ico create mode 100644 examples/browser-nuxtjs/store/README.md create mode 100644 examples/browser-nuxtjs/tests/test.js diff --git a/examples/browser-nuxtjs/.editorconfig b/examples/browser-nuxtjs/.editorconfig new file mode 100644 index 00000000..5d126348 --- /dev/null +++ b/examples/browser-nuxtjs/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/examples/browser-nuxtjs/.gitignore b/examples/browser-nuxtjs/.gitignore new file mode 100644 index 00000000..e8f682ba --- /dev/null +++ b/examples/browser-nuxtjs/.gitignore @@ -0,0 +1,90 @@ +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +/logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://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/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# Nuxt generate +dist + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# IDE / Editor +.idea + +# Service worker +sw.* + +# macOS +.DS_Store + +# Vim swap files +*.swp diff --git a/examples/browser-nuxtjs/README.md b/examples/browser-nuxtjs/README.md new file mode 100644 index 00000000..de59a0f6 --- /dev/null +++ b/examples/browser-nuxtjs/README.md @@ -0,0 +1,190 @@ +

+ + IPFS in JavaScript logo + +

+ +

IPFS Nuxt App

+ +

+ Using js-ipfs in a nuxtjs project +
+
+ +
+ Explore the docs + · + View Demo + · + Report Bug + · + Request Feature/Example +

+ +## Table of Contents + +- [Table of Contents](#table-of-contents) +- [About The Project](#about-the-project) +- [Getting Started](#getting-started) + - [Pre requisites](#pre-requisites) + - [Installation and Running example](#installation-and-running-example) + - [Available Scripts](#available-scripts) + - [Compiles and hot-reloads for development](#compiles-and-hot-reloads-for-development) + - [Compiles and minifies for production](#compiles-and-minifies-for-production) + - [Generate static project](#generate-static-project) + - [Customize configuration](#customize-configuration) +- [Usage](#usage) + - [`assets`](#assets) + - [`components`](#components) + - [`layouts`](#layouts) + - [`pages`](#pages) + - [`plugins`](#plugins) + - [`static`](#static) + - [`store`](#store) +- [Documentation](#documentation) +- [Contributing](#contributing) +- [Want to hack on IPFS?](#want-to-hack-on-ipfs) + +## About The Project + +- Read the [docs](https://github.com/ipfs/js-ipfs/tree/master/docs) +- Look into other [examples](https://github.com/ipfs/js-ipfs/tree/master/examples) to learn how to spawn an IPFS node in Node.js and in the Browser +- Consult the [Core API docs](https://github.com/ipfs/js-ipfs/tree/master/docs/core-api) to see what you can do with an IPFS node +- Visit https://dweb-primer.ipfs.io to learn about IPFS and the concepts that underpin it +- Head over to https://proto.school to take interactive tutorials that cover core IPFS APIs +- Check out https://docs.ipfs.io for tips, how-tos and more +- See https://blog.ipfs.io for news and more +- Need help? Please ask 'How do I?' questions on https://discuss.ipfs.io + +## Getting Started + +### Pre requisites + +Make sure you have installed all of the following prerequisites on your development machine: + +- Git - [Download & Install Git](https://git-scm.com/downloads). OSX and Linux machines typically have this already installed. +- Node.js - [Download & Install Node.js](https://nodejs.org/en/download/) and the npm package manager. + +### Installation and Running example + +```console +> npm install +> npm start +``` + +Now open your browser at `http://localhost:8081` + +### Available Scripts + +In the project directory, you can run: + +#### Compiles and hot-reloads for development + +```console +$ npm run dev +``` + +#### Compiles and minifies for production + +```console +$ npm run build +$ npm run start +``` + +#### Generate static project + +```console +$ npm run generate +``` + +#### Customize configuration + +For detailed explanation on how things work, check out the [documentation](https://nuxtjs.org). + +## Usage + +A minimal demonstration of how to use `js-ipfs` with `Nuxt`. + +You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality. + +### `assets` + +The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets). + +### `components` + +The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components). + +### `layouts` + +Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts). + +### `pages` + +This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing). + +### `plugins` + +The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins). + +### `static` + +This directory contains your static files. Each file inside this directory is mapped to `/`. + +Example: `/static/robots.txt` is mapped as `/robots.txt`. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static). + +### `store` + +This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store). + +This project was bootstrapped with [create-nuxt-app](https://nuxtjs.org/docs/2.x/get-started/installation). + +_For more examples, please refer to the [Documentation](#documentation)_ + +## Documentation + +- [Config](https://docs.ipfs.io/) +- [Core API](https://github.com/ipfs/js-ipfs/tree/master/docs/core-api) +- [Examples](https://github.com/ipfs/js-ipfs/tree/master/examples) +- [Development](https://github.com/ipfs/js-ipfs/blob/master/docs/DEVELOPMENT.md) + +## Contributing + +Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. + +1. Fork the IPFS Project +2. Create your Feature Branch (`git checkout -b feature/amazing-feature`) +3. Commit your Changes (`git commit -a -m 'feat: add some amazing feature'`) +4. Push to the Branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request + +## Want to hack on IPFS? + +[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) + +The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out: + +Read the [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md) and [JavaScript Contributing Guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md). + +- **Check out existing issues** The [issue list](https://github.com/ipfs/js-ipfs/issues) has many that are marked as ['help wanted'](https://github.com/ipfs/js-ipfs/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22) or ['difficulty:easy'](https://github.com/ipfs/js-ipfs/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Adifficulty%3Aeasy) which make great starting points for development, many of which can be tackled with no prior IPFS knowledge +- **Look at the [IPFS Roadmap](https://github.com/ipfs/roadmap)** This are the high priority items being worked on right now +- **Perform code reviews** More eyes will help + a. speed the project along + b. ensure quality, and + c. reduce possible future bugs. +- **Add tests**. There can never be enough tests. +- **Join the [Weekly Core Implementations Call](https://github.com/ipfs/team-mgmt/issues/992)** it's where everyone discusses what's going on with IPFS and what's next diff --git a/examples/browser-nuxtjs/components/IpfsInfo.vue b/examples/browser-nuxtjs/components/IpfsInfo.vue new file mode 100644 index 00000000..2f00a477 --- /dev/null +++ b/examples/browser-nuxtjs/components/IpfsInfo.vue @@ -0,0 +1,49 @@ + + + diff --git a/examples/browser-nuxtjs/components/NuxtLogo.vue b/examples/browser-nuxtjs/components/NuxtLogo.vue new file mode 100644 index 00000000..970eba0e --- /dev/null +++ b/examples/browser-nuxtjs/components/NuxtLogo.vue @@ -0,0 +1,11 @@ + + + diff --git a/examples/browser-nuxtjs/components/Tutorial.vue b/examples/browser-nuxtjs/components/Tutorial.vue new file mode 100644 index 00000000..09290b70 --- /dev/null +++ b/examples/browser-nuxtjs/components/Tutorial.vue @@ -0,0 +1,119 @@ + + diff --git a/examples/browser-nuxtjs/nuxt.config.js b/examples/browser-nuxtjs/nuxt.config.js new file mode 100644 index 00000000..58e24e09 --- /dev/null +++ b/examples/browser-nuxtjs/nuxt.config.js @@ -0,0 +1,51 @@ +export default { + // Global page headers: https://go.nuxtjs.dev/config-head + head: { + title: 'browser-nuxtjs', + htmlAttrs: { + lang: 'en' + }, + meta: [ + { charset: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { hid: 'description', name: 'description', content: '' }, + { name: 'format-detection', content: 'telephone=no' } + ], + link: [ + { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } + ] + }, + + // Global CSS: https://go.nuxtjs.dev/config-css + css: [ + ], + + // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins + plugins: [ + '~/plugins/vue-ipfs.js' + ], + + // Auto import components: https://go.nuxtjs.dev/config-components + components: true, + + // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules + buildModules: [ + ], + + // Modules: https://go.nuxtjs.dev/config-modules + modules: [ + ], + + // Build Configuration: https://go.nuxtjs.dev/config-build + build: { + // ! TODO: TO BE REMOVED + // * For now it is needed to transpile "Optional chaining" from `ipfs-http-client` + transpile: ['ipfs-http-client'], + babel: { + plugins: [ + ['@babel/plugin-proposal-private-methods', { loose: true }], + ["@babel/plugin-proposal-private-property-in-object", { loose: true }] + ], + }, + } +} diff --git a/examples/browser-nuxtjs/package.json b/examples/browser-nuxtjs/package.json new file mode 100644 index 00000000..d453c94d --- /dev/null +++ b/examples/browser-nuxtjs/package.json @@ -0,0 +1,26 @@ +{ + "name": "browser-nuxtjs", + "version": "1.0.0", + "private": true, + "description": "A minimal demonstration of how to use js-ipfs in a `create-nuxt-app` generated app.", + "license": "MIT", + "scripts": { + "clean": "rimraf ./.nuxt ./dist", + "dev": "nuxt", + "build": "nuxt build", + "start": "nuxt start", + "generate": "nuxt generate", + "test:example": "npm run generate && playwright test tests" + }, + "dependencies": { + "core-js": "^3.15.1", + "ipfs": "^0.56.1", + "nuxt": "^2.15.7" + }, + "devDependencies": { + "@playwright/test": "^1.12.3", + "playwright": "^1.12.3", + "rimraf": "^3.0.2", + "test-util-ipfs-example": "^1.0.2" + } +} diff --git a/examples/browser-nuxtjs/pages/index.vue b/examples/browser-nuxtjs/pages/index.vue new file mode 100644 index 00000000..f2faa0d5 --- /dev/null +++ b/examples/browser-nuxtjs/pages/index.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/browser-nuxtjs/plugins/vue-ipfs.js b/examples/browser-nuxtjs/plugins/vue-ipfs.js new file mode 100644 index 00000000..e85c0648 --- /dev/null +++ b/examples/browser-nuxtjs/plugins/vue-ipfs.js @@ -0,0 +1,10 @@ +import Vue from 'vue' +import IPFS from 'ipfs' + +const IPFSPlugin = { + install: (app, options) => { + app.prototype.$ipfs = IPFS.create(options) + } +} + +Vue.use(IPFSPlugin, {}) diff --git a/examples/browser-nuxtjs/static/favicon.ico b/examples/browser-nuxtjs/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d751f60c6d606d10dc8fcc6200b4dd747dd1e1ce GIT binary patch literal 8636 zcmc&)^-~+n(+^&tXp6gBgMJ~nTX3g%ixw%+0L3jpixdm)!KGMnZAyXSZpA6?8l1q( z^H;okb8~yMKiq!S=4NLB0JP`zAE5yl0VPZT0QoZ?rK6=nfJcq@%o2cA74`m;{V_AhDIUiN=_x{uRUY_%}lF~~WR$;EkAC!Lwx?ZMK;eOry75s9MeHn{G=mFvRMXh@|w*v6TX=LTCnjS(7@=hZsdL z#q2QAD}eyfSXd1KKxPZ|54qz2K4$bS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y&?$*h&snl+(4c!!WSv>h$?w4V$lk z5(a%$*=mQpRG5S5pT%bN2@N7kQ5Dc2E3S6p_c~6Y{)3DI-vhmtC*J;xqoS}QyXy&& z(3wur!}7}10Fj)++^X>Hh@#COl@hJD%J8W<*fz>res@^P5lQm@FmDi|cIqa=Rg_F? TAMreE0RVuNv=po5-$DNmO`MKU literal 0 HcmV?d00001 diff --git a/examples/browser-nuxtjs/store/README.md b/examples/browser-nuxtjs/store/README.md new file mode 100644 index 00000000..1972d277 --- /dev/null +++ b/examples/browser-nuxtjs/store/README.md @@ -0,0 +1,10 @@ +# STORE + +**This directory is not required, you can delete it if you don't want to use it.** + +This directory contains your Vuex Store files. +Vuex Store option is implemented in the Nuxt.js framework. + +Creating a file in this directory automatically activates the option in the framework. + +More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). diff --git a/examples/browser-nuxtjs/tests/test.js b/examples/browser-nuxtjs/tests/test.js new file mode 100644 index 00000000..77c5a233 --- /dev/null +++ b/examples/browser-nuxtjs/tests/test.js @@ -0,0 +1,27 @@ +'use strict' + +const { test, expect } = require('@playwright/test'); +const { playwright } = require('test-util-ipfs-example'); + +// Setup +const play = test.extend({ + ...playwright.servers(), +}); + +play.describe('integrate ipfs with nuxtjs:', () => { + // DOM + const info = "#ipfs-info" + const id = "#ipfs-info-id" + const agent = "#ipfs-info-agent" + + play.beforeEach(async ({servers, page}) => { + await page.goto(`http://localhost:${servers[0].port}/`); + }) + + play('should properly initialized a IPFS node and print some information about the node', async ({ page }) => { + await page.waitForSelector(info) + + expect(await page.textContent(id)).toContain("Qm"); + expect(await page.textContent(agent)).toContain("js-ipfs/"); + }); +});