Add Robot_JoyIt driver
This commit is contained in:
1
node_modules/jest-changed-files/LICENSE
generated
vendored
1
node_modules/jest-changed-files/LICENSE
generated
vendored
@@ -1,6 +1,7 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
Copyright Contributors to the Jest project.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
169
node_modules/jest-changed-files/build/git.js
generated
vendored
169
node_modules/jest-changed-files/build/git.js
generated
vendored
@@ -1,169 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
_util = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _execa() {
|
||||
const data = _interopRequireDefault(require('execa'));
|
||||
_execa = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function (nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interopRequireWildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
const findChangedFilesUsingCommand = async (args, cwd) => {
|
||||
let result;
|
||||
try {
|
||||
result = await (0, _execa().default)('git', args, {
|
||||
cwd
|
||||
});
|
||||
} catch (e) {
|
||||
if (_util().types.isNativeError(e)) {
|
||||
const err = e;
|
||||
// TODO: Should we keep the original `message`?
|
||||
err.message = err.stderr;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return result.stdout
|
||||
.split('\n')
|
||||
.filter(s => s !== '')
|
||||
.map(changedPath => path().resolve(cwd, changedPath));
|
||||
};
|
||||
const adapter = {
|
||||
findChangedFiles: async (cwd, options) => {
|
||||
const changedSince =
|
||||
options.withAncestor === true ? 'HEAD^' : options.changedSince;
|
||||
const includePaths = (options.includePaths ?? []).map(absoluteRoot =>
|
||||
path().normalize(path().relative(cwd, absoluteRoot))
|
||||
);
|
||||
if (options.lastCommit === true) {
|
||||
return findChangedFilesUsingCommand(
|
||||
['show', '--name-only', '--pretty=format:', 'HEAD', '--'].concat(
|
||||
includePaths
|
||||
),
|
||||
cwd
|
||||
);
|
||||
}
|
||||
if (changedSince != null && changedSince.length > 0) {
|
||||
const [committed, staged, unstaged] = await Promise.all([
|
||||
findChangedFilesUsingCommand(
|
||||
['diff', '--name-only', `${changedSince}...HEAD`, '--'].concat(
|
||||
includePaths
|
||||
),
|
||||
cwd
|
||||
),
|
||||
findChangedFilesUsingCommand(
|
||||
['diff', '--cached', '--name-only', '--'].concat(includePaths),
|
||||
cwd
|
||||
),
|
||||
findChangedFilesUsingCommand(
|
||||
[
|
||||
'ls-files',
|
||||
'--other',
|
||||
'--modified',
|
||||
'--exclude-standard',
|
||||
'--'
|
||||
].concat(includePaths),
|
||||
cwd
|
||||
)
|
||||
]);
|
||||
return [...committed, ...staged, ...unstaged];
|
||||
}
|
||||
const [staged, unstaged] = await Promise.all([
|
||||
findChangedFilesUsingCommand(
|
||||
['diff', '--cached', '--name-only', '--'].concat(includePaths),
|
||||
cwd
|
||||
),
|
||||
findChangedFilesUsingCommand(
|
||||
[
|
||||
'ls-files',
|
||||
'--other',
|
||||
'--modified',
|
||||
'--exclude-standard',
|
||||
'--'
|
||||
].concat(includePaths),
|
||||
cwd
|
||||
)
|
||||
]);
|
||||
return [...staged, ...unstaged];
|
||||
},
|
||||
getRoot: async cwd => {
|
||||
const options = ['rev-parse', '--show-cdup'];
|
||||
try {
|
||||
const result = await (0, _execa().default)('git', options, {
|
||||
cwd
|
||||
});
|
||||
return path().resolve(cwd, result.stdout);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = adapter;
|
||||
exports.default = _default;
|
||||
130
node_modules/jest-changed-files/build/hg.js
generated
vendored
130
node_modules/jest-changed-files/build/hg.js
generated
vendored
@@ -1,130 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
_util = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _execa() {
|
||||
const data = _interopRequireDefault(require('execa'));
|
||||
_execa = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function (nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interopRequireWildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
const env = {
|
||||
...process.env,
|
||||
HGPLAIN: '1'
|
||||
};
|
||||
const adapter = {
|
||||
findChangedFiles: async (cwd, options) => {
|
||||
const includePaths = options.includePaths ?? [];
|
||||
const args = ['status', '-amnu'];
|
||||
if (options.withAncestor === true) {
|
||||
args.push('--rev', 'first(min(!public() & ::.)^+.^)');
|
||||
} else if (
|
||||
options.changedSince != null &&
|
||||
options.changedSince.length > 0
|
||||
) {
|
||||
args.push('--rev', `ancestor(., ${options.changedSince})`);
|
||||
} else if (options.lastCommit === true) {
|
||||
args.push('--change', '.');
|
||||
}
|
||||
args.push(...includePaths);
|
||||
let result;
|
||||
try {
|
||||
result = await (0, _execa().default)('hg', args, {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
} catch (e) {
|
||||
if (_util().types.isNativeError(e)) {
|
||||
const err = e;
|
||||
// TODO: Should we keep the original `message`?
|
||||
err.message = err.stderr;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return result.stdout
|
||||
.split('\n')
|
||||
.filter(s => s !== '')
|
||||
.map(changedPath => path().resolve(cwd, changedPath));
|
||||
},
|
||||
getRoot: async cwd => {
|
||||
try {
|
||||
const result = await (0, _execa().default)('hg', ['root'], {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
return result.stdout;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = adapter;
|
||||
exports.default = _default;
|
||||
30
node_modules/jest-changed-files/build/index.d.mts
generated
vendored
Normal file
30
node_modules/jest-changed-files/build/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
//#region src/types.d.ts
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
type Options = {
|
||||
lastCommit?: boolean;
|
||||
withAncestor?: boolean;
|
||||
changedSince?: string;
|
||||
includePaths?: Array<string>;
|
||||
};
|
||||
type Paths = Set<string>;
|
||||
type Repos = {
|
||||
git: Paths;
|
||||
hg: Paths;
|
||||
sl: Paths;
|
||||
};
|
||||
type ChangedFiles = {
|
||||
repos: Repos;
|
||||
changedFiles: Paths;
|
||||
};
|
||||
type ChangedFilesPromise = Promise<ChangedFiles>;
|
||||
//#endregion
|
||||
//#region src/index.d.ts
|
||||
declare const getChangedFilesForRoots: (roots: Array<string>, options: Options) => ChangedFilesPromise;
|
||||
declare const findRepos: (roots: Array<string>) => Promise<Repos>;
|
||||
//#endregion
|
||||
export { ChangedFiles, ChangedFilesPromise, findRepos, getChangedFilesForRoots };
|
||||
1
node_modules/jest-changed-files/build/index.d.ts
generated
vendored
1
node_modules/jest-changed-files/build/index.d.ts
generated
vendored
@@ -4,6 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
export declare type ChangedFiles = {
|
||||
repos: Repos;
|
||||
changedFiles: Paths;
|
||||
|
||||
328
node_modules/jest-changed-files/build/index.js
generated
vendored
328
node_modules/jest-changed-files/build/index.js
generated
vendored
@@ -1,29 +1,307 @@
|
||||
'use strict';
|
||||
/*!
|
||||
* /**
|
||||
* * Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* *
|
||||
* * This source code is licensed under the MIT license found in the
|
||||
* * LICENSE file in the root directory of this source tree.
|
||||
* * /
|
||||
*/
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
/***/ "./src/git.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
});
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require("path"));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _execa() {
|
||||
const data = _interopRequireDefault(require("execa"));
|
||||
_execa = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
const findChangedFilesUsingCommand = async (args, cwd) => {
|
||||
const result = await (0, _execa().default)('git', args, {
|
||||
cwd
|
||||
});
|
||||
return result.stdout.split('\n').filter(s => s !== '').map(changedPath => path().resolve(cwd, changedPath));
|
||||
};
|
||||
const adapter = {
|
||||
findChangedFiles: async (cwd, options) => {
|
||||
const changedSince = options.withAncestor === true ? 'HEAD^' : options.changedSince;
|
||||
const includePaths = (options.includePaths ?? []).map(absoluteRoot => path().normalize(path().relative(cwd, absoluteRoot)));
|
||||
if (options.lastCommit === true) {
|
||||
return findChangedFilesUsingCommand(['show', '--name-only', '--pretty=format:', 'HEAD', '--', ...includePaths], cwd);
|
||||
}
|
||||
if (changedSince != null && changedSince.length > 0) {
|
||||
const [committed, staged, unstaged] = await Promise.all([findChangedFilesUsingCommand(['diff', '--name-only', `${changedSince}...HEAD`, '--', ...includePaths], cwd), findChangedFilesUsingCommand(['diff', '--cached', '--name-only', '--', ...includePaths], cwd), findChangedFilesUsingCommand(['ls-files', '--other', '--modified', '--exclude-standard', '--', ...includePaths], cwd)]);
|
||||
return [...committed, ...staged, ...unstaged];
|
||||
}
|
||||
const [staged, unstaged] = await Promise.all([findChangedFilesUsingCommand(['diff', '--cached', '--name-only', '--', ...includePaths], cwd), findChangedFilesUsingCommand(['ls-files', '--other', '--modified', '--exclude-standard', '--', ...includePaths], cwd)]);
|
||||
return [...staged, ...unstaged];
|
||||
},
|
||||
getRoot: async cwd => {
|
||||
const options = ['rev-parse', '--show-cdup'];
|
||||
try {
|
||||
const result = await (0, _execa().default)('git', options, {
|
||||
cwd
|
||||
});
|
||||
return path().resolve(cwd, result.stdout);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = exports["default"] = adapter;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/hg.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require("path"));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _execa() {
|
||||
const data = _interopRequireDefault(require("execa"));
|
||||
_execa = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
const env = {
|
||||
...process.env,
|
||||
HGPLAIN: '1'
|
||||
};
|
||||
const adapter = {
|
||||
findChangedFiles: async (cwd, options) => {
|
||||
const includePaths = options.includePaths ?? [];
|
||||
const args = ['status', '-amnu'];
|
||||
if (options.withAncestor === true) {
|
||||
args.push('--rev', 'first(min(!public() & ::.)^+.^)');
|
||||
} else if (options.changedSince != null && options.changedSince.length > 0) {
|
||||
args.push('--rev', `ancestor(., ${options.changedSince})`);
|
||||
} else if (options.lastCommit === true) {
|
||||
args.push('--change', '.');
|
||||
}
|
||||
args.push(...includePaths);
|
||||
const result = await (0, _execa().default)('hg', args, {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
return result.stdout.split('\n').filter(s => s !== '').map(changedPath => path().resolve(cwd, changedPath));
|
||||
},
|
||||
getRoot: async cwd => {
|
||||
try {
|
||||
const result = await (0, _execa().default)('hg', ['root'], {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
return result.stdout;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = exports["default"] = adapter;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/sl.ts":
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports["default"] = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require("path"));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _execa() {
|
||||
const data = _interopRequireDefault(require("execa"));
|
||||
_execa = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable any configuration settings that might change Sapling's default output.
|
||||
* More info in `sl help environment`. _HG_PLAIN is intentional
|
||||
*/
|
||||
const env = {
|
||||
...process.env,
|
||||
HGPLAIN: '1'
|
||||
};
|
||||
|
||||
// Whether `sl` is a steam locomotive or not
|
||||
let isSteamLocomotive = false;
|
||||
const adapter = {
|
||||
findChangedFiles: async (cwd, options) => {
|
||||
const includePaths = options.includePaths ?? [];
|
||||
const args = ['status', '-amnu'];
|
||||
if (options.withAncestor === true) {
|
||||
args.push('--rev', 'first(min(!public() & ::.)^+.^)');
|
||||
} else if (options.changedSince != null && options.changedSince.length > 0) {
|
||||
args.push('--rev', `ancestor(., ${options.changedSince})`);
|
||||
} else if (options.lastCommit === true) {
|
||||
args.push('--change', '.');
|
||||
}
|
||||
args.push(...includePaths);
|
||||
const result = await (0, _execa().default)('sl', args, {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
return result.stdout.split('\n').filter(s => s !== '').map(changedPath => path().resolve(cwd, changedPath));
|
||||
},
|
||||
getRoot: async cwd => {
|
||||
if (isSteamLocomotive) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const subprocess = (0, _execa().default)('sl', ['root'], {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
|
||||
// Check if we're calling sl (steam locomotive) instead of sl (sapling)
|
||||
// by looking for the escape character in the first chunk of data.
|
||||
if (subprocess.stdout) {
|
||||
subprocess.stdout.once('data', data => {
|
||||
data = Buffer.isBuffer(data) ? data.toString() : data;
|
||||
if (data.codePointAt(0) === 27) {
|
||||
subprocess.cancel();
|
||||
isSteamLocomotive = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
const result = await subprocess;
|
||||
if (result.killed && isSteamLocomotive) {
|
||||
return null;
|
||||
}
|
||||
return result.stdout;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = exports["default"] = adapter;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
|
||||
(() => {
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
exports.getChangedFilesForRoots = exports.findRepos = void 0;
|
||||
function _pLimit() {
|
||||
const data = _interopRequireDefault(require('p-limit'));
|
||||
const data = _interopRequireDefault(require("p-limit"));
|
||||
_pLimit = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
const data = require("jest-util");
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _git = _interopRequireDefault(require('./git'));
|
||||
var _hg = _interopRequireDefault(require('./hg'));
|
||||
var _sl = _interopRequireDefault(require('./sl'));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
var _git = _interopRequireDefault(__webpack_require__("./src/git.ts"));
|
||||
var _hg = _interopRequireDefault(__webpack_require__("./src/hg.ts"));
|
||||
var _sl = _interopRequireDefault(__webpack_require__("./src/sl.ts"));
|
||||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
@@ -44,18 +322,11 @@ const getChangedFilesForRoots = async (roots, options) => {
|
||||
includePaths: roots,
|
||||
...options
|
||||
};
|
||||
const gitPromises = Array.from(repos.git, repo =>
|
||||
_git.default.findChangedFiles(repo, changedFilesOptions)
|
||||
);
|
||||
const hgPromises = Array.from(repos.hg, repo =>
|
||||
_hg.default.findChangedFiles(repo, changedFilesOptions)
|
||||
);
|
||||
const slPromises = Array.from(repos.sl, repo =>
|
||||
_sl.default.findChangedFiles(repo, changedFilesOptions)
|
||||
);
|
||||
const changedFiles = (
|
||||
await Promise.all([...gitPromises, ...hgPromises, ...slPromises])
|
||||
).reduce((allFiles, changedFilesInTheRepo) => {
|
||||
const gitPromises = Array.from(repos.git, repo => _git.default.findChangedFiles(repo, changedFilesOptions));
|
||||
const hgPromises = Array.from(repos.hg, repo => _hg.default.findChangedFiles(repo, changedFilesOptions));
|
||||
const slPromises = Array.from(repos.sl, repo => _sl.default.findChangedFiles(repo, changedFilesOptions));
|
||||
const allVcs = await Promise.all([...gitPromises, ...hgPromises, ...slPromises]);
|
||||
const changedFiles = allVcs.reduce((allFiles, changedFilesInTheRepo) => {
|
||||
for (const file of changedFilesInTheRepo) {
|
||||
allFiles.add(file);
|
||||
}
|
||||
@@ -68,11 +339,7 @@ const getChangedFilesForRoots = async (roots, options) => {
|
||||
};
|
||||
exports.getChangedFilesForRoots = getChangedFilesForRoots;
|
||||
const findRepos = async roots => {
|
||||
const [gitRepos, hgRepos, slRepos] = await Promise.all([
|
||||
Promise.all(roots.map(findGitRoot)),
|
||||
Promise.all(roots.map(findHgRoot)),
|
||||
Promise.all(roots.map(findSlRoot))
|
||||
]);
|
||||
const [gitRepos, hgRepos, slRepos] = await Promise.all([Promise.all(roots.map(findGitRoot)), Promise.all(roots.map(findHgRoot)), Promise.all(roots.map(findSlRoot))]);
|
||||
return {
|
||||
git: new Set(gitRepos.filter(_jestUtil().isNonNullable)),
|
||||
hg: new Set(hgRepos.filter(_jestUtil().isNonNullable)),
|
||||
@@ -80,3 +347,8 @@ const findRepos = async roots => {
|
||||
};
|
||||
};
|
||||
exports.findRepos = findRepos;
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
4
node_modules/jest-changed-files/build/index.mjs
generated
vendored
Normal file
4
node_modules/jest-changed-files/build/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import cjsModule from './index.js';
|
||||
|
||||
export const findRepos = cjsModule.findRepos;
|
||||
export const getChangedFilesForRoots = cjsModule.getChangedFilesForRoots;
|
||||
134
node_modules/jest-changed-files/build/sl.js
generated
vendored
134
node_modules/jest-changed-files/build/sl.js
generated
vendored
@@ -1,134 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function path() {
|
||||
const data = _interopRequireWildcard(require('path'));
|
||||
path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
_util = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _execa() {
|
||||
const data = _interopRequireDefault(require('execa'));
|
||||
_execa = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== 'function') return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function (nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interopRequireWildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
return {default: obj};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for (var key in obj) {
|
||||
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable any configuration settings that might change Sapling's default output.
|
||||
* More info in `sl help environment`. _HG_PLAIN is intentional
|
||||
*/
|
||||
const env = {
|
||||
...process.env,
|
||||
HGPLAIN: '1'
|
||||
};
|
||||
const adapter = {
|
||||
findChangedFiles: async (cwd, options) => {
|
||||
const includePaths = options.includePaths ?? [];
|
||||
const args = ['status', '-amnu'];
|
||||
if (options.withAncestor === true) {
|
||||
args.push('--rev', 'first(min(!public() & ::.)^+.^)');
|
||||
} else if (
|
||||
options.changedSince != null &&
|
||||
options.changedSince.length > 0
|
||||
) {
|
||||
args.push('--rev', `ancestor(., ${options.changedSince})`);
|
||||
} else if (options.lastCommit === true) {
|
||||
args.push('--change', '.');
|
||||
}
|
||||
args.push(...includePaths);
|
||||
let result;
|
||||
try {
|
||||
result = await (0, _execa().default)('sl', args, {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
} catch (e) {
|
||||
if (_util().types.isNativeError(e)) {
|
||||
const err = e;
|
||||
// TODO: Should we keep the original `message`?
|
||||
err.message = err.stderr;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return result.stdout
|
||||
.split('\n')
|
||||
.filter(s => s !== '')
|
||||
.map(changedPath => path().resolve(cwd, changedPath));
|
||||
},
|
||||
getRoot: async cwd => {
|
||||
try {
|
||||
const result = await (0, _execa().default)('sl', ['root'], {
|
||||
cwd,
|
||||
env
|
||||
});
|
||||
return result.stdout;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = adapter;
|
||||
exports.default = _default;
|
||||
1
node_modules/jest-changed-files/build/types.js
generated
vendored
1
node_modules/jest-changed-files/build/types.js
generated
vendored
@@ -1 +0,0 @@
|
||||
'use strict';
|
||||
12
node_modules/jest-changed-files/package.json
generated
vendored
12
node_modules/jest-changed-files/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jest-changed-files",
|
||||
"version": "29.7.0",
|
||||
"version": "30.2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
@@ -12,20 +12,22 @@
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./build/index.d.ts",
|
||||
"require": "./build/index.js",
|
||||
"import": "./build/index.mjs",
|
||||
"default": "./build/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"execa": "^5.0.0",
|
||||
"jest-util": "^29.7.0",
|
||||
"execa": "^5.1.1",
|
||||
"jest-util": "30.2.0",
|
||||
"p-limit": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
"node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630"
|
||||
"gitHead": "855864e3f9751366455246790be2bf912d4d0dac"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user