@tallyrelease/core 0.1.0-beta.1 → 0.1.0-beta.2

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/dist/config.d.ts CHANGED
@@ -1,10 +1,13 @@
1
- import type { Propagate, VersionMode } from "./plugin.js";
1
+ import type { Propagate, VersionSource } from "./plugin.js";
2
2
  /** Config overlay for the unit at a root; creates a config-only unit if none is discovered. */
3
3
  export interface UnitOverlay {
4
4
  id?: string;
5
5
  include?: string[];
6
6
  exclude?: string[];
7
- version?: VersionMode;
7
+ /** Default `defaults.release`, else false. */
8
+ release?: boolean;
9
+ /** Overrides the plugin's source; applies only when released. */
10
+ version?: VersionSource;
8
11
  scheme?: string;
9
12
  tagFormat?: string;
10
13
  propagate?: Propagate;
@@ -23,6 +26,7 @@ export interface TallyConfig {
23
26
  */
24
27
  plugins: Record<string, Record<string, unknown> | null>;
25
28
  defaults?: {
29
+ release?: boolean;
26
30
  tagFormat?: string;
27
31
  propagate?: Propagate;
28
32
  };
package/dist/discover.js CHANGED
@@ -40,11 +40,12 @@ export const discoverUnits = async (active, env) => {
40
40
  });
41
41
  }
42
42
  }
43
- for (const [key, overlay] of Object.entries(env.config.units ?? {})) {
43
+ for (const [key, { release, ...overlay }] of Object.entries(env.config.units ?? {})) {
44
44
  const root = normalizeRoot(key);
45
45
  const entry = byRoot.get(root);
46
46
  if (entry) {
47
47
  entry.draft = { ...entry.draft, ...overlay };
48
+ entry.release = release;
48
49
  }
49
50
  else {
50
51
  byRoot.set(root, {
@@ -55,6 +56,7 @@ export const discoverUnits = async (active, env) => {
55
56
  root,
56
57
  },
57
58
  meta: {},
59
+ release,
58
60
  });
59
61
  }
60
62
  }
@@ -82,7 +84,7 @@ export const discoverUnits = async (active, env) => {
82
84
  const roots = [...byRoot.keys()].sort(compare);
83
85
  const { defaults } = env.config;
84
86
  return [...byId.values()]
85
- .map(({ plugin, draft, meta }) => {
87
+ .map(({ plugin, draft, meta, release }) => {
86
88
  const { root } = draft;
87
89
  const nested = roots
88
90
  .filter((r) => isInside(r, root))
@@ -97,7 +99,9 @@ export const discoverUnits = async (active, env) => {
97
99
  ]),
98
100
  ]),
99
101
  exclude: Object.freeze([...nested, ...(draft.exclude ?? [])]),
100
- version: draft.version ?? "tag",
102
+ version: (release ?? defaults?.release ?? false)
103
+ ? (draft.version ?? "tag")
104
+ : "none",
101
105
  scheme: draft.scheme ?? "semver",
102
106
  tagFormat: draft.tagFormat ??
103
107
  defaults?.tagFormat ??
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { AffectedDoc, AffectedOptions, AffectedReason, AffectedUnit, BaseSo
3
3
  export type { DepConfig, TallyConfig, UnitOverlay } from "./config.js";
4
4
  export type { Warning } from "./errors.js";
5
5
  export type { Graph, SourcedEdge } from "./graph.js";
6
- export type { BumpLevel, Change, Ctx, Edge, EdgeDraft, GitReader, IntentSource, MaybePromise, Plugin, PreCtx, Propagate, RawCommit, ReadonlyFs, TagRef, Unit, UnitDraft, VersionFile, VersionMode, VersionScheme, WriteCtx, } from "./plugin.js";
6
+ export type { BumpLevel, Change, Ctx, Edge, EdgeDraft, GitReader, IntentSource, MaybePromise, Plugin, PreCtx, Propagate, RawCommit, ReadonlyFs, TagRef, Unit, UnitDraft, VersionFile, VersionMode, VersionScheme, VersionSource, WriteCtx, } from "./plugin.js";
7
7
  export type { ActivePlugin, PluginEnv } from "./plugins.js";
8
8
  export type { Workspace, WorkspaceInput } from "./workspace.js";
9
9
  export { computeAffected } from "./affected.js";
package/dist/plugin.d.ts CHANGED
@@ -69,14 +69,17 @@ export interface RawCommit {
69
69
  date: string;
70
70
  }
71
71
  export type Propagate = "auto" | "patch" | "rebuild";
72
- /** `file`: tags and version files; `tag`: tags only; `none`: build-only. */
73
- export type VersionMode = "file" | "tag" | "none";
72
+ /** Where a released unit's version lives. `file`: tags and version files; `tag`: tags only. */
73
+ export type VersionSource = "file" | "tag";
74
+ /** Effective mode; `none` when the unit is not released. */
75
+ export type VersionMode = VersionSource | "none";
74
76
  export interface UnitDraft {
75
77
  id: string;
76
78
  root: string;
77
79
  include?: string[];
78
80
  exclude?: string[];
79
- version?: VersionMode;
81
+ /** Source if the unit is released; default `tag`. */
82
+ version?: VersionSource;
80
83
  scheme?: string;
81
84
  tagFormat?: string;
82
85
  propagate?: Propagate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tallyrelease/core",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "description": "Pure planning core of tallyrelease",
5
5
  "repository": {
6
6
  "type": "git",