create-expo-module
Advanced tools
Comparing version 0.8.8 to 0.8.9-canary-20241211-61c49bd
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,3 +30,2 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.eventCreateExpoModule = exports.logEventAsync = exports.getTelemetryClient = void 0; | ||
const getUserState_1 = require("@expo/config/build/getUserState"); | ||
const json_file_1 = __importDefault(require("@expo/json-file")); | ||
@@ -13,3 +35,4 @@ const rudder_sdk_node_1 = __importDefault(require("@expo/rudder-sdk-node")); | ||
const getenv_1 = require("getenv"); | ||
const os_1 = __importDefault(require("os")); | ||
const os_1 = __importStar(require("os")); | ||
const path = __importStar(require("path")); | ||
const packageJson = require('../package.json'); | ||
@@ -37,5 +60,23 @@ /** If telemetry is disabled by the user */ | ||
exports.getTelemetryClient = getTelemetryClient; | ||
// The ~/.expo directory is used to store authentication sessions, | ||
// which are shared between EAS CLI and Expo CLI. | ||
function getExpoHomeDirectory() { | ||
const home = (0, os_1.homedir)(); | ||
if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) { | ||
return process.env.__UNSAFE_EXPO_HOME_DIRECTORY; | ||
} | ||
else if ((0, getenv_1.boolish)('EXPO_STAGING', false)) { | ||
return path.join(home, '.expo-staging'); | ||
} | ||
else if ((0, getenv_1.boolish)('EXPO_LOCAL', false)) { | ||
return path.join(home, '.expo-local'); | ||
} | ||
return path.join(home, '.expo'); | ||
} | ||
function getUserStatePath() { | ||
return path.join(getExpoHomeDirectory(), 'state.json'); | ||
} | ||
/** Get the randomly generated anonymous ID from the persistent storage, see @expo/cli */ | ||
async function getTelemetryIdAsync() { | ||
const settings = new json_file_1.default((0, getUserState_1.getUserStatePath)(), { | ||
const settings = new json_file_1.default(getUserStatePath(), { | ||
ensureDir: true, | ||
@@ -42,0 +83,0 @@ jsonParseErrorDefault: {}, |
{ | ||
"name": "create-expo-module", | ||
"version": "0.8.8", | ||
"version": "0.8.9-canary-20241211-61c49bd", | ||
"description": "The script to create the Expo module", | ||
@@ -36,4 +36,4 @@ "main": "build/create-expo-module.js", | ||
"dependencies": { | ||
"@expo/config": "~10.0.4", | ||
"@expo/json-file": "^9.0.0", | ||
"@expo/config": "11.0.0-canary-20241211-61c49bd", | ||
"@expo/json-file": "9.0.1-canary-20241211-61c49bd", | ||
"@expo/rudder-sdk-node": "^1.1.1", | ||
@@ -59,5 +59,4 @@ "@expo/spawn-async": "^1.7.2", | ||
"@types/prompts": "^2.4.9", | ||
"expo-module-scripts": "^4.0.0" | ||
}, | ||
"gitHead": "728158f99d680cf64fb06f08301d3806c18c6f63" | ||
"expo-module-scripts": "4.0.3-canary-20241211-61c49bd" | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
import { getUserStatePath } from '@expo/config/build/getUserState'; | ||
import JsonFile from '@expo/json-file'; | ||
@@ -6,3 +5,4 @@ import TelemetryClient from '@expo/rudder-sdk-node'; | ||
import { boolish } from 'getenv'; | ||
import os from 'os'; | ||
import os, { homedir } from 'os'; | ||
import * as path from 'path'; | ||
@@ -41,2 +41,20 @@ import { CommandOptions } from './types'; | ||
// The ~/.expo directory is used to store authentication sessions, | ||
// which are shared between EAS CLI and Expo CLI. | ||
function getExpoHomeDirectory() { | ||
const home = homedir(); | ||
if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) { | ||
return process.env.__UNSAFE_EXPO_HOME_DIRECTORY; | ||
} else if (boolish('EXPO_STAGING', false)) { | ||
return path.join(home, '.expo-staging'); | ||
} else if (boolish('EXPO_LOCAL', false)) { | ||
return path.join(home, '.expo-local'); | ||
} | ||
return path.join(home, '.expo'); | ||
} | ||
function getUserStatePath() { | ||
return path.join(getExpoHomeDirectory(), 'state.json'); | ||
} | ||
/** Get the randomly generated anonymous ID from the persistent storage, see @expo/cli */ | ||
@@ -43,0 +61,0 @@ async function getTelemetryIdAsync() { |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
151396
2215
9
+ Added@expo/config@11.0.0-canary-20241211-61c49bd(transitive)
+ Added@expo/config-plugins@9.0.13-canary-20241211-61c49bd(transitive)
+ Added@expo/config-types@53.0.0-canary-20241211-61c49bd(transitive)
+ Added@expo/json-file@9.0.1-canary-20241211-61c49bd(transitive)
+ Added@expo/plist@0.2.1-canary-20241211-61c49bd(transitive)
- Removed@expo/config@10.0.8(transitive)
- Removed@expo/config-plugins@9.0.14(transitive)
- Removed@expo/config-types@52.0.3(transitive)
- Removed@expo/json-file@9.0.1(transitive)
- Removed@expo/plist@0.2.1(transitive)