@servicetitan/startup 33.0.0 → 33.0.1

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 (2) hide show
  1. package/package.json +5 -5
  2. package/src/postinstall.js +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/startup",
3
- "version": "33.0.0",
3
+ "version": "33.0.1",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/startup",
6
6
  "repository": {
@@ -53,9 +53,9 @@
53
53
  "@jest/core": "~30.2.0",
54
54
  "@jest/types": "~30.2.0",
55
55
  "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
56
- "@servicetitan/eslint-config": "33.0.0",
57
- "@servicetitan/install": "33.0.0",
58
- "@servicetitan/stylelint-config": "33.0.0",
56
+ "@servicetitan/eslint-config": "33.0.1",
57
+ "@servicetitan/install": "33.0.1",
58
+ "@servicetitan/stylelint-config": "33.0.1",
59
59
  "@svgr/webpack": "^8.1.0",
60
60
  "@swc/cli": "^0.5.0",
61
61
  "@swc/core": "1.13.5",
@@ -148,5 +148,5 @@
148
148
  "cli": {
149
149
  "webpack": false
150
150
  },
151
- "gitHead": "31ea85a4348eec3402ac60008c9c2944d34bdbb2"
151
+ "gitHead": "6a140ed15688cc4915d3d0e52000c2f8c1f381ca"
152
152
  }
@@ -1,11 +1,23 @@
1
1
  const { execFileSync } = require('child_process');
2
+ const fs = require('fs');
2
3
  const path = require('path');
3
4
 
4
5
  const cwd = process.env.INIT_CWD;
5
6
  const patchDir = path.relative(cwd, path.resolve('patches'));
6
7
 
7
- execFileSync('npx', ['patch-package', '--error-on-fail', '--patch-dir', patchDir], {
8
- cwd,
9
- shell: process.platform === 'win32',
10
- stdio: 'inherit',
11
- });
8
+ try {
9
+ // Only apply patches when installed in project (as opposed to globally or in npx cache)
10
+ if (fs.existsSync('package.json')) {
11
+ execFileSync('npx', ['patch-package', '--error-on-fail', '--patch-dir', patchDir], {
12
+ cwd,
13
+ shell: process.platform === 'win32',
14
+ stdio: 'inherit',
15
+ });
16
+ }
17
+ } catch (e) {
18
+ /*
19
+ * To avoid disrupting workflows only log warning when postinstall fails.
20
+ * To see detailed error, run npm with --foreground-scripts option.
21
+ */
22
+ console.warn(`postinstall failed`, e); // eslint-disable-line no-console
23
+ }