Socket
Socket
Sign inDemoInstall

@auto-it/version-file

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auto-it/version-file - npm Package Compare versions

Comparing version 11.1.6 to 11.2.0

16

dist/index.d.ts
import { Auto, IPlugin } from '@auto-it/core';
import * as t from "io-ts";
interface ReleaseTypeArgs {
/** Args to use when invoking the publishScript during the publish hook */
publish: string[];
/** Args to use when invoking the publishScript during the canary hook */
canary: string[];
/** Args to use when invoking the publishScript during the next hook */
next: string[];
}
declare const pluginOptions: t.PartialC<{

@@ -8,2 +16,8 @@ /** Path to file (from where auto is executed) where the version is stored */

publishScript: t.StringC;
/** Optional publish script args mapping for each release hook, defaults `publish` to ["release"] and the others to ["snapshot"] */
publishScriptReleaseTypeArgs: t.PartialC<{
publish: t.ArrayC<t.StringC>;
canary: t.ArrayC<t.StringC>;
next: t.ArrayC<t.StringC>;
}>;
}>;

@@ -19,2 +33,4 @@ export declare type IVersionFilePluginOptions = t.TypeOf<typeof pluginOptions>;

readonly publishScript: string | undefined;
/** */
readonly publishScriptReleaseTypeArgs: ReleaseTypeArgs;
/** Initialize the plugin with it's options */

@@ -21,0 +37,0 @@ constructor(options: IVersionFilePluginOptions);

17

dist/index.js

@@ -15,3 +15,9 @@ "use strict";

/** Optional script that executes release pipeline stages */
publishScript: t.string
publishScript: t.string,
/** Optional publish script args mapping for each release hook, defaults `publish` to ["release"] and the others to ["snapshot"] */
publishScriptReleaseTypeArgs: t.partial({
publish: t.array(t.string),
canary: t.array(t.string),
next: t.array(t.string),
})
});

@@ -43,3 +49,3 @@ /**

constructor(options) {
var _a;
var _a, _b;
/** The name of the plugin */

@@ -49,2 +55,3 @@ this.name = 'version-file';

this.publishScript = options.publishScript;
this.publishScriptReleaseTypeArgs = Object.assign({ publish: ['release'], canary: ['snapshot'], next: ['snapshot'] }, (_b = options.publishScriptReleaseTypeArgs) !== null && _b !== void 0 ? _b : {});
}

@@ -93,3 +100,3 @@ /** Tap into auto plugin points. */

auto.logger.log.info(`Calling release script in repo at ${this.publishScript}`);
await core_1.execPromise(this.publishScript, ["release"]);
await core_1.execPromise(this.publishScript, this.publishScriptReleaseTypeArgs.publish);
}

@@ -117,3 +124,3 @@ else {

auto.logger.log.info(`Calling release script in repo at ${this.publishScript}`);
await core_1.execPromise(this.publishScript, ["snapshot"]);
await core_1.execPromise(this.publishScript, this.publishScriptReleaseTypeArgs.canary);
}

@@ -149,3 +156,3 @@ else {

auto.logger.log.info(`Calling release script in repo at ${this.publishScript}`);
await core_1.execPromise(this.publishScript, ["snapshot"]);
await core_1.execPromise(this.publishScript, this.publishScriptReleaseTypeArgs.next);
}

@@ -152,0 +159,0 @@ else {

{
"name": "@auto-it/version-file",
"version": "11.1.6",
"version": "11.2.0",
"main": "dist/index.js",

@@ -39,3 +39,3 @@ "description": "",

"dependencies": {
"@auto-it/core": "11.1.6",
"@auto-it/core": "11.2.0",
"fp-ts": "^2.5.3",

@@ -46,3 +46,3 @@ "io-ts": "^2.1.2",

},
"gitHead": "335fadb33fc1b661faa2a82a1d992b0e81036a74"
"gitHead": "32f3d7845a32b92ccb009f81fb0f1bbe234aee13"
}

@@ -20,3 +20,8 @@ # Version File Plugin

- versionFile (optional, default="VERSION"): Path to where the version is stored in the repository. It should be a file containing just the semver.
- releaseScript: (optional, default=None): Path to script that runs the publish actions in your repository. If not supplied nothing will be called. If supplied will be called during the `publish`,`canary` and `next` hooks. For the `publish` hook the first parameter passed to the script will be `release` to indicate that a regular release is being called. For `canary` and `next` hooks the first parameter will be `snapshot` to indicate a prerelease version.
- publishScript: (optional, default=None): Path to script that runs the publish actions in your repository. If not supplied nothing will be called. If supplied will be called during the `publish`,`canary` and `next` hooks with the arguments defined in `publishScriptReleaseTypeArgs` for that release type.
- publishScriptReleaseTypeArgs: (optional, default=```{
"publish": ["release"],
"canary": ["snapshot"],
"next": ["snapshot"]
}```): Mapping of arguments to pass to the `publishScript` for each release type (`publish`, `canary`, `next`)

@@ -38,4 +43,8 @@ ## Usage

"plugins": [
"version-file", {"versionFile": "./tools/Version.txt", "releaseScript":"./tools/publish.sh"}
"version-file", {"versionFile": "./tools/Version.txt", "publishScript":"./tools/publish.sh", "publishScriptReleaseTypeArgs": {
"publish": ["release"], // (default)
"canary": ["snapshot"],
"next": ["some", "other", "args"],
}}
]
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc