@stacksjs/path 0.75.135 → 0.75.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1319,5 +1319,5 @@ export declare interface Path {
1319
1319
  * comparison can say whether it is current.
1320
1320
  */
1321
1321
  export type DefaultsProvenance = 'not-applicable' | 'current' | 'stale' | 'unstamped';
1322
- export { appPath, frameworkPath, projectPath, storagePath } from './project';
1322
+ export { appPath, frameworkPath, isCompiledBinary, projectPath, storagePath } from './project';
1323
1323
  export { basename, delimiter, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep, toNamespacedPath };
package/dist/index.js CHANGED
@@ -46,6 +46,12 @@ function projectRootFor(cwd) {
46
46
  }
47
47
  return candidates.find((candidate) => existsSync(join(candidate, "storage", "framework"))) ?? candidates.find((candidate) => existsSync(join(candidate, "package.json"))) ?? cwd;
48
48
  }
49
+ var BUNDLED_ROOT = /(?:^|[/\\])(?:\$bunfs|~BUN)(?:[/\\]|$)/;
50
+ function isCompiledBinary(main = Bun.main) {
51
+ if (!main)
52
+ return false;
53
+ return BUNDLED_ROOT.test(main);
54
+ }
49
55
  function projectPath(filePath = "", options) {
50
56
  const cwd = process.cwd();
51
57
  let path;
@@ -849,6 +855,7 @@ export {
849
855
  inspectDefaultsProvenance,
850
856
  installedDefaultsVersion,
851
857
  isAbsolute,
858
+ isCompiledBinary,
852
859
  jobsPath,
853
860
  join2 as join,
854
861
  langPath,
package/dist/project.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { relative } from 'node:path';
2
+ export declare function isCompiledBinary(main?: string | undefined): boolean;
2
3
  export declare function projectPath(filePath?: string, options?: { relative: boolean }): string;
3
4
  export declare function appPath(path?: string, options?: { relative?: boolean, cwd?: string }): string;
4
5
  export declare function storagePath(path?: string): string;
package/dist/project.js CHANGED
@@ -16,6 +16,12 @@ function projectRootFor(cwd) {
16
16
  }
17
17
  return candidates.find((candidate) => existsSync(join(candidate, "storage", "framework"))) ?? candidates.find((candidate) => existsSync(join(candidate, "package.json"))) ?? cwd;
18
18
  }
19
+ var BUNDLED_ROOT = /(?:^|[/\\])(?:\$bunfs|~BUN)(?:[/\\]|$)/;
20
+ function isCompiledBinary(main = Bun.main) {
21
+ if (!main)
22
+ return false;
23
+ return BUNDLED_ROOT.test(main);
24
+ }
19
25
  function projectPath(filePath = "", options) {
20
26
  const cwd = process.cwd();
21
27
  let path;
@@ -49,6 +55,7 @@ function frameworkPath(path, options) {
49
55
  export {
50
56
  appPath,
51
57
  frameworkPath,
58
+ isCompiledBinary,
52
59
  projectPath,
53
60
  storagePath
54
61
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/path",
3
3
  "type": "module",
4
- "version": "0.75.135",
4
+ "version": "0.75.136",
5
5
  "description": "The Stacks path.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [