aport-tools 2.1.4 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v2.1.4 | ISC */
1
+ /*! aport-tools v2.1.5 | ISC */
2
2
  import React, { createContext, useState, useEffect, useContext } from 'react';
3
3
  import { Appearance, StyleSheet, View, Text, Switch } from 'react-native';
4
4
  import AsyncStorage from '@react-native-async-storage/async-storage';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v2.1.4 | ISC */
1
+ /*! aport-tools v2.1.5 | ISC */
2
2
  'use strict';
3
3
 
4
4
  var React = require('react');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aport-tools",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Aport mobile Tools with modern and minimalistic design",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -16,6 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "rollup -c rollup.config.mjs",
18
18
  "prepare": "npm run build",
19
+ "postpublish": "node scripts/fix-async-storage-import.js",
19
20
  "test": "echo \"Error: no test specified\" && exit 1"
20
21
  },
21
22
  "keywords": [
@@ -0,0 +1,22 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const filePath = path.resolve(__dirname, '../dist/index.js'); // Adjust path as necessary
5
+
6
+ fs.readFile(filePath, 'utf8', (err, data) => {
7
+ if (err) {
8
+ console.error('Error reading file:', err);
9
+ return;
10
+ }
11
+
12
+ const result = data.replace(/var AsyncStorage = require\('@react-native-async-storage\/async-storage'\);/g,
13
+ "import AsyncStorage from '@react-native-async-storage/async-storage';");
14
+
15
+ fs.writeFile(filePath, result, 'utf8', (err) => {
16
+ if (err) {
17
+ console.error('Error writing file:', err);
18
+ } else {
19
+ console.log('AsyncStorage import fixed in index.js');
20
+ }
21
+ });
22
+ });