{"_id":"@64mb/semantic-release-flutter-plugin","name":"@64mb/semantic-release-flutter-plugin","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@64mb/semantic-release-flutter-plugin","version":"1.0.0","description":"semantic-release plugin to bump pubspec.yaml version with version code support","main":"index.js","scripts":{"build":"ncc build src/index.ts -m","format":"prettier --write .","test":"uvu test"},"repository":{"type":"git","url":"git+https://github.com/64mb/semantic-release-flutter-plugin.git"},"keywords":["flutter","dart","semantic-release"],"author":{"name":"64mb","email":"team@64mb.ru","url":"https://github.com/64mb"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/64mb/semantic-release-flutter-plugin","devDependencies":{"@saithodev/semantic-release-backmerge":"^3.1.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@vercel/ncc":"^0.36.1","expect":"^29.5.0","prettier":"^2.8.8","uvu":"^0.5.6"},"dependencies":{"semantic-release":"^21.0.1","semver":"^7.5.0","yaml":"^2.2.1"},"bugs":{"url":"https://github.com/64mb/semantic-release-flutter-plugin/issues"},"directories":{"test":"test"},"gitHead":"e5bb90d93be170350a5274d80c08489f0489288b","_id":"@64mb/semantic-release-flutter-plugin@1.0.0","_nodeVersion":"14.21.3","_npmVersion":"9.6.4","dist":{"integrity":"sha512-0wr8WSkseMqUiu0zq1rxok3WVNQO67NbQyHeV9nGDVhREi/f2+6bR0NwxDX0nqjd7z7JB35+l8v+OYZRg0oMKg==","shasum":"a1a11f6285ef5eea9575e875d87b9204bad2f9b9","tarball":"https://registry.npmjs.org/@64mb/semantic-release-flutter-plugin/-/semantic-release-flutter-plugin-1.0.0.tgz","fileCount":8,"unpackedSize":15669,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4YGTHkMDJ8fxbSj+ZRJStntfiBvo4XdTr286LL9ffIQIhAMu3GUK1QQMpjKOFV6/PGobj+0J9bgiSuLt+uk/W9r9d"}]},"_npmUser":{"name":"malkovgv","email":"i.malkovgv@gmail.com"},"maintainers":[{"name":"malkovgv","email":"i.malkovgv@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/semantic-release-flutter-plugin_1.0.0_1686054709555_0.7851032921742966"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-06T12:31:49.450Z","1.0.0":"2023-06-06T12:31:49.704Z","modified":"2023-06-06T12:31:50.067Z"},"maintainers":[{"name":"malkovgv","email":"i.malkovgv@gmail.com"}],"description":"semantic-release plugin to bump pubspec.yaml version with version code support","homepage":"https://github.com/64mb/semantic-release-flutter-plugin","keywords":["flutter","dart","semantic-release"],"repository":{"type":"git","url":"git+https://github.com/64mb/semantic-release-flutter-plugin.git"},"author":{"name":"64mb","email":"team@64mb.ru","url":"https://github.com/64mb"},"bugs":{"url":"https://github.com/64mb/semantic-release-flutter-plugin/issues"},"license":"SEE LICENSE IN LICENSE","readme":"# semantic-release-flutter-plugin\r\n\r\n### fork from [PalmDevs/semantic-release-flutter-plugin](https://github.com/PalmDevs/semantic-release-flutter-plugin) with old semantic-release version support without ESM import\r\n\r\n[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to bump pubspec.yaml version with version code support.\r\n> **Warning**: Your `branches` array configuration order for **semantic-release** actually matters. More explanation [here](#examples).\r\n\r\n| Step               | Description                                                                                           |\r\n| ------------------ | ----------------------------------------------------------------------------------------------------- |\r\n| `verifyConditions` | Verify if the file `pubspecPath` in configuration exists.                                             |\r\n| `prepare`          | Verify if the contents of file pubspec.yaml file is valid and updates the file's version field.       |\r\n\r\n## Install\r\n\r\n```bash\r\n$ npm install semantic-release-flutter-plugin -D\r\n```\r\n\r\n### Options\r\n\r\n| Options                  | Description                                                                   | Default                                                                             |\r\n| ------------------------ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |\r\n| `pubspecPath`            | The path of the **pubspec.yaml** file | `${CWD}/pubspec.yaml`<br/><br/>Where `CWD` is `context.cwd` given by **semantic-release** or if undefined, `process.cwd()`. |                                                                                                                     |\r\n| `majorWeight`            | The weight of a major version         | `100000000` (100 million)                                                                                                   |\r\n| `minorWeight`            | The weight of a minor version         | `100000` (100 thousand)                                                                                                     |\r\n| `patchWeight`            | The weight of a patch version         | `1000`                                                                                                                      |\r\n| `channelWeight`          | The weight of a release channel       | `100`                                                                                                                       |\r\n| `preReleaseWeight`       | The weight of a prerelease number     | `1`                                                                                                                         |\r\n\r\n#### Deciding weights\r\n[The highest version code Play Store allows is `2100000000` (2 billion, 100 million)](https://developer.android.com/studio/publish/versioning#versioningsettings). Which means you'll need to configure the weights carefully. This is also very close to the 32-bit integer limit.\r\n\r\nIf you don't want to publish your app to Play Store or support 32-bit devices, the limit can be safely ignored.  \r\n\r\nThe default configuration allows for:\r\n- 21 major versions\r\n- 1000 minor versions (in a single major version)\r\n- 100 patch versions (in a single minor version)\r\n- 10 release channels\r\n- 100 prerelease builds (in a single version)\r\n\r\n> The limits are calculated by doing `upperNonZeroWeight / currentWeight`, eg. if you want to calculate a minor version limit, you can do `majorWeight / minorWeight`.\r\n>\r\n> If `upperNonZeroWeight` is `0`, look for the upper weight of the `upperWeight`, eg. if you set `channelWeight` to `0`, the formula for prerelease number limit is `patchWeight / preReleaseWeight` *(because `patchWeight` is `channelWeight`'s upper limit)*.\r\n\r\n### How version codes are calculated\r\nThe weight properties in the configuration is responsible for all the computing. The plugin gets each version number and multiplies it by the weight given in configuration. **There are exceptions**, such as the prerelease build number which gets `1` removed from the number before multiplying (because the first prerelease number always is `1` and not `0`). Here are examples for the default configuration.\r\n\r\n**v1.2.3**\r\n- `1 * 100000000` (major)\r\n- `2 * 100000` (minor)\r\n- `3 * 1000` (patch)\r\n- `100000000 + 200000 + 3000 = 100203000` (sum)\r\n\r\n**v1.2.4-alpha.2** ([with branches configuration below](#examples))\r\n- `1 * 100000000`\r\n- `2 * 100000`\r\n- `4 * 1000`\r\n- `2 * 100` (channel)\r\n- `(2 - 1) * 1` (prerelease)\r\n\r\n### Examples\r\n> **Warning**: The order in the `branches` property matters! The plugin will generate a higher version code depending on where you place your branch configuration in the `branches` array.  \r\n> \r\n> When the plugin notices a prerelease version (eg. `v1.1.0-alpha.1`), it will get the index of where the prerelease branch configuration is (in this case, `alpha`, index `2`), then it multiplies that number by the supplied the `channelWeight` option (`2 * channelWeight`) and adds it to the version code number.  \r\n>\r\n> This would mean that users from the `alpha` release channel wouldn't be able to downgrade to `beta` *(index `1`)* or the `main` *(index `0`)* channel, as the index for those is lower than the `alpha` release channel's index.  \r\n> \r\n> If you want to disable this feature, set `channelWeight` to `0`. This will also increase room for more version codes.\r\n\r\n```json\r\n{\r\n  \"branches\": [\r\n    \"main\",\r\n    {\r\n      \"name\": \"beta\",\r\n      \"prerelease\": true\r\n    },\r\n    {\r\n      \"name\": \"alpha\",\r\n      \"prerelease\": true\r\n    }\r\n  ],\r\n  \"plugins\": [\r\n    \"@semantic-release/commit-analyzer\",\r\n    \"@semantic-release/release-notes-generator\",\r\n    [\r\n      \"semantic-release-flutter-plugin\",\r\n      {\r\n        \"pubspecPath\": \"pubspec.yaml\"\r\n      }\r\n    ],\r\n    [\r\n      \"@semantic-release/git\",\r\n      {\r\n        \"assets\": [\r\n          \"pubspec.yaml\"\r\n        ]\r\n      }\r\n    ]\r\n  ]\r\n}\r\n```\r\n","readmeFilename":"README.md"}