@servicetitan/startup 39.1.0 → 39.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/mfe-list.d.ts +0 -2
- package/dist/cli/commands/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/mfe-list.js +4 -30
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +1 -2
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +7 -5
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.js +5 -3
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts +1 -0
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +14 -12
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/registry/command-registry.d.ts +13 -4
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/mfe-list.d.ts +2 -1
- package/dist/cli/commands/registry/mfe-list.d.ts.map +1 -1
- package/dist/cli/commands/registry/mfe-list.js +3 -1
- package/dist/cli/commands/registry/mfe-list.js.map +1 -1
- package/dist/cli/commands/registry/mfe-package-clean.d.ts +2 -1
- package/dist/cli/commands/registry/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/registry/mfe-package-clean.js +4 -2
- package/dist/cli/commands/registry/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/registry/mfe-package-publish.d.ts +2 -1
- package/dist/cli/commands/registry/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/registry/mfe-package-publish.js +4 -2
- package/dist/cli/commands/registry/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/registry/mfe-package-rollback.d.ts +2 -1
- package/dist/cli/commands/registry/mfe-package-rollback.d.ts.map +1 -1
- package/dist/cli/commands/registry/mfe-package-rollback.js +4 -2
- package/dist/cli/commands/registry/mfe-package-rollback.js.map +1 -1
- package/dist/cli/commands/registry/upload-sourcemaps.d.ts +5 -0
- package/dist/cli/commands/registry/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/registry/upload-sourcemaps.js +5 -0
- package/dist/cli/commands/registry/upload-sourcemaps.js.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 +4 -7
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/commands/utils/get-mfe-registry.d.ts +4 -0
- package/dist/cli/commands/utils/get-mfe-registry.d.ts.map +1 -0
- package/dist/cli/commands/utils/get-mfe-registry.js +28 -0
- package/dist/cli/commands/utils/get-mfe-registry.js.map +1 -0
- package/dist/cli/commands/utils/get-unpkg-host.d.ts +2 -0
- package/dist/cli/commands/utils/get-unpkg-host.d.ts.map +1 -0
- package/dist/cli/commands/utils/get-unpkg-host.js +18 -0
- package/dist/cli/commands/utils/get-unpkg-host.js.map +1 -0
- package/dist/cli/commands/utils/index.d.ts +3 -1
- package/dist/cli/commands/utils/index.d.ts.map +1 -1
- package/dist/cli/commands/utils/index.js +3 -1
- package/dist/cli/commands/utils/index.js.map +1 -1
- package/dist/cli/commands/utils/login.d.ts +2 -0
- package/dist/cli/commands/utils/login.d.ts.map +1 -0
- package/dist/cli/commands/utils/login.js +56 -0
- package/dist/cli/commands/utils/login.js.map +1 -0
- package/dist/cli/commands/utils/purge-cache.d.ts.map +1 -1
- package/dist/cli/commands/utils/purge-cache.js +2 -4
- package/dist/cli/commands/utils/purge-cache.js.map +1 -1
- package/dist/cli/index.js +4 -1
- package/dist/cli/index.js.map +1 -1
- package/package.json +15 -16
- package/src/cli/commands/__tests__/mfe-list.test.ts +25 -56
- package/src/cli/commands/__tests__/mfe-package-clean.test.ts +6 -0
- package/src/cli/commands/__tests__/mfe-package-publish.test.ts +52 -47
- package/src/cli/commands/__tests__/mfe-package-rollback.test.ts +4 -2
- package/src/cli/commands/__tests__/mfe-publish.test.ts +51 -14
- package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +27 -13
- package/src/cli/commands/mfe-list.ts +7 -36
- package/src/cli/commands/mfe-package-clean.ts +2 -2
- package/src/cli/commands/mfe-package-publish.ts +10 -8
- package/src/cli/commands/mfe-package-rollback.ts +6 -5
- package/src/cli/commands/mfe-publish.ts +17 -16
- package/src/cli/commands/registry/mfe-list.ts +6 -1
- package/src/cli/commands/registry/mfe-package-clean.ts +7 -1
- package/src/cli/commands/registry/mfe-package-publish.ts +7 -1
- package/src/cli/commands/registry/mfe-package-rollback.ts +4 -2
- package/src/cli/commands/registry/upload-sourcemaps.ts +1 -0
- package/src/cli/commands/upload-sourcemaps.ts +4 -7
- package/src/cli/commands/utils/__tests__/get-mfe-registry.test.ts +24 -0
- package/src/cli/commands/utils/__tests__/get-unpkg-host.test.ts +32 -0
- package/src/cli/commands/utils/__tests__/login.test.ts +122 -0
- package/src/cli/commands/utils/__tests__/purge-cache.test.ts +17 -15
- package/src/cli/commands/utils/get-mfe-registry.ts +6 -0
- package/src/cli/commands/utils/get-unpkg-host.ts +8 -0
- package/src/cli/commands/utils/index.ts +3 -1
- package/src/cli/commands/utils/login.ts +38 -0
- package/src/cli/commands/utils/purge-cache.ts +2 -5
- package/src/cli/index.ts +2 -1
- package/dist/cli/commands/utils/constants.d.ts +0 -2
- package/dist/cli/commands/utils/constants.d.ts.map +0 -1
- package/dist/cli/commands/utils/constants.js +0 -13
- package/dist/cli/commands/utils/constants.js.map +0 -1
- package/src/cli/commands/utils/constants.ts +0 -1
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "entry", {
|
|
|
8
8
|
return entry;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _getmferegistry = require("../utils/get-mfe-registry");
|
|
11
12
|
const _defineentry = require("./define-entry");
|
|
12
13
|
const entry = (0, _defineentry.defineEntry)({
|
|
13
14
|
allowRunFromGlobal: true,
|
|
@@ -38,7 +39,8 @@ const entry = (0, _defineentry.defineEntry)({
|
|
|
38
39
|
},
|
|
39
40
|
registry: {
|
|
40
41
|
string: true,
|
|
41
|
-
|
|
42
|
+
description: 'List packages published to the specified registry',
|
|
43
|
+
defaultDescription: _getmferegistry.PROD_MFE_REGISTRY
|
|
42
44
|
},
|
|
43
45
|
tagged: {
|
|
44
46
|
boolean: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-list.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n allowRunFromGlobal: true,\n description: 'List published MFE packages',\n options: {\n /* eslint-disable @typescript-eslint/naming-convention */\n _: { description: '[packageNames...]', array: true, string: true },\n /* eslint-enable @typescript-eslint/naming-convention */\n all: { boolean: true, description: 'List all published versions ' },\n ignore: {\n array: true,\n string: 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 packageNames: { array: true, string: true, hidden: true },\n registry: {
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-list.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { PROD_MFE_REGISTRY } from '../utils/get-mfe-registry';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n allowRunFromGlobal: true,\n description: 'List published MFE packages',\n options: {\n /* eslint-disable @typescript-eslint/naming-convention */\n _: { description: '[packageNames...]', array: true, string: true },\n /* eslint-enable @typescript-eslint/naming-convention */\n all: { boolean: true, description: 'List all published versions ' },\n ignore: {\n array: true,\n string: 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 packageNames: { array: true, string: true, hidden: true },\n registry: {\n string: true,\n description: 'List packages published to the specified registry',\n defaultDescription: PROD_MFE_REGISTRY,\n },\n tagged: { boolean: true, description: 'List only tagged versions' },\n },\n} satisfies CommandEntry);\n"],"names":["entry","defineEntry","allowRunFromGlobal","description","options","_","array","string","all","boolean","ignore","limit","number","packageNames","hidden","registry","defaultDescription","PROD_MFE_REGISTRY","tagged"],"mappings":";;;;+BAIaA;;;eAAAA;;;gCAHqB;6BACN;AAErB,MAAMA,QAAQC,IAAAA,wBAAW,EAAC;IAC7BC,oBAAoB;IACpBC,aAAa;IACbC,SAAS;QACL,uDAAuD,GACvDC,GAAG;YAAEF,aAAa;YAAqBG,OAAO;YAAMC,QAAQ;QAAK;QACjE,sDAAsD,GACtDC,KAAK;YAAEC,SAAS;YAAMN,aAAa;QAA+B;QAClEO,QAAQ;YACJJ,OAAO;YACPC,QAAQ;YACRJ,aAAa;QACjB;QACAQ,OAAO;YACHC,QAAQ;YACRT,aAAa;QACjB;QACAU,cAAc;YAAEP,OAAO;YAAMC,QAAQ;YAAMO,QAAQ;QAAK;QACxDC,UAAU;YACNR,QAAQ;YACRJ,aAAa;YACba,oBAAoBC,iCAAiB;QACzC;QACAC,QAAQ;YAAET,SAAS;YAAMN,aAAa;QAA4B;IACtE;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-package-clean.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/mfe-package-clean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mfe-package-clean.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/mfe-package-clean.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BO,CAAC"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "entry", {
|
|
|
8
8
|
return entry;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _getmferegistry = require("../utils/get-mfe-registry");
|
|
11
12
|
const _defineentry = require("./define-entry");
|
|
12
13
|
const entry = (0, _defineentry.defineEntry)({
|
|
13
14
|
options: {
|
|
@@ -32,8 +33,9 @@ const entry = (0, _defineentry.defineEntry)({
|
|
|
32
33
|
},
|
|
33
34
|
registry: {
|
|
34
35
|
string: true,
|
|
35
|
-
hidden:
|
|
36
|
-
description: 'Registry
|
|
36
|
+
hidden: false,
|
|
37
|
+
description: 'Registry to remove old versions from',
|
|
38
|
+
defaultDescription: (0, _getmferegistry.getMfeRegistry)()
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-package-clean.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n all: {\n boolean: true,\n description: 'Unpublish old versions from all branches',\n defaultDescription: 'false',\n },\n branch: {\n string: true,\n description: 'Branch name of versions to unpublish',\n defaultDescription: 'current git branch',\n },\n count: {\n number: true,\n description: 'Keep the specified number of old versions',\n defaultDescription: '5',\n },\n dry: {\n boolean: true,\n description: 'Take no action and only log what would be unpublished',\n },\n registry: {
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-package-clean.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { getMfeRegistry } from '../utils/get-mfe-registry';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n all: {\n boolean: true,\n description: 'Unpublish old versions from all branches',\n defaultDescription: 'false',\n },\n branch: {\n string: true,\n description: 'Branch name of versions to unpublish',\n defaultDescription: 'current git branch',\n },\n count: {\n number: true,\n description: 'Keep the specified number of old versions',\n defaultDescription: '5',\n },\n dry: {\n boolean: true,\n description: 'Take no action and only log what would be unpublished',\n },\n registry: {\n string: true,\n hidden: false,\n description: 'Registry to remove old versions from',\n defaultDescription: getMfeRegistry(),\n },\n },\n} satisfies CommandEntry);\n"],"names":["entry","defineEntry","options","all","boolean","description","defaultDescription","branch","string","count","number","dry","registry","hidden","getMfeRegistry"],"mappings":";;;;+BAIaA;;;eAAAA;;;gCAHkB;6BACH;AAErB,MAAMA,QAAQC,IAAAA,wBAAW,EAAC;IAC7BC,SAAS;QACLC,KAAK;YACDC,SAAS;YACTC,aAAa;YACbC,oBAAoB;QACxB;QACAC,QAAQ;YACJC,QAAQ;YACRH,aAAa;YACbC,oBAAoB;QACxB;QACAG,OAAO;YACHC,QAAQ;YACRL,aAAa;YACbC,oBAAoB;QACxB;QACAK,KAAK;YACDP,SAAS;YACTC,aAAa;QACjB;QACAO,UAAU;YACNJ,QAAQ;YACRK,QAAQ;YACRR,aAAa;YACbC,oBAAoBQ,IAAAA,8BAAc;QACtC;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-package-publish.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/mfe-package-publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mfe-package-publish.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/mfe-package-publish.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CO,CAAC"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "entry", {
|
|
|
8
8
|
return entry;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _getmferegistry = require("../utils/get-mfe-registry");
|
|
11
12
|
const _defineentry = require("./define-entry");
|
|
12
13
|
const entry = (0, _defineentry.defineEntry)({
|
|
13
14
|
options: {
|
|
@@ -31,8 +32,9 @@ const entry = (0, _defineentry.defineEntry)({
|
|
|
31
32
|
},
|
|
32
33
|
registry: {
|
|
33
34
|
string: true,
|
|
34
|
-
hidden:
|
|
35
|
-
description: 'Registry
|
|
35
|
+
hidden: false,
|
|
36
|
+
description: 'Registry to publish to',
|
|
37
|
+
defaultDescription: (0, _getmferegistry.getMfeRegistry)()
|
|
36
38
|
},
|
|
37
39
|
trackHistory: {
|
|
38
40
|
boolean: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-package-publish.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n branch: {\n string: true,\n description: 'Branch name to associate with published version',\n defaultDescription: 'current git branch',\n },\n build: {\n string: true,\n description: 'Package version',\n defaultDescription: '<branch_name>.<commit_hash>',\n },\n dry: {\n boolean: true,\n description: 'Take no action and only log what would be published',\n },\n force: {\n boolean: true,\n description: 'Force publishing from an unrecognized branch',\n },\n registry: {
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-package-publish.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { getMfeRegistry } from '../utils/get-mfe-registry';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n branch: {\n string: true,\n description: 'Branch name to associate with published version',\n defaultDescription: 'current git branch',\n },\n build: {\n string: true,\n description: 'Package version',\n defaultDescription: '<branch_name>.<commit_hash>',\n },\n dry: {\n boolean: true,\n description: 'Take no action and only log what would be published',\n },\n force: {\n boolean: true,\n description: 'Force publishing from an unrecognized branch',\n },\n registry: {\n string: true,\n hidden: false,\n description: 'Registry to publish to',\n defaultDescription: getMfeRegistry(),\n },\n trackHistory: {\n boolean: true,\n description: 'Tag the previous release, to support rollbacks',\n defaultDescription: 'true',\n hidden: true,\n },\n tag: {\n string: true,\n description: 'Tag to assign to published version',\n },\n uploadSourcemaps: {\n boolean: true,\n description: 'Upload source maps to Datadog?',\n defaultDescription: 'true',\n },\n purgeCache: {\n boolean: true,\n description: 'Purge unpkg cache after publishing?',\n defaultDescription: 'true',\n },\n },\n} satisfies CommandEntry);\n"],"names":["entry","defineEntry","options","branch","string","description","defaultDescription","build","dry","boolean","force","registry","hidden","getMfeRegistry","trackHistory","tag","uploadSourcemaps","purgeCache"],"mappings":";;;;+BAIaA;;;eAAAA;;;gCAHkB;6BACH;AAErB,MAAMA,QAAQC,IAAAA,wBAAW,EAAC;IAC7BC,SAAS;QACLC,QAAQ;YACJC,QAAQ;YACRC,aAAa;YACbC,oBAAoB;QACxB;QACAC,OAAO;YACHH,QAAQ;YACRC,aAAa;YACbC,oBAAoB;QACxB;QACAE,KAAK;YACDC,SAAS;YACTJ,aAAa;QACjB;QACAK,OAAO;YACHD,SAAS;YACTJ,aAAa;QACjB;QACAM,UAAU;YACNP,QAAQ;YACRQ,QAAQ;YACRP,aAAa;YACbC,oBAAoBO,IAAAA,8BAAc;QACtC;QACAC,cAAc;YACVL,SAAS;YACTJ,aAAa;YACbC,oBAAoB;YACpBM,QAAQ;QACZ;QACAG,KAAK;YACDX,QAAQ;YACRC,aAAa;QACjB;QACAW,kBAAkB;YACdP,SAAS;YACTJ,aAAa;YACbC,oBAAoB;QACxB;QACAW,YAAY;YACRR,SAAS;YACTJ,aAAa;YACbC,oBAAoB;QACxB;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-package-rollback.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/mfe-package-rollback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mfe-package-rollback.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/mfe-package-rollback.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;CAuBO,CAAC"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "entry", {
|
|
|
8
8
|
return entry;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _getmferegistry = require("../utils/get-mfe-registry");
|
|
11
12
|
const _defineentry = require("./define-entry");
|
|
12
13
|
const entry = (0, _defineentry.defineEntry)({
|
|
13
14
|
options: {
|
|
@@ -17,8 +18,9 @@ const entry = (0, _defineentry.defineEntry)({
|
|
|
17
18
|
},
|
|
18
19
|
registry: {
|
|
19
20
|
string: true,
|
|
20
|
-
hidden:
|
|
21
|
-
description: 'Registry
|
|
21
|
+
hidden: false,
|
|
22
|
+
description: 'Registry to roll back within',
|
|
23
|
+
defaultDescription: (0, _getmferegistry.getMfeRegistry)()
|
|
22
24
|
},
|
|
23
25
|
tag: {
|
|
24
26
|
string: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-package-rollback.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n dry: {\n boolean: true,\n description: 'Take no action and only log what would be rolled back',\n },\n registry: {\n string: true,\n hidden:
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/registry/mfe-package-rollback.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { getMfeRegistry } from '../utils/get-mfe-registry';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n dry: {\n boolean: true,\n description: 'Take no action and only log what would be rolled back',\n },\n registry: {\n string: true,\n hidden: false,\n description: 'Registry to roll back within',\n defaultDescription: getMfeRegistry(),\n },\n tag: {\n string: true,\n description: 'The tag to rollback to its previous version',\n required: true,\n },\n purgeCache: {\n boolean: true,\n description: 'Purge unpkg cache after rolling back?',\n defaultDescription: 'true',\n },\n },\n} satisfies CommandEntry);\n"],"names":["entry","defineEntry","options","dry","boolean","description","registry","string","hidden","defaultDescription","getMfeRegistry","tag","required","purgeCache"],"mappings":";;;;+BAIaA;;;eAAAA;;;gCAHkB;6BACH;AAErB,MAAMA,QAAQC,IAAAA,wBAAW,EAAC;IAC7BC,SAAS;QACLC,KAAK;YACDC,SAAS;YACTC,aAAa;QACjB;QACAC,UAAU;YACNC,QAAQ;YACRC,QAAQ;YACRH,aAAa;YACbI,oBAAoBC,IAAAA,8BAAc;QACtC;QACAC,KAAK;YACDJ,QAAQ;YACRF,aAAa;YACbO,UAAU;QACd;QACAC,YAAY;YACRT,SAAS;YACTC,aAAa;YACbI,oBAAoB;QACxB;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-sourcemaps.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/upload-sourcemaps.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"upload-sourcemaps.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/registry/upload-sourcemaps.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;CAWO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/registry/upload-sourcemaps.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n dry: { boolean: true, description: 'Dry run mode' },\n releaseVersion: {\n string: true,\n demandOption: true,\n requiresArg: true,\n description: 'Release version',\n },\n },\n} satisfies CommandEntry);\n"],"names":["entry","defineEntry","options","dry","boolean","description","
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/registry/upload-sourcemaps.ts"],"sourcesContent":["import type { CommandEntry } from '../types';\nimport { defineEntry } from './define-entry';\n\nexport const entry = defineEntry({\n options: {\n dry: { boolean: true, description: 'Dry run mode' },\n registry: { string: true, hidden: true, description: 'Registry url' },\n releaseVersion: {\n string: true,\n demandOption: true,\n requiresArg: true,\n description: 'Release version',\n },\n },\n} satisfies CommandEntry);\n"],"names":["entry","defineEntry","options","dry","boolean","description","registry","string","hidden","releaseVersion","demandOption","requiresArg"],"mappings":";;;;+BAGaA;;;eAAAA;;;6BAFe;AAErB,MAAMA,QAAQC,IAAAA,wBAAW,EAAC;IAC7BC,SAAS;QACLC,KAAK;YAAEC,SAAS;YAAMC,aAAa;QAAe;QAClDC,UAAU;YAAEC,QAAQ;YAAMC,QAAQ;YAAMH,aAAa;QAAe;QACpEI,gBAAgB;YACZF,QAAQ;YACRG,cAAc;YACdC,aAAa;YACbN,aAAa;QACjB;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/review/types.ts"],"sourcesContent":["import { PackageManager } from '@servicetitan/install';\n\nexport 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 packageManager: PackageManager;\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 | [Level] | [Level, { exclude?: string[] | Record<string, string[]> }];\n\nexport type Level = 'warn' | 'error' | 'off';\n"],"names":["ErrorSeverity","FixCategory","PackageRule"],"mappings":";;;;;;;;;;;QAyDYA;eAAAA;;QAKAC;eAAAA;;QA5DUC;eAAAA;;;AAAf,MAAeA;AAItB;AAmDO,IAAA,AAAKF,uCAAAA
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/review/types.ts"],"sourcesContent":["import { PackageManager } from '@servicetitan/install';\n\nexport 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 packageManager: PackageManager;\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 | [Level] | [Level, { exclude?: string[] | Record<string, string[]> }];\n\nexport type Level = 'warn' | 'error' | 'off';\n"],"names":["ErrorSeverity","FixCategory","PackageRule"],"mappings":";;;;;;;;;;;QAyDYA;eAAAA;;QAKAC;eAAAA;;QA5DUC;eAAAA;;;AAAf,MAAeA;AAItB;AAmDO,IAAA,AAAKF,uCAAAA;2CACA;6CACE;WAFFA;;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":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAOlC,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,OAAO,KAAK,CAAC;;IAMjD,OAAO;IAWb,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,GAAG;CAId"}
|
|
@@ -8,12 +8,12 @@ Object.defineProperty(exports, "UploadSourcemaps", {
|
|
|
8
8
|
return UploadSourcemaps;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _install = require("@servicetitan/install");
|
|
12
11
|
const _child_process = require("child_process");
|
|
13
12
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
13
|
const _utils = require("../../utils");
|
|
15
14
|
const _utils1 = require("../utils");
|
|
16
15
|
const _types = require("./types");
|
|
16
|
+
const _utils2 = require("./utils");
|
|
17
17
|
function _check_private_redeclaration(obj, privateCollection) {
|
|
18
18
|
if (privateCollection.has(obj)) {
|
|
19
19
|
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
@@ -85,11 +85,7 @@ class UploadSourcemaps extends _types.Command {
|
|
|
85
85
|
}
|
|
86
86
|
checkArgs() {
|
|
87
87
|
if (!process.env.DATADOG_API_KEY) {
|
|
88
|
-
|
|
89
|
-
if (!(0, _install.isCI)()) {
|
|
90
|
-
throw new Error(message);
|
|
91
|
-
}
|
|
92
|
-
_utils.log.warning(`${message}; skipping sourcemaps`);
|
|
88
|
+
_utils.log.warning('DATADOG_API_KEY environment variable is not set; skipping sourcemaps');
|
|
93
89
|
return false;
|
|
94
90
|
}
|
|
95
91
|
return true;
|
|
@@ -104,7 +100,8 @@ class UploadSourcemaps extends _types.Command {
|
|
|
104
100
|
}
|
|
105
101
|
getMinifiedPrefixPath() {
|
|
106
102
|
const { name } = this.getPackageJson();
|
|
107
|
-
const
|
|
103
|
+
const host = (0, _utils2.getUnpkgHost)(this.args.registry);
|
|
104
|
+
const baseUrl = `${host}/${name}@${this.args.releaseVersion}`;
|
|
108
105
|
return `${baseUrl}/${this.getBundleDir().replace(/\\/g, '/')}`;
|
|
109
106
|
}
|
|
110
107
|
getOptions() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/upload-sourcemaps.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/upload-sourcemaps.ts"],"sourcesContent":["import { execSync } from 'child_process';\nimport path from 'path';\nimport { getTsConfig, isWebComponent, log, logErrors, readJson } from '../../utils';\nimport { TSConfig } from '../utils';\nimport type { entry } from './registry/upload-sourcemaps';\nimport { Command } from './types';\nimport { getUnpkgHost } from './utils';\n\ninterface PackageJson {\n name: string;\n}\n\nexport class UploadSourcemaps extends Command<typeof entry> {\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 log.warning('DATADOG_API_KEY environment variable is not set; skipping sourcemaps');\n return false;\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 host = getUnpkgHost(this.args.registry);\n const baseUrl = `${host}/${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","log","warning","isWebComponent","Error","path","relative","getOutDir","getMinifiedPrefixPath","name","getPackageJson","host","getUnpkgHost","args","registry","baseUrl","releaseVersion","replace","dry","service","getProjectPath","filter","item","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.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/get-mfe-registry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,uCAAuC,CAAC;AACtE,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get DEV_MFE_REGISTRY () {
|
|
13
|
+
return DEV_MFE_REGISTRY;
|
|
14
|
+
},
|
|
15
|
+
get PROD_MFE_REGISTRY () {
|
|
16
|
+
return PROD_MFE_REGISTRY;
|
|
17
|
+
},
|
|
18
|
+
get getMfeRegistry () {
|
|
19
|
+
return getMfeRegistry;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const PROD_MFE_REGISTRY = 'https://verdaccio.servicetitan.com';
|
|
23
|
+
const DEV_MFE_REGISTRY = 'https://verdaccio.st.dev';
|
|
24
|
+
function getMfeRegistry(registry) {
|
|
25
|
+
return registry !== null && registry !== void 0 ? registry : PROD_MFE_REGISTRY;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=get-mfe-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/utils/get-mfe-registry.ts"],"sourcesContent":["export const PROD_MFE_REGISTRY = 'https://verdaccio.servicetitan.com';\nexport const DEV_MFE_REGISTRY = 'https://verdaccio.st.dev';\n\nexport function getMfeRegistry(registry?: string): string {\n return registry ?? PROD_MFE_REGISTRY;\n}\n"],"names":["DEV_MFE_REGISTRY","PROD_MFE_REGISTRY","getMfeRegistry","registry"],"mappings":";;;;;;;;;;;QACaA;eAAAA;;QADAC;eAAAA;;QAGGC;eAAAA;;;AAHT,MAAMD,oBAAoB;AAC1B,MAAMD,mBAAmB;AAEzB,SAASE,eAAeC,QAAiB;IAC5C,OAAOA,qBAAAA,sBAAAA,WAAYF;AACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-unpkg-host.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/get-unpkg-host.ts"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getUnpkgHost", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getUnpkgHost;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _getmferegistry = require("./get-mfe-registry");
|
|
12
|
+
const PROD_UNPKG_HOST = 'https://unpkg.servicetitan.com';
|
|
13
|
+
const DEV_UNPKG_HOST = 'https://unpkg.st.dev';
|
|
14
|
+
function getUnpkgHost(registry) {
|
|
15
|
+
return (0, _getmferegistry.getMfeRegistry)(registry) === _getmferegistry.DEV_MFE_REGISTRY ? DEV_UNPKG_HOST : PROD_UNPKG_HOST;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=get-unpkg-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/utils/get-unpkg-host.ts"],"sourcesContent":["import { DEV_MFE_REGISTRY, getMfeRegistry } from './get-mfe-registry';\n\nconst PROD_UNPKG_HOST = 'https://unpkg.servicetitan.com';\nconst DEV_UNPKG_HOST = 'https://unpkg.st.dev';\n\nexport function getUnpkgHost(registry?: string): string {\n return getMfeRegistry(registry) === DEV_MFE_REGISTRY ? DEV_UNPKG_HOST : PROD_UNPKG_HOST;\n}\n"],"names":["getUnpkgHost","PROD_UNPKG_HOST","DEV_UNPKG_HOST","registry","getMfeRegistry","DEV_MFE_REGISTRY"],"mappings":";;;;+BAKgBA;;;eAAAA;;;gCALiC;AAEjD,MAAMC,kBAAkB;AACxB,MAAMC,iBAAiB;AAEhB,SAASF,aAAaG,QAAiB;IAC1C,OAAOC,IAAAA,8BAAc,EAACD,cAAcE,gCAAgB,GAAGH,iBAAiBD;AAC5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
_export_star(require("./build-rollback-tag"), exports);
|
|
6
|
-
_export_star(require("./
|
|
6
|
+
_export_star(require("./get-mfe-registry"), exports);
|
|
7
|
+
_export_star(require("./get-unpkg-host"), exports);
|
|
8
|
+
_export_star(require("./login"), exports);
|
|
7
9
|
_export_star(require("./purge-cache"), exports);
|
|
8
10
|
function _export_star(from, to) {
|
|
9
11
|
Object.keys(from).forEach(function(k) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/utils/index.ts"],"sourcesContent":["export * from './build-rollback-tag';\nexport * from './
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/utils/index.ts"],"sourcesContent":["export * from './build-rollback-tag';\nexport * from './get-mfe-registry';\nexport * from './get-unpkg-host';\nexport * from './login';\nexport * from './purge-cache';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/login.ts"],"names":[],"mappings":"AAQA,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,iBAsB3C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "login", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return login;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _install = require("@servicetitan/install");
|
|
12
|
+
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
13
|
+
const _promises = /*#__PURE__*/ _interop_require_default(require("readline/promises"));
|
|
14
|
+
const _utils = require("../../utils");
|
|
15
|
+
const _getmferegistry = require("./get-mfe-registry");
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const OKTA_REGISTRIES = [
|
|
22
|
+
_getmferegistry.PROD_MFE_REGISTRY,
|
|
23
|
+
_getmferegistry.DEV_MFE_REGISTRY
|
|
24
|
+
];
|
|
25
|
+
async function login(registry) {
|
|
26
|
+
if ((0, _install.npmWhoAmI)({
|
|
27
|
+
registry
|
|
28
|
+
}) !== undefined) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!OKTA_REGISTRIES.includes(registry)) {
|
|
32
|
+
throw new Error(`Registry ${registry} is not recognized. Please log in manually.`);
|
|
33
|
+
}
|
|
34
|
+
const message = `This machine is not authorized to access ${registry}.`;
|
|
35
|
+
if (!(0, _utils.isTTY)()) {
|
|
36
|
+
throw new Error(message);
|
|
37
|
+
}
|
|
38
|
+
const answer = await ask(_chalk.default.bold.cyan(`${message} Authorize? [Y/n] `));
|
|
39
|
+
if (answer && answer !== 'y') {
|
|
40
|
+
throw new Error('Not authorized');
|
|
41
|
+
}
|
|
42
|
+
await (0, _utils.runCommand)(`npx --yes verdaccio-okta-oauth@latest --registry=${registry}`, {
|
|
43
|
+
quiet: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async function ask(question) {
|
|
47
|
+
const rl = _promises.default.createInterface({
|
|
48
|
+
input: process.stdin,
|
|
49
|
+
output: process.stdout
|
|
50
|
+
});
|
|
51
|
+
const answer = await rl.question(question);
|
|
52
|
+
rl.close();
|
|
53
|
+
return answer.trim().toLowerCase();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/utils/login.ts"],"sourcesContent":["import { npmWhoAmI } from '@servicetitan/install';\nimport chalk from 'chalk';\nimport readline from 'readline/promises';\nimport { isTTY, runCommand } from '../../utils';\nimport { DEV_MFE_REGISTRY, PROD_MFE_REGISTRY } from './get-mfe-registry';\n\nconst OKTA_REGISTRIES: string[] = [PROD_MFE_REGISTRY, DEV_MFE_REGISTRY];\n\nexport async function login(registry: string) {\n if (npmWhoAmI({ registry }) !== undefined) {\n return;\n }\n\n if (!OKTA_REGISTRIES.includes(registry)) {\n throw new Error(`Registry ${registry} is not recognized. Please log in manually.`);\n }\n\n const message = `This machine is not authorized to access ${registry}.`;\n if (!isTTY()) {\n throw new Error(message);\n }\n\n const answer = await 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=${registry}`, {\n quiet: true,\n });\n}\n\nasync function 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"],"names":["login","OKTA_REGISTRIES","PROD_MFE_REGISTRY","DEV_MFE_REGISTRY","registry","npmWhoAmI","undefined","includes","Error","message","isTTY","answer","ask","chalk","bold","cyan","runCommand","quiet","question","rl","readline","createInterface","input","process","stdin","output","stdout","close","trim","toLowerCase"],"mappings":";;;;+BAQsBA;;;eAAAA;;;yBARI;8DACR;iEACG;uBACa;gCACkB;;;;;;AAEpD,MAAMC,kBAA4B;IAACC,iCAAiB;IAAEC,gCAAgB;CAAC;AAEhE,eAAeH,MAAMI,QAAgB;IACxC,IAAIC,IAAAA,kBAAS,EAAC;QAAED;IAAS,OAAOE,WAAW;QACvC;IACJ;IAEA,IAAI,CAACL,gBAAgBM,QAAQ,CAACH,WAAW;QACrC,MAAM,IAAII,MAAM,CAAC,SAAS,EAAEJ,SAAS,2CAA2C,CAAC;IACrF;IAEA,MAAMK,UAAU,CAAC,yCAAyC,EAAEL,SAAS,CAAC,CAAC;IACvE,IAAI,CAACM,IAAAA,YAAK,KAAI;QACV,MAAM,IAAIF,MAAMC;IACpB;IAEA,MAAME,SAAS,MAAMC,IAAIC,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,GAAGN,QAAQ,kBAAkB,CAAC;IACvE,IAAIE,UAAUA,WAAW,KAAK;QAC1B,MAAM,IAAIH,MAAM;IACpB;IAEA,MAAMQ,IAAAA,iBAAU,EAAC,CAAC,iDAAiD,EAAEZ,UAAU,EAAE;QAC7Ea,OAAO;IACX;AACJ;AAEA,eAAeL,IAAIM,QAAgB;IAC/B,MAAMC,KAAKC,iBAAQ,CAACC,eAAe,CAAC;QAAEC,OAAOC,QAAQC,KAAK;QAAEC,QAAQF,QAAQG,MAAM;IAAC;IACnF,MAAMf,SAAS,MAAMQ,GAAGD,QAAQ,CAACA;IACjCC,GAAGQ,KAAK;IACR,OAAOhB,OAAOiB,IAAI,GAAGC,WAAW;AACpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purge-cache.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/purge-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"purge-cache.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/utils/purge-cache.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,QAM1F"}
|
|
@@ -9,12 +9,10 @@ Object.defineProperty(exports, "purgeCache", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _utils = require("../../utils");
|
|
12
|
-
const
|
|
13
|
-
const DEFAULT_UNPKG_HOST = 'https://unpkg.servicetitan.com';
|
|
14
|
-
const DEV_UNPKG_HOST = 'https://unpkg.st.dev';
|
|
12
|
+
const _getunpkghost = require("./get-unpkg-host");
|
|
15
13
|
function purgeCache(options) {
|
|
16
14
|
const { packageName, registry, tag } = options;
|
|
17
|
-
const host = registry
|
|
15
|
+
const host = (0, _getunpkghost.getUnpkgHost)(registry);
|
|
18
16
|
(0, _utils.runCommandOutput)(`npx startup mfe-purge-cache --host ${host} --package-name ${packageName} --tag ${tag}`);
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/commands/utils/purge-cache.ts"],"sourcesContent":["import { runCommandOutput } from '../../utils';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/commands/utils/purge-cache.ts"],"sourcesContent":["import { runCommandOutput } from '../../utils';\nimport { getUnpkgHost } from './get-unpkg-host';\n\nexport function purgeCache(options: { packageName: string; registry?: string; tag: string }) {\n const { packageName, registry, tag } = options;\n const host = getUnpkgHost(registry);\n runCommandOutput(\n `npx startup mfe-purge-cache --host ${host} --package-name ${packageName} --tag ${tag}`\n );\n}\n"],"names":["purgeCache","options","packageName","registry","tag","host","getUnpkgHost","runCommandOutput"],"mappings":";;;;+BAGgBA;;;eAAAA;;;uBAHiB;8BACJ;AAEtB,SAASA,WAAWC,OAAgE;IACvF,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGH;IACvC,MAAMI,OAAOC,IAAAA,0BAAY,EAACH;IAC1BI,IAAAA,uBAAgB,EACZ,CAAC,mCAAmC,EAAEF,KAAK,gBAAgB,EAAEH,YAAY,OAAO,EAAEE,KAAK;AAE/F"}
|
package/dist/cli/index.js
CHANGED
|
@@ -30,7 +30,10 @@ function addCommand(name, y) {
|
|
|
30
30
|
const { description, options: { _, ...options } = {} } = entry;
|
|
31
31
|
const nameWithArgs = name + ((_ === null || _ === void 0 ? void 0 : _.description) ? ` ${_.description}` : '');
|
|
32
32
|
const groupedOptions = Object.entries(options).reduce((result, [key, value])=>{
|
|
33
|
-
|
|
33
|
+
var _ref;
|
|
34
|
+
var _exec;
|
|
35
|
+
const suffix = (_ref = (_exec = /\W+$/.exec(key)) === null || _exec === void 0 ? void 0 : _exec[0]) !== null && _ref !== void 0 ? _ref : ''; // fix for kebabCase dropping `\u00A0` suffixes
|
|
36
|
+
result[(0, _lodashkebabcase.default)(key) + suffix] = {
|
|
34
37
|
group: 'Command Options:',
|
|
35
38
|
...value
|
|
36
39
|
};
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["import chalk from 'chalk';\nimport execa from 'execa';\nimport kebabCase from 'lodash.kebabcase';\nimport path from 'path';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { getStartupVersion } from '../core';\nimport { CommandName, log } from '../utils';\nimport { commandRegistry } from './commands/registry';\nimport type { CommandOptions } from './commands/types';\nimport { checkStartupLocation, getExitCode, setNodeOptions } from './utils';\n\nconst yargsInstance = yargs(hideBin(process.argv));\n\nObject.values(CommandName)\n .reduce((y, name) => addCommand(name, y), yargsInstance)\n .usage('Usage: startup <command> [options]')\n .epilogue(\n chalk.bold.cyan(`startup cli v${getStartupVersion()}\\n`) +\n `Run ${chalk.bold.cyan('startup <command> --help')} to see command options.\\n` +\n `For detailed documentation, see ${chalk.bold.cyan('https://docs.st.dev/docs/frontend/uikit/startup')}.\\n`\n )\n .demandCommand(1, '')\n .strictCommands()\n .updateStrings({\n 'Unknown command: %s': {\n one: chalk.bold.red('Unknown command: %s'),\n other: chalk.bold.red('Unknown command: %s'),\n } as any,\n })\n .version()\n .wrap(Math.min(100, yargsInstance.terminalWidth()))\n .help()\n .parse();\n\nfunction addCommand(name: CommandName, y: typeof yargs) {\n const entry = commandRegistry[name];\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { description, options: { _, ...options } = {} } = entry;\n const nameWithArgs = name + (_?.description ? ` ${_.description}` : '');\n const groupedOptions = Object.entries(options).reduce((result, [key, value]) => {\n result[kebabCase(key)] = { group: 'Command Options:', ...value };\n return result;\n }, {} as CommandOptions);\n const handler = (argv: any) => handleCommand(name, argv);\n if (description) {\n y.command(nameWithArgs, description, groupedOptions, handler);\n } else {\n y.command(nameWithArgs, false, groupedOptions, handler);\n }\n return y;\n}\n\nasync function handleCommand(name: CommandName, argv: any) {\n const entry = commandRegistry[name];\n\n checkNodeVersion();\n checkStartupLocation(name, entry);\n\n if (setNodeOptions(name, entry)) {\n log.debug('run', `Running ${name} in child process with amended NODE_OPTIONS`);\n execa(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(reason => {\n process.exit(getExitCode(reason));\n });\n return;\n }\n\n const CommandClass = await entry.load();\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const command = new CommandClass({ ...argv, _: argv._.slice(1) });\n\n command.watchForParentExit(name);\n\n command.execute().catch(() => {\n process.exit(1);\n });\n}\n\nfunction checkNodeVersion() {\n const nodeVersion = Number(process.versions.node.split('.')[0]);\n if (nodeVersion % 2 === 0 || process.env.SKIP_NODE_VERSION_CHECK) {\n return;\n }\n\n const { engines } = require(path.join(__dirname, '../../package.json'));\n log.error(\n `error: node v${nodeVersion} detected, only even-numbered LTS versions ${engines.node} are supported`\n );\n log.text('See https://nodejs.org/en/download for LTS versions');\n process.exit(1);\n}\n"],"names":["yargsInstance","yargs","hideBin","process","argv","Object","values","CommandName","reduce","y","name","addCommand","usage","epilogue","chalk","bold","cyan","getStartupVersion","demandCommand","strictCommands","updateStrings","one","red","other","version","wrap","Math","min","terminalWidth","help","parse","entry","commandRegistry","description","options","_","nameWithArgs","groupedOptions","entries","result","key","value","kebabCase","group","handler","handleCommand","command","checkNodeVersion","checkStartupLocation","setNodeOptions","log","debug","execa","slice","stdio","catch","reason","exit","getExitCode","CommandClass","load","watchForParentExit","execute","nodeVersion","Number","versions","node","split","env","SKIP_NODE_VERSION_CHECK","engines","require","path","join","__dirname","error","text"],"mappings":";;;;8DAAkB;8DACA;wEACI;6DACL;8DACC;yBACM;sBACU;uBACD;0BACD;wBAEkC;;;;;;AAElE,MAAMA,gBAAgBC,IAAAA,cAAK,EAACC,IAAAA,gBAAO,EAACC,QAAQC,IAAI;AAEhDC,OAAOC,MAAM,CAACC,kBAAW,EACpBC,MAAM,CAAC,CAACC,GAAGC,OAASC,WAAWD,MAAMD,IAAIT,eACzCY,KAAK,CAAC,sCACNC,QAAQ,CACLC,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,CAAC,aAAa,EAAEC,IAAAA,uBAAiB,IAAG,EAAE,CAAC,IACnD,CAAC,IAAI,EAAEH,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,4BAA4B,0BAA0B,CAAC,GAC9E,CAAC,gCAAgC,EAAEF,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,mDAAmD,GAAG,CAAC,EAEjHE,aAAa,CAAC,GAAG,IACjBC,cAAc,GACdC,aAAa,CAAC;IACX,uBAAuB;QACnBC,KAAKP,cAAK,CAACC,IAAI,CAACO,GAAG,CAAC;QACpBC,OAAOT,cAAK,CAACC,IAAI,CAACO,GAAG,CAAC;IAC1B;AACJ,GACCE,OAAO,GACPC,IAAI,CAACC,KAAKC,GAAG,CAAC,KAAK3B,cAAc4B,aAAa,KAC9CC,IAAI,GACJC,KAAK;AAEV,SAASnB,WAAWD,IAAiB,EAAED,CAAe;IAClD,MAAMsB,QAAQC,yBAAe,CAACtB,KAAK;IAEnC,gEAAgE;IAChE,MAAM,EAAEuB,WAAW,EAAEC,SAAS,EAAEC,CAAC,EAAE,GAAGD,SAAS,GAAG,CAAC,CAAC,EAAE,GAAGH;IACzD,MAAMK,eAAe1B,OAAQyB,CAAAA,CAAAA,cAAAA,wBAAAA,EAAGF,WAAW,IAAG,CAAC,CAAC,EAAEE,EAAEF,WAAW,EAAE,GAAG,EAAC;IACrE,MAAMI,iBAAiBhC,OAAOiC,OAAO,CAACJ,SAAS1B,MAAM,CAAC,CAAC+B,QAAQ,CAACC,KAAKC,MAAM;
|
|
1
|
+
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["import chalk from 'chalk';\nimport execa from 'execa';\nimport kebabCase from 'lodash.kebabcase';\nimport path from 'path';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { getStartupVersion } from '../core';\nimport { CommandName, log } from '../utils';\nimport { commandRegistry } from './commands/registry';\nimport type { CommandOptions } from './commands/types';\nimport { checkStartupLocation, getExitCode, setNodeOptions } from './utils';\n\nconst yargsInstance = yargs(hideBin(process.argv));\n\nObject.values(CommandName)\n .reduce((y, name) => addCommand(name, y), yargsInstance)\n .usage('Usage: startup <command> [options]')\n .epilogue(\n chalk.bold.cyan(`startup cli v${getStartupVersion()}\\n`) +\n `Run ${chalk.bold.cyan('startup <command> --help')} to see command options.\\n` +\n `For detailed documentation, see ${chalk.bold.cyan('https://docs.st.dev/docs/frontend/uikit/startup')}.\\n`\n )\n .demandCommand(1, '')\n .strictCommands()\n .updateStrings({\n 'Unknown command: %s': {\n one: chalk.bold.red('Unknown command: %s'),\n other: chalk.bold.red('Unknown command: %s'),\n } as any,\n })\n .version()\n .wrap(Math.min(100, yargsInstance.terminalWidth()))\n .help()\n .parse();\n\nfunction addCommand(name: CommandName, y: typeof yargs) {\n const entry = commandRegistry[name];\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { description, options: { _, ...options } = {} } = entry;\n const nameWithArgs = name + (_?.description ? ` ${_.description}` : '');\n const groupedOptions = Object.entries(options).reduce((result, [key, value]) => {\n const suffix = /\\W+$/.exec(key)?.[0] ?? ''; // fix for kebabCase dropping `\\u00A0` suffixes\n result[kebabCase(key) + suffix] = { group: 'Command Options:', ...value };\n return result;\n }, {} as CommandOptions);\n const handler = (argv: any) => handleCommand(name, argv);\n if (description) {\n y.command(nameWithArgs, description, groupedOptions, handler);\n } else {\n y.command(nameWithArgs, false, groupedOptions, handler);\n }\n return y;\n}\n\nasync function handleCommand(name: CommandName, argv: any) {\n const entry = commandRegistry[name];\n\n checkNodeVersion();\n checkStartupLocation(name, entry);\n\n if (setNodeOptions(name, entry)) {\n log.debug('run', `Running ${name} in child process with amended NODE_OPTIONS`);\n execa(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(reason => {\n process.exit(getExitCode(reason));\n });\n return;\n }\n\n const CommandClass = await entry.load();\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const command = new CommandClass({ ...argv, _: argv._.slice(1) });\n\n command.watchForParentExit(name);\n\n command.execute().catch(() => {\n process.exit(1);\n });\n}\n\nfunction checkNodeVersion() {\n const nodeVersion = Number(process.versions.node.split('.')[0]);\n if (nodeVersion % 2 === 0 || process.env.SKIP_NODE_VERSION_CHECK) {\n return;\n }\n\n const { engines } = require(path.join(__dirname, '../../package.json'));\n log.error(\n `error: node v${nodeVersion} detected, only even-numbered LTS versions ${engines.node} are supported`\n );\n log.text('See https://nodejs.org/en/download for LTS versions');\n process.exit(1);\n}\n"],"names":["yargsInstance","yargs","hideBin","process","argv","Object","values","CommandName","reduce","y","name","addCommand","usage","epilogue","chalk","bold","cyan","getStartupVersion","demandCommand","strictCommands","updateStrings","one","red","other","version","wrap","Math","min","terminalWidth","help","parse","entry","commandRegistry","description","options","_","nameWithArgs","groupedOptions","entries","result","key","value","suffix","exec","kebabCase","group","handler","handleCommand","command","checkNodeVersion","checkStartupLocation","setNodeOptions","log","debug","execa","slice","stdio","catch","reason","exit","getExitCode","CommandClass","load","watchForParentExit","execute","nodeVersion","Number","versions","node","split","env","SKIP_NODE_VERSION_CHECK","engines","require","path","join","__dirname","error","text"],"mappings":";;;;8DAAkB;8DACA;wEACI;6DACL;8DACC;yBACM;sBACU;uBACD;0BACD;wBAEkC;;;;;;AAElE,MAAMA,gBAAgBC,IAAAA,cAAK,EAACC,IAAAA,gBAAO,EAACC,QAAQC,IAAI;AAEhDC,OAAOC,MAAM,CAACC,kBAAW,EACpBC,MAAM,CAAC,CAACC,GAAGC,OAASC,WAAWD,MAAMD,IAAIT,eACzCY,KAAK,CAAC,sCACNC,QAAQ,CACLC,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,CAAC,aAAa,EAAEC,IAAAA,uBAAiB,IAAG,EAAE,CAAC,IACnD,CAAC,IAAI,EAAEH,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,4BAA4B,0BAA0B,CAAC,GAC9E,CAAC,gCAAgC,EAAEF,cAAK,CAACC,IAAI,CAACC,IAAI,CAAC,mDAAmD,GAAG,CAAC,EAEjHE,aAAa,CAAC,GAAG,IACjBC,cAAc,GACdC,aAAa,CAAC;IACX,uBAAuB;QACnBC,KAAKP,cAAK,CAACC,IAAI,CAACO,GAAG,CAAC;QACpBC,OAAOT,cAAK,CAACC,IAAI,CAACO,GAAG,CAAC;IAC1B;AACJ,GACCE,OAAO,GACPC,IAAI,CAACC,KAAKC,GAAG,CAAC,KA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