@html-validate/commitlint-config 3.0.30 → 3.2.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/bin/commitlint.js +3 -0
- package/bin/install.js +3 -0
- package/dist/commitlint.js +264488 -0
- package/dist/commitlint.schema.json +105 -0
- package/dist/config.js +181 -0
- package/dist/formatter.js +565 -0
- package/dist/install.js +476 -0
- package/dist/parser-preset.js +518 -0
- package/dist/templates/commit.hbs +30 -0
- package/dist/templates/footer.hbs +0 -0
- package/dist/templates/header.hbs +9 -0
- package/dist/templates/template.hbs +23 -0
- package/package.json +20 -42
- package/cli.js +0 -3
- package/index.js +0 -6
- package/install.js +0 -59
package/dist/install.js
ADDED
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
|
|
2
|
+
import { dirname as _$_dirname } from "node:path";
|
|
3
|
+
import { createRequire as _$_createRequire } from "node:module";
|
|
4
|
+
import { fileURLToPath as _$_fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const require = _$_createRequire(import.meta.url);
|
|
7
|
+
const __dirname = _$_dirname(_$_fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
var __create = Object.create;
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
14
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
16
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
// node_modules/ci-info/vendors.json
|
|
36
|
+
var require_vendors = __commonJS({
|
|
37
|
+
"node_modules/ci-info/vendors.json"(exports, module) {
|
|
38
|
+
module.exports = [
|
|
39
|
+
{
|
|
40
|
+
name: "Appcircle",
|
|
41
|
+
constant: "APPCIRCLE",
|
|
42
|
+
env: "AC_APPCIRCLE"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "AppVeyor",
|
|
46
|
+
constant: "APPVEYOR",
|
|
47
|
+
env: "APPVEYOR",
|
|
48
|
+
pr: "APPVEYOR_PULL_REQUEST_NUMBER"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "AWS CodeBuild",
|
|
52
|
+
constant: "CODEBUILD",
|
|
53
|
+
env: "CODEBUILD_BUILD_ARN"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "Azure Pipelines",
|
|
57
|
+
constant: "AZURE_PIPELINES",
|
|
58
|
+
env: "TF_BUILD",
|
|
59
|
+
pr: {
|
|
60
|
+
BUILD_REASON: "PullRequest"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "Bamboo",
|
|
65
|
+
constant: "BAMBOO",
|
|
66
|
+
env: "bamboo_planKey"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Bitbucket Pipelines",
|
|
70
|
+
constant: "BITBUCKET",
|
|
71
|
+
env: "BITBUCKET_COMMIT",
|
|
72
|
+
pr: "BITBUCKET_PR_ID"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Bitrise",
|
|
76
|
+
constant: "BITRISE",
|
|
77
|
+
env: "BITRISE_IO",
|
|
78
|
+
pr: "BITRISE_PULL_REQUEST"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Buddy",
|
|
82
|
+
constant: "BUDDY",
|
|
83
|
+
env: "BUDDY_WORKSPACE_ID",
|
|
84
|
+
pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "Buildkite",
|
|
88
|
+
constant: "BUILDKITE",
|
|
89
|
+
env: "BUILDKITE",
|
|
90
|
+
pr: {
|
|
91
|
+
env: "BUILDKITE_PULL_REQUEST",
|
|
92
|
+
ne: "false"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "CircleCI",
|
|
97
|
+
constant: "CIRCLE",
|
|
98
|
+
env: "CIRCLECI",
|
|
99
|
+
pr: "CIRCLE_PULL_REQUEST"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "Cirrus CI",
|
|
103
|
+
constant: "CIRRUS",
|
|
104
|
+
env: "CIRRUS_CI",
|
|
105
|
+
pr: "CIRRUS_PR"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "Codefresh",
|
|
109
|
+
constant: "CODEFRESH",
|
|
110
|
+
env: "CF_BUILD_ID",
|
|
111
|
+
pr: {
|
|
112
|
+
any: [
|
|
113
|
+
"CF_PULL_REQUEST_NUMBER",
|
|
114
|
+
"CF_PULL_REQUEST_ID"
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "Codemagic",
|
|
120
|
+
constant: "CODEMAGIC",
|
|
121
|
+
env: "CM_BUILD_ID",
|
|
122
|
+
pr: "CM_PULL_REQUEST"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "Codeship",
|
|
126
|
+
constant: "CODESHIP",
|
|
127
|
+
env: {
|
|
128
|
+
CI_NAME: "codeship"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "Drone",
|
|
133
|
+
constant: "DRONE",
|
|
134
|
+
env: "DRONE",
|
|
135
|
+
pr: {
|
|
136
|
+
DRONE_BUILD_EVENT: "pull_request"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "dsari",
|
|
141
|
+
constant: "DSARI",
|
|
142
|
+
env: "DSARI"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "Expo Application Services",
|
|
146
|
+
constant: "EAS",
|
|
147
|
+
env: "EAS_BUILD"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "Gerrit",
|
|
151
|
+
constant: "GERRIT",
|
|
152
|
+
env: "GERRIT_PROJECT"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "GitHub Actions",
|
|
156
|
+
constant: "GITHUB_ACTIONS",
|
|
157
|
+
env: "GITHUB_ACTIONS",
|
|
158
|
+
pr: {
|
|
159
|
+
GITHUB_EVENT_NAME: "pull_request"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "GitLab CI",
|
|
164
|
+
constant: "GITLAB",
|
|
165
|
+
env: "GITLAB_CI",
|
|
166
|
+
pr: "CI_MERGE_REQUEST_ID"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "GoCD",
|
|
170
|
+
constant: "GOCD",
|
|
171
|
+
env: "GO_PIPELINE_LABEL"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "Google Cloud Build",
|
|
175
|
+
constant: "GOOGLE_CLOUD_BUILD",
|
|
176
|
+
env: "BUILDER_OUTPUT"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "Harness CI",
|
|
180
|
+
constant: "HARNESS",
|
|
181
|
+
env: "HARNESS_BUILD_ID"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "Heroku",
|
|
185
|
+
constant: "HEROKU",
|
|
186
|
+
env: {
|
|
187
|
+
env: "NODE",
|
|
188
|
+
includes: "/app/.heroku/node/bin/node"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "Hudson",
|
|
193
|
+
constant: "HUDSON",
|
|
194
|
+
env: "HUDSON_URL"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "Jenkins",
|
|
198
|
+
constant: "JENKINS",
|
|
199
|
+
env: [
|
|
200
|
+
"JENKINS_URL",
|
|
201
|
+
"BUILD_ID"
|
|
202
|
+
],
|
|
203
|
+
pr: {
|
|
204
|
+
any: [
|
|
205
|
+
"ghprbPullId",
|
|
206
|
+
"CHANGE_ID"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "LayerCI",
|
|
212
|
+
constant: "LAYERCI",
|
|
213
|
+
env: "LAYERCI",
|
|
214
|
+
pr: "LAYERCI_PULL_REQUEST"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "Magnum CI",
|
|
218
|
+
constant: "MAGNUM",
|
|
219
|
+
env: "MAGNUM"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "Netlify CI",
|
|
223
|
+
constant: "NETLIFY",
|
|
224
|
+
env: "NETLIFY",
|
|
225
|
+
pr: {
|
|
226
|
+
env: "PULL_REQUEST",
|
|
227
|
+
ne: "false"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "Nevercode",
|
|
232
|
+
constant: "NEVERCODE",
|
|
233
|
+
env: "NEVERCODE",
|
|
234
|
+
pr: {
|
|
235
|
+
env: "NEVERCODE_PULL_REQUEST",
|
|
236
|
+
ne: "false"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "ReleaseHub",
|
|
241
|
+
constant: "RELEASEHUB",
|
|
242
|
+
env: "RELEASE_BUILD_ID"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "Render",
|
|
246
|
+
constant: "RENDER",
|
|
247
|
+
env: "RENDER",
|
|
248
|
+
pr: {
|
|
249
|
+
IS_PULL_REQUEST: "true"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "Sail CI",
|
|
254
|
+
constant: "SAIL",
|
|
255
|
+
env: "SAILCI",
|
|
256
|
+
pr: "SAIL_PULL_REQUEST_NUMBER"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "Screwdriver",
|
|
260
|
+
constant: "SCREWDRIVER",
|
|
261
|
+
env: "SCREWDRIVER",
|
|
262
|
+
pr: {
|
|
263
|
+
env: "SD_PULL_REQUEST",
|
|
264
|
+
ne: "false"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "Semaphore",
|
|
269
|
+
constant: "SEMAPHORE",
|
|
270
|
+
env: "SEMAPHORE",
|
|
271
|
+
pr: "PULL_REQUEST_NUMBER"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "Shippable",
|
|
275
|
+
constant: "SHIPPABLE",
|
|
276
|
+
env: "SHIPPABLE",
|
|
277
|
+
pr: {
|
|
278
|
+
IS_PULL_REQUEST: "true"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: "Solano CI",
|
|
283
|
+
constant: "SOLANO",
|
|
284
|
+
env: "TDDIUM",
|
|
285
|
+
pr: "TDDIUM_PR_ID"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "Sourcehut",
|
|
289
|
+
constant: "SOURCEHUT",
|
|
290
|
+
env: {
|
|
291
|
+
CI_NAME: "sourcehut"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "Strider CD",
|
|
296
|
+
constant: "STRIDER",
|
|
297
|
+
env: "STRIDER"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "TaskCluster",
|
|
301
|
+
constant: "TASKCLUSTER",
|
|
302
|
+
env: [
|
|
303
|
+
"TASK_ID",
|
|
304
|
+
"RUN_ID"
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "TeamCity",
|
|
309
|
+
constant: "TEAMCITY",
|
|
310
|
+
env: "TEAMCITY_VERSION"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: "Travis CI",
|
|
314
|
+
constant: "TRAVIS",
|
|
315
|
+
env: "TRAVIS",
|
|
316
|
+
pr: {
|
|
317
|
+
env: "TRAVIS_PULL_REQUEST",
|
|
318
|
+
ne: "false"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: "Vercel",
|
|
323
|
+
constant: "VERCEL",
|
|
324
|
+
env: {
|
|
325
|
+
any: [
|
|
326
|
+
"NOW_BUILDER",
|
|
327
|
+
"VERCEL"
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
pr: "VERCEL_GIT_PULL_REQUEST_ID"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: "Visual Studio App Center",
|
|
334
|
+
constant: "APPCENTER",
|
|
335
|
+
env: "APPCENTER_BUILD_ID"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "Woodpecker",
|
|
339
|
+
constant: "WOODPECKER",
|
|
340
|
+
env: {
|
|
341
|
+
CI: "woodpecker"
|
|
342
|
+
},
|
|
343
|
+
pr: {
|
|
344
|
+
CI_BUILD_EVENT: "pull_request"
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: "Xcode Cloud",
|
|
349
|
+
constant: "XCODE_CLOUD",
|
|
350
|
+
env: "CI_XCODE_PROJECT",
|
|
351
|
+
pr: "CI_PULL_REQUEST_NUMBER"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "Xcode Server",
|
|
355
|
+
constant: "XCODE_SERVER",
|
|
356
|
+
env: "XCS"
|
|
357
|
+
}
|
|
358
|
+
];
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
// node_modules/ci-info/index.js
|
|
363
|
+
var require_ci_info = __commonJS({
|
|
364
|
+
"node_modules/ci-info/index.js"(exports) {
|
|
365
|
+
"use strict";
|
|
366
|
+
var vendors = require_vendors();
|
|
367
|
+
var env = process.env;
|
|
368
|
+
Object.defineProperty(exports, "_vendors", {
|
|
369
|
+
value: vendors.map(function(v) {
|
|
370
|
+
return v.constant;
|
|
371
|
+
})
|
|
372
|
+
});
|
|
373
|
+
exports.name = null;
|
|
374
|
+
exports.isPR = null;
|
|
375
|
+
vendors.forEach(function(vendor) {
|
|
376
|
+
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
|
377
|
+
const isCI2 = envs.every(function(obj) {
|
|
378
|
+
return checkEnv(obj);
|
|
379
|
+
});
|
|
380
|
+
exports[vendor.constant] = isCI2;
|
|
381
|
+
if (!isCI2) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
exports.name = vendor.name;
|
|
385
|
+
switch (typeof vendor.pr) {
|
|
386
|
+
case "string":
|
|
387
|
+
exports.isPR = !!env[vendor.pr];
|
|
388
|
+
break;
|
|
389
|
+
case "object":
|
|
390
|
+
if ("env" in vendor.pr) {
|
|
391
|
+
exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
|
|
392
|
+
} else if ("any" in vendor.pr) {
|
|
393
|
+
exports.isPR = vendor.pr.any.some(function(key) {
|
|
394
|
+
return !!env[key];
|
|
395
|
+
});
|
|
396
|
+
} else {
|
|
397
|
+
exports.isPR = checkEnv(vendor.pr);
|
|
398
|
+
}
|
|
399
|
+
break;
|
|
400
|
+
default:
|
|
401
|
+
exports.isPR = null;
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
|
405
|
+
(env.BUILD_ID || // Jenkins, Cloudbees
|
|
406
|
+
env.BUILD_NUMBER || // Jenkins, TeamCity
|
|
407
|
+
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
|
|
408
|
+
env.CI_APP_ID || // Appflow
|
|
409
|
+
env.CI_BUILD_ID || // Appflow
|
|
410
|
+
env.CI_BUILD_NUMBER || // Appflow
|
|
411
|
+
env.CI_NAME || // Codeship and others
|
|
412
|
+
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
|
413
|
+
env.RUN_ID || // TaskCluster, dsari
|
|
414
|
+
exports.name || false));
|
|
415
|
+
function checkEnv(obj) {
|
|
416
|
+
if (typeof obj === "string")
|
|
417
|
+
return !!env[obj];
|
|
418
|
+
if ("env" in obj) {
|
|
419
|
+
return env[obj.env] && env[obj.env].includes(obj.includes);
|
|
420
|
+
}
|
|
421
|
+
if ("any" in obj) {
|
|
422
|
+
return obj.any.some(function(k) {
|
|
423
|
+
return !!env[k];
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
return Object.keys(obj).every(function(k) {
|
|
427
|
+
return env[k] === obj[k];
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
// node_modules/is-ci/index.js
|
|
434
|
+
var require_is_ci = __commonJS({
|
|
435
|
+
"node_modules/is-ci/index.js"(exports, module) {
|
|
436
|
+
"use strict";
|
|
437
|
+
module.exports = require_ci_info().isCI;
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
// src/install.ts
|
|
442
|
+
var import_is_ci = __toESM(require_is_ci(), 1);
|
|
443
|
+
import fs from "node:fs";
|
|
444
|
+
import path from "node:path";
|
|
445
|
+
import { spawnSync } from "node:child_process";
|
|
446
|
+
var MAX_DEPTH = 100;
|
|
447
|
+
function findGit(cwd) {
|
|
448
|
+
let current = cwd;
|
|
449
|
+
for (let depth = 0; depth < MAX_DEPTH; depth++) {
|
|
450
|
+
const search = path.join(current, ".git");
|
|
451
|
+
if (fs.existsSync(search)) {
|
|
452
|
+
return path.resolve(current);
|
|
453
|
+
}
|
|
454
|
+
const child = current;
|
|
455
|
+
current = path.dirname(current);
|
|
456
|
+
if (current === child) {
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
function configureCommitTemplate() {
|
|
463
|
+
const gitDir = findGit(process.cwd());
|
|
464
|
+
if (!gitDir) {
|
|
465
|
+
console.warn("Failed to locate git directory, skipping gitmessage");
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
const relPath = path.relative(gitDir, __dirname);
|
|
469
|
+
const gitmessage = path.join(relPath, "../gitmessage");
|
|
470
|
+
const args = ["config", "commit.template", gitmessage];
|
|
471
|
+
console.info(`git ${args.join(" ")}`);
|
|
472
|
+
spawnSync("git", args);
|
|
473
|
+
}
|
|
474
|
+
if (!import_is_ci.default) {
|
|
475
|
+
configureCommitTemplate();
|
|
476
|
+
}
|