commit
a3e378f219
4 changed files with 72 additions and 70 deletions
69
package.json
69
package.json
|
|
@ -4,47 +4,48 @@
|
||||||
"description": "This plugin allows for Habitica integration into Obsidian",
|
"description": "This plugin allows for Habitica integration into Obsidian",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "rollup --config rollup.config.js -w",
|
"dev": "rollup --config rollup.config.mjs -w",
|
||||||
"build": "rollup --config rollup.config.js --environment BUILD:production",
|
"build": "rollup --config rollup.config.mjs --environment BUILD:production",
|
||||||
"dev2": "obsidian-plugin dev src/main.ts"
|
"dev2": "obsidian-plugin dev src/main.ts"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "Leonard and Ran",
|
"author": "Leonard and Ran",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^18.0.0",
|
"@rollup/plugin-commonjs": "^25.0.7",
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@rollup/plugin-typescript": "^8.2.1",
|
"@rollup/plugin-typescript": "^11.1.6",
|
||||||
"@types/markdown-it": "^12.2.3",
|
"@types/markdown-it": "^13.0.7",
|
||||||
"@types/markdown-it-emoji": "^2.0.2",
|
"@types/markdown-it-emoji": "^2.0.4",
|
||||||
"@types/node": "^14.14.37",
|
"@types/node": "^20.11.0",
|
||||||
"@types/node-emoji": "^1.8.1",
|
"@types/node-emoji": "^1.8.2",
|
||||||
"@types/react": "^17.0.27",
|
"@types/react": "^18.2.47",
|
||||||
"@types/react-dom": "^17.0.9",
|
"@types/react-dom": "^18.2.18",
|
||||||
"@types/react-tabs": "^2.3.3",
|
"@types/react-tabs": "^5.0.4",
|
||||||
"@types/twemoji": "^12.1.2",
|
"@types/twemoji": "^13.1.1",
|
||||||
"css-loader": "^6.4.0",
|
"css-loader": "^6.9.0",
|
||||||
"extract-text-webpack-plugin": "^2.1.2",
|
"mini-css-extract-plugin": "^2.7.7",
|
||||||
"obsidian": "^0.12.0",
|
"obsidian": "^1.4.11",
|
||||||
"obsidian-plugin-cli": "^0.4.3",
|
"obsidian-plugin-cli": "^0.0.5",
|
||||||
"rollup": "^2.32.1",
|
"rollup": "^4.9.4",
|
||||||
"style-loader": "^3.3.0",
|
"style-loader": "^3.3.4",
|
||||||
"tslib": "^2.2.0",
|
"tslib": "^2.6.2",
|
||||||
"typescript": "^4.2.4"
|
"typescript": "^5.3.3",
|
||||||
|
"webpack": "^5.89.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"markdown-it": "^12.3.2",
|
"markdown-it": "^14.0.0",
|
||||||
"markdown-it-emoji": "^2.0.0",
|
"markdown-it-emoji": "^2.0.2",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.30.1",
|
||||||
"node": "^16.10.0",
|
"node": "^21.2.0",
|
||||||
"node-emoji": "^1.11.0",
|
"node-emoji": "^2.1.3",
|
||||||
"node-fetch": "^3.0.0",
|
"node-fetch": "^3.3.2",
|
||||||
"react": "^17.0.2",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^18.2.0",
|
||||||
"react-emoji-render": "^1.2.4",
|
"react-emoji-render": "^2.0.1",
|
||||||
"react-markdown": "^7.1.0",
|
"react-markdown": "^9.0.1",
|
||||||
"react-tabs": "^3.2.2",
|
"react-tabs": "^6.0.2",
|
||||||
"twemoji": "^13.1.0"
|
"twemoji": "^14.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,32 @@
|
||||||
import typescript from '@rollup/plugin-typescript';
|
import typescript from '@rollup/plugin-typescript';
|
||||||
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
import json from '@rollup/plugin-json';
|
import json from '@rollup/plugin-json';
|
||||||
|
|
||||||
const isProd = (process.env.BUILD === 'production');
|
const isProd = (process.env.BUILD === 'production');
|
||||||
|
|
||||||
const banner =
|
const banner =
|
||||||
`/*
|
`/*
|
||||||
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
|
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
|
||||||
if you want to view the source visit the plugins github repository
|
if you want to view the source visit the plugins github repository
|
||||||
*/
|
*/
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'src/main.ts',
|
input: 'src/main.ts',
|
||||||
output: {
|
output: {
|
||||||
dir: '.',
|
dir: '.',
|
||||||
sourcemap: 'inline',
|
sourcemap: 'inline',
|
||||||
sourcemapExcludeSources: isProd,
|
sourcemapExcludeSources: isProd,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
exports: 'default',
|
exports: 'default',
|
||||||
banner,
|
banner,
|
||||||
},
|
},
|
||||||
external: ['obsidian'],
|
external: ['obsidian'],
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
typescript(),
|
||||||
nodeResolve({browser: true}),
|
nodeResolve({browser: true}),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
json(),
|
json(),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
10
src/main.ts
10
src/main.ts
|
|
@ -39,7 +39,7 @@ export default class HabiticaSync extends Plugin {
|
||||||
this.activateView();
|
this.activateView();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
async loadSettings() {
|
async loadSettings() {
|
||||||
this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData())
|
this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData())
|
||||||
|
|
@ -50,22 +50,22 @@ export default class HabiticaSync extends Plugin {
|
||||||
|
|
||||||
async onunload() {
|
async onunload() {
|
||||||
await this.view.onClose();
|
await this.view.onClose();
|
||||||
|
|
||||||
this.app.workspace
|
this.app.workspace
|
||||||
.getLeavesOfType(VIEW_TYPE)
|
.getLeavesOfType(VIEW_TYPE)
|
||||||
.forEach((leaf) => leaf.detach());
|
.forEach((leaf) => leaf.detach());
|
||||||
}
|
}
|
||||||
async activateView() {
|
async activateView() {
|
||||||
this.app.workspace.detachLeavesOfType(VIEW_TYPE);
|
this.app.workspace.detachLeavesOfType(VIEW_TYPE);
|
||||||
|
|
||||||
await this.app.workspace.getRightLeaf(false).setViewState({
|
await this.app.workspace.getRightLeaf(false).setViewState({
|
||||||
type: VIEW_TYPE,
|
type: VIEW_TYPE,
|
||||||
active: true,
|
active: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.app.workspace.revealLeaf(
|
this.app.workspace.revealLeaf(
|
||||||
this.app.workspace.getLeavesOfType(VIEW_TYPE)[0]
|
this.app.workspace.getLeavesOfType(VIEW_TYPE)[0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es5",
|
"es5",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue