@arcgis/components-build-utils
Advanced tools
Comparing version 4.32.0-next.46 to 4.32.0-next.47
// src/index.ts | ||
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs"; | ||
import { join as join2, sep as sep3 } from "node:path"; | ||
// src/path.ts | ||
import { sep } from "path"; | ||
import posix from "path/posix"; | ||
import win32 from "path/win32"; | ||
var isPosix = sep === posix.sep; | ||
var toPosixPathSeparators = (relativePath) => relativePath.includes(win32.sep) ? relativePath.replaceAll(win32.sep, posix.sep) : relativePath; | ||
var toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath; | ||
var toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators; | ||
var getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd()); | ||
var path = isPosix ? posix : { | ||
...win32, | ||
sep: posix.sep, | ||
join(...paths) { | ||
const result = win32.join(...paths); | ||
return toPosixPathSeparators(result); | ||
}, | ||
normalize(path2) { | ||
const result = win32.normalize(path2); | ||
return toPosixPathSeparators(result); | ||
}, | ||
relative(from, to) { | ||
const result = win32.relative(from, to); | ||
return toPosixPathSeparators(result); | ||
}, | ||
dirname(path2) { | ||
const result = win32.dirname(path2); | ||
return toPosixPathSeparators(result); | ||
}, | ||
resolve(...paths) { | ||
const result = win32.resolve(...paths); | ||
return toPosixPathSeparators(result); | ||
}, | ||
toNamespacedPath(path2) { | ||
const result = win32.toNamespacedPath(path2); | ||
return toPosixPathSeparators(result); | ||
} | ||
}; | ||
var exportsForTests = { toWin32PathSeparators }; | ||
// src/file.ts | ||
@@ -9,3 +47,3 @@ import { existsSync } from "node:fs"; | ||
import { execSync } from "node:child_process"; | ||
import { dirname, join, resolve, sep } from "path"; | ||
import { dirname, join, resolve, sep as sep2 } from "path"; | ||
import { fileURLToPath } from "node:url"; | ||
@@ -22,6 +60,6 @@ var existsAsync = async (file) => await access(file, constants.F_OK).then(() => true).catch(() => false); | ||
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory); | ||
const parentPath = resolvedStartDirectory.split(sep); | ||
const parentPath = resolvedStartDirectory.split(sep2); | ||
while (parentPath.length > 2) { | ||
const fullPath = join( | ||
...sep === "/" ? ["/"] : [], | ||
...sep2 === "/" ? ["/"] : [], | ||
...parentPath, | ||
@@ -39,6 +77,6 @@ target | ||
const resolvedStartDirectory = startDirectory.startsWith("file:///") ? dirname(fileURLToPath(startDirectory)) : resolve(startDirectory); | ||
const parentPath = resolvedStartDirectory.split(sep); | ||
const parentPath = resolvedStartDirectory.split(sep2); | ||
while (parentPath.length > 2) { | ||
const fullPath = join( | ||
...sep === "/" ? ["/"] : [], | ||
...sep2 === "/" ? ["/"] : [], | ||
...parentPath, | ||
@@ -55,41 +93,2 @@ target | ||
// src/path.ts | ||
import { sep as sep2 } from "path"; | ||
import posix from "path/posix"; | ||
import win32 from "path/win32"; | ||
var isPosix = sep2 === posix.sep; | ||
var toPosixPathSeparators = (relativePath) => relativePath.includes(win32.sep) ? relativePath.replaceAll(win32.sep, posix.sep) : relativePath; | ||
var toWin32PathSeparators = (relativePath) => relativePath.includes(posix.sep) ? relativePath.replaceAll(posix.sep, win32.sep) : relativePath; | ||
var toSystemPathSeparators = isPosix ? (path2) => path2 : toWin32PathSeparators; | ||
var getCwd = isPosix ? process.cwd : () => toPosixPathSeparators(process.cwd()); | ||
var path = isPosix ? posix : { | ||
...win32, | ||
sep: posix.sep, | ||
join(...paths) { | ||
const result = win32.join(...paths); | ||
return toPosixPathSeparators(result); | ||
}, | ||
normalize(path2) { | ||
const result = win32.normalize(path2); | ||
return toPosixPathSeparators(result); | ||
}, | ||
relative(from, to) { | ||
const result = win32.relative(from, to); | ||
return toPosixPathSeparators(result); | ||
}, | ||
dirname(path2) { | ||
const result = win32.dirname(path2); | ||
return toPosixPathSeparators(result); | ||
}, | ||
resolve(...paths) { | ||
const result = win32.resolve(...paths); | ||
return toPosixPathSeparators(result); | ||
}, | ||
toNamespacedPath(path2) { | ||
const result = win32.toNamespacedPath(path2); | ||
return toPosixPathSeparators(result); | ||
} | ||
}; | ||
var exportsForTests = { toWin32PathSeparators }; | ||
// src/packageJson.ts | ||
@@ -143,5 +142,5 @@ import { readFileSync } from "node:fs"; | ||
{ | ||
const pathParts = cwd.split(sep3); | ||
const pathParts = path.resolve(cwd).split(path.sep); | ||
while (pathParts.length > 1) { | ||
const packageJson = join2(pathParts.join(sep3), "package.json"); | ||
const packageJson = path.join(pathParts.join(path.sep), "package.json"); | ||
pathParts.pop(); | ||
@@ -148,0 +147,0 @@ if (!existsSync2(packageJson)) { |
{ | ||
"name": "@arcgis/components-build-utils", | ||
"version": "4.32.0-next.46", | ||
"version": "4.32.0-next.47", | ||
"description": "Collection of common internal build-time patterns and utilities for ArcGIS Maps SDK for JavaScript components.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://developers.arcgis.com/javascript/latest/", |
#!/usr/bin/env node | ||
import { spawn } from "node:child_process"; | ||
import { join } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
const scriptPath = join(fileURLToPath(import.meta.url), "..", "run.ts"); | ||
const scriptPath = join(import.meta.dirname, "run.ts"); | ||
const commandArguments = process.argv.slice(2); | ||
@@ -8,0 +7,0 @@ |
Sorry, the diff of this file is not supported yet
23879
463