@multiplatform.one/utils
Advanced tools
Comparing version 5.0.7 to 5.0.8
@@ -11,7 +11,8 @@ import { | ||
// src/dev.ts | ||
import { spawnSync } from "node:child_process"; | ||
import fs from "node:fs"; | ||
import path from "node:path"; | ||
import { spawnSync } from "node:child_process"; | ||
var logger = console; | ||
function lookupTranspileModules(packageDirs, { log = true } = {}) { | ||
const projectRoot = lookupProjectRoot(); | ||
const transpileModules = [ | ||
@@ -42,2 +43,3 @@ ...new Set( | ||
function lookupTamaguiModules(packageDirs, { log = true } = {}) { | ||
const projectRoot = lookupProjectRoot(); | ||
const tamaguiModules = [ | ||
@@ -77,3 +79,5 @@ .../* @__PURE__ */ new Set([ | ||
} | ||
var projectRoot = (() => { | ||
var _projectRoot; | ||
function lookupProjectRoot() { | ||
if (_projectRoot) return _projectRoot; | ||
try { | ||
@@ -83,12 +87,14 @@ const { stdout } = spawnSync("git", ["rev-parse", "--show-toplevel"], { | ||
}); | ||
return stdout.trim(); | ||
_projectRoot = stdout.trim(); | ||
return _projectRoot; | ||
} catch (err) { | ||
return process.cwd(); | ||
_projectRoot = process.cwd(); | ||
return _projectRoot; | ||
} | ||
})(); | ||
} | ||
export { | ||
formatServiceList, | ||
lookupProjectRoot, | ||
lookupTamaguiModules, | ||
lookupTranspileModules, | ||
projectRoot, | ||
resolveConfig, | ||
@@ -95,0 +101,0 @@ waitForApi, |
{ | ||
"name": "@multiplatform.one/utils", | ||
"version": "5.0.7", | ||
"version": "5.0.8", | ||
"description": "utilities for multiplatform.one", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -40,2 +40,3 @@ /* | ||
) { | ||
const projectRoot = lookupProjectRoot(); | ||
const transpileModules = [ | ||
@@ -72,2 +73,3 @@ ...new Set( | ||
) { | ||
const projectRoot = lookupProjectRoot(); | ||
const tamaguiModules = [ | ||
@@ -113,3 +115,5 @@ ...new Set([ | ||
export const projectRoot = (() => { | ||
let _projectRoot: string | undefined; | ||
export function lookupProjectRoot() { | ||
if (_projectRoot) return _projectRoot; | ||
try { | ||
@@ -119,8 +123,10 @@ const { stdout } = spawnSync("git", ["rev-parse", "--show-toplevel"], { | ||
}); | ||
return stdout.trim(); | ||
_projectRoot = stdout.trim(); | ||
return _projectRoot; | ||
} catch (err) { | ||
return process.cwd(); | ||
_projectRoot = process.cwd(); | ||
return _projectRoot; | ||
} | ||
})(); | ||
} | ||
export * from "./wait"; |
@@ -10,4 +10,4 @@ export interface LookupTranspileModulesOptions { | ||
export declare function resolveConfig(keys?: string[]): Record<string, string | undefined>; | ||
export declare const projectRoot: string; | ||
export declare function lookupProjectRoot(): string; | ||
export * from "./wait"; | ||
//# sourceMappingURL=dev.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
74259
1054