GithubHelp home page GithubHelp logo

unigraph-dev / unigraph-dev Goto Github PK

View Code? Open in Web Editor NEW
704.0 16.0 48.0 33.96 MB

A local-first and universal knowledge graph, personal search engine, and workspace for your life.

Home Page: https://unigraph.dev/

License: MIT License

TypeScript 77.30% HTML 0.26% CSS 1.51% Shell 0.14% JavaScript 20.58% PowerShell 0.02% Dockerfile 0.07% Nix 0.12%
dgraph knowledge-base knowledge-management react

unigraph-dev's Introduction

Unigraph

A local-first and universal knowledge graph, personal search engine, and workspace for your life.

Please join the Discord community below to talk about contributing, or open a GitHub issue if you want to help!

Discord

Docs

License: MIT

Getting started

Running with Docker image

We provide an experimental Dockerfile for easy setup:

  • Building Unigraph: docker build -t unigraph-devserver . (this should take roughly 10 minutes max),
  • Running Unigraph: docker run -d -p 4002:4002 -v <data directory>:/opt/unigraph -p 4001:4001 -p 3000:3000 -P unigraph-devserver,
  • Open http://localhost:3000 in a Browser that supports JavaScript to access Unigraph. If container is running on a different machine, replace localhost accordingly.

To update the Docker image, run docker build again after git pull.

Building from source

1) Build the Dgraph backend binary from source [reference]

requires gcc, make, go>=1.13

git clone https://github.com/unigraph-dev/dgraph.git
cd ./dgraph
make install  # installs built binary in $GOPATH/bin
# you can view your $GOPATH by running:  go env GOPATH
# and similarly, confirm binary exists:
> ls $(go env GOPATH)/bin | grep dgraph
dgraph

Alternative for step 1): find Unigraph's Dgraph binary for your platform on GitHub Releases and rename it to dgraph. On Linux or macOS, you'll need to make it executable: chmod +x ./Downloads/dgraph. Then, continue to step 2).

2) In the unigraph project root, fetch and build project dependencies:

if you have node.js versioning issues, consider using nvm. Windows users, see the note further down.

yarn && yarn build-deps

3) Move the Dgraph binary you built in step 1) to a new /opt/unigraph directory. This is a project default, but you can use a path of your choosing (as well as keep a separate data directory & bin path).

check that your user can read/write to the path(s) โ€” you may need to e.g. chown -R $(whoami) /opt/unigraph

4) Run the backend and frontend from the unigraph project root!

the Dgraph backend currently requires its default ports to be free, especially 8080.

# run backend with default data and bin path:  /opt/unigraph
./scripts/start_server.sh
# or, run backend with custom paths:
./scripts/start_server.sh -d "<data directory>" -b "<dgraph binary location>"
# run frontend application in a browser:
yarn explorer-start
# or, to run as an electron application:
yarn electron-start

NOTE: if the backend failed during server initialization, you'll need a clean application state before reattempting:

  • killall dgraph to kill all running dgraph processes, then
  • remove p/, w/, zw/ in your data directory (by default /opt/unigraph)

Server initialization is successful upon unigraph> Unigraph server listening on port 4002 and announcing upserts.

5) If you want to use third-party API integrations, consult the "API Keys" section below.


Alternative Setup for Windows Dev/Technically Savvy Users

If you have managed to get a Dgraph instance running in WSL or via Docker, but would like to hack on Unigraph under Windows, the following commands can get the frontend and local backend built and connecting to Dgraph. These commands depend on PowerShell. Note that Windows comes with an older version of PowerShell, but you should install the most recent version from here. The binary, pwsh.exe, should be on your path after installation.

In one PowerShell terminal instance execute the following commands:

yarn
yarn build-deps
yarn backend-start

In another PowerShell terminal instance run this command, when the last command of the previous set has finished upserting to Dgraph:

yarn explorer-start

If you want to change Unigraph's default Ctrl + e shortcut for the Omnibar (which in Windows can pop up the browser's search bar), you can do it by editing the following section of packages\unigraph-dev-explorer\src\pages\SearchOverlay.tsx (currently hardcoded):

document.onkeydown = function(evt) {
    evt = evt || window.event;
    if ((evt.ctrlKey || evt.metaKey) && evt.key === 'e' && !isElectron()) {
        if (open === undefined) setSearchEnabled(!searchEnabled);
    }
    if ((searchEnabled) && evt.key === 'Escape') {
        setSearchEnabled(false);
    }
};

Updating Unigraph

Unigraph is being worked on constantly. If you're interested in getting the latest version, do the following:

  • git pull to retrieve the latest changes;
  • make sure backend and dgraph is not running;
  • yarn build-deps to re-build common libraries and default packages;
  • ./script/start_server.sh to re-start backend, and update any new packages if available.

Structure

This repository contains all relevant source code for Unigraph:

  • packages/
    • unigraph-dev-backend/ : Unigraph local backend in Node.js.
    • unigraph-dev-common/ : shared data and utilities between backend and frontend.
    • unigraph-dev-explorer/ : Unigraph frontend in React.
    • default-packages/ : schema, data and code declarations for packages providing default functionalities. If you are looking to build packages, you can study example projects here.

API Keys

To use third-party API integrations, obtain desired API keys and put them in this format in a file named secrets.env.json before starting the server:

{
    "twitter": {
        "api_key": "abc",
        "api_secret_key": "abc",
        "bearer_token": "abc"
    },
    "reddit": {
        "client_id": "abc"
    },
    "openai": {
        "api_key": "abc"
    },
    "google": {
        "client_id": "abc",
        "client_secret": "abc"
    }
}

For how to obtain them, see the docs page.

unigraph-dev's People

Contributors

asampal avatar berriesncats avatar dantefromhell avatar dragonman225 avatar dynamicdoyle avatar oaao avatar ssalka avatar theexgenesis avatar thesophiaxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unigraph-dev's Issues

Error when opening in split pane

After updating in the settings to open components in a new pane instead of the tab, clicking on any component, results in the error.

Screen Shot 2021-11-22 at 3 45 48 PM

Error while building docker

ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2422556431/.Dockerfile.base: no such file or directory

Better user experience for routines

By @edbmuir on Discord:

  1. indicators for running/scheduled/etc routines
  2. see a list of all running routines
  3. concurrent routines management (e.g. don't run routine if one is already running, etc)

Fails to build in Docker

$ sudo docker build -t unigraph-devserver .
...
warning " > @babel/[email protected]" has unmet peer dependency "@babel/core@>=7.11.0".
warning " > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning " > [email protected]" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
warning "workspace-aggregator-bbae34d0-3434-4676-9bdc-8442d98e1ea5 > unigraph-dev-explorer > @monaco-editor/[email protected]" has incorrect peer dependency "monaco-editor@^0.23.0".
warning "workspace-aggregator-bbae34d0-3434-4676-9bdc-8442d98e1ea5 > unigraph-dev-explorer > @sandstreamdev/[email protected]" has unmet peer dependency "prop-types@^15.7.2".
warning "workspace-aggregator-bbae34d0-3434-4676-9bdc-8442d98e1ea5 > unigraph-dev-explorer > [email protected]" has incorrect peer dependency "eslint@^7.0.0".
warning "workspace-aggregator-bbae34d0-3434-4676-9bdc-8442d98e1ea5 > unigraph-dev-explorer > [email protected]" has unmet peer dependency "prop-types@^15.5.0".
warning "workspace-aggregator-bbae34d0-3434-4676-9bdc-8442d98e1ea5 > unigraph-dev-explorer > [email protected]" has incorrect peer dependency "react@^15.5.0 || ^16.0.0".
warning "workspace-aggregator-bbae34d0-3434-4676-9bdc-8442d98e1ea5 > unigraph-dev-explorer > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5".
[5/5] Building fresh packages...
error /app/node_modules/nlapack, /app/packages/unigraph-dev-electron/node_modules/nlapack: Command failed.
Exit code: 1
Command: npm run build
Arguments: 
Directory: /app/packages/unigraph-dev-electron/node_modules/nlapack
Output:
> [email protected] build
> node-gyp rebuild -j max

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v16.17.0/node-v16.17.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v16.17.0/node-v16.17.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v16.17.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v16.17.0/SHASUMS256.txt
(node:116) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/app/node_modules/@npmcli/run-script/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/app/packages/unigraph-dev-electron/node_modules/nlapack/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/app/node_modules/@npmcli/run-script/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/16.17.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.17.0',
gyp info spawn args   '-Dnode_gyp_dir=/app/node_modules/@npmcli/run-script/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.17.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/app/packages/unigraph-dev-electron/node_modules/nlapack',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/app/node_modules/@npmcli/run-script/node_modules/which/which.js:10:17)
gyp ERR! stack     at /app/node_modules/@npmcli/run-script/node_modules/which/which.js:57:18
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at step (/app/node_modules/@npmcli/run-script/node_modules/which/which.js:54:21)
gyp ERR! stack     at /app/node_modules/@npmcli/run-script/node_modules/which/which.js:71:22
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at subStep (/app/node_modules/@npmcli/run-script/node_modules/which/which.js:69:33)
gyp ERR! stack     at /app/node_modules/@npmcli/run-script/node_modules/which/which.js:80:22
gyp ERR! stack     at /app/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /app/node_modules/isexe/mode.js:8:5
gyp ERR! System Linux 5.15.0-48-generic
gyp ERR! command "/usr/bin/node" "/app/node_modules/.bin/node-gyp" "rebuild" "-j" "max"
gyp ERR! cwd /app/packages/unigraph-dev-electron/node_modules/nlapack
gyp ERR! node -v v16.17.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c cd /app && yarn --network-timeout 600000' returned a non-zero code: 1

Using checkout 1613443.
Ubuntu 22.04.1 LTS

Right-click on note reference in ToDo navigates to note

My expectation is that if I right-click anywhere on the ToDo item, a context menu shows. While one does appear when right-clicking on the text portion of the ToDo, it should do the same no matter where you right-click (possibly the menu should be context-sensitive according to the target under the click, but that's another matter).

image

Windows 11, Unigraph de86927

Schema error on `yarn backend-start`

After pulling latest I get the following error on doing yarn backend-start:

โฏ yarn backend-start       
yarn run v1.22.17
$ yarn workspace unigraph-dev-backend start
warning package.json: No license field
$ yarn build && node --trace-warnings dist
warning package.json: No license field
$ run-script-os
warning package.json: No license field
$ pwsh -Command "tsc && (Copy-Item ../../secrets.env.json.gpg -Destination dist)"
D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\call.js:31
    return Object.assign(new Error(message), status);
                         ^

Error: 2 UNKNOWN: Schema does not contain a matching predicate for field definition in type Type
    at Object.callErrorFromStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\call.js:31:26)
    at Object.onReceiveStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\client.js:176:52)
    at Object.onReceiveStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:336:141)
    at Object.onReceiveStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:299:181)
    at D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\call-stream.js:145:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 2,
  details: 'Schema does not contain a matching predicate for field definition in type Type',
  metadata: Metadata {
    internalRepr: Map(1) { 'content-type' => [ 'application/grpc' ] },
    options: {}
  }
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: d:\dev\nvm\v16.13.1\node_modules\yarn\lib\cli.js start
Directory: D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Windows 11, Unigraph a82ac19

Error while starting backend

I am attempting to run unigraph locally on an ubuntu machine, following the readme.
When starting the server, dgraph starts without issues, but the backend server bootstrap fails. After a few successful upserts, I get the following error message:

[Subscription] Refreshing subscriptions...
[Subscription] Total of 0 type queries, 0 object queries, and 1 query queries,
[Subscription] Merged into 1 queries.
/home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:415
            entries = lodash_1.default.merge(entries, { _value: makePart(schemaMap[type]._definition, depth + 1, true) });
                                                                                         ^

TypeError: Cannot read properties of undefined (reading '_definition')
    at makePart (/home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:415:90)
    at /home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:438:36
    at Array.forEach (<anonymous>)
    at makePart (/home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:437:47)
    at makePart (/home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:459:56)
    at /home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:423:41
    at Array.map (<anonymous>)
    at makePart (/home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:420:58)
    at makePart (/home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:415:65)
    at /home/unigraph/unigraph-dev/packages/unigraph-dev-common/lib/utils/entityUtils.js:438:36
error Command failed with exit code 1.

I instrumented, and found that the type is subentity; the loop is called successfully (thrice) with type executable.

No autocomplete of note title when creating ToDo

When creating a ToDo using the OmniBar, if I type some text [[, there is no autocompletion offered. If, on the other hand, I type some text [[]] and then back up into the brackets, completion is then offered.

image

Windows 11, Unigraph de86927

Renaming note crashes then breaks backend

I tried renaming a note in the notes interface which kept reseting to its original then I went into the JSON viewer to edit it, which resulted in a crash with this error:

Building entity part error: Error: Building entity part error: TypeError: Schema check failure for object: "Thoughts about Unigraph"{"uid":"0x50dc","_properties":[{"uid":"0x50dd","_definition":{"uid":"0x50d6","type":{"uid":"0x4e8d","unigraph.id":"$/schema/interface/textual","dgraph.type":["Type"]}},"_indexAs":"name","_key":"text"},{"uid":"0x50de","_definition":{"uid":"0x50d4","_parameters":{"uid":"0x50da","_element":{"uid":"0x50d7","_parameters":{"uid":"0x50d3","_definitions":[{"uid":"0x50d8","type":{"uid":"0x4e4f","unigraph.id":"$/schema/subentity","dgraph.type":["Type"]}},{"uid":"0x50d9","type":{"uid":"0x4e4b","unigraph.id":"$/schema/interface/semantic","dgraph.type":["Type"]}}]},"type":{"uid":"0x4e2b","unigraph.id":"$/composer/Union"}}},"type":{"uid":"0x4e2a","unigraph.id":"$/composer/Array"}},"_key":"children"}],"_parameters":{"uid":"0x50d5","_indexedBy":{"uid":"0x4e26","unigraph.id":"$/primitive/string"}},"type":{"uid":"0x4e2c","unigraph.id":"$/composer/Object"}}$/primitive/string"Thoughts about Unigraph"{"uid":"0x50dc","_properties":[{"uid":"0x50dd","_definition":{"uid":"0x50d6","type":{"uid":"0x4e8d","unigraph.id":"$/schema/interface/textual","dgraph.type":["Type"]}},"_indexAs":"name","_key":"text"},{"uid":"0x50de","_definition":{"uid":"0x50d4","_parameters":{"uid":"0x50da","_element":{"uid":"0x50d7","_parameters":{"uid":"0x50d3","_definitions":[{"uid":"0x50d8","type":{"uid":"0x4e4f","unigraph.id":"$/schema/subentity","dgraph.type":["Type"]}},{"uid":"0x50d9","type":{"uid":"0x4e4b","unigraph.id":"$/schema/interface/semantic","dgraph.type":["Type"]}}]},"type":{"uid":"0x4e2b","unigraph.id":"$/composer/Union"}}},"type":{"uid":"0x4e2a","unigraph.id":"$/composer/Array"}},"_key":"children"}],"_parameters":{"uid":"0x50d5","_indexedBy":{"uid":"0x4e26","unigraph.id":"$/primitive/string"}},"type":{"uid":"0x4e2c","unigraph.id":"$/composer/Object"}}$/primitive/string
"Thoughts about Unigraph"{"uid":"0x50e6","type":{"uid":"0x50df","unigraph.id":"$/schema/note_block","dgraph.type":["Type"]}}$/primitive/string

/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-common/lib/utils/entityUtils.js:249
            throw new Error('Building entity part error: ' + e + JSON.stringify(rawPart) + JSON.stringify(localSchema) + rawPartUnigraphType + '\n');
                  ^

Error: Building entity part error: Error: Building entity part error: Error: Building entity part error: TypeError: Union type does not allow ambiguous or nonexistent selections!"Thoughts about Unigraph"{"uid":"0x50e5","type":{"uid":"0x4e2b","unigraph.id":"$/composer/Union"},"_parameters":{"uid":"0x50e7","_definitions":[{"uid":"0x4e87","type":{"uid":"0x4e80","unigraph.id":"$/schema/note","dgraph.type":["Type"]}},{"uid":"0x4e89","type":{"uid":"0x4e83","unigraph.id":"$/schema/html","dgraph.type":["Type"]}},{"uid":"0x4e8a","type":{"uid":"0x4e86","unigraph.id":"$/schema/markdown","dgraph.type":["Type"]}},{"uid":"0x50e6","type":{"uid":"0x50df","unigraph.id":"$/schema/note_block","dgraph.type":["Type"]}}]}}$/primitive/string
available types: $/schema/note ,$/schema/html ,$/schema/markdown ,$/schema/note_block 

"Thoughts about Unigraph"{"uid":"0x50e5","type":{"uid":"0x4e2b","unigraph.id":"$/composer/Union"},"_parameters":{"uid":"0x50e7","_definitions":[{"uid":"0x4e87","type":{"uid":"0x4e80","unigraph.id":"$/schema/note","dgraph.type":["Type"]}},{"uid":"0x4e89","type":{"uid":"0x4e83","unigraph.id":"$/schema/html","dgraph.type":["Type"]}},{"uid":"0x4e8a","type":{"uid":"0x4e86","unigraph.id":"$/schema/markdown","dgraph.type":["Type"]}},{"uid":"0x50e6","type":{"uid":"0x50df","unigraph.id":"$/schema/note_block","dgraph.type":["Type"]}}]}}$/primitive/string
"Thoughts about Unigraph"{"uid":"0x50d6","type":{"uid":"0x4e8d","unigraph.id":"$/schema/interface/textual","dgraph.type":["Type"]}}$/primitive/string
{"text":"Thoughts about Unigraph"}{"uid":"0x50dc","_properties":[{"uid":"0x50dd","_definition":{"uid":"0x50d6","type":{"uid":"0x4e8d","unigraph.id":"$/schema/interface/textual","dgraph.type":["Type"]}},"_indexAs":"name","_key":"text"},{"uid":"0x50de","_definition":{"uid":"0x50d4","_parameters":{"uid":"0x50da","_element":{"uid":"0x50d7","_parameters":{"uid":"0x50d3","_definitions":[{"uid":"0x50d8","type":{"uid":"0x4e4f","unigraph.id":"$/schema/subentity","dgraph.type":["Type"]}},{"uid":"0x50d9","type":{"uid":"0x4e4b","unigraph.id":"$/schema/interface/semantic","dgraph.type":["Type"]}}]},"type":{"uid":"0x4e2b","unigraph.id":"$/composer/Union"}}},"type":{"uid":"0x4e2a","unigraph.id":"$/composer/Array"}},"_key":"children"}],"_parameters":{"uid":"0x50d5","_indexedBy":{"uid":"0x4e26","unigraph.id":"$/primitive/string"}},"type":{"uid":"0x4e2c","unigraph.id":"$/composer/Object"}}$/composer/Object

    at buildUnigraphEntityPart (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-common/lib/utils/entityUtils.js:249:19)
    at Object.buildUnigraphEntity (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-common/lib/utils/entityUtils.js:309:36)
    at Object.update_object (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-backend/dist/server.js:284:57)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

Now when I restart the server I get the following error:

/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-common/lib/utils/entityUtils.js:423
    var localSchema = schemaMap[schemaName]._definition;
                                            ^

TypeError: Cannot read property '_definition' of undefined
    at Object.makeQueryFragmentFromType (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-common/lib/utils/entityUtils.js:423:45)
    at Object.subscribeToType (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-backend/dist/localUnigraphApi.js:47:119)
    at /Users/ericmuir/Projects/unigraph/packages/unigraph-dev-backend/dist/server.js:135:39
    at exec (/Users/ericmuir/Projects/unigraph/node_modules/async-lock/lib/index.js:127:4)
    at AsyncLock.acquire (/Users/ericmuir/Projects/unigraph/node_modules/async-lock/lib/index.js:152:3)
    at Object.subscribe_to_type (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-backend/dist/server.js:133:18)
    at WebSocket.<anonymous> (/Users/ericmuir/Projects/unigraph/packages/unigraph-dev-backend/dist/server.js:423:49)
    at WebSocket.emit (node:events:369:20)
    at WebSocket.emit (node:domain:470:12)
    at Receiver.receiverOnMessage (/Users/ericmuir/Projects/unigraph/node_modules/ws/lib/websocket.js:835:20)

I'm going to try dig into the issue myself but as it's a totally new codebase to me it'll take me some time to get my head around. As per usual I'll get a PR in if I can fix the issue but any help would be grand.

Cheers,
Eric
(101stArrow on your Discord)

Performance of fetching linked references is slow

Currently Unigraph fetches whole object (including children) for each linked reference but that's not efficient.

We should fetch UIDs only for linked references, then use object-specific queries to speed up the process.

Deleting daily note should re-enable "add daily note" in Homepage

Description: Instead, if I delete today's journal entry, Journal shows Error in detailed AutoDynamicView: { "error": {} } in Homepage.

Cause: Deleting note leaves behind the journal{note, date} object, which daily note view is checking for.

Design question: How to proceed here? Should trying to delete the note block prompt for a delete of the entire daily note? Should it be done automatically? (I'm inclined towards yes in this case bc the date is just metadata. What's the right way to implement this logic?

There should be a way to refresh (or at least notify of) updated packages

When commits are made to Unigraph it's not necessarily obvious, to developers who are trying to stay up to date with the latest, which packages might need to be updated in Dgraph as a result of the changes.

It's not clear what approach would help the developer workflow wrt changed packages, but a few suggestions would be:

  • Mention affected packages in commit messages so that devs could update as required in the Packages view.
  • Provide a button in the Packages view to update all packages in a directory. In this way, devs unfamiliar with the complete codebase could just use that to update all of the standard packages in one shot.
  • Since packages are versioned, a version comparison should be done for standard packages wrt the Dgraph version (of course this would assume a bump in the source version when any changes are made) when using the Packages view. A button should allow changed packages to be updated in Dgraph.

External links can't be followed

External links are properly rendered in content, but it doesn't seem possible to follow them. In a note, a single click on a link just expands text to show the link markup. In a ToDo, a single click does nothing. In either case, a ctrl + click or other key/mouse combination also doesn't follow the link to display it, e.g., in a browser/Unigraph view, etc.

Windows 11, Unigraph 16d448f

Local backend crash when adding bookmark

To reproduce:

  • Ctrl + e to bring up omnibar
  • enter +bm https://dgraph.io/docs/get-started/ and hit Enter to add the bookmark
  • observe the following output in the console where yarn backend-start was run:
D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\localUnigraphApi.js:338
                const exec = uid.startsWith("0x") ? entityUtils_1.unpad((await client.queryUID(uid))[0]) : states.caches["executables"].data[uid];
                                 ^

TypeError: Cannot read property 'startsWith' of undefined
    at D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\localUnigraphApi.js:338:34
    at exec (D:\dev\projects-open-source\unigraph-dev\node_modules\async-lock\lib\index.js:127:4)
    at AsyncLock.acquire (D:\dev\projects-open-source\unigraph-dev\node_modules\async-lock\lib\index.js:152:3)
    at Object.runExecutable (D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\localUnigraphApi.js:337:31)
    at Object.eval (eval at runEnvRoutineJs (D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\executableManager.js:96:16), <anonymous>:28:48)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\executableManager.js:61:29
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: d:\dev\nvm\v15.14.0\node_modules\yarn\lib\cli.js start
Directory: D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Windows 11, Unigraph 16d448f

`yarn backend-start` fails after commit 23b47923

Getting the following error after pulling latest and doing yarn, yarn build-deps, yarn backend-start.

โฏ yarn backend-start
yarn run v1.22.17
$ yarn workspace unigraph-dev-backend start
warning package.json: No license field
$ yarn build && node --trace-warnings dist
warning package.json: No license field
$ run-script-os
warning package.json: No license field
$ pwsh -Command "tsc && (Copy-Item ../../secrets.env.json.gpg -Destination dist)"
Actually doing the upsert...
Error: 2 UNKNOWN: : Query couldn't be executed
    at Object.callErrorFromStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\call.js:31:26)
    at Object.onReceiveStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\client.js:176:52)
    at Object.onReceiveStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:336:141)
    at Object.onReceiveStatus (D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:299:181)
    at D:\dev\projects-open-source\unigraph-dev\node_modules\@grpc\grpc-js\build\src\call-stream.js:145:78
    at processTicksAndRejections (node:internal/process/task_queues:76:11) {
  code: 2,
  details: ": Query couldn't be executed",
  metadata: Metadata {
    internalRepr: Map(1) { 'content-type' => [Array] },
    options: {}
  }
}
D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\dgraphClient.js:257
        const tns = res.getLatency().getTotalNs();
                        ^

TypeError: res.getLatency is not a function
    at DgraphClient.queryDgraph (D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\dgraphClient.js:257:25)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async DgraphClient.getSchemasFromTable (D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\dgraphClient.js:303:22)
    at async Object.cache.updateNow (D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend\dist\datamodelManager.js:43:25)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: d:\dev\nvm\v15.14.0\node_modules\yarn\lib\cli.js start
Directory: D:\dev\projects-open-source\unigraph-dev\packages\unigraph-dev-backend
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
adi@VESUVIUS ๎‚ฐ D:\dev\projects-open-source\unigraph-dev ๎‚ฐ ๎‚  main โ†‘5 ๎‚ฐ                                                                                      [22:02]

Docker (compose)

I think Docker would be a very nice addition since I'm having problems setting it up and docker(-compose) would make it way easier!

There is no indication in the embedding note that a note is transcluded when the transcluded note has no content

When using ((Some note)) and choosing to create that note on the fly, it is created and the title of the transcluded note is shown in the parent note, but it is not obvious that it is a transcluded note rather than just being a regular line of content.

image

In the note above, This is a transcluded note is not marked as being a transcluded note until some content is added to it. At that time, it does get the vertical bar indicating transclusion.

Windows 11, Unigraph 16d448f

When following a note link, open an existing view of the note if it exists

Only create a new note view if an existing view for the linked note doesn't exist. A new view should be opened only if the link is followed with a modifier, e.g. ctrl + click. In the example below, the link to Another note was followed from the note A note for today by clicking it. As shown, a new view for Another note was opened despite one already existing.

image

Windows 11, Unigraph 16d448f

Syntax error on `yarn explorer-start`

In Firefox, when starting up Unigraph, I get the following error:

image

Closing this error overlay view allows the app to continue. The error is probably due to having added some favorites (e.g. the library view) and then deleted the favorite from the trash bin. Chrome doesn't seem to bring up the same error with yarn explorer-start, but the differing behaviour might be because of the browser-local state.

Windows 11, Unigraph 43ebb87

ToDos should be able to link to notes

A ToDo should be able to link to another item, e.g. a note. Currently when entering [[]] while creating a task, a drop-down with items to link to isn't displayed as it is when entering note content. Entering the name of an existing note, e.g. Another note doesn't result in a navigable link, and renders as below:

image

Windows 11, Unigraph 16d448f

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.