tegami 1.0.0-beta.5 → 1.0.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/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +3 -2
- package/dist/{draft-DtFyGxe8.js → draft-BqHcSCeX.js} +32 -23
- package/dist/{error-We7chQVJ.js → error-BhMYq9iW.js} +14 -1
- package/dist/{generate-BfYdNTFi.js → generate-Rvz4Lu98.js} +3 -33
- package/dist/generators/simple.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -141
- package/dist/npm-1iEegfHg.js +684 -0
- package/dist/plugins/cargo.d.ts +97 -0
- package/dist/{cargo-hlZX2akE.js → plugins/cargo.js} +43 -27
- package/dist/plugins/git.d.ts +1 -1
- package/dist/plugins/git.js +1 -1
- package/dist/plugins/github.d.ts +1 -1
- package/dist/plugins/github.js +4 -4
- package/dist/plugins/gitlab.d.ts +1 -1
- package/dist/plugins/gitlab.js +18 -25
- package/dist/plugins/go.d.ts +8 -7
- package/dist/plugins/go.js +34 -20
- package/dist/providers/npm.d.ts +1 -1
- package/dist/providers/npm.js +1 -1
- package/dist/shared-C92toqVI.js +32 -0
- package/dist/{types-C1rEqeM4.d.ts → types-DItu_YCc.d.ts} +100 -178
- package/dist/utils/index.js +1 -1
- package/dist/{version-request-DKvR3_xb.js → version-request-oxy16TJ1.js} +1 -1
- package/package.json +2 -2
- package/dist/npm-CMOyacwf.js +0 -371
- package/dist/providers/cargo.d.ts +0 -2
- package/dist/providers/cargo.js +0 -2
|
@@ -164,8 +164,8 @@ interface TegamiContext {
|
|
|
164
164
|
gitlab?: {
|
|
165
165
|
repo?: string;
|
|
166
166
|
token?: GitLabToken;
|
|
167
|
-
apiUrl
|
|
168
|
-
webUrl
|
|
167
|
+
apiUrl: string;
|
|
168
|
+
webUrl: string;
|
|
169
169
|
};
|
|
170
170
|
/** additional context when npm plugin is configured */
|
|
171
171
|
npm?: {
|
|
@@ -195,160 +195,27 @@ declare const packageManifestSchema: z.ZodObject<{
|
|
|
195
195
|
}, z.core.$loose>;
|
|
196
196
|
type PackageManifest = z.infer<typeof packageManifestSchema>;
|
|
197
197
|
//#endregion
|
|
198
|
-
//#region src/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
constructor(path: string, manifest: PackageManifest);
|
|
205
|
-
get name(): string;
|
|
206
|
-
get version(): string | undefined;
|
|
207
|
-
write(): Promise<void>;
|
|
208
|
-
initDraft(): PackageDraft;
|
|
209
|
-
configureDraft(draft: PackageDraft, group?: PackageGroup): void;
|
|
210
|
-
}
|
|
211
|
-
type DependencySpec = {
|
|
212
|
-
protocol: "npm";
|
|
213
|
-
alias: string;
|
|
214
|
-
range: string;
|
|
215
|
-
linked?: WorkspacePackage;
|
|
216
|
-
} | {
|
|
217
|
-
protocol: "workspace";
|
|
218
|
-
range: string;
|
|
219
|
-
linked?: WorkspacePackage;
|
|
220
|
-
} | {
|
|
221
|
-
protocol: "file";
|
|
222
|
-
raw: string;
|
|
223
|
-
linked?: WorkspacePackage;
|
|
224
|
-
} | {
|
|
225
|
-
range: string;
|
|
226
|
-
linked?: WorkspacePackage;
|
|
227
|
-
protocol?: undefined;
|
|
228
|
-
};
|
|
229
|
-
interface NpmPluginOptions {
|
|
230
|
-
/** Package manager command used for npm registry operations. */
|
|
231
|
-
client?: AgentName;
|
|
232
|
-
/**
|
|
233
|
-
* Decide how to bump the dependents of a bumped package.
|
|
234
|
-
*/
|
|
235
|
-
bumpDep?: (opts: {
|
|
236
|
-
dependent: NpmPackage;
|
|
237
|
-
kind: (typeof DEP_FIELDS$1)[number];
|
|
238
|
-
name: string;
|
|
239
|
-
spec: DependencySpec;
|
|
240
|
-
}) => BumpType | false;
|
|
241
|
-
/**
|
|
242
|
-
* What to do when a workspace dependency's version has gone beyond peer dependency constraints:
|
|
243
|
-
*
|
|
244
|
-
* - `set` (default): set to the current version (won't preserve prefix).
|
|
245
|
-
* - `error`: throw error.
|
|
246
|
-
* - `ignore`: do nothing.
|
|
247
|
-
*
|
|
248
|
-
* Note: `workspace:` protocols are not included.
|
|
249
|
-
*/
|
|
250
|
-
onBreakPeerDep?: "set" | "error" | "ignore";
|
|
251
|
-
/** update lockfile after applying a draft @default true */
|
|
252
|
-
updateLockFile?: boolean;
|
|
198
|
+
//#region src/changelog/generate.d.ts
|
|
199
|
+
interface GenerateFromCommitsOptions {
|
|
200
|
+
/** Start revision. Defaults to the latest reachable git tag, or all history if none exists. */
|
|
201
|
+
from?: string;
|
|
202
|
+
/** End revision. Defaults to HEAD. */
|
|
203
|
+
to?: string;
|
|
253
204
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}?: NpmPluginOptions): TegamiPlugin;
|
|
260
|
-
//#endregion
|
|
261
|
-
//#region src/providers/cargo/schema.d.ts
|
|
262
|
-
declare const cargoManifestSchema: z.ZodObject<{
|
|
263
|
-
package: z.ZodObject<{
|
|
264
|
-
name: z.ZodString;
|
|
265
|
-
version: z.ZodOptional<z.ZodString>;
|
|
266
|
-
publish: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
-
}, z.core.$strip>;
|
|
268
|
-
workspace: z.ZodOptional<z.ZodObject<{
|
|
269
|
-
members: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
271
|
-
package: z.ZodOptional<z.ZodObject<{
|
|
272
|
-
version: z.ZodOptional<z.ZodString>;
|
|
273
|
-
}, z.core.$strip>>;
|
|
274
|
-
}, z.core.$strip>>;
|
|
275
|
-
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
276
|
-
version: z.ZodString;
|
|
277
|
-
package: z.ZodOptional<z.ZodString>;
|
|
278
|
-
path: z.ZodOptional<z.ZodString>;
|
|
279
|
-
}, z.core.$strip>]>>>;
|
|
280
|
-
"dev-dependencies": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
281
|
-
version: z.ZodString;
|
|
282
|
-
package: z.ZodOptional<z.ZodString>;
|
|
283
|
-
path: z.ZodOptional<z.ZodString>;
|
|
284
|
-
}, z.core.$strip>]>>>;
|
|
285
|
-
"build-dependencies": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
286
|
-
version: z.ZodString;
|
|
287
|
-
package: z.ZodOptional<z.ZodString>;
|
|
288
|
-
path: z.ZodOptional<z.ZodString>;
|
|
289
|
-
}, z.core.$strip>]>>>;
|
|
290
|
-
target: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
291
|
-
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
292
|
-
version: z.ZodString;
|
|
293
|
-
package: z.ZodOptional<z.ZodString>;
|
|
294
|
-
path: z.ZodOptional<z.ZodString>;
|
|
295
|
-
}, z.core.$strip>]>>>;
|
|
296
|
-
"dev-dependencies": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
297
|
-
version: z.ZodString;
|
|
298
|
-
package: z.ZodOptional<z.ZodString>;
|
|
299
|
-
path: z.ZodOptional<z.ZodString>;
|
|
300
|
-
}, z.core.$strip>]>>>;
|
|
301
|
-
"build-dependencies": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
302
|
-
version: z.ZodString;
|
|
303
|
-
package: z.ZodOptional<z.ZodString>;
|
|
304
|
-
path: z.ZodOptional<z.ZodString>;
|
|
305
|
-
}, z.core.$strip>]>>>;
|
|
306
|
-
}, z.core.$strip>>>;
|
|
307
|
-
}, z.core.$strip>;
|
|
308
|
-
type CargoManifest = z.infer<typeof cargoManifestSchema>;
|
|
309
|
-
//#endregion
|
|
310
|
-
//#region src/providers/cargo.d.ts
|
|
311
|
-
declare const DEP_FIELDS: readonly ["dependencies", "dev-dependencies", "build-dependencies"];
|
|
312
|
-
declare class CargoPackage extends WorkspacePackage {
|
|
313
|
-
readonly path: string;
|
|
314
|
-
readonly manifest: CargoManifest;
|
|
315
|
-
private content;
|
|
316
|
-
private readonly workspaceManifest?;
|
|
317
|
-
readonly manager = "cargo";
|
|
318
|
-
constructor(path: string, manifest: CargoManifest, content: string, workspaceManifest?: CargoManifest | undefined);
|
|
319
|
-
get name(): string;
|
|
320
|
-
get version(): string | undefined;
|
|
321
|
-
setVersion(version: string): void;
|
|
322
|
-
write(): Promise<void>;
|
|
323
|
-
patch(path: string, value: unknown): void;
|
|
324
|
-
get packageInfo(): {
|
|
325
|
-
name: string;
|
|
326
|
-
version?: string | undefined;
|
|
327
|
-
publish?: boolean | undefined;
|
|
328
|
-
};
|
|
329
|
-
private get workspaceVersion();
|
|
205
|
+
interface CommitChangelog {
|
|
206
|
+
filename: string;
|
|
207
|
+
content: string;
|
|
208
|
+
packages: Record<string, BumpType | ChangelogPackageConfig>;
|
|
209
|
+
changes: CommitChange[];
|
|
330
210
|
}
|
|
331
|
-
interface
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Decide how to bump the dependents of a bumped package.
|
|
340
|
-
*/
|
|
341
|
-
bumpDep?: (opts: {
|
|
342
|
-
dependent: CargoPackage;
|
|
343
|
-
kind: (typeof DEP_FIELDS)[number];
|
|
344
|
-
name: string;
|
|
345
|
-
version: string;
|
|
346
|
-
}) => BumpType | false;
|
|
211
|
+
interface CommitChange {
|
|
212
|
+
hash: string;
|
|
213
|
+
subject: string;
|
|
214
|
+
body: string;
|
|
215
|
+
packages: string[];
|
|
216
|
+
type: BumpType;
|
|
217
|
+
title: string;
|
|
347
218
|
}
|
|
348
|
-
declare function cargo({
|
|
349
|
-
updateLockFile,
|
|
350
|
-
bumpDep: getBumpDepType
|
|
351
|
-
}?: CargoPluginOptions): TegamiPlugin;
|
|
352
219
|
//#endregion
|
|
353
220
|
//#region src/plans/publish.d.ts
|
|
354
221
|
interface PublishPlan {
|
|
@@ -368,7 +235,8 @@ interface PackagePublishPlan {
|
|
|
368
235
|
};
|
|
369
236
|
/** generated by npm plugin */
|
|
370
237
|
npm?: {
|
|
371
|
-
/** dist tag to use if published */distTag?: string;
|
|
238
|
+
/** dist tag to use if published */distTag?: string; /** point latest tag to it if published */
|
|
239
|
+
markLatest?: boolean;
|
|
372
240
|
};
|
|
373
241
|
/** publish result, generated for all packages in publish plan after publishing */
|
|
374
242
|
publishResult?: PackagePublishResult;
|
|
@@ -403,28 +271,6 @@ declare class PublishLock {
|
|
|
403
271
|
serialize(): string;
|
|
404
272
|
}
|
|
405
273
|
//#endregion
|
|
406
|
-
//#region src/changelog/generate.d.ts
|
|
407
|
-
interface GenerateFromCommitsOptions {
|
|
408
|
-
/** Start revision. Defaults to the latest reachable git tag, or all history if none exists. */
|
|
409
|
-
from?: string;
|
|
410
|
-
/** End revision. Defaults to HEAD. */
|
|
411
|
-
to?: string;
|
|
412
|
-
}
|
|
413
|
-
interface CommitChangelog {
|
|
414
|
-
filename: string;
|
|
415
|
-
content: string;
|
|
416
|
-
packages: Record<string, BumpType | ChangelogPackageConfig>;
|
|
417
|
-
changes: CommitChange[];
|
|
418
|
-
}
|
|
419
|
-
interface CommitChange {
|
|
420
|
-
hash: string;
|
|
421
|
-
subject: string;
|
|
422
|
-
body: string;
|
|
423
|
-
packages: string[];
|
|
424
|
-
type: BumpType;
|
|
425
|
-
title: string;
|
|
426
|
-
}
|
|
427
|
-
//#endregion
|
|
428
274
|
//#region src/index.d.ts
|
|
429
275
|
interface GenerateChangelogOptions extends GenerateFromCommitsOptions {
|
|
430
276
|
/**
|
|
@@ -492,6 +338,83 @@ interface TegamiCliRegistry {
|
|
|
492
338
|
parse(argv: string[]): Promise<void>;
|
|
493
339
|
}
|
|
494
340
|
//#endregion
|
|
341
|
+
//#region src/providers/npm/cli.d.ts
|
|
342
|
+
type TrustedPublishOptions = {
|
|
343
|
+
provider: "github"; /** CI workflow filename for publishing. */
|
|
344
|
+
workflow: string;
|
|
345
|
+
} | {
|
|
346
|
+
provider: "gitlab"; /** CI pipeline filename for publishing. */
|
|
347
|
+
workflow: string;
|
|
348
|
+
};
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/providers/npm.d.ts
|
|
351
|
+
declare const DEP_FIELDS: readonly ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
352
|
+
declare class NpmPackage extends WorkspacePackage {
|
|
353
|
+
readonly path: string;
|
|
354
|
+
readonly manifest: PackageManifest;
|
|
355
|
+
readonly manager = "npm";
|
|
356
|
+
constructor(path: string, manifest: PackageManifest);
|
|
357
|
+
get name(): string;
|
|
358
|
+
get version(): string | undefined;
|
|
359
|
+
write(): Promise<void>;
|
|
360
|
+
initDraft(): PackageDraft;
|
|
361
|
+
getRegistry(): string;
|
|
362
|
+
configureDraft(draft: PackageDraft, group?: PackageGroup): void;
|
|
363
|
+
}
|
|
364
|
+
type DependencySpec = {
|
|
365
|
+
protocol: "npm";
|
|
366
|
+
alias: string;
|
|
367
|
+
range: string;
|
|
368
|
+
linked?: WorkspacePackage;
|
|
369
|
+
} | {
|
|
370
|
+
protocol: "workspace";
|
|
371
|
+
range: string;
|
|
372
|
+
linked?: WorkspacePackage;
|
|
373
|
+
} | {
|
|
374
|
+
protocol: "file";
|
|
375
|
+
raw: string;
|
|
376
|
+
linked?: WorkspacePackage;
|
|
377
|
+
} | {
|
|
378
|
+
range: string;
|
|
379
|
+
linked?: WorkspacePackage;
|
|
380
|
+
protocol?: undefined;
|
|
381
|
+
};
|
|
382
|
+
interface DependentRef {
|
|
383
|
+
dependent: NpmPackage;
|
|
384
|
+
kind: (typeof DEP_FIELDS)[number];
|
|
385
|
+
name: string;
|
|
386
|
+
spec: DependencySpec;
|
|
387
|
+
}
|
|
388
|
+
interface NpmPluginOptions {
|
|
389
|
+
/** Package manager command used for npm registry operations. */
|
|
390
|
+
client?: AgentName;
|
|
391
|
+
/**
|
|
392
|
+
* Decide how to bump the dependents of a bumped package.
|
|
393
|
+
*/
|
|
394
|
+
bumpDep?: (opts: DependentRef) => BumpType | false;
|
|
395
|
+
/**
|
|
396
|
+
* What to do when a workspace dependency's version has gone beyond peer dependency constraints:
|
|
397
|
+
*
|
|
398
|
+
* - `set` (default): set to the current version (won't preserve prefix).
|
|
399
|
+
* - `error`: throw error.
|
|
400
|
+
* - `ignore`: do nothing.
|
|
401
|
+
*
|
|
402
|
+
* Note: `workspace:` protocols are not included.
|
|
403
|
+
*/
|
|
404
|
+
onBreakPeerDep?: "set" | "error" | "ignore";
|
|
405
|
+
/** update lockfile after applying a draft @default true */
|
|
406
|
+
updateLockFile?: boolean;
|
|
407
|
+
/** Configure `tegami npm pretrust`, disabled by default. */
|
|
408
|
+
trustedPublish?: TrustedPublishOptions;
|
|
409
|
+
}
|
|
410
|
+
declare function npm({
|
|
411
|
+
client: defaultClient,
|
|
412
|
+
onBreakPeerDep,
|
|
413
|
+
updateLockFile,
|
|
414
|
+
trustedPublish,
|
|
415
|
+
bumpDep: getBumpDepType
|
|
416
|
+
}?: NpmPluginOptions): TegamiPlugin;
|
|
417
|
+
//#endregion
|
|
495
418
|
//#region src/types.d.ts
|
|
496
419
|
/** Generates changelog content for a package release. */
|
|
497
420
|
interface LogGenerator {
|
|
@@ -525,7 +448,6 @@ interface TegamiOptions<Groups extends string = string> {
|
|
|
525
448
|
*/
|
|
526
449
|
conventionalCommits?: boolean;
|
|
527
450
|
npm?: NpmPluginOptions;
|
|
528
|
-
cargo?: CargoPluginOptions;
|
|
529
451
|
}
|
|
530
452
|
interface SharedGoOptions {
|
|
531
453
|
/**
|
|
@@ -641,4 +563,4 @@ interface PublishPreflight {
|
|
|
641
563
|
wait?: string[];
|
|
642
564
|
}
|
|
643
565
|
//#endregion
|
|
644
|
-
export {
|
|
566
|
+
export { PackageGroup as C, PackageDraft as D, DraftPolicy as E, BumpType as O, PackageGraph as S, Draft as T, PackagePublishResult as _, PublishPreflight as a, CommitChangelog as b, TegamiPluginOption as c, npm as d, GenerateChangelogOptions as f, PackagePublishPlan as g, PublishLock as h, PackageOptions as i, NpmPackage as l, tegami as m, GroupOptions as n, TegamiOptions as o, Tegami as p, LogGenerator as r, TegamiPlugin as s, Awaitable as t, NpmPluginOptions as u, PublishOptions as v, WorkspacePackage as w, TegamiContext as x, PublishPlan as y };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as execFailure } from "../error-
|
|
1
|
+
import { n as execFailure } from "../error-BhMYq9iW.js";
|
|
2
2
|
export { execFailure };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as formatNpmDistTag } from "./semver-EKJ8yK5U.js";
|
|
2
|
-
import { n as execFailure } from "./error-
|
|
2
|
+
import { n as execFailure } from "./error-BhMYq9iW.js";
|
|
3
3
|
import { x } from "tinyexec";
|
|
4
4
|
//#region src/utils/version-request.ts
|
|
5
5
|
async function hasGitChanges(cwd) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tegami",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Utility for package versioning & publish",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fuma Nama",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
".": "./dist/index.js",
|
|
17
17
|
"./cli": "./dist/cli/index.js",
|
|
18
18
|
"./generators/simple": "./dist/generators/simple.js",
|
|
19
|
+
"./plugins/cargo": "./dist/plugins/cargo.js",
|
|
19
20
|
"./plugins/git": "./dist/plugins/git.js",
|
|
20
21
|
"./plugins/github": "./dist/plugins/github.js",
|
|
21
22
|
"./plugins/gitlab": "./dist/plugins/gitlab.js",
|
|
22
23
|
"./plugins/go": "./dist/plugins/go.js",
|
|
23
|
-
"./providers/cargo": "./dist/providers/cargo.js",
|
|
24
24
|
"./providers/npm": "./dist/providers/npm.js",
|
|
25
25
|
"./utils": "./dist/utils/index.js",
|
|
26
26
|
"./package.json": "./package.json"
|