@kbach/react 0.5.1 → 0.5.3

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.
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-EBISJEHP.mjs";
6
- import "./chunk-M3LZVDYD.mjs";
5
+ } from "./chunk-7C3WGTMN.mjs";
6
+ import "./chunk-OKK7AJ2G.mjs";
7
7
  export {
8
8
  Fragment,
9
9
  jsx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "React / React Native components and hooks for the Kbach framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",
@@ -33,7 +33,8 @@
33
33
  "build": "tsup src/index.ts src/jsx-runtime.tsx src/jsx-dev-runtime.tsx --format esm,cjs --dts --clean",
34
34
  "dev": "tsup src/index.ts src/jsx-runtime.tsx src/jsx-dev-runtime.tsx --format esm,cjs --dts --watch",
35
35
  "test": "vitest run --passWithNoTests",
36
- "lint": "tsc --noEmit"
36
+ "lint": "tsc --noEmit",
37
+ "postinstall": "node scripts/postinstall.js"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@types/react": "^19.2.0",
@@ -53,6 +54,8 @@
53
54
  "access": "public"
54
55
  },
55
56
  "files": [
56
- "dist"
57
+ "dist",
58
+ "scripts",
59
+ "KBACH.md"
57
60
  ]
58
61
  }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ // INIT_CWD is set by npm to the directory where `npm install` was invoked —
8
+ // i.e. the user's project root. It is not set during a local `npm pack` / publish run.
9
+ const projectRoot = process.env.INIT_CWD;
10
+ if (!projectRoot) process.exit(0);
11
+
12
+ // Safety: never write outside the user's project (e.g. if somehow inside node_modules)
13
+ if (projectRoot.includes('node_modules')) process.exit(0);
14
+
15
+ // Don't overwrite an existing file — user may have customised it.
16
+ const dest = path.join(projectRoot, 'KBACH.md');
17
+ if (fs.existsSync(dest)) process.exit(0);
18
+
19
+ // The reference file ships alongside this script inside the npm package.
20
+ const src = path.join(__dirname, '..', 'KBACH.md');
21
+ if (!fs.existsSync(src)) process.exit(0);
22
+
23
+ try {
24
+ fs.copyFileSync(src, dest);
25
+ console.log('[kbach] Created KBACH.md in your project — AI reference for all Kbach utilities and modifiers.');
26
+ } catch {
27
+ // Never break an install over a doc file.
28
+ }