@monoweave/types 0.0.5 → 1.1.0
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/lib/types.d.ts +31 -14
- package/package.json +21 -6
- package/schema.json +247 -0
package/lib/types.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export interface MonoweaveConfiguration {
|
|
|
83
83
|
* git.tag and autoCommit options, thus allowing you to create the tags
|
|
84
84
|
* and release commit automatically while deferring the actual push.
|
|
85
85
|
*
|
|
86
|
-
* @default
|
|
86
|
+
* @default true
|
|
87
87
|
*/
|
|
88
88
|
push: boolean;
|
|
89
89
|
/**
|
|
@@ -95,12 +95,15 @@ export interface MonoweaveConfiguration {
|
|
|
95
95
|
tag: boolean;
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
|
-
* A conventional changelog config package name. This
|
|
99
|
-
*
|
|
98
|
+
* A conventional changelog config package name. This config determines the changelog format,
|
|
99
|
+
* as well as the version strategy determiner.
|
|
100
|
+
*
|
|
101
|
+
* Set explicitly to false to disable conventional changelog mode and enter a "manual" mode
|
|
102
|
+
* that determines versions based on version files.
|
|
100
103
|
*
|
|
101
104
|
* @default _Partial internal implementation (not recommended)_
|
|
102
105
|
*/
|
|
103
|
-
conventionalChangelogConfig?: string | {
|
|
106
|
+
conventionalChangelogConfig?: false | string | {
|
|
104
107
|
name: string;
|
|
105
108
|
[key: string]: unknown;
|
|
106
109
|
};
|
|
@@ -109,12 +112,6 @@ export interface MonoweaveConfiguration {
|
|
|
109
112
|
* run, will contain change history useful for external scripts. Set to '-' to write to stdout.
|
|
110
113
|
*/
|
|
111
114
|
changesetFilename?: string;
|
|
112
|
-
/**
|
|
113
|
-
* Whether to resume publishing from a changeset. This option can only be set from the command line,
|
|
114
|
-
* and cannot be provided via a monoweave.config.js file. This feature is _not_ available yet. If
|
|
115
|
-
* you're interested in this feature, please leave comments on the [GitHub Issue](https://github.com/monoweave/monoweave/issues/323).
|
|
116
|
-
*/
|
|
117
|
-
applyChangeset?: boolean;
|
|
118
115
|
/**
|
|
119
116
|
* The filename to write changelogs to, assuming a conventional changelog config has been set.
|
|
120
117
|
* Use '<packageDir>' to reference the cwd of an individual workspace. You should also enable
|
|
@@ -214,7 +211,7 @@ export interface MonoweaveConfiguration {
|
|
|
214
211
|
* The maximum number of packages whose lifecycle scripts can be run in parallel. Similar to
|
|
215
212
|
* concurrency in Lerna.
|
|
216
213
|
*
|
|
217
|
-
* @default
|
|
214
|
+
* @default "os.availableParallelism()"
|
|
218
215
|
*/
|
|
219
216
|
jobs: number;
|
|
220
217
|
/**
|
|
@@ -268,9 +265,7 @@ export interface VersionStrategyConfiguration {
|
|
|
268
265
|
* "minor" version. If set to "major", the peerDependency version is rounded down
|
|
269
266
|
* to the nearest major.
|
|
270
267
|
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* @default "patch"
|
|
268
|
+
* @default "minor"
|
|
274
269
|
*/
|
|
275
270
|
coerceImplicitPeerDependency?: 'patch' | 'minor' | 'major';
|
|
276
271
|
/**
|
|
@@ -284,6 +279,19 @@ export interface VersionStrategyConfiguration {
|
|
|
284
279
|
* @default undefined
|
|
285
280
|
*/
|
|
286
281
|
minimumStrategy?: 'patch' | 'minor' | 'major' | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* If enabled, version strategy determination will be based on committed version files
|
|
284
|
+
* instead of conventional changelog commit message parsing. If a conventional changelog
|
|
285
|
+
* config is provided, it will be used for changelog generation only.
|
|
286
|
+
*/
|
|
287
|
+
manualMode?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* If using monoweave in manual mode (which is activated by setting the conventional changelog config
|
|
290
|
+
* explicitly to false), the version folder can be specified to change the location of deferred version files.
|
|
291
|
+
*
|
|
292
|
+
* @default "./.monoweave"
|
|
293
|
+
*/
|
|
294
|
+
versionFolder?: string;
|
|
287
295
|
}
|
|
288
296
|
export interface GroupConfiguration {
|
|
289
297
|
/**
|
|
@@ -322,6 +330,7 @@ export type PackageStrategyType = 'major' | 'minor' | 'patch';
|
|
|
322
330
|
export type PackageStrategyMap = Map<string, {
|
|
323
331
|
type: PackageStrategyType;
|
|
324
332
|
commits: CommitMessage[];
|
|
333
|
+
changelog?: string;
|
|
325
334
|
}>;
|
|
326
335
|
export type StrategyDeterminer = (commits: string[]) => Promise<number>;
|
|
327
336
|
export interface ChangesetRecord {
|
|
@@ -337,3 +346,11 @@ export declare function isNodeError<T = NodeJS.ErrnoException>(error: unknown):
|
|
|
337
346
|
export type MonoweaveConfigFile = RecursivePartial<Omit<MonoweaveConfiguration, 'cwd'>> & {
|
|
338
347
|
preset?: string;
|
|
339
348
|
};
|
|
349
|
+
/**
|
|
350
|
+
* Represents a deferred version entry, used when conventional changelog
|
|
351
|
+
* mode is disabled.
|
|
352
|
+
*/
|
|
353
|
+
export interface DeferredVersionRecord {
|
|
354
|
+
changelog?: string;
|
|
355
|
+
strategies: Record<string, PackageStrategyType | null>;
|
|
356
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoweave/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/monoweave/monoweave.git",
|
|
@@ -8,19 +8,34 @@
|
|
|
8
8
|
},
|
|
9
9
|
"author": {
|
|
10
10
|
"name": "noahnu",
|
|
11
|
-
"url": "https://monoweave.github.io"
|
|
11
|
+
"url": "https://monoweave.github.io/monoweave/"
|
|
12
12
|
},
|
|
13
13
|
"license": "BSD-3",
|
|
14
14
|
"main": "./lib/types.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./lib/types.d.ts",
|
|
18
|
+
"default": "./lib/types.js"
|
|
19
|
+
},
|
|
20
|
+
"./schema.json": "./schema.json"
|
|
21
|
+
},
|
|
15
22
|
"publishConfig": {
|
|
16
23
|
"main": "./lib/types.js",
|
|
17
24
|
"types": "./lib/types.d.ts",
|
|
18
25
|
"registry": "https://registry.npmjs.org/",
|
|
19
|
-
"access": "public"
|
|
26
|
+
"access": "public",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./lib/types.d.ts",
|
|
30
|
+
"default": "./lib/types.js"
|
|
31
|
+
},
|
|
32
|
+
"./schema.json": "./schema.json"
|
|
33
|
+
}
|
|
20
34
|
},
|
|
21
35
|
"group": "monoweave",
|
|
22
36
|
"files": [
|
|
23
|
-
"lib"
|
|
37
|
+
"lib",
|
|
38
|
+
"schema.json"
|
|
24
39
|
],
|
|
25
40
|
"scripts": {
|
|
26
41
|
"clean": "run workspace:clean \"$(pwd)\"",
|
|
@@ -31,15 +46,15 @@
|
|
|
31
46
|
"docs": "ts-node --transpile-only ./generateDocs.ts"
|
|
32
47
|
},
|
|
33
48
|
"dependencies": {
|
|
49
|
+
"@yarnpkg/core": "^4.0.3",
|
|
34
50
|
"tapable": "^2.2.1"
|
|
35
51
|
},
|
|
36
52
|
"peerDependencies": {
|
|
37
53
|
"@yarnpkg/core": "^4.0.3"
|
|
38
54
|
},
|
|
39
55
|
"devDependencies": {
|
|
40
|
-
"@types/jest": "^29.5.
|
|
56
|
+
"@types/jest": "^29.5.12",
|
|
41
57
|
"@types/node": "^18.18.6",
|
|
42
|
-
"@yarnpkg/core": "^4.0.3",
|
|
43
58
|
"ts-node": "^10.9.1",
|
|
44
59
|
"typedoc": "^0.25.2",
|
|
45
60
|
"typescript": "5.2.2"
|
package/schema.json
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/monoweave/monoweave/main/packages/types/schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "Monoweave Configuration File",
|
|
6
|
+
"description": "Monoweave configuration file schema.",
|
|
7
|
+
"properties": {
|
|
8
|
+
"preset": {
|
|
9
|
+
"description": "A configuration preset. This can point to an NPM package or one of the built-in monoweave presets (e.g. monoweave/preset-recommended, monoweave/preset-manual).",
|
|
10
|
+
"default": "monoweave/preset-recommended",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"nullable": true
|
|
13
|
+
},
|
|
14
|
+
"registryUrl": {
|
|
15
|
+
"description": "The NPM registry URL for fetching package information, and publishing packages. Note that this overrides any publishConfig.registryUrl or Yarn RC configuration.",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"nullable": true
|
|
18
|
+
},
|
|
19
|
+
"registryMode": {
|
|
20
|
+
"description": "By default the latest package versions upon which the version strategy is applied is taken from the NPM registry (npm mode). If registryMode is set to 'manifest' the latest version is instead taken from the package.json files. Note that 'manifest' mode is incompatible with prerelease mode.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"nullable": true,
|
|
23
|
+
"enum": ["npm", "manifest"]
|
|
24
|
+
},
|
|
25
|
+
"packageGroups": {
|
|
26
|
+
"description": "Package group specific settings. Note that if no packageGroupManifestField is set, each workspace is in its own group.",
|
|
27
|
+
"type": "object",
|
|
28
|
+
"patternProperties": {
|
|
29
|
+
".*": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"registryMode": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"nullable": true,
|
|
35
|
+
"enum": ["npm", "manifest"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dryRun": {
|
|
42
|
+
"description": "If enabled, any operation performing a destructive action on an external system is skipped over. This includes publishing to NPM, committing to git, and execution of lifecycle scripts. Use dry run to preview publish changes, and to validate your configuration. Defaults to true outside of CI.",
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"nullable": true
|
|
45
|
+
},
|
|
46
|
+
"conventionalChangelogConfig": {
|
|
47
|
+
"description": "A conventional changelog config package name. This config determines the changelog format, as well as the version strategy determiner. Set explicitly to false to disable conventional changelog mode and enter a 'manual' mode that determines versions based on version files.",
|
|
48
|
+
"type": ["string", "object", "boolean"],
|
|
49
|
+
"nullable": true,
|
|
50
|
+
"oneOf": [
|
|
51
|
+
{
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": ["name"],
|
|
54
|
+
"properties": {
|
|
55
|
+
"name": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"additionalProperties": true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"enum": [false]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"changesetFilename": {
|
|
71
|
+
"description": "The filename to write the changeset to. This is a metadata file which after a monoweave run, will contain change history useful for external scripts. Set to '-' to write to stdout.",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"nullable": true
|
|
74
|
+
},
|
|
75
|
+
"changelogFilename": {
|
|
76
|
+
"description": "The filename to write changelogs to, assuming a conventional changelog config has been set. Use '<packageDir>' to reference the cwd of an individual workspace. You should also enable 'autoCommit' when this is set so that the changelogs are committed to your repo.",
|
|
77
|
+
"type": "string",
|
|
78
|
+
"nullable": true
|
|
79
|
+
},
|
|
80
|
+
"changesetIgnorePatterns": {
|
|
81
|
+
"description": "An array of micromatch globs which will be used to filter out modified files. You can use this to skip modifications to 'test files' as part of the 'how this package changed' determination.",
|
|
82
|
+
"type": "array",
|
|
83
|
+
"nullable": true,
|
|
84
|
+
"items": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"commitIgnorePatterns": {
|
|
89
|
+
"description": "An array of regular expressions which will be used to filter out commits from the explicit package bump detection. The patterns are matched against commits of the form: <sha> <newline> <body>",
|
|
90
|
+
"type": "array",
|
|
91
|
+
"nullable": true,
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"forceWriteChangeFiles": {
|
|
97
|
+
"description": "By default, the changeset and changelog files are not written in dry run mode, as they constitute a change to an external system. Enable force write to write these change files, which can be useful for generating publish previews.",
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"nullable": true
|
|
100
|
+
},
|
|
101
|
+
"access": {
|
|
102
|
+
"description": "This overrides the access defined in the publishConfig of individual workspaces. Set this to 'infer' to respect individual workspace configurations.",
|
|
103
|
+
"type": "string",
|
|
104
|
+
"nullable": true,
|
|
105
|
+
"enum": ["infer", "public", "restricted"]
|
|
106
|
+
},
|
|
107
|
+
"persistVersions": {
|
|
108
|
+
"description": "Whether to persist package.json modifications, i.e. updating the dependency versions and the version field of each published workspace. Most publishing tools act as if this is enabled. It can be useful to disable version persistence if you do not want your CI environment to write back to your Git repository. Useful for runners like Jenkins. You should also enable 'autoCommit' when this is set so that the changelogs are committed to your repo.",
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"nullable": true
|
|
111
|
+
},
|
|
112
|
+
"topological": {
|
|
113
|
+
"description": "Whether to run the lifecycle scripts of the packages to publish in topological order, based on dependencies and peerDependencies. This excludes devDependencies from the graph.",
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"nullable": true
|
|
116
|
+
},
|
|
117
|
+
"topologicalDev": {
|
|
118
|
+
"description": "Similar to topological, however also consider devDependencies.",
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"nullable": true
|
|
121
|
+
},
|
|
122
|
+
"jobs": {
|
|
123
|
+
"description": "The maximum number of packages whose lifecycle scripts can be run in parallel. Similar to concurrency in Lerna.",
|
|
124
|
+
"type": "integer",
|
|
125
|
+
"nullable": true
|
|
126
|
+
},
|
|
127
|
+
"maxConcurrentReads": {
|
|
128
|
+
"description": "The maximum number of package metadata to read from the NPM registry simultaneously. If no default is set, or set to 0, Monoweave will use its discretion.",
|
|
129
|
+
"type": "integer",
|
|
130
|
+
"nullable": true
|
|
131
|
+
},
|
|
132
|
+
"maxConcurrentWrites": {
|
|
133
|
+
"description": "The maximum number of packages to publish to the NPM registry simultaneously. We have seen issues in the past with too many concurrent writes for private registries. If no default is set, or set to 0, Monoweave will use its discretion.",
|
|
134
|
+
"type": "integer",
|
|
135
|
+
"nullable": true
|
|
136
|
+
},
|
|
137
|
+
"autoCommit": {
|
|
138
|
+
"description": "Whether to automatically create a release commit after a publish. If using autoCommit, you must also have one of 'persistVersions' or 'changelogFilename' set.",
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"nullable": true
|
|
141
|
+
},
|
|
142
|
+
"autoCommitMessage": {
|
|
143
|
+
"description": "The commit message to use when autoCommit is enabled.",
|
|
144
|
+
"type": "string",
|
|
145
|
+
"nullable": true
|
|
146
|
+
},
|
|
147
|
+
"git": {
|
|
148
|
+
"description": "Git configuration.",
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"baseBranch": {
|
|
152
|
+
"description": "The base git ref to using as the starting point of package change discovery. If not set, this will default to the last tagged commit. You usually do not want to set this.",
|
|
153
|
+
"type": "string",
|
|
154
|
+
"nullable": true
|
|
155
|
+
},
|
|
156
|
+
"commitSha": {
|
|
157
|
+
"description": "The git ref which marks the 'end point' of package change discovery. This defaults to HEAD. You usually do not want to set this.",
|
|
158
|
+
"type": "string",
|
|
159
|
+
"nullable": true
|
|
160
|
+
},
|
|
161
|
+
"remote": {
|
|
162
|
+
"description": "The git remote name to push tags and the release commit to. Defaults to origin.",
|
|
163
|
+
"type": "string",
|
|
164
|
+
"nullable": true
|
|
165
|
+
},
|
|
166
|
+
"push": {
|
|
167
|
+
"description": "Whether to push to the git remote. This works in conjunction with the git.tag and autoCommit options, thus allowing you to create the tags and release commit automatically while deferring the actual push.",
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"nullable": true
|
|
170
|
+
},
|
|
171
|
+
"tag": {
|
|
172
|
+
"description": "Whether to create git tags to track the releases. It is useful to disable this when publishing to a test registry, where you do not want to modify the main git branch.",
|
|
173
|
+
"type": "boolean",
|
|
174
|
+
"nullable": true
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"required": [],
|
|
178
|
+
"additionalProperties": false,
|
|
179
|
+
"nullable": true
|
|
180
|
+
},
|
|
181
|
+
"plugins": {
|
|
182
|
+
"description": "An array of Monoweave plugins. See the plugin section of the documentation for more information.",
|
|
183
|
+
"type": "array",
|
|
184
|
+
"nullable": true,
|
|
185
|
+
"items": {
|
|
186
|
+
"anyOf": [
|
|
187
|
+
{
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"type": "array",
|
|
192
|
+
"prefixItems": [
|
|
193
|
+
{
|
|
194
|
+
"type": "string"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"minItems": 1,
|
|
198
|
+
"maxItems": 2
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"prerelease": {
|
|
204
|
+
"description": "Whether to run Monoweave in Prerelease mode. In prerelease mode, versions are not published to the latest npm dist tag. This is meant for release candidates, and beta versions. Version strategy behaviour is also impacted by this mode.",
|
|
205
|
+
"type": "boolean",
|
|
206
|
+
"nullable": true
|
|
207
|
+
},
|
|
208
|
+
"prereleaseId": {
|
|
209
|
+
"description": "The identifier to use in the prerelease tag. Defaults to 'rc' as in '1.0.0-rc.1'.",
|
|
210
|
+
"type": "string",
|
|
211
|
+
"nullable": true
|
|
212
|
+
},
|
|
213
|
+
"prereleaseNPMTag": {
|
|
214
|
+
"description": "The npm dist-tag to publish to in prerelease mode. Defaults to 'next'.",
|
|
215
|
+
"type": "string",
|
|
216
|
+
"nullable": true
|
|
217
|
+
},
|
|
218
|
+
"packageGroupManifestField": {
|
|
219
|
+
"description": "The manifest field name to use in workspace grouping. All packages within a group will always have the same version and git tag. If unset, all packages are versioned independently. Since the group is used for the git tag, it must not contain any characters not supported in a git tag. You can use a '.' to access nested properties in the manifest file. For example, you can use 'publishConfig.group' to access the group property in your publishConfig.",
|
|
220
|
+
"type": "string",
|
|
221
|
+
"nullable": true
|
|
222
|
+
},
|
|
223
|
+
"versionStrategy": {
|
|
224
|
+
"description": "Customizations to the version strategy logic.",
|
|
225
|
+
"type": "object",
|
|
226
|
+
"properties": {
|
|
227
|
+
"coerceImplicitPeerDependency": {
|
|
228
|
+
"description": "When patching dependencies in package manifests, this setting controls how to set the version for peerDependencies. The default is 'patch'. If set to 'minor', the peerDependency version is rounded down to the nearest 'minor' version. If set to 'major', the peerDependency version is rounded down to the nearest major.",
|
|
229
|
+
"type": "string",
|
|
230
|
+
"nullable": true,
|
|
231
|
+
"enum": ["patch", "minor", "major"]
|
|
232
|
+
},
|
|
233
|
+
"minimumStrategy": {
|
|
234
|
+
"description": "If specified, when determining explicit version strategies, a '3' or null returned from the strategy determiner will be coerced to the minimum strategy. This can be used to override a third party conventional changelog config such that all package changes are treated as a 'patch' at a minimum. Without this override, a strategy determiner, depending on the configuration, may treat a certain commit as a 'no-op'.",
|
|
235
|
+
"type": "string",
|
|
236
|
+
"nullable": true,
|
|
237
|
+
"enum": ["patch", "minor", "major"]
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": [],
|
|
241
|
+
"additionalProperties": false,
|
|
242
|
+
"nullable": true
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": [],
|
|
246
|
+
"additionalProperties": false
|
|
247
|
+
}
|