@kbach/native 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -53,17 +53,7 @@ module.exports = withKbachBabel({
53
53
  });
54
54
  ```
55
55
 
56
- ### 2. metro.config.js
57
-
58
- ```
59
- const { getDefaultConfig } = require('expo/metro-config');
60
- const { withKbach } = require('@kbach/native');
61
-
62
- const config = getDefaultConfig(__dirname);
63
- module.exports = withKbach(config);
64
- ```
65
-
66
- ### 3. Wrap your app
56
+ ### 2. Wrap your app
67
57
 
68
58
  ```
69
59
  import { ThemeProvider } from '@kbach/native';
@@ -77,7 +67,7 @@ export default function App() {
77
67
  }
78
68
  ```
79
69
 
80
- After changing `babel.config.js` or `metro.config.js`, clear the Metro cache:
70
+ After changing `babel.config.js`, clear the Metro cache:
81
71
 
82
72
  ```
83
73
  npx expo start --clear
package/dist/index.d.mts CHANGED
@@ -34,7 +34,7 @@ interface KbachOptions {
34
34
  * module.exports = withKbach(config);
35
35
  * ```
36
36
  */
37
- declare function withKbach(metroConfig: Record<string, any>, options?: KbachOptions): Record<string, any>;
37
+ declare function withKbach(metroConfig: Record<string, any>, _options?: KbachOptions): Record<string, any>;
38
38
  /**
39
39
  * Add the Kbach plugin to an existing Babel config.
40
40
  * Use this when you have a custom babel.config.js and want to keep it.
package/dist/index.d.ts CHANGED
@@ -34,7 +34,7 @@ interface KbachOptions {
34
34
  * module.exports = withKbach(config);
35
35
  * ```
36
36
  */
37
- declare function withKbach(metroConfig: Record<string, any>, options?: KbachOptions): Record<string, any>;
37
+ declare function withKbach(metroConfig: Record<string, any>, _options?: KbachOptions): Record<string, any>;
38
38
  /**
39
39
  * Add the Kbach plugin to an existing Babel config.
40
40
  * Use this when you have a custom babel.config.js and want to keep it.
package/dist/index.js CHANGED
@@ -29,35 +29,8 @@ module.exports = __toCommonJS(index_exports);
29
29
  __reExport(index_exports, require("@kbach/react"), module.exports);
30
30
 
31
31
  // src/setup.ts
32
- function withKbach(metroConfig, options = {}) {
33
- const {
34
- configFile = "kbach.config.js",
35
- attributes = ["tw", "className"],
36
- debug = false
37
- } = options;
38
- const pluginEntry = ["babel-plugin-kbach", { configFile, attributes, debug }];
39
- return {
40
- ...metroConfig,
41
- transformer: {
42
- ...metroConfig.transformer ?? {},
43
- getTransformOptions: wrapTransformOptions(
44
- metroConfig.transformer?.getTransformOptions,
45
- pluginEntry
46
- )
47
- }
48
- };
49
- }
50
- function wrapTransformOptions(existing, pluginEntry) {
51
- return async function getTransformOptions(...args) {
52
- const base = existing ? await existing(...args) : {};
53
- const existingPlugins = base.transform?.customTransformOptions?.babelPlugins ?? [];
54
- base.transform = base.transform ?? {};
55
- base.transform.customTransformOptions = {
56
- ...base.transform.customTransformOptions ?? {},
57
- babelPlugins: [pluginEntry, ...existingPlugins]
58
- };
59
- return base;
60
- };
32
+ function withKbach(metroConfig, _options = {}) {
33
+ return metroConfig;
61
34
  }
62
35
  function withKbachBabel(babelConfig, options = {}) {
63
36
  const {
@@ -65,7 +38,7 @@ function withKbachBabel(babelConfig, options = {}) {
65
38
  attributes = ["tw", "className"],
66
39
  debug = false
67
40
  } = options;
68
- const pluginEntry = ["babel-plugin-kbach", { configFile, attributes, debug }];
41
+ const pluginEntry = ["babel-plugin-kbach", { configFile, attributes, debug, jsxRuntime: false }];
69
42
  const presets = (babelConfig.presets ?? []).map((preset) => {
70
43
  const [name, presetOpts = {}] = Array.isArray(preset) ? preset : [preset, {}];
71
44
  if (name === "babel-preset-expo" || name === "@babel/preset-react" || typeof name === "string" && name.includes("react")) {
package/dist/index.mjs CHANGED
@@ -2,35 +2,8 @@
2
2
  export * from "@kbach/react";
3
3
 
4
4
  // src/setup.ts
5
- function withKbach(metroConfig, options = {}) {
6
- const {
7
- configFile = "kbach.config.js",
8
- attributes = ["tw", "className"],
9
- debug = false
10
- } = options;
11
- const pluginEntry = ["babel-plugin-kbach", { configFile, attributes, debug }];
12
- return {
13
- ...metroConfig,
14
- transformer: {
15
- ...metroConfig.transformer ?? {},
16
- getTransformOptions: wrapTransformOptions(
17
- metroConfig.transformer?.getTransformOptions,
18
- pluginEntry
19
- )
20
- }
21
- };
22
- }
23
- function wrapTransformOptions(existing, pluginEntry) {
24
- return async function getTransformOptions(...args) {
25
- const base = existing ? await existing(...args) : {};
26
- const existingPlugins = base.transform?.customTransformOptions?.babelPlugins ?? [];
27
- base.transform = base.transform ?? {};
28
- base.transform.customTransformOptions = {
29
- ...base.transform.customTransformOptions ?? {},
30
- babelPlugins: [pluginEntry, ...existingPlugins]
31
- };
32
- return base;
33
- };
5
+ function withKbach(metroConfig, _options = {}) {
6
+ return metroConfig;
34
7
  }
35
8
  function withKbachBabel(babelConfig, options = {}) {
36
9
  const {
@@ -38,7 +11,7 @@ function withKbachBabel(babelConfig, options = {}) {
38
11
  attributes = ["tw", "className"],
39
12
  debug = false
40
13
  } = options;
41
- const pluginEntry = ["babel-plugin-kbach", { configFile, attributes, debug }];
14
+ const pluginEntry = ["babel-plugin-kbach", { configFile, attributes, debug, jsxRuntime: false }];
42
15
  const presets = (babelConfig.presets ?? []).map((preset) => {
43
16
  const [name, presetOpts = {}] = Array.isArray(preset) ? preset : [preset, {}];
44
17
  if (name === "babel-preset-expo" || name === "@babel/preset-react" || typeof name === "string" && name.includes("react")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/native",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Single-package Kbach install for React Native and Expo — includes core, components, Babel plugin, and Metro config",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@kbach/core": "0.1.0",
37
37
  "@kbach/react": "0.1.4",
38
- "babel-plugin-kbach": "0.1.0"
38
+ "babel-plugin-kbach": "0.1.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/react": "^19.2.0",