@servicetitan/startup 36.1.2-canary.9 → 36.3.0-far-1776.2
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/get-command.d.ts +4 -0
- package/dist/cli/commands/get-command.d.ts.map +1 -0
- package/dist/cli/commands/get-command.js +68 -0
- package/dist/cli/commands/get-command.js.map +1 -0
- package/dist/cli/commands/index.d.ts +15 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +32 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +5 -1
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/run-task.test.d.ts +2 -0
- package/dist/cli/commands/run-task.test.d.ts.map +1 -0
- package/dist/cli/commands/run-task.test.js +65 -0
- package/dist/cli/commands/run-task.test.js.map +1 -0
- package/dist/cli/utils/check-startup-location.d.ts.map +1 -1
- package/dist/cli/utils/check-startup-location.js +13 -1
- package/dist/cli/utils/check-startup-location.js.map +1 -1
- package/dist/cypress-config/index.d.ts +2 -0
- package/dist/cypress-config/index.d.ts.map +1 -0
- package/dist/cypress-config/index.js +20 -0
- package/dist/cypress-config/index.js.map +1 -0
- package/dist/cypress-config/webpack-config.d.ts +4 -0
- package/dist/cypress-config/webpack-config.d.ts.map +1 -0
- package/dist/cypress-config/webpack-config.js +76 -0
- package/dist/cypress-config/webpack-config.js.map +1 -0
- package/dist/utils/__tests__/get-package-version.test.js +180 -0
- package/dist/utils/__tests__/get-package-version.test.js.map +1 -0
- package/dist/utils/find-package-lock.d.ts +2 -0
- package/dist/utils/find-package-lock.d.ts.map +1 -0
- package/dist/utils/find-package-lock.js +26 -0
- package/dist/utils/find-package-lock.js.map +1 -0
- package/dist/utils/find-up.js +4 -4
- package/dist/utils/find-up.js.map +1 -1
- package/dist/utils/get-package-data.d.ts +0 -1
- package/dist/utils/get-package-data.d.ts.map +1 -1
- package/dist/utils/get-package-data.js +3 -22
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/utils/get-package-version.d.ts +3 -0
- package/dist/utils/get-package-version.d.ts.map +1 -0
- package/dist/utils/get-package-version.js +31 -0
- package/dist/utils/get-package-version.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/package-lock/find-package-lock.d.ts +2 -0
- package/dist/utils/package-lock/find-package-lock.d.ts.map +1 -0
- package/dist/utils/package-lock/find-package-lock.js +26 -0
- package/dist/utils/package-lock/find-package-lock.js.map +1 -0
- package/dist/utils/package-lock/get-lock-file-entry.d.ts +3 -0
- package/dist/utils/package-lock/get-lock-file-entry.d.ts.map +1 -0
- package/dist/utils/package-lock/get-lock-file-entry.js +22 -0
- package/dist/utils/package-lock/get-lock-file-entry.js.map +1 -0
- package/dist/utils/package-lock/get-lock-file-version.d.ts +3 -0
- package/dist/utils/package-lock/get-lock-file-version.d.ts.map +1 -0
- package/dist/utils/package-lock/get-lock-file-version.js +16 -0
- package/dist/utils/package-lock/get-lock-file-version.js.map +1 -0
- package/dist/utils/package-lock/get-package-version.d.ts +3 -0
- package/dist/utils/package-lock/get-package-version.d.ts.map +1 -0
- package/dist/utils/package-lock/get-package-version.js +31 -0
- package/dist/utils/package-lock/get-package-version.js.map +1 -0
- package/dist/utils/package-lock/index.d.ts +6 -0
- package/dist/utils/package-lock/index.d.ts.map +1 -0
- package/dist/utils/package-lock/index.js +23 -0
- package/dist/utils/package-lock/index.js.map +1 -0
- package/dist/utils/package-lock/read-package-lock.d.ts +3 -0
- package/dist/utils/package-lock/read-package-lock.d.ts.map +1 -0
- package/dist/utils/package-lock/read-package-lock.js +22 -0
- package/dist/utils/package-lock/read-package-lock.js.map +1 -0
- package/dist/utils/package-lock/resolve-package-lock-entry.d.ts +3 -0
- package/dist/utils/package-lock/resolve-package-lock-entry.d.ts.map +1 -0
- package/dist/utils/package-lock/resolve-package-lock-entry.js +21 -0
- package/dist/utils/package-lock/resolve-package-lock-entry.js.map +1 -0
- package/dist/utils/package-lock/types.d.ts +12 -0
- package/dist/utils/package-lock/types.d.ts.map +1 -0
- package/dist/utils/package-lock/types.js +6 -0
- package/dist/utils/package-lock/types.js.map +1 -0
- package/dist/utils/package-lock.d.ts +14 -0
- package/dist/utils/package-lock.d.ts.map +1 -0
- package/dist/utils/package-lock.js +63 -0
- package/dist/utils/package-lock.js.map +1 -0
- package/dist/utils/resolve-package-lock-entry.d.ts +11 -0
- package/dist/utils/resolve-package-lock-entry.d.ts.map +1 -0
- package/dist/utils/resolve-package-lock-entry.js +21 -0
- package/dist/utils/resolve-package-lock-entry.js.map +1 -0
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +3 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +1 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +1 -11
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +1 -1
- package/dist/webpack/configs/utils/get-web-components-version.js +5 -7
- package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -1
- package/package.json +8 -8
- package/src/cli/commands/__tests__/mfe-check.test.ts +12 -10
- package/src/cli/commands/mfe-check.ts +5 -1
- package/src/cli/utils/__tests__/check-startup-location.test.ts +38 -5
- package/src/cli/utils/check-startup-location.ts +16 -1
- package/src/utils/__tests__/get-package-data.test.ts +1 -45
- package/src/utils/find-up.ts +1 -1
- package/src/utils/get-package-data.ts +0 -14
- package/src/utils/index.ts +1 -0
- package/src/utils/package-lock/__tests__/find-package-lock.test.ts +35 -0
- package/src/utils/package-lock/__tests__/get-lock-file-entry.test.ts +97 -0
- package/src/utils/package-lock/__tests__/get-lock-file-version.test.ts +32 -0
- package/src/utils/package-lock/__tests__/read-package-lock.test.ts +47 -0
- package/src/utils/package-lock/find-package-lock.ts +10 -0
- package/src/utils/package-lock/get-lock-file-entry.ts +14 -0
- package/src/utils/package-lock/get-lock-file-version.ts +6 -0
- package/src/utils/package-lock/index.ts +5 -0
- package/src/utils/package-lock/read-package-lock.ts +13 -0
- package/src/utils/package-lock/types.ts +13 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +4 -6
- package/src/webpack/__tests__/create-webpack-config.test.ts +3 -5
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +6 -3
- package/src/webpack/configs/utils/__tests__/get-launchdarkly-sdk-version.test.ts +29 -12
- package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +37 -12
- package/src/webpack/configs/utils/get-launchdarkly-sdk-version.ts +2 -12
- package/src/webpack/configs/utils/get-web-components-version.ts +8 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/get-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA+B3C,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAE1E"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getCommand", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getCommand;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _utils = require("../../utils");
|
|
12
|
+
const _build = require("./build");
|
|
13
|
+
const _bundlepackage = require("./bundle-package");
|
|
14
|
+
const _clean = require("./clean");
|
|
15
|
+
const _converteslintconfig = require("./convert-eslint-config");
|
|
16
|
+
const _eslint = require("./eslint");
|
|
17
|
+
const _init = require("./init");
|
|
18
|
+
const _install = require("./install");
|
|
19
|
+
const _kendouilicense = require("./kendo-ui-license");
|
|
20
|
+
const _lint = require("./lint");
|
|
21
|
+
const _mfecheck = require("./mfe-check");
|
|
22
|
+
const _mfegeneratemetadata = require("./mfe-generate-metadata");
|
|
23
|
+
const _mfelist = require("./mfe-list");
|
|
24
|
+
const _mfepackageclean = require("./mfe-package-clean");
|
|
25
|
+
const _mfepackagepublish = require("./mfe-package-publish");
|
|
26
|
+
const _mfepackagerollback = require("./mfe-package-rollback");
|
|
27
|
+
const _mfepublish = require("./mfe-publish");
|
|
28
|
+
const _mfepurgecache = require("./mfe-purge-cache");
|
|
29
|
+
const _preparepackage = require("./prepare-package");
|
|
30
|
+
const _review = require("./review");
|
|
31
|
+
const _runtask = require("./run-task");
|
|
32
|
+
const _start = require("./start");
|
|
33
|
+
const _stylelint = require("./stylelint");
|
|
34
|
+
const _stylescheck = require("./styles-check");
|
|
35
|
+
const _test = require("./test");
|
|
36
|
+
const _uploadsourcemaps = require("./upload-sourcemaps");
|
|
37
|
+
const commands = {
|
|
38
|
+
[_utils.CommandName.build]: _build.Build,
|
|
39
|
+
[_utils.CommandName['bundle-package']]: _bundlepackage.BundlePackage,
|
|
40
|
+
[_utils.CommandName['convert-eslint-config']]: _converteslintconfig.ConvertEslintConfig,
|
|
41
|
+
[_utils.CommandName.clean]: _clean.Clean,
|
|
42
|
+
[_utils.CommandName.eslint]: _eslint.ESLintCommand,
|
|
43
|
+
[_utils.CommandName.init]: _init.Init,
|
|
44
|
+
[_utils.CommandName.install]: _install.Install,
|
|
45
|
+
[_utils.CommandName['kendo-ui-license']]: _kendouilicense.KendoUILicense,
|
|
46
|
+
[_utils.CommandName.lint]: _lint.Lint,
|
|
47
|
+
[_utils.CommandName['mfe-check']]: _mfecheck.MfeCheck,
|
|
48
|
+
[_utils.CommandName['mfe-generate-metadata']]: _mfegeneratemetadata.MfeGenerateMetadata,
|
|
49
|
+
[_utils.CommandName['mfe-list']]: _mfelist.MFEList,
|
|
50
|
+
[_utils.CommandName['mfe-package-clean']]: _mfepackageclean.MFEPackageClean,
|
|
51
|
+
[_utils.CommandName['mfe-package-publish']]: _mfepackagepublish.MFEPackagePublish,
|
|
52
|
+
[_utils.CommandName['mfe-package-rollback']]: _mfepackagerollback.MFEPackageRollback,
|
|
53
|
+
[_utils.CommandName['mfe-publish']]: _mfepublish.MFEPublish,
|
|
54
|
+
[_utils.CommandName['mfe-purge-cache']]: _mfepurgecache.MFEPurgeCache,
|
|
55
|
+
[_utils.CommandName['prepare-package']]: _preparepackage.PreparePackage,
|
|
56
|
+
[_utils.CommandName.review]: _review.Review,
|
|
57
|
+
[_utils.CommandName.start]: _start.Start,
|
|
58
|
+
[_utils.CommandName.stylelint]: _stylelint.Stylelint,
|
|
59
|
+
[_utils.CommandName['styles-check']]: _stylescheck.StylesCheck,
|
|
60
|
+
[_utils.CommandName.test]: _test.Tests,
|
|
61
|
+
[_utils.CommandName.task]: _runtask.RunTask,
|
|
62
|
+
[_utils.CommandName['upload-sourcemaps']]: _uploadsourcemaps.UploadSourcemaps
|
|
63
|
+
};
|
|
64
|
+
function getCommand(name) {
|
|
65
|
+
return commands[name];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=get-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/get-command.ts"],"sourcesContent":["import { CommandName } from '../../utils';\nimport { Build } from './build';\nimport { BundlePackage } from './bundle-package';\nimport { Clean } from './clean';\nimport { ConvertEslintConfig } from './convert-eslint-config';\nimport { ESLintCommand } from './eslint';\nimport { Init } from './init';\nimport { Install } from './install';\nimport { KendoUILicense } from './kendo-ui-license';\nimport { Lint } from './lint';\nimport { MfeCheck } from './mfe-check';\nimport { MfeGenerateMetadata } from './mfe-generate-metadata';\nimport { MFEList } from './mfe-list';\nimport { MFEPackageClean } from './mfe-package-clean';\nimport { MFEPackagePublish } from './mfe-package-publish';\nimport { MFEPackageRollback } from './mfe-package-rollback';\nimport { MFEPublish } from './mfe-publish';\nimport { MFEPurgeCache } from './mfe-purge-cache';\nimport { PreparePackage } from './prepare-package';\nimport { Review } from './review';\nimport { RunTask } from './run-task';\nimport { Start } from './start';\nimport { Stylelint } from './stylelint';\nimport { StylesCheck } from './styles-check';\nimport { Tests } from './test';\nimport { Command, Newable } from './types';\nimport { UploadSourcemaps } from './upload-sourcemaps';\n\nconst commands: Record<CommandName, Newable<Command>> = {\n [CommandName.build]: Build,\n [CommandName['bundle-package']]: BundlePackage,\n [CommandName['convert-eslint-config']]: ConvertEslintConfig,\n [CommandName.clean]: Clean,\n [CommandName.eslint]: ESLintCommand,\n [CommandName.init]: Init,\n [CommandName.install]: Install,\n [CommandName['kendo-ui-license']]: KendoUILicense,\n [CommandName.lint]: Lint,\n [CommandName['mfe-check']]: MfeCheck,\n [CommandName['mfe-generate-metadata']]: MfeGenerateMetadata,\n [CommandName['mfe-list']]: MFEList,\n [CommandName['mfe-package-clean']]: MFEPackageClean,\n [CommandName['mfe-package-publish']]: MFEPackagePublish,\n [CommandName['mfe-package-rollback']]: MFEPackageRollback,\n [CommandName['mfe-publish']]: MFEPublish,\n [CommandName['mfe-purge-cache']]: MFEPurgeCache,\n [CommandName['prepare-package']]: PreparePackage,\n [CommandName.review]: Review,\n [CommandName.start]: Start,\n [CommandName.stylelint]: Stylelint,\n [CommandName['styles-check']]: StylesCheck,\n [CommandName.test]: Tests,\n [CommandName.task]: RunTask,\n [CommandName['upload-sourcemaps']]: UploadSourcemaps,\n};\n\nexport function getCommand(name: CommandName): Newable<Command> | undefined {\n return commands[name];\n}\n"],"names":["getCommand","commands","CommandName","build","Build","BundlePackage","ConvertEslintConfig","clean","Clean","eslint","ESLintCommand","init","Init","install","Install","KendoUILicense","lint","Lint","MfeCheck","MfeGenerateMetadata","MFEList","MFEPackageClean","MFEPackagePublish","MFEPackageRollback","MFEPublish","MFEPurgeCache","PreparePackage","review","Review","start","Start","stylelint","Stylelint","StylesCheck","test","Tests","task","RunTask","UploadSourcemaps","name"],"mappings":";;;;+BAwDgBA;;;eAAAA;;;uBAxDY;uBACN;+BACQ;uBACR;qCACc;wBACN;sBACT;yBACG;gCACO;sBACV;0BACI;qCACW;yBACZ;iCACQ;mCACE;oCACC;4BACR;+BACG;gCACC;wBACR;yBACC;uBACF;2BACI;6BACE;sBACN;kCAEW;AAEjC,MAAMC,WAAkD;IACpD,CAACC,kBAAW,CAACC,KAAK,CAAC,EAAEC,YAAK;IAC1B,CAACF,kBAAW,CAAC,iBAAiB,CAAC,EAAEG,4BAAa;IAC9C,CAACH,kBAAW,CAAC,wBAAwB,CAAC,EAAEI,wCAAmB;IAC3D,CAACJ,kBAAW,CAACK,KAAK,CAAC,EAAEC,YAAK;IAC1B,CAACN,kBAAW,CAACO,MAAM,CAAC,EAAEC,qBAAa;IACnC,CAACR,kBAAW,CAACS,IAAI,CAAC,EAAEC,UAAI;IACxB,CAACV,kBAAW,CAACW,OAAO,CAAC,EAAEC,gBAAO;IAC9B,CAACZ,kBAAW,CAAC,mBAAmB,CAAC,EAAEa,8BAAc;IACjD,CAACb,kBAAW,CAACc,IAAI,CAAC,EAAEC,UAAI;IACxB,CAACf,kBAAW,CAAC,YAAY,CAAC,EAAEgB,kBAAQ;IACpC,CAAChB,kBAAW,CAAC,wBAAwB,CAAC,EAAEiB,wCAAmB;IAC3D,CAACjB,kBAAW,CAAC,WAAW,CAAC,EAAEkB,gBAAO;IAClC,CAAClB,kBAAW,CAAC,oBAAoB,CAAC,EAAEmB,gCAAe;IACnD,CAACnB,kBAAW,CAAC,sBAAsB,CAAC,EAAEoB,oCAAiB;IACvD,CAACpB,kBAAW,CAAC,uBAAuB,CAAC,EAAEqB,sCAAkB;IACzD,CAACrB,kBAAW,CAAC,cAAc,CAAC,EAAEsB,sBAAU;IACxC,CAACtB,kBAAW,CAAC,kBAAkB,CAAC,EAAEuB,4BAAa;IAC/C,CAACvB,kBAAW,CAAC,kBAAkB,CAAC,EAAEwB,8BAAc;IAChD,CAACxB,kBAAW,CAACyB,MAAM,CAAC,EAAEC,cAAM;IAC5B,CAAC1B,kBAAW,CAAC2B,KAAK,CAAC,EAAEC,YAAK;IAC1B,CAAC5B,kBAAW,CAAC6B,SAAS,CAAC,EAAEC,oBAAS;IAClC,CAAC9B,kBAAW,CAAC,eAAe,CAAC,EAAE+B,wBAAW;IAC1C,CAAC/B,kBAAW,CAACgC,IAAI,CAAC,EAAEC,WAAK;IACzB,CAACjC,kBAAW,CAACkC,IAAI,CAAC,EAAEC,gBAAO;IAC3B,CAACnC,kBAAW,CAAC,oBAAoB,CAAC,EAAEoC,kCAAgB;AACxD;AAEO,SAAStC,WAAWuC,IAAiB;IACxC,OAAOtC,QAAQ,CAACsC,KAAK;AACzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './build';
|
|
2
|
+
export * from './bundle-package';
|
|
3
|
+
export * from './eslint';
|
|
4
|
+
export * from './get-command';
|
|
5
|
+
export * from './init';
|
|
6
|
+
export * from './install';
|
|
7
|
+
export * from './kendo-ui-license';
|
|
8
|
+
export * from './lint';
|
|
9
|
+
export * from './mfe-publish';
|
|
10
|
+
export * from './prepare-package';
|
|
11
|
+
export * from './start';
|
|
12
|
+
export * from './styles-check';
|
|
13
|
+
export * from './test';
|
|
14
|
+
export type * from './types';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./build"), exports);
|
|
6
|
+
_export_star(require("./bundle-package"), exports);
|
|
7
|
+
_export_star(require("./eslint"), exports);
|
|
8
|
+
_export_star(require("./get-command"), exports);
|
|
9
|
+
_export_star(require("./init"), exports);
|
|
10
|
+
_export_star(require("./install"), exports);
|
|
11
|
+
_export_star(require("./kendo-ui-license"), exports);
|
|
12
|
+
_export_star(require("./lint"), exports);
|
|
13
|
+
_export_star(require("./mfe-publish"), exports);
|
|
14
|
+
_export_star(require("./prepare-package"), exports);
|
|
15
|
+
_export_star(require("./start"), exports);
|
|
16
|
+
_export_star(require("./styles-check"), exports);
|
|
17
|
+
_export_star(require("./test"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/index.ts"],"sourcesContent":["export * from './build';\nexport * from './bundle-package';\nexport * from './eslint';\nexport * from './get-command';\nexport * from './init';\nexport * from './install';\nexport * from './kendo-ui-license';\nexport * from './lint';\nexport * from './mfe-publish';\nexport * from './prepare-package';\nexport * from './start';\nexport * from './styles-check';\nexport * from './test';\nexport type * from './types';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mfe-check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mfe-check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mfe-check.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAuBlC,qBAAa,QAAS,SAAQ,OAAO,CAAC,OAAO,KAAK,CAAC;IAEzC,OAAO;IAoBb,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,kBAAkB;IAoC1B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;CA2B9B"}
|
|
@@ -58,7 +58,11 @@ class MfeCheck extends _types.Command {
|
|
|
58
58
|
var _hostData_cli_webpack, _hostData_cli, _hostData_cli_webpack1, _hostData_cli1;
|
|
59
59
|
const mfeSharedDependencies = mfeMetadata.sharedDependencies;
|
|
60
60
|
const hostSharedDependencies = (0, _utils.loadSharedDependencies)(hostData.dependencies, (_hostData_cli = hostData.cli) === null || _hostData_cli === void 0 ? void 0 : (_hostData_cli_webpack = _hostData_cli.webpack) === null || _hostData_cli_webpack === void 0 ? void 0 : _hostData_cli_webpack['shared-dependencies']);
|
|
61
|
-
const
|
|
61
|
+
const lockFile = (0, _utils.readPackageLock)();
|
|
62
|
+
const exposedDependencies = (0, _utils1.getExposedDependencies)(hostSharedDependencies, (dependency)=>{
|
|
63
|
+
var _getLockFileVersion;
|
|
64
|
+
return (_getLockFileVersion = (0, _utils.getLockFileVersion)(lockFile, dependency)) !== null && _getLockFileVersion !== void 0 ? _getLockFileVersion : hostData.dependencies[dependency];
|
|
65
|
+
});
|
|
62
66
|
const mismatchResult = (0, _startuputils.getVersionMismatches)(exposedDependencies, mfeMetadata.dependencies, mfeSharedDependencies);
|
|
63
67
|
const isHostMfe = (0, _utils.isWebComponent)(hostData);
|
|
64
68
|
const isSharedDependenciesEnabled = ((_hostData_cli1 = hostData.cli) === null || _hostData_cli1 === void 0 ? void 0 : (_hostData_cli_webpack1 = _hostData_cli1.webpack) === null || _hostData_cli_webpack1 === void 0 ? void 0 : _hostData_cli_webpack1['expose-shared-dependencies']) === true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/mfe-check.ts"],"sourcesContent":["import { getVersionMismatches } from '@servicetitan/startup-utils';\nimport path from 'node:path';\nimport {\n isWebComponent,\n loadSharedDependencies,\n log,\n logErrors,\n readJson,\n toArray,\n} from '../../utils';\nimport { Metadata } from '../../webpack/configs/types';\nimport { getExposedDependencies } from '../../webpack/configs/utils';\nimport type { entry } from './registry/mfe-check';\nimport { Command } from './types';\n\ninterface HostPackageJSON {\n name: string;\n dependencies: Record<string, string>;\n cli?: {\n 'web-component'?: boolean | string | object;\n 'webpack'?: {\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n };\n };\n}\n\ninterface CompatibilityResult {\n name: string;\n compatible: boolean;\n bundleType: 'light' | 'full';\n mismatches?: Record<string, { host: string; package: string }>;\n isSharedDependenciesEnabled: boolean;\n isHostMfe: boolean;\n}\n\nexport class MfeCheck extends Command<typeof entry> {\n @logErrors\n async execute() {\n const { metadata: metadataPath, hostPackageJson, json } = this.args;\n const mfeMetadata = readJson<Metadata>(path.resolve(metadataPath));\n const hostPackageJsonPaths = toArray(hostPackageJson);\n const hostData = this.getHostPackageData(hostPackageJsonPaths);\n const result = this.checkCompatibility(mfeMetadata, hostData);\n\n if (json) {\n this.outputJson(result);\n } else {\n this.outputHumanReadable(result);\n }\n\n if (!result.compatible) {\n process.exitCode = 1;\n }\n\n return Promise.resolve();\n }\n\n private getHostPackageData(packageJsonPaths: string[]): HostPackageJSON {\n const packages = packageJsonPaths.map(packageJsonPath =>\n readJson<HostPackageJSON>(path.resolve(packageJsonPath))\n );\n const mergedDependencies = packages.reduceRight<HostPackageJSON['dependencies']>(\n (result, currentPackage) => Object.assign(result, currentPackage.dependencies),\n {}\n );\n const mainPackage = packages[0];\n\n return {\n name: mainPackage.name,\n cli: mainPackage.cli,\n dependencies: mergedDependencies,\n };\n }\n\n private checkCompatibility(\n mfeMetadata: Metadata,\n hostData: HostPackageJSON\n ): CompatibilityResult {\n const mfeSharedDependencies = mfeMetadata.sharedDependencies;\n const hostSharedDependencies = loadSharedDependencies(\n hostData.dependencies,\n hostData.cli?.webpack?.['shared-dependencies']\n );\n const exposedDependencies = getExposedDependencies(\n hostSharedDependencies,\n hostData.dependencies\n );\n const mismatchResult = getVersionMismatches(\n exposedDependencies,\n mfeMetadata.dependencies,\n mfeSharedDependencies\n );\n\n const isHostMfe = isWebComponent(hostData);\n const isSharedDependenciesEnabled =\n hostData.cli?.webpack?.['expose-shared-dependencies'] === true;\n const compatible = !isHostMfe && !mismatchResult && isSharedDependenciesEnabled;\n\n return {\n name: mfeMetadata.name,\n compatible,\n bundleType: compatible ? 'light' : 'full',\n isSharedDependenciesEnabled,\n isHostMfe,\n ...(mismatchResult ? { mismatches: mismatchResult } : {}),\n };\n }\n\n private outputJson(result: CompatibilityResult) {\n process.stdout.write(JSON.stringify(result, null, 2) + '\\n');\n }\n\n private outputHumanReadable(result: CompatibilityResult) {\n log.info(`Checking ${result.name}...`);\n\n if (result.isHostMfe) {\n log.error('Skipping compatibility check because host is an MFE');\n return;\n }\n\n if (result.compatible) {\n log.info('Compatible: light bundle can be used');\n return;\n }\n\n if (result.mismatches) {\n log.error('Dependency mismatch found:');\n\n for (const [dep, versions] of Object.entries(result.mismatches)) {\n log.error(` ${dep}: host=${versions.host}, package=${versions.package}`);\n }\n }\n\n if (!result.isSharedDependenciesEnabled) {\n log.error('expose-shared-dependencies is not enabled in host package.json');\n }\n\n log.error('Result: full bundle required');\n }\n}\n"],"names":["MfeCheck","Command","execute","metadata","metadataPath","hostPackageJson","json","args","mfeMetadata","readJson","path","resolve","hostPackageJsonPaths","toArray","hostData","getHostPackageData","result","checkCompatibility","outputJson","outputHumanReadable","compatible","process","exitCode","Promise","packageJsonPaths","packages","map","packageJsonPath","mergedDependencies","reduceRight","currentPackage","Object","assign","dependencies","mainPackage","name","cli","mfeSharedDependencies","sharedDependencies","hostSharedDependencies","loadSharedDependencies","webpack","exposedDependencies","getExposedDependencies","mismatchResult","getVersionMismatches","isHostMfe","isWebComponent","isSharedDependenciesEnabled","bundleType","mismatches","stdout","write","JSON","stringify","log","info","error","dep","versions","entries","host","package"],"mappings":";;;;+
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/mfe-check.ts"],"sourcesContent":["import { getVersionMismatches } from '@servicetitan/startup-utils';\nimport path from 'node:path';\nimport {\n getLockFileVersion,\n isWebComponent,\n loadSharedDependencies,\n log,\n logErrors,\n readJson,\n readPackageLock,\n toArray,\n} from '../../utils';\nimport { Metadata } from '../../webpack/configs/types';\nimport { getExposedDependencies } from '../../webpack/configs/utils';\nimport type { entry } from './registry/mfe-check';\nimport { Command } from './types';\n\ninterface HostPackageJSON {\n name: string;\n dependencies: Record<string, string>;\n cli?: {\n 'web-component'?: boolean | string | object;\n 'webpack'?: {\n 'expose-shared-dependencies'?: boolean;\n 'shared-dependencies'?: Record<string, string>;\n };\n };\n}\n\ninterface CompatibilityResult {\n name: string;\n compatible: boolean;\n bundleType: 'light' | 'full';\n mismatches?: Record<string, { host: string; package: string }>;\n isSharedDependenciesEnabled: boolean;\n isHostMfe: boolean;\n}\n\nexport class MfeCheck extends Command<typeof entry> {\n @logErrors\n async execute() {\n const { metadata: metadataPath, hostPackageJson, json } = this.args;\n const mfeMetadata = readJson<Metadata>(path.resolve(metadataPath));\n const hostPackageJsonPaths = toArray(hostPackageJson);\n const hostData = this.getHostPackageData(hostPackageJsonPaths);\n const result = this.checkCompatibility(mfeMetadata, hostData);\n\n if (json) {\n this.outputJson(result);\n } else {\n this.outputHumanReadable(result);\n }\n\n if (!result.compatible) {\n process.exitCode = 1;\n }\n\n return Promise.resolve();\n }\n\n private getHostPackageData(packageJsonPaths: string[]): HostPackageJSON {\n const packages = packageJsonPaths.map(packageJsonPath =>\n readJson<HostPackageJSON>(path.resolve(packageJsonPath))\n );\n const mergedDependencies = packages.reduceRight<HostPackageJSON['dependencies']>(\n (result, currentPackage) => Object.assign(result, currentPackage.dependencies),\n {}\n );\n const mainPackage = packages[0];\n\n return {\n name: mainPackage.name,\n cli: mainPackage.cli,\n dependencies: mergedDependencies,\n };\n }\n\n private checkCompatibility(\n mfeMetadata: Metadata,\n hostData: HostPackageJSON\n ): CompatibilityResult {\n const mfeSharedDependencies = mfeMetadata.sharedDependencies;\n const hostSharedDependencies = loadSharedDependencies(\n hostData.dependencies,\n hostData.cli?.webpack?.['shared-dependencies']\n );\n const lockFile = readPackageLock();\n const exposedDependencies = getExposedDependencies(\n hostSharedDependencies,\n dependency =>\n getLockFileVersion(lockFile, dependency) ?? hostData.dependencies[dependency]\n );\n const mismatchResult = getVersionMismatches(\n exposedDependencies,\n mfeMetadata.dependencies,\n mfeSharedDependencies\n );\n\n const isHostMfe = isWebComponent(hostData);\n const isSharedDependenciesEnabled =\n hostData.cli?.webpack?.['expose-shared-dependencies'] === true;\n const compatible = !isHostMfe && !mismatchResult && isSharedDependenciesEnabled;\n\n return {\n name: mfeMetadata.name,\n compatible,\n bundleType: compatible ? 'light' : 'full',\n isSharedDependenciesEnabled,\n isHostMfe,\n ...(mismatchResult ? { mismatches: mismatchResult } : {}),\n };\n }\n\n private outputJson(result: CompatibilityResult) {\n process.stdout.write(JSON.stringify(result, null, 2) + '\\n');\n }\n\n private outputHumanReadable(result: CompatibilityResult) {\n log.info(`Checking ${result.name}...`);\n\n if (result.isHostMfe) {\n log.error('Skipping compatibility check because host is an MFE');\n return;\n }\n\n if (result.compatible) {\n log.info('Compatible: light bundle can be used');\n return;\n }\n\n if (result.mismatches) {\n log.error('Dependency mismatch found:');\n\n for (const [dep, versions] of Object.entries(result.mismatches)) {\n log.error(` ${dep}: host=${versions.host}, package=${versions.package}`);\n }\n }\n\n if (!result.isSharedDependenciesEnabled) {\n log.error('expose-shared-dependencies is not enabled in host package.json');\n }\n\n log.error('Result: full bundle required');\n }\n}\n"],"names":["MfeCheck","Command","execute","metadata","metadataPath","hostPackageJson","json","args","mfeMetadata","readJson","path","resolve","hostPackageJsonPaths","toArray","hostData","getHostPackageData","result","checkCompatibility","outputJson","outputHumanReadable","compatible","process","exitCode","Promise","packageJsonPaths","packages","map","packageJsonPath","mergedDependencies","reduceRight","currentPackage","Object","assign","dependencies","mainPackage","name","cli","mfeSharedDependencies","sharedDependencies","hostSharedDependencies","loadSharedDependencies","webpack","lockFile","readPackageLock","exposedDependencies","getExposedDependencies","dependency","getLockFileVersion","mismatchResult","getVersionMismatches","isHostMfe","isWebComponent","isSharedDependenciesEnabled","bundleType","mismatches","stdout","write","JSON","stringify","log","info","error","dep","versions","entries","host","package"],"mappings":";;;;+BAsCaA;;;eAAAA;;;8BAtCwB;iEACpB;uBAUV;wBAEgC;uBAEf;;;;;;;;;;;;;;;AAuBjB,MAAMA,iBAAiBC,cAAO;IACjC,MACMC,UAAU;QACZ,MAAM,EAAEC,UAAUC,YAAY,EAAEC,eAAe,EAAEC,IAAI,EAAE,GAAG,IAAI,CAACC,IAAI;QACnE,MAAMC,cAAcC,IAAAA,eAAQ,EAAWC,iBAAI,CAACC,OAAO,CAACP;QACpD,MAAMQ,uBAAuBC,IAAAA,cAAO,EAACR;QACrC,MAAMS,WAAW,IAAI,CAACC,kBAAkB,CAACH;QACzC,MAAMI,SAA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Root":"","sources":["../../../src/cli/commands/run-task.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _utils = require("../../utils");
|
|
6
|
+
const _tasks = require("../tasks");
|
|
7
|
+
const _runtask = require("./run-task");
|
|
8
|
+
jest.mock('../../utils', ()=>({
|
|
9
|
+
...jest.requireActual('../../utils'),
|
|
10
|
+
log: {
|
|
11
|
+
error: jest.fn(),
|
|
12
|
+
text: jest.fn()
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
jest.mock('../tasks/swc-compile-package');
|
|
16
|
+
jest.mock('../tasks/tsc-compile');
|
|
17
|
+
jest.mock('../tasks/tsc-compile-package');
|
|
18
|
+
describe(`[startup] ${_runtask.RunTask.name}`, ()=>{
|
|
19
|
+
let args;
|
|
20
|
+
beforeEach(()=>{
|
|
21
|
+
jest.clearAllMocks();
|
|
22
|
+
});
|
|
23
|
+
const subject = ()=>new _runtask.RunTask(args).execute();
|
|
24
|
+
const supportedTasks = {
|
|
25
|
+
'tsc-compile-package': _tasks.TscCompilePackage,
|
|
26
|
+
'swc-compile-package': _tasks.SwcCompilePackage,
|
|
27
|
+
'tsc-compile': _tasks.TscCompile
|
|
28
|
+
};
|
|
29
|
+
Object.entries(supportedTasks).forEach(([name, task])=>describe(`with ${name}`, ()=>{
|
|
30
|
+
beforeEach(()=>args = {
|
|
31
|
+
_: [
|
|
32
|
+
name
|
|
33
|
+
]
|
|
34
|
+
}); // eslint-disable-line @typescript-eslint/naming-convention
|
|
35
|
+
test(`runs ${task.name}`, async ()=>{
|
|
36
|
+
await subject();
|
|
37
|
+
expect(jest.mocked(task).mock.instances[0].execute).toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
}));
|
|
40
|
+
describe('with empty args', ()=>{
|
|
41
|
+
beforeEach(()=>args = {});
|
|
42
|
+
test('logs error for undefined task', async ()=>{
|
|
43
|
+
await subject();
|
|
44
|
+
expect(_utils.log.error).toHaveBeenCalledWith('Unknown task: "undefined"');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('with unrecognized task', ()=>{
|
|
48
|
+
beforeEach(()=>args = {
|
|
49
|
+
_: [
|
|
50
|
+
'foo'
|
|
51
|
+
]
|
|
52
|
+
}); // eslint-disable-line @typescript-eslint/naming-convention
|
|
53
|
+
test('logs error', async ()=>{
|
|
54
|
+
var _args__;
|
|
55
|
+
await subject();
|
|
56
|
+
expect(_utils.log.error).toHaveBeenCalledWith(`Unknown task: "${(_args__ = args._) === null || _args__ === void 0 ? void 0 : _args__[0]}"`);
|
|
57
|
+
});
|
|
58
|
+
test('lists supported tasks', async ()=>{
|
|
59
|
+
await subject();
|
|
60
|
+
expect(_utils.log.text).toHaveBeenCalledWith(`\nSupported tasks: "${Object.keys(supportedTasks).join('", "')}"`);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=run-task.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/run-task.test.ts"],"sourcesContent":["import { log } from '../../utils';\nimport { SwcCompilePackage, TscCompile, TscCompilePackage } from '../tasks';\nimport { RunTask } from './run-task';\n\njest.mock('../../utils', () => ({\n ...jest.requireActual('../../utils'),\n log: { error: jest.fn(), text: jest.fn() },\n}));\njest.mock('../tasks/swc-compile-package');\njest.mock('../tasks/tsc-compile');\njest.mock('../tasks/tsc-compile-package');\n\ndescribe(`[startup] ${RunTask.name}`, () => {\n let args: ConstructorParameters<typeof RunTask>[0];\n\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n const subject = () => new RunTask(args).execute();\n\n const supportedTasks = {\n 'tsc-compile-package': TscCompilePackage,\n 'swc-compile-package': SwcCompilePackage,\n 'tsc-compile': TscCompile,\n };\n\n Object.entries(supportedTasks).forEach(([name, task]) =>\n describe(`with ${name}`, () => {\n beforeEach(() => (args = { _: [name] })); // eslint-disable-line @typescript-eslint/naming-convention\n\n test(`runs ${task.name}`, async () => {\n await subject();\n\n expect(jest.mocked(task).mock.instances[0].execute).toHaveBeenCalled();\n });\n })\n );\n\n describe('with empty args', () => {\n beforeEach(() => (args = {}));\n\n test('logs error for undefined task', async () => {\n await subject();\n\n expect(log.error).toHaveBeenCalledWith('Unknown task: \"undefined\"');\n });\n });\n\n describe('with unrecognized task', () => {\n beforeEach(() => (args = { _: ['foo'] })); // eslint-disable-line @typescript-eslint/naming-convention\n\n test('logs error', async () => {\n await subject();\n\n expect(log.error).toHaveBeenCalledWith(`Unknown task: \"${args._?.[0]}\"`);\n });\n\n test('lists supported tasks', async () => {\n await subject();\n\n expect(log.text).toHaveBeenCalledWith(\n `\\nSupported tasks: \"${Object.keys(supportedTasks).join('\", \"')}\"`\n );\n });\n });\n});\n"],"names":["jest","mock","requireActual","log","error","fn","text","describe","RunTask","name","args","beforeEach","clearAllMocks","subject","execute","supportedTasks","TscCompilePackage","SwcCompilePackage","TscCompile","Object","entries","forEach","task","_","test","expect","mocked","instances","toHaveBeenCalled","toHaveBeenCalledWith","keys","join"],"mappings":";;;;uBAAoB;uBAC6C;yBACzC;AAExBA,KAAKC,IAAI,CAAC,eAAe,IAAO,CAAA;QAC5B,GAAGD,KAAKE,aAAa,CAAC,cAAc;QACpCC,KAAK;YAAEC,OAAOJ,KAAKK,EAAE;YAAIC,MAAMN,KAAKK,EAAE;QAAG;IAC7C,CAAA;AACAL,KAAKC,IAAI,CAAC;AACVD,KAAKC,IAAI,CAAC;AACVD,KAAKC,IAAI,CAAC;AAEVM,SAAS,CAAC,UAAU,EAAEC,gBAAO,CAACC,IAAI,EAAE,EAAE;IAClC,IAAIC;IAEJC,WAAW;QACPX,KAAKY,aAAa;IACtB;IAEA,MAAMC,UAAU,IAAM,IAAIL,gBAAO,CAACE,MAAMI,OAAO;IAE/C,MAAMC,iBA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],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAO,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,wBAAgB,oBAAoB,CAChC,WAAW,EAAE,WAAW,EACxB,EAAE,kBAAkB,EAAE,GAAE,YAAiB,
|
|
1
|
+
{"version":3,"file":"check-startup-location.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/check-startup-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAO,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,wBAAgB,oBAAoB,CAChC,WAAW,EAAE,WAAW,EACxB,EAAE,kBAAkB,EAAE,GAAE,YAAiB,QA+B5C"}
|
|
@@ -11,10 +11,22 @@ Object.defineProperty(exports, "checkStartupLocation", {
|
|
|
11
11
|
const _utils = require("../../utils");
|
|
12
12
|
const _clinpm = require("./cli-npm");
|
|
13
13
|
function checkStartupLocation(commandName, { allowRunFromGlobal } = {}) {
|
|
14
|
-
if (
|
|
14
|
+
if (process.env.SKIP_STARTUP_LOCATION_CHECK) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
const projectRoot = (0, _clinpm.npmGetProjectRoot)();
|
|
18
|
+
/*
|
|
19
|
+
* Set nx's workspace root so lerna/nx don't walk past a worktree into the
|
|
20
|
+
* main repo. nx walks ancestors looking for node_modules/nx and picks the
|
|
21
|
+
* highest match, which lands on the main repo when the worktree was
|
|
22
|
+
* created inside it. See FAR-1803.
|
|
23
|
+
*/ if (projectRoot) {
|
|
24
|
+
var _process_env, _NX_WORKSPACE_ROOT_PATH;
|
|
25
|
+
(_NX_WORKSPACE_ROOT_PATH = (_process_env = process.env).NX_WORKSPACE_ROOT_PATH) !== null && _NX_WORKSPACE_ROOT_PATH !== void 0 ? _NX_WORKSPACE_ROOT_PATH : _process_env.NX_WORKSPACE_ROOT_PATH = projectRoot;
|
|
26
|
+
}
|
|
27
|
+
if (allowRunFromGlobal) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
18
30
|
if (projectRoot && __dirname.startsWith(projectRoot)) {
|
|
19
31
|
process.env.SKIP_STARTUP_LOCATION_CHECK = 'true';
|
|
20
32
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/utils/check-startup-location.ts"],"sourcesContent":["import { CommandName, log } from '../../utils';\nimport { CommandEntry } from '../commands/types';\nimport { npmGetProjectRoot } from './cli-npm';\n\nexport function checkStartupLocation(\n commandName: CommandName,\n { allowRunFromGlobal }: CommandEntry = {}\n) {\n if (
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/utils/check-startup-location.ts"],"sourcesContent":["import { CommandName, log } from '../../utils';\nimport { CommandEntry } from '../commands/types';\nimport { npmGetProjectRoot } from './cli-npm';\n\nexport function checkStartupLocation(\n commandName: CommandName,\n { allowRunFromGlobal }: CommandEntry = {}\n) {\n if (process.env.SKIP_STARTUP_LOCATION_CHECK) {\n return;\n }\n\n const projectRoot = npmGetProjectRoot();\n\n /*\n * Set nx's workspace root so lerna/nx don't walk past a worktree into the\n * main repo. nx walks ancestors looking for node_modules/nx and picks the\n * highest match, which lands on the main repo when the worktree was\n * created inside it. See FAR-1803.\n */\n if (projectRoot) {\n process.env.NX_WORKSPACE_ROOT_PATH ??= projectRoot;\n }\n\n if (allowRunFromGlobal) {\n return;\n }\n\n if (projectRoot && __dirname.startsWith(projectRoot)) {\n process.env.SKIP_STARTUP_LOCATION_CHECK = 'true';\n return;\n }\n\n log.error(\n `Error: ${commandName} must be run from the local @servicetitan/startup installation`\n );\n process.exit(1);\n}\n"],"names":["checkStartupLocation","commandName","allowRunFromGlobal","process","env","SKIP_STARTUP_LOCATION_CHECK","projectRoot","npmGetProjectRoot","NX_WORKSPACE_ROOT_PATH","__dirname","startsWith","log","error","exit"],"mappings":";;;;+BAIgBA;;;eAAAA;;;uBAJiB;wBAEC;AAE3B,SAASA,qBACZC,WAAwB,EACxB,EAAEC,kBAAkB,EAAgB,GAAG,CAAC,CAAC;IAEzC,IAAIC,QAAQC,GAAG,CAACC,2BAA2B,EAAE;QACzC;IACJ;IAEA,MAAMC,cAAcC,IAAAA,yBAAiB;IAErC;;;;;KAKC,GACD,IAAID,aAAa;YACbH,cAAAA;SAAAA,0BAAAA,CAAAA,eAAAA,QAAQC,GAAG,EAACI,sBAAsB,cAAlCL,qCAAAA,0BAAAA,aAAYK,sBAAsB,GAAKF;IAC3C;IAEA,IAAIJ,oBAAoB;QACpB;IACJ;IAEA,IAAII,eAAeG,UAAUC,UAAU,CAACJ,cAAc;QAClDH,QAAQC,GAAG,CAACC,2BAA2B,GAAG;QAC1C;IACJ;IAEAM,UAAG,CAACC,KAAK,CACL,CAAC,OAAO,EAAEX,YAAY,8DAA8D,CAAC;IAEzFE,QAAQU,IAAI,CAAC;AACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cypress-config/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./webpack-config"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return from;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cypress-config/index.ts"],"sourcesContent":["export * from './webpack-config';\n"],"names":[],"mappings":";;;;qBAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack-config.d.ts","sourceRoot":"","sources":["../../src/cypress-config/webpack-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,OAAO,EAAW,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAErE,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAiBlE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "webpackConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return webpackConfig;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _nodeutil = require("node:util");
|
|
12
|
+
const _webpackmerge = /*#__PURE__*/ _interop_require_default(require("webpack-merge"));
|
|
13
|
+
const _tasks = require("../cli/tasks");
|
|
14
|
+
const _utils = require("../cli/utils");
|
|
15
|
+
const _utils1 = require("../utils");
|
|
16
|
+
const _configs = require("../webpack/configs");
|
|
17
|
+
function _interop_require_default(obj) {
|
|
18
|
+
return obj && obj.__esModule ? obj : {
|
|
19
|
+
default: obj
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function webpackConfig(overrides) {
|
|
23
|
+
var _ref;
|
|
24
|
+
const context = getContext();
|
|
25
|
+
const rules = getRules(context, overrides !== null && overrides !== void 0 ? overrides : {});
|
|
26
|
+
/* istanbul ignore next: debug only */ _utils1.log.debug('cypress-config:webpack-config', ()=>(0, _nodeutil.inspect)({
|
|
27
|
+
rules
|
|
28
|
+
}, {
|
|
29
|
+
depth: null
|
|
30
|
+
}));
|
|
31
|
+
const config = {
|
|
32
|
+
module: {
|
|
33
|
+
rules
|
|
34
|
+
},
|
|
35
|
+
resolve: {
|
|
36
|
+
extensions: [
|
|
37
|
+
'.ts',
|
|
38
|
+
'.tsx',
|
|
39
|
+
'.js',
|
|
40
|
+
'.jsx'
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return (0, _webpackmerge.default)(config, (_ref = overrides === null || overrides === void 0 ? void 0 : overrides.configuration) !== null && _ref !== void 0 ? _ref : {});
|
|
45
|
+
}
|
|
46
|
+
function getContext() {
|
|
47
|
+
return {
|
|
48
|
+
destination: '',
|
|
49
|
+
isProduction: false,
|
|
50
|
+
name: '',
|
|
51
|
+
packageData: {},
|
|
52
|
+
sharedDependencies: {},
|
|
53
|
+
source: ''
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function getRules(context, overrides) {
|
|
57
|
+
const { rules } = (0, _configs.rulesConfig)(context, overrides);
|
|
58
|
+
return [
|
|
59
|
+
getSwcLoaderRule(),
|
|
60
|
+
...rules
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
function getSwcLoaderRule() {
|
|
64
|
+
const tsConfig = new _utils.TSConfig((0, _utils1.getTsConfigWithFallback)());
|
|
65
|
+
const swcOptions = (0, _tasks.getSwcOptions)(tsConfig);
|
|
66
|
+
return {
|
|
67
|
+
test: /\.tsx?$/,
|
|
68
|
+
exclude: /node_modules/,
|
|
69
|
+
use: {
|
|
70
|
+
loader: 'swc-loader',
|
|
71
|
+
options: swcOptions
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=webpack-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cypress-config/webpack-config.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport merge from 'webpack-merge';\nimport { getSwcOptions } from '../cli/tasks';\nimport { TSConfig } from '../cli/utils';\nimport { getTsConfigWithFallback, log } from '../utils';\nimport { Context, Overrides, rulesConfig } from '../webpack/configs';\n\nexport function webpackConfig(overrides?: Overrides): Configuration {\n const context = getContext();\n const rules = getRules(context, overrides ?? {});\n\n /* istanbul ignore next: debug only */\n log.debug('cypress-config:webpack-config', () => inspect({ rules }, { depth: null }));\n\n const config: Configuration = {\n module: {\n rules,\n },\n resolve: {\n extensions: ['.ts', '.tsx', '.js', '.jsx'],\n },\n };\n\n return merge(config, overrides?.configuration ?? {});\n}\n\nfunction getContext(): Context {\n return {\n destination: '',\n isProduction: false,\n name: '',\n packageData: {} as any,\n sharedDependencies: {},\n source: '',\n };\n}\n\nfunction getRules(context: Context, overrides: Overrides) {\n const { rules } = rulesConfig(context, overrides);\n\n return [getSwcLoaderRule(), ...rules];\n}\n\nfunction getSwcLoaderRule() {\n const tsConfig = new TSConfig(getTsConfigWithFallback());\n\n const swcOptions = getSwcOptions(tsConfig);\n\n return {\n test: /\\.tsx?$/,\n exclude: /node_modules/,\n use: {\n loader: 'swc-loader',\n options: swcOptions,\n },\n };\n}\n"],"names":["webpackConfig","overrides","context","getContext","rules","getRules","log","debug","inspect","depth","config","module","resolve","extensions","merge","configuration","destination","isProduction","name","packageData","sharedDependencies","source","rulesConfig","getSwcLoaderRule","tsConfig","TSConfig","getTsConfigWithFallback","swcOptions","getSwcOptions","test","exclude","use","loader","options"],"mappings":";;;;+BAQgBA;;;eAAAA;;;0BARQ;qEAEN;uBACY;uBACL;wBACoB;yBACG;;;;;;AAEzC,SAASA,cAAcC,SAAqB;;IAC/C,MAAMC,UAAUC;IAChB,MAAMC,QAAQC,SAASH,SAASD,sBAAAA,uBAAAA,YAAa,CAAC;IAE9C,oCAAoC,GACpCK,WAAG,CAACC,KAAK,CAAC,iCAAiC,IAAMC,IAAAA,iBAAO,EAAC;YAAEJ;QAAM,GAAG;YAAEK,OAAO;QAAK;IAElF,MAAMC,SAAwB;QAC1BC,QAAQ;YACJP;QACJ;QACAQ,SAAS;YACLC,YAAY;gBAAC;gBAAO;gBAAQ;gBAAO;aAAO;QAC9C;IACJ;IAEA,OAAOC,IAAAA,qBAAK,EAACJ,gBAAQT,sBAAAA,gCAAAA,UAAWc,aAAa,uCAAI,CAAC;AACtD;AAEA,SAASZ;IACL,OAAO;QACHa,aAAa;QACbC,cAAc;QACdC,MAAM;QACNC,aAAa,CAAC;QACdC,oBAAoB,CAAC;QACrBC,QAAQ;IACZ;AACJ;AAEA,SAAShB,SAASH,OAAgB,EAAED,SAAoB;IACpD,MAAM,EAAEG,KAAK,EAAE,GAAGkB,IAAAA,oBAAW,EAACpB,SAASD;IAEvC,OAAO;QAACsB;WAAuBnB;KAAM;AACzC;AAEA,SAASmB;IACL,MAAMC,WAAW,IAAIC,eAAQ,CAACC,IAAAA,+BAAuB;IAErD,MAAMC,aAAaC,IAAAA,oBAAa,EAACJ;IAEjC,OAAO;QACHK,MAAM;QACNC,SAAS;QACTC,KAAK;YACDC,QAAQ;YACRC,SAASN;QACb;IACJ;AACJ"}
|