From 98d165c18edd4356533d4792645fac49f0faa39f Mon Sep 17 00:00:00 2001 From: Abdullah Mzaien Date: Sat, 2 Mar 2024 12:04:52 +0300 Subject: [PATCH] chore: use package.json data --- build/index.js | 3 ++- src/index.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build/index.js b/build/index.js index 2c00b25..e64c149 100644 --- a/build/index.js +++ b/build/index.js @@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const config_plugins_1 = require("@expo/config-plugins"); const fs_extra_1 = require("fs-extra"); const path = __importStar(require("path")); +const metaData = (0, fs_extra_1.readJsonSync)('./package.json'); function withCustomAssetsAndroid(config, props) { // Specify the source directory of your assets const assetSourceDir = props.assetsPath; @@ -122,4 +123,4 @@ const withCustomAssets = (config, props) => { config = withCustomAssetsAndroid(config, props); return config; }; -exports.default = (0, config_plugins_1.createRunOncePlugin)(withCustomAssets, "expo-custom-assets", "1.2.1"); +exports.default = (0, config_plugins_1.createRunOncePlugin)(withCustomAssets, metaData.name, metaData.version); diff --git a/src/index.ts b/src/index.ts index 4130717..536cddc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,8 +13,10 @@ import { existsSync, readFile, writeFile, + readJsonSync } from "fs-extra"; import * as path from "path"; +const metaData = readJsonSync('./package.json'); function withCustomAssetsAndroid( config: ExpoConfig, props: { assetsPath: string } @@ -152,6 +154,6 @@ const withCustomAssets: ConfigPlugin<{ assetsPath: string }> = ( export default createRunOncePlugin( withCustomAssets, - "expo-custom-assets", - "1.2.1", + metaData.name, + metaData.version, );