refactor: fix typo; update doc

This commit is contained in:
aidenlx 2022-01-23 04:10:02 +08:00
parent 8d975a192d
commit 976798a086
2 changed files with 7 additions and 7 deletions

View File

@ -36,8 +36,8 @@ 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. - 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. - Publish the release.
> You can simplify the version bump process by running `npm version patch`, `npm version minor` or `npm version major` after updating minimum-obsidian-version manually in `manifest.json`. > 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 vesion to `versions.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 ### Adding your plugin to the community plugin list

View File

@ -3,12 +3,12 @@ import { readFileSync, writeFileSync } from "fs";
const targetVersion = process.env.npm_package_version; const targetVersion = process.env.npm_package_version;
// read minAppVersion from manifest.json and bump version to target version // read minAppVersion from manifest.json and bump version to target version
let menifest = JSON.parse(readFileSync("manifest.json").toString()); let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
const { minAppVersion } = menifest; const { minAppVersion } = manifest;
menifest.version = targetVersion; manifest.version = targetVersion;
writeFileSync("manifest.json", JSON.stringify(menifest, null, "\t")); writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
// update versions.json with target version and minAppVersion from manifest.json // update versions.json with target version and minAppVersion from manifest.json
let versions = JSON.parse(readFileSync("versions.json").toString()); let versions = JSON.parse(readFileSync("versions.json", "utf8"));
versions[targetVersion] = minAppVersion; versions[targetVersion] = minAppVersion;
writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));