diff options
| author | aidenlx <[email protected]> | 2022-01-23 05:13:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-22 16:13:50 -0500 |
| commit | f3286063d332c262911b96a61cf6559a47ff1820 (patch) | |
| tree | ccfbb43528e14856b47242d7ce929cc1fda0dc6b | |
| parent | 4f502e92eb96800f5feb4089fb5c5dc1974b2fa6 (diff) | |
| download | ai-pulse-obsidian-plugin-f3286063d332c262911b96a61cf6559a47ff1820.tar.gz ai-pulse-obsidian-plugin-f3286063d332c262911b96a61cf6559a47ff1820.zip | |
add version bump script (#10)
| -rw-r--r-- | .eslintrc | 1 | ||||
| -rw-r--r-- | .npmrc | 1 | ||||
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | package.json | 5 | ||||
| -rw-r--r-- | version-bump.mjs | 14 | ||||
| -rw-r--r-- | versions.json | 4 |
6 files changed, 24 insertions, 4 deletions
@@ -1,6 +1,7 @@ { "root": true, "parser": "@typescript-eslint/parser", + "env": { "node": true }, "plugins": [ "@typescript-eslint" ], @@ -0,0 +1 @@ +tag-version-prefix=""
\ No newline at end of file @@ -36,6 +36,9 @@ Quick starting guide for new plugin devs: - Upload the files `manifest.json`, `main.js`, `styles.css` as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release.
- Publish the release.
+> You can simplify the version bump process by running `npm version patch`, `npm version minor` or `npm version major` after updating `minAppVersion` manually in `manifest.json`.
+> The command will bump version in `manifest.json` and `package.json`, and add the entry for the new version to `versions.json`
+
### Adding your plugin to the community plugin list
- Check https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md
diff --git a/package.json b/package.json index 67edd6c..7f1f5f6 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "obsidian-sample-plugin", - "version": "0.12.0", + "version": "1.0.1", "description": "This is a sample plugin for Obsidian (https://obsidian.md)", "main": "main.js", "scripts": { "dev": "node esbuild.config.mjs", - "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production" + "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", + "version": "node version-bump.mjs && git add manifest.json versions.json" }, "keywords": [], "author": "", diff --git a/version-bump.mjs b/version-bump.mjs new file mode 100644 index 0000000..d409fa0 --- /dev/null +++ b/version-bump.mjs @@ -0,0 +1,14 @@ +import { readFileSync, writeFileSync } from "fs"; + +const targetVersion = process.env.npm_package_version; + +// read minAppVersion from manifest.json and bump version to target version +let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); +const { minAppVersion } = manifest; +manifest.version = targetVersion; +writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); + +// update versions.json with target version and minAppVersion from manifest.json +let versions = JSON.parse(readFileSync("versions.json", "utf8")); +versions[targetVersion] = minAppVersion; +writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); diff --git a/versions.json b/versions.json index ba14785..4bca15f 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ {
- "1.0.1": "0.9.12",
- "1.0.0": "0.9.7"
+ "1.0.0": "0.9.7",
+ "1.0.1": "0.12.0"
}
|
