Skip to content

Commit

Permalink
Extract PouchDB storage into @deephaven/pouch-storage package (deepha…
Browse files Browse the repository at this point in the history
  • Loading branch information
vbabich authored Oct 21, 2022
1 parent f1df977 commit d483569
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 38 deletions.
89 changes: 60 additions & 29 deletions package-lock.json

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

1 change: 1 addition & 0 deletions packages/code-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@deephaven/jsapi-shim": "file:../jsapi-shim",
"@deephaven/jsapi-utils": "file:../jsapi-utils",
"@deephaven/log": "file:../log",
"@deephaven/pouch-storage": "file:../pouch-storage",
"@deephaven/react-hooks": "file:../react-hooks",
"@deephaven/redux": "file:../redux",
"@deephaven/storage": "file:../storage",
Expand Down
2 changes: 1 addition & 1 deletion packages/code-studio/src/main/AppInit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
IntegerColumnFormatter,
} from '@deephaven/jsapi-utils';
import Log from '@deephaven/log';
import { PouchCommandHistoryStorage } from '@deephaven/pouch-storage';
import {
DeephavenPluginModuleMap,
getWorkspace,
Expand All @@ -41,7 +42,6 @@ import {
} from '@deephaven/redux';
import { setLayoutStorage as setLayoutStorageAction } from '../redux/actions';
import App from './App';
import PouchCommandHistoryStorage from '../storage/PouchCommandHistoryStorage';
import LocalWorkspaceStorage from '../storage/LocalWorkspaceStorage';
import {
createConnection,
Expand Down
3 changes: 3 additions & 0 deletions packages/code-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
{
"path": "../log"
},
{
"path": "../pouch-storage"
},
{
"path": "../react-hooks"
},
Expand Down
31 changes: 31 additions & 0 deletions packages/pouch-storage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build
/dist

# misc
.vscode
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.project
.settings/
.eslintcache
.stylelintcache

/public/vs

npm-debug.log*
yarn-debug.log*
yarn-error.log*

src/**/*.css
9 changes: 9 additions & 0 deletions packages/pouch-storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @deephaven/storage

A library implementing storage classes based on PouchDB for storing application data from Deephaven.

## Install

```bash
npm install --save @deephaven/pouch-storage
```
7 changes: 7 additions & 0 deletions packages/pouch-storage/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const baseConfig = require('../../jest.config.base.cjs');
const packageJson = require('./package');

module.exports = {
...baseConfig,
displayName: packageJson.name,
};
51 changes: 51 additions & 0 deletions packages/pouch-storage/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@deephaven/pouch-storage",
"version": "0.20.0",
"description": "Deephaven Storage based on PouchDB",
"author": "Deephaven Data Labs LLC",
"license": "Apache-2.0",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/deephaven/web-client-ui.git",
"directory": "packages/pouch-storage"
},
"source": "src/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=16"
},
"scripts": {
"build": "cross-env NODE_ENV=production run-p build:*",
"build-dev": "cross-env NODE_ENV=development run-p build:*",
"babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward",
"build:babel": "npm run babel",
"watch": "run-p watch:*",
"watch:babel": "npm run babel -- -w --skip-initial-build",
"prestart": "npm run build-dev",
"start": "cross-env NODE_ENV=development npm run watch"
},
"dependencies": {
"@deephaven/console": "file:../console",
"@deephaven/filters": "file:../filters",
"@deephaven/log": "file:../log",
"@deephaven/storage": "file:../storage",
"@deephaven/utils": "file:../utils",
"lodash.throttle": "^4.1.1",
"pouchdb-browser": "^7.3.0",
"pouchdb-find": "^7.3.0"
},
"peerDependencies": {
"react": "^17.0.0"
},
"devDependencies": {
"@deephaven/tsconfig": "file:../tsconfig"
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
}
}
1 change: 1 addition & 0 deletions packages/pouch-storage/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './PouchCommandHistoryStorage';
26 changes: 26 additions & 0 deletions packages/pouch-storage/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src/",
"outDir": "dist/"
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"],
"exclude": ["node_modules", "src/**/*.test.*", "src/**/__mocks__/*"],
"references": [
{
"path": "../console"
},
{
"path": "../filters"
},
{
"path": "../log"
},
{
"path": "../storage"
},
{
"path": "../utils"
}
]
}
14 changes: 6 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@deephaven/*": [
"./packages/*/src"
]
"@deephaven/*": ["./packages/*/src"]
},
"types": ["jest", "node"]
},
"files": [],
"watchOptions": {
"excludeDirectories": [
"**/node_modules",
"**/dist"
]
"excludeDirectories": ["**/node_modules", "**/dist"]
},
"references": [
{
Expand Down Expand Up @@ -53,6 +48,9 @@
{
"path": "./packages/log"
},
{
"path": "./packages/pouch-storage"
},
{
"path": "./packages/react-hooks"
},
Expand All @@ -66,4 +64,4 @@
"path": "./packages/utils"
}
]
}
}

0 comments on commit d483569

Please sign in to comment.