├── settings.json ├── .eslintignore ├── packages ├── api-server │ ├── README.md │ ├── .vscode │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ ├── tsconfig.json │ ├── env │ │ └── integ.yml │ ├── jest.config.js │ ├── .gitignore │ ├── src │ │ ├── store │ │ │ ├── __tests__ │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── memoryStore.spec.ts.snap │ │ │ │ └── memoryStore.spec.ts │ │ │ └── memoryStore.ts │ │ ├── start.ts │ │ ├── constants.ts │ │ ├── core.ts │ │ ├── routes │ │ │ ├── index.ts │ │ │ ├── workspace.ts │ │ │ └── schema.ts │ │ ├── utils.ts │ │ ├── index.ts │ │ ├── __tests__ │ │ │ └── workspace.spec.ts │ │ └── modules │ │ │ └── workspace │ │ │ └── index.ts │ ├── tsconfig.build.json │ └── public │ │ └── index.html ├── common-all │ ├── src │ │ ├── __tests__ │ │ │ └── utils.ts │ │ ├── uuid.ts │ │ ├── helpers.ts │ │ ├── time.ts │ │ ├── utils.ts │ │ ├── greeter.ts │ │ ├── index.ts │ │ ├── logger.ts │ │ ├── assert.ts │ │ ├── vault.ts │ │ ├── constants.ts │ │ ├── config.ts │ │ ├── error.ts │ │ └── env.ts │ ├── .eslintrc.js │ ├── .vscode │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ ├── jest.config.js │ ├── .gitignore │ ├── .npmignore │ ├── tsconfig.build.json │ ├── .editorconfig │ ├── .travis.yml │ └── tsconfig.json ├── seeds-core │ ├── README.md │ ├── .vscode │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ ├── src │ │ ├── index.ts │ │ └── __tests__ │ │ │ └── dummy.spec.ts │ ├── jest.config.js │ ├── .gitignore │ └── tsconfig.json ├── dendron-next-server │ ├── .env.development │ ├── lib │ │ ├── types.ts │ │ ├── logger.ts │ │ ├── config.ts │ │ └── env.ts │ ├── next-env.d.ts │ ├── public │ │ ├── favicon.ico │ │ ├── static │ │ │ └── memberful.js │ │ └── vercel.svg │ ├── pages │ │ ├── schemas │ │ │ └── [id].tsx │ │ ├── api │ │ │ └── hello.ts │ │ ├── _app.tsx │ │ ├── workspace │ │ │ └── configSample.tsx │ │ └── index.js │ ├── styles │ │ ├── globals.css │ │ ├── layout.module.css │ │ └── utils.module.css │ ├── tsconfig.json │ ├── package.json │ ├── .gitignore │ ├── components │ │ └── hooks.tsx │ ├── README.md │ └── next.config.js ├── common-test-utils │ ├── README.md │ ├── .vscode │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ ├── src │ │ ├── presets │ │ │ ├── plugin-core │ │ │ │ ├── lookup-multi.ts │ │ │ │ ├── index.ts │ │ │ │ └── lookup-single.ts │ │ │ ├── pods-core │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── engine-server │ │ │ │ ├── index.ts │ │ │ │ ├── engine-multi.ts │ │ │ │ └── note-refs.ts │ │ │ ├── utils.ts │ │ │ └── initialize.ts │ │ ├── __tests__ │ │ │ └── dummy.spec.ts │ │ └── types.ts │ ├── jest.config.js │ ├── .gitignore │ └── tsconfig.json ├── lsp-client │ ├── client │ │ ├── testFixture │ │ │ ├── completion.txt │ │ │ └── diagnostics.txt │ │ ├── tsconfig.json │ │ ├── CHANGELOG.md │ │ ├── package.json │ │ └── src │ │ │ └── test │ │ │ ├── runTest.ts │ │ │ ├── index.ts │ │ │ ├── completion.test.ts │ │ │ └── helper.ts │ ├── scripts │ │ └── e2e.sh │ ├── .gitignore │ ├── tsconfig.json │ ├── tsconfig.build.json │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ └── README.md ├── lsp-server │ ├── .gitignore │ ├── src │ │ ├── types.ts │ │ ├── settings.ts │ │ ├── utils.ts │ │ └── engine-server.ts │ ├── tsconfig.json │ ├── package.json │ └── .vscode │ │ └── launch.json ├── engine-server │ ├── fixtures │ │ └── pods │ │ │ ├── filePod │ │ │ └── project │ │ │ │ ├── p.3 │ │ │ │ └── n1.md │ │ │ │ ├── p1 │ │ │ │ ├── n1.md │ │ │ │ ├── n1.pdf │ │ │ │ ├── n3.pdf │ │ │ │ ├── .DS_STORE_TEST │ │ │ │ └── n2.md │ │ │ │ └── p2 │ │ │ │ └── n1.md │ │ │ └── fooPodModule │ │ │ ├── src │ │ │ ├── main.js │ │ │ └── index.js │ │ │ └── package.json │ ├── tsconfig.json │ ├── jest.config.js │ ├── src │ │ ├── topics │ │ │ ├── __tests__ │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── git.spec.ts.snap │ │ │ │ └── git.spec.ts │ │ │ └── markdown │ │ │ │ ├── index.ts │ │ │ │ ├── plugins │ │ │ │ ├── index.ts │ │ │ │ └── __tests__ │ │ │ │ │ ├── utils.ts │ │ │ │ │ └── dendronLinksPlugin.spec.ts │ │ │ │ └── __tests__ │ │ │ │ └── __snapshots__ │ │ │ │ └── utilsv2.spec.ts.snap │ │ ├── types.ts │ │ ├── external │ │ │ └── memo │ │ │ │ ├── types.ts │ │ │ │ └── declarations.d.ts │ │ ├── index.ts │ │ ├── __tests__ │ │ │ └── __snapshots__ │ │ │ │ ├── enginev3.spec.ts.snap │ │ │ │ └── nodev2.spec.ts.snap │ │ └── cache │ │ │ └── gitCache.ts │ ├── .gitignore │ ├── .npmignore │ ├── .vscode │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ ├── tsconfig.build.json │ ├── .editorconfig │ └── .travis.yml ├── dendron-cli │ ├── src │ │ ├── index.ts │ │ └── commands │ │ │ ├── index.ts │ │ │ ├── base.ts │ │ │ ├── __tests__ │ │ │ └── utils.ts │ │ │ ├── backfillV2.ts │ │ │ ├── exportPod.ts │ │ │ ├── importPod.ts │ │ │ ├── plantSeed.ts │ │ │ └── refactorFM.ts │ ├── tsconfig.json │ ├── .vscode │ │ └── settings.json │ ├── .eslintrc.js │ ├── jest.config.js │ ├── .gitignore │ ├── .npmignore │ ├── .editorconfig │ ├── .travis.yml │ └── tsconfig.build.json ├── plugin-core │ ├── fixtures │ │ └── fake-workspace │ │ │ └── .vscode │ │ │ └── settings.json │ ├── scripts │ │ ├── pack_and_install.sh │ │ ├── syncAssets.sh │ │ ├── install.sh │ │ ├── check_links.sh │ │ ├── publish-insider.sh │ │ ├── publish.sh │ │ ├── package.sh │ │ └── sync_vault.sh │ ├── assets │ │ ├── images │ │ │ └── logo.png │ │ └── jekyll │ │ │ ├── favicon.ico │ │ │ ├── 404.md │ │ │ ├── assets │ │ │ └── images │ │ │ │ ├── logo.png │ │ │ │ └── logo-banner.png │ │ │ ├── Gemfile │ │ │ └── _config.yml │ ├── tsconfig.json │ ├── media │ │ ├── fontello │ │ │ └── font │ │ │ │ ├── fontello.eot │ │ │ │ ├── fontello.ttf │ │ │ │ ├── fontello.woff │ │ │ │ ├── fontello.woff2 │ │ │ │ └── fontello.svg │ │ └── markdown.css │ ├── src │ │ ├── components │ │ │ └── lookup │ │ │ │ ├── constants.ts │ │ │ │ └── types.ts │ │ ├── utils │ │ │ ├── editor.ts │ │ │ ├── pods.ts │ │ │ └── md.ts │ │ ├── types.ts │ │ ├── external │ │ │ └── memo │ │ │ │ ├── types.ts │ │ │ │ └── declarations.d.ts │ │ ├── extension.ts │ │ ├── commands │ │ │ ├── Contribute.ts │ │ │ ├── ShowPreview.ts │ │ │ ├── OpenLogs.ts │ │ │ ├── ConfigureCommand.ts │ │ │ ├── DumpStateCommand.ts │ │ │ ├── GoDownCommand.ts │ │ │ ├── ShowHelp.ts │ │ │ ├── Publish.ts │ │ │ ├── SnapshotVault.ts │ │ │ ├── GoUpCommand.ts │ │ │ ├── ChangeWorkspace.ts │ │ │ ├── GotoNote.ts │ │ │ ├── ArchiveHierarchy.ts │ │ │ ├── CopyNoteLink.ts │ │ │ ├── CreateDailyJournal.ts │ │ │ └── ConfigurePodCommand.ts │ │ ├── services │ │ │ └── EngineAPIService.ts │ │ └── test │ │ │ ├── runTestInteg.ts │ │ │ ├── runTest.ts │ │ │ ├── suite │ │ │ └── index.ts │ │ │ └── suite-integ │ │ │ ├── index.ts │ │ │ ├── CreateDailyJournalNote.test.ts │ │ │ └── CopyNoteLink.test.ts │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ ├── settings.json │ │ └── tasks.json │ ├── .vscodeignore │ ├── tsconfig.build.json │ ├── .eslintrc.json │ └── templates │ │ ├── command.test.j2 │ │ └── command.ts.j2 ├── common-server │ ├── tsconfig.json │ ├── .vscode │ │ ├── settings.json │ │ ├── launch.json │ │ └── tasks.json │ ├── src │ │ ├── __tests__ │ │ │ ├── dumy.spec.ts │ │ │ ├── file.spec.ts │ │ │ └── __snapshots__ │ │ │ │ └── filesv2.spec.ts.snap │ │ └── index.ts │ ├── jest.config.js │ ├── .gitignore │ ├── .npmignore │ ├── tsconfig.build.json │ ├── .editorconfig │ └── .travis.yml └── pods-core │ ├── jest.config.js │ ├── src │ ├── builtin │ │ ├── index.ts │ │ └── __tests__ │ │ │ └── __snapshots__ │ │ │ ├── JSONPod.spec.ts.snap │ │ │ └── SnapshotPod.spec.ts.snap │ ├── types.ts │ └── index.ts │ ├── .gitignore │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── .vscode │ ├── launch.json │ └── tasks.json ├── bootstrap ├── .vscode │ ├── spellright.dict │ ├── settings.json │ └── typescript.code-snippets └── scripts │ ├── bootstrap.sh │ ├── sleep.sh │ ├── sync_vault.sh │ ├── stats.sh │ ├── testAll.sh │ ├── publish-pre-patch.sh │ ├── init.sh │ ├── changelog.sh │ ├── publish.sh │ ├── cleanup.sh │ ├── test-ci.sh │ ├── publish_pre_and_install.sh │ ├── watch.sh │ ├── lerna-helpers.sh │ ├── install.sh │ └── build.sh ├── .yarnrc ├── NOTICE.md ├── templates └── type.d.ts.jinja ├── vendor └── dendron-remark-math │ ├── yarn.lock │ ├── types │ ├── tslint.json │ ├── tsconfig.json │ ├── index.d.ts │ └── test.ts │ ├── index.js │ ├── util.js │ └── package.json ├── extensions.json ├── tsconfig.json ├── .github └── ISSUE_TEMPLATE │ ├── work-item.md │ ├── feature_request.md │ ├── bug_report.md │ └── pod-request-template.md ├── docs └── CONTRIBUTING.md ├── .prettierignore ├── .git-blame-ignore-revs ├── .gitignore ├── lerna.json ├── dev ├── dev.t.changelog.md └── dev.md ├── playbooks └── addTypes.yml ├── .eslintcache ├── tsconfig.build.json ├── .versionrc.json ├── jest.config.js ├── .travis.yml ├── dendron-next-server.code-workspace ├── package.json ├── dendron-cli.code-workspace └── reports └── 3511130720393ac8a1ca1300cf03fccf07cce2f0 /settings.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | vendor/**/* -------------------------------------------------------------------------------- /packages/api-server/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | -------------------------------------------------------------------------------- /packages/common-all/src/__tests__/utils.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/seeds-core/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | -------------------------------------------------------------------------------- /bootstrap/.vscode/spellright.dict: -------------------------------------------------------------------------------- 1 | 2 | dep 3 | -------------------------------------------------------------------------------- /packages/api-server/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /packages/dendron-next-server/.env.development: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/seeds-core/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /packages/common-test-utils/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | -------------------------------------------------------------------------------- /packages/lsp-client/client/testFixture/completion.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/common-test-utils/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /packages/lsp-server/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | dist 3 | logs 4 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p.3/n1.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p1/n1.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p1/n1.pdf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p1/n3.pdf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/seeds-core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./base"; 2 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/plugin-core/lookup-multi.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/dendron-cli/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./commands"; 2 | -------------------------------------------------------------------------------- /packages/plugin-core/fixtures/fake-workspace/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | "@dendronhq:registry" "https://npm.pkg.github.com/" 2 | 3 | 4 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | Dendron 2 | Copyright 2020 Thence LLC. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /bootstrap/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p1/.DS_STORE_TEST: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/dendron-next-server/lib/types.ts: -------------------------------------------------------------------------------- 1 | export type StageEnv = { 2 | }; 3 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p1/n2.md: -------------------------------------------------------------------------------- 1 | # N2 Content 2 | -------------------------------------------------------------------------------- /packages/lsp-client/client/testFixture/diagnostics.txt: -------------------------------------------------------------------------------- 1 | ANY browsers, ANY OS. -------------------------------------------------------------------------------- /packages/api-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/common-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/dendron-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/engine-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /bootstrap/scripts/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "bootstrapping..." 4 | npx lerna bootstrap -------------------------------------------------------------------------------- /bootstrap/scripts/sleep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "start sleeping" 4 | sleep 120 5 | echo "done sleeping" -------------------------------------------------------------------------------- /bootstrap/scripts/sync_vault.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd packages/plugin-core/ 4 | ./scripts/sync_vault.sh -------------------------------------------------------------------------------- /packages/seeds-core/src/__tests__/dummy.spec.ts: -------------------------------------------------------------------------------- 1 | test("ok", () => { 2 | expect(1).toEqual(1); 3 | }); 4 | -------------------------------------------------------------------------------- /bootstrap/scripts/stats.sh: -------------------------------------------------------------------------------- 1 | commit=$(git rev-list HEAD --max-count=1) 2 | cloc --vcs=git . | tee reports/$commit -------------------------------------------------------------------------------- /packages/api-server/env/integ.yml: -------------------------------------------------------------------------------- 1 | LOG_NAME: api-server 2 | LOG_DST: /tmp/api-server.txt 3 | LOG_LVL: DEBUG 4 | -------------------------------------------------------------------------------- /packages/common-server/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib/" 3 | } 4 | -------------------------------------------------------------------------------- /packages/common-server/src/__tests__/dumy.spec.ts: -------------------------------------------------------------------------------- 1 | test("stub", () => { 2 | expect(1).toEqual(1); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/__tests__/dummy.spec.ts: -------------------------------------------------------------------------------- 1 | test("ok", () => { 2 | expect(1).toEqual(1); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/dendron-cli/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib/" 3 | } 4 | -------------------------------------------------------------------------------- /packages/lsp-server/src/types.ts: -------------------------------------------------------------------------------- 1 | export type DendronInitializationOptions = { 2 | wsRoot: string; 3 | }; 4 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/filePod/project/p2/n1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: n1 title 3 | --- 4 | 5 | n1 content 6 | -------------------------------------------------------------------------------- /packages/common-all/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const root = require("../../.eslintrc"); 2 | module.exports = { 3 | ...root, 4 | }; 5 | -------------------------------------------------------------------------------- /packages/dendron-cli/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const root = require("../../.eslintrc"); 2 | module.exports = { 3 | ...root, 4 | }; 5 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/pack_and_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./scripts/package.sh 4 | ./scripts/install.sh 5 | -------------------------------------------------------------------------------- /packages/dendron-next-server/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/fooPodModule/src/main.js: -------------------------------------------------------------------------------- 1 | const Pod = require("./index"); 2 | 3 | new Pod().execute(); 4 | -------------------------------------------------------------------------------- /templates/type.d.ts.jinja: -------------------------------------------------------------------------------- 1 | declare module "{{ts_module}}" { 2 | export function {{ts_module}}(...args: any): any; 3 | } 4 | -------------------------------------------------------------------------------- /bootstrap/scripts/testAll.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | npx lerna run test --parallel --ignore @dendronhq/plugin-core -- -- -u 2>&1 4 | -------------------------------------------------------------------------------- /packages/common-all/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib/", 3 | "eslint.enable": true 4 | } 5 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/types.ts: -------------------------------------------------------------------------------- 1 | export type TestResult = { 2 | actual: any; 3 | expected: any; 4 | msg?: string; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/dendron-cli/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig 5 | } -------------------------------------------------------------------------------- /packages/plugin-core/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/assets/images/logo.png -------------------------------------------------------------------------------- /vendor/dendron-remark-math/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /packages/api-server/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/common-all/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/common-all/src/uuid.ts: -------------------------------------------------------------------------------- 1 | import { v4 } from "uuid"; 2 | 3 | function genUUID() { 4 | return v4(); 5 | } 6 | export { genUUID }; 7 | -------------------------------------------------------------------------------- /packages/dendron-next-server/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/dendron-next-server/public/favicon.ico -------------------------------------------------------------------------------- /packages/plugin-core/assets/jekyll/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/assets/jekyll/favicon.ico -------------------------------------------------------------------------------- /packages/pods-core/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/pods-core/src/builtin/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./JSONPod"; 2 | export * from "./MarkdownPod"; 3 | export * from "./SnapshotPod"; 4 | -------------------------------------------------------------------------------- /packages/seeds-core/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/common-all/src/helpers.ts: -------------------------------------------------------------------------------- 1 | export function makeResponse(resp: T) { 2 | return Promise.resolve({ 3 | ...resp, 4 | }); 5 | } 6 | -------------------------------------------------------------------------------- /packages/common-server/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/engine-server/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/plugin-core/assets/jekyll/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 404 4 | nav_exclude: true 5 | --- 6 | 7 | # 404 8 | 9 | Page not found -------------------------------------------------------------------------------- /packages/common-test-utils/jest.config.js: -------------------------------------------------------------------------------- 1 | const jestConfig = require("../../jest.config"); 2 | 3 | module.exports = { 4 | ...jestConfig, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/plugin-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /bootstrap/scripts/publish-pre-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "upgrading..." 4 | lerna version prerelease 5 | lerna publish from-package 6 | git push 7 | -------------------------------------------------------------------------------- /packages/common-all/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | -------------------------------------------------------------------------------- /packages/plugin-core/media/fontello/font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/media/fontello/font/fontello.eot -------------------------------------------------------------------------------- /packages/plugin-core/media/fontello/font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/media/fontello/font/fontello.ttf -------------------------------------------------------------------------------- /packages/plugin-core/media/fontello/font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/media/fontello/font/fontello.woff -------------------------------------------------------------------------------- /packages/plugin-core/media/fontello/font/fontello.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/media/fontello/font/fontello.woff2 -------------------------------------------------------------------------------- /packages/pods-core/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | -------------------------------------------------------------------------------- /packages/seeds-core/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | -------------------------------------------------------------------------------- /extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode", 5 | "amatiasq.sort-imports" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/common-server/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | -------------------------------------------------------------------------------- /packages/plugin-core/assets/jekyll/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/assets/jekyll/assets/images/logo.png -------------------------------------------------------------------------------- /packages/common-test-utils/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | -------------------------------------------------------------------------------- /bootstrap/scripts/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./bootstrap/scripts/bootstrap.sh 4 | ./bootstrap/scripts/build.sh 5 | cd packages/plugin-core/ 6 | ./scripts/sync_vault.sh -------------------------------------------------------------------------------- /packages/engine-server/src/topics/__tests__/__snapshots__/git.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`isRepo no repo 1`] = `false`; 4 | -------------------------------------------------------------------------------- /bootstrap/scripts/changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp CHANGELOG.md packages/plugin-core/CHANGELOG.md 4 | git add . 5 | git commit -m "chore: update changelog" 6 | git push 7 | -------------------------------------------------------------------------------- /packages/plugin-core/assets/jekyll/assets/images/logo-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bs/dendron/master/packages/plugin-core/assets/jekyll/assets/images/logo-banner.png -------------------------------------------------------------------------------- /packages/plugin-core/src/components/lookup/constants.ts: -------------------------------------------------------------------------------- 1 | export const CREATE_NEW_DETAIL = "Note does not exist. Create?"; 2 | export const CREATE_NEW_LABEL = "Create New"; 3 | -------------------------------------------------------------------------------- /vendor/dendron-remark-math/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "whitespace": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/api-server/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | stdout 10 | -------------------------------------------------------------------------------- /packages/common-server/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./files"; 2 | export * from "./filesv2"; 3 | export * from "./logger"; 4 | export * from "./api"; 5 | export * from "./parser"; 6 | -------------------------------------------------------------------------------- /packages/engine-server/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | proto*.ts 10 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/plugin-core/index.ts: -------------------------------------------------------------------------------- 1 | import LOOKUP_SINGLE_TEST_PRESET from "./lookup-single"; 2 | 3 | export const PLUGIN_CORE = { 4 | LOOKUP_SINGLE_TEST_PRESET, 5 | }; 6 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/pods-core/index.ts: -------------------------------------------------------------------------------- 1 | import SNAPSHOT from "./snapshot"; 2 | import JSON from "./json"; 3 | 4 | export const PODS_CORE = { 5 | SNAPSHOT, 6 | JSON, 7 | }; 8 | -------------------------------------------------------------------------------- /packages/dendron-cli/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | src/proto-* 10 | stdout 11 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/syncAssets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "syncing note assets..." 3 | aws s3 sync assets/notes/vault.main/assets/ s3://foundation-prod-assetspublic53c57cce-8cpvgjldwysl/assets/ -------------------------------------------------------------------------------- /packages/common-all/src/time.ts: -------------------------------------------------------------------------------- 1 | import { DateTime } from "luxon"; 2 | 3 | export class Time { 4 | static now() { 5 | return DateTime.local(); 6 | } 7 | static DateTime = DateTime; 8 | } 9 | -------------------------------------------------------------------------------- /packages/engine-server/src/topics/markdown/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./utils"; 2 | export * from "./utilsv2"; 3 | export * from "./plugins"; 4 | const toc = require("remark-toc"); 5 | export { toc }; 6 | -------------------------------------------------------------------------------- /packages/common-all/src/utils.ts: -------------------------------------------------------------------------------- 1 | import minimatch from "minimatch"; 2 | import semver from "semver"; 3 | 4 | export class DUtils { 5 | static minimatch = minimatch; 6 | static semver = semver; 7 | } 8 | -------------------------------------------------------------------------------- /packages/dendron-next-server/lib/logger.ts: -------------------------------------------------------------------------------- 1 | export function info(msg: any) { 2 | console.log(JSON.stringify(msg)); 3 | } 4 | export function error(msg: any) { 5 | console.log(JSON.stringify(msg)); 6 | } -------------------------------------------------------------------------------- /packages/plugin-core/src/utils/editor.ts: -------------------------------------------------------------------------------- 1 | import vscode from "vscode" ; 2 | 3 | export function isAnythingSelected(): boolean { 4 | return !vscode.window?.activeTextEditor?.selection?.isEmpty; 5 | } 6 | -------------------------------------------------------------------------------- /packages/api-server/src/store/__tests__/__snapshots__/memoryStore.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`memory store basic 1`] = ` 4 | Object { 5 | "foo": 1, 6 | } 7 | `; 8 | -------------------------------------------------------------------------------- /packages/dendron-next-server/pages/schemas/[id].tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import DendronTree from "../../components/dendronTree"; 3 | 4 | export default function Schema() { 5 | return 6 | } -------------------------------------------------------------------------------- /packages/lsp-client/scripts/e2e.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export CODE_TESTS_PATH="$(pwd)/client/out/test" 4 | export CODE_TESTS_WORKSPACE="$(pwd)/client/testFixture" 5 | 6 | node "$(pwd)/client/out/test/runTest" -------------------------------------------------------------------------------- /packages/plugin-core/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | build 6 | notes 7 | reports 8 | assets/LAST_COMMIT 9 | assets/dendronWS 10 | OVSX_PAT 11 | dist 12 | fixtures/fake-workspace -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.build.json", 3 | 4 | "compilerOptions": { 5 | "baseUrl": ".", 6 | "paths": { 7 | "@dendronhq/*": ["packages/*/src"] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/dendron-cli/src/commands/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./build-site"; 2 | export * from "./exportPod"; 3 | export * from "./publishNotes"; 4 | export * from "./backfillV2"; 5 | export * from "./PublishPodCLICommand"; 6 | -------------------------------------------------------------------------------- /packages/engine-server/src/topics/markdown/plugins/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./dendronLinksPlugin"; 2 | export * from "./replaceRefs"; 3 | export * from "./dendronRefsPlugin"; 4 | export * from "./dendronNoteRefPlugin"; 5 | -------------------------------------------------------------------------------- /packages/lsp-client/.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | .nyc_output 7 | lib 8 | lib_test 9 | dist 10 | old 11 | out 12 | server 13 | .vscode-test 14 | -------------------------------------------------------------------------------- /packages/plugin-core/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": ["dbaeumer.vscode-eslint"] 5 | } 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/work-item.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Work Item 3 | about: Used by Dendron team to track current work items 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Context 11 | 12 | ## Proposal 13 | -------------------------------------------------------------------------------- /bootstrap/scripts/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "upgrading..." 4 | # npm run release -- --patch --no-verify --no-git-tag-version --no-push 5 | lerna version patch 6 | lerna publish from-package -y 7 | git push 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Dendron 2 | 3 | Thanks for your interest in contributing to Dendron! ❤️ 4 | 5 | Please go [here](https://www.dendron.so/notes/64f0e2d5-2c83-43df-9144-40f2c68935aa.html) to see the contribution docs. 6 | -------------------------------------------------------------------------------- /packages/api-server/src/start.ts: -------------------------------------------------------------------------------- 1 | import process from "process"; 2 | 3 | import { launch } from "./index"; 4 | const port = process.env.PORT || 3000; 5 | const logPath = process.env.LOG_DST; 6 | launch({ port: port as number, logPath }); 7 | -------------------------------------------------------------------------------- /packages/dendron-next-server/lib/config.ts: -------------------------------------------------------------------------------- 1 | import { StageEnv } from "./types"; 2 | 3 | export const ENV: {[key: string]: StageEnv} = { 4 | dev: { 5 | }, 6 | prod: { 7 | } 8 | } 9 | 10 | export const CONFIG = { 11 | }; 12 | -------------------------------------------------------------------------------- /packages/dendron-next-server/pages/api/hello.ts: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | 3 | export default (req, res) => { 4 | res.statusCode = 200; 5 | res.json({ name: "John Doe" }); 6 | }; 7 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | vendor/**/* 2 | lib 3 | node_modules 4 | out 5 | dist 6 | assets 7 | *.lock 8 | .* 9 | __snapshots__ 10 | LICENSE 11 | *.sh 12 | *.j2 13 | # build 14 | # docs 15 | # fixtures 16 | # packages 17 | # playbooks 18 | # templates -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./rename"; 2 | export * from "./initialize"; 3 | export * from "./pods-core"; 4 | export * from "./engine-server"; 5 | export * from "./plugin-core"; 6 | export * from "./utils"; 7 | -------------------------------------------------------------------------------- /packages/common-all/.npmignore: -------------------------------------------------------------------------------- 1 | # gitignore 2 | 3 | coverage/ 4 | node_modules/ 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | .nyc_output 9 | lib 10 | lib_test 11 | 12 | # npmignore 13 | 14 | src/ 15 | __tests__/ 16 | .vscode/ -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/fooPodModule/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fooPodModule", 3 | "version": "1.0.0", 4 | "main": "src/index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "cowsay": "^1.4.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/plugin-core/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/.eslintrc.json 9 | **/*.map 10 | **/*.ts 11 | node_modules 12 | build 13 | -------------------------------------------------------------------------------- /bootstrap/scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | find packages -name "node_modules" -type d -prune -exec rm -rf '{}' + 4 | find packages -type f -name yarn.lock -exec rm -rf '{}' + 5 | find packages -type f -name package-lock.json -exec rm {} + 6 | 7 | -------------------------------------------------------------------------------- /packages/common-server/.npmignore: -------------------------------------------------------------------------------- 1 | # gitignore 2 | 3 | coverage/ 4 | node_modules/ 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | .nyc_output 9 | lib 10 | lib_test 11 | 12 | # npmignore 13 | 14 | src/ 15 | __tests__/ 16 | .vscode/ -------------------------------------------------------------------------------- /packages/dendron-cli/.npmignore: -------------------------------------------------------------------------------- 1 | # gitignore 2 | 3 | coverage/ 4 | node_modules/ 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | .nyc_output 9 | lib 10 | lib_test 11 | 12 | # npmignore 13 | 14 | src/ 15 | __tests__/ 16 | .vscode/ -------------------------------------------------------------------------------- /packages/engine-server/.npmignore: -------------------------------------------------------------------------------- 1 | # gitignore 2 | 3 | coverage/ 4 | node_modules/ 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | .nyc_output 9 | lib 10 | lib_test 11 | 12 | # npmignore 13 | 14 | src/ 15 | __tests__/ 16 | .vscode/ -------------------------------------------------------------------------------- /packages/pods-core/src/builtin/__tests__/__snapshots__/JSONPod.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`JSONExportPod write config 1`] = ` 4 | "# description: where to export to 5 | # type: string 6 | dest: TODO" 7 | `; 8 | -------------------------------------------------------------------------------- /vendor/dendron-remark-math/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["es2015", "dom"], 4 | "strict": true, 5 | "baseUrl": ".", 6 | "paths": {"remark-math": ["."]}, 7 | "esModuleInterop": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bootstrap/scripts/test-ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "run CI test..." 4 | npx lerna run test --parallel -- -- -u 2>&1 5 | 6 | travis_terminate() { 7 | set +e 8 | pkill -9 -P $$ &> /dev/null || true 9 | exit $1 10 | } 11 | travis_terminate 0 12 | -------------------------------------------------------------------------------- /packages/plugin-core/assets/jekyll/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "github-pages", group: :jekyll_plugins 4 | gem "jekyll" 5 | # TODO: use official gem 6 | #gem "just-the-docs", path: "/Users/kevinlin/projects/dendronv2/dendron-just-the-docs/" -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # prettier chagnes 2 | 00bd5fb049eabb9739e47c7806e82cff87cb43af 3 | # rename @dendron 4 | 5847877bbf41b38d49e16c030deb42929898b694 5 | # formatting 6 | 66e4251bfe2e79ba9315e09664a59421c3000bd8 7 | b4584c201542ff526626882dff4fa5a637a9298c 8 | -------------------------------------------------------------------------------- /packages/engine-server/fixtures/pods/fooPodModule/src/index.js: -------------------------------------------------------------------------------- 1 | const { say } = require("cowsay"); 2 | 3 | class TestPod { 4 | execute() { 5 | console.log(say({ text: "grazing in the browser" })); 6 | } 7 | } 8 | 9 | module.exports = TestPod; 10 | -------------------------------------------------------------------------------- /packages/api-server/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "exclude": ["node_modules", "**/*-spec.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/common-all/src/greeter.ts: -------------------------------------------------------------------------------- 1 | export class Greeter { 2 | private greeting: string; 3 | 4 | constructor(message: string) { 5 | this.greeting = message; 6 | } 7 | 8 | public greet(): string { 9 | return `Bonjour, ${this.greeting}!`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/common-server/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "exclude": ["node_modules", "**/*-spec.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/engine-server/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib/", 3 | "spellright.language": [ 4 | "en" 5 | ], 6 | "spellright.documentTypes": [ 7 | "markdown", 8 | "latex", 9 | "plaintext" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/engine-server/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "exclude": ["node_modules", "**/*-spec.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | version=`cat package.json | jq ".version" -r` 4 | name=`cat package.json | jq ".name" -r` 5 | code-insiders --install-extension "$name-$version.vsix" --force 6 | codium --install-extension "$name-$version.vsix" --force 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .next 3 | /out/ 4 | /build 5 | lerna-debug.log 6 | local 7 | common-client-v_boilerplate2cra 8 | common-client-v2 9 | vendor 10 | dendron.code-workspace 11 | .jekyll-cache 12 | _site 13 | shell.code-snippets 14 | packages/pods-core/lib/index.d.ts 15 | -------------------------------------------------------------------------------- /packages/common-all/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "exclude": ["node_modules", "**/*-spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/check_links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | [[ ! -d "reports" ]] && mkdir reports 3 | cd reports && awesome_bot ../CHANGELOG.md --allow-redirect --allow-dupe --allow 429 -w "https://github.com/dendronhq/dendron/compare/*,https://github.com/dendronhq/dendron/commit/*" 4 | -------------------------------------------------------------------------------- /packages/pods-core/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "lib", 5 | "rootDir": "src" 6 | }, 7 | "include": ["src/**/*"], 8 | "exclude": ["node_modules", "**/*-spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/common-all/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/dendron-cli/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/common-server/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /packages/engine-server/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /bootstrap/scripts/publish_pre_and_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./publish-pre-patch.sh 4 | retVal=$? 5 | if [ $retVal -ne 0 ]; then 6 | echo "Error" 7 | exit 8 | fi 9 | ./sleep.sh 10 | 11 | pushd ../../build/dendron/packages/plugin-core 12 | ./scripts/pack_and_install.sh 13 | popd 14 | -------------------------------------------------------------------------------- /packages/engine-server/src/types.ts: -------------------------------------------------------------------------------- 1 | import { DEngineClientV2, DNoteLoc } from "@dendronhq/common-all"; 2 | 3 | export type ReplaceLinkOpts = { from: DNoteLoc; to: DNoteLoc }; 4 | export { DEngineClientV2 }; 5 | 6 | export type WSMeta = { 7 | version: string; 8 | activationTime: number; 9 | }; 10 | -------------------------------------------------------------------------------- /vendor/dendron-remark-math/index.js: -------------------------------------------------------------------------------- 1 | const inlinePlugin = require('./inline') 2 | const blockPlugin = require('./block') 3 | 4 | module.exports = math 5 | 6 | function math(options) { 7 | var settings = options || {} 8 | blockPlugin.call(this, settings) 9 | inlinePlugin.call(this, settings) 10 | } 11 | -------------------------------------------------------------------------------- /packages/common-all/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "node" # use latest stable nodejs version 4 | script: 5 | - npm run coverage # jest test with coverage flag does coverage too 6 | after_script: 7 | - "cat coverage/lcov.info | ./node_modules/.bin/coveralls" # sends the coverage report to coveralls 8 | -------------------------------------------------------------------------------- /packages/dendron-cli/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 'node' # use latest stable nodejs version 4 | script: 5 | - npm run coverage # jest test with coverage flag does coverage too 6 | after_script: 7 | - 'cat coverage/lcov.info | ./node_modules/.bin/coveralls' # sends the coverage report to coveralls 8 | -------------------------------------------------------------------------------- /packages/common-server/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "node" # use latest stable nodejs version 4 | script: 5 | - npm run coverage # jest test with coverage flag does coverage too 6 | after_script: 7 | - "cat coverage/lcov.info | ./node_modules/.bin/coveralls" # sends the coverage report to coveralls 8 | -------------------------------------------------------------------------------- /packages/engine-server/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "node" # use latest stable nodejs version 4 | script: 5 | - npm run coverage # jest test with coverage flag does coverage too 6 | after_script: 7 | - "cat coverage/lcov.info | ./node_modules/.bin/coveralls" # sends the coverage report to coveralls 8 | -------------------------------------------------------------------------------- /packages/lsp-client/client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2019", 5 | "lib": ["ES2019"], 6 | "outDir": "out", 7 | "rootDir": "src", 8 | "sourceMap": true 9 | }, 10 | "include": ["src"], 11 | "exclude": ["node_modules", ".vscode-test"] 12 | } 13 | -------------------------------------------------------------------------------- /packages/dendron-cli/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "rootDirs": ["src", "bin"], 6 | "skipLibCheck": true 7 | }, 8 | "include": ["src/**/*", "bin/*"], 9 | "exclude": ["node_modules", "**/*-spec.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/api-server/src/constants.ts: -------------------------------------------------------------------------------- 1 | import { DendronError } from "@dendronhq/common-all"; 2 | 3 | export const LOG_FILE_NAME = "dendron.server.log"; 4 | 5 | export function getLogPath(): string { 6 | if (!process.env["LOG_DST"]) { 7 | throw new DendronError({ msg: "log not set" }); 8 | } 9 | return process.env["LOG_DST"]; 10 | } 11 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/engine-server/index.ts: -------------------------------------------------------------------------------- 1 | import ENGINE_MULTI_TEST_PRESET from "./engine-multi"; 2 | import ENGINE_SINGLE_TEST_PRESET from "./engine-single"; 3 | import NOTE_REF from "./note-refs"; 4 | 5 | export const ENGINE_SERVER = { 6 | NOTE_REF, 7 | ENGINE_MULTI_TEST_PRESET, 8 | ENGINE_SINGLE_TEST_PRESET, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/publish-insider.sh: -------------------------------------------------------------------------------- 1 | version=`cat package.json | jq ".version" -r` 2 | name=`cat package.json | jq ".name" -r` 3 | package="$name-$version.vsix" 4 | 5 | aws s3 cp $package s3://artifacts-prod-artifactb7980f61-19orqnnuurvwy/publish/$package 6 | echo https://artifacts-prod-artifactb7980f61-19orqnnuurvwy.s3.amazonaws.com/publish/$package -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "0.16.0", 6 | "npmClient": "npm", 7 | "command": { 8 | "version": { 9 | "conventionalCommits": true, 10 | "message": "chore(release): publish", 11 | "changelogPreset": "@dendronhq/conventional-changelog-dendron", 12 | "yes": true 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/plugin-core/src/types.ts: -------------------------------------------------------------------------------- 1 | export type WorkspaceFolderRaw = { 2 | path: string; 3 | name?: string; 4 | }; 5 | 6 | export type WorkspaceSettings = { 7 | folders: WorkspaceFolderRaw[]; 8 | settings: any; 9 | extensions: any; 10 | }; 11 | 12 | export type EngineFlavor = "note" | "schema"; 13 | export type EngineOpts = { 14 | flavor: EngineFlavor; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/plugin-core/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "outDir": "out", 5 | "rootDirs": ["src"], 6 | "declaration": false, 7 | "skipLibCheck": true 8 | }, 9 | "exclude": [ 10 | "node_modules", 11 | "lib", 12 | "local", 13 | ".vscode-test", 14 | "out" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/dendron-next-server/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Layout from "../components/layout"; 3 | import "../styles/globals.css"; 4 | import 'antd/dist/antd.css' 5 | 6 | function App({ Component, pageProps }) { 7 | return }> 8 | 9 | 10 | } 11 | 12 | export default App; -------------------------------------------------------------------------------- /packages/dendron-cli/src/commands/base.ts: -------------------------------------------------------------------------------- 1 | import { createLogger } from "@dendronhq/common-server"; 2 | 3 | export abstract class BaseCommand { 4 | public L: ReturnType; 5 | 6 | constructor(name?: string) { 7 | this.L = createLogger(name || "Command"); 8 | } 9 | 10 | abstract async execute(opts?: TOpts): Promise; 11 | } 12 | -------------------------------------------------------------------------------- /vendor/dendron-remark-math/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import {Plugin} from 'unified' // eslint-disable-line import/no-extraneous-dependencies 2 | 3 | declare namespace remarkMath { 4 | interface RemarkMathOptions { 5 | inlineMathDouble?: boolean 6 | } 7 | 8 | type Math = Plugin<[RemarkMathOptions?]> 9 | } 10 | 11 | declare const remarkMath: remarkMath.Math 12 | 13 | export = remarkMath 14 | -------------------------------------------------------------------------------- /vendor/dendron-remark-math/util.js: -------------------------------------------------------------------------------- 1 | exports.isRemarkParser = isRemarkParser 2 | exports.isRemarkCompiler = isRemarkCompiler 3 | 4 | function isRemarkParser(parser) { 5 | return Boolean(parser && parser.prototype && parser.prototype.blockTokenizers) 6 | } 7 | 8 | function isRemarkCompiler(compiler) { 9 | return Boolean(compiler && compiler.prototype && compiler.prototype.visitors) 10 | } 11 | -------------------------------------------------------------------------------- /packages/api-server/src/core.ts: -------------------------------------------------------------------------------- 1 | import { createLogger, DLogger } from "@dendronhq/common-server"; 2 | 3 | let L: DLogger | undefined; 4 | 5 | export function setLogger({ logPath }: { logPath: string }) { 6 | L = createLogger("dendron.server", logPath); 7 | } 8 | 9 | export function getLogger() { 10 | if (!L) { 11 | L = createLogger("dendron.server"); 12 | } 13 | return L; 14 | } 15 | -------------------------------------------------------------------------------- /packages/engine-server/src/external/memo/types.ts: -------------------------------------------------------------------------------- 1 | import { URI } from "vscode-uri"; 2 | 3 | export type WorkspaceCache = { 4 | imageUris: URI[]; 5 | markdownUris: URI[]; 6 | otherUris: URI[]; 7 | allUris: URI[]; 8 | danglingRefs: string[]; 9 | danglingRefsByFsPath: { [key: string]: string[] }; 10 | }; 11 | 12 | export type RefT = { 13 | label: string; 14 | ref: string; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/pods-core/src/types.ts: -------------------------------------------------------------------------------- 1 | import { DPod } from "./basev2"; 2 | 3 | export interface PodClassEntryV4 { 4 | id: string; 5 | description: string; 6 | kind: PodKind; 7 | new (): DPod; 8 | } 9 | 10 | export type PodItemV4 = { 11 | id: string; 12 | description: string; 13 | podClass: PodClassEntryV4; 14 | }; 15 | 16 | export type PodKind = "import" | "export" | "publish"; 17 | -------------------------------------------------------------------------------- /packages/engine-server/src/topics/markdown/plugins/__tests__/utils.ts: -------------------------------------------------------------------------------- 1 | import { DNoteRefData, DNoteRefLink } from "@dendronhq/common-all"; 2 | 3 | export function createRefLink({ 4 | fname, 5 | ...data 6 | }: { fname: string } & DNoteRefData): DNoteRefLink { 7 | return { 8 | data: { ...data, type: "file" }, 9 | from: { 10 | fname, 11 | }, 12 | type: "ref", 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /packages/api-server/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Cat Coding 7 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/common-server/src/__tests__/file.spec.ts: -------------------------------------------------------------------------------- 1 | import { cleanFileName } from "../files"; 2 | 3 | describe("cleanFileName", () => { 4 | test("cleanFileName", () => { 5 | expect(cleanFileName("foo")).toEqual("foo"); 6 | }); 7 | 8 | // TODO: doesn't work on windows 9 | test.skip("cleanFileName", () => { 10 | expect(cleanFileName("Data/1 foo.md")).toEqual("data.1-foo"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/plugin-core/src/external/memo/types.ts: -------------------------------------------------------------------------------- 1 | import { Uri } from 'vscode'; 2 | 3 | export type WorkspaceCache = { 4 | imageUris: Uri[]; 5 | markdownUris: Uri[]; 6 | otherUris: Uri[]; 7 | allUris: Uri[]; 8 | danglingRefs: string[]; 9 | danglingRefsByFsPath: { [key: string]: string[] }; 10 | }; 11 | 12 | export type RefT = { 13 | label: string; 14 | ref: string; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/engine-server/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./enginev2"; 2 | export * from "./config"; 3 | export * from "./drivers/file/storev2"; 4 | export * from "./utils"; 5 | export * from "./topics/markdown"; 6 | export * from "./topics/connector"; 7 | export * from "./topics/git"; 8 | export * from "./fuseEngine"; 9 | export * from "./engineClient"; 10 | export * from "./workspace"; 11 | export * from "./types"; 12 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export OVSX_PAT=`cat /Users/kevinlin/projects/dendronv2/dendron-playbooks/secrets/OVSX_PAT` 4 | 5 | # echo "upgrade version..." 6 | # yarn version --patch 7 | 8 | # echo "publish..." 9 | # vsce package 10 | 11 | echo "publish to vscode..." 12 | vsce publish 13 | 14 | echo "publish to ovsx..." 15 | ovsx publish 16 | 17 | # echo "push..." 18 | # git push -------------------------------------------------------------------------------- /packages/common-all/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./types"; 2 | export * from "./typesv2"; 3 | export * from "./nodev2"; 4 | export * from "./helpers"; 5 | export * from "./env"; 6 | export * from "./logger"; 7 | export * from "./assert"; 8 | export * from "./uuid"; 9 | export * from "./constants"; 10 | export * from "./error"; 11 | export * from "./time"; 12 | export * from "./utils"; 13 | export * from "./vault"; 14 | -------------------------------------------------------------------------------- /packages/dendron-next-server/lib/env.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash" 2 | import { ENV } from "./config" 3 | import { StageEnv } from "./types"; 4 | 5 | export function getStage() { 6 | return process.env.STAGE 7 | } 8 | 9 | export function env(key: keyof StageEnv): any { 10 | const stage = getStage(); 11 | return ENV[stage][key] 12 | } 13 | 14 | export function dump(): StageEnv { 15 | return ENV[getStage()]; 16 | } 17 | -------------------------------------------------------------------------------- /dev/dev.t.changelog.md: -------------------------------------------------------------------------------- 1 | # Cook 2 | 3 | ### Updating the changelog 4 | 5 | - make edits in {root}/CHANGELOG.md 6 | 7 | ```sh 8 | cp CHANGELOG.md packages/plugin-core/CHANGELOG.md 9 | git add . 10 | git commit -m "chore: update changelog" 11 | git push 12 | ``` 13 | 14 | ### Updating git tags 15 | 16 | GIT_TAG="v0.4.3" 17 | git tag $GIT_TAG --delete 18 | git push --delete origin $GIT_TAG 19 | git tag \$GIT_TAG 20 | git push --tags 21 | -------------------------------------------------------------------------------- /packages/lsp-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2019", 4 | "lib": ["ES2019"], 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "esModuleInterop": true, 8 | "skipLibCheck": true, 9 | "sourceMap": true, 10 | "strict": true, 11 | "outDir": "out", 12 | "rootDir": "src" 13 | }, 14 | "include": ["src"], 15 | "exclude": ["node_modules", ".vscode-test"] 16 | } 17 | -------------------------------------------------------------------------------- /packages/api-server/src/store/__tests__/memoryStore.spec.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStore } from "../memoryStore"; 2 | 3 | describe("memory store", () => { 4 | let store: MemoryStore; 5 | 6 | beforeEach(() => { 7 | store = MemoryStore.instance(true); 8 | }); 9 | 10 | test("basic", async () => { 11 | await store.put("foo", 1); 12 | const resp = await store.list("foo"); 13 | expect(resp).toMatchSnapshot(); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/lsp-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2019", 5 | "lib": ["ES2019"], 6 | "outDir": "out", 7 | "rootDir": "src", 8 | "sourceMap": true 9 | }, 10 | "include": [ 11 | "src" 12 | ], 13 | "exclude": [ 14 | "node_modules", 15 | ".vscode-test" 16 | ], 17 | "references": [ 18 | { "path": "./client" }, 19 | { "path": "./server" } 20 | ] 21 | } -------------------------------------------------------------------------------- /packages/plugin-core/src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | import { Logger } from "./logger"; 3 | import { DWorkspace } from "./workspacev2"; 4 | 5 | export function activate(context: vscode.ExtensionContext) { 6 | Logger.configure(context, "debug"); 7 | require("./_extension").activate(context); 8 | return { DWorkspace }; 9 | } 10 | 11 | export function deactivate() { 12 | require("./_extension").deactivate(); 13 | } 14 | -------------------------------------------------------------------------------- /vendor/dendron-remark-math/types/test.ts: -------------------------------------------------------------------------------- 1 | import unified from 'unified' // eslint-disable-line import/no-extraneous-dependencies 2 | import math from 'remark-math' 3 | 4 | // $ExpectType Processor 5 | unified().use(math) 6 | // $ExpectType Processor 7 | unified().use(math, {inlineMathDouble: true}) 8 | // $ExpectError 9 | unified().use(math, {inlineMathDouble: 3}) 10 | // $ExpectError 11 | unified().use(math, {invalidProp: true}) 12 | -------------------------------------------------------------------------------- /packages/lsp-server/src/settings.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash"; 2 | 3 | type DendronSettings = { 4 | wsRoot: string; 5 | port: number; 6 | }; 7 | 8 | // let settings: Map> = new Map(); 9 | let settings: Partial = {}; 10 | 11 | export function getSettings() { 12 | return settings as DendronSettings; 13 | } 14 | 15 | export async function updateSettings(obj: any) { 16 | settings = { ...settings, ...obj }; 17 | } 18 | -------------------------------------------------------------------------------- /packages/plugin-core/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module" 7 | }, 8 | "plugins": ["@typescript-eslint"], 9 | "rules": { 10 | "@typescript-eslint/class-name-casing": "warn", 11 | "@typescript-eslint/semi": "warn", 12 | "curly": "warn", 13 | "eqeqeq": "warn", 14 | "no-throw-literal": "warn", 15 | "semi": "off" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/common-all/src/logger.ts: -------------------------------------------------------------------------------- 1 | import { env } from "./env"; 2 | import pino from "pino"; 3 | 4 | function createLogger(name?: string) { 5 | const level = env("LOG_LEVEL", { shouldThrow: false }) || "debug"; 6 | const nameClean = name || env("LOG_NAME"); 7 | return pino({ name: nameClean, level }); 8 | } 9 | 10 | export { createLogger }; 11 | 12 | export function logAndThrow(logger: pino.Logger, msg: any): never { 13 | logger.error(msg); 14 | throw JSON.stringify(msg); 15 | } 16 | -------------------------------------------------------------------------------- /packages/lsp-client/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.build.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "target": "es2019", 6 | "lib": ["ES2019"], 7 | "outDir": "out", 8 | "rootDir": "src", 9 | "sourceMap": true 10 | }, 11 | "include": [ 12 | "src" 13 | ], 14 | "exclude": [ 15 | "node_modules", 16 | ".vscode-test" 17 | ], 18 | "references": [ 19 | { "path": "./client" }, 20 | { "path": "./server" } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/engine-server/src/__tests__/__snapshots__/enginev3.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`engine, notes/ init/ basic/: dir1 1`] = ` 4 | Array [ 5 | "foo.ch1.md", 6 | "foo.md", 7 | "foo.schema.yml", 8 | "root.md", 9 | "root.schema.yml", 10 | ] 11 | `; 12 | 13 | exports[`engine, notes/ init/ basic/: dir2 1`] = ` 14 | Array [ 15 | "bar.ch1.md", 16 | "bar.md", 17 | "bar.schema.yml", 18 | "root.md", 19 | "root.schema.yml", 20 | ] 21 | `; 22 | -------------------------------------------------------------------------------- /packages/dendron-cli/src/commands/__tests__/utils.ts: -------------------------------------------------------------------------------- 1 | import { DendronSiteConfig } from "@dendronhq/common-all"; 2 | import _ from "lodash"; 3 | 4 | export function setupDendronPubConfig(opts: { 5 | siteHierarchies?: string[]; 6 | siteRootDir: string; 7 | }) { 8 | const { siteHierarchies, siteRootDir } = _.defaults(opts, { 9 | siteHierarchies: ["root"], 10 | }); 11 | const config: DendronSiteConfig = { 12 | siteHierarchies, 13 | siteRootDir, 14 | }; 15 | return config; 16 | } 17 | -------------------------------------------------------------------------------- /packages/plugin-core/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } 12 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git reset --hard 4 | git clean -f 5 | git pull 6 | # conform to vscode naming convention 7 | sed -ibak 's/@dendronhq.plugin-core/dendron/' package.json 8 | sed -ibak 's/out\/extension/dist\/extension/' package.json 9 | 10 | cat package.json | jq '.repository = { "url": "https://github.com/dendronhq/dendron.git", "type": "git" }' > tmp.json 11 | mv tmp.json package.json 12 | 13 | ./scripts/sync_vault.sh 14 | npm install 15 | vsce package 16 | -------------------------------------------------------------------------------- /packages/common-all/src/assert.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash"; 2 | 3 | export class AssertionError extends Error {} 4 | 5 | export function assertExists(val: T, msg: string): NonNullable { 6 | if (_.isNull(val) || _.isUndefined(val)) { 7 | throw new AssertionError(msg); 8 | } 9 | // @ts-ignore 10 | return val; 11 | } 12 | 13 | export function assert(statement: boolean, msg: string) { 14 | if (!statement) { 15 | throw new AssertionError(msg); 16 | } else { 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /playbooks/addTypes.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost # use all for remote 2 | vars: 3 | ts_module: "qs" 4 | tasks: 5 | - name: Ansible Basic Variable Example 6 | debug: 7 | msg: "{{ root }}" 8 | - name: Create dir 9 | file: 10 | path: "{{root}}/app/@types/{{ts_module}}" 11 | state: directory 12 | mode: "0755" 13 | - name: Create type file 14 | template: 15 | src: ../templates/type.d.ts.jinja 16 | dest: "{{root}}/app/@types/{{ts_module}}/index.d.ts" 17 | -------------------------------------------------------------------------------- /bootstrap/scripts/watch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "watching..." 4 | npx lerna run watch --parallel 5 | \ --scope @dendronhq/common-all 6 | \ --scope @dendronhq/common-server 7 | \ --scope @dendronhq/engine-server 8 | \ --scope @dendronhq/plugin-core 9 | \ --scope @dendronhq/dendron-cli 10 | \ --scope @dendronhq/pods-core 11 | \ --scope @dendronhq/seeds-core 12 | \ --scope @dendronhq/lsp-server 13 | \ --scope @dendronhq/api-server 14 | \ --scope @dendronhq/dendron-next-server 15 | \ --scope @dendronhq/common-test-utils -------------------------------------------------------------------------------- /packages/engine-server/src/external/memo/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module "markdown-it-regex"; 2 | 3 | declare module "cross-path-sort" { 4 | type SortOptions = { 5 | pathKey?: string; 6 | shallowFirst?: boolean; 7 | deepFirst?: boolean; 8 | homePathsSupported?: boolean; 9 | posixOrder?: ("rel" | "home" | "abs")[]; 10 | windowsOrder?: ("rel" | "home" | "abs" | "drel" | "dabs" | "unc" | "nms")[]; 11 | segmentCompareFn?: (a: string, b: string) => number; 12 | }; 13 | 14 | export function sort(paths: T[], options?: SortOptions): T[]; 15 | } 16 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/Contribute.ts: -------------------------------------------------------------------------------- 1 | import { env, Uri } from "vscode"; 2 | import { BasicCommand } from "./base"; 3 | 4 | type CommandOpts = {}; 5 | 6 | type CommandInput = {}; 7 | 8 | type CommandOutput = void; 9 | 10 | export class ContributeCommand extends BasicCommand< 11 | CommandOpts, 12 | CommandOutput 13 | > { 14 | async gatherInputs(): Promise { 15 | return {}; 16 | } 17 | async execute() { 18 | env.openExternal( 19 | Uri.parse("https://accounts.dendron.so/account/subscribe") 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/plugin-core/src/external/memo/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'markdown-it-regex'; 2 | 3 | declare module 'cross-path-sort' { 4 | type SortOptions = { 5 | pathKey?: string; 6 | shallowFirst?: boolean; 7 | deepFirst?: boolean; 8 | homePathsSupported?: boolean; 9 | posixOrder?: ('rel' | 'home' | 'abs')[]; 10 | windowsOrder?: ('rel' | 'home' | 'abs' | 'drel' | 'dabs' | 'unc' | 'nms')[]; 11 | segmentCompareFn?: (a: string, b: string) => number; 12 | }; 13 | 14 | export function sort(paths: T[], options?: SortOptions): T[]; 15 | } 16 | -------------------------------------------------------------------------------- /packages/plugin-core/src/services/EngineAPIService.ts: -------------------------------------------------------------------------------- 1 | import { DendronEngineClient } from "@dendronhq/engine-server"; 2 | import path from "path"; 3 | import { DendronWorkspace } from "../workspace"; 4 | 5 | export class EngineAPIService extends DendronEngineClient { 6 | static create({ port }: { port: number | string }) { 7 | const vaults = 8 | DendronWorkspace.instance().vaults?.map((ent) => ent.fsPath) || []; 9 | const ws = path.dirname(DendronWorkspace.workspaceFile().fsPath); 10 | return DendronEngineClient.create({ vaults, ws, port }); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/common-server/src/__tests__/__snapshots__/filesv2.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`schemaModuleProps2File non-root 1`] = ` 4 | "version: 1 5 | imports: [] 6 | schemas: 7 | - id: bond 8 | children: 9 | - ch1 10 | title: bond 11 | parent: root 12 | - id: ch1 13 | children: [] 14 | title: ch1 15 | " 16 | `; 17 | 18 | exports[`schemaModuleProps2File root 1`] = ` 19 | "version: 1 20 | imports: [] 21 | schemas: 22 | - id: root 23 | children: [] 24 | title: root 25 | parent: root 26 | " 27 | `; 28 | -------------------------------------------------------------------------------- /.eslintcache: -------------------------------------------------------------------------------- 1 | [{"/Users/kevinlin/projects/dendronv2/dendron/packages/plugin-core/src/utils.ts":"1"},{"size":3529,"mtime":1594759191451,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"14rnt4r","/Users/kevinlin/projects/dendronv2/dendron/packages/plugin-core/src/utils.ts",["6"],{"ruleId":"7","message":"8","line":1,"column":1,"endLine":1,"endColumn":2,"severity":2,"nodeType":null},"@typescript-eslint/class-name-casing","Definition for rule '@typescript-eslint/class-name-casing' was not found."] -------------------------------------------------------------------------------- /bootstrap/scripts/lerna-helpers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function run() { 4 | cmd=$@ 5 | echo $cmd 6 | eval $cmd || 0 7 | } 8 | 9 | function install() { 10 | package=$1 11 | scope=$2 12 | suffix="" 13 | if [[ -z $package || -z $scope ]]; then 14 | echo "install {package} {scope}" 15 | fi 16 | echo "install, args: $package $scope" 17 | if [ $scope ]; then 18 | suffix="--scope $scope" 19 | fi 20 | cmd="lerna add $package" 21 | run $cmd $suffix 22 | cmd="lerna add -D @types/$package" 23 | run $cmd $suffix 24 | } 25 | -------------------------------------------------------------------------------- /packages/dendron-next-server/styles/globals.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | padding: 0; 4 | margin: 0; 5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 7 | background: #fff; 8 | min-height: 800px; 9 | } 10 | 11 | a { 12 | color: inherit; 13 | text-decoration: none; 14 | } 15 | 16 | :root { 17 | --amplify-primary-color: #54b758; 18 | --amplify-primary-tint: #54b758; 19 | --amplify-primary-shade: #54b758; 20 | } 21 | 22 | /* * { 23 | box-sizing: border-box; 24 | } */ 25 | -------------------------------------------------------------------------------- /bootstrap/scripts/install.sh: -------------------------------------------------------------------------------- 1 | 2 | function run() { 3 | cmd=$@ 4 | echo $cmd 5 | eval $cmd || 0 6 | } 7 | 8 | function install() { 9 | package=$1 10 | scope=$2 11 | suffix="" 12 | if [[ -z $package || -z $scope ]]; then 13 | echo "install {package} {scope}" 14 | exit 0 15 | fi 16 | echo "install, args: $package $scope" 17 | if [ $scope ]; then 18 | suffix="--scope $scope" 19 | fi 20 | cmd="lerna add $package" 21 | run $cmd $suffix 22 | cmd="lerna add -D @types/$package" 23 | run $cmd $suffix 24 | } 25 | 26 | install $1 $2 -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/engine-server/engine-multi.ts: -------------------------------------------------------------------------------- 1 | import { TestPresetEntry } from "../../utils"; 2 | import ENGINE_SINGLE_TEST_PRESET from "./engine-single"; 3 | 4 | const INIT = { 5 | WITH_STUBS: new TestPresetEntry({ 6 | label: "with stubs", 7 | before: ENGINE_SINGLE_TEST_PRESET.INIT.WITH_STUBS.before, 8 | results: async ({}: {}) => { 9 | return []; 10 | }, 11 | }), 12 | results: ENGINE_SINGLE_TEST_PRESET.INIT.WITH_STUBS.results, 13 | }; 14 | 15 | const ENGINE_MULTI_TEST_PRESET = { 16 | INIT, 17 | }; 18 | 19 | export default ENGINE_MULTI_TEST_PRESET; 20 | -------------------------------------------------------------------------------- /packages/dendron-next-server/public/static/memberful.js: -------------------------------------------------------------------------------- 1 | 2 | window.MemberfulOptions = {site: "https://dendron.memberful.com"}; 3 | 4 | (function() { 5 | var s = document.createElement('script'); 6 | 7 | s.type = 'text/javascript'; 8 | s.async = true; 9 | s.src = 'https://d35xxde4fgg0cx.cloudfront.net/assets/embedded.js'; 10 | 11 | setup = function() { window.MemberfulEmbedded.setup(); } 12 | 13 | s.addEventListener("load", setup, false); 14 | 15 | ( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s ); 16 | })(); 17 | -------------------------------------------------------------------------------- /packages/dendron-next-server/styles/layout.module.css: -------------------------------------------------------------------------------- 1 | .logo { 2 | float: left; 3 | width: 120px; 4 | } 5 | .headerImage { 6 | width: 6rem; 7 | height: 6rem; 8 | } 9 | .siteLayoutBackground { 10 | background: #fff; 11 | } 12 | /* .container { 13 | max-width: 36rem; 14 | padding: 0 1rem; 15 | margin: 3rem auto 6rem; 16 | } 17 | 18 | .header { 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | } 23 | 24 | 25 | .headerHomeImage { 26 | width: 8rem; 27 | height: 8rem; 28 | } 29 | 30 | .backToHome { 31 | margin: 3rem 0 0; 32 | } 33 | */ 34 | -------------------------------------------------------------------------------- /packages/lsp-client/client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [0.12.3-alpha.2](https://github.com/Microsoft/vscode-extension-samples/compare/v0.12.3-alpha.1...v0.12.3-alpha.2) (2020-09-24) 7 | 8 | **Note:** Version bump only for package @dendronhq/lsp-client 9 | 10 | ## [0.12.3-alpha.1](https://github.com/Microsoft/vscode-extension-samples/compare/v0.12.3-alpha.0...v0.12.3-alpha.1) (2020-09-24) 11 | 12 | **Note:** Version bump only for package @dendronhq/lsp-client 13 | -------------------------------------------------------------------------------- /packages/common-all/src/vault.ts: -------------------------------------------------------------------------------- 1 | import { DVault } from "./typesv2"; 2 | import path from "path"; 3 | import _ from "lodash"; 4 | import { DendronError } from "./error"; 5 | 6 | export class VaultUtils { 7 | static getName(vault: DVault): string { 8 | return vault.name || path.basename(vault.fsPath); 9 | } 10 | static getVaultByFsPath({ 11 | vaults, 12 | fsPath, 13 | }: { 14 | fsPath: string; 15 | vaults: DVault[]; 16 | }) { 17 | const vault = _.find(vaults, { fsPath }); 18 | if (!vault) { 19 | throw new DendronError({ msg: "no vault found" }); 20 | } 21 | return vault; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/ShowPreview.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash"; 2 | import { VSCodeUtils } from "../utils"; 3 | import { MarkdownUtils } from "../utils/md"; 4 | import { BasicCommand } from "./base"; 5 | 6 | type CommandOpts = {}; 7 | type CommandOutput = any; 8 | 9 | export class ShowPreviewCommand extends BasicCommand< 10 | CommandOpts, 11 | CommandOutput 12 | > { 13 | async sanityCheck() { 14 | if (_.isUndefined(VSCodeUtils.getActiveTextEditor())) { 15 | return "No document open"; 16 | } 17 | return; 18 | } 19 | 20 | async execute(_opts: CommandOpts) { 21 | return await MarkdownUtils.openPreview(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/pods-core/src/index.ts: -------------------------------------------------------------------------------- 1 | import { JSONExportPod, JSONImportPod, JSONPublishPod } from "./builtin"; 2 | import { MarkdownImportPod, MarkdownPublishPod } from "./builtin/MarkdownPod"; 3 | import { PodClassEntryV4 } from "./types"; 4 | export * from "./builtin"; 5 | export * from "./types"; 6 | export * from "./utils"; 7 | 8 | export function getAllExportPods(): PodClassEntryV4[] { 9 | return [JSONExportPod]; 10 | } 11 | export function getAllPublishPods(): PodClassEntryV4[] { 12 | return [JSONPublishPod, MarkdownPublishPod]; 13 | } 14 | export function getAllImportPods(): PodClassEntryV4[] { 15 | return [JSONImportPod, MarkdownImportPod]; 16 | } 17 | -------------------------------------------------------------------------------- /packages/common-test-utils/src/presets/utils.ts: -------------------------------------------------------------------------------- 1 | import { NodeTestUtilsV2 } from ".."; 2 | 3 | export class NotePresetsUtils { 4 | static async createBasic({ 5 | vaultDir, 6 | fname, 7 | }: { 8 | fname: string; 9 | vaultDir: string; 10 | }) { 11 | await NodeTestUtilsV2.createSchemas({ vaultPath: vaultDir }); 12 | await NodeTestUtilsV2.createNotes({ vaultPath: vaultDir }); 13 | await NodeTestUtilsV2.createNoteProps({ 14 | vaultPath: vaultDir, 15 | rootName: fname, 16 | }); 17 | await NodeTestUtilsV2.createSchemaModuleOpts({ 18 | vaultDir: vaultDir, 19 | rootName: fname, 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/plugin-core/src/utils/pods.ts: -------------------------------------------------------------------------------- 1 | import { PodItemV4 } from "@dendronhq/pods-core"; 2 | import { QuickPickItem, window } from "vscode"; 3 | 4 | export type PodQuickPickItemV4 = QuickPickItem & PodItemV4; 5 | 6 | export const showPodQuickPickItemsV4 = (podItem: PodItemV4[]) => { 7 | const pickItems: PodQuickPickItemV4[] = podItem.map((podItem) => { 8 | return { 9 | label: podItem.id, 10 | ...podItem, 11 | } as PodQuickPickItemV4; 12 | }); 13 | return window.showQuickPick(pickItems, { 14 | placeHolder: "Choose a Pod", 15 | ignoreFocusOut: false, 16 | matchOnDescription: true, 17 | canPickMany: false, 18 | }); 19 | }; 20 | -------------------------------------------------------------------------------- /packages/common-all/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "target": "ES2019", 6 | "lib": ["es2019"], 7 | "sourceMap": true, 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "declaration": true, 12 | // --- checks 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": true, 15 | "noImplicitAny": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | // --- language features 19 | "experimentalDecorators": true, 20 | "emitDecoratorMetadata": true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/pods-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "target": "ES2019", 6 | "lib": ["es2019"], 7 | "sourceMap": true, 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "declaration": true, 12 | // --- checks 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": true, 15 | "noImplicitAny": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | // --- language features 19 | "experimentalDecorators": true, 20 | "emitDecoratorMetadata": true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/plugin-core/templates/command.test.j2: -------------------------------------------------------------------------------- 1 | describe("{{ command }}", function () { 2 | test("basic", function (done) { 3 | onWSActive(async () => { 4 | const uri = vscode.Uri.file( 5 | path.join(root.name, "vault", "dendron.md") 6 | ); 7 | await vscode.window.showTextDocument(uri); 8 | VSCodeUtils.showInputBox = async (opts: vscode.InputBoxOptions|undefined) => { 9 | return opts?.value; 10 | } 11 | const resp = await new {{ command }}().run() as vscode.Uri; 12 | // assert.ok({{TODO}}); 13 | done(); 14 | }); 15 | setupDendronWorkspace(root.name, ctx); 16 | }); 17 | }); -------------------------------------------------------------------------------- /packages/plugin-core/src/components/lookup/types.ts: -------------------------------------------------------------------------------- 1 | import { DNodePropsQuickInputV2, DNodePropsV2 } from "@dendronhq/common-all"; 2 | import { QuickPick } from "vscode"; 3 | import { DendronBtn } from "./buttons"; 4 | 5 | export type LookupControllerState = { 6 | buttons: DendronBtn[]; 7 | buttonsPrev: DendronBtn[]; 8 | }; 9 | 10 | export type DendronQuickPickItemV2 = QuickPick; 11 | export type DendronQuickPickerV2 = DendronQuickPickItemV2 & { 12 | buttons: DendronBtn[]; 13 | justActivated?: boolean; 14 | prev?: { activeItems: any; items: any }; 15 | onCreate?: (note: DNodePropsV2) => Promise; 16 | showDirectChildrenOnly?: boolean; 17 | }; 18 | -------------------------------------------------------------------------------- /packages/plugin-core/scripts/sync_vault.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | if [[ -d ./build ]]; then 5 | echo "pulling template..." 6 | cd build/dendron-template 7 | git pull 8 | else 9 | echo "cloning template..." 10 | mkdir build 11 | cd build 12 | git clone https://github.com/dendronhq/dendron-template.git 13 | cd dendron-template 14 | fi 15 | export LAST_COMMIT=$(git rev-parse HEAD) 16 | echo "sync $LAST_COMMIT..." 17 | 18 | rm -rf ../../assets/dendronWS || true 19 | mkdir ../../assets/dendronWS 20 | # TODO: figure out why --delete option doesn't work 21 | rsync -avq vault ../../assets/dendronWS/ --delete 22 | 23 | echo $LAST_COMMIT > ../../assets/LAST_COMMIT -------------------------------------------------------------------------------- /packages/lsp-client/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@dendronhq/lsp-client", 3 | "description": "VSCode part of a language server", 4 | "private": true, 5 | "author": "Microsoft Corporation", 6 | "license": "MIT", 7 | "version": "0.12.3-alpha.2", 8 | "publisher": "vscode", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/Microsoft/vscode-extension-samples" 12 | }, 13 | "engines": { 14 | "vscode": "^1.43.0" 15 | }, 16 | "dependencies": { 17 | "vscode-languageclient": "^6.1.3" 18 | }, 19 | "devDependencies": { 20 | "@types/vscode": "1.43.0", 21 | "vscode-test": "^1.3.0" 22 | }, 23 | "gitHead": "b747a42e317e52137dd2aa740805d44e33b77ee8" 24 | } 25 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/OpenLogs.ts: -------------------------------------------------------------------------------- 1 | import { Uri, window, workspace } from "vscode"; 2 | import { Logger } from "../logger"; 3 | import { BasicCommand } from "./base"; 4 | const L = Logger; 5 | 6 | type OpenLogsCommandOpts = {}; 7 | 8 | export class OpenLogsCommand extends BasicCommand { 9 | async execute(opts?: OpenLogsCommandOpts) { 10 | const ctx = "execute"; 11 | L.info({ ctx, opts }); 12 | const logPath = Logger.logPath; 13 | if (!logPath) { 14 | throw Error("logPath not defined"); 15 | } 16 | const doc = await workspace.openTextDocument(Uri.file(logPath)); 17 | window.showTextDocument(doc); 18 | return; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/api-server/src/routes/index.ts: -------------------------------------------------------------------------------- 1 | import { Router } from "express"; 2 | import { noteRouter } from "./note"; 3 | import { schemaRouter } from "./schema"; 4 | import { workspaceRouter } from "./workspace"; 5 | 6 | // Init router and path 7 | const router = Router(); 8 | 9 | // Add sub-routes 10 | router.use("/workspace", workspaceRouter); 11 | router.use("/note", noteRouter); 12 | router.use("/schema", schemaRouter); 13 | 14 | // const engineRouter = Router(); 15 | // engineRouter.get("health", async (_req: Request, res: Response) => { 16 | // return res.json({ok: 1}); 17 | // }); 18 | // router.use("/bond", engineRouter); 19 | 20 | // Export the base-router 21 | export { router as baseRouter }; 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2019", 5 | "lib": ["es2019", "es2020.string"], 6 | "sourceMap": true, 7 | "allowSyntheticDefaultImports": true, 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "declaration": true, 11 | // --- checks 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitAny": true, 15 | "noImplicitReturns": true, 16 | "noFallthroughCasesInSwitch": true, 17 | // --- language features 18 | "experimentalDecorators": true, 19 | "emitDecoratorMetadata": true 20 | }, 21 | "compileOnSave": true, 22 | "exclude": ["node_modules", "lib", "local", ".vscode-test", "out"] 23 | } 24 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/ConfigureCommand.ts: -------------------------------------------------------------------------------- 1 | import { DConfig } from "@dendronhq/engine-server"; 2 | import { Uri } from "vscode"; 3 | import { VSCodeUtils } from "../utils"; 4 | import { DendronWorkspace } from "../workspace"; 5 | import { BasicCommand } from "./base"; 6 | 7 | type CommandOpts = {}; 8 | 9 | type CommandOutput = void; 10 | 11 | export class ConfigureCommand extends BasicCommand { 12 | async gatherInputs(): Promise { 13 | return {}; 14 | } 15 | async execute() { 16 | const wsRoot = DendronWorkspace.rootDir() as string; 17 | const configPath = DConfig.configPath(wsRoot); 18 | const uri = Uri.file(configPath); 19 | VSCodeUtils.openFileInEditor(uri); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/common-all/src/constants.ts: -------------------------------------------------------------------------------- 1 | const ROOT_PATH = "/doc/root"; 2 | 3 | export const CONSTANTS = { 4 | ROOT_PATH, 5 | ALL_QUERY: "**/*", 6 | DENDRON_SERVER_PORT: ".dendron.port", 7 | DENDRON_WS_META: ".dendron.ws", 8 | }; 9 | 10 | export const ENGINE_ERROR_CODES = { 11 | NODE_EXISTS: "node_exists", 12 | NO_SCHEMA_FOUND: "no_schema_found", 13 | NO_ROOT_SCHEMA_FOUND: "no_root_schema_found", 14 | MISSING_SCHEMA: "missing_schema", 15 | NO_ROOT_NOTE_FOUND: "no_root_note_found", 16 | BAD_PARSE_FOR_NOTE: "bad_parse_for_note", 17 | BAD_PARSE_FOR_SCHEMA: "bad_parse_for_schema", 18 | NO_PARENT_FOR_NOTE: "no_parent_for_note", 19 | CANT_DELETE_ROOT: "no_delete_root_node", 20 | }; 21 | 22 | export enum ERROR_CODES { 23 | MINOR, 24 | } 25 | -------------------------------------------------------------------------------- /packages/dendron-next-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "strict": false, 12 | "forceConsistentCasingInFileNames": true, 13 | "noEmit": true, 14 | "esModuleInterop": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "jsx": "preserve" 20 | }, 21 | "include": [ 22 | "next-env.d.ts", 23 | "**/*.ts", 24 | "**/*.tsx" 25 | ], 26 | "exclude": [ 27 | "node_modules" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/plugin-core/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | }, 18 | "label": "npm: watch", 19 | "detail": "tsc -watch -p ./" 20 | }, 21 | { 22 | "label": "gen:config", 23 | "type": "shell", 24 | "command": "node scripts/genConfig.js", 25 | "problemMatcher": [] 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /packages/api-server/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { DEngineV2 } from "@dendronhq/common-all/src"; 2 | import { DendronEngineV2 } from "@dendronhq/engine-server"; 3 | import _ from "lodash"; 4 | import { MemoryStore } from "./store/memoryStore"; 5 | 6 | export function getWSKey(uri: string) { 7 | return _.trimEnd(uri, "/"); 8 | } 9 | 10 | export async function putWS({ 11 | ws, 12 | engine, 13 | }: { 14 | ws: string; 15 | engine: DendronEngineV2; 16 | }) { 17 | MemoryStore.instance().put(`ws:${getWSKey(ws)}`, engine); 18 | } 19 | 20 | export async function getWS({ ws }: { ws: string }) { 21 | const engine = await MemoryStore.instance().get( 22 | `ws:${getWSKey(ws)}` 23 | ); 24 | if (!engine) { 25 | throw `No Engine: ${ws}`; 26 | } 27 | return engine; 28 | } 29 | -------------------------------------------------------------------------------- /bootstrap/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "building..." 4 | npx lerna run build --scope @dendronhq/common-all || exit 1 5 | npx lerna run build --scope @dendronhq/common-server || exit 1 6 | 7 | npx lerna run build --scope @dendronhq/common-test-utils || exit 1 8 | 9 | npx lerna run build --scope @dendronhq/engine-server || exit 1 10 | npx lerna run build --scope @dendronhq/lsp-server || exit 1 11 | npx lerna run build --scope @dendronhq/api-server || exit 1 12 | 13 | npx lerna run build --scope @dendronhq/dendron-cli || exit 1 14 | npx lerna run build --parallel --scope @dendronhq/pods-core --scope @dendronhq/seeds-core || exit 1 15 | npx lerna run build --scope @dendronhq/dendron-next-server || exit 1 16 | 17 | npx lerna run build --scope @dendronhq/plugin-core || exit 1 -------------------------------------------------------------------------------- /packages/seeds-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "lib", 4 | "rootDir": "src", 5 | "module": "commonjs", 6 | "target": "ES2019", 7 | "lib": ["es2019"], 8 | "sourceMap": true, 9 | "allowSyntheticDefaultImports": true, 10 | "esModuleInterop": true, 11 | "strict": true, 12 | "declaration": true, 13 | // --- checks 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noFallthroughCasesInSwitch": true, 19 | // --- language features 20 | "experimentalDecorators": true, 21 | "emitDecoratorMetadata": true 22 | }, 23 | "compileOnSave": true, 24 | "exclude": ["node_modules", "lib", "local", ".vscode-test", "out"] 25 | } 26 | -------------------------------------------------------------------------------- /packages/common-test-utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "lib", 4 | "rootDir": "src", 5 | "module": "commonjs", 6 | "target": "ES2019", 7 | "lib": ["es2019"], 8 | "sourceMap": true, 9 | "allowSyntheticDefaultImports": true, 10 | "esModuleInterop": true, 11 | "strict": true, 12 | "declaration": true, 13 | // --- checks 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noFallthroughCasesInSwitch": true, 19 | // --- language features 20 | "experimentalDecorators": true, 21 | "emitDecoratorMetadata": true 22 | }, 23 | "compileOnSave": true, 24 | "exclude": ["node_modules", "lib", "local", ".vscode-test", "out"] 25 | } 26 | -------------------------------------------------------------------------------- /packages/api-server/src/index.ts: -------------------------------------------------------------------------------- 1 | import { getLogger } from "./core"; 2 | 3 | function launch(opts?: { port?: number; logPath?: string }): Promise { 4 | const ctx = "launch"; 5 | const listenPort = opts?.port || 0; 6 | const LOG_DST = opts?.logPath ? opts.logPath : "stdout"; 7 | process.env["LOG_DST"] = LOG_DST; 8 | const L = getLogger(); 9 | return new Promise((resolve) => { 10 | const appModule = require("./Server").appModule; 11 | const app = appModule({ logPath: LOG_DST }); 12 | const server = app.listen(listenPort, () => { 13 | const port = (server.address() as any).port; 14 | L.info({ ctx, msg: "exit", port, LOG_DST, lvl: L.level }); 15 | resolve(port); 16 | }); 17 | }); 18 | } 19 | export { appModule } from "./Server"; 20 | export { launch }; 21 | -------------------------------------------------------------------------------- /packages/plugin-core/src/test/runTestInteg.ts: -------------------------------------------------------------------------------- 1 | import * as path from "path"; 2 | 3 | import { runTests } from "vscode-test"; 4 | 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, "../../"); 10 | 11 | const extensionTestsPath = path.resolve(__dirname, "./suite-integ/index"); 12 | 13 | // Download VS Code, unzip it and run the integration test 14 | await runTests({ 15 | extensionDevelopmentPath, 16 | extensionTestsPath, 17 | extensionTestsEnv: { STAGE: "test" }, 18 | }); 19 | } catch (err) { 20 | console.error("Failed to run tests"); 21 | process.exit(1); 22 | } 23 | } 24 | 25 | main(); 26 | -------------------------------------------------------------------------------- /.versionrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "skip": { "tag": true }, 3 | "packageFiles": [{ "filename": "lerna.json", "type": "json" }], 4 | "bumpFiles": [{ "filename": "lerna.json", "type": "json" }], 5 | "types": [ 6 | { "type": "feat", "section": "Features" }, 7 | { "type": "spike", "section": "Work in Progress" }, 8 | { "type": "breaking", "section": "Breaking" }, 9 | { "type": "enhance", "section": "Enhancements" }, 10 | { "type": "fix", "section": "Bug Fixes" }, 11 | { "type": "release", "section": "Release" }, 12 | { "type": "chore", "hidden": true }, 13 | { "type": "docs", "hidden": false }, 14 | { "type": "style", "hidden": true }, 15 | { "type": "refactor", "hidden": true }, 16 | { "type": "perf", "hidden": true }, 17 | { "type": "test", "hidden": true } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/DumpStateCommand.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash"; 2 | import { Logger } from "../logger"; 3 | import { DendronWorkspace } from "../workspace"; 4 | import { BasicCommand } from "./base"; 5 | import { OpenLogsCommand } from "./OpenLogs"; 6 | 7 | type CommandOpts = {}; 8 | 9 | type CommandOutput = void; 10 | 11 | export class DumpStateCommand extends BasicCommand { 12 | async gatherInputs(): Promise { 13 | return {}; 14 | } 15 | async execute() { 16 | const ctx = "DumpStateCommand"; 17 | const engine = DendronWorkspace.instance().getEngine(); 18 | const notes = _.mapValues(engine.notes, (val) => _.omit(val, "body")); 19 | const schemas = engine.schemas; 20 | Logger.info({ ctx, notes, schemas }); 21 | await new OpenLogsCommand().execute(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dev/dev.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | 3 | ## Setup for publishing 4 | 5 | - from workspace 6 | 7 | ```sh 8 | mkdir build 9 | # TODO: get secret from 1pass 10 | echo {OVSX_SECRET} > OVSX_PAT 11 | export OVSX_PAT=`cat OVSX_PAT` 12 | git clone {dendron remote} 13 | 14 | ``` 15 | 16 | # Workflows 17 | 18 | ## Publishing a patch release 19 | 20 | - [ ] integ tests 21 | - [ ] `Pub: Local` 22 | - [ ] Test locally 23 | - [ ] Update docs 24 | - [ ] `Code: Release` 25 | - [ ] update changelog 26 | - [ ] `./scripts/changelog.sh` 27 | - [ ] announce on twitter and discord 28 | 29 | ## Publishing a minor release 30 | 31 | - [ ] publish 32 | 33 | ``` 34 | lerna publish from-package --ignore-scripts -y 35 | git push 36 | ``` 37 | 38 | - [ ] integ tests 39 | - [ ] `Pub: Local` 40 | - [ ] Test locally 41 | - [ ] `Code: Release` 42 | - [ ] announce on twitter and discord 43 | -------------------------------------------------------------------------------- /packages/api-server/src/store/memoryStore.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash"; 2 | 3 | const STORE: any = {}; 4 | 5 | export class MemoryStore { 6 | static _instance: MemoryStore; 7 | 8 | static instance(force?: boolean) { 9 | if (!MemoryStore._instance || force) { 10 | MemoryStore._instance = new MemoryStore(); 11 | } 12 | return MemoryStore._instance; 13 | } 14 | 15 | static store = () => { 16 | return STORE; 17 | }; 18 | 19 | async put(key: string, value: any) { 20 | STORE[key] = value; 21 | } 22 | 23 | async get(key: string): Promise { 24 | return STORE[key] as T; 25 | } 26 | 27 | async list(prefix: string): Promise { 28 | const keys = _.filter(_.keys(STORE), (ent: string) => 29 | ent.startsWith(prefix) 30 | ); 31 | return _.pick(STORE, keys); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/plugin-core/src/test/runTest.ts: -------------------------------------------------------------------------------- 1 | import * as path from "path"; 2 | 3 | import { runTests } from "vscode-test"; 4 | 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, "../../"); 10 | 11 | // The path to test runner 12 | // Passed to --extensionTestsPath 13 | const extensionTestsPath = path.resolve(__dirname, "./suite/index"); 14 | 15 | // Download VS Code, unzip it and run the integration test 16 | await runTests({ 17 | extensionDevelopmentPath, 18 | extensionTestsPath, 19 | extensionTestsEnv: { STAGE: "test" }, 20 | }); 21 | } catch (err) { 22 | console.error("Failed to run tests"); 23 | process.exit(1); 24 | } 25 | } 26 | 27 | main(); 28 | -------------------------------------------------------------------------------- /packages/dendron-next-server/pages/workspace/configSample.tsx: -------------------------------------------------------------------------------- 1 | import {DendronConfig} from "@dendronhq/common-all"; 2 | 3 | const getConfigData = (): {data: DendronConfig} => { 4 | return { 5 | data: { 6 | vaults: [{ 7 | fsPath: "vault" 8 | }], 9 | site: { 10 | siteHierarchies: ["dendron"], 11 | siteRootDir: "docs" 12 | } 13 | } 14 | } 15 | } 16 | 17 | const saveConfigData = (data: DendronConfig) => { 18 | console.log("data saved") 19 | } 20 | 21 | export default function ConfigSamplePage() { 22 | const {data} = getConfigData() 23 | return
24 |

Config Data

25 |
26 |             {JSON.stringify(data)}
27 |         
28 | 29 |
30 | } -------------------------------------------------------------------------------- /packages/common-all/src/config.ts: -------------------------------------------------------------------------------- 1 | export const global: GlobalConfig = {}; 2 | export const test: StageConfig = { 3 | COGNITO_POOL_ID: "TODO", 4 | COGNITO_CLIENT_ID: "TODO", 5 | }; 6 | export const dev: StageConfig = { 7 | COGNITO_POOL_ID: "us-west-2_X6icVFghe", 8 | COGNITO_CLIENT_ID: "19vkp969ss471e424pfh7trq33", 9 | }; 10 | export const prod: StageConfig = { 11 | COGNITO_POOL_ID: "us-west-2_X6icVFghe", 12 | COGNITO_CLIENT_ID: "19vkp969ss471e424pfh7trq33", 13 | // COGNITO_POOL_ID: "TODO", 14 | // COGNITO_CLIENT_ID: "TODO" 15 | }; 16 | export const config = { global, test, dev, prod }; 17 | 18 | type GlobalConfig = { 19 | LOG_LEVEL?: string; 20 | LOG_NAME?: string; 21 | LOG_DST?: string; 22 | }; 23 | 24 | type StageConfig = { 25 | COGNITO_POOL_ID: string; 26 | COGNITO_CLIENT_ID: string; 27 | }; 28 | export type ConfigKey = keyof GlobalConfig | keyof StageConfig; 29 | -------------------------------------------------------------------------------- /packages/dendron-next-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@dendronhq/dendron-next-server", 3 | "version": "0.16.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "dev:inspect": "NODE_OPTIONS='--inspect' next", 8 | "build": "next build && next export", 9 | "start": "next start", 10 | "watch": "echo 0" 11 | }, 12 | "dependencies": { 13 | "@dendronhq/common-all": "^0.16.0", 14 | "antd": "^4.6.6", 15 | "lodash": "^4.17.20", 16 | "next": "10.0.0", 17 | "react": "17.0.1", 18 | "react-d3-tree": "^1.16.1", 19 | "react-dom": "17.0.1" 20 | }, 21 | "devDependencies": { 22 | "@types/lodash": "^4.14.161", 23 | "@types/node": "^14.11.2", 24 | "@types/react": "^16.9.50", 25 | "@types/styled-components": "^5.1.3", 26 | "@types/yup": "^0.29.7", 27 | "nodemon": "^2.0.4", 28 | "typescript": "^4.0.3" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "ts-jest", 3 | clearMocks: true, 4 | coverageDirectory: "coverage", 5 | coverageReporters: ["text", "clover"], 6 | coverageThreshold: { 7 | global: { 8 | branches: 80, 9 | functions: 80, 10 | lines: 80, 11 | statements: 80, 12 | }, 13 | }, 14 | globals: { 15 | "ts-jest": { 16 | tsConfig: "tsconfig.json", 17 | diagnostics: false, 18 | }, 19 | }, 20 | moduleFileExtensions: ["ts", "tsx", "js", "json"], 21 | modulePathIgnorePatterns: ["lib"], 22 | notify: true, 23 | notifyMode: "always", 24 | testEnvironment: "node", 25 | testPathIgnorePatterns: ["utils.ts"], 26 | //roots: ["/packages"], 27 | transform: { 28 | "^.+\\.tsx?$": "ts-jest", 29 | }, 30 | //setupTestFrameworkScriptFile: "src/setupTests.ts", 31 | //snapshotSerializers: ["enzyme-to-json/serializer"], 32 | }; 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | 34 | ** Dendron Log file** 35 | Please attach the output of `>Dev:Dendron: Open Logs` here 36 | -------------------------------------------------------------------------------- /packages/lsp-server/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { getStage } from "@dendronhq/common-all"; 2 | import { IConnection, WorkspaceFolder } from "vscode-languageserver"; 3 | import { getSettings } from "./settings"; 4 | import path from "path"; 5 | import { URI } from "vscode-uri"; 6 | 7 | export class LSPUtils { 8 | static connection: IConnection | null; 9 | 10 | static instance(connection?: IConnection) { 11 | if (connection) { 12 | this.connection = connection; 13 | } 14 | } 15 | 16 | static async wsFolders(): Promise { 17 | if (getStage() === "test") { 18 | const uri = path.join(getSettings().wsRoot, "vault"); 19 | return [{ uri, name: "vault" }]; 20 | } 21 | return await (this 22 | .connection as IConnection).workspace.getWorkspaceFolders(); 23 | } 24 | 25 | static log(msg: any) { 26 | LSPUtils.connection?.console.log(JSON.stringify(msg)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/dendron-next-server/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env.local 29 | .env.development.local 30 | .env.test.local 31 | .env.production.local 32 | 33 | # vercel 34 | .vercel 35 | 36 | #amplify 37 | amplify/\#current-cloud-backend 38 | amplify/.config/local-* 39 | amplify/mock-data 40 | amplify/backend/amplify-meta.json 41 | amplify/backend/awscloudformation 42 | build/ 43 | dist/ 44 | node_modules/ 45 | aws-exports.js 46 | awsconfiguration.json 47 | amplifyconfiguration.json 48 | amplify-build-config.json 49 | amplify-gradle-config.json 50 | amplifytools.xcconfig -------------------------------------------------------------------------------- /packages/plugin-core/assets/jekyll/_config.yml: -------------------------------------------------------------------------------- 1 | # uncomment to preview locally 2 | #theme: "just-the-docs" 3 | remote_theme: dendronhq/dendron-jekyll 4 | title: Dendron 5 | logo: "/assets/images/logo.png" 6 | exclude: [ "node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile", "*/dendron.template.release.md" 7 | ] 8 | footer_content: "" 9 | 10 | gh_edit_link: false 11 | 12 | # seo 13 | tagline: "A better way to know" 14 | description: "Dendron is a local-first, markdown based, hierarchical note taking tool. It is meant to help you create, organize, and collaborate on knowledge bases of any size." 15 | twitter: 16 | card: summary 17 | username: dendronhq 18 | author: 19 | twitter: dendronhq 20 | 21 | defaults: 22 | - 23 | scope: 24 | path: "notes" # an empty string here means all files in the project 25 | values: 26 | layout: "default" 27 | image: "/assets/images/logo.png" 28 | -------------------------------------------------------------------------------- /packages/lsp-server/src/engine-server.ts: -------------------------------------------------------------------------------- 1 | import { WorkspaceFolder } from "vscode-languageserver"; 2 | import { DendronEngine } from "@dendronhq/engine-server"; 3 | 4 | type DendronEngineServerOpts = { 5 | roots: WorkspaceFolder[]; 6 | }; 7 | 8 | export class DendronEngineServer { 9 | protected _engine?: DendronEngine; 10 | 11 | constructor(public opts: DendronEngineServerOpts) {} 12 | 13 | static _instance: DendronEngineServer | null; 14 | 15 | static getOrCreate(opts: DendronEngineServerOpts) { 16 | if (!DendronEngineServer._instance) { 17 | DendronEngineServer._instance = new DendronEngineServer(opts); 18 | } 19 | return DendronEngineServer._instance; 20 | } 21 | 22 | init() { 23 | const root = this.opts.roots[0]; 24 | if (!root) { 25 | return; 26 | } 27 | const engine = DendronEngine.getOrCreateEngine({ 28 | root: root.uri, 29 | forceNew: true, 30 | }) as DendronEngine; 31 | this._engine = engine; 32 | this._engine.init(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/common-all/src/error.ts: -------------------------------------------------------------------------------- 1 | import { ERROR_CODES } from "./constants"; 2 | 3 | export class DendronError extends Error { 4 | public status: string; 5 | public msg: string; 6 | public friendly?: string; 7 | public payload?: string; 8 | public code?: ERROR_CODES; 9 | 10 | constructor({ 11 | friendly, 12 | msg, 13 | status, 14 | payload, 15 | code, 16 | }: { 17 | friendly?: string; 18 | msg?: string; 19 | status?: string; 20 | code?: number; 21 | payload?: any; 22 | }) { 23 | super(msg); 24 | this.status = status || "unknown"; 25 | this.msg = msg || ""; 26 | this.friendly = friendly; 27 | if (payload?.message && payload?.stack) { 28 | this.payload = JSON.stringify({ 29 | msg: payload.message, 30 | stack: payload.stack, 31 | }); 32 | } else { 33 | this.payload = JSON.stringify(payload || {}); 34 | } 35 | this.code = code; 36 | } 37 | } 38 | 39 | export class IllegalOperationError extends DendronError {} 40 | -------------------------------------------------------------------------------- /packages/dendron-cli/src/commands/backfillV2.ts: -------------------------------------------------------------------------------- 1 | import { DEngineClientV2, NoteUtilsV2 } from "@dendronhq/common-all"; 2 | import _ from "lodash"; 3 | import { BaseCommand } from "./base"; 4 | 5 | type CommandOpts = { engine: DEngineClientV2 } & CommonOpts; 6 | 7 | type CommonOpts = { 8 | overwriteFields?: string[]; 9 | }; 10 | 11 | type CommandOutput = void; 12 | 13 | export class BackfillV2Command extends BaseCommand { 14 | async execute(opts: CommandOpts) { 15 | const { engine, overwriteFields } = _.defaults(opts, { 16 | overwriteFields: [], 17 | }); 18 | await Promise.all( 19 | _.values(engine.notes).map((n) => { 20 | overwriteFields.forEach((f) => { 21 | if (f === "title") { 22 | n.title = NoteUtilsV2.genTitle(n.fname); 23 | } else { 24 | throw Error(`unknown overwrite field: ${f}`); 25 | } 26 | }); 27 | return engine.writeNote(n); 28 | }) 29 | ); 30 | return; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/GoDownCommand.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import { DendronQuickPickerV2 } from "../components/lookup/types"; 3 | import { VSCodeUtils } from "../utils"; 4 | import { BasicCommand } from "./base"; 5 | import { LookupCommand } from "./LookupCommand"; 6 | 7 | type CommandOpts = {}; 8 | 9 | type CommandOutput = DendronQuickPickerV2; 10 | 11 | export class GoDownCommand extends BasicCommand { 12 | async gatherInputs(): Promise { 13 | return {}; 14 | } 15 | async execute() { 16 | const maybeTextEditor = VSCodeUtils.getActiveTextEditor(); 17 | let value = ""; 18 | if (maybeTextEditor) { 19 | value = path.basename(maybeTextEditor.document.uri.fsPath, ".md") + "."; 20 | if (value === "root.") { 21 | value = ""; 22 | } 23 | } 24 | 25 | const picker = (await new LookupCommand().execute({ 26 | flavor: "note", 27 | value, 28 | })) as DendronQuickPickerV2; 29 | return picker; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/plugin-core/src/test/suite/index.ts: -------------------------------------------------------------------------------- 1 | import Mocha from "mocha"; 2 | import glob from "glob"; 3 | import path from "path"; 4 | 5 | export function run(): Promise { 6 | // Create the mocha test 7 | const mocha = new Mocha({ 8 | ui: "tdd", 9 | color: true, 10 | }); 11 | 12 | const testsRoot = path.resolve(__dirname, "."); 13 | 14 | return new Promise((c, e) => { 15 | glob("**/**.test.js", { cwd: testsRoot }, (err, files) => { 16 | if (err) { 17 | return e(err); 18 | } 19 | 20 | // Add files to the test suite 21 | files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); 22 | 23 | try { 24 | // Run the mocha test 25 | mocha.run((failures) => { 26 | if (failures > 0) { 27 | e(new Error(`${failures} tests failed.`)); 28 | } else { 29 | c(); 30 | } 31 | }); 32 | } catch (err) { 33 | console.error(err); 34 | e(err); 35 | } 36 | }); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /packages/dendron-cli/src/commands/exportPod.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getAllExportPods, 3 | podClassEntryToPodItemV4, 4 | PodItemV4, 5 | } from "@dendronhq/pods-core"; 6 | import yargs from "yargs"; 7 | import { CommandCLIOpts, PodCLICommand } from "./pod"; 8 | 9 | export { CommandCLIOpts as ExportPodCLIOpts }; 10 | 11 | export class ExportPodCLICommand extends PodCLICommand { 12 | static async buildArgs(args: yargs.Argv) { 13 | const podItems: PodItemV4[] = ExportPodCLICommand.getPods().map((p) => 14 | podClassEntryToPodItemV4(p) 15 | ); 16 | return ExportPodCLICommand.buildArgsCore(args, podItems); 17 | } 18 | 19 | static getPods() { 20 | return getAllExportPods(); 21 | } 22 | 23 | static async run(args: CommandCLIOpts) { 24 | try { 25 | const cmd = new ExportPodCLICommand(); 26 | const pods = await ExportPodCLICommand.getPods(); 27 | const opts = await cmd.enrichArgs(args, pods, "export"); 28 | return cmd.execute(opts); 29 | } catch (err) { 30 | console.log(err); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/engine-server/src/topics/markdown/plugins/__tests__/dendronLinksPlugin.spec.ts: -------------------------------------------------------------------------------- 1 | import unified from "unified"; 2 | import { dendronLinksPlugin } from "../dendronLinksPlugin"; 3 | import markdownParse from "remark-parse"; 4 | 5 | function getProcessor() { 6 | return unified().use(markdownParse, { gfm: true }).use(dendronLinksPlugin); 7 | } 8 | 9 | describe("basic", () => { 10 | test("init", () => { 11 | const resp = getProcessor().parse(`[["foo.md"]]`); 12 | expect(resp).toMatchSnapshot(); 13 | // @ts-ignore 14 | expect(resp.children[0].children[0].type).toEqual("wikiLink"); 15 | }); 16 | 17 | test("doesn't parse inline code block", () => { 18 | const resp = getProcessor().parse("`[[foo.md]]`"); 19 | expect(resp).toMatchSnapshot("bond"); 20 | // child1 paragraph, child2 link 21 | // @ts-ignore 22 | // expect(resp.children[0].children[0].data.link).not.toEqual({ 23 | // type: "file", 24 | // name: "foo", 25 | // anchorStart: undefined, 26 | // anchorEnd: undefined, 27 | // }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/plugin-core/media/fontello/font/fontello.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Copyright (C) 2020 by original authors @ fontello.com 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /packages/common-server/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible Node.js debug attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Debug file", 11 | "program": "${workspaceRoot}/lib/${fileBasenameNoExtension}.js", 12 | "cwd": "${workspaceRoot}", 13 | "sourceMaps": true, 14 | "smartStep": true, 15 | "preLaunchTask": "build", 16 | "outFiles": ["${workspaceRoot}/lib/*.js"] 17 | }, 18 | { 19 | "type": "node", 20 | "request": "launch", 21 | "name": "common-server:debug test file", 22 | "program": "${workspaceFolder:common-server}/node_modules/jest/bin/jest.js", 23 | "sourceMaps": true, 24 | "smartStep": true, 25 | "cwd": "${workspaceFolder:common-server}", 26 | "args": ["--runInBand", "${relativeFile}", "-u"] 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/plugin-core/src/utils/md.ts: -------------------------------------------------------------------------------- 1 | import { extensions, commands } from "vscode"; 2 | import _ from "lodash"; 3 | 4 | export class MarkdownUtils { 5 | static async openPreview(opts?: { reuseWindow?: boolean }) { 6 | const cleanOpts = _.defaults(opts, { reuseWindow: false }); 7 | let previewEnhanced = extensions.getExtension( 8 | "dendron.markdown-preview-enhanced" 9 | ); 10 | let previewEnhanced2 = extensions.getExtension( 11 | "dendron.dendron-markdown-preview-enhanced" 12 | ); 13 | const cmds = { 14 | builtin: { 15 | open: "markdown.showPreview", 16 | openSide: "markdown.showPreviewToSide", 17 | }, 18 | enhanced: { 19 | open: "markdown-preview-enhanced.openPreview", 20 | openSide: "markdown-preview-enhanced.openPreviewToTheSide", 21 | }, 22 | }; 23 | const mdClient = 24 | cmds[previewEnhanced || previewEnhanced2 ? "enhanced" : "builtin"]; 25 | const openCmd = mdClient[cleanOpts.reuseWindow ? "open" : "openSide"]; 26 | return commands.executeCommand(openCmd); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bootstrap/.vscode/typescript.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | // Place your dendron-root workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 3 | // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 4 | // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 5 | // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 6 | // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 7 | // Placeholders with the same ids are connected. 8 | // Example: 9 | "cl.logs": { 10 | "scope": "typescript", 11 | "prefix": "cl.logs", 12 | "body": [ 13 | "console.log(ctx.logPath)", 14 | ], 15 | "description": "Log output to console" 16 | }, 17 | "qa.server": { 18 | "scope": "typescript", 19 | "prefix": "qa.server", 20 | "body": [ 21 | "configOverride: {", 22 | "\"dendron.serverPort\": 3005", 23 | "}", 24 | ], 25 | "description": "Log output to console" 26 | } 27 | } -------------------------------------------------------------------------------- /vendor/dendron-remark-math/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@dendronhq/remark-math", 3 | "version": "3.0.1", 4 | "description": "remark plugin to parse and stringify math", 5 | "license": "MIT", 6 | "keywords": [ 7 | "unified", 8 | "remark", 9 | "remark-plugin", 10 | "plugin", 11 | "mdast", 12 | "markdown", 13 | "math", 14 | "katex", 15 | "latex", 16 | "tex" 17 | ], 18 | "repository": "https://github.com/remarkjs/remark-math/tree/main/packages/remark-math", 19 | "bugs": "https://github.com/remarkjs/remark-math/issues", 20 | "author": "Junyoung Choi (https://rokt33r.github.io)", 21 | "contributors": [ 22 | "Junyoung Choi (https://rokt33r.github.io)", 23 | "Titus Wormer (https://wooorm.com)" 24 | ], 25 | "files": [ 26 | "index.js", 27 | "block.js", 28 | "inline.js", 29 | "util.js", 30 | "types/index.d.ts" 31 | ], 32 | "main": "index.js", 33 | "types": "types/index.d.ts", 34 | "scripts": { 35 | "test-types": "dtslint types" 36 | }, 37 | "xo": false 38 | } 39 | -------------------------------------------------------------------------------- /packages/dendron-next-server/public/vercel.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /packages/plugin-core/src/commands/ShowHelp.ts: -------------------------------------------------------------------------------- 1 | import _ from "lodash"; 2 | import path from "path"; 3 | import { env, Uri, window } from "vscode"; 4 | import { BasicCommand } from "./base"; 5 | 6 | type CommandOpts = {}; 7 | 8 | type CommandInput = {}; 9 | 10 | type CommandOutput = void; 11 | 12 | export class ShowHelpCommand extends BasicCommand { 13 | async gatherInputs(): Promise { 14 | const resp = await window.showInputBox({ 15 | prompt: "Select your folder for dendron", 16 | ignoreFocusOut: true, 17 | validateInput: (input: string) => { 18 | if (!path.isAbsolute(input)) { 19 | if (input[0] !== "~") { 20 | return "must enter absolute path"; 21 | } 22 | } 23 | return undefined; 24 | }, 25 | }); 26 | if (_.isUndefined(resp)) { 27 | return; 28 | } 29 | return; 30 | } 31 | async execute() { 32 | env.openExternal( 33 | Uri.parse( 34 | "https://www.dendron.so/notes/f9540bb6-7a5a-46db-ae7c-e1a606f28c73.html" 35 | ) 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/dendron-cli/src/commands/importPod.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getAllImportPods, 3 | podClassEntryToPodItemV4, 4 | PodItemV4, 5 | } from "@dendronhq/pods-core"; 6 | import yargs from "yargs"; 7 | import { CommandCLIOpts, PodCLICommand } from "./pod"; 8 | 9 | export class ImportPodCLICommand extends PodCLICommand { 10 | static getPods() { 11 | return getAllImportPods(); 12 | } 13 | 14 | static async buildArgs(args: yargs.Argv) { 15 | const podItems: PodItemV4[] = ImportPodCLICommand.getPods().map((p) => 16 | podClassEntryToPodItemV4(p) 17 | ); 18 | return ImportPodCLICommand.buildArgsCore(args, podItems); 19 | } 20 | 21 | static async run(args: CommandCLIOpts) { 22 | const ctx = "ImportPod:run"; 23 | const cmd = new ImportPodCLICommand(); 24 | cmd.L.info({ ctx, msg: "enter", args }); 25 | const pods = await ImportPodCLICommand.getPods(); 26 | const opts = await cmd.enrichArgs(args, pods, "import"); 27 | cmd.L.info({ ctx, msg: "enrichArgs:post", args }); 28 | await cmd.execute(opts); 29 | cmd.L.info({ ctx, msg: "exit", args }); 30 | return cmd; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/pod-request-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Pod Request Template 3 | about: 'When requesting a Pod (import/export method for Dendron), use this template. ' 4 | title: "[Pod Request] placeholder" 5 | labels: '' 6 | assignees: kpathakota 7 | 8 | --- 9 | 10 | #