@versu/cli 0.6.18 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/commands/plugin/install.d.ts +13 -0
- package/dist/commands/plugin/install.d.ts.map +1 -0
- package/dist/commands/plugin/install.js +39 -0
- package/dist/commands/plugin/install.js.map +1 -0
- package/dist/commands/plugin/list.d.ts +7 -0
- package/dist/commands/plugin/list.d.ts.map +1 -0
- package/dist/commands/plugin/list.js +25 -0
- package/dist/commands/plugin/list.js.map +1 -0
- package/dist/commands/plugin/uninstall.d.ts +13 -0
- package/dist/commands/plugin/uninstall.d.ts.map +1 -0
- package/dist/commands/plugin/uninstall.js +39 -0
- package/dist/commands/plugin/uninstall.js.map +1 -0
- package/dist/commands/run.d.ts +26 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +96 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/index.d.ts +1 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -95
- package/dist/index.js.map +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# @versu/cli - Command-Line Interface
|
|
8
8
|
|
|
9
|
-
Command-line interface for
|
|
9
|
+
Command-line interface for Versu. This CLI provides all the power of Versu's semantic versioning engine through an easy-to-use command-line tool, perfect for local development and custom CI/CD systems.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -165,7 +165,7 @@ Then manually review, commit, and push.
|
|
|
165
165
|
|
|
166
166
|
## Configuration
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
Versu CLI uses the same configuration system as the core library. Configuration files are automatically detected in your repository root.
|
|
169
169
|
|
|
170
170
|
### Supported Configuration Files
|
|
171
171
|
|
|
@@ -218,7 +218,7 @@ For more configuration examples, see the [core package documentation](../core).
|
|
|
218
218
|
|
|
219
219
|
**Advanced Changelog Configuration:**
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
Versu supports [conventional-changelog-writer](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer) options for customizing changelog generation. For advanced customization with functions (transforms, sorting, templates), use JavaScript configuration files:
|
|
222
222
|
|
|
223
223
|
```javascript
|
|
224
224
|
// versu.config.js
|
|
@@ -281,7 +281,7 @@ api.version=1.5.0
|
|
|
281
281
|
|
|
282
282
|
## Commit Message Format
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
Versu uses [Conventional Commits](https://conventionalcommits.org/) to determine version bumps:
|
|
285
285
|
|
|
286
286
|
```text
|
|
287
287
|
<type>[optional scope]: <description>
|
|
@@ -315,7 +315,7 @@ Breaking changes trigger **major** version bumps:
|
|
|
315
315
|
### GitHub Actions
|
|
316
316
|
|
|
317
317
|
```yaml
|
|
318
|
-
- name: Install
|
|
318
|
+
- name: Install Versu CLI
|
|
319
319
|
run: npm install -g @versu/cli
|
|
320
320
|
|
|
321
321
|
- name: Install Adapter
|
|
@@ -394,7 +394,7 @@ If versions aren't bumping:
|
|
|
394
394
|
1. Check commit messages follow Conventional Commits format
|
|
395
395
|
2. Verify you have commits since the last version
|
|
396
396
|
3. Check configuration if certain commit types are ignored
|
|
397
|
-
4. Use `--dry-run` to see what
|
|
397
|
+
4. Use `--dry-run` to see what Versu detects
|
|
398
398
|
|
|
399
399
|
### Adapter Not Detected
|
|
400
400
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class Install extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
global: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,OAAgB,WAAW,SAA+B;IAE1D,OAAgB,QAAQ,WAMtB;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,OAAgB,KAAK;;MAMnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAe3B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Args, Command, Flags } from "@oclif/core";
|
|
2
|
+
import { OclifLogger } from "../../logger.js";
|
|
3
|
+
import { initLogger, logger, pluginManager } from "@versu/core";
|
|
4
|
+
export default class Install extends Command {
|
|
5
|
+
static description = "Install plugins for Versu";
|
|
6
|
+
static examples = [
|
|
7
|
+
"<%= config.bin %> <%= command.id %> @versu/plugin-example",
|
|
8
|
+
"<%= config.bin %> <%= command.id %> @scoped/versu-plugin-example",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> versu-plugin-example",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> @versu/plugin-example --global",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> @versu/plugin-example -g",
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
name: Args.string({
|
|
15
|
+
required: true,
|
|
16
|
+
description: "Plugin name",
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
global: Flags.boolean({
|
|
21
|
+
description: "Install the plugin globally instead of locally",
|
|
22
|
+
default: false,
|
|
23
|
+
char: "g",
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { flags, args } = await this.parse(Install);
|
|
28
|
+
initLogger(new OclifLogger(this));
|
|
29
|
+
try {
|
|
30
|
+
await pluginManager.install(args.name, flags.global);
|
|
31
|
+
logger.info("Plugin installation completed", { pluginName: args.name, global: flags.global });
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
35
|
+
logger.error("Command failed", { error: errorMessage });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/plugin/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAU,WAAW,GAAG,2BAA2B,CAAC;IAE1D,MAAM,CAAU,QAAQ,GAAG;QACzB,2DAA2D;QAC3D,kEAAkE;QAClE,0DAA0D;QAC1D,oEAAoE;QACpE,8DAA8D;KAC/D,CAAC;IAEF,MAAM,CAAC,IAAI,GAAG;QACZ,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,aAAa;SAC3B,CAAC;KACH,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC;YACpB,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,GAAG;SACV,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElD,UAAU,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC;YACH,MAAM,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAErD,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAChG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAQtC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,OAAgB,WAAW,SAA4B;IAEvD,OAAgB,QAAQ,WAEtB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB3B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
import { OclifLogger } from "../../logger.js";
|
|
3
|
+
import { initLogger, logger, pluginManager, } from "@versu/core";
|
|
4
|
+
export default class List extends Command {
|
|
5
|
+
static description = "List plugins for Versu";
|
|
6
|
+
static examples = [
|
|
7
|
+
"<%= config.bin %> <%= command.id %>",
|
|
8
|
+
];
|
|
9
|
+
async run() {
|
|
10
|
+
await this.parse(List);
|
|
11
|
+
initLogger(new OclifLogger(this));
|
|
12
|
+
try {
|
|
13
|
+
const result = await pluginManager.list();
|
|
14
|
+
logger.info("Installed plugins:");
|
|
15
|
+
result.forEach((plugin) => {
|
|
16
|
+
logger.info(`- ${plugin.name} (${plugin.global ? "global" : "local"})`);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
21
|
+
logger.error("Command failed", { error: errorMessage });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/plugin/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,UAAU,EACV,MAAM,EACN,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,MAAM,CAAU,WAAW,GAAG,wBAAwB,CAAC;IAEvD,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;KACtC,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvB,UAAU,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;YAE1C,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YAClC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;YAC1E,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class Uninstall extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
global: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=uninstall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/commands/plugin/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,OAAgB,WAAW,SAAiC;IAE5D,OAAgB,QAAQ,WAMtB;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,OAAgB,KAAK;;MAMnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAe3B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Args, Command, Flags } from "@oclif/core";
|
|
2
|
+
import { OclifLogger } from "../../logger.js";
|
|
3
|
+
import { initLogger, logger, pluginManager } from "@versu/core";
|
|
4
|
+
export default class Uninstall extends Command {
|
|
5
|
+
static description = "Uninstall plugins for Versu";
|
|
6
|
+
static examples = [
|
|
7
|
+
"<%= config.bin %> <%= command.id %> @versu/plugin-example",
|
|
8
|
+
"<%= config.bin %> <%= command.id %> @scoped/versu-plugin-example",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> versu-plugin-example",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> @versu/plugin-example --global",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> @versu/plugin-example -g",
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
name: Args.string({
|
|
15
|
+
required: true,
|
|
16
|
+
description: "Plugin name",
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
global: Flags.boolean({
|
|
21
|
+
description: "Uninstall the plugin globally instead of locally",
|
|
22
|
+
default: false,
|
|
23
|
+
char: "g",
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { flags, args } = await this.parse(Uninstall);
|
|
28
|
+
initLogger(new OclifLogger(this));
|
|
29
|
+
try {
|
|
30
|
+
await pluginManager.uninstall(args.name, flags.global);
|
|
31
|
+
logger.info("Plugin uninstallation completed", { pluginName: args.name, global: flags.global });
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
35
|
+
logger.error("Command failed", { error: errorMessage });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=uninstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/commands/plugin/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAA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;QAC1D,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class Run extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
repositoryRoot: import("@oclif/core/interfaces").Arg<string, {
|
|
7
|
+
exists?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
version: import("@oclif/core/interfaces").BooleanFlag<void>;
|
|
12
|
+
"prerelease-mode": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
"prerelease-id": import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
"bump-unchanged": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
"add-build-metadata": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
"timestamp-versions": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
"append-snapshot": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
"create-tags": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
"generate-changelog": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
"push-changes": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
"dry-run": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
adapter: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
};
|
|
24
|
+
run(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,OAAgB,WAAW,SAAkD;IAE7E,OAAgB,QAAQ,WAKtB;IAEF,MAAM,CAAC,IAAI;;;;MAMT;IAEF,OAAgB,KAAK;;;;;;;;;;;;;MAqDnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6B3B"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Args, Command, Flags } from "@oclif/core";
|
|
2
|
+
import { OclifLogger } from "../logger.js";
|
|
3
|
+
import { initLogger, logger, VersuRunner } from "@versu/core";
|
|
4
|
+
export default class Run extends Command {
|
|
5
|
+
static description = "Calculate and apply semantic version changes";
|
|
6
|
+
static examples = [
|
|
7
|
+
"<%= config.bin %> <%= command.id %>",
|
|
8
|
+
"<%= config.bin %> <%= command.id %> --adapter gradle",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --dry-run",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --prerelease-mode --prerelease-id alpha",
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
repositoryRoot: Args.directory({
|
|
14
|
+
required: false,
|
|
15
|
+
description: "Path to the repository root",
|
|
16
|
+
default: ".",
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
version: Flags.version({ char: "v" }),
|
|
21
|
+
"prerelease-mode": Flags.boolean({
|
|
22
|
+
description: "Generate pre-release versions instead of final versions",
|
|
23
|
+
default: false,
|
|
24
|
+
}),
|
|
25
|
+
"prerelease-id": Flags.string({
|
|
26
|
+
description: "Pre-release identifier (e.g., alpha, beta, rc)",
|
|
27
|
+
default: "alpha",
|
|
28
|
+
}),
|
|
29
|
+
"bump-unchanged": Flags.boolean({
|
|
30
|
+
description: "In prerelease mode, bump modules even when no changes are detected",
|
|
31
|
+
default: false,
|
|
32
|
+
}),
|
|
33
|
+
"add-build-metadata": Flags.boolean({
|
|
34
|
+
description: "Add build metadata with short SHA to all versions",
|
|
35
|
+
default: false,
|
|
36
|
+
}),
|
|
37
|
+
"timestamp-versions": Flags.boolean({
|
|
38
|
+
description: "Use timestamp-based prerelease identifiers (requires prerelease-mode)",
|
|
39
|
+
default: false,
|
|
40
|
+
}),
|
|
41
|
+
"append-snapshot": Flags.boolean({
|
|
42
|
+
description: "Add -SNAPSHOT suffix to all versions if supported by adapter",
|
|
43
|
+
default: false,
|
|
44
|
+
}),
|
|
45
|
+
"create-tags": Flags.boolean({
|
|
46
|
+
description: "Create git tags for new versions",
|
|
47
|
+
default: true,
|
|
48
|
+
allowNo: true,
|
|
49
|
+
}),
|
|
50
|
+
"generate-changelog": Flags.boolean({
|
|
51
|
+
description: "Generate or update changelog files for changed modules",
|
|
52
|
+
default: true,
|
|
53
|
+
allowNo: true,
|
|
54
|
+
}),
|
|
55
|
+
"push-changes": Flags.boolean({
|
|
56
|
+
description: "Commit and push version changes and changelogs to remote",
|
|
57
|
+
default: true,
|
|
58
|
+
allowNo: true,
|
|
59
|
+
}),
|
|
60
|
+
"dry-run": Flags.boolean({
|
|
61
|
+
description: "Run without writing or pushing changes",
|
|
62
|
+
default: false,
|
|
63
|
+
}),
|
|
64
|
+
adapter: Flags.string({
|
|
65
|
+
description: "Language adapter (e.g., gradle). Auto-detected if not provided",
|
|
66
|
+
required: false,
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
async run() {
|
|
70
|
+
const { flags, args } = await this.parse(Run);
|
|
71
|
+
initLogger(new OclifLogger(this));
|
|
72
|
+
try {
|
|
73
|
+
const options = {
|
|
74
|
+
repoRoot: args.repositoryRoot,
|
|
75
|
+
prereleaseMode: flags["prerelease-mode"],
|
|
76
|
+
prereleaseId: flags["prerelease-id"],
|
|
77
|
+
bumpUnchanged: flags["bump-unchanged"],
|
|
78
|
+
addBuildMetadata: flags["add-build-metadata"],
|
|
79
|
+
timestampVersions: flags["timestamp-versions"],
|
|
80
|
+
appendSnapshot: flags["append-snapshot"],
|
|
81
|
+
createTags: flags["create-tags"],
|
|
82
|
+
generateChangelog: flags["generate-changelog"],
|
|
83
|
+
pushChanges: flags["push-changes"],
|
|
84
|
+
adapter: flags.adapter,
|
|
85
|
+
dryRun: flags["dry-run"],
|
|
86
|
+
};
|
|
87
|
+
const runner = new VersuRunner(options);
|
|
88
|
+
await runner.run();
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
92
|
+
logger.error("Command failed", { error: errorMessage });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,MAAM,CAAU,WAAW,GAAG,8CAA8C,CAAC;IAE7E,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,sDAAsD;QACtD,+CAA+C;QAC/C,6EAA6E;KAC9E,CAAC;IAEF,MAAM,CAAC,IAAI,GAAG;QACZ,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC;YAC7B,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,6BAA6B;YAC1C,OAAO,EAAE,GAAG;SACb,CAAC;KACH,CAAC;IAEF,MAAM,CAAU,KAAK,GAAG;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;QACrC,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC;YAC/B,WAAW,EAAE,yDAAyD;YAC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AAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9C,UAAU,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC;YACH,MAAM,OAAO,GAAkB;gBAC7B,QAAQ,EAAE,IAAI,CAAC,cAAc;gBAC7B,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC;gBACxC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;gBACpC,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC;gBACtC,gBAAgB,EAAE,KAAK,CAAC,oBAAoB,CAAC;gBAC7C,iBAAiB,EAAE,KAAK,CAAC,oBAAoB,CAAC;gBAC9C,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC;gBACxC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;gBAChC,iBAAiB,EAAE,KAAK,CAAC,oBAAoB,CAAC;gBAC9C,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC;gBAClC,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;aACzB,CAAC;YAEF,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;YACxC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default class Version extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static args: {
|
|
6
|
-
repositoryRoot: import("@oclif/core/interfaces").Arg<string, {
|
|
7
|
-
exists?: boolean;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
static flags: {
|
|
11
|
-
version: import("@oclif/core/interfaces").BooleanFlag<void>;
|
|
12
|
-
"prerelease-mode": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
"prerelease-id": import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
"bump-unchanged": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
"add-build-metadata": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
"timestamp-versions": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
-
"append-snapshot": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
-
"create-tags": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
-
"generate-changelog": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
-
"push-changes": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
-
"dry-run": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
-
adapter: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
-
};
|
|
24
|
-
run(): Promise<void>;
|
|
25
|
-
}
|
|
1
|
+
export { run } from "@oclif/core";
|
|
26
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,96 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { VersuRunner, initLogger, logger } from "@versu/core";
|
|
3
|
-
import { OclifLogger } from "./logger.js";
|
|
4
|
-
export default class Version extends Command {
|
|
5
|
-
static description = "Calculate and apply semantic version changes";
|
|
6
|
-
static examples = [
|
|
7
|
-
"<%= config.bin %> <%= command.id %>",
|
|
8
|
-
"<%= config.bin %> <%= command.id %> --adapter gradle",
|
|
9
|
-
"<%= config.bin %> <%= command.id %> --dry-run",
|
|
10
|
-
"<%= config.bin %> <%= command.id %> --prerelease-mode --prerelease-id alpha",
|
|
11
|
-
];
|
|
12
|
-
static args = {
|
|
13
|
-
repositoryRoot: Args.directory({
|
|
14
|
-
required: false,
|
|
15
|
-
description: "Path to the repository root",
|
|
16
|
-
default: ".",
|
|
17
|
-
}),
|
|
18
|
-
};
|
|
19
|
-
static flags = {
|
|
20
|
-
version: Flags.version({ char: 'v' }),
|
|
21
|
-
"prerelease-mode": Flags.boolean({
|
|
22
|
-
description: "Generate pre-release versions instead of final versions",
|
|
23
|
-
default: false,
|
|
24
|
-
}),
|
|
25
|
-
"prerelease-id": Flags.string({
|
|
26
|
-
description: "Pre-release identifier (e.g., alpha, beta, rc)",
|
|
27
|
-
default: "alpha",
|
|
28
|
-
}),
|
|
29
|
-
"bump-unchanged": Flags.boolean({
|
|
30
|
-
description: "In prerelease mode, bump modules even when no changes are detected",
|
|
31
|
-
default: false,
|
|
32
|
-
}),
|
|
33
|
-
"add-build-metadata": Flags.boolean({
|
|
34
|
-
description: "Add build metadata with short SHA to all versions",
|
|
35
|
-
default: false,
|
|
36
|
-
}),
|
|
37
|
-
"timestamp-versions": Flags.boolean({
|
|
38
|
-
description: "Use timestamp-based prerelease identifiers (requires prerelease-mode)",
|
|
39
|
-
default: false,
|
|
40
|
-
}),
|
|
41
|
-
"append-snapshot": Flags.boolean({
|
|
42
|
-
description: "Add -SNAPSHOT suffix to all versions if supported by adapter",
|
|
43
|
-
default: false,
|
|
44
|
-
}),
|
|
45
|
-
"create-tags": Flags.boolean({
|
|
46
|
-
description: "Create git tags for new versions",
|
|
47
|
-
default: true,
|
|
48
|
-
allowNo: true,
|
|
49
|
-
}),
|
|
50
|
-
"generate-changelog": Flags.boolean({
|
|
51
|
-
description: "Generate or update changelog files for changed modules",
|
|
52
|
-
default: true,
|
|
53
|
-
allowNo: true,
|
|
54
|
-
}),
|
|
55
|
-
"push-changes": Flags.boolean({
|
|
56
|
-
description: "Commit and push version changes and changelogs to remote",
|
|
57
|
-
default: true,
|
|
58
|
-
allowNo: true,
|
|
59
|
-
}),
|
|
60
|
-
"dry-run": Flags.boolean({
|
|
61
|
-
description: "Run without writing or pushing changes",
|
|
62
|
-
default: false,
|
|
63
|
-
}),
|
|
64
|
-
adapter: Flags.string({
|
|
65
|
-
description: "Language adapter (e.g., gradle). Auto-detected if not provided",
|
|
66
|
-
required: false,
|
|
67
|
-
}),
|
|
68
|
-
};
|
|
69
|
-
async run() {
|
|
70
|
-
const { flags, args } = await this.parse(Version);
|
|
71
|
-
initLogger(new OclifLogger(this));
|
|
72
|
-
try {
|
|
73
|
-
const options = {
|
|
74
|
-
repoRoot: args.repositoryRoot,
|
|
75
|
-
prereleaseMode: flags["prerelease-mode"],
|
|
76
|
-
prereleaseId: flags["prerelease-id"],
|
|
77
|
-
bumpUnchanged: flags["bump-unchanged"],
|
|
78
|
-
addBuildMetadata: flags["add-build-metadata"],
|
|
79
|
-
timestampVersions: flags["timestamp-versions"],
|
|
80
|
-
appendSnapshot: flags["append-snapshot"],
|
|
81
|
-
createTags: flags["create-tags"],
|
|
82
|
-
generateChangelog: flags["generate-changelog"],
|
|
83
|
-
pushChanges: flags["push-changes"],
|
|
84
|
-
adapter: flags.adapter,
|
|
85
|
-
dryRun: flags["dry-run"],
|
|
86
|
-
};
|
|
87
|
-
const runner = new VersuRunner(options);
|
|
88
|
-
await runner.run();
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
92
|
-
logger.error("Command failed", { error: errorMessage });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
1
|
+
export { run } from "@oclif/core";
|
|
96
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versu/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "Versu (CLI)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"types": "dist/index.d.ts",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@oclif/core": "^4.8.0",
|
|
42
|
-
"@versu/core": "^0.
|
|
42
|
+
"@versu/core": "^0.7.1",
|
|
43
43
|
"chalk": "^5.6.2",
|
|
44
44
|
"oclif": "^4.14.0",
|
|
45
45
|
"ora": "^9.3.0"
|
|
@@ -65,9 +65,11 @@
|
|
|
65
65
|
"dirname": "versu",
|
|
66
66
|
"topicSeparator": " ",
|
|
67
67
|
"plugins": [],
|
|
68
|
-
"commands":
|
|
69
|
-
|
|
70
|
-
"
|
|
68
|
+
"commands": "./dist/commands",
|
|
69
|
+
"topics": {
|
|
70
|
+
"plugin": {
|
|
71
|
+
"description": "Manage Versu plugins"
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
|
-
}
|
|
75
|
+
}
|