@servicetitan/startup 32.4.0 → 32.5.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/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +6 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +1 -4
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +12 -118
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/mfe-list.js +2 -1
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
- package/dist/cli/commands/review/rules/index.js +2 -0
- package/dist/cli/commands/review/rules/index.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-startup-install.d.ts +7 -0
- package/dist/cli/commands/review/rules/no-deprecated-startup-install.d.ts.map +1 -0
- package/dist/cli/commands/review/rules/no-deprecated-startup-install.js +38 -0
- package/dist/cli/commands/review/rules/no-deprecated-startup-install.js.map +1 -0
- package/dist/cli/commands/review/types.d.ts +1 -0
- package/dist/cli/commands/review/types.d.ts.map +1 -1
- package/dist/cli/commands/review/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +2 -1
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/utils/cli-git.d.ts +0 -9
- package/dist/cli/utils/cli-git.d.ts.map +1 -1
- package/dist/cli/utils/cli-git.js +0 -59
- package/dist/cli/utils/cli-git.js.map +1 -1
- package/dist/cli/utils/cli-npm.d.ts +0 -3
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +0 -22
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/index.d.ts +0 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +0 -1
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +2 -2
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/package.json +7 -8
- package/src/cli/commands/__tests__/init.test.ts +11 -14
- package/src/cli/commands/__tests__/install.test.ts +19 -224
- package/src/cli/commands/__tests__/mfe-list.test.ts +5 -4
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +4 -7
- package/src/cli/commands/init.ts +6 -4
- package/src/cli/commands/install.ts +13 -116
- package/src/cli/commands/mfe-list.ts +2 -1
- package/src/cli/commands/review/rules/__tests__/no-deprecated-startup-install.test.ts +81 -0
- package/src/cli/commands/review/rules/index.ts +2 -0
- package/src/cli/commands/review/rules/no-deprecated-startup-install.ts +30 -0
- package/src/cli/commands/review/types.ts +1 -0
- package/src/cli/commands/upload-sourcemaps.ts +2 -1
- package/src/cli/utils/__tests__/cli-git.test.ts +4 -140
- package/src/cli/utils/__tests__/cli-npm.test.ts +0 -43
- package/src/cli/utils/__tests__/lerna-exec.test.ts +2 -2
- package/src/cli/utils/cli-git.ts +1 -52
- package/src/cli/utils/cli-npm.ts +0 -12
- package/src/cli/utils/index.ts +0 -1
- package/src/cli/utils/lerna-exec.ts +1 -1
- package/dist/cli/utils/is-ci.d.ts +0 -2
- package/dist/cli/utils/is-ci.d.ts.map +0 -1
- package/dist/cli/utils/is-ci.js +0 -15
- package/dist/cli/utils/is-ci.js.map +0 -1
- package/src/cli/utils/__tests__/is-ci.test.ts +0 -40
- package/src/cli/utils/is-ci.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/C,UAAU,IAAK,SAAQ,WAAW;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,qBAAa,IAAK,SAAQ,OAAO,CAAC,IAAI,CAAC;IACnC,MAAM,CAAC,QAAQ,CAAC,WAAW,4BAA4B;IACvD,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;MAErB;IAGI,OAAO;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/C,UAAU,IAAK,SAAQ,WAAW;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,qBAAa,IAAK,SAAQ,OAAO,CAAC,IAAI,CAAC;IACnC,MAAM,CAAC,QAAQ,CAAC,WAAW,4BAA4B;IACvD,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;MAErB;IAGI,OAAO;IAsBb,SAAS,CAAC,WAAW,EAAE,MAAM;CAWhC"}
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "Init", {
|
|
|
8
8
|
return Init;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _install = require("@servicetitan/install");
|
|
11
12
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
13
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
14
|
const _utils = require("../../utils");
|
|
14
|
-
const _utils1 = require("../utils");
|
|
15
15
|
const _types = require("./types");
|
|
16
16
|
function _define_property(obj, key, value) {
|
|
17
17
|
if (key in obj) {
|
|
@@ -54,18 +54,19 @@ class Init extends _types.Command {
|
|
|
54
54
|
} else if (_fs.default.readdirSync(destination).length !== 0) {
|
|
55
55
|
throw new Error(`${destination} is not an empty directory`);
|
|
56
56
|
}
|
|
57
|
-
if (
|
|
57
|
+
if (this.cloneRepo(destination)) {
|
|
58
58
|
_utils.log.info(`copied example project to ${destination}`);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
if (!(0,
|
|
61
|
+
if (!(0, _install.gitIsReachable)({
|
|
62
62
|
name: REPO_NAME
|
|
63
63
|
})) {
|
|
64
64
|
throw new Error(`could not read servicetitan/${REPO_NAME} repository`);
|
|
65
65
|
}
|
|
66
|
+
return Promise.resolve();
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
-
const ok =
|
|
68
|
+
cloneRepo(destination) {
|
|
69
|
+
const ok = (0, _install.gitCloneRepo)({
|
|
69
70
|
destination,
|
|
70
71
|
name: REPO_NAME
|
|
71
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/init.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { log, logErrors } from '../../utils';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/init.ts"],"sourcesContent":["import { gitCloneRepo, gitIsReachable } from '@servicetitan/install';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { log, logErrors } from '../../utils';\nimport { Command, CommandArgs } from './types';\n\ninterface Args extends CommandArgs {\n output?: string;\n}\n\nconst REPO_NAME = 'frontend-example';\n\nexport class Init extends Command<Args> {\n static readonly description = 'Create example project';\n static readonly options = {\n output: { string: true, description: 'Output path' },\n };\n\n @logErrors\n async execute() {\n const destination = path.resolve(this.args.output ?? '.');\n if (!fs.existsSync(destination)) {\n fs.mkdirSync(destination, { recursive: true });\n } else if (!fs.lstatSync(destination).isDirectory()) {\n throw new Error(`${destination} is not a directory`);\n } else if (fs.readdirSync(destination).length !== 0) {\n throw new Error(`${destination} is not an empty directory`);\n }\n\n if (this.cloneRepo(destination)) {\n log.info(`copied example project to ${destination}`);\n return;\n }\n\n if (!gitIsReachable({ name: REPO_NAME })) {\n throw new Error(`could not read servicetitan/${REPO_NAME} repository`);\n }\n\n return Promise.resolve();\n }\n\n cloneRepo(destination: string) {\n const ok = gitCloneRepo({ destination, name: REPO_NAME });\n if (!ok) {\n return false;\n }\n\n fs.rmSync(path.join(destination, '.git'), { recursive: true, force: true });\n fs.rmSync(path.join(destination, '.github', 'CODEOWNERS'));\n fs.rmSync(path.join(destination, 'package-lock.json'));\n return true;\n }\n}\n"],"names":["Init","REPO_NAME","Command","execute","destination","path","resolve","args","output","fs","existsSync","mkdirSync","recursive","lstatSync","isDirectory","Error","readdirSync","length","cloneRepo","log","info","gitIsReachable","name","Promise","ok","gitCloneRepo","rmSync","join","force","description","options","string"],"mappings":";;;;+BAaaA;;;eAAAA;;;yBAbgC;2DAC9B;6DACE;uBAEc;uBACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMrC,MAAMC,YAAY;AAEX,MAAMD,aAAaE,cAAO;IAM7B,MACMC,UAAU;YACqB;QAAjC,MAAMC,cAAcC,aAAI,CAACC,OAAO,CAAC,CAAA,oBAAA,IAAI,CAACC,IAAI,CAACC,MAAM,cAAhB,+BAAA,oBAAoB;QACrD,IAAI,CAACC,WAAE,CAACC,UAAU,CAACN,cAAc;YAC7BK,WAAE,CAACE,SAAS,CAACP,aAAa;gBAAEQ,WAAW;YAAK;QAChD,OAAO,IAAI,CAACH,WAAE,CAACI,SAAS,CAACT,aAAaU,WAAW,IAAI;YACjD,MAAM,IAAIC,MAAM,GAAGX,YAAY,mBAAmB,CAAC;QACvD,OAAO,IAAIK,WAAE,CAACO,WAAW,CAACZ,aAAaa,MAAM,KAAK,GAAG;YACjD,MAAM,IAAIF,MAAM,GAAGX,YAAY,0BAA0B,CAAC;QAC9D;QAEA,IAAI,IAAI,CAACc,SAAS,CAACd,cAAc;YAC7Be,UAAG,CAACC,IAAI,CAAC,CAAC,0BAA0B,EAAEhB,aAAa;YACnD;QACJ;QAEA,IAAI,CAACiB,IAAAA,uBAAc,EAAC;YAAEC,MAAMrB;QAAU,IAAI;YACtC,MAAM,IAAIc,MAAM,CAAC,4BAA4B,EAAEd,UAAU,WAAW,CAAC;QACzE;QAEA,OAAOsB,QAAQjB,OAAO;IAC1B;IAEAY,UAAUd,WAAmB,EAAE;QAC3B,MAAMoB,KAAKC,IAAAA,qBAAY,EAAC;YAAErB;YAAakB,MAAMrB;QAAU;QACvD,IAAI,CAACuB,IAAI;YACL,OAAO;QACX;QAEAf,WAAE,CAACiB,MAAM,CAACrB,aAAI,CAACsB,IAAI,CAACvB,aAAa,SAAS;YAAEQ,WAAW;YAAMgB,OAAO;QAAK;QACzEnB,WAAE,CAACiB,MAAM,CAACrB,aAAI,CAACsB,IAAI,CAACvB,aAAa,WAAW;QAC5CK,WAAE,CAACiB,MAAM,CAACrB,aAAI,CAACsB,IAAI,CAACvB,aAAa;QACjC,OAAO;IACX;AACJ;AAvCI,iBADSJ,MACO6B,eAAc;AAC9B,iBAFS7B,MAEO8B,WAAU;IACtBtB,QAAQ;QAAEuB,QAAQ;QAAMF,aAAa;IAAc;AACvD"}
|
|
@@ -12,7 +12,7 @@ export declare class Install extends Command<Args> {
|
|
|
12
12
|
describe: string;
|
|
13
13
|
hidden: boolean;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
quiet: {
|
|
16
16
|
boolean: boolean;
|
|
17
17
|
describe: string;
|
|
18
18
|
hidden: boolean;
|
|
@@ -23,9 +23,6 @@ export declare class Install extends Command<Args> {
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
execute(): Promise<void>;
|
|
26
|
-
private configureNpmToken;
|
|
27
|
-
private fetchNpmToken;
|
|
28
|
-
private installPackages;
|
|
29
26
|
}
|
|
30
27
|
export {};
|
|
31
28
|
//# sourceMappingURL=install.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/C,UAAU,IAAK,SAAQ,WAAW;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,OAAQ,SAAQ,OAAO,CAAC,IAAI,CAAC;IACtC,MAAM,CAAC,QAAQ,CAAC,WAAW,kCAAkC;IAC7D,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;MAIrB;IAGI,OAAO;CAoBhB"}
|
|
@@ -9,12 +9,8 @@ Object.defineProperty(exports, "Install", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _child_process = require("child_process");
|
|
12
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
13
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
|
-
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
15
12
|
const _utils = require("../../utils");
|
|
16
13
|
const _types = require("./types");
|
|
17
|
-
const _utils1 = require("../utils");
|
|
18
14
|
function _define_property(obj, key, value) {
|
|
19
15
|
if (key in obj) {
|
|
20
16
|
Object.defineProperty(obj, key, {
|
|
@@ -28,11 +24,6 @@ function _define_property(obj, key, value) {
|
|
|
28
24
|
}
|
|
29
25
|
return obj;
|
|
30
26
|
}
|
|
31
|
-
function _interop_require_default(obj) {
|
|
32
|
-
return obj && obj.__esModule ? obj : {
|
|
33
|
-
default: obj
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
27
|
function _ts_decorate(decorators, target, key, desc) {
|
|
37
28
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
38
29
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -42,120 +33,23 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
42
33
|
function _ts_metadata(k, v) {
|
|
43
34
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
44
35
|
}
|
|
45
|
-
const REPO_NAME = 'frontend-dev-config';
|
|
46
|
-
const AUTH_TOKEN_KEY = '//registry.npmjs.org/:_authToken';
|
|
47
|
-
const AUTH_TOKEN_REGEX = /^\/\/registry\.npmjs\.org\/:_authToken=\s*\${([^}]+)}/m;
|
|
48
36
|
class Install extends _types.Command {
|
|
49
37
|
async execute() {
|
|
50
|
-
|
|
51
|
-
if (!((_this_args = this.args) === null || _this_args === void 0 ? void 0 : _this_args.quiet)) {
|
|
38
|
+
if (!this.args.quiet) {
|
|
52
39
|
_utils.log.info(`startup cli v${(0, _utils.getStartupVersion)()}`);
|
|
53
40
|
}
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (!((_this_args2 = this.args) === null || _this_args2 === void 0 ? void 0 : _this_args2.quiet)) {
|
|
66
|
-
_utils.log.info('Configuring NPM token ...');
|
|
67
|
-
}
|
|
68
|
-
if (((_this_args3 = this.args) === null || _this_args3 === void 0 ? void 0 : _this_args3.token) !== true) {
|
|
69
|
-
const npmUser = (0, _utils1.npmWhoAmI)();
|
|
70
|
-
/* istanbul ignore next: debug only */ _utils.log.debug('install:npm-user', ()=>JSON.stringify({
|
|
71
|
-
npmUser
|
|
72
|
-
}));
|
|
73
|
-
if (npmUser === 'st-team') {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const token = await this.fetchNpmToken();
|
|
78
|
-
if (!token) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
(0, _child_process.execSync)(`npm config set "${AUTH_TOKEN_KEY}"="${token}"`);
|
|
82
|
-
if (!_fs.default.existsSync('.npmrc')) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const npmrc = _fs.default.readFileSync('.npmrc', 'utf-8');
|
|
86
|
-
const match = AUTH_TOKEN_REGEX.exec(npmrc);
|
|
87
|
-
if (match) {
|
|
88
|
-
return {
|
|
89
|
-
[match[1]]: token
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
(0, _child_process.execSync)(`npm config delete --location=project "${AUTH_TOKEN_KEY}"`);
|
|
93
|
-
}
|
|
94
|
-
async fetchNpmToken() {
|
|
95
|
-
const tempDirPath = _fs.default.mkdtempSync(_path.default.join(_os.default.tmpdir(), 'st-install-'));
|
|
96
|
-
try {
|
|
97
|
-
if (!await (0, _utils1.gitCloneRepo)({
|
|
98
|
-
destination: tempDirPath,
|
|
99
|
-
name: REPO_NAME
|
|
100
|
-
})) {
|
|
101
|
-
throw new Error(`could not clone servicetitan/${REPO_NAME}`);
|
|
102
|
-
}
|
|
103
|
-
const npmJson = (0, _utils.readJsonSafe)(_path.default.join(tempDirPath, '.npm.json'));
|
|
104
|
-
/* istanbul ignore next: debug only */ _utils.log.debug('install:fetch-token', ()=>JSON.stringify(npmJson, null, 2));
|
|
105
|
-
if (!(npmJson && typeof npmJson === 'object' || Array.isArray(npmJson))) {
|
|
106
|
-
throw new Error('.npm.json is not an object');
|
|
107
|
-
}
|
|
108
|
-
const { readOnlyToken: authToken } = npmJson;
|
|
109
|
-
if (!authToken) {
|
|
110
|
-
throw new Error('.npm.json does not contain auth token');
|
|
111
|
-
}
|
|
112
|
-
if (typeof authToken !== 'string') {
|
|
113
|
-
throw new Error('.npm.json auth token is not a string');
|
|
114
|
-
}
|
|
115
|
-
return Buffer.from(authToken, 'base64').toString('utf-8');
|
|
116
|
-
} catch (e) {
|
|
117
|
-
_utils.log.warning(String(e));
|
|
118
|
-
} finally{
|
|
119
|
-
try {
|
|
120
|
-
_fs.default.rmSync(tempDirPath, {
|
|
121
|
-
recursive: true,
|
|
122
|
-
force: true
|
|
123
|
-
});
|
|
124
|
-
} catch (e) {
|
|
125
|
-
// ignore
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
installPackages(env) {
|
|
130
|
-
var _this_args, _this_args1;
|
|
131
|
-
/* istanbul ignore next: debug only */ _utils.log.debug('install:install-packages', ()=>JSON.stringify({
|
|
132
|
-
env
|
|
133
|
-
}));
|
|
134
|
-
/**
|
|
135
|
-
* Note, if these are changed, update bootstrap.js to match
|
|
136
|
-
* @see {@link file://./../../../../../bootstrap.js}
|
|
137
|
-
*/ const npmArguments = [
|
|
138
|
-
(0, _utils1.isCI)() ? 'ci' : 'i',
|
|
139
|
-
'--audit=false',
|
|
140
|
-
'--fund=false',
|
|
141
|
-
'--legacy-peer-deps',
|
|
142
|
-
...((_this_args = this.args) === null || _this_args === void 0 ? void 0 : _this_args.fix) ? [
|
|
143
|
-
'--package-lock-only',
|
|
144
|
-
'--prefer-dedupe'
|
|
145
|
-
] : []
|
|
146
|
-
].join(' ');
|
|
147
|
-
if (!((_this_args1 = this.args) === null || _this_args1 === void 0 ? void 0 : _this_args1.quiet)) {
|
|
148
|
-
_utils.log.info(`Running npm ${npmArguments} ...`);
|
|
149
|
-
}
|
|
150
|
-
(0, _child_process.execSync)(`npm ${npmArguments}`, {
|
|
151
|
-
...env ? {
|
|
152
|
-
env: {
|
|
153
|
-
...process.env,
|
|
154
|
-
...env
|
|
155
|
-
}
|
|
156
|
-
} : {},
|
|
41
|
+
const options = [
|
|
42
|
+
this.args.fix ? '--fix' : '',
|
|
43
|
+
this.args.quiet ? '--quiet' : '',
|
|
44
|
+
this.args.token === true ? '--token' : '',
|
|
45
|
+
this.args.token === false ? '--no-token' : ''
|
|
46
|
+
].filter((option)=>!!option);
|
|
47
|
+
const command = `npx @servicetitan/install ${options.join(' ')}`.trim();
|
|
48
|
+
_utils.log.debug('install', command);
|
|
49
|
+
(0, _child_process.execSync)(command, {
|
|
157
50
|
stdio: 'inherit'
|
|
158
51
|
});
|
|
52
|
+
return Promise.resolve(); // stops "async method has no 'await' expression" lint error
|
|
159
53
|
}
|
|
160
54
|
}
|
|
161
55
|
_define_property(Install, "description", 'Install project dependencies');
|
|
@@ -165,7 +59,7 @@ _define_property(Install, "options", {
|
|
|
165
59
|
describe: 'Update and dedupe package-lock.json',
|
|
166
60
|
hidden: true
|
|
167
61
|
},
|
|
168
|
-
|
|
62
|
+
quiet: {
|
|
169
63
|
boolean: true,
|
|
170
64
|
describe: 'Suppress output',
|
|
171
65
|
hidden: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/install.ts"],"sourcesContent":["import { execSync } from 'child_process';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/install.ts"],"sourcesContent":["import { execSync } from 'child_process';\nimport { log, logErrors, getStartupVersion } from '../../utils';\nimport { Command, CommandArgs } from './types';\ninterface Args extends CommandArgs {\n fix?: boolean;\n quiet?: boolean;\n token?: boolean;\n}\n\nexport class Install extends Command<Args> {\n static readonly description = 'Install project dependencies';\n static readonly options = {\n fix: { boolean: true, describe: 'Update and dedupe package-lock.json', hidden: true },\n quiet: { boolean: true, describe: 'Suppress output', hidden: true },\n token: { boolean: true, describe: 'Configure npm token' },\n };\n\n @logErrors\n async execute() {\n if (!this.args.quiet) {\n log.info(`startup cli v${getStartupVersion()}`);\n }\n\n const options = [\n this.args.fix ? '--fix' : '',\n this.args.quiet ? '--quiet' : '',\n this.args.token === true ? '--token' : '',\n this.args.token === false ? '--no-token' : '',\n ].filter(option => !!option);\n\n const command = `npx @servicetitan/install ${options.join(' ')}`.trim();\n\n log.debug('install', command);\n\n execSync(command, { stdio: 'inherit' });\n\n return Promise.resolve(); // stops \"async method has no 'await' expression\" lint error\n }\n}\n"],"names":["Install","Command","execute","args","quiet","log","info","getStartupVersion","options","fix","token","filter","option","command","join","trim","debug","execSync","stdio","Promise","resolve","description","boolean","describe","hidden"],"mappings":";;;;+BASaA;;;eAAAA;;;+BATY;uBACyB;uBACb;;;;;;;;;;;;;;;;;;;;;;;AAO9B,MAAMA,gBAAgBC,cAAO;IAQhC,MACMC,UAAU;QACZ,IAAI,CAAC,IAAI,CAACC,IAAI,CAACC,KAAK,EAAE;YAClBC,UAAG,CAACC,IAAI,CAAC,CAAC,aAAa,EAAEC,IAAAA,wBAAiB,KAAI;QAClD;QAEA,MAAMC,UAAU;YACZ,IAAI,CAACL,IAAI,CAACM,GAAG,GAAG,UAAU;YAC1B,IAAI,CAACN,IAAI,CAACC,KAAK,GAAG,YAAY;YAC9B,IAAI,CAACD,IAAI,CAACO,KAAK,KAAK,OAAO,YAAY;YACvC,IAAI,CAACP,IAAI,CAACO,KAAK,KAAK,QAAQ,eAAe;SAC9C,CAACC,MAAM,CAACC,CAAAA,SAAU,CAAC,CAACA;QAErB,MAAMC,UAAU,CAAC,0BAA0B,EAAEL,QAAQM,IAAI,CAAC,MAAM,CAACC,IAAI;QAErEV,UAAG,CAACW,KAAK,CAAC,WAAWH;QAErBI,IAAAA,uBAAQ,EAACJ,SAAS;YAAEK,OAAO;QAAU;QAErC,OAAOC,QAAQC,OAAO,IAAI,4DAA4D;IAC1F;AACJ;AA5BI,iBADSpB,SACOqB,eAAc;AAC9B,iBAFSrB,SAEOQ,WAAU;IACtBC,KAAK;QAAEa,SAAS;QAAMC,UAAU;QAAuCC,QAAQ;IAAK;IACpFpB,OAAO;QAAEkB,SAAS;QAAMC,UAAU;QAAmBC,QAAQ;IAAK;IAClEd,OAAO;QAAEY,SAAS;QAAMC,UAAU;IAAsB;AAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mfe-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mfe-list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mfe-list.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG/C,UAAU,IAAK,SAAQ,WAAW;IAC9B,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD,qBAAa,OAAQ,SAAQ,OAAO,CAAC,IAAI,CAAC;IACtC,MAAM,CAAC,QAAQ,CAAC,WAAW,iCAAiC;IAC5D,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;MAYrB;IAGI,OAAO;IAmBb,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,QAAQ;IAgChB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,cAAc;YAWR,GAAG;YAOH,KAAK;IAoBnB,OAAO,KAAK,KAAK,GAKhB;IAED,OAAO,KAAK,YAAY,GAUvB;IAED,OAAO,KAAK,QAAQ,GAEnB;CACJ"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "MFEList", {
|
|
|
8
8
|
return MFEList;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _install = require("@servicetitan/install");
|
|
11
12
|
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
12
13
|
const _clitable3 = /*#__PURE__*/ _interop_require_default(require("cli-table3"));
|
|
13
14
|
const _promises = /*#__PURE__*/ _interop_require_default(require("readline/promises"));
|
|
@@ -127,7 +128,7 @@ class MFEList extends _types.Command {
|
|
|
127
128
|
return answer.trim().toLowerCase();
|
|
128
129
|
}
|
|
129
130
|
async login() {
|
|
130
|
-
if (this.registry !== VERDACCIO || (0,
|
|
131
|
+
if (this.registry !== VERDACCIO || (0, _install.npmWhoAmI)({
|
|
131
132
|
registry: this.registry
|
|
132
133
|
}) !== undefined) {
|
|
133
134
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/mfe-list.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport chalk from 'chalk';\nimport Table from 'cli-table3';\nimport readline from 'readline/promises';\nimport {\n formatRelativeDate,\n getPackages,\n isWebComponent,\n log,\n logErrors,\n PackageType,\n} from '../../utils';\nimport { Command, CommandArgs } from './types';\nimport { isTTY, NPMPackageInfo, npmView, npmWhoAmI, runCommand } from '../utils';\n\ninterface Args extends CommandArgs {\n _: string[];\n all?: boolean;\n ignore?: string | string[];\n limit?: number;\n packageNames?: string[];\n registry?: string;\n tagged?: boolean;\n}\n\nconst collator = new Intl.Collator();\n\nconst VERDACCIO = 'https://verdaccio.servicetitan.com';\n\nexport class MFEList extends Command<Args> {\n static readonly description = 'List published MFE packages';\n static readonly options = {\n _: { description: '[packageNames...]' },\n all: { boolean: true, description: 'List all published versions ' },\n ignore: {\n array: true,\n description: 'Exclude MFEs with names matching specified glob pattern ',\n },\n limit: {\n number: true,\n description: 'List only the specified number of published versions',\n },\n tagged: { boolean: true, description: 'List only tagged versions' },\n };\n\n @logErrors\n async execute() {\n await this.login();\n\n this.packageNames.forEach((name, index) => {\n const info = npmView({ packageName: name, registry: this.registry });\n if (info) {\n if (index > 0) {\n process.stdout.write('\\n');\n }\n\n process.stdout.write(this.getCaption(info) + '\\n');\n const table = this.getTable(info);\n if (table) {\n process.stdout.write(table + '\\n');\n }\n }\n });\n }\n\n private getCaption(info: NPMPackageInfo) {\n return [\n chalk.bold.cyan(info.name),\n info.version && `version: ${info.version}`,\n `versions: ${Object.keys(this.getTime(info)).length}`,\n ]\n .filter(el => !!el)\n .join(' | ');\n }\n\n private getTable(info: NPMPackageInfo) {\n const times = Object.entries(this.getTime(info)).sort(\n ([, a], [, b]) => -1 * collator.compare(a, b)\n );\n const versionTags = this.getVersionTags(info);\n const versions = this.args.tagged\n ? times.filter(([version]) => !!versionTags[version])\n : times.slice(0, this.limit);\n\n /* istanbul ignore next: debug only */\n log.debug('mfe-list', () =>\n JSON.stringify({ name: info.name, versionTags, versions }, null, 2)\n );\n\n if (versions.length === 0) {\n return '';\n }\n\n const table = new Table({\n head: ['Version', 'Tag', 'When'].map(title => chalk.bold.cyan(title)),\n style: { head: [] },\n });\n\n versions.forEach(([version, timestamp]) => {\n const when = formatRelativeDate(new Date(timestamp));\n const tag = (versionTags[version] ?? []).join(', ');\n table.push([version, chalk.bold.cyan(tag), when]);\n });\n\n return table.toString();\n }\n\n private getTime(info: NPMPackageInfo) {\n const { time: { created, modified, ...time } = {} } = info;\n return time;\n }\n\n private getVersionTags({ 'dist-tags': distTags = {} }: NPMPackageInfo) {\n return Object.entries(distTags).reduce<Record<string, string[]>>(\n (result, [name, version]) => {\n result[version] ??= [];\n result[version].push(name);\n return result;\n },\n {}\n );\n }\n\n private async ask(question: string) {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const answer = await rl.question(question);\n rl.close();\n return answer.trim().toLowerCase();\n }\n\n private async login() {\n if (this.registry !== VERDACCIO || npmWhoAmI({ registry: this.registry }) !== undefined) {\n return;\n }\n\n const message = `This machine is not authorized to access ${this.registry}.`;\n if (!isTTY()) {\n throw new Error(message);\n }\n\n const answer = await this.ask(chalk.bold.cyan(`${message} Authorize? [Y/n] `));\n if (answer && answer !== 'y') {\n throw new Error('Not authorized');\n }\n\n await runCommand(`npx --yes verdaccio-okta-oauth@latest --registry=${this.registry}`, {\n quiet: true,\n });\n }\n\n private get limit() {\n if (this.args.all) {\n return Number.MAX_SAFE_INTEGER;\n }\n return this.args.limit && this.args.limit > 0 ? this.args.limit : 20;\n }\n\n private get packageNames() {\n const { _, packageNames = [] } = this.args;\n if (_.length || packageNames.length) {\n return [..._, ...packageNames];\n }\n\n return getPackages({ ignore: this.args.ignore, type: PackageType.Webpack })\n .filter(isWebComponent)\n .map(({ name }) => name)\n .sort((a, b) => collator.compare(a, b));\n }\n\n private get registry() {\n return this.args.registry ?? VERDACCIO;\n }\n}\n"],"names":["MFEList","collator","Intl","Collator","VERDACCIO","Command","execute","login","packageNames","forEach","name","index","info","npmView","packageName","registry","process","stdout","write","getCaption","table","getTable","chalk","bold","cyan","version","Object","keys","getTime","length","filter","el","join","times","entries","sort","a","b","compare","versionTags","getVersionTags","versions","args","tagged","slice","limit","log","debug","JSON","stringify","Table","head","map","title","style","timestamp","when","formatRelativeDate","Date","tag","push","toString","time","created","modified","distTags","reduce","result","ask","question","rl","readline","createInterface","input","stdin","output","answer","close","trim","toLowerCase","npmWhoAmI","undefined","message","isTTY","Error","runCommand","quiet","all","Number","MAX_SAFE_INTEGER","_","getPackages","ignore","type","PackageType","Webpack","isWebComponent","description","options","boolean","array","number"],"mappings":"AAAA,uDAAuD;;;;+BA6B1CA;;;eAAAA;;;8DA5BK;kEACA;iEACG;uBAQd;uBAC8B;wBACiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYtE,MAAMC,WAAW,IAAIC,KAAKC,QAAQ;AAElC,MAAMC,YAAY;AAEX,MAAMJ,gBAAgBK,cAAO;IAgBhC,MACMC,UAAU;QACZ,MAAM,IAAI,CAACC,KAAK;QAEhB,IAAI,CAACC,YAAY,CAACC,OAAO,CAAC,CAACC,MAAMC;YAC7B,MAAMC,OAAOC,IAAAA,eAAO,EAAC;gBAAEC,aAAaJ;gBAAMK,UAAU,IAAI,CAACA,QAAQ;YAAC;YAClE,IAAIH,MAAM;gBACN,IAAID,QAAQ,GAAG;oBACXK,QAAQC,MAAM,CAACC,KAAK,CAAC;gBACzB;gBAEAF,QAAQC,MAAM,CAACC,KAAK,CAAC,IAAI,CAACC,UAAU,CAACP,QAAQ;gBAC7C,MAAMQ,QAAQ,IAAI,CAACC,QAAQ,CAACT;gBAC5B,IAAIQ,OAAO;oBACPJ,QAAQC,MAAM,CAACC,KAAK,CAACE,QAAQ;gBACjC;YACJ;QACJ;IACJ;IAEQD,WAAWP,IAAoB,EAAE;QACrC,OAAO;YACHU,cAAK,CAACC,IAAI,CAACC,IAAI,CAACZ,KAAKF,IAAI;YACzBE,KAAKa,OA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,WAAU;IACtBR,GAAG;QAAEO,aAAa;IAAoB;IACtCV,KAAK;QAAEY,SAAS;QAAMF,aAAa;IAA+B;IAClEL,QAAQ;QACJQ,OAAO;QACPH,aAAa;IACjB;IACApD,OAAO;QACHwD,QAAQ;QACRJ,aAAa;IACjB;IACAtD,QAAQ;QAAEwD,SAAS;QAAMF,aAAa;IAA4B;AACtE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/mfe-list.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { npmWhoAmI } from '@servicetitan/install';\nimport chalk from 'chalk';\nimport Table from 'cli-table3';\nimport readline from 'readline/promises';\nimport {\n formatRelativeDate,\n getPackages,\n isWebComponent,\n log,\n logErrors,\n PackageType,\n} from '../../utils';\nimport { Command, CommandArgs } from './types';\nimport { isTTY, NPMPackageInfo, npmView, runCommand } from '../utils';\n\ninterface Args extends CommandArgs {\n _: string[];\n all?: boolean;\n ignore?: string | string[];\n limit?: number;\n packageNames?: string[];\n registry?: string;\n tagged?: boolean;\n}\n\nconst collator = new Intl.Collator();\n\nconst VERDACCIO = 'https://verdaccio.servicetitan.com';\n\nexport class MFEList extends Command<Args> {\n static readonly description = 'List published MFE packages';\n static readonly options = {\n _: { description: '[packageNames...]' },\n all: { boolean: true, description: 'List all published versions ' },\n ignore: {\n array: true,\n description: 'Exclude MFEs with names matching specified glob pattern ',\n },\n limit: {\n number: true,\n description: 'List only the specified number of published versions',\n },\n tagged: { boolean: true, description: 'List only tagged versions' },\n };\n\n @logErrors\n async execute() {\n await this.login();\n\n this.packageNames.forEach((name, index) => {\n const info = npmView({ packageName: name, registry: this.registry });\n if (info) {\n if (index > 0) {\n process.stdout.write('\\n');\n }\n\n process.stdout.write(this.getCaption(info) + '\\n');\n const table = this.getTable(info);\n if (table) {\n process.stdout.write(table + '\\n');\n }\n }\n });\n }\n\n private getCaption(info: NPMPackageInfo) {\n return [\n chalk.bold.cyan(info.name),\n info.version && `version: ${info.version}`,\n `versions: ${Object.keys(this.getTime(info)).length}`,\n ]\n .filter(el => !!el)\n .join(' | ');\n }\n\n private getTable(info: NPMPackageInfo) {\n const times = Object.entries(this.getTime(info)).sort(\n ([, a], [, b]) => -1 * collator.compare(a, b)\n );\n const versionTags = this.getVersionTags(info);\n const versions = this.args.tagged\n ? times.filter(([version]) => !!versionTags[version])\n : times.slice(0, this.limit);\n\n /* istanbul ignore next: debug only */\n log.debug('mfe-list', () =>\n JSON.stringify({ name: info.name, versionTags, versions }, null, 2)\n );\n\n if (versions.length === 0) {\n return '';\n }\n\n const table = new Table({\n head: ['Version', 'Tag', 'When'].map(title => chalk.bold.cyan(title)),\n style: { head: [] },\n });\n\n versions.forEach(([version, timestamp]) => {\n const when = formatRelativeDate(new Date(timestamp));\n const tag = (versionTags[version] ?? []).join(', ');\n table.push([version, chalk.bold.cyan(tag), when]);\n });\n\n return table.toString();\n }\n\n private getTime(info: NPMPackageInfo) {\n const { time: { created, modified, ...time } = {} } = info;\n return time;\n }\n\n private getVersionTags({ 'dist-tags': distTags = {} }: NPMPackageInfo) {\n return Object.entries(distTags).reduce<Record<string, string[]>>(\n (result, [name, version]) => {\n result[version] ??= [];\n result[version].push(name);\n return result;\n },\n {}\n );\n }\n\n private async ask(question: string) {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const answer = await rl.question(question);\n rl.close();\n return answer.trim().toLowerCase();\n }\n\n private async login() {\n if (this.registry !== VERDACCIO || npmWhoAmI({ registry: this.registry }) !== undefined) {\n return;\n }\n\n const message = `This machine is not authorized to access ${this.registry}.`;\n if (!isTTY()) {\n throw new Error(message);\n }\n\n const answer = await this.ask(chalk.bold.cyan(`${message} Authorize? [Y/n] `));\n if (answer && answer !== 'y') {\n throw new Error('Not authorized');\n }\n\n await runCommand(`npx --yes verdaccio-okta-oauth@latest --registry=${this.registry}`, {\n quiet: true,\n });\n }\n\n private get limit() {\n if (this.args.all) {\n return Number.MAX_SAFE_INTEGER;\n }\n return this.args.limit && this.args.limit > 0 ? this.args.limit : 20;\n }\n\n private get packageNames() {\n const { _, packageNames = [] } = this.args;\n if (_.length || packageNames.length) {\n return [..._, ...packageNames];\n }\n\n return getPackages({ ignore: this.args.ignore, type: PackageType.Webpack })\n .filter(isWebComponent)\n .map(({ name }) => name)\n .sort((a, b) => collator.compare(a, b));\n }\n\n private get registry() {\n return this.args.registry ?? VERDACCIO;\n }\n}\n"],"names":["MFEList","collator","Intl","Collator","VERDACCIO","Command","execute","login","packageNames","forEach","name","index","info","npmView","packageName","registry","process","stdout","write","getCaption","table","getTable","chalk","bold","cyan","version","Object","keys","getTime","length","filter","el","join","times","entries","sort","a","b","compare","versionTags","getVersionTags","versions","args","tagged","slice","limit","log","debug","JSON","stringify","Table","head","map","title","style","timestamp","when","formatRelativeDate","Date","tag","push","toString","time","created","modified","distTags","reduce","result","ask","question","rl","readline","createInterface","input","stdin","output","answer","close","trim","toLowerCase","npmWhoAmI","undefined","message","isTTY","Error","runCommand","quiet","all","Number","MAX_SAFE_INTEGER","_","getPackages","ignore","type","PackageType","Webpack","isWebComponent","description","options","boolean","array","number"],"mappings":"AAAA,uDAAuD;;;;+BA8B1CA;;;eAAAA;;;yBA7Ba;8DACR;kEACA;iEACG;uBAQd;uBAC8B;wBACsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAY3D,MAAMC,WAAW,IAAIC,KAAKC,QAAQ;AAElC,MAAMC,YAAY;AAEX,MAAMJ,gBAAgBK,cAAO;IAgBhC,MACMC,UAAU;QACZ,MAAM,IAAI,CAACC,KAAK;QAEhB,IAAI,CAACC,YAAY,CAACC,OAAO,CAAC,CAACC,MAAMC;YAC7B,MAAMC,OAAOC,IAAAA,eAAO,EAAC;gBAAEC,aAAaJ;gBAAMK,UAAU,IAAI,CAACA,QAAQ;YAAC;YAClE,IAAIH,MAAM;gBACN,IAAID,QAAQ,GAAG;oBACXK,QAAQC,MAAM,CAACC,KAAK,CAAC;gBACzB;gBAEAF,QAAQC,MAAM,CAACC,KAAK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GAAG,CAAC,CAAC,EAAE1C,IAAI,EAAE,GAAKA,MAClByB,IAAI,CAAC,CAACC,GAAGC,IAAMpC,SAASqC,OAAO,CAACF,GAAGC;IAC5C;IAEA,IAAYtB,WAAW;YACZ;QAAP,OAAO,CAAA,sBAAA,IAAI,CAAC2B,IAAI,CAAC3B,QAAQ,cAAlB,iCAAA,sBAAsBX;IACjC;AACJ;AA9II,iBADSJ,SACOiG,eAAc;AAC9B,iBAFSjG,SAEOkG,WAAU;IACtBR,GAAG;QAAEO,aAAa;IAAoB;IACtCV,KAAK;QAAEY,SAAS;QAAMF,aAAa;IAA+B;IAClEL,QAAQ;QACJQ,OAAO;QACPH,aAAa;IACjB;IACApD,OAAO;QACHwD,QAAQ;QACRJ,aAAa;IACjB;IACAtD,QAAQ;QAAEwD,SAAS;QAAMF,aAAa;IAA4B;AACtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBvC,eAAO,MAAM,KAAK,EAAE,WAAW,EAgB9B,CAAC"}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "rules", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _nodeprecatedcontentbase = require("./no-deprecated-content-base");
|
|
12
|
+
const _nodeprecatedstartupinstall = require("./no-deprecated-startup-install");
|
|
12
13
|
const _nodirectpeerdependencies = require("./no-direct-peer-dependencies");
|
|
13
14
|
const _notypescriptentrypoint = require("./no-typescript-entry-point");
|
|
14
15
|
const _preferopenendedpeerdependencies = require("./prefer-open-ended-peer-dependencies");
|
|
@@ -32,6 +33,7 @@ const rules = [
|
|
|
32
33
|
new _requirecompatiblelaunchdarklysdk.RequireCompatibleLaunchDarklySdk(),
|
|
33
34
|
new _nodeprecatedcontentbase.NoDeprecatedContentBase(),
|
|
34
35
|
new _nodirectpeerdependencies.NoDirectPeerDependencies(),
|
|
36
|
+
new _nodeprecatedstartupinstall.NoDeprecatedStartupInstall(),
|
|
35
37
|
new _notypescriptentrypoint.NoTypescriptEntryPoint(),
|
|
36
38
|
new _preferopenendedpeerdependencies.PreferOpenEndedPeerDependencies(),
|
|
37
39
|
new _requireservicetitanscope.RequireServiceTitanScope(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/cli/commands/review/rules/index.ts"],"sourcesContent":["import { PackageRule } from '../types';\nimport { NoDeprecatedContentBase } from './no-deprecated-content-base';\nimport { NoDirectPeerDependencies } from './no-direct-peer-dependencies';\nimport { NoTypescriptEntryPoint } from './no-typescript-entry-point';\nimport { PreferOpenEndedPeerDependencies } from './prefer-open-ended-peer-dependencies';\nimport { RequireAllReactDependencies } from './require-all-react-dependencies';\nimport { RequireCompatibleLaunchDarklySdk } from './require-compatible-launch-darkly-sdk';\nimport { RequireExplicitSideEffects } from './require-explicit-side-effects';\nimport { RequireNpmrc } from './require-npmrc';\nimport { RequireOneAnvilUikitContribVersion } from './require-one-anvil-uikit-contrib-version';\nimport { RequireOnePackageVersion } from './require-one-package-version';\nimport { RequireOneReactVersion } from './require-one-react-version';\nimport { RequireOneUikitVersion } from './require-one-uikit-version';\nimport { RequireProjectVersionInRootNodeModules } from './require-project-version-in-root-node-modules';\nimport { RequireServiceTitanScope } from './require-servicetitan-scope';\n\nexport const rules: PackageRule[] = [\n new RequireAllReactDependencies(),\n new RequireOneAnvilUikitContribVersion(),\n new RequireOnePackageVersion(),\n new RequireOneReactVersion(),\n new RequireOneUikitVersion(),\n new RequireProjectVersionInRootNodeModules(),\n new RequireCompatibleLaunchDarklySdk(),\n new NoDeprecatedContentBase(),\n new NoDirectPeerDependencies(),\n new NoTypescriptEntryPoint(),\n new PreferOpenEndedPeerDependencies(),\n new RequireServiceTitanScope(),\n new RequireExplicitSideEffects(),\n new RequireNpmrc(),\n];\n"],"names":["rules","RequireAllReactDependencies","RequireOneAnvilUikitContribVersion","RequireOnePackageVersion","RequireOneReactVersion","RequireOneUikitVersion","RequireProjectVersionInRootNodeModules","RequireCompatibleLaunchDarklySdk","NoDeprecatedContentBase","NoDirectPeerDependencies","NoTypescriptEntryPoint","PreferOpenEndedPeerDependencies","RequireServiceTitanScope","RequireExplicitSideEffects","RequireNpmrc"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/commands/review/rules/index.ts"],"sourcesContent":["import { PackageRule } from '../types';\nimport { NoDeprecatedContentBase } from './no-deprecated-content-base';\nimport { NoDeprecatedStartupInstall } from './no-deprecated-startup-install';\nimport { NoDirectPeerDependencies } from './no-direct-peer-dependencies';\nimport { NoTypescriptEntryPoint } from './no-typescript-entry-point';\nimport { PreferOpenEndedPeerDependencies } from './prefer-open-ended-peer-dependencies';\nimport { RequireAllReactDependencies } from './require-all-react-dependencies';\nimport { RequireCompatibleLaunchDarklySdk } from './require-compatible-launch-darkly-sdk';\nimport { RequireExplicitSideEffects } from './require-explicit-side-effects';\nimport { RequireNpmrc } from './require-npmrc';\nimport { RequireOneAnvilUikitContribVersion } from './require-one-anvil-uikit-contrib-version';\nimport { RequireOnePackageVersion } from './require-one-package-version';\nimport { RequireOneReactVersion } from './require-one-react-version';\nimport { RequireOneUikitVersion } from './require-one-uikit-version';\nimport { RequireProjectVersionInRootNodeModules } from './require-project-version-in-root-node-modules';\nimport { RequireServiceTitanScope } from './require-servicetitan-scope';\n\nexport const rules: PackageRule[] = [\n new RequireAllReactDependencies(),\n new RequireOneAnvilUikitContribVersion(),\n new RequireOnePackageVersion(),\n new RequireOneReactVersion(),\n new RequireOneUikitVersion(),\n new RequireProjectVersionInRootNodeModules(),\n new RequireCompatibleLaunchDarklySdk(),\n new NoDeprecatedContentBase(),\n new NoDirectPeerDependencies(),\n new NoDeprecatedStartupInstall(),\n new NoTypescriptEntryPoint(),\n new PreferOpenEndedPeerDependencies(),\n new RequireServiceTitanScope(),\n new RequireExplicitSideEffects(),\n new RequireNpmrc(),\n];\n"],"names":["rules","RequireAllReactDependencies","RequireOneAnvilUikitContribVersion","RequireOnePackageVersion","RequireOneReactVersion","RequireOneUikitVersion","RequireProjectVersionInRootNodeModules","RequireCompatibleLaunchDarklySdk","NoDeprecatedContentBase","NoDirectPeerDependencies","NoDeprecatedStartupInstall","NoTypescriptEntryPoint","PreferOpenEndedPeerDependencies","RequireServiceTitanScope","RequireExplicitSideEffects","RequireNpmrc"],"mappings":";;;;+BAiBaA;;;eAAAA;;;yCAhB2B;4CACG;0CACF;wCACF;iDACS;6CACJ;kDACK;4CACN;8BACd;oDACsB;0CACV;wCACF;wCACA;wDACgB;0CACd;AAElC,MAAMA,QAAuB;IAChC,IAAIC,wDAA2B;IAC/B,IAAIC,sEAAkC;IACtC,IAAIC,kDAAwB;IAC5B,IAAIC,8CAAsB;IAC1B,IAAIC,8CAAsB;IAC1B,IAAIC,8EAAsC;IAC1C,IAAIC,kEAAgC;IACpC,IAAIC,gDAAuB;IAC3B,IAAIC,kDAAwB;IAC5B,IAAIC,sDAA0B;IAC9B,IAAIC,8CAAsB;IAC1B,IAAIC,gEAA+B;IACnC,IAAIC,kDAAwB;IAC5B,IAAIC,sDAA0B;IAC9B,IAAIC,0BAAY;CACnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PackageError, PackageRule, Project } from '../types';
|
|
2
|
+
export declare class NoDeprecatedStartupInstall implements PackageRule {
|
|
3
|
+
get id(): string;
|
|
4
|
+
run(project: Project): PackageError | undefined;
|
|
5
|
+
fix({ location }: PackageError): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=no-deprecated-startup-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-deprecated-startup-install.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/review/rules/no-deprecated-startup-install.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE3E,qBAAa,0BAA2B,YAAW,WAAW;IAC1D,IAAI,EAAE,WAEL;IAED,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS;IAc/C,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY;CAOjC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "NoDeprecatedStartupInstall", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return NoDeprecatedStartupInstall;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _child_process = require("child_process");
|
|
12
|
+
const _types = require("../types");
|
|
13
|
+
class NoDeprecatedStartupInstall {
|
|
14
|
+
get id() {
|
|
15
|
+
return 'no-deprecated-startup-install';
|
|
16
|
+
}
|
|
17
|
+
run(project) {
|
|
18
|
+
var _root_scripts;
|
|
19
|
+
const root = project.packages.find(({ location })=>location === '.');
|
|
20
|
+
const bootstrap = root === null || root === void 0 ? void 0 : (_root_scripts = root.scripts) === null || _root_scripts === void 0 ? void 0 : _root_scripts.bootstrap;
|
|
21
|
+
if (bootstrap && /@servicetitan\/startup.* install/.test(bootstrap)) {
|
|
22
|
+
return {
|
|
23
|
+
id: this.id,
|
|
24
|
+
message: 'project uses deprecated "@servicetitan/startup install" script',
|
|
25
|
+
location: root.location,
|
|
26
|
+
fixable: _types.FixCategory.isolated
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
fix({ location }) {
|
|
31
|
+
if (!location) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
(0, _child_process.execSync)('npm pkg set scripts.bootstrap="npx --yes @servicetitan/install"');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=no-deprecated-startup-install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/commands/review/rules/no-deprecated-startup-install.ts"],"sourcesContent":["import { execSync } from 'child_process';\nimport { FixCategory, PackageError, PackageRule, Project } from '../types';\n\nexport class NoDeprecatedStartupInstall implements PackageRule {\n get id() {\n return 'no-deprecated-startup-install';\n }\n\n run(project: Project): PackageError | undefined {\n const root = project.packages.find(({ location }) => location === '.');\n const bootstrap = root?.scripts?.bootstrap;\n\n if (bootstrap && /@servicetitan\\/startup.* install/.test(bootstrap)) {\n return {\n id: this.id,\n message: 'project uses deprecated \"@servicetitan/startup install\" script',\n location: root.location,\n fixable: FixCategory.isolated,\n };\n }\n }\n\n fix({ location }: PackageError) {\n if (!location) {\n return;\n }\n\n execSync('npm pkg set scripts.bootstrap=\"npx --yes @servicetitan/install\"');\n }\n}\n"],"names":["NoDeprecatedStartupInstall","id","run","project","root","packages","find","location","bootstrap","scripts","test","message","fixable","FixCategory","isolated","fix","execSync"],"mappings":";;;;+BAGaA;;;eAAAA;;;+BAHY;uBACuC;AAEzD,MAAMA;IACT,IAAIC,KAAK;QACL,OAAO;IACX;IAEAC,IAAIC,OAAgB,EAA4B;YAE1BC;QADlB,MAAMA,OAAOD,QAAQE,QAAQ,CAACC,IAAI,CAAC,CAAC,EAAEC,QAAQ,EAAE,GAAKA,aAAa;QAClE,MAAMC,YAAYJ,iBAAAA,4BAAAA,gBAAAA,KAAMK,OAAO,cAAbL,oCAAAA,cAAeI,SAAS;QAE1C,IAAIA,aAAa,mCAAmCE,IAAI,CAACF,YAAY;YACjE,OAAO;gBACHP,IAAI,IAAI,CAACA,EAAE;gBACXU,SAAS;gBACTJ,UAAUH,KAAKG,QAAQ;gBACvBK,S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AmB;IAChC,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAAA;KAAE,CAAC;CAC/C;AAED,MAAM,MAAM,iBAAiB,GACvB,KAAK,GACL,CAAC,KAAK,CAAC,GACP,CAAC,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEjE,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/review/types.ts"],"sourcesContent":["export abstract class PackageRule {\n abstract get id(): string;\n abstract run(project: Project): PackageError | PackageError[] | undefined;\n abstract fix?(error: PackageError, project: Project): void;\n}\n\nexport interface Project {\n config: ReviewConfiguration;\n dependencies: Dependencies;\n // Only using this subset of package-lock.json\n packageLock: {\n packages: Record<\n string,\n {\n version: string;\n dependencies?: Record<string, string>;\n peerDependencies?: Record<string, string>;\n }\n >;\n location: string;\n };\n packages: Package[];\n}\n\n/**\n * Maps package name to versions and dependents of those versions.\n */\nexport interface Dependencies {\n [packageName: string]: {\n [version: string]: string[];\n };\n}\n\n/**\n * Subset of package.json used by rules\n */\nexport interface Package {\n cli?: CliOptions;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n exports?: string | Record<string, string | Record<string, string>> | null;\n location: string;\n main?: string;\n module?: string;\n name: string;\n peerDependencies?: Record<string, string>;\n private?: boolean;\n sideEffects?: any;\n workspaces?: string[];\n}\n\ninterface CliOptions {\n webpack?: false | Record<string, any>;\n}\n\nexport interface PackageError<T = any> {\n data?: T;\n details?: string | string[];\n fixable?: FixCategory;\n id: string;\n location?: string;\n message: string;\n severity?: ErrorSeverity;\n}\n\nexport enum ErrorSeverity {\n error = 1,\n warning = 2,\n}\n\nexport enum FixCategory {\n isolated = 'isolated', // fix examines and changes at most one dependency or package.json, if any\n normal = 'normal', // fix potentially examines and changes multiple dependencies\n lockFile = 'lockFile', // fix examines and changes package-lock.json\n}\n\nexport interface ReviewConfiguration {\n rules?: { [id: string]: RuleConfiguration };\n}\n\nexport type RuleConfiguration =\n | Level\n | [Level]\n | [Level, { exclude?: string[] | Record<string, string[]> }];\n\nexport type Level = 'warn' | 'error' | 'off';\n"],"names":["ErrorSeverity","FixCategory","PackageRule"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/review/types.ts"],"sourcesContent":["export abstract class PackageRule {\n abstract get id(): string;\n abstract run(project: Project): PackageError | PackageError[] | undefined;\n abstract fix?(error: PackageError, project: Project): void;\n}\n\nexport interface Project {\n config: ReviewConfiguration;\n dependencies: Dependencies;\n // Only using this subset of package-lock.json\n packageLock: {\n packages: Record<\n string,\n {\n version: string;\n dependencies?: Record<string, string>;\n peerDependencies?: Record<string, string>;\n }\n >;\n location: string;\n };\n packages: Package[];\n}\n\n/**\n * Maps package name to versions and dependents of those versions.\n */\nexport interface Dependencies {\n [packageName: string]: {\n [version: string]: string[];\n };\n}\n\n/**\n * Subset of package.json used by rules\n */\nexport interface Package {\n cli?: CliOptions;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n exports?: string | Record<string, string | Record<string, string>> | null;\n location: string;\n main?: string;\n module?: string;\n name: string;\n peerDependencies?: Record<string, string>;\n private?: boolean;\n scripts?: Record<string, string>;\n sideEffects?: any;\n workspaces?: string[];\n}\n\ninterface CliOptions {\n webpack?: false | Record<string, any>;\n}\n\nexport interface PackageError<T = any> {\n data?: T;\n details?: string | string[];\n fixable?: FixCategory;\n id: string;\n location?: string;\n message: string;\n severity?: ErrorSeverity;\n}\n\nexport enum ErrorSeverity {\n error = 1,\n warning = 2,\n}\n\nexport enum FixCategory {\n isolated = 'isolated', // fix examines and changes at most one dependency or package.json, if any\n normal = 'normal', // fix potentially examines and changes multiple dependencies\n lockFile = 'lockFile', // fix examines and changes package-lock.json\n}\n\nexport interface ReviewConfiguration {\n rules?: { [id: string]: RuleConfiguration };\n}\n\nexport type RuleConfiguration =\n | Level\n | [Level]\n | [Level, { exclude?: string[] | Record<string, string[]> }];\n\nexport type Level = 'warn' | 'error' | 'off';\n"],"names":["ErrorSeverity","FixCategory","PackageRule"],"mappings":";;;;;;;;;;;QAkEYA;eAAAA;;QAKAC;eAAAA;;QAvEUC;eAAAA;;;AAAf,MAAeA;AAItB;AA8DO,IAAA,AAAKF,uCAAAA;;;WAAAA;;AAKL,IAAA,AAAKC,qCAAAA;;;;WAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-sourcemaps.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/upload-sourcemaps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload-sourcemaps.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/upload-sourcemaps.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/C,UAAU,IAAK,SAAQ,WAAW;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CAC1B;AAMD,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,IAAI,CAAC;;IAMzC,OAAO;IAWb,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,GAAG;CAId"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "UploadSourcemaps", {
|
|
|
8
8
|
return UploadSourcemaps;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _install = require("@servicetitan/install");
|
|
11
12
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
13
|
const _child_process = require("child_process");
|
|
13
14
|
const _utils = require("../../utils");
|
|
@@ -81,7 +82,7 @@ class UploadSourcemaps extends _types.Command {
|
|
|
81
82
|
checkArgs() {
|
|
82
83
|
if (!process.env.DATADOG_API_KEY) {
|
|
83
84
|
const message = 'DATADOG_API_KEY environment variable is not set';
|
|
84
|
-
if (!(0,
|
|
85
|
+
if (!(0, _install.isCI)()) {
|
|
85
86
|
throw new Error(message);
|
|
86
87
|
}
|
|
87
88
|
_utils.log.warning(`${message}; skipping sourcemaps`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/upload-sourcemaps.ts"],"sourcesContent":["import path from 'path';\nimport { execSync } from 'child_process';\nimport { getTsConfig, isWebComponent, log, logErrors, readJson } from '../../utils';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/upload-sourcemaps.ts"],"sourcesContent":["import { isCI } from '@servicetitan/install';\nimport path from 'path';\nimport { execSync } from 'child_process';\nimport { getTsConfig, isWebComponent, log, logErrors, readJson } from '../../utils';\nimport { TSConfig } from '../utils';\nimport { Command, CommandArgs } from './types';\n\ninterface Args extends CommandArgs {\n dry?: boolean;\n releaseVersion: string;\n}\n\ninterface PackageJson {\n name: string;\n}\n\nexport class UploadSourcemaps extends Command<Args> {\n #outDir?: string;\n #packageJson?: PackageJson;\n\n @logErrors\n // eslint-disable-next-line @typescript-eslint/require-await\n async execute() {\n this.checkLocation();\n if (!this.checkArgs()) {\n return;\n }\n\n const bundleDir = this.getBundleDir();\n const options = this.getOptions().join(' ');\n this.run(`npx --yes @datadog/datadog-ci@3 sourcemaps upload ${bundleDir} ${options}`);\n }\n\n private checkArgs() {\n if (!process.env.DATADOG_API_KEY) {\n const message = 'DATADOG_API_KEY environment variable is not set';\n if (!isCI()) {\n throw new Error(message);\n }\n log.warning(`${message}; skipping sourcemaps`);\n return false;\n }\n\n if (!this.args.releaseVersion) {\n throw new Error('--release-version is required');\n }\n\n return true;\n }\n\n private checkLocation() {\n if (!isWebComponent()) {\n throw new Error(`this command must be run inside a web-component directory`);\n }\n }\n\n private getBundleDir() {\n return path.relative('.', path.join(this.getOutDir(), 'bundle'));\n }\n\n private getMinifiedPrefixPath() {\n const { name } = this.getPackageJson();\n const baseUrl = `https://unpkg.servicetitan.com/${name}@${this.args.releaseVersion}`;\n return `${baseUrl}/${this.getBundleDir().replace(/\\\\/g, '/')}`;\n }\n\n private getOptions() {\n const { dry, releaseVersion } = this.args;\n const service = this.getPackageJson().name.replace(/^[^/]+\\//, '');\n return [\n ...[dry && `--dry-run`],\n `--service=${service}`,\n `--release-version=${releaseVersion}`,\n `--minified-path-prefix=${this.getMinifiedPrefixPath()}`,\n `--project-path=${this.getProjectPath()}`,\n ].filter(item => !!item) as string[];\n }\n\n private getOutDir() {\n if (!this.#outDir) {\n const outDir = new TSConfig(getTsConfig()).getValue<string>('compilerOptions.outDir');\n if (!outDir) {\n throw new Error('compilerOptions.outDir is not configured');\n }\n\n this.#outDir = outDir;\n }\n return this.#outDir;\n }\n\n private getPackageJson() {\n if (!this.#packageJson) {\n this.#packageJson = readJson<PackageJson>('package.json');\n }\n return this.#packageJson;\n }\n\n private getProjectPath() {\n const name = readJson(path.join(this.getOutDir(), 'metadata.json')).name;\n return `${name}/`;\n }\n\n private run(command: string) {\n log.info(`Running: ${command}`);\n return execSync(command, { stdio: 'inherit' });\n }\n}\n"],"names":["UploadSourcemaps","Command","execute","checkLocation","checkArgs","bundleDir","getBundleDir","options","getOptions","join","run","process","env","DATADOG_API_KEY","message","isCI","Error","log","warning","args","releaseVersion","isWebComponent","path","relative","getOutDir","getMinifiedPrefixPath","name","getPackageJson","baseUrl","replace","dry","service","getProjectPath","filter","item","outDir","TSConfig","getTsConfig","getValue","readJson","command","info","execSync","stdio"],"mappings":";;;;+BAgBaA;;;eAAAA;;;yBAhBQ;6DACJ;+BACQ;uBAC6C;wBAC7C;uBACY;;;;;;;;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2
|
export declare function gitGetCommitHash(): string;
|
|
3
|
-
interface Repo {
|
|
4
|
-
owner?: string;
|
|
5
|
-
name: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function gitCloneRepo(params: Repo & {
|
|
8
|
-
destination: string;
|
|
9
|
-
}): Promise<boolean>;
|
|
10
|
-
export declare function gitIsReachable({ owner, name }: Repo): boolean;
|
|
11
|
-
export {};
|
|
12
3
|
//# sourceMappingURL=cli-git.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-git.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/cli-git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-git.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/cli-git.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|