@servicetitan/install 39.2.0 → 40.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.
Files changed (71) hide show
  1. package/dist/cli/index.js +6 -0
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/cli/install.d.ts +1 -0
  4. package/dist/cli/install.d.ts.map +1 -1
  5. package/dist/cli/install.js.map +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/package-manager/npm-package-manager.d.ts +2 -0
  11. package/dist/package-manager/npm-package-manager.d.ts.map +1 -1
  12. package/dist/package-manager/npm-package-manager.js +63 -4
  13. package/dist/package-manager/npm-package-manager.js.map +1 -1
  14. package/dist/package-manager/package-manager.d.ts +1 -0
  15. package/dist/package-manager/package-manager.d.ts.map +1 -1
  16. package/dist/package-manager/package-manager.js.map +1 -1
  17. package/dist/package-manager/pnpm-package-manager.d.ts +2 -0
  18. package/dist/package-manager/pnpm-package-manager.d.ts.map +1 -1
  19. package/dist/package-manager/pnpm-package-manager.js +40 -1
  20. package/dist/package-manager/pnpm-package-manager.js.map +1 -1
  21. package/dist/package-manager/utils/filter-trusted-scripts.d.ts +13 -0
  22. package/dist/package-manager/utils/filter-trusted-scripts.d.ts.map +1 -0
  23. package/dist/package-manager/utils/filter-trusted-scripts.js +42 -0
  24. package/dist/package-manager/utils/filter-trusted-scripts.js.map +1 -0
  25. package/dist/package-manager/utils/index.d.ts +2 -0
  26. package/dist/package-manager/utils/index.d.ts.map +1 -1
  27. package/dist/package-manager/utils/index.js +2 -0
  28. package/dist/package-manager/utils/index.js.map +1 -1
  29. package/dist/package-manager/utils/resolve-allow-scripts.d.ts +0 -1
  30. package/dist/package-manager/utils/resolve-allow-scripts.d.ts.map +1 -1
  31. package/dist/package-manager/utils/resolve-allow-scripts.js +3 -18
  32. package/dist/package-manager/utils/resolve-allow-scripts.js.map +1 -1
  33. package/dist/package-manager/utils/resolve-min-release-age.d.ts +6 -0
  34. package/dist/package-manager/utils/resolve-min-release-age.d.ts.map +1 -0
  35. package/dist/package-manager/utils/resolve-min-release-age.js +25 -0
  36. package/dist/package-manager/utils/resolve-min-release-age.js.map +1 -0
  37. package/dist/utils/audited-scripts.d.ts +8 -0
  38. package/dist/utils/audited-scripts.d.ts.map +1 -0
  39. package/dist/utils/audited-scripts.js +102 -0
  40. package/dist/utils/audited-scripts.js.map +1 -0
  41. package/dist/utils/get-packages-with-install-scripts.d.ts.map +1 -1
  42. package/dist/utils/get-packages-with-install-scripts.js +10 -14
  43. package/dist/utils/get-packages-with-install-scripts.js.map +1 -1
  44. package/dist/utils/index.d.ts +2 -0
  45. package/dist/utils/index.d.ts.map +1 -1
  46. package/dist/utils/index.js +2 -0
  47. package/dist/utils/index.js.map +1 -1
  48. package/dist/utils/version-compare.d.ts +2 -0
  49. package/dist/utils/version-compare.d.ts.map +1 -0
  50. package/dist/utils/version-compare.js +44 -0
  51. package/dist/utils/version-compare.js.map +1 -0
  52. package/dist/utils/warn-untrusted-install-scripts.d.ts +2 -1
  53. package/dist/utils/warn-untrusted-install-scripts.d.ts.map +1 -1
  54. package/dist/utils/warn-untrusted-install-scripts.js +18 -25
  55. package/dist/utils/warn-untrusted-install-scripts.js.map +1 -1
  56. package/package.json +2 -2
  57. package/src/cli/index.ts +4 -0
  58. package/src/cli/install.ts +1 -0
  59. package/src/index.ts +1 -1
  60. package/src/package-manager/npm-package-manager.ts +89 -6
  61. package/src/package-manager/package-manager.ts +1 -0
  62. package/src/package-manager/pnpm-package-manager.ts +47 -1
  63. package/src/package-manager/utils/filter-trusted-scripts.ts +44 -0
  64. package/src/package-manager/utils/index.ts +2 -0
  65. package/src/package-manager/utils/resolve-allow-scripts.ts +0 -8
  66. package/src/package-manager/utils/resolve-min-release-age.ts +16 -0
  67. package/src/utils/audited-scripts.ts +92 -0
  68. package/src/utils/get-packages-with-install-scripts.ts +6 -10
  69. package/src/utils/index.ts +2 -0
  70. package/src/utils/version-compare.ts +34 -0
  71. package/src/utils/warn-untrusted-install-scripts.ts +26 -24
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-allow-scripts.d.ts","sourceRoot":"","sources":["../../../src/package-manager/utils/resolve-allow-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,eAAO,MAAM,uBAAuB,UAMnC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,YAAY,CAKjG"}
1
+ {"version":3,"file":"resolve-allow-scripts.d.ts","sourceRoot":"","sources":["../../../src/package-manager/utils/resolve-allow-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,YAAY,CAKjG"}
@@ -2,28 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
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 DEFAULT_ALLOWED_SCRIPTS () {
13
- return DEFAULT_ALLOWED_SCRIPTS;
14
- },
15
- get resolveAllowScripts () {
5
+ Object.defineProperty(exports, "resolveAllowScripts", {
6
+ enumerable: true,
7
+ get: function() {
16
8
  return resolveAllowScripts;
17
9
  }
18
10
  });
19
11
  const _parseallowscripts = require("./parse-allow-scripts");
20
- const DEFAULT_ALLOWED_SCRIPTS = [
21
- '@servicetitan/startup',
22
- 'cypress',
23
- 'msw',
24
- 'nx',
25
- 'tree-sitter'
26
- ];
27
12
  function resolveAllowScripts(value, builtInAllowlist) {
28
13
  if (value === true || value === false) {
29
14
  return value;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/package-manager/utils/resolve-allow-scripts.ts"],"sourcesContent":["import type { AllowScripts } from '../package-manager';\nimport { parseAllowScripts } from './parse-allow-scripts';\n\nexport const DEFAULT_ALLOWED_SCRIPTS = [\n '@servicetitan/startup',\n 'cypress',\n 'msw',\n 'nx',\n 'tree-sitter',\n];\n\nexport function resolveAllowScripts(value: AllowScripts, builtInAllowlist: string[]): AllowScripts {\n if (value === true || value === false) {\n return value;\n }\n return [...builtInAllowlist, ...parseAllowScripts(value)];\n}\n"],"names":["DEFAULT_ALLOWED_SCRIPTS","resolveAllowScripts","value","builtInAllowlist","parseAllowScripts"],"mappings":";;;;;;;;;;;QAGaA;eAAAA;;QAQGC;eAAAA;;;mCAVkB;AAE3B,MAAMD,0BAA0B;IACnC;IACA;IACA;IACA;IACA;CACH;AAEM,SAASC,oBAAoBC,KAAmB,EAAEC,gBAA0B;IAC/E,IAAID,UAAU,QAAQA,UAAU,OAAO;QACnC,OAAOA;IACX;IACA,OAAO;WAAIC;WAAqBC,IAAAA,oCAAiB,EAACF;KAAO;AAC7D"}
1
+ {"version":3,"sources":["../../../src/package-manager/utils/resolve-allow-scripts.ts"],"sourcesContent":["import type { AllowScripts } from '../package-manager';\nimport { parseAllowScripts } from './parse-allow-scripts';\n\nexport function resolveAllowScripts(value: AllowScripts, builtInAllowlist: string[]): AllowScripts {\n if (value === true || value === false) {\n return value;\n }\n return [...builtInAllowlist, ...parseAllowScripts(value)];\n}\n"],"names":["resolveAllowScripts","value","builtInAllowlist","parseAllowScripts"],"mappings":";;;;+BAGgBA;;;eAAAA;;;mCAFkB;AAE3B,SAASA,oBAAoBC,KAAmB,EAAEC,gBAA0B;IAC/E,IAAID,UAAU,QAAQA,UAAU,OAAO;QACnC,OAAOA;IACX;IACA,OAAO;WAAIC;WAAqBC,IAAAA,oCAAiB,EAACF;KAAO;AAC7D"}
@@ -0,0 +1,6 @@
1
+ export interface ResolvedMinReleaseAge {
2
+ days: number;
3
+ exclude: string[];
4
+ }
5
+ export declare function resolveMinReleaseAge(minReleaseAge: false | undefined): ResolvedMinReleaseAge | false;
6
+ //# sourceMappingURL=resolve-min-release-age.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-min-release-age.d.ts","sourceRoot":"","sources":["../../../src/package-manager/utils/resolve-min-release-age.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAChC,aAAa,EAAE,KAAK,GAAG,SAAS,GACjC,qBAAqB,GAAG,KAAK,CAK/B"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "resolveMinReleaseAge", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return resolveMinReleaseAge;
9
+ }
10
+ });
11
+ const DEFAULT_MIN_RELEASE_AGE_DAYS = 3;
12
+ const DEFAULT_MIN_RELEASE_AGE_EXCLUDE = [
13
+ '@servicetitan/*'
14
+ ];
15
+ function resolveMinReleaseAge(minReleaseAge) {
16
+ if (minReleaseAge === false) {
17
+ return false;
18
+ }
19
+ return {
20
+ days: DEFAULT_MIN_RELEASE_AGE_DAYS,
21
+ exclude: DEFAULT_MIN_RELEASE_AGE_EXCLUDE
22
+ };
23
+ }
24
+
25
+ //# sourceMappingURL=resolve-min-release-age.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/package-manager/utils/resolve-min-release-age.ts"],"sourcesContent":["const DEFAULT_MIN_RELEASE_AGE_DAYS = 3;\nconst DEFAULT_MIN_RELEASE_AGE_EXCLUDE = ['@servicetitan/*'];\n\nexport interface ResolvedMinReleaseAge {\n days: number;\n exclude: string[];\n}\n\nexport function resolveMinReleaseAge(\n minReleaseAge: false | undefined\n): ResolvedMinReleaseAge | false {\n if (minReleaseAge === false) {\n return false;\n }\n return { days: DEFAULT_MIN_RELEASE_AGE_DAYS, exclude: DEFAULT_MIN_RELEASE_AGE_EXCLUDE };\n}\n"],"names":["resolveMinReleaseAge","DEFAULT_MIN_RELEASE_AGE_DAYS","DEFAULT_MIN_RELEASE_AGE_EXCLUDE","minReleaseAge","days","exclude"],"mappings":";;;;+BAQgBA;;;eAAAA;;;AARhB,MAAMC,+BAA+B;AACrC,MAAMC,kCAAkC;IAAC;CAAkB;AAOpD,SAASF,qBACZG,aAAgC;IAEhC,IAAIA,kBAAkB,OAAO;QACzB,OAAO;IACX;IACA,OAAO;QAAEC,MAAMH;QAA8BI,SAASH;IAAgC;AAC1F"}
@@ -0,0 +1,8 @@
1
+ export interface AuditedScript {
2
+ name: string;
3
+ action: 'allow' | 'ignore';
4
+ maximumVersion?: string;
5
+ note?: string;
6
+ }
7
+ export declare const AUDITED_SCRIPTS: AuditedScript[];
8
+ //# sourceMappingURL=audited-scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audited-scripts.d.ts","sourceRoot":"","sources":["../../src/utils/audited-scripts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,EAoF1C,CAAC"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "AUDITED_SCRIPTS", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return AUDITED_SCRIPTS;
9
+ }
10
+ });
11
+ const AUDITED_SCRIPTS = [
12
+ // Trusted to run their install scripts, up to the audited version.
13
+ ...[
14
+ {
15
+ name: '@servicetitan/startup',
16
+ note: 'Applies patch-package patches to installed dependencies'
17
+ },
18
+ {
19
+ name: 'cypress',
20
+ maximumVersion: '16.0.0',
21
+ note: "Downloads Cypress's platform-specific test runner binary"
22
+ },
23
+ {
24
+ name: 'msw',
25
+ maximumVersion: '2.15.0',
26
+ note: "Regenerates the mock service worker script into the project's configured workerDirectory, no-op unless that's set"
27
+ },
28
+ {
29
+ name: 'nx',
30
+ maximumVersion: '23.2.1',
31
+ note: 'Verifies native platform support and updates the Nx Cloud client if the workspace uses Nx Cloud'
32
+ },
33
+ {
34
+ name: 'tree-sitter',
35
+ maximumVersion: '0.25.1',
36
+ note: 'Installs a prebuilt native binary via node-gyp-build, compiling from source as a fallback'
37
+ }
38
+ ].map((entry)=>({
39
+ ...entry,
40
+ action: 'allow'
41
+ })),
42
+ // Have install scripts, but don't need them to function correctly.
43
+ ...[
44
+ {
45
+ name: '@parcel/watcher',
46
+ note: 'Installs platform-specific binary via optionalDependencies, install script is a legacy fallback'
47
+ },
48
+ {
49
+ name: '@progress/kendo-licensing',
50
+ note: 'Validates Kendo UI license key, not needed for functionality'
51
+ },
52
+ {
53
+ name: '@scarf/scarf',
54
+ note: 'Sends anonymous analytics/telemetry to Scarf, usage-tracking mechanism with no functional purpose'
55
+ },
56
+ {
57
+ name: '@swc/core',
58
+ note: 'Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback'
59
+ },
60
+ {
61
+ name: '@tree-sitter-grammars/tree-sitter-yaml',
62
+ note: 'Ships prebuilds for all supported targets via node-gyp-build, install script is a source-compile fallback'
63
+ },
64
+ {
65
+ name: '@vaadin/vaadin-usage-statistics',
66
+ note: "Toggles Vaadin's development-time telemetry, no effect on functionality"
67
+ },
68
+ {
69
+ name: 'contentful',
70
+ note: 'In 9.3.x, printed a message announcing that v10 was available, no functional purpose; no install script at all since 9.4.0'
71
+ },
72
+ {
73
+ name: 'core-js-pure',
74
+ note: 'Prints a donation/sponsorship banner to the console, no functional purpose'
75
+ },
76
+ {
77
+ name: 'core-js',
78
+ note: 'Prints a donation/sponsorship banner to the console, no functional purpose'
79
+ },
80
+ {
81
+ name: 'es5-ext',
82
+ note: 'Displays politically motivated message targeted at Russian developers, no effect on functionality'
83
+ },
84
+ {
85
+ name: 'esbuild',
86
+ note: 'Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback'
87
+ },
88
+ {
89
+ name: 'tree-sitter-json',
90
+ note: 'Ships prebuilds for all supported targets via node-gyp-build, install script is a source-compile fallback'
91
+ },
92
+ {
93
+ name: 'unrs-resolver',
94
+ note: 'Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback'
95
+ }
96
+ ].map((entry)=>({
97
+ ...entry,
98
+ action: 'ignore'
99
+ }))
100
+ ];
101
+
102
+ //# sourceMappingURL=audited-scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/audited-scripts.ts"],"sourcesContent":["export interface AuditedScript {\n name: string;\n action: 'allow' | 'ignore';\n maximumVersion?: string;\n note?: string;\n}\n\nexport const AUDITED_SCRIPTS: AuditedScript[] = [\n // Trusted to run their install scripts, up to the audited version.\n ...[\n {\n name: '@servicetitan/startup',\n note: 'Applies patch-package patches to installed dependencies',\n },\n {\n name: 'cypress',\n maximumVersion: '16.0.0',\n note: \"Downloads Cypress's platform-specific test runner binary\",\n },\n {\n name: 'msw',\n maximumVersion: '2.15.0',\n note: \"Regenerates the mock service worker script into the project's configured workerDirectory, no-op unless that's set\",\n },\n {\n name: 'nx',\n maximumVersion: '23.2.1',\n note: 'Verifies native platform support and updates the Nx Cloud client if the workspace uses Nx Cloud',\n },\n {\n name: 'tree-sitter',\n maximumVersion: '0.25.1',\n note: 'Installs a prebuilt native binary via node-gyp-build, compiling from source as a fallback',\n },\n ].map((entry: Omit<AuditedScript, 'action'>) => ({ ...entry, action: 'allow' as const })),\n\n // Have install scripts, but don't need them to function correctly.\n ...[\n {\n name: '@parcel/watcher',\n note: 'Installs platform-specific binary via optionalDependencies, install script is a legacy fallback',\n },\n {\n name: '@progress/kendo-licensing',\n note: 'Validates Kendo UI license key, not needed for functionality',\n },\n {\n name: '@scarf/scarf',\n note: 'Sends anonymous analytics/telemetry to Scarf, usage-tracking mechanism with no functional purpose',\n },\n {\n name: '@swc/core',\n note: 'Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback',\n },\n {\n name: '@tree-sitter-grammars/tree-sitter-yaml',\n note: 'Ships prebuilds for all supported targets via node-gyp-build, install script is a source-compile fallback',\n },\n {\n name: '@vaadin/vaadin-usage-statistics',\n note: \"Toggles Vaadin's development-time telemetry, no effect on functionality\",\n },\n {\n name: 'contentful',\n note: 'In 9.3.x, printed a message announcing that v10 was available, no functional purpose; no install script at all since 9.4.0',\n },\n {\n name: 'core-js-pure',\n note: 'Prints a donation/sponsorship banner to the console, no functional purpose',\n },\n {\n name: 'core-js',\n note: 'Prints a donation/sponsorship banner to the console, no functional purpose',\n },\n {\n name: 'es5-ext',\n note: 'Displays politically motivated message targeted at Russian developers, no effect on functionality',\n },\n {\n name: 'esbuild',\n note: 'Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback',\n },\n {\n name: 'tree-sitter-json',\n note: 'Ships prebuilds for all supported targets via node-gyp-build, install script is a source-compile fallback',\n },\n {\n name: 'unrs-resolver',\n note: 'Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback',\n },\n ].map((entry: Omit<AuditedScript, 'action'>) => ({ ...entry, action: 'ignore' as const })),\n];\n"],"names":["AUDITED_SCRIPTS","name","note","maximumVersion","map","entry","action"],"mappings":";;;;+BAOaA;;;eAAAA;;;AAAN,MAAMA,kBAAmC;IAC5C,mEAAmE;OAChE;QACC;YACIC,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNE,gBAAgB;YAChBD,MAAM;QACV;QACA;YACID,MAAM;YACNE,gBAAgB;YAChBD,MAAM;QACV;QACA;YACID,MAAM;YACNE,gBAAgB;YAChBD,MAAM;QACV;QACA;YACID,MAAM;YACNE,gBAAgB;YAChBD,MAAM;QACV;KACH,CAACE,GAAG,CAAC,CAACC,QAA0C,CAAA;YAAE,GAAGA,KAAK;YAAEC,QAAQ;QAAiB,CAAA;IAEtF,mEAAmE;OAChE;QACC;YACIL,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;QACA;YACID,MAAM;YACNC,MAAM;QACV;KACH,CAACE,GAAG,CAAC,CAACC,QAA0C,CAAA;YAAE,GAAGA,KAAK;YAAEC,QAAQ;QAAkB,CAAA;CAC1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-packages-with-install-scripts.d.ts","sourceRoot":"","sources":["../../src/utils/get-packages-with-install-scripts.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAWD,wBAAgB,6BAA6B,IAAI,iBAAiB,EAAE,CAWnE"}
1
+ {"version":3,"file":"get-packages-with-install-scripts.d.ts","sourceRoot":"","sources":["../../src/utils/get-packages-with-install-scripts.ts"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAWD,wBAAgB,6BAA6B,IAAI,iBAAiB,EAAE,CAOnE"}
@@ -19,20 +19,16 @@ const _os = require("./os");
19
19
  'postinstall'
20
20
  ].map((script)=>`:attr(scripts,[${script}])`).join(',');
21
21
  function getPackagesWithInstallScripts() {
22
- try {
23
- const result = (0, _os.runCommand)('npm', [
24
- 'query',
25
- SELECTORS,
26
- '--json'
27
- ]);
28
- return JSON.parse(result).map(({ location, name, version })=>({
29
- location,
30
- name,
31
- version
32
- }));
33
- } catch (unused) {
34
- return [];
35
- }
22
+ const result = (0, _os.runCommand)('npm', [
23
+ 'query',
24
+ SELECTORS,
25
+ '--json'
26
+ ]);
27
+ return JSON.parse(result).map(({ location, name, version })=>({
28
+ location,
29
+ name,
30
+ version
31
+ }));
36
32
  }
37
33
 
38
34
  //# sourceMappingURL=get-packages-with-install-scripts.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/get-packages-with-install-scripts.ts"],"sourcesContent":["import { runCommand } from './os';\n\ninterface PackageWithScript {\n location: string;\n name: string;\n version: string;\n}\n\n/*\n * Keep this selector free of whitespace. On Windows npm runs through a shell (npm.CMD) and\n * execFileSync passes args unquoted, so a space would split the selector at the shell and npm\n * query would receive a truncated, invalid selector.\n */\nconst SELECTORS = ['preinstall', 'install', 'postinstall']\n .map(script => `:attr(scripts,[${script}])`)\n .join(',');\n\nexport function getPackagesWithInstallScripts(): PackageWithScript[] {\n try {\n const result = runCommand('npm', ['query', SELECTORS, '--json']);\n return JSON.parse(result).map(({ location, name, version }: PackageWithScript) => ({\n location,\n name,\n version,\n }));\n } catch {\n return [];\n }\n}\n"],"names":["getPackagesWithInstallScripts","SELECTORS","map","script","join","result","runCommand","JSON","parse","location","name","version"],"mappings":";;;;+BAiBgBA;;;eAAAA;;;oBAjBW;AAQ3B;;;;CAIC,GACD,MAAMC,YAAY;IAAC;IAAc;IAAW;CAAc,CACrDC,GAAG,CAACC,CAAAA,SAAU,CAAC,eAAe,EAAEA,OAAO,EAAE,CAAC,EAC1CC,IAAI,CAAC;AAEH,SAASJ;IACZ,IAAI;QACA,MAAMK,SAASC,IAAAA,cAAU,EAAC,OAAO;YAAC;YAASL;YAAW;SAAS;QAC/D,OAAOM,KAAKC,KAAK,CAACH,QAAQH,GAAG,CAAC,CAAC,EAAEO,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAqB,GAAM,CAAA;gBAC/EF;gBACAC;gBACAC;YACJ,CAAA;IACJ,EAAE,eAAM;QACJ,OAAO,EAAE;IACb;AACJ"}
1
+ {"version":3,"sources":["../../src/utils/get-packages-with-install-scripts.ts"],"sourcesContent":["import { runCommand } from './os';\n\ninterface PackageWithScript {\n location: string;\n name: string;\n version: string;\n}\n\n/*\n * Keep this selector free of whitespace. On Windows npm runs through a shell (npm.CMD) and\n * execFileSync passes args unquoted, so a space would split the selector at the shell and npm\n * query would receive a truncated, invalid selector.\n */\nconst SELECTORS = ['preinstall', 'install', 'postinstall']\n .map(script => `:attr(scripts,[${script}])`)\n .join(',');\n\nexport function getPackagesWithInstallScripts(): PackageWithScript[] {\n const result = runCommand('npm', ['query', SELECTORS, '--json']);\n return JSON.parse(result).map(({ location, name, version }: PackageWithScript) => ({\n location,\n name,\n version,\n }));\n}\n"],"names":["getPackagesWithInstallScripts","SELECTORS","map","script","join","result","runCommand","JSON","parse","location","name","version"],"mappings":";;;;+BAiBgBA;;;eAAAA;;;oBAjBW;AAQ3B;;;;CAIC,GACD,MAAMC,YAAY;IAAC;IAAc;IAAW;CAAc,CACrDC,GAAG,CAACC,CAAAA,SAAU,CAAC,eAAe,EAAEA,OAAO,EAAE,CAAC,EAC1CC,IAAI,CAAC;AAEH,SAASJ;IACZ,MAAMK,SAASC,IAAAA,cAAU,EAAC,OAAO;QAAC;QAASL;QAAW;KAAS;IAC/D,OAAOM,KAAKC,KAAK,CAACH,QAAQH,GAAG,CAAC,CAAC,EAAEO,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAqB,GAAM,CAAA;YAC/EF;YACAC;YACAC;QACJ,CAAA;AACJ"}
@@ -1,3 +1,4 @@
1
+ export * from './audited-scripts';
1
2
  export * from './ci';
2
3
  export * from './debug';
3
4
  export * from './find-up';
@@ -8,5 +9,6 @@ export * from './git';
8
9
  export * from './npm';
9
10
  export * from './os';
10
11
  export * from './read-json';
12
+ export * from './version-compare';
11
13
  export * from './warn-untrusted-install-scripts';
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,qCAAqC,CAAC;AACpD,cAAc,eAAe,CAAC;AAC9B,cAAc,mCAAmC,CAAC;AAClD,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,qCAAqC,CAAC;AACpD,cAAc,eAAe,CAAC;AAC9B,cAAc,mCAAmC,CAAC;AAClD,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
+ _export_star(require("./audited-scripts"), exports);
5
6
  _export_star(require("./ci"), exports);
6
7
  _export_star(require("./debug"), exports);
7
8
  _export_star(require("./find-up"), exports);
@@ -12,6 +13,7 @@ _export_star(require("./git"), exports);
12
13
  _export_star(require("./npm"), exports);
13
14
  _export_star(require("./os"), exports);
14
15
  _export_star(require("./read-json"), exports);
16
+ _export_star(require("./version-compare"), exports);
15
17
  _export_star(require("./warn-untrusted-install-scripts"), exports);
16
18
  function _export_star(from, to) {
17
19
  Object.keys(from).forEach(function(k) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './ci';\nexport * from './debug';\nexport * from './find-up';\nexport * from './get-packages-with-install-scripts';\nexport * from './get-version';\nexport * from './get-workspace-root-package-json';\nexport * from './git';\nexport * from './npm';\nexport * from './os';\nexport * from './read-json';\nexport * from './warn-untrusted-install-scripts';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './audited-scripts';\nexport * from './ci';\nexport * from './debug';\nexport * from './find-up';\nexport * from './get-packages-with-install-scripts';\nexport * from './get-version';\nexport * from './get-workspace-root-package-json';\nexport * from './git';\nexport * from './npm';\nexport * from './os';\nexport * from './read-json';\nexport * from './version-compare';\nexport * from './warn-untrusted-install-scripts';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -0,0 +1,2 @@
1
+ export declare function versionCompare(version: string, otherVersion: string): -1 | 0 | 1;
2
+ //# sourceMappingURL=version-compare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-compare.d.ts","sourceRoot":"","sources":["../../src/utils/version-compare.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAwBhF"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "versionCompare", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return versionCompare;
9
+ }
10
+ });
11
+ function versionCompare(version, otherVersion) {
12
+ const [versionCore, versionPrerelease] = splitPrerelease(version);
13
+ const [otherCore, otherPrerelease] = splitPrerelease(otherVersion);
14
+ const parts = parseVersion(versionCore);
15
+ const otherParts = parseVersion(otherCore);
16
+ const length = Math.max(parts.length, otherParts.length);
17
+ for(let i = 0; i < length; i++){
18
+ var _parts_i, _otherParts_i;
19
+ const part = (_parts_i = parts[i]) !== null && _parts_i !== void 0 ? _parts_i : 0;
20
+ const otherPart = (_otherParts_i = otherParts[i]) !== null && _otherParts_i !== void 0 ? _otherParts_i : 0;
21
+ if (part !== otherPart) {
22
+ return part > otherPart ? 1 : -1;
23
+ }
24
+ }
25
+ /*
26
+ * Same core version: a pre-release build (e.g. "-canary.5") has lower
27
+ * precedence than the plain release it precedes.
28
+ */ if (!!versionPrerelease === !!otherPrerelease) {
29
+ return 0;
30
+ }
31
+ return versionPrerelease ? -1 : 1;
32
+ }
33
+ function splitPrerelease(version) {
34
+ const [core, ...prerelease] = version.trim().split('-');
35
+ return [
36
+ core,
37
+ prerelease.length > 0 ? prerelease.join('-') : undefined
38
+ ];
39
+ }
40
+ function parseVersion(version) {
41
+ return version.split('.').map((part)=>parseInt(part, 10) || 0);
42
+ }
43
+
44
+ //# sourceMappingURL=version-compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/version-compare.ts"],"sourcesContent":["export function versionCompare(version: string, otherVersion: string): -1 | 0 | 1 {\n const [versionCore, versionPrerelease] = splitPrerelease(version);\n const [otherCore, otherPrerelease] = splitPrerelease(otherVersion);\n\n const parts = parseVersion(versionCore);\n const otherParts = parseVersion(otherCore);\n\n const length = Math.max(parts.length, otherParts.length);\n for (let i = 0; i < length; i++) {\n const part = parts[i] ?? 0;\n const otherPart = otherParts[i] ?? 0;\n if (part !== otherPart) {\n return part > otherPart ? 1 : -1;\n }\n }\n\n /*\n * Same core version: a pre-release build (e.g. \"-canary.5\") has lower\n * precedence than the plain release it precedes.\n */\n if (!!versionPrerelease === !!otherPrerelease) {\n return 0;\n }\n return versionPrerelease ? -1 : 1;\n}\n\nfunction splitPrerelease(version: string): [core: string, prerelease: string | undefined] {\n const [core, ...prerelease] = version.trim().split('-');\n return [core, prerelease.length > 0 ? prerelease.join('-') : undefined];\n}\n\nfunction parseVersion(version: string): number[] {\n return version.split('.').map(part => parseInt(part, 10) || 0);\n}\n"],"names":["versionCompare","version","otherVersion","versionCore","versionPrerelease","splitPrerelease","otherCore","otherPrerelease","parts","parseVersion","otherParts","length","Math","max","i","part","otherPart","core","prerelease","trim","split","join","undefined","map","parseInt"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,eAAeC,OAAe,EAAEC,YAAoB;IAChE,MAAM,CAACC,aAAaC,kBAAkB,GAAGC,gBAAgBJ;IACzD,MAAM,CAACK,WAAWC,gBAAgB,GAAGF,gBAAgBH;IAErD,MAAMM,QAAQC,aAAaN;IAC3B,MAAMO,aAAaD,aAAaH;IAEhC,MAAMK,SAASC,KAAKC,GAAG,CAACL,MAAMG,MAAM,EAAED,WAAWC,MAAM;IACvD,IAAK,IAAIG,IAAI,GAAGA,IAAIH,QAAQG,IAAK;YAChBN,UACKE;QADlB,MAAMK,QAAOP,WAAAA,KAAK,CAACM,EAAE,cAARN,sBAAAA,WAAY;QACzB,MAAMQ,aAAYN,gBAAAA,UAAU,CAACI,EAAE,cAAbJ,2BAAAA,gBAAiB;QACnC,IAAIK,SAASC,WAAW;YACpB,OAAOD,OAAOC,YAAY,IAAI,CAAC;QACnC;IACJ;IAEA;;;KAGC,GACD,IAAI,CAAC,CAACZ,sBAAsB,CAAC,CAACG,iBAAiB;QAC3C,OAAO;IACX;IACA,OAAOH,oBAAoB,CAAC,IAAI;AACpC;AAEA,SAASC,gBAAgBJ,OAAe;IACpC,MAAM,CAACgB,MAAM,GAAGC,WAAW,GAAGjB,QAAQkB,IAAI,GAAGC,KAAK,CAAC;IACnD,OAAO;QAACH;QAAMC,WAAWP,MAAM,GAAG,IAAIO,WAAWG,IAAI,CAAC,OAAOC;KAAU;AAC3E;AAEA,SAASb,aAAaR,OAAe;IACjC,OAAOA,QAAQmB,KAAK,CAAC,KAAKG,GAAG,CAACR,CAAAA,OAAQS,SAAST,MAAM,OAAO;AAChE"}
@@ -1,2 +1,3 @@
1
- export declare function warnUntrustedInstallScripts(allowedScripts: string[]): void;
1
+ import type { AuditedScript } from './audited-scripts';
2
+ export declare function warnUntrustedInstallScripts(allowedScripts: string[], ignored: AuditedScript[]): void;
2
3
  //# sourceMappingURL=warn-untrusted-install-scripts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"warn-untrusted-install-scripts.d.ts","sourceRoot":"","sources":["../../src/utils/warn-untrusted-install-scripts.ts"],"names":[],"mappings":"AAsBA,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE,QAmBnE"}
1
+ {"version":3,"file":"warn-untrusted-install-scripts.d.ts","sourceRoot":"","sources":["../../src/utils/warn-untrusted-install-scripts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,QAsC7F"}
@@ -9,31 +9,24 @@ Object.defineProperty(exports, "warnUntrustedInstallScripts", {
9
9
  }
10
10
  });
11
11
  const _getpackageswithinstallscripts = require("./get-packages-with-install-scripts");
12
- // These packages have scripts, but don't need them to function correctly.
13
- const IGNORE = [
14
- '@parcel/watcher',
15
- '@progress/kendo-licensing',
16
- '@scarf/scarf',
17
- '@swc/core',
18
- '@tree-sitter-grammars/tree-sitter-yaml',
19
- '@vaadin/vaadin-usage-statistics',
20
- 'contentful',
21
- 'core-js-pure',
22
- 'core-js',
23
- 'es5-ext',
24
- 'esbuild',
25
- 'less',
26
- 'tree-sitter-json',
27
- 'unrs-resolver'
28
- ];
29
- function warnUntrustedInstallScripts(allowedScripts) {
30
- const packages = (0, _getpackageswithinstallscripts.getPackagesWithInstallScripts)();
31
- const trustedOrIgnored = new Set([
32
- ...allowedScripts,
33
- ...IGNORE
34
- ]);
35
- const untrusted = packages.filter(({ location, name })=>{
36
- return !!location && !trustedOrIgnored.has(name);
12
+ const _versioncompare = require("./version-compare");
13
+ function warnUntrustedInstallScripts(allowedScripts, ignored) {
14
+ let packages;
15
+ try {
16
+ packages = (0, _getpackageswithinstallscripts.getPackagesWithInstallScripts)();
17
+ } catch (error) {
18
+ console.warn(`WARNING: Unable to check for untrusted install scripts: ${error}`);
19
+ return;
20
+ }
21
+ const untrusted = packages.filter(({ location, name, version })=>{
22
+ if (!location || allowedScripts.includes(name) || allowedScripts.includes(`${name}@${version}`)) {
23
+ return false;
24
+ }
25
+ const ignoredEntry = ignored.find((entry)=>entry.name === name);
26
+ if (!ignoredEntry) {
27
+ return true;
28
+ }
29
+ return !!ignoredEntry.maximumVersion && (0, _versioncompare.versionCompare)(version, ignoredEntry.maximumVersion) > 0;
37
30
  });
38
31
  if (untrusted.length === 0) {
39
32
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/warn-untrusted-install-scripts.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { getPackagesWithInstallScripts } from './get-packages-with-install-scripts';\n\n// These packages have scripts, but don't need them to function correctly.\n\nconst IGNORE = [\n '@parcel/watcher', // Installs platform-specific binary via optionalDependencies, install script is a legacy fallback\n '@progress/kendo-licensing', // Validates Kendo UI license key, not needed for functionality\n '@scarf/scarf', // Sends anonymous analytics/telemetry to Scarf, usage-tracking mechanism with no functional purpose\n '@swc/core', // Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback\n '@tree-sitter-grammars/tree-sitter-yaml', // Ships prebuilds for all supported targets via node-gyp-build, install script is a source-compile fallback\n '@vaadin/vaadin-usage-statistics', // Toggles Vaadin's development-time telemetry, no effect on functionality\n 'contentful', // v9 printed a message announcing that v10 was available, no functional purpose\n 'core-js-pure', // Prints a donation/sponsorship banner to the console, no functional purpose\n 'core-js', // Prints a donation/sponsorship banner to the console, no functional purpose\n 'es5-ext', // Displays politically motivated message targeted at Russian developers, no effect on functionality\n 'esbuild', // Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback\n 'less', // Installs Playwright browsers for Less's own test suite\n 'tree-sitter-json', // Ships prebuilds for all supported targets via node-gyp-build, install script is a source-compile fallback\n 'unrs-resolver', // Installs platform-specific binary via optionalDependencies, postinstall is a legacy fallback\n];\n\nexport function warnUntrustedInstallScripts(allowedScripts: string[]) {\n const packages = getPackagesWithInstallScripts();\n const trustedOrIgnored = new Set([...allowedScripts, ...IGNORE]);\n const untrusted = packages.filter(({ location, name }) => {\n return !!location && !trustedOrIgnored.has(name);\n });\n\n if (untrusted.length === 0) {\n return;\n }\n\n const list = untrusted.map(({ name, version }) => ` - ${name}@${version}`).join('\\n');\n console.warn(\n [\n 'WARNING: The following packages have untrusted install scripts.',\n 'Review and add trusted packages to --allow-scripts:',\n list,\n ].join('\\n')\n );\n}\n"],"names":["warnUntrustedInstallScripts","IGNORE","allowedScripts","packages","getPackagesWithInstallScripts","trustedOrIgnored","Set","untrusted","filter","location","name","has","length","list","map","version","join","console","warn"],"mappings":"AAAA,6BAA6B;;;;+BAsBbA;;;eAAAA;;;+CArB8B;AAE9C,0EAA0E;AAE1E,MAAMC,SAAS;IACX;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAEM,SAASD,4BAA4BE,cAAwB;IAChE,MAAMC,WAAWC,IAAAA,4DAA6B;IAC9C,MAAMC,mBAAmB,IAAIC,IAAI;WAAIJ;WAAmBD;KAAO;IAC/D,MAAMM,YAAYJ,SAASK,MAAM,CAAC,CAAC,EAAEC,QAAQ,EAAEC,IAAI,EAAE;QACjD,OAAO,CAAC,CAACD,YAAY,CAACJ,iBAAiBM,GAAG,CAACD;IAC/C;IAEA,IAAIH,UAAUK,MAAM,KAAK,GAAG;QACxB;IACJ;IAEA,MAAMC,OAAON,UAAUO,GAAG,CAAC,CAAC,EAAEJ,IAAI,EAAEK,OAAO,EAAE,GAAK,CAAC,IAAI,EAAEL,KAAK,CAAC,EAAEK,SAAS,EAAEC,IAAI,CAAC;IACjFC,QAAQC,IAAI,CACR;QACI;QACA;QACAL;KACH,CAACG,IAAI,CAAC;AAEf"}
1
+ {"version":3,"sources":["../../src/utils/warn-untrusted-install-scripts.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { AuditedScript } from './audited-scripts';\nimport { getPackagesWithInstallScripts } from './get-packages-with-install-scripts';\nimport { versionCompare } from './version-compare';\n\nexport function warnUntrustedInstallScripts(allowedScripts: string[], ignored: AuditedScript[]) {\n let packages: ReturnType<typeof getPackagesWithInstallScripts>;\n try {\n packages = getPackagesWithInstallScripts();\n } catch (error) {\n console.warn(`WARNING: Unable to check for untrusted install scripts: ${error}`);\n return;\n }\n const untrusted = packages.filter(({ location, name, version }) => {\n if (\n !location ||\n allowedScripts.includes(name) ||\n allowedScripts.includes(`${name}@${version}`)\n ) {\n return false;\n }\n const ignoredEntry = ignored.find(entry => entry.name === name);\n if (!ignoredEntry) {\n return true;\n }\n return (\n !!ignoredEntry.maximumVersion &&\n versionCompare(version, ignoredEntry.maximumVersion) > 0\n );\n });\n\n if (untrusted.length === 0) {\n return;\n }\n\n const list = untrusted.map(({ name, version }) => ` - ${name}@${version}`).join('\\n');\n console.warn(\n [\n 'WARNING: The following packages have untrusted install scripts.',\n 'Review and add trusted packages to --allow-scripts:',\n list,\n ].join('\\n')\n );\n}\n"],"names":["warnUntrustedInstallScripts","allowedScripts","ignored","packages","getPackagesWithInstallScripts","error","console","warn","untrusted","filter","location","name","version","includes","ignoredEntry","find","entry","maximumVersion","versionCompare","length","list","map","join"],"mappings":"AAAA,6BAA6B;;;;+BAKbA;;;eAAAA;;;+CAH8B;gCACf;AAExB,SAASA,4BAA4BC,cAAwB,EAAEC,OAAwB;IAC1F,IAAIC;IACJ,IAAI;QACAA,WAAWC,IAAAA,4DAA6B;IAC5C,EAAE,OAAOC,OAAO;QACZC,QAAQC,IAAI,CAAC,CAAC,wDAAwD,EAAEF,OAAO;QAC/E;IACJ;IACA,MAAMG,YAAYL,SAASM,MAAM,CAAC,CAAC,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAE;QAC1D,IACI,CAACF,YACDT,eAAeY,QAAQ,CAACF,SACxBV,eAAeY,QAAQ,CAAC,GAAGF,KAAK,CAAC,EAAEC,SAAS,GAC9C;YACE,OAAO;QACX;QACA,MAAME,eAAeZ,QAAQa,IAAI,CAACC,CAAAA,QAASA,MAAML,IAAI,KAAKA;QAC1D,IAAI,CAACG,cAAc;YACf,OAAO;QACX;QACA,OACI,CAAC,CAACA,aAAaG,cAAc,IAC7BC,IAAAA,8BAAc,EAACN,SAASE,aAAaG,cAAc,IAAI;IAE/D;IAEA,IAAIT,UAAUW,MAAM,KAAK,GAAG;QACxB;IACJ;IAEA,MAAMC,OAAOZ,UAAUa,GAAG,CAAC,CAAC,EAAEV,IAAI,EAAEC,OAAO,EAAE,GAAK,CAAC,IAAI,EAAED,KAAK,CAAC,EAAEC,SAAS,EAAEU,IAAI,CAAC;IACjFhB,QAAQC,IAAI,CACR;QACI;QACA;QACAa;KACH,CAACE,IAAI,CAAC;AAEf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/install",
3
- "version": "39.2.0",
3
+ "version": "40.0.0",
4
4
  "description": "Lightweight wrapper around npm install that configures access to private packages",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/uikit/install",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "webpack": false
31
31
  },
32
32
  "peerDependencies": {
33
- "js-yaml": "~5.4.1"
33
+ "js-yaml": "~5.4.2"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "js-yaml": {
package/src/cli/index.ts CHANGED
@@ -11,6 +11,7 @@ const args = (function getArgs() {
11
11
  'no-allow-scripts': { type: 'boolean' },
12
12
  'allow-all-scripts': { type: 'boolean' },
13
13
  'fix': { type: 'boolean' },
14
+ 'no-min-release-age': { type: 'boolean' },
14
15
  'quiet': { type: 'boolean' },
15
16
  'token': { type: 'boolean' },
16
17
  'no-token': { type: 'boolean' },
@@ -35,6 +36,9 @@ const args = (function getArgs() {
35
36
  case 'allow-all-scripts':
36
37
  result.allowScripts = true;
37
38
  break;
39
+ case 'no-min-release-age':
40
+ result.minReleaseAge = false;
41
+ break;
38
42
  case 'no-token':
39
43
  result.token = false;
40
44
  break;
@@ -14,6 +14,7 @@ const ENVIRONMENT_VARIABLE_REGEX = /\${(?<environmentVariable>[^}]+)}/;
14
14
  export interface Args {
15
15
  allowScripts?: AllowScripts;
16
16
  fix?: boolean;
17
+ minReleaseAge?: false;
17
18
  quiet?: boolean;
18
19
  token?: boolean;
19
20
  }
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { PackageManager, getPackageManager } from './package-manager';
2
2
  export type { DeclaredVersionQuery, ResolvedVersionQuery } from './package-manager';
3
- export { gitCloneRepo, gitIsReachable, isCI, npmWhoAmI } from './utils';
3
+ export { gitCloneRepo, gitIsReachable, isCI, npmWhoAmI, versionCompare } from './utils';