This repository has been archived by the owner on Sep 30, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from orbitdb/fix/persistent-store
Fix/persistent store
- Loading branch information
Showing
17 changed files
with
16,230 additions
and
1,420 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,59 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/ | ||
version: 2.1 | ||
|
||
executors: | ||
node10-browsers: | ||
docker: | ||
- image: circleci/node:10-browsers | ||
|
||
jobs: | ||
setup: | ||
executor: node10-browsers | ||
steps: | ||
- checkout | ||
- run: mkdir -p /tmp/workspace | ||
- run: make clean-dependencies | ||
- run: make deps | ||
- run: npm run lint | ||
- run: cp -R conf src node_modules test package.json /tmp/workspace | ||
- persist_to_workspace: | ||
root: /tmp/workspace | ||
paths: | ||
- src | ||
- node_modules | ||
- test | ||
- conf | ||
- package.json | ||
test-node: | ||
executor: node10-browsers | ||
steps: | ||
- attach_workspace: | ||
at: ./ | ||
- run: npm run test:node | ||
test-browser: | ||
executor: node10-browsers | ||
steps: | ||
- attach_workspace: | ||
at: ./ | ||
- run: npm run test:browser | ||
build: | ||
executor: node10-browsers | ||
steps: | ||
- attach_workspace: | ||
at: ./ | ||
- run: npm run build | ||
|
||
workflows: | ||
version: 2 | ||
Implementations: | ||
jobs: | ||
- setup | ||
- test-node: | ||
requires: | ||
- setup | ||
- test-browser: | ||
requires: | ||
- setup | ||
- build: | ||
requires: | ||
- setup |
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 +1,4 @@ | ||
node_modules/ | ||
dump.rdb | ||
orbitdb.json | ||
node_modules | ||
redis-stable* |
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,27 @@ | ||
all: build | ||
|
||
deps: | ||
npm install | ||
|
||
test: deps | ||
npm run test | ||
rm -f dump.rdb | ||
rm -f orbitdb.json | ||
|
||
build: test | ||
npm run build | ||
@echo "Build success!" | ||
@echo "Output: 'dist/'" | ||
|
||
clean: | ||
rm -rf orbitdb/ | ||
rm -rf customDir/ | ||
rm -rf node_modules/ | ||
rm -rf redis-stable/ | ||
|
||
clean-dependencies: clean | ||
rm -f package-lock.json; | ||
|
||
rebuild: | clean-dependencies build | ||
|
||
.PHONY: test 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use strict' | ||
|
||
const path = require('path') | ||
const webpack = require('webpack') | ||
|
||
module.exports = { | ||
entry: './src/Cache.js', | ||
output: { | ||
libraryTarget: 'var', | ||
library: 'Cache', | ||
filename: '../dist/orbit-db-cache.min.js' | ||
}, | ||
target: 'web', | ||
devtool: 'none', | ||
externals: { | ||
fs: '{}', | ||
mkdirp: '{}' | ||
}, | ||
node: { | ||
console: false, | ||
Buffer: true, | ||
mkdirp: 'empty' | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
} | ||
}) | ||
], | ||
resolve: { | ||
modules: [ | ||
'node_modules', | ||
path.resolve(__dirname, '../node_modules') | ||
], | ||
alias: { | ||
leveldown: 'level-js' | ||
} | ||
}, | ||
resolveLoader: { | ||
modules: [ | ||
'node_modules', | ||
path.resolve(__dirname, '../node_modules') | ||
], | ||
moduleExtensions: ['-loader'] | ||
} | ||
} |
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,65 @@ | ||
'use strict' | ||
|
||
const glob = require('glob') | ||
const webpack = require('webpack') | ||
const path = require('path') | ||
|
||
module.exports = { | ||
// TODO: put all tests in a .js file that webpack can use as entry point | ||
entry: glob.sync('./test/*.spec.js'), | ||
output: { | ||
filename: '../test/browser/bundle.js' | ||
}, | ||
target: 'web', | ||
mode: 'production', | ||
devtool: 'source-map', | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
} | ||
}), | ||
new webpack.IgnorePlugin(/mongo|redis/) | ||
], | ||
externals: { | ||
fs: '{}', | ||
fatfs: '{}', | ||
runtimejs: '{}', | ||
net: '{}', | ||
tls: '{}', | ||
'child_process': {}, | ||
dns: '{}' | ||
// path: '{}', | ||
// "node-gyp-build": '{}' | ||
}, | ||
resolve: { | ||
modules: [ | ||
'node_modules', | ||
path.resolve(__dirname, '../node_modules') | ||
] | ||
}, | ||
resolveLoader: { | ||
modules: [ | ||
'node_modules', | ||
path.resolve(__dirname, '../node_modules') | ||
], | ||
moduleExtensions: ['-loader'] | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: [ | ||
['@babel/preset-env', { modules: false }] | ||
], | ||
plugins: ['@babel/syntax-object-rest-spread', '@babel/transform-runtime', '@babel/plugin-transform-modules-commonjs'] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.