@axium/server 0.44.0 → 0.44.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 +2 -2
  2. package/patches/patch.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.44.0",
3
+ "version": "0.44.1",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -43,7 +43,7 @@
43
43
  "build": "tsc",
44
44
  "build:schemas": "mkdir -p schemas && node dist/main.js config schema -j > schemas/config.json && node dist/main.js db json-schema -j > schemas/db.json",
45
45
  "clean": "rm -rf build .svelte-kit node_modules/{.vite,.vite-temp}",
46
- "postinstall": "patch-package"
46
+ "postinstall": "node patches/patch.js"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@axium/client": ">=0.21.0",
@@ -0,0 +1,12 @@
1
+ import { relative, join } from 'node:path';
2
+ import { execFileSync } from 'node:child_process';
3
+
4
+ // If this package is installed as a dependency (inside node_modules),
5
+ // we want to run patch-package from the consumer's root directory (INIT_CWD).
6
+ const cwd = process.cwd();
7
+ const init = cwd.includes('node_modules') ? process.env.INIT_CWD || cwd : cwd;
8
+
9
+ const patchesRelativePath = relative(init, join(cwd, 'patches'));
10
+
11
+ const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx';
12
+ execFileSync(npx, ['patch-package', '--patch-dir', patchesRelativePath], { cwd: init, stdio: 'inherit' });