prettier 4.0.3 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/node_modules/prettier/LICENSE +53 -124
- data/node_modules/prettier/doc.js +5 -5
- data/node_modules/prettier/index.cjs +1 -1
- data/node_modules/prettier/index.d.ts +5 -7
- data/node_modules/prettier/index.mjs +7854 -7334
- data/node_modules/prettier/internal/cli.mjs +18 -19
- data/node_modules/prettier/package.json +1 -2
- data/node_modules/prettier/plugins/acorn.js +1 -1
- data/node_modules/prettier/plugins/acorn.mjs +1 -1
- data/node_modules/prettier/plugins/angular.js +1 -2
- data/node_modules/prettier/plugins/angular.mjs +1 -2
- data/node_modules/prettier/plugins/babel.js +1 -1
- data/node_modules/prettier/plugins/babel.mjs +1 -1
- data/node_modules/prettier/plugins/estree.js +26 -26
- data/node_modules/prettier/plugins/estree.mjs +26 -26
- data/node_modules/prettier/plugins/flow.js +17 -17
- data/node_modules/prettier/plugins/flow.mjs +16 -16
- data/node_modules/prettier/plugins/glimmer.js +20 -20
- data/node_modules/prettier/plugins/glimmer.mjs +20 -20
- data/node_modules/prettier/plugins/markdown.js +40 -40
- data/node_modules/prettier/plugins/markdown.mjs +40 -40
- data/node_modules/prettier/plugins/meriyah.js +5 -5
- data/node_modules/prettier/plugins/meriyah.mjs +5 -5
- data/node_modules/prettier/plugins/postcss.js +1 -1
- data/node_modules/prettier/plugins/postcss.mjs +1 -1
- data/node_modules/prettier/plugins/typescript.js +20 -20
- data/node_modules/prettier/plugins/typescript.mjs +20 -20
- data/node_modules/prettier/standalone.d.ts +1 -1
- data/node_modules/prettier/standalone.js +15 -18
- data/node_modules/prettier/standalone.mjs +16 -19
- data/package.json +1 -1
- data/src/plugin.js +7 -4
- metadata +2 -3
- data/node_modules/prettier/internal/internal.mjs +0 -712
@@ -1,712 +0,0 @@
|
|
1
|
-
import { createRequire as __prettierCreateRequire } from "module";
|
2
|
-
import { fileURLToPath as __prettierFileUrlToPath } from "url";
|
3
|
-
import { dirname as __prettierDirname } from "path";
|
4
|
-
const require = __prettierCreateRequire(import.meta.url);
|
5
|
-
const __filename = __prettierFileUrlToPath(import.meta.url);
|
6
|
-
const __dirname = __prettierDirname(__filename);
|
7
|
-
|
8
|
-
var __create = Object.create;
|
9
|
-
var __defProp = Object.defineProperty;
|
10
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
11
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
12
|
-
var __getProtoOf = Object.getPrototypeOf;
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
14
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
15
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
16
|
-
}) : x)(function(x) {
|
17
|
-
if (typeof require !== "undefined")
|
18
|
-
return require.apply(this, arguments);
|
19
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
20
|
-
});
|
21
|
-
var __commonJS = (cb, mod) => function __require2() {
|
22
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
23
|
-
};
|
24
|
-
var __copyProps = (to, from, except, desc) => {
|
25
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
26
|
-
for (let key of __getOwnPropNames(from))
|
27
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
28
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
29
|
-
}
|
30
|
-
return to;
|
31
|
-
};
|
32
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
33
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
34
|
-
// file that has been converted to a CommonJS file using a Babel-
|
35
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
36
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
37
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
38
|
-
mod
|
39
|
-
));
|
40
|
-
|
41
|
-
// node_modules/lilconfig/dist/index.js
|
42
|
-
var require_dist = __commonJS({
|
43
|
-
"node_modules/lilconfig/dist/index.js"(exports) {
|
44
|
-
"use strict";
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
46
|
-
exports.lilconfigSync = exports.lilconfig = exports.defaultLoaders = void 0;
|
47
|
-
var path = __require("path");
|
48
|
-
var fs2 = __require("fs");
|
49
|
-
var os = __require("os");
|
50
|
-
var fsReadFileAsync = fs2.promises.readFile;
|
51
|
-
function getDefaultSearchPlaces(name) {
|
52
|
-
return [
|
53
|
-
"package.json",
|
54
|
-
`.${name}rc.json`,
|
55
|
-
`.${name}rc.js`,
|
56
|
-
`.${name}rc.cjs`,
|
57
|
-
`.config/${name}rc`,
|
58
|
-
`.config/${name}rc.json`,
|
59
|
-
`.config/${name}rc.js`,
|
60
|
-
`.config/${name}rc.cjs`,
|
61
|
-
`${name}.config.js`,
|
62
|
-
`${name}.config.cjs`
|
63
|
-
];
|
64
|
-
}
|
65
|
-
function getSearchPaths(startDir, stopDir) {
|
66
|
-
return startDir.split(path.sep).reduceRight((acc, _, ind, arr) => {
|
67
|
-
const currentPath = arr.slice(0, ind + 1).join(path.sep);
|
68
|
-
if (!acc.passedStopDir)
|
69
|
-
acc.searchPlaces.push(currentPath || path.sep);
|
70
|
-
if (currentPath === stopDir)
|
71
|
-
acc.passedStopDir = true;
|
72
|
-
return acc;
|
73
|
-
}, { searchPlaces: [], passedStopDir: false }).searchPlaces;
|
74
|
-
}
|
75
|
-
exports.defaultLoaders = Object.freeze({
|
76
|
-
".js": __require,
|
77
|
-
".json": __require,
|
78
|
-
".cjs": __require,
|
79
|
-
noExt(_, content) {
|
80
|
-
return JSON.parse(content);
|
81
|
-
}
|
82
|
-
});
|
83
|
-
function getExtDesc(ext) {
|
84
|
-
return ext === "noExt" ? "files without extensions" : `extension "${ext}"`;
|
85
|
-
}
|
86
|
-
function getOptions(name, options = {}) {
|
87
|
-
const conf = {
|
88
|
-
stopDir: os.homedir(),
|
89
|
-
searchPlaces: getDefaultSearchPlaces(name),
|
90
|
-
ignoreEmptySearchPlaces: true,
|
91
|
-
transform: (x) => x,
|
92
|
-
packageProp: [name],
|
93
|
-
...options,
|
94
|
-
loaders: { ...exports.defaultLoaders, ...options.loaders }
|
95
|
-
};
|
96
|
-
conf.searchPlaces.forEach((place) => {
|
97
|
-
const key = path.extname(place) || "noExt";
|
98
|
-
const loader = conf.loaders[key];
|
99
|
-
if (!loader) {
|
100
|
-
throw new Error(`No loader specified for ${getExtDesc(key)}, so searchPlaces item "${place}" is invalid`);
|
101
|
-
}
|
102
|
-
if (typeof loader !== "function") {
|
103
|
-
throw new Error(`loader for ${getExtDesc(key)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`);
|
104
|
-
}
|
105
|
-
});
|
106
|
-
return conf;
|
107
|
-
}
|
108
|
-
function getPackageProp(props, obj) {
|
109
|
-
if (typeof props === "string" && props in obj)
|
110
|
-
return obj[props];
|
111
|
-
return (Array.isArray(props) ? props : props.split(".")).reduce((acc, prop) => acc === void 0 ? acc : acc[prop], obj) || null;
|
112
|
-
}
|
113
|
-
function getSearchItems(searchPlaces, searchPaths) {
|
114
|
-
return searchPaths.reduce((acc, searchPath) => {
|
115
|
-
searchPlaces.forEach((sp) => acc.push({
|
116
|
-
searchPlace: sp,
|
117
|
-
filepath: path.join(searchPath, sp),
|
118
|
-
loaderKey: path.extname(sp) || "noExt"
|
119
|
-
}));
|
120
|
-
return acc;
|
121
|
-
}, []);
|
122
|
-
}
|
123
|
-
function validateFilePath(filepath) {
|
124
|
-
if (!filepath)
|
125
|
-
throw new Error("load must pass a non-empty string");
|
126
|
-
}
|
127
|
-
function validateLoader(loader, ext) {
|
128
|
-
if (!loader)
|
129
|
-
throw new Error(`No loader specified for extension "${ext}"`);
|
130
|
-
if (typeof loader !== "function")
|
131
|
-
throw new Error("loader is not a function");
|
132
|
-
}
|
133
|
-
function lilconfig2(name, options) {
|
134
|
-
const { ignoreEmptySearchPlaces, loaders, packageProp, searchPlaces, stopDir, transform } = getOptions(name, options);
|
135
|
-
return {
|
136
|
-
async search(searchFrom = process.cwd()) {
|
137
|
-
const searchPaths = getSearchPaths(searchFrom, stopDir);
|
138
|
-
const result = {
|
139
|
-
config: null,
|
140
|
-
filepath: ""
|
141
|
-
};
|
142
|
-
const searchItems = getSearchItems(searchPlaces, searchPaths);
|
143
|
-
for (const { searchPlace, filepath, loaderKey } of searchItems) {
|
144
|
-
try {
|
145
|
-
await fs2.promises.access(filepath);
|
146
|
-
} catch (_a) {
|
147
|
-
continue;
|
148
|
-
}
|
149
|
-
const content = String(await fsReadFileAsync(filepath));
|
150
|
-
const loader = loaders[loaderKey];
|
151
|
-
if (searchPlace === "package.json") {
|
152
|
-
const pkg = await loader(filepath, content);
|
153
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
154
|
-
if (maybeConfig != null) {
|
155
|
-
result.config = maybeConfig;
|
156
|
-
result.filepath = filepath;
|
157
|
-
break;
|
158
|
-
}
|
159
|
-
continue;
|
160
|
-
}
|
161
|
-
const isEmpty = content.trim() === "";
|
162
|
-
if (isEmpty && ignoreEmptySearchPlaces)
|
163
|
-
continue;
|
164
|
-
if (isEmpty) {
|
165
|
-
result.isEmpty = true;
|
166
|
-
result.config = void 0;
|
167
|
-
} else {
|
168
|
-
validateLoader(loader, loaderKey);
|
169
|
-
result.config = await loader(filepath, content);
|
170
|
-
}
|
171
|
-
result.filepath = filepath;
|
172
|
-
break;
|
173
|
-
}
|
174
|
-
if (result.filepath === "" && result.config === null)
|
175
|
-
return transform(null);
|
176
|
-
return transform(result);
|
177
|
-
},
|
178
|
-
async load(filepath) {
|
179
|
-
validateFilePath(filepath);
|
180
|
-
const absPath = path.resolve(process.cwd(), filepath);
|
181
|
-
const { base, ext } = path.parse(absPath);
|
182
|
-
const loaderKey = ext || "noExt";
|
183
|
-
const loader = loaders[loaderKey];
|
184
|
-
validateLoader(loader, loaderKey);
|
185
|
-
const content = String(await fsReadFileAsync(absPath));
|
186
|
-
if (base === "package.json") {
|
187
|
-
const pkg = await loader(absPath, content);
|
188
|
-
return transform({
|
189
|
-
config: getPackageProp(packageProp, pkg),
|
190
|
-
filepath: absPath
|
191
|
-
});
|
192
|
-
}
|
193
|
-
const result = {
|
194
|
-
config: null,
|
195
|
-
filepath: absPath
|
196
|
-
};
|
197
|
-
const isEmpty = content.trim() === "";
|
198
|
-
if (isEmpty && ignoreEmptySearchPlaces)
|
199
|
-
return transform({
|
200
|
-
config: void 0,
|
201
|
-
filepath: absPath,
|
202
|
-
isEmpty: true
|
203
|
-
});
|
204
|
-
result.config = isEmpty ? void 0 : await loader(absPath, content);
|
205
|
-
return transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result);
|
206
|
-
}
|
207
|
-
};
|
208
|
-
}
|
209
|
-
exports.lilconfig = lilconfig2;
|
210
|
-
}
|
211
|
-
});
|
212
|
-
|
213
|
-
// node_modules/find-parent-dir/index.js
|
214
|
-
var require_find_parent_dir = __commonJS({
|
215
|
-
"node_modules/find-parent-dir/index.js"(exports, module) {
|
216
|
-
"use strict";
|
217
|
-
var path = __require("path");
|
218
|
-
var fs2 = __require("fs");
|
219
|
-
var exists = fs2.exists || path.exists;
|
220
|
-
var existsSync = fs2.existsSync || path.existsSync;
|
221
|
-
function splitPath(path2) {
|
222
|
-
var parts = path2.split(/(\/|\\)/);
|
223
|
-
if (!parts.length)
|
224
|
-
return parts;
|
225
|
-
return !parts[0].length ? parts.slice(1) : parts;
|
226
|
-
}
|
227
|
-
exports = module.exports = function(currentFullPath, clue, cb) {
|
228
|
-
function testDir(parts) {
|
229
|
-
if (parts.length === 0)
|
230
|
-
return cb(null, null);
|
231
|
-
var p = parts.join("");
|
232
|
-
exists(path.join(p, clue), function(itdoes) {
|
233
|
-
if (itdoes)
|
234
|
-
return cb(null, p);
|
235
|
-
testDir(parts.slice(0, -1));
|
236
|
-
});
|
237
|
-
}
|
238
|
-
testDir(splitPath(currentFullPath));
|
239
|
-
};
|
240
|
-
exports.sync = function(currentFullPath, clue) {
|
241
|
-
function testDir(parts) {
|
242
|
-
if (parts.length === 0)
|
243
|
-
return null;
|
244
|
-
var p = parts.join("");
|
245
|
-
var itdoes = existsSync(path.join(p, clue));
|
246
|
-
return itdoes ? p : testDir(parts.slice(0, -1));
|
247
|
-
}
|
248
|
-
return testDir(splitPath(currentFullPath));
|
249
|
-
};
|
250
|
-
}
|
251
|
-
});
|
252
|
-
|
253
|
-
// node_modules/ci-info/vendors.json
|
254
|
-
var require_vendors = __commonJS({
|
255
|
-
"node_modules/ci-info/vendors.json"(exports, module) {
|
256
|
-
module.exports = [
|
257
|
-
{
|
258
|
-
name: "Agola CI",
|
259
|
-
constant: "AGOLA",
|
260
|
-
env: "AGOLA_GIT_REF",
|
261
|
-
pr: "AGOLA_PULL_REQUEST_ID"
|
262
|
-
},
|
263
|
-
{
|
264
|
-
name: "Appcircle",
|
265
|
-
constant: "APPCIRCLE",
|
266
|
-
env: "AC_APPCIRCLE"
|
267
|
-
},
|
268
|
-
{
|
269
|
-
name: "AppVeyor",
|
270
|
-
constant: "APPVEYOR",
|
271
|
-
env: "APPVEYOR",
|
272
|
-
pr: "APPVEYOR_PULL_REQUEST_NUMBER"
|
273
|
-
},
|
274
|
-
{
|
275
|
-
name: "AWS CodeBuild",
|
276
|
-
constant: "CODEBUILD",
|
277
|
-
env: "CODEBUILD_BUILD_ARN"
|
278
|
-
},
|
279
|
-
{
|
280
|
-
name: "Azure Pipelines",
|
281
|
-
constant: "AZURE_PIPELINES",
|
282
|
-
env: "TF_BUILD",
|
283
|
-
pr: {
|
284
|
-
BUILD_REASON: "PullRequest"
|
285
|
-
}
|
286
|
-
},
|
287
|
-
{
|
288
|
-
name: "Bamboo",
|
289
|
-
constant: "BAMBOO",
|
290
|
-
env: "bamboo_planKey"
|
291
|
-
},
|
292
|
-
{
|
293
|
-
name: "Bitbucket Pipelines",
|
294
|
-
constant: "BITBUCKET",
|
295
|
-
env: "BITBUCKET_COMMIT",
|
296
|
-
pr: "BITBUCKET_PR_ID"
|
297
|
-
},
|
298
|
-
{
|
299
|
-
name: "Bitrise",
|
300
|
-
constant: "BITRISE",
|
301
|
-
env: "BITRISE_IO",
|
302
|
-
pr: "BITRISE_PULL_REQUEST"
|
303
|
-
},
|
304
|
-
{
|
305
|
-
name: "Buddy",
|
306
|
-
constant: "BUDDY",
|
307
|
-
env: "BUDDY_WORKSPACE_ID",
|
308
|
-
pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
|
309
|
-
},
|
310
|
-
{
|
311
|
-
name: "Buildkite",
|
312
|
-
constant: "BUILDKITE",
|
313
|
-
env: "BUILDKITE",
|
314
|
-
pr: {
|
315
|
-
env: "BUILDKITE_PULL_REQUEST",
|
316
|
-
ne: "false"
|
317
|
-
}
|
318
|
-
},
|
319
|
-
{
|
320
|
-
name: "CircleCI",
|
321
|
-
constant: "CIRCLE",
|
322
|
-
env: "CIRCLECI",
|
323
|
-
pr: "CIRCLE_PULL_REQUEST"
|
324
|
-
},
|
325
|
-
{
|
326
|
-
name: "Cirrus CI",
|
327
|
-
constant: "CIRRUS",
|
328
|
-
env: "CIRRUS_CI",
|
329
|
-
pr: "CIRRUS_PR"
|
330
|
-
},
|
331
|
-
{
|
332
|
-
name: "Codefresh",
|
333
|
-
constant: "CODEFRESH",
|
334
|
-
env: "CF_BUILD_ID",
|
335
|
-
pr: {
|
336
|
-
any: [
|
337
|
-
"CF_PULL_REQUEST_NUMBER",
|
338
|
-
"CF_PULL_REQUEST_ID"
|
339
|
-
]
|
340
|
-
}
|
341
|
-
},
|
342
|
-
{
|
343
|
-
name: "Codemagic",
|
344
|
-
constant: "CODEMAGIC",
|
345
|
-
env: "CM_BUILD_ID",
|
346
|
-
pr: "CM_PULL_REQUEST"
|
347
|
-
},
|
348
|
-
{
|
349
|
-
name: "Codeship",
|
350
|
-
constant: "CODESHIP",
|
351
|
-
env: {
|
352
|
-
CI_NAME: "codeship"
|
353
|
-
}
|
354
|
-
},
|
355
|
-
{
|
356
|
-
name: "Drone",
|
357
|
-
constant: "DRONE",
|
358
|
-
env: "DRONE",
|
359
|
-
pr: {
|
360
|
-
DRONE_BUILD_EVENT: "pull_request"
|
361
|
-
}
|
362
|
-
},
|
363
|
-
{
|
364
|
-
name: "dsari",
|
365
|
-
constant: "DSARI",
|
366
|
-
env: "DSARI"
|
367
|
-
},
|
368
|
-
{
|
369
|
-
name: "Earthly",
|
370
|
-
constant: "EARTHLY",
|
371
|
-
env: "EARTHLY_CI"
|
372
|
-
},
|
373
|
-
{
|
374
|
-
name: "Expo Application Services",
|
375
|
-
constant: "EAS",
|
376
|
-
env: "EAS_BUILD"
|
377
|
-
},
|
378
|
-
{
|
379
|
-
name: "Gerrit",
|
380
|
-
constant: "GERRIT",
|
381
|
-
env: "GERRIT_PROJECT"
|
382
|
-
},
|
383
|
-
{
|
384
|
-
name: "Gitea Actions",
|
385
|
-
constant: "GITEA_ACTIONS",
|
386
|
-
env: "GITEA_ACTIONS"
|
387
|
-
},
|
388
|
-
{
|
389
|
-
name: "GitHub Actions",
|
390
|
-
constant: "GITHUB_ACTIONS",
|
391
|
-
env: "GITHUB_ACTIONS",
|
392
|
-
pr: {
|
393
|
-
GITHUB_EVENT_NAME: "pull_request"
|
394
|
-
}
|
395
|
-
},
|
396
|
-
{
|
397
|
-
name: "GitLab CI",
|
398
|
-
constant: "GITLAB",
|
399
|
-
env: "GITLAB_CI",
|
400
|
-
pr: "CI_MERGE_REQUEST_ID"
|
401
|
-
},
|
402
|
-
{
|
403
|
-
name: "GoCD",
|
404
|
-
constant: "GOCD",
|
405
|
-
env: "GO_PIPELINE_LABEL"
|
406
|
-
},
|
407
|
-
{
|
408
|
-
name: "Google Cloud Build",
|
409
|
-
constant: "GOOGLE_CLOUD_BUILD",
|
410
|
-
env: "BUILDER_OUTPUT"
|
411
|
-
},
|
412
|
-
{
|
413
|
-
name: "Harness CI",
|
414
|
-
constant: "HARNESS",
|
415
|
-
env: "HARNESS_BUILD_ID"
|
416
|
-
},
|
417
|
-
{
|
418
|
-
name: "Heroku",
|
419
|
-
constant: "HEROKU",
|
420
|
-
env: {
|
421
|
-
env: "NODE",
|
422
|
-
includes: "/app/.heroku/node/bin/node"
|
423
|
-
}
|
424
|
-
},
|
425
|
-
{
|
426
|
-
name: "Hudson",
|
427
|
-
constant: "HUDSON",
|
428
|
-
env: "HUDSON_URL"
|
429
|
-
},
|
430
|
-
{
|
431
|
-
name: "Jenkins",
|
432
|
-
constant: "JENKINS",
|
433
|
-
env: [
|
434
|
-
"JENKINS_URL",
|
435
|
-
"BUILD_ID"
|
436
|
-
],
|
437
|
-
pr: {
|
438
|
-
any: [
|
439
|
-
"ghprbPullId",
|
440
|
-
"CHANGE_ID"
|
441
|
-
]
|
442
|
-
}
|
443
|
-
},
|
444
|
-
{
|
445
|
-
name: "LayerCI",
|
446
|
-
constant: "LAYERCI",
|
447
|
-
env: "LAYERCI",
|
448
|
-
pr: "LAYERCI_PULL_REQUEST"
|
449
|
-
},
|
450
|
-
{
|
451
|
-
name: "Magnum CI",
|
452
|
-
constant: "MAGNUM",
|
453
|
-
env: "MAGNUM"
|
454
|
-
},
|
455
|
-
{
|
456
|
-
name: "Netlify CI",
|
457
|
-
constant: "NETLIFY",
|
458
|
-
env: "NETLIFY",
|
459
|
-
pr: {
|
460
|
-
env: "PULL_REQUEST",
|
461
|
-
ne: "false"
|
462
|
-
}
|
463
|
-
},
|
464
|
-
{
|
465
|
-
name: "Nevercode",
|
466
|
-
constant: "NEVERCODE",
|
467
|
-
env: "NEVERCODE",
|
468
|
-
pr: {
|
469
|
-
env: "NEVERCODE_PULL_REQUEST",
|
470
|
-
ne: "false"
|
471
|
-
}
|
472
|
-
},
|
473
|
-
{
|
474
|
-
name: "Prow",
|
475
|
-
constant: "PROW",
|
476
|
-
env: "PROW_JOB_ID"
|
477
|
-
},
|
478
|
-
{
|
479
|
-
name: "ReleaseHub",
|
480
|
-
constant: "RELEASEHUB",
|
481
|
-
env: "RELEASE_BUILD_ID"
|
482
|
-
},
|
483
|
-
{
|
484
|
-
name: "Render",
|
485
|
-
constant: "RENDER",
|
486
|
-
env: "RENDER",
|
487
|
-
pr: {
|
488
|
-
IS_PULL_REQUEST: "true"
|
489
|
-
}
|
490
|
-
},
|
491
|
-
{
|
492
|
-
name: "Sail CI",
|
493
|
-
constant: "SAIL",
|
494
|
-
env: "SAILCI",
|
495
|
-
pr: "SAIL_PULL_REQUEST_NUMBER"
|
496
|
-
},
|
497
|
-
{
|
498
|
-
name: "Screwdriver",
|
499
|
-
constant: "SCREWDRIVER",
|
500
|
-
env: "SCREWDRIVER",
|
501
|
-
pr: {
|
502
|
-
env: "SD_PULL_REQUEST",
|
503
|
-
ne: "false"
|
504
|
-
}
|
505
|
-
},
|
506
|
-
{
|
507
|
-
name: "Semaphore",
|
508
|
-
constant: "SEMAPHORE",
|
509
|
-
env: "SEMAPHORE",
|
510
|
-
pr: "PULL_REQUEST_NUMBER"
|
511
|
-
},
|
512
|
-
{
|
513
|
-
name: "Sourcehut",
|
514
|
-
constant: "SOURCEHUT",
|
515
|
-
env: {
|
516
|
-
CI_NAME: "sourcehut"
|
517
|
-
}
|
518
|
-
},
|
519
|
-
{
|
520
|
-
name: "Strider CD",
|
521
|
-
constant: "STRIDER",
|
522
|
-
env: "STRIDER"
|
523
|
-
},
|
524
|
-
{
|
525
|
-
name: "TaskCluster",
|
526
|
-
constant: "TASKCLUSTER",
|
527
|
-
env: [
|
528
|
-
"TASK_ID",
|
529
|
-
"RUN_ID"
|
530
|
-
]
|
531
|
-
},
|
532
|
-
{
|
533
|
-
name: "TeamCity",
|
534
|
-
constant: "TEAMCITY",
|
535
|
-
env: "TEAMCITY_VERSION"
|
536
|
-
},
|
537
|
-
{
|
538
|
-
name: "Travis CI",
|
539
|
-
constant: "TRAVIS",
|
540
|
-
env: "TRAVIS",
|
541
|
-
pr: {
|
542
|
-
env: "TRAVIS_PULL_REQUEST",
|
543
|
-
ne: "false"
|
544
|
-
}
|
545
|
-
},
|
546
|
-
{
|
547
|
-
name: "Vela",
|
548
|
-
constant: "VELA",
|
549
|
-
env: "VELA",
|
550
|
-
pr: {
|
551
|
-
VELA_PULL_REQUEST: "1"
|
552
|
-
}
|
553
|
-
},
|
554
|
-
{
|
555
|
-
name: "Vercel",
|
556
|
-
constant: "VERCEL",
|
557
|
-
env: {
|
558
|
-
any: [
|
559
|
-
"NOW_BUILDER",
|
560
|
-
"VERCEL"
|
561
|
-
]
|
562
|
-
},
|
563
|
-
pr: "VERCEL_GIT_PULL_REQUEST_ID"
|
564
|
-
},
|
565
|
-
{
|
566
|
-
name: "Visual Studio App Center",
|
567
|
-
constant: "APPCENTER",
|
568
|
-
env: "APPCENTER_BUILD_ID"
|
569
|
-
},
|
570
|
-
{
|
571
|
-
name: "Woodpecker",
|
572
|
-
constant: "WOODPECKER",
|
573
|
-
env: {
|
574
|
-
CI: "woodpecker"
|
575
|
-
},
|
576
|
-
pr: {
|
577
|
-
CI_BUILD_EVENT: "pull_request"
|
578
|
-
}
|
579
|
-
},
|
580
|
-
{
|
581
|
-
name: "Xcode Cloud",
|
582
|
-
constant: "XCODE_CLOUD",
|
583
|
-
env: "CI_XCODE_PROJECT",
|
584
|
-
pr: "CI_PULL_REQUEST_NUMBER"
|
585
|
-
},
|
586
|
-
{
|
587
|
-
name: "Xcode Server",
|
588
|
-
constant: "XCODE_SERVER",
|
589
|
-
env: "XCS"
|
590
|
-
}
|
591
|
-
];
|
592
|
-
}
|
593
|
-
});
|
594
|
-
|
595
|
-
// node_modules/ci-info/index.js
|
596
|
-
var require_ci_info = __commonJS({
|
597
|
-
"node_modules/ci-info/index.js"(exports) {
|
598
|
-
"use strict";
|
599
|
-
var vendors = require_vendors();
|
600
|
-
var env = process.env;
|
601
|
-
Object.defineProperty(exports, "_vendors", {
|
602
|
-
value: vendors.map(function(v) {
|
603
|
-
return v.constant;
|
604
|
-
})
|
605
|
-
});
|
606
|
-
exports.name = null;
|
607
|
-
exports.isPR = null;
|
608
|
-
vendors.forEach(function(vendor) {
|
609
|
-
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
610
|
-
const isCI2 = envs.every(function(obj) {
|
611
|
-
return checkEnv(obj);
|
612
|
-
});
|
613
|
-
exports[vendor.constant] = isCI2;
|
614
|
-
if (!isCI2) {
|
615
|
-
return;
|
616
|
-
}
|
617
|
-
exports.name = vendor.name;
|
618
|
-
switch (typeof vendor.pr) {
|
619
|
-
case "string":
|
620
|
-
exports.isPR = !!env[vendor.pr];
|
621
|
-
break;
|
622
|
-
case "object":
|
623
|
-
if ("env" in vendor.pr) {
|
624
|
-
exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
|
625
|
-
} else if ("any" in vendor.pr) {
|
626
|
-
exports.isPR = vendor.pr.any.some(function(key) {
|
627
|
-
return !!env[key];
|
628
|
-
});
|
629
|
-
} else {
|
630
|
-
exports.isPR = checkEnv(vendor.pr);
|
631
|
-
}
|
632
|
-
break;
|
633
|
-
default:
|
634
|
-
exports.isPR = null;
|
635
|
-
}
|
636
|
-
});
|
637
|
-
exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
638
|
-
(env.BUILD_ID || // Jenkins, Cloudbees
|
639
|
-
env.BUILD_NUMBER || // Jenkins, TeamCity
|
640
|
-
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
|
641
|
-
env.CI_APP_ID || // Appflow
|
642
|
-
env.CI_BUILD_ID || // Appflow
|
643
|
-
env.CI_BUILD_NUMBER || // Appflow
|
644
|
-
env.CI_NAME || // Codeship and others
|
645
|
-
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
646
|
-
env.RUN_ID || // TaskCluster, dsari
|
647
|
-
exports.name || false));
|
648
|
-
function checkEnv(obj) {
|
649
|
-
if (typeof obj === "string")
|
650
|
-
return !!env[obj];
|
651
|
-
if ("env" in obj) {
|
652
|
-
return env[obj.env] && env[obj.env].includes(obj.includes);
|
653
|
-
}
|
654
|
-
if ("any" in obj) {
|
655
|
-
return obj.any.some(function(k) {
|
656
|
-
return !!env[k];
|
657
|
-
});
|
658
|
-
}
|
659
|
-
return Object.keys(obj).every(function(k) {
|
660
|
-
return env[k] === obj[k];
|
661
|
-
});
|
662
|
-
}
|
663
|
-
}
|
664
|
-
});
|
665
|
-
|
666
|
-
// src/common/mockable.js
|
667
|
-
var import_lilconfig = __toESM(require_dist(), 1);
|
668
|
-
var import_find_parent_dir = __toESM(require_find_parent_dir(), 1);
|
669
|
-
import fs from "fs/promises";
|
670
|
-
|
671
|
-
// node_modules/get-stdin/index.js
|
672
|
-
var { stdin } = process;
|
673
|
-
async function getStdin() {
|
674
|
-
let result = "";
|
675
|
-
if (stdin.isTTY) {
|
676
|
-
return result;
|
677
|
-
}
|
678
|
-
stdin.setEncoding("utf8");
|
679
|
-
for await (const chunk of stdin) {
|
680
|
-
result += chunk;
|
681
|
-
}
|
682
|
-
return result;
|
683
|
-
}
|
684
|
-
getStdin.buffer = async () => {
|
685
|
-
const result = [];
|
686
|
-
let length = 0;
|
687
|
-
if (stdin.isTTY) {
|
688
|
-
return Buffer.concat([]);
|
689
|
-
}
|
690
|
-
for await (const chunk of stdin) {
|
691
|
-
result.push(chunk);
|
692
|
-
length += chunk.length;
|
693
|
-
}
|
694
|
-
return Buffer.concat(result, length);
|
695
|
-
};
|
696
|
-
|
697
|
-
// src/common/mockable.js
|
698
|
-
var import_ci_info = __toESM(require_ci_info(), 1);
|
699
|
-
function writeFormattedFile(file, data) {
|
700
|
-
return fs.writeFile(file, data);
|
701
|
-
}
|
702
|
-
var mockable = {
|
703
|
-
lilconfig: import_lilconfig.lilconfig,
|
704
|
-
findParentDir: import_find_parent_dir.sync,
|
705
|
-
getStdin,
|
706
|
-
isCI: () => import_ci_info.isCI,
|
707
|
-
writeFormattedFile
|
708
|
-
};
|
709
|
-
var mockable_default = mockable;
|
710
|
-
export {
|
711
|
-
mockable_default as default
|
712
|
-
};
|