@servicetitan/startup 26.3.0 → 27.0.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/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +3 -2
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/utils/pick.d.ts.map +1 -1
- package/dist/utils/pick.js.map +1 -1
- package/dist/webpack/__mocks__/style-rules.d.ts.map +1 -1
- package/dist/webpack/__mocks__/style-rules.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +2 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +23 -9
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +3 -2
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.d.ts +14 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.js +15 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.js.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts +7 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts.map +1 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js +8 -0
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map +1 -0
- package/package.json +10 -11
- package/src/cli/commands/__tests__/build.test.ts +3 -0
- package/src/cli/commands/__tests__/get-command.test.ts +3 -0
- package/src/cli/commands/__tests__/get-user-commands.test.ts +3 -0
- package/src/cli/commands/__tests__/lint.test.ts +1 -1
- package/src/cli/commands/lint.ts +3 -2
- package/src/utils/pick.ts +9 -6
- package/src/webpack/__mocks__/style-rules.ts +7 -4
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/check-resource.test.ts +28 -13
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/is-optional-anvil-peer-dependency.test.ts +54 -0
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/{is-optional-peer-dependency.test.ts → is-optional-react-dom-peer-dependency.test.ts} +10 -5
- package/src/webpack/configs/plugins/ignore-plugin/check-resource.ts +24 -8
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +3 -2
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.ts +22 -0
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.ts +11 -0
- package/template/.prettierrc +2 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts +0 -7
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +0 -7
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js.map +0 -1
- package/src/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAG5B,UAAU,IAAI;IAEV,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,8BAA8B;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,IAAK,YAAW,OAAO;IAGpB,OAAO,CAAC,IAAI;IAFxB,KAAK,EAAE,MAAM,EAAE,CAAC;gBAEI,IAAI,EAAE,IAAI;IAI9B,WAAW;IAIL,OAAO;YAOC,MAAM;YAuBN,SAAS;
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAG5B,UAAU,IAAI;IAEV,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,8BAA8B;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,IAAK,YAAW,OAAO;IAGpB,OAAO,CAAC,IAAI;IAFxB,KAAK,EAAE,MAAM,EAAE,CAAC;gBAEI,IAAI,EAAE,IAAI;IAI9B,WAAW;IAIL,OAAO;YAOC,MAAM;YAuBN,SAAS;YA6CT,WAAW;CAW5B"}
|
|
@@ -84,14 +84,15 @@ class Lint {
|
|
|
84
84
|
if (!files.length) {
|
|
85
85
|
files = [glob];
|
|
86
86
|
}
|
|
87
|
-
const {
|
|
87
|
+
const { report, errored } = await stylelint_1.default.lint({
|
|
88
88
|
files,
|
|
89
89
|
ignorePattern: ['node_modules', ...(0, utils_1.getDestinationFolders)()],
|
|
90
90
|
formatter: 'string',
|
|
91
91
|
fix,
|
|
92
|
+
quietDeprecationWarnings: true,
|
|
92
93
|
...config,
|
|
93
94
|
});
|
|
94
|
-
process.stdout.write(
|
|
95
|
+
process.stdout.write(report);
|
|
95
96
|
if (errored) {
|
|
96
97
|
process.exitCode = 1;
|
|
97
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../src/cli/commands/lint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AAExB,0DAAkC;AAElC,uCAMqB;AAErB,oCAA6C;AAe7C,MAAa,IAAI;IAGb,YAAoB,IAAU;QAAlB;;;;mBAAQ,IAAI;WAAM;QAF9B;;;;;WAAgB;QAGZ,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAED,WAAW;QACP,OAAO,0BAA0B,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;IAGa,AAAN,KAAK,CAAC,MAAM;QAChB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QACnD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAEvB,MAAM,SAAS,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,CAAC;QACjE,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;YACjC,WAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YAC9B,MAAM,IAAA,cAAM,EAAC,EAAE,GAAG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":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../src/utils/pick.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../src/utils/pick.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,cAUtF"}
|
package/dist/utils/pick.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../src/utils/pick.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../src/utils/pick.ts"],"names":[],"mappings":";;AAAA,oBAUC;AAVD,SAAgB,IAAI,CAAsC,MAAS,EAAE,IAAkB;IACnF,OAAO,IAAI,CAAC,MAAM,CACd,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACZ,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC,EACD,EAAgB,CACnB,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-rules.d.ts","sourceRoot":"","sources":["../../../src/webpack/__mocks__/style-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IAAE,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CAAE,CAAC;AAEnE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CA4EhD,CAAC;AAEF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"style-rules.d.ts","sourceRoot":"","sources":["../../../src/webpack/__mocks__/style-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IAAE,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CAAE,CAAC;AAEnE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CA4EhD,CAAC;AAEF,eAAO,MAAM,sBAAsB,2BAMlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,2BAUhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-rules.js","sourceRoot":"","sources":["../../../src/webpack/__mocks__/style-rules.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA2D;AAK9C,QAAA,UAAU,GAA8B;IACjD,MAAM,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC7B,GAAG,EAAE,CAAC,cAAc,EAAE,YAAY,CAAC;KACtC;IACD,OAAO,EAAE;QACL,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,gBAAgB;QACzB,GAAG,EAAE,CAAC,cAAc,EAAE,YAAY,EAAE,aAAa,CAAC;KACrD;IACD,OAAO,EAAE;QACL,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,gBAAgB;QACzB,GAAG,EAAE;YACD,cAAc;YACd,YAAY;YACZ;gBACI,MAAM,EAAE,aAAa;gBACrB,OAAO,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aAC/C;SACJ;KACJ;IACD,a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,kBAAkB,CAAC,EAAE,CAAC;IACtE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,EACD,EAAmC,CACtC,CAAC;AAEF;;GAEG;AACH,SAAS,kBAAkB,CAAC,MAAoC;;IAC5D,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,YAAY,KAAI,MAAA,MAAM,CAAC,OAAO,0CAAE,OAAO,CAAA,EAAE,CAAC;QAC1F,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,MAAM,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,CAAC;QACnF,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,MAAoC;IAC9D,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;QAC5B,OAAO,iCAAoB,CAAC,MAAM,CAAC;IACvC,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,cAAc,EAAE,CAAC;QACjE,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,iCAAoB,CAAC,MAAM,EAAE,CAAC;IAC9D,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { Context } from '../../types';
|
|
2
|
+
export declare function checkResource(packageContext: Context): (resource: string, context: string) => boolean;
|
|
2
3
|
//# sourceMappingURL=check-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-resource.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/check-resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-resource.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/check-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,wBAAgB,aAAa,CAAC,cAAc,EAAE,OAAO,cACtB,MAAM,WAAW,MAAM,aAsBrD"}
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkResource = checkResource;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const is_optional_anvil_peer_dependency_1 = require("./is-optional-anvil-peer-dependency");
|
|
5
|
+
const is_optional_react_dom_peer_dependency_1 = require("./is-optional-react-dom-peer-dependency");
|
|
6
|
+
function checkResource(packageContext) {
|
|
7
|
+
return function (resource, context) {
|
|
8
|
+
/**
|
|
9
|
+
* isOptionalAnvilPeerDependency checks packageContext instead of node_modules to
|
|
10
|
+
* allow MFEs within the same monorepo to rely on different versions of Anvil
|
|
11
|
+
*/
|
|
12
|
+
if ((0, is_optional_anvil_peer_dependency_1.isOptionalAnvilPeerDependency)({ context, packageContext, resource })) {
|
|
11
13
|
return true;
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* isOptionalReactDomPeerDependency cannot use packageContext because react-dom/client
|
|
17
|
+
* is not explicitly listed in the package.json dependencies
|
|
18
|
+
*/
|
|
19
|
+
if ((0, is_optional_react_dom_peer_dependency_1.isOptionalReactDomPeerDependency)({ resource, context })) {
|
|
20
|
+
try {
|
|
21
|
+
require.resolve(resource);
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
15
29
|
}
|
|
16
30
|
//# sourceMappingURL=check-resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-resource.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/check-resource.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"check-resource.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/check-resource.ts"],"names":[],"mappings":";;AAIA,sCAuBC;AA1BD,2FAAoF;AACpF,mGAA2F;AAE3F,SAAgB,aAAa,CAAC,cAAuB;IACjD,OAAO,UAAU,QAAgB,EAAE,OAAe;QAC9C;;;WAGG;QACH,IAAI,IAAA,iEAA6B,EAAC,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;YACvE,OAAO,IAAI,CAAC;QAChB,CAAC;QAED;;;WAGG;QACH,IAAI,IAAA,wEAAgC,EAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YAC1D,IAAI,CAAC;gBACD,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC9B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IgnorePlugin } from 'webpack';
|
|
2
2
|
import { Context, Overrides } from '../../types';
|
|
3
|
-
export declare function ignorePlugin(
|
|
3
|
+
export declare function ignorePlugin(context: Context, _: Overrides): IgnorePlugin;
|
|
4
4
|
//# sourceMappingURL=ignore-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"ignore-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,gBAQ1D"}
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ignorePlugin = ignorePlugin;
|
|
4
4
|
const webpack_1 = require("webpack");
|
|
5
5
|
const check_resource_1 = require("./check-resource");
|
|
6
|
-
function ignorePlugin(
|
|
6
|
+
function ignorePlugin(context, _) {
|
|
7
7
|
/**
|
|
8
8
|
* Ignore optional peer dependencies
|
|
9
|
+
* @see {@link: file://./../../../../../../web-components/src/register.tsx}
|
|
9
10
|
* @see {@link: file://./../../../../../../web-components/src/render.ts}
|
|
10
11
|
* @see {@link: file://./../../../../../../ko-bridge/src/ko-binding-handlers.tsx}
|
|
11
12
|
*/
|
|
12
|
-
return new webpack_1.IgnorePlugin({ checkResource: check_resource_1.checkResource });
|
|
13
|
+
return new webpack_1.IgnorePlugin({ checkResource: (0, check_resource_1.checkResource)(context) });
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=ignore-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-plugin.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"ignore-plugin.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts"],"names":[],"mappings":";;AAKA,oCAQC;AAbD,qCAAuC;AAGvC,qDAAiD;AAEjD,SAAgB,YAAY,CAAC,OAAgB,EAAE,CAAY;IACvD;;;;;OAKG;IACH,OAAO,IAAI,sBAAY,CAAC,EAAE,aAAa,EAAE,IAAA,8BAAa,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from '../../types';
|
|
2
|
+
interface Dependency {
|
|
3
|
+
context: string;
|
|
4
|
+
resource: string;
|
|
5
|
+
packageContext: Context;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Ignore any Anvil dependency used in register.tsx that is not in the package.json dependencies,
|
|
9
|
+
* so that register.tsx's web-components/anvil2 requires will fail
|
|
10
|
+
* @see {@link file://./../../../../../../web-components/src/register.tsx}
|
|
11
|
+
*/
|
|
12
|
+
export declare function isOptionalAnvilPeerDependency({ context, packageContext, resource }: Dependency): boolean;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=is-optional-anvil-peer-dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-optional-anvil-peer-dependency.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,UAAU,UAAU;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;CAC3B;AAID;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,UAAU,WAM9F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isOptionalAnvilPeerDependency = isOptionalAnvilPeerDependency;
|
|
4
|
+
const optionalAnvilPeerDependencies = ['@servicetitan/design-system', '@servicetitan/anvil2'];
|
|
5
|
+
/**
|
|
6
|
+
* Ignore any Anvil dependency used in register.tsx that is not in the package.json dependencies,
|
|
7
|
+
* so that register.tsx's web-components/anvil2 requires will fail
|
|
8
|
+
* @see {@link file://./../../../../../../web-components/src/register.tsx}
|
|
9
|
+
*/
|
|
10
|
+
function isOptionalAnvilPeerDependency({ context, packageContext, resource }) {
|
|
11
|
+
return (optionalAnvilPeerDependencies.includes(resource) &&
|
|
12
|
+
/(@servicetitan|packages)\/(web-components)/.test(context) &&
|
|
13
|
+
!Object.keys(packageContext.packageData.dependencies).includes(resource));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=is-optional-anvil-peer-dependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-optional-anvil-peer-dependency.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-anvil-peer-dependency.ts"],"names":[],"mappings":";;AAeA,sEAMC;AAbD,MAAM,6BAA6B,GAAG,CAAC,6BAA6B,EAAE,sBAAsB,CAAC,CAAC;AAE9F;;;;GAIG;AACH,SAAgB,6BAA6B,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAc;IAC3F,OAAO,CACH,6BAA6B,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAChD,4CAA4C,CAAC,IAAI,CAAC,OAAO,CAAC;QAC1D,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC3E,CAAC;AACN,CAAC"}
|
package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-optional-react-dom-peer-dependency.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gCAAgC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,WAKjF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isOptionalReactDomPeerDependency = isOptionalReactDomPeerDependency;
|
|
4
|
+
function isOptionalReactDomPeerDependency({ context, resource }) {
|
|
5
|
+
return (resource === 'react-dom/client' &&
|
|
6
|
+
/(@servicetitan|packages)\/(ko-bridge|web-components)/.test(context));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=is-optional-react-dom-peer-dependency.js.map
|
package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-optional-react-dom-peer-dependency.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.ts"],"names":[],"mappings":";;AAKA,4EAKC;AALD,SAAgB,gCAAgC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAc;IAC9E,OAAO,CACH,QAAQ,KAAK,kBAAkB;QAC/B,sDAAsD,CAAC,IAAI,CAAC,OAAO,CAAC,CACvE,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/startup",
|
|
6
6
|
"repository": {
|
|
@@ -28,16 +28,15 @@
|
|
|
28
28
|
"@types/eslint": "~8.56.3",
|
|
29
29
|
"@types/less": "~3.0.3",
|
|
30
30
|
"@types/moment-locales-webpack-plugin": "~1.2.2",
|
|
31
|
-
"@types/sass": "~1.45.0",
|
|
32
31
|
"@types/webpack-assets-manifest": "~5.1.4",
|
|
33
32
|
"@types/yargs": "~17.0.24"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
|
-
"@babel/preset-env": "~7.25.
|
|
35
|
+
"@babel/preset-env": "~7.25.4",
|
|
37
36
|
"@jest/core": "~29.7.0",
|
|
38
37
|
"@jest/types": "~29.6.3",
|
|
39
|
-
"@servicetitan/eslint-config": "
|
|
40
|
-
"@servicetitan/stylelint-config": "
|
|
38
|
+
"@servicetitan/eslint-config": "27.0.0",
|
|
39
|
+
"@servicetitan/stylelint-config": "27.0.0",
|
|
41
40
|
"@svgr/webpack": "^8.1.0",
|
|
42
41
|
"@swc/core": "1.6.13",
|
|
43
42
|
"@types/debug": "^4.1.12",
|
|
@@ -64,19 +63,19 @@
|
|
|
64
63
|
"less-loader": "~12.2.0",
|
|
65
64
|
"less-plugin-npm-import": "~2.1.0",
|
|
66
65
|
"memfs": "~4.11.1",
|
|
67
|
-
"mini-css-extract-plugin": "~2.9.
|
|
66
|
+
"mini-css-extract-plugin": "~2.9.1",
|
|
68
67
|
"moment": "^2.30.1",
|
|
69
68
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
70
69
|
"multimatch": "~5.0.0",
|
|
71
70
|
"portfinder": "~1.0.32",
|
|
72
71
|
"postcss": "~8.4.41",
|
|
73
|
-
"prettier": "~
|
|
72
|
+
"prettier": "~3.3.3",
|
|
74
73
|
"sass": "~1.77.8",
|
|
75
|
-
"sass-loader": "~16.0.
|
|
74
|
+
"sass-loader": "~16.0.1",
|
|
76
75
|
"source-map-loader": "~5.0.0",
|
|
77
76
|
"string-width": "<5.0.0",
|
|
78
77
|
"style-loader": "~4.0.0",
|
|
79
|
-
"stylelint": "~
|
|
78
|
+
"stylelint": "~16.8.1",
|
|
80
79
|
"swc-loader": "0.2.6",
|
|
81
80
|
"terser-webpack-plugin": "^5.3.10",
|
|
82
81
|
"ts-jest": "~29.2.4",
|
|
@@ -85,7 +84,7 @@
|
|
|
85
84
|
"typed-css-modules": "~0.9.1",
|
|
86
85
|
"typescript": "5.5.3",
|
|
87
86
|
"username": "~5.1.0",
|
|
88
|
-
"webpack": "~5.
|
|
87
|
+
"webpack": "~5.94.0",
|
|
89
88
|
"webpack-assets-manifest": "~5.2.1",
|
|
90
89
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
91
90
|
"webpack-dev-server": "~5.0.4",
|
|
@@ -105,5 +104,5 @@
|
|
|
105
104
|
"cli": {
|
|
106
105
|
"webpack": false
|
|
107
106
|
},
|
|
108
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "7076608156b454b875fedf0fcb1fa07ff573c899"
|
|
109
108
|
}
|
|
@@ -3,7 +3,7 @@ import { eslint, lernaExec } from '../../utils';
|
|
|
3
3
|
import { getPackages } from '../../../utils';
|
|
4
4
|
|
|
5
5
|
jest.mock('execa');
|
|
6
|
-
jest.mock('stylelint', () => ({ lint: jest.fn(() => ({
|
|
6
|
+
jest.mock('stylelint', () => ({ lint: jest.fn(() => ({ report: '' })) }));
|
|
7
7
|
|
|
8
8
|
jest.mock('../../utils');
|
|
9
9
|
jest.mock('../../../utils', () => ({
|
package/src/cli/commands/lint.ts
CHANGED
|
@@ -94,15 +94,16 @@ export class Lint implements Command {
|
|
|
94
94
|
files = [glob];
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const {
|
|
97
|
+
const { report, errored } = await stylelint.lint({
|
|
98
98
|
files,
|
|
99
99
|
ignorePattern: ['node_modules', ...getDestinationFolders()],
|
|
100
100
|
formatter: 'string',
|
|
101
101
|
fix,
|
|
102
|
+
quietDeprecationWarnings: true,
|
|
102
103
|
...config,
|
|
103
104
|
});
|
|
104
105
|
|
|
105
|
-
process.stdout.write(
|
|
106
|
+
process.stdout.write(report);
|
|
106
107
|
|
|
107
108
|
if (errored) {
|
|
108
109
|
process.exitCode = 1;
|
package/src/utils/pick.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export function pick<T extends object, K extends keyof T>(target: T, keys: readonly K[]) {
|
|
2
|
-
return keys.reduce(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
return keys.reduce(
|
|
3
|
+
(result, key) => {
|
|
4
|
+
if (Object.hasOwn(target, key)) {
|
|
5
|
+
result[key] = target[key];
|
|
6
|
+
}
|
|
7
|
+
return result;
|
|
8
|
+
},
|
|
9
|
+
{} as Pick<T, K>
|
|
10
|
+
);
|
|
8
11
|
}
|
|
@@ -81,10 +81,13 @@ export const styleRules: Record<string, StyleRule> = {
|
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
export const webComponentStyleRules = Object.entries(styleRules).reduce(
|
|
85
|
-
result[key
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
export const webComponentStyleRules = Object.entries(styleRules).reduce(
|
|
85
|
+
(result, [key, rule]) => {
|
|
86
|
+
result[key] = { ...rule, use: rule.use?.map(transformStyleLoader) };
|
|
87
|
+
return result;
|
|
88
|
+
},
|
|
89
|
+
{} as typeof styleRules
|
|
90
|
+
);
|
|
88
91
|
|
|
89
92
|
export const productionStyleRules = Object.entries(webComponentStyleRules).reduce(
|
|
90
93
|
(result, [key, rule]) => {
|
|
@@ -1,37 +1,52 @@
|
|
|
1
1
|
import { checkResource } from '../check-resource';
|
|
2
|
-
import {
|
|
2
|
+
import { isOptionalReactDomPeerDependency } from '../is-optional-react-dom-peer-dependency';
|
|
3
|
+
import { isOptionalAnvilPeerDependency } from '../is-optional-anvil-peer-dependency';
|
|
3
4
|
|
|
4
|
-
jest.mock('../is-optional-peer-dependency');
|
|
5
|
+
jest.mock('../is-optional-react-dom-peer-dependency');
|
|
6
|
+
jest.mock('../is-optional-anvil-peer-dependency');
|
|
7
|
+
|
|
8
|
+
type PackageContext = Parameters<typeof isOptionalAnvilPeerDependency>[0]['packageContext'];
|
|
5
9
|
|
|
6
10
|
describe(`${checkResource.name}`, () => {
|
|
11
|
+
let packageContext: PackageContext;
|
|
7
12
|
let context: string;
|
|
8
13
|
let resource: string;
|
|
9
14
|
|
|
10
|
-
const subject = () => checkResource(resource, context);
|
|
15
|
+
const subject = () => checkResource(packageContext)(resource, context);
|
|
11
16
|
|
|
12
17
|
function itReturns(value: boolean) {
|
|
13
18
|
test(`returns ${value}`, () => expect(subject()).toBe(value));
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
describe('when resource is
|
|
17
|
-
beforeEach(() => jest.mocked(
|
|
21
|
+
describe('when resource is an optional anvil peer dependency', () => {
|
|
22
|
+
beforeEach(() => jest.mocked(isOptionalAnvilPeerDependency).mockReturnValue(true));
|
|
18
23
|
|
|
19
|
-
itReturns(
|
|
24
|
+
itReturns(true);
|
|
20
25
|
});
|
|
21
26
|
|
|
22
|
-
describe('when resource is optional peer dependency', () => {
|
|
23
|
-
beforeEach(() => jest.mocked(
|
|
27
|
+
describe('when resource is not an optional anvil peer dependency', () => {
|
|
28
|
+
beforeEach(() => jest.mocked(isOptionalAnvilPeerDependency).mockReturnValue(false));
|
|
24
29
|
|
|
25
|
-
describe('when resource is
|
|
26
|
-
beforeEach(() => (
|
|
30
|
+
describe('when resource is not an optional react-dom peer dependency', () => {
|
|
31
|
+
beforeEach(() => jest.mocked(isOptionalReactDomPeerDependency).mockReturnValue(false));
|
|
27
32
|
|
|
28
33
|
itReturns(false);
|
|
29
34
|
});
|
|
30
35
|
|
|
31
|
-
describe('when resource is
|
|
32
|
-
beforeEach(() => (
|
|
36
|
+
describe('when resource is optional react-dom peer dependency', () => {
|
|
37
|
+
beforeEach(() => jest.mocked(isOptionalReactDomPeerDependency).mockReturnValue(true));
|
|
38
|
+
|
|
39
|
+
describe('when resource is present', () => {
|
|
40
|
+
beforeEach(() => (resource = 'fs'));
|
|
41
|
+
|
|
42
|
+
itReturns(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('when resource is not present', () => {
|
|
46
|
+
beforeEach(() => (resource = 'foo'));
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
itReturns(true);
|
|
49
|
+
});
|
|
35
50
|
});
|
|
36
51
|
});
|
|
37
52
|
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isOptionalAnvilPeerDependency } from '../is-optional-anvil-peer-dependency';
|
|
2
|
+
|
|
3
|
+
type PackageContext = Parameters<typeof isOptionalAnvilPeerDependency>[0]['packageContext'];
|
|
4
|
+
|
|
5
|
+
describe(`${isOptionalAnvilPeerDependency.name}`, () => {
|
|
6
|
+
const subject = (...args: Parameters<typeof isOptionalAnvilPeerDependency>) =>
|
|
7
|
+
isOptionalAnvilPeerDependency(...args);
|
|
8
|
+
|
|
9
|
+
describe.each([
|
|
10
|
+
{
|
|
11
|
+
packageContextDependencyName: '@servicetitan/anvil2',
|
|
12
|
+
resource: '@servicetitan/design-system',
|
|
13
|
+
contexts: ['@servicetitan/web-components', 'uikit/packages/web-components/dist'],
|
|
14
|
+
expectedResult: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
packageContextDependencyName: '@servicetitan/design-system',
|
|
18
|
+
resource: '@servicetitan/anvil2',
|
|
19
|
+
contexts: ['@servicetitan/web-components', 'uikit/packages/web-components/dist'],
|
|
20
|
+
expectedResult: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
packageContextDependencyName: '@servicetitan/anvil2',
|
|
24
|
+
resource: '@servicetitan/anvil2',
|
|
25
|
+
contexts: ['@servicetitan/web-components', 'uikit/packages/web-components/dist'],
|
|
26
|
+
expectedResult: false,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
packageContextDependencyName: '@servicetitan/anvil2',
|
|
30
|
+
resource: '@servicetitan/design-system',
|
|
31
|
+
contexts: ['@servicetitan/anvil2/Button'],
|
|
32
|
+
expectedResult: false,
|
|
33
|
+
},
|
|
34
|
+
])(
|
|
35
|
+
'with required dependency "$resource" and package.json dependencies containing "$packageContextDependencyName"',
|
|
36
|
+
({ packageContextDependencyName, resource, contexts, expectedResult }) => {
|
|
37
|
+
contexts.forEach(context => {
|
|
38
|
+
test(`with context ${context}, returns ${expectedResult}`, () => {
|
|
39
|
+
expect(
|
|
40
|
+
subject({
|
|
41
|
+
packageContext: {
|
|
42
|
+
packageData: {
|
|
43
|
+
dependencies: { [packageContextDependencyName]: 'x.x.x' },
|
|
44
|
+
},
|
|
45
|
+
} as unknown as PackageContext,
|
|
46
|
+
resource,
|
|
47
|
+
context,
|
|
48
|
+
})
|
|
49
|
+
).toBe(expectedResult);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isOptionalReactDomPeerDependency } from '../is-optional-react-dom-peer-dependency';
|
|
2
2
|
|
|
3
|
-
describe(`${
|
|
4
|
-
const subject = (...args: Parameters<typeof
|
|
5
|
-
|
|
3
|
+
describe(`${isOptionalReactDomPeerDependency.name}`, () => {
|
|
4
|
+
const subject = (...args: Parameters<typeof isOptionalReactDomPeerDependency>) =>
|
|
5
|
+
isOptionalReactDomPeerDependency(...args);
|
|
6
6
|
|
|
7
7
|
describe.each([
|
|
8
8
|
{
|
|
9
9
|
resource: 'react-dom/client',
|
|
10
|
-
contexts: [
|
|
10
|
+
contexts: [
|
|
11
|
+
'@servicetitan/web-components',
|
|
12
|
+
'uikit/packages/web-components/dist',
|
|
13
|
+
'@servicetitan/ko-bridge',
|
|
14
|
+
'uikit/packages/ko-bridge/dist',
|
|
15
|
+
],
|
|
11
16
|
},
|
|
12
17
|
])('with dependency "$resource"', ({ resource, contexts }) => {
|
|
13
18
|
contexts.forEach(context => {
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Context } from '../../types';
|
|
2
|
+
import { isOptionalAnvilPeerDependency } from './is-optional-anvil-peer-dependency';
|
|
3
|
+
import { isOptionalReactDomPeerDependency } from './is-optional-react-dom-peer-dependency';
|
|
2
4
|
|
|
3
|
-
export function checkResource(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export function checkResource(packageContext: Context) {
|
|
6
|
+
return function (resource: string, context: string) {
|
|
7
|
+
/**
|
|
8
|
+
* isOptionalAnvilPeerDependency checks packageContext instead of node_modules to
|
|
9
|
+
* allow MFEs within the same monorepo to rely on different versions of Anvil
|
|
10
|
+
*/
|
|
11
|
+
if (isOptionalAnvilPeerDependency({ context, packageContext, resource })) {
|
|
8
12
|
return true;
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* isOptionalReactDomPeerDependency cannot use packageContext because react-dom/client
|
|
17
|
+
* is not explicitly listed in the package.json dependencies
|
|
18
|
+
*/
|
|
19
|
+
if (isOptionalReactDomPeerDependency({ resource, context })) {
|
|
20
|
+
try {
|
|
21
|
+
require.resolve(resource);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
};
|
|
12
28
|
}
|
|
@@ -3,11 +3,12 @@ import { IgnorePlugin } from 'webpack';
|
|
|
3
3
|
import { Context, Overrides } from '../../types';
|
|
4
4
|
import { checkResource } from './check-resource';
|
|
5
5
|
|
|
6
|
-
export function ignorePlugin(
|
|
6
|
+
export function ignorePlugin(context: Context, _: Overrides) {
|
|
7
7
|
/**
|
|
8
8
|
* Ignore optional peer dependencies
|
|
9
|
+
* @see {@link: file://./../../../../../../web-components/src/register.tsx}
|
|
9
10
|
* @see {@link: file://./../../../../../../web-components/src/render.ts}
|
|
10
11
|
* @see {@link: file://./../../../../../../ko-bridge/src/ko-binding-handlers.tsx}
|
|
11
12
|
*/
|
|
12
|
-
return new IgnorePlugin({ checkResource });
|
|
13
|
+
return new IgnorePlugin({ checkResource: checkResource(context) });
|
|
13
14
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context } from '../../types';
|
|
2
|
+
|
|
3
|
+
interface Dependency {
|
|
4
|
+
context: string;
|
|
5
|
+
resource: string;
|
|
6
|
+
packageContext: Context;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const optionalAnvilPeerDependencies = ['@servicetitan/design-system', '@servicetitan/anvil2'];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Ignore any Anvil dependency used in register.tsx that is not in the package.json dependencies,
|
|
13
|
+
* so that register.tsx's web-components/anvil2 requires will fail
|
|
14
|
+
* @see {@link file://./../../../../../../web-components/src/register.tsx}
|
|
15
|
+
*/
|
|
16
|
+
export function isOptionalAnvilPeerDependency({ context, packageContext, resource }: Dependency) {
|
|
17
|
+
return (
|
|
18
|
+
optionalAnvilPeerDependencies.includes(resource) &&
|
|
19
|
+
/(@servicetitan|packages)\/(web-components)/.test(context) &&
|
|
20
|
+
!Object.keys(packageContext.packageData.dependencies).includes(resource)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Dependency {
|
|
2
|
+
context: string;
|
|
3
|
+
resource: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function isOptionalReactDomPeerDependency({ context, resource }: Dependency) {
|
|
7
|
+
return (
|
|
8
|
+
resource === 'react-dom/client' &&
|
|
9
|
+
/(@servicetitan|packages)\/(ko-bridge|web-components)/.test(context)
|
|
10
|
+
);
|
|
11
|
+
}
|
package/template/.prettierrc
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-optional-peer-dependency.d.ts","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,wBAAwB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,WAIzE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isOptionalPeerDependency = isOptionalPeerDependency;
|
|
4
|
-
function isOptionalPeerDependency({ context, resource }) {
|
|
5
|
-
return (resource === 'react-dom/client' && /@servicetitan\/(ko-bridge|web-components)/.test(context));
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=is-optional-peer-dependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-optional-peer-dependency.js","sourceRoot":"","sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.ts"],"names":[],"mappings":";;AAKA,4DAIC;AAJD,SAAgB,wBAAwB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAc;IACtE,OAAO,CACH,QAAQ,KAAK,kBAAkB,IAAI,2CAA2C,CAAC,IAAI,CAAC,OAAO,CAAC,CAC/F,CAAC;AACN,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface Dependency {
|
|
2
|
-
context: string;
|
|
3
|
-
resource: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export function isOptionalPeerDependency({ context, resource }: Dependency) {
|
|
7
|
-
return (
|
|
8
|
-
resource === 'react-dom/client' && /@servicetitan\/(ko-bridge|web-components)/.test(context)
|
|
9
|
-
);
|
|
10
|
-
}
|