diff --git a/.gitignore b/.gitignore index bcce96f..0fc5ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ test-vault/.obsidian/* # If its import to test though, add it somewhere where other # people can test it too. test-vault/untracked/* + +build diff --git a/manifest.json b/manifest.json index 8f6b80f..96dfb51 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { - "id": "obsidian-dataview-autocompletion", + "id": "dataview-autocompletion", "name": "Dataview Autocompletion", - "version": "0.6.0", + "version": "0.8.0", "minAppVersion": "0.15.0", "description": "Adds autocompletion to Dataview metadata fields", "author": "Daniel Bauer", diff --git a/package.json b/package.json index c3bb8fd..0afef64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-dataview-autocompletion", - "version": "1.0.0", + "version": "0.8", "description": "This is a plugin for Obsidian that provides autocompletion for Dataview metadata fields", "main": "main.js", "scripts": { @@ -8,8 +8,7 @@ "build": "npx rollup --config rollup.config.js --environment BUILD:production", "check-format": "npx prettier --check src", "test": "npx jest", - "version": "node version-bump.mjs && git add manifest.json versions.json", - "prepare": "husky" + "version": "node ersion-bump.mjs && git add manifest.json versions.json" }, "keywords": [ "Obsidian", diff --git a/rollup.config.js b/rollup.config.js index 6bda63b..6353d2a 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,16 +3,31 @@ import commonjs from "@rollup/plugin-commonjs"; import copy from "rollup-plugin-copy"; import typescript2 from "rollup-plugin-typescript2"; -const BASE_CONFIG = { +const createBaseConfig = (outdir) => ({ input: "src/main.ts", external: ["obsidian"], -}; + plugins: getRollupPlugins( + undefined, + copy({ + targets: [ + { + src: "manifest.json", + dest: outdir, + }, + { + src: "styles.css", + dest: outdir, + }, + ], + }), + ), +}); const getRollupPlugins = (tsconfig, ...plugins) => [typescript2(tsconfig), nodeResolve({ browser: true }), commonjs()].concat(plugins); const DEV_PLUGIN_CONFIG = { - ...BASE_CONFIG, + ...createBaseConfig("test-vault/.obsidian/plugins/dataview-suggester"), output: { dir: "test-vault/.obsidian/plugins/dataview-suggester", sourcemap: "inline", @@ -20,25 +35,10 @@ const DEV_PLUGIN_CONFIG = { exports: "default", name: "Dataview Suggester (Development)", }, - plugins: getRollupPlugins( - undefined, - copy({ - targets: [ - { - src: "manifest.json", - dest: "test-vault/.obsidian/plugins/dataview-suggester/", - }, - { - src: "styles.css", - dest: "test-vault/.obsidian/plugins/dataview-suggester/", - }, - ], - }), - ), }; const PROD_PLUGIN_CONFIG = { - ...BASE_CONFIG, + ...createBaseConfig("build"), output: { dir: "build", sourcemap: "inline", @@ -47,7 +47,6 @@ const PROD_PLUGIN_CONFIG = { exports: "default", name: "Dataview Suggester (Production)", }, - plugins: getRollupPlugins(), }; let configs = [];