-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replaces path to .asar.unpacked if cmd includes .asar/node_modu…
…les + windows support * chrore: adds .appveryor.yml * replaces path to .asar.unpacked if cmd includes .asar/node_modules * moves asar detection and win fix * should be appRoot * forgot os * lints * updates comment electron-packager with asar.unpackDir without wildcard (tested macos and win32) * removes .exe in executable path on windos * tests ipfs-api version response length and first item * checks response of ipfs.util.addFromFs for windows * checks response of ipfs.util.addFromFs for windows again * adds info about packaging with asar and electron-asar example * disables eslint no-console warning for examples * cleanup, to be ready for releasing * skips addFromFs on win32 * skips multiple start stop test on windows * skips only repo.lock assertion * untests api file on windows
- Loading branch information
Showing
12 changed files
with
172 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
environment: | ||
matrix: | ||
- nodejs_version: "6" | ||
- nodejs_version: "8" | ||
|
||
# cache: | ||
# - node_modules | ||
|
||
platform: | ||
- x64 | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
- npm install | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- npm test | ||
|
||
build: off | ||
|
||
version: "{build}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint no-console: 0 */ | ||
'use strict' | ||
|
||
// Start a disposable node, and get access to the api | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
test-ipfs-app* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* eslint no-console: 0 */ | ||
'use strict' | ||
|
||
const { app, ipcMain, BrowserWindow } = require('electron') | ||
const ipfsd = require('ipfsd-ctl') | ||
|
||
app.on('ready', () => { | ||
const win = new BrowserWindow({ | ||
title: 'loading' | ||
}) | ||
win.loadURL(`file://${app.getAppPath()}/public/index.html`) | ||
}) | ||
|
||
ipcMain.on('start', ({ sender }) => { | ||
console.log('starting disposable IPFS') | ||
sender.send('message', 'starting disposable IPFS') | ||
|
||
ipfsd.disposableApi((err, ipfs) => { | ||
if (err) { | ||
sender.send('error', err) | ||
throw err | ||
} | ||
console.log('get id') | ||
sender.send('message', 'get id') | ||
ipfs.id(function (err, id) { | ||
if (err) { | ||
sender.send('error', err) | ||
throw err | ||
} | ||
console.log('got id', id) | ||
sender.send('id', JSON.stringify(id)) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "test-ipfs-app", | ||
"private": true, | ||
"main": "./app.js", | ||
"dependencies": { | ||
"ipfsd-ctl": "*" | ||
}, | ||
"devDependencies": { | ||
"electron": "^1.7.6", | ||
"electron-packager": "^9.0.0" | ||
}, | ||
"scripts": { | ||
"start": "electron .", | ||
"package": "electron-packager ./ --overwrite --asar.unpackDir=node_modules/go-ipfs-dep" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>loading</title> | ||
<button>test ipfs app</button> | ||
<script> | ||
const { ipcRenderer } = require('electron') | ||
|
||
ipcRenderer.on('message', (event, msg) => appendPre(msg)) | ||
ipcRenderer.on('error', (event, err) => appendPre(err)) | ||
|
||
document.querySelector('button') | ||
.addEventListener('click', () => { | ||
ipcRenderer.once('id', (event, id) => appendPre(id)) | ||
ipcRenderer.send('start') | ||
}) | ||
|
||
function appendPre(data) { | ||
const pre = document.createElement('pre') | ||
pre.textContent = data | ||
document.body.appendChild(pre) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Packaging | ||
|
||
```bash | ||
npm install | ||
npm run package | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint no-console: 0 */ | ||
'use strict' | ||
|
||
var ipfsd = require('../') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint no-console: 0 */ | ||
'use strict' | ||
|
||
var ipfsd = require('../') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters