@kirill.konshin/react-native 0.0.1 → 0.0.2

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/.ctirc CHANGED
@@ -1,11 +1,20 @@
1
1
  {
2
- "addNewline": true,
3
- "fileExcludePatterns": [
4
- "*.stories.*",
5
- "*.test.*",
6
- "*.fixture.*"
7
- ],
8
- "verbose": false,
9
- "withoutBackupFile": true,
10
- "withoutComment": true
11
- }
2
+ "options": [
3
+ {
4
+ "mode": "create",
5
+ "project": "tsconfig.json",
6
+ "include": "src/**/*.{ts,tsx}",
7
+ "exclude": [
8
+ "**/*.stories.*",
9
+ "**/*.test.*",
10
+ "**/*.fixture.*"
11
+ ],
12
+ "startFrom": "src",
13
+ "backup": false,
14
+ "overwrite": true,
15
+ "generationStyle": "default-alias-named-star",
16
+ "output": "src",
17
+ "verbose": true
18
+ }
19
+ ]
20
+ }
@@ -1,5 +1,12 @@
1
1
  vite v7.0.6 building SSR bundle for production...
2
- create succeeded: /home/runner/work/utils/utils/packages/react-native/src
2
+ - ctix 'create' mode start, ...
3
+ ✔ /home/runner/work/utils/utils/packages/react-native/tsconfig.json loading complete!
4
+ ✔ analysis export statements completed!
5
+ - build "index.ts" file start
6
+ - output file exists check, ...
7
+
8
+
9
+ ✔ ctix 'create' mode complete!
3
10
  transforming...
4
11
  ✓ 4 modules transformed.
5
12
  rendering chunks...
@@ -8,8 +15,8 @@ rendering chunks...
8
15
  dist/index.js 0.21 kB │ map: 0.09 kB
9
16
  dist/useAppState.js 0.47 kB │ map: 0.89 kB
10
17
  dist/share.js 0.85 kB │ map: 1.78 kB
11
- dist/update.js 1.05 kB │ map: 2.00 kB
12
- [vite:dts] Declaration files built in 1414ms.
18
+ dist/update.js 1.06 kB │ map: 2.09 kB
19
+ [vite:dts] Declaration files built in 1478ms.
13
20
 
14
- ✓ built in 2.11s
21
+ ✓ built in 4.71s
15
22
  Updated package.json with exports
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # @kirill.konshin/react-native
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 63fdba8: Agent-assisted refactoring
8
+ - 63fdba8: Divided core to browser/node/worker-specific packages, CTIX upgrade, etc.
package/dist/update.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import { FC } from 'react';
2
- export declare const Update: FC<any>;
2
+ export type UpdateProps = {
3
+ children: any;
4
+ };
5
+ export declare const Update: FC<UpdateProps>;
3
6
  //# sourceMappingURL=update.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAGhD,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,GAAG,CAmC1B,CAAC"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA6B,MAAM,OAAO,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,EAAE,GAAG,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAmCjC,CAAC"}
package/dist/update.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsxs } from "react/jsx-runtime";
2
2
  import * as Updates from "expo-updates";
3
- import { useState, useEffect } from "react";
3
+ import { memo, useState, useEffect } from "react";
4
4
  import { Text } from "react-native";
5
- const Update = function Update2({ children }) {
5
+ const Update = memo(function Update2({ children }) {
6
6
  const [updating, setUpdating] = useState(true);
7
7
  useEffect(() => {
8
8
  (async () => {
@@ -33,7 +33,7 @@ const Update = function Update2({ children }) {
33
33
  ] });
34
34
  }
35
35
  return children;
36
- };
36
+ });
37
37
  export {
38
38
  Update
39
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sources":["../src/update.tsx"],"sourcesContent":["import * as Updates from 'expo-updates';\nimport { FC, useEffect, useState } from 'react';\nimport { Text } from 'react-native';\n\nexport const Update: FC<any> = function Update({ children }) {\n //FIXME useUpdates https://blog.expo.dev/feature-preview-updates-js-api-for-expo-updates-3b92beb40dab\n const [updating, setUpdating] = useState(true);\n\n useEffect(() => {\n (async () => {\n try {\n if (__DEV__) {\n setUpdating(false);\n return;\n }\n\n const update = await Updates.checkForUpdateAsync();\n\n if (!update.isAvailable) {\n setUpdating(false);\n return;\n }\n\n await Updates.fetchUpdateAsync();\n alert('Update is available. App will reload.');\n await Updates.reloadAsync();\n } catch (error) {\n // You can also add an alert() to see the error message in case of an error when fetching updates.\n alert(`Error fetching latest Expo update: ${error}`);\n setUpdating(false);\n }\n })();\n });\n\n if (updating) {\n return <Text>Checking for updates ({Updates.channel})...</Text>;\n }\n\n return children;\n};\n"],"names":["Update"],"mappings":";;;;AAIO,MAAM,SAAkB,SAASA,QAAO,EAAE,YAAY;AAEzD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,IAAI;AAE7C,YAAU,MAAM;AACZ,KAAC,YAAY;AACT,UAAI;AACA,YAAI,SAAS;AACT,sBAAY,KAAK;AACjB;AAAA,QACJ;AAEA,cAAM,SAAS,MAAM,QAAQ,oBAAA;AAE7B,YAAI,CAAC,OAAO,aAAa;AACrB,sBAAY,KAAK;AACjB;AAAA,QACJ;AAEA,cAAM,QAAQ,iBAAA;AACd,cAAM,uCAAuC;AAC7C,cAAM,QAAQ,YAAA;AAAA,MAClB,SAAS,OAAO;AAEZ,cAAM,sCAAsC,KAAK,EAAE;AACnD,oBAAY,KAAK;AAAA,MACrB;AAAA,IACJ,GAAA;AAAA,EACJ,CAAC;AAED,MAAI,UAAU;AACV,gCAAQ,MAAA,EAAK,UAAA;AAAA,MAAA;AAAA,MAAuB,QAAQ;AAAA,MAAQ;AAAA,IAAA,GAAI;AAAA,EAC5D;AAEA,SAAO;AACX;"}
1
+ {"version":3,"file":"update.js","sources":["../src/update.tsx"],"sourcesContent":["import * as Updates from 'expo-updates';\nimport { FC, memo, useEffect, useState } from 'react';\nimport { Text } from 'react-native';\n\nexport type UpdateProps = {\n children: any;\n};\n\nexport const Update: FC<UpdateProps> = memo(function Update({ children }) {\n //FIXME useUpdates https://blog.expo.dev/feature-preview-updates-js-api-for-expo-updates-3b92beb40dab\n const [updating, setUpdating] = useState(true);\n\n useEffect(() => {\n (async () => {\n try {\n if (__DEV__) {\n setUpdating(false);\n return;\n }\n\n const update = await Updates.checkForUpdateAsync();\n\n if (!update.isAvailable) {\n setUpdating(false);\n return;\n }\n\n await Updates.fetchUpdateAsync();\n alert('Update is available. App will reload.');\n await Updates.reloadAsync();\n } catch (error) {\n // You can also add an alert() to see the error message in case of an error when fetching updates.\n alert(`Error fetching latest Expo update: ${error}`);\n setUpdating(false);\n }\n })();\n });\n\n if (updating) {\n return <Text>Checking for updates ({Updates.channel})...</Text>;\n }\n\n return children;\n});\n"],"names":["Update"],"mappings":";;;;AAQO,MAAM,SAA0B,KAAK,SAASA,QAAO,EAAE,YAAY;AAEtE,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,IAAI;AAE7C,YAAU,MAAM;AACZ,KAAC,YAAY;AACT,UAAI;AACA,YAAI,SAAS;AACT,sBAAY,KAAK;AACjB;AAAA,QACJ;AAEA,cAAM,SAAS,MAAM,QAAQ,oBAAA;AAE7B,YAAI,CAAC,OAAO,aAAa;AACrB,sBAAY,KAAK;AACjB;AAAA,QACJ;AAEA,cAAM,QAAQ,iBAAA;AACd,cAAM,uCAAuC;AAC7C,cAAM,QAAQ,YAAA;AAAA,MAClB,SAAS,OAAO;AAEZ,cAAM,sCAAsC,KAAK,EAAE;AACnD,oBAAY,KAAK;AAAA,MACrB;AAAA,IACJ,GAAA;AAAA,EACJ,CAAC;AAED,MAAI,UAAU;AACV,gCAAQ,MAAA,EAAK,UAAA;AAAA,MAAA;AAAA,MAAuB,QAAQ;AAAA,MAAQ;AAAA,IAAA,GAAI;AAAA,EAC5D;AAEA,SAAO;AACX,CAAC;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@kirill.konshin/react-native",
3
3
  "description": "Utilities",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "----- BUILD -----": "",
8
8
  "clean": "rm -rf dist .tscache tsconfig.tsbuildinfo",
9
9
  "build": "vite build",
10
- "build:index": "cti create ./src",
10
+ "build:index": "ctix build",
11
11
  "build:check-types": "attw --pack .",
12
12
  "start": "yarn build --watch",
13
13
  "wait": "wait-on ./dist/index.js",
package/src/update.tsx CHANGED
@@ -1,8 +1,12 @@
1
1
  import * as Updates from 'expo-updates';
2
- import { FC, useEffect, useState } from 'react';
2
+ import { FC, memo, useEffect, useState } from 'react';
3
3
  import { Text } from 'react-native';
4
4
 
5
- export const Update: FC<any> = function Update({ children }) {
5
+ export type UpdateProps = {
6
+ children: any;
7
+ };
8
+
9
+ export const Update: FC<UpdateProps> = memo(function Update({ children }) {
6
10
  //FIXME useUpdates https://blog.expo.dev/feature-preview-updates-js-api-for-expo-updates-3b92beb40dab
7
11
  const [updating, setUpdating] = useState(true);
8
12
 
@@ -37,4 +41,4 @@ export const Update: FC<any> = function Update({ children }) {
37
41
  }
38
42
 
39
43
  return children;
40
- };
44
+ });