@decaf-ts/utils 1.5.1 → 1.5.3

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.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/dist/utils.cjs +1 -1
  3. package/dist/utils.cjs.map +1 -1
  4. package/dist/utils.js +1 -1
  5. package/dist/utils.js.map +1 -1
  6. package/lib/cjs/cli/commands/build-scripts.cjs +25 -4
  7. package/lib/cjs/cli/commands/build-scripts.cjs.map +1 -1
  8. package/lib/cjs/cli/commands/help.cjs +29 -0
  9. package/lib/cjs/cli/commands/help.cjs.map +1 -0
  10. package/lib/cjs/cli/commands/modules.cjs +14 -0
  11. package/lib/cjs/cli/commands/modules.cjs.map +1 -1
  12. package/lib/cjs/cli/commands/npm-link.cjs +77 -7
  13. package/lib/cjs/cli/commands/npm-link.cjs.map +1 -1
  14. package/lib/cjs/cli/commands/npm-token.cjs +24 -0
  15. package/lib/cjs/cli/commands/npm-token.cjs.map +1 -1
  16. package/lib/cjs/cli/commands/release-chain.cjs +82 -0
  17. package/lib/cjs/cli/commands/release-chain.cjs.map +1 -1
  18. package/lib/cjs/cli/commands/run-all.cjs +23 -0
  19. package/lib/cjs/cli/commands/run-all.cjs.map +1 -1
  20. package/lib/cjs/cli/commands/tag-release-shell.cjs +52 -0
  21. package/lib/cjs/cli/commands/tag-release-shell.cjs.map +1 -1
  22. package/lib/cjs/cli/commands/tag-release.cjs +33 -2
  23. package/lib/cjs/cli/commands/tag-release.cjs.map +1 -1
  24. package/lib/cjs/index.cjs +21 -5
  25. package/lib/cjs/index.cjs.map +1 -1
  26. package/lib/esm/cli/commands/build-scripts.js +25 -4
  27. package/lib/esm/cli/commands/build-scripts.js.map +1 -1
  28. package/lib/esm/cli/commands/help.js +25 -0
  29. package/lib/esm/cli/commands/help.js.map +1 -0
  30. package/lib/esm/cli/commands/modules.js +14 -0
  31. package/lib/esm/cli/commands/modules.js.map +1 -1
  32. package/lib/esm/cli/commands/npm-link.js +77 -7
  33. package/lib/esm/cli/commands/npm-link.js.map +1 -1
  34. package/lib/esm/cli/commands/npm-token.js +24 -0
  35. package/lib/esm/cli/commands/npm-token.js.map +1 -1
  36. package/lib/esm/cli/commands/release-chain.js +82 -0
  37. package/lib/esm/cli/commands/release-chain.js.map +1 -1
  38. package/lib/esm/cli/commands/run-all.js +23 -0
  39. package/lib/esm/cli/commands/run-all.js.map +1 -1
  40. package/lib/esm/cli/commands/tag-release-shell.js +52 -0
  41. package/lib/esm/cli/commands/tag-release-shell.js.map +1 -1
  42. package/lib/esm/cli/commands/tag-release.js +33 -2
  43. package/lib/esm/cli/commands/tag-release.js.map +1 -1
  44. package/lib/esm/index.js +20 -4
  45. package/lib/esm/index.js.map +1 -1
  46. package/lib/types/cli/commands/build-scripts.d.cts +6 -3
  47. package/lib/types/cli/commands/build-scripts.d.mts +6 -3
  48. package/lib/types/cli/commands/help.d.cts +7 -0
  49. package/lib/types/cli/commands/help.d.mts +7 -0
  50. package/lib/types/cli/commands/modules.d.cts +1 -0
  51. package/lib/types/cli/commands/modules.d.mts +1 -0
  52. package/lib/types/cli/commands/npm-link.d.cts +11 -0
  53. package/lib/types/cli/commands/npm-link.d.mts +11 -0
  54. package/lib/types/cli/commands/npm-token.d.cts +1 -0
  55. package/lib/types/cli/commands/npm-token.d.mts +1 -0
  56. package/lib/types/cli/commands/release-chain.d.cts +2 -0
  57. package/lib/types/cli/commands/release-chain.d.mts +2 -0
  58. package/lib/types/cli/commands/run-all.d.cts +1 -0
  59. package/lib/types/cli/commands/run-all.d.mts +1 -0
  60. package/lib/types/cli/commands/tag-release-shell.d.cts +1 -0
  61. package/lib/types/cli/commands/tag-release-shell.d.mts +1 -0
  62. package/lib/types/cli/commands/tag-release.d.cts +1 -0
  63. package/lib/types/cli/commands/tag-release.d.mts +1 -0
  64. package/lib/types/index.d.cts +20 -4
  65. package/lib/types/index.d.mts +20 -4
  66. package/package.json +1 -1
@@ -69,11 +69,14 @@ export declare class BuildScripts extends Command<CommandOptions<typeof options>
69
69
  private replacements;
70
70
  private readonly pkgVersion;
71
71
  private readonly pkgName;
72
+ private readonly commitHash;
73
+ private readonly fullVersion;
72
74
  constructor();
73
75
  /**
74
- * @description Patches files with version and package name.
75
- * @summary This method reads all files in a directory, finds placeholders for version
76
- * and package name, and replaces them with the actual values from package.json.
76
+ * @description Patches files with version, commit, full version, and package name.
77
+ * @summary This method reads all files in a directory, finds placeholders for version,
78
+ * commit hash, full version, and package name, and replaces them with the actual values
79
+ * from package.json and the current git revision.
77
80
  * @param {string} p - The path to the directory containing the files to patch.
78
81
  */
79
82
  patchFiles(p: string): void;
@@ -0,0 +1,7 @@
1
+ import { Logger } from "@decaf-ts/logging";
2
+ export type HelpOption = {
3
+ flag: string;
4
+ description: string;
5
+ defaultValue?: string;
6
+ };
7
+ export declare function printCommandHelp(log: Logger, commandName: string, summary: string, usage: string, options: HelpOption[], notes?: string[], examples?: string[]): void;
@@ -0,0 +1,7 @@
1
+ import { Logger } from "@decaf-ts/logging";
2
+ export type HelpOption = {
3
+ flag: string;
4
+ description: string;
5
+ defaultValue?: string;
6
+ };
7
+ export declare function printCommandHelp(log: Logger, commandName: string, summary: string, usage: string, options: HelpOption[], notes?: string[], examples?: string[]): void;
@@ -11,6 +11,7 @@ declare const options: {
11
11
  };
12
12
  export declare class ModulesCommand extends Command<typeof options, void> {
13
13
  constructor();
14
+ protected help(): void;
14
15
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
15
16
  basePath: string;
16
17
  }): Promise<void>;
@@ -11,6 +11,7 @@ declare const options: {
11
11
  };
12
12
  export declare class ModulesCommand extends Command<typeof options, void> {
13
13
  constructor();
14
+ protected help(): void;
14
15
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
15
16
  basePath: string;
16
17
  }): Promise<void>;
@@ -16,6 +16,15 @@ declare const options: {
16
16
  multiple: boolean;
17
17
  default: never[];
18
18
  };
19
+ packages: {
20
+ type: string;
21
+ multiple: boolean;
22
+ default: never[];
23
+ };
24
+ mainPackagePath: {
25
+ type: string;
26
+ default: string;
27
+ };
19
28
  operation: {
20
29
  type: string;
21
30
  default: string;
@@ -28,6 +37,8 @@ export declare class NpmLinkCommand extends Command<typeof options, void> {
28
37
  maxTraversal: unknown;
29
38
  excludes: unknown;
30
39
  include: unknown;
40
+ packages: unknown;
41
+ mainPackagePath: unknown;
31
42
  operation: unknown;
32
43
  }): Promise<void>;
33
44
  }
@@ -16,6 +16,15 @@ declare const options: {
16
16
  multiple: boolean;
17
17
  default: never[];
18
18
  };
19
+ packages: {
20
+ type: string;
21
+ multiple: boolean;
22
+ default: never[];
23
+ };
24
+ mainPackagePath: {
25
+ type: string;
26
+ default: string;
27
+ };
19
28
  operation: {
20
29
  type: string;
21
30
  default: string;
@@ -28,6 +37,8 @@ export declare class NpmLinkCommand extends Command<typeof options, void> {
28
37
  maxTraversal: unknown;
29
38
  excludes: unknown;
30
39
  include: unknown;
40
+ packages: unknown;
41
+ mainPackagePath: unknown;
31
42
  operation: unknown;
32
43
  }): Promise<void>;
33
44
  }
@@ -14,6 +14,7 @@ declare const options: {
14
14
  };
15
15
  export declare class NpmTokenCommand extends Command<typeof options, void> {
16
16
  constructor();
17
+ protected help(): void;
17
18
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
18
19
  maxTraversal: unknown;
19
20
  tokenFiles: unknown;
@@ -14,6 +14,7 @@ declare const options: {
14
14
  };
15
15
  export declare class NpmTokenCommand extends Command<typeof options, void> {
16
16
  constructor();
17
+ protected help(): void;
17
18
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
18
19
  maxTraversal: unknown;
19
20
  tokenFiles: unknown;
@@ -53,10 +53,12 @@ type ReleaseChainAnswerMap = {
53
53
  };
54
54
  export declare class ReleaseChainCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
55
55
  constructor();
56
+ protected help(): void;
56
57
  protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
57
58
  }
58
59
  export declare class ReleaseChainDispatchCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
59
60
  constructor();
61
+ protected help(): void;
60
62
  protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
61
63
  }
62
64
  export {};
@@ -53,10 +53,12 @@ type ReleaseChainAnswerMap = {
53
53
  };
54
54
  export declare class ReleaseChainCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
55
55
  constructor();
56
+ protected help(): void;
56
57
  protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
57
58
  }
58
59
  export declare class ReleaseChainDispatchCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
59
60
  constructor();
61
+ protected help(): void;
60
62
  protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
61
63
  }
62
64
  export {};
@@ -13,6 +13,7 @@ declare const options: {
13
13
  };
14
14
  export declare class RunAllCommand extends Command<typeof options, void> {
15
15
  constructor();
16
+ protected help(): void;
16
17
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
17
18
  basePath: unknown;
18
19
  command: unknown;
@@ -13,6 +13,7 @@ declare const options: {
13
13
  };
14
14
  export declare class RunAllCommand extends Command<typeof options, void> {
15
15
  constructor();
16
+ protected help(): void;
16
17
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
17
18
  basePath: unknown;
18
19
  command: unknown;
@@ -42,6 +42,7 @@ export declare class TagReleaseCommand extends Command<typeof options, void> {
42
42
  private prepareMessage;
43
43
  private hasToken;
44
44
  private readToken;
45
+ protected help(): void;
45
46
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
46
47
  public: unknown;
47
48
  private: unknown;
@@ -42,6 +42,7 @@ export declare class TagReleaseCommand extends Command<typeof options, void> {
42
42
  private prepareMessage;
43
43
  private hasToken;
44
44
  private readToken;
45
+ protected help(): void;
45
46
  protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
46
47
  public: unknown;
47
48
  private: unknown;
@@ -68,6 +68,7 @@ export declare class ReleaseScript extends Command<typeof options, void> {
68
68
  * @returns {Promise<string>} The prepared release message
69
69
  */
70
70
  prepareMessage(message?: string): Promise<string>;
71
+ protected help(): void;
71
72
  /**
72
73
  * @description Runs the release script.
73
74
  * @summary This method orchestrates the entire release process, including version preparation, message creation,
@@ -68,6 +68,7 @@ export declare class ReleaseScript extends Command<typeof options, void> {
68
68
  * @returns {Promise<string>} The prepared release message
69
69
  */
70
70
  prepareMessage(message?: string): Promise<string>;
71
+ protected help(): void;
71
72
  /**
72
73
  * @description Runs the release script.
73
74
  * @summary This method orchestrates the entire release process, including version preparation, message creation,
@@ -27,12 +27,28 @@ export * from "./release-chain/index.d.cts";
27
27
  * @const VERSION
28
28
  * @memberOf module:utils
29
29
  */
30
- export declare const VERSION = "1.5.0";
30
+ export declare const VERSION = "1.5.2";
31
+ /**
32
+ * @description Represents the current commit hash of the module build.
33
+ * @summary Stores the current git commit hash for the @decaf-ts/utils package.
34
+ * The build replaces the placeholder with the actual commit hash at publish time.
35
+ * @const COMMIT
36
+ * @memberOf module:utils
37
+ */
38
+ export declare const COMMIT = "bd18c64";
39
+ /**
40
+ * @description Represents the full version string of the module.
41
+ * @summary Stores the semver version and commit hash for the @decaf-ts/utils package.
42
+ * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
43
+ * @const FULL_VERSION
44
+ * @memberOf module:utils
45
+ */
46
+ export declare const FULL_VERSION = "1.5.2-bd18c64";
31
47
  /**
32
48
  * @description Represents the current version of the module.
33
- * @summary Stores the version for the @decaf-ts/utils package. The build replaces
34
- * the placeholder with the actual version number at publish time.
35
- * @const VERSION
49
+ * @summary Stores the package name for the @decaf-ts/utils package. The build replaces
50
+ * the placeholder with the actual package name at publish time.
51
+ * @const PACKAGE_NAME
36
52
  * @memberOf module:utils
37
53
  */
38
54
  export declare const PACKAGE_NAME = "@decaf-ts/utils";
@@ -27,12 +27,28 @@ export * from "./release-chain/index.d.mts";
27
27
  * @const VERSION
28
28
  * @memberOf module:utils
29
29
  */
30
- export declare const VERSION = "1.5.0";
30
+ export declare const VERSION = "1.5.2";
31
+ /**
32
+ * @description Represents the current commit hash of the module build.
33
+ * @summary Stores the current git commit hash for the @decaf-ts/utils package.
34
+ * The build replaces the placeholder with the actual commit hash at publish time.
35
+ * @const COMMIT
36
+ * @memberOf module:utils
37
+ */
38
+ export declare const COMMIT = "bd18c64";
39
+ /**
40
+ * @description Represents the full version string of the module.
41
+ * @summary Stores the semver version and commit hash for the @decaf-ts/utils package.
42
+ * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
43
+ * @const FULL_VERSION
44
+ * @memberOf module:utils
45
+ */
46
+ export declare const FULL_VERSION = "1.5.2-bd18c64";
31
47
  /**
32
48
  * @description Represents the current version of the module.
33
- * @summary Stores the version for the @decaf-ts/utils package. The build replaces
34
- * the placeholder with the actual version number at publish time.
35
- * @const VERSION
49
+ * @summary Stores the package name for the @decaf-ts/utils package. The build replaces
50
+ * the placeholder with the actual package name at publish time.
51
+ * @const PACKAGE_NAME
36
52
  * @memberOf module:utils
37
53
  */
38
54
  export declare const PACKAGE_NAME = "@decaf-ts/utils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/utils",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "module management utils for decaf-ts",
5
5
  "type": "module",
6
6
  "exports": {