functype-os 0.2.0 → 0.3.0

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
@@ -3,5 +3,5 @@ import { ConfigResolver } from "./config/ConfigResolver.js";
3
3
  import { Env } from "./env/Env.js";
4
4
  import { Fs } from "./fs/Fs.js";
5
5
  import { Path, expandPath, expandTilde, expandVars } from "./path/PathExpander.js";
6
- import { Platform, UserInfo } from "./platform/Platform.js";
7
- export { ConfigError, ConfigResolver, Env, EnvError, Fs, FsError, type OsError, Path, PathError, Platform, type UserInfo, expandPath, expandTilde, expandVars };
6
+ import { CloudProvider, CloudStorageDir, Platform, UserInfo } from "./platform/Platform.js";
7
+ export { type CloudProvider, type CloudStorageDir, ConfigError, ConfigResolver, Env, EnvError, Fs, FsError, type OsError, Path, PathError, Platform, type UserInfo, expandPath, expandTilde, expandVars };
@@ -1,4 +1,4 @@
1
- import { Option } from "functype";
1
+ import { List, Option } from "functype";
2
2
 
3
3
  //#region src/platform/Platform.d.ts
4
4
  type UserInfo = {
@@ -8,6 +8,12 @@ type UserInfo = {
8
8
  readonly shell: string | null;
9
9
  readonly homedir: string;
10
10
  };
11
+ type CloudProvider = "onedrive" | "gdrive" | "dropbox" | "icloud";
12
+ type CloudStorageDir = {
13
+ readonly provider: CloudProvider;
14
+ readonly path: string;
15
+ readonly label: string;
16
+ };
11
17
  declare const Platform: {
12
18
  os: () => "darwin" | "linux" | "win32" | string;
13
19
  arch: () => string;
@@ -25,7 +31,10 @@ declare const Platform: {
25
31
  isWSL: () => boolean;
26
32
  isCI: () => boolean;
27
33
  isContainer: () => boolean;
34
+ windowsHomeDir: () => Option<string>;
35
+ homeDirs: () => List<string>;
36
+ cloudStorageDirs: (home?: string) => List<CloudStorageDir>;
28
37
  };
29
38
  //#endregion
30
- export { Platform, UserInfo };
39
+ export { CloudProvider, CloudStorageDir, Platform, UserInfo };
31
40
  //# sourceMappingURL=Platform.d.ts.map
@@ -1,2 +1,2 @@
1
- import{Option as e}from"functype";import*as t from"node:fs";import*as n from"node:os";import*as r from"node:path";const i=()=>{try{return t.statSync(`/.dockerenv`),!0}catch{return!1}},a=()=>{try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}},o=e=>{let t={};return()=>(`value`in t||(t.value=e()),t.value)},s=o(()=>i()||a()),c=o(()=>{try{return t.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`kube`)}catch{return!1}}),l=o(()=>{try{let e=t.readFileSync(`/proc/version`,`utf8`);return e.includes(`Microsoft`)||e.includes(`WSL`)}catch{return!1}}),u=o(()=>process.env.CI!==void 0||process.env.GITHUB_ACTIONS!==void 0||process.env.GITLAB_CI!==void 0||process.env.CIRCLECI!==void 0||process.env.JENKINS_URL!==void 0||process.env.TRAVIS!==void 0||process.env.BUILDKITE!==void 0),d={os:()=>process.platform,arch:()=>process.arch,homeDir:()=>n.homedir(),tmpDir:()=>n.tmpdir(),hostname:()=>n.hostname(),eol:()=>n.EOL,pathSep:()=>r.sep,isWindows:()=>process.platform===`win32`,isMac:()=>process.platform===`darwin`,isLinux:()=>process.platform===`linux`,userInfo:()=>{try{let t=n.userInfo();return e({username:t.username,uid:t.uid,gid:t.gid,shell:t.shell,homedir:t.homedir})}catch{return e(void 0)}},isDocker:()=>s(),isKubernetes:()=>c(),isWSL:()=>l(),isCI:()=>u(),isContainer:()=>d.isDocker()||d.isKubernetes()};export{d as Platform};
1
+ import{List as e,Option as t}from"functype";import*as n from"node:fs";import*as r from"node:os";import*as i from"node:path";import{execSync as a}from"node:child_process";const o=()=>{try{return n.statSync(`/.dockerenv`),!0}catch{return!1}},s=()=>{try{return n.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}},c=e=>{let t={};return()=>(`value`in t||(t.value=e()),t.value)},l=c(()=>o()||s()),u=c(()=>{try{return n.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`kube`)}catch{return!1}}),d=c(()=>{try{let e=n.readFileSync(`/proc/version`,`utf8`);return e.includes(`Microsoft`)||e.includes(`WSL`)}catch{return!1}}),f=c(()=>process.env.CI!==void 0||process.env.GITHUB_ACTIONS!==void 0||process.env.GITLAB_CI!==void 0||process.env.CIRCLECI!==void 0||process.env.JENKINS_URL!==void 0||process.env.TRAVIS!==void 0||process.env.BUILDKITE!==void 0),p=new Set([`all users`,`default`,`default user`,`public`]),m=e=>{let t=e.toLowerCase();return!!(p.has(t)||t.startsWith(`defaultuser`)||t.startsWith(`desktop.`)||t.startsWith(`wsiaccount`))},h=e=>{try{return n.statSync(e).isDirectory()}catch{return!1}},g=e=>{try{return n.readdirSync(e).filter(t=>!m(t)&&h(i.join(e,t)))}catch{return}},_=(e,n)=>{try{let e=a(`cmd.exe /c echo %USERPROFILE%`,{timeout:3e3,encoding:`utf8`}).trim().match(/^([A-Za-z]):\\(.*)$/);if(e){let n=`/mnt/${e[1].toLowerCase()}/${e[2].replace(/\\/g,`/`)}`;if(h(n))return t(n)}}catch{}return t(n)},v=c(()=>{if(!d())return t(void 0);let e=`/mnt/c/Users`,n=g(e);return n===void 0?t(void 0):n.length===1?t(i.join(e,n[0])):n.length>1?_(e,i.join(e,n[0])):t(void 0)}),y=e=>{if(e===`OneDrive`||e.startsWith(`OneDrive `)||e.startsWith(`OneDrive-`))return{provider:`onedrive`,label:e};if(e===`Google Drive`)return{provider:`gdrive`,label:e};if(e===`Dropbox`)return{provider:`dropbox`,label:e}},b=e=>{let t=[];try{let r=n.readdirSync(e);for(let n of r){let r=i.join(e,n),a=y(n);a&&h(r)&&t.push({provider:a.provider,path:r,label:a.label})}}catch{}let r=i.join(e,`Library`,`CloudStorage`);try{let e=n.readdirSync(r);for(let n of e){let e=i.join(r,n);h(e)&&(n.startsWith(`OneDrive`)?t.push({provider:`onedrive`,path:e,label:n}):n.startsWith(`GoogleDrive`)&&t.push({provider:`gdrive`,path:e,label:n}))}}catch{}let a=i.join(e,`Library`,`Mobile Documents`,`com~apple~CloudDocs`);return h(a)&&t.push({provider:`icloud`,path:a,label:`iCloud Drive`}),t},x={os:()=>process.platform,arch:()=>process.arch,homeDir:()=>r.homedir(),tmpDir:()=>r.tmpdir(),hostname:()=>r.hostname(),eol:()=>r.EOL,pathSep:()=>i.sep,isWindows:()=>process.platform===`win32`,isMac:()=>process.platform===`darwin`,isLinux:()=>process.platform===`linux`,userInfo:()=>{try{let e=r.userInfo();return t({username:e.username,uid:e.uid,gid:e.gid,shell:e.shell,homedir:e.homedir})}catch{return t(void 0)}},isDocker:()=>l(),isKubernetes:()=>u(),isWSL:()=>d(),isCI:()=>f(),isContainer:()=>x.isDocker()||x.isKubernetes(),windowsHomeDir:()=>v(),homeDirs:()=>{let t=[r.homedir()];return x.windowsHomeDir().forEach(e=>{e!==r.homedir()&&t.push(e)}),e(t)},cloudStorageDirs:t=>{if(t!==void 0)return e(b(t));let n=[],r=new Set;return x.homeDirs().forEach(e=>{for(let t of b(e))r.has(t.path)||(r.add(t.path),n.push(t))}),e(n)}};export{x as Platform};
2
2
  //# sourceMappingURL=Platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Platform.js","names":[],"sources":["../../src/platform/Platform.ts"],"sourcesContent":["import * as fs from \"node:fs\"\nimport * as os from \"node:os\"\nimport * as path from \"node:path\"\n\nimport { Option } from \"functype\"\n\nexport type UserInfo = {\n readonly username: string\n readonly uid: number\n readonly gid: number\n readonly shell: string | null\n readonly homedir: string\n}\n\nconst hasDockerEnv = (): boolean => {\n try {\n fs.statSync(\"/.dockerenv\")\n return true\n } catch {\n return false\n }\n}\nconst hasDockerCGroup = (): boolean => {\n try {\n return fs.readFileSync(\"/proc/self/cgroup\", \"utf8\").includes(\"docker\")\n } catch {\n return false\n }\n}\n\nconst memo = <T>(fn: () => T): (() => T) => {\n const cache: { value?: T } = {}\n return () => {\n if (!(\"value\" in cache)) {\n cache.value = fn()\n }\n return cache.value as T\n }\n}\n\nconst cachedIsDocker = memo(() => hasDockerEnv() || hasDockerCGroup())\nconst cachedIsKube = memo(() => {\n try {\n return fs.readFileSync(\"/proc/self/cgroup\", \"utf8\").includes(\"kube\")\n } catch {\n return false\n }\n})\nconst cachedIsWSL = memo(() => {\n try {\n const version = fs.readFileSync(\"/proc/version\", \"utf8\")\n return version.includes(\"Microsoft\") || version.includes(\"WSL\")\n } catch {\n return false\n }\n})\nconst cachedIsCI = memo(\n () =>\n process.env[\"CI\"] !== undefined ||\n process.env[\"GITHUB_ACTIONS\"] !== undefined ||\n process.env[\"GITLAB_CI\"] !== undefined ||\n process.env[\"CIRCLECI\"] !== undefined ||\n process.env[\"JENKINS_URL\"] !== undefined ||\n process.env[\"TRAVIS\"] !== undefined ||\n process.env[\"BUILDKITE\"] !== undefined,\n)\n\nexport const Platform = {\n os: (): \"darwin\" | \"linux\" | \"win32\" | string => process.platform,\n arch: (): string => process.arch,\n homeDir: (): string => os.homedir(),\n tmpDir: (): string => os.tmpdir(),\n hostname: (): string => os.hostname(),\n eol: (): string => os.EOL,\n pathSep: (): string => path.sep,\n\n isWindows: (): boolean => process.platform === \"win32\",\n isMac: (): boolean => process.platform === \"darwin\",\n isLinux: (): boolean => process.platform === \"linux\",\n\n userInfo: (): Option<UserInfo> => {\n try {\n const info = os.userInfo()\n return Option({\n username: info.username,\n uid: info.uid,\n gid: info.gid,\n shell: info.shell,\n homedir: info.homedir,\n })\n } catch {\n return Option<UserInfo>(undefined)\n }\n },\n\n isDocker: (): boolean => cachedIsDocker(),\n isKubernetes: (): boolean => cachedIsKube(),\n isWSL: (): boolean => cachedIsWSL(),\n isCI: (): boolean => cachedIsCI(),\n\n isContainer: (): boolean => Platform.isDocker() || Platform.isKubernetes(),\n}\n"],"mappings":"kHAcA,MAAM,MAA8B,CAClC,GAAI,CAEF,OADA,EAAG,SAAS,cAAc,CACnB,QACD,CACN,MAAO,KAGL,MAAiC,CACrC,GAAI,CACF,OAAO,EAAG,aAAa,oBAAqB,OAAO,CAAC,SAAS,SAAS,MAChE,CACN,MAAO,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S,cAAc,CAC3E"}
1
+ {"version":3,"file":"Platform.js","names":[],"sources":["../../src/platform/Platform.ts"],"sourcesContent":["import { execSync } from \"node:child_process\"\nimport * as fs from \"node:fs\"\nimport * as os from \"node:os\"\nimport * as path from \"node:path\"\n\nimport { List, Option } from \"functype\"\n\nexport type UserInfo = {\n readonly username: string\n readonly uid: number\n readonly gid: number\n readonly shell: string | null\n readonly homedir: string\n}\n\nexport type CloudProvider = \"onedrive\" | \"gdrive\" | \"dropbox\" | \"icloud\"\n\nexport type CloudStorageDir = {\n readonly provider: CloudProvider\n readonly path: string\n readonly label: string\n}\n\nconst hasDockerEnv = (): boolean => {\n try {\n fs.statSync(\"/.dockerenv\")\n return true\n } catch {\n return false\n }\n}\nconst hasDockerCGroup = (): boolean => {\n try {\n return fs.readFileSync(\"/proc/self/cgroup\", \"utf8\").includes(\"docker\")\n } catch {\n return false\n }\n}\n\nconst memo = <T>(fn: () => T): (() => T) => {\n const cache: { value?: T } = {}\n return () => {\n if (!(\"value\" in cache)) {\n cache.value = fn()\n }\n return cache.value as T\n }\n}\n\nconst cachedIsDocker = memo(() => hasDockerEnv() || hasDockerCGroup())\nconst cachedIsKube = memo(() => {\n try {\n return fs.readFileSync(\"/proc/self/cgroup\", \"utf8\").includes(\"kube\")\n } catch {\n return false\n }\n})\nconst cachedIsWSL = memo(() => {\n try {\n const version = fs.readFileSync(\"/proc/version\", \"utf8\")\n return version.includes(\"Microsoft\") || version.includes(\"WSL\")\n } catch {\n return false\n }\n})\nconst cachedIsCI = memo(\n () =>\n process.env[\"CI\"] !== undefined ||\n process.env[\"GITHUB_ACTIONS\"] !== undefined ||\n process.env[\"GITLAB_CI\"] !== undefined ||\n process.env[\"CIRCLECI\"] !== undefined ||\n process.env[\"JENKINS_URL\"] !== undefined ||\n process.env[\"TRAVIS\"] !== undefined ||\n process.env[\"BUILDKITE\"] !== undefined,\n)\n\nconst SYSTEM_ACCOUNTS = new Set([\"all users\", \"default\", \"default user\", \"public\"])\n\nconst isSystemAccount = (name: string): boolean => {\n const lower = name.toLowerCase()\n if (SYSTEM_ACCOUNTS.has(lower)) return true\n if (lower.startsWith(\"defaultuser\") || lower.startsWith(\"desktop.\") || lower.startsWith(\"wsiaccount\")) return true\n return false\n}\n\nconst isDirectory = (p: string): boolean => {\n try {\n return fs.statSync(p).isDirectory()\n } catch {\n return false\n }\n}\n\nconst readRealUsers = (usersDir: string): readonly string[] | undefined => {\n try {\n const entries = fs.readdirSync(usersDir)\n return entries.filter((name) => !isSystemAccount(name) && isDirectory(path.join(usersDir, name)))\n } catch {\n return undefined\n }\n}\n\nconst resolveViaCmdExe = (usersDir: string, fallback: string): Option<string> => {\n try {\n const raw = execSync(\"cmd.exe /c echo %USERPROFILE%\", { timeout: 3000, encoding: \"utf8\" }).trim()\n // Convert Windows path C:\\Users\\foo → /mnt/c/Users/foo\n const match = raw.match(/^([A-Za-z]):\\\\(.*)$/)\n if (match) {\n const drive = match[1].toLowerCase()\n const rest = match[2].replace(/\\\\/g, \"/\")\n const wslPath = `/mnt/${drive}/${rest}`\n if (isDirectory(wslPath)) {\n return Option(wslPath)\n }\n }\n } catch {\n // cmd.exe failed, fall through to best guess\n }\n return Option(fallback)\n}\n\nconst resolveWindowsHome = (): Option<string> => {\n if (!cachedIsWSL()) return Option<string>(undefined)\n\n const usersDir = \"/mnt/c/Users\"\n const realUsers = readRealUsers(usersDir)\n if (realUsers === undefined) return Option<string>(undefined)\n\n if (realUsers.length === 1) {\n return Option(path.join(usersDir, realUsers[0]))\n }\n\n if (realUsers.length > 1) {\n return resolveViaCmdExe(usersDir, path.join(usersDir, realUsers[0]))\n }\n\n return Option<string>(undefined)\n}\n\nconst cachedWindowsHome = memo(resolveWindowsHome)\n\nconst detectCloudProvider = (name: string): { provider: CloudProvider; label: string } | undefined => {\n if (name === \"OneDrive\" || name.startsWith(\"OneDrive \") || name.startsWith(\"OneDrive-\")) {\n return { provider: \"onedrive\", label: name }\n }\n if (name === \"Google Drive\") {\n return { provider: \"gdrive\", label: name }\n }\n if (name === \"Dropbox\") {\n return { provider: \"dropbox\", label: name }\n }\n return undefined\n}\n\nconst scanCloudStorageDirs = (home: string): CloudStorageDir[] => {\n const results: CloudStorageDir[] = []\n\n // Direct home children\n try {\n const entries = fs.readdirSync(home)\n for (const name of entries) {\n const fullPath = path.join(home, name)\n const detection = detectCloudProvider(name)\n if (detection && isDirectory(fullPath)) {\n results.push({ provider: detection.provider, path: fullPath, label: detection.label })\n }\n }\n } catch {\n // home dir may not exist or be readable\n }\n\n // macOS Library/CloudStorage children\n const cloudStoragePath = path.join(home, \"Library\", \"CloudStorage\")\n try {\n const entries = fs.readdirSync(cloudStoragePath)\n for (const name of entries) {\n const fullPath = path.join(cloudStoragePath, name)\n if (!isDirectory(fullPath)) continue\n if (name.startsWith(\"OneDrive\")) {\n results.push({ provider: \"onedrive\", path: fullPath, label: name })\n } else if (name.startsWith(\"GoogleDrive\")) {\n results.push({ provider: \"gdrive\", path: fullPath, label: name })\n }\n }\n } catch {\n // Library/CloudStorage may not exist\n }\n\n // macOS iCloud fixed path\n const icloudPath = path.join(home, \"Library\", \"Mobile Documents\", \"com~apple~CloudDocs\")\n if (isDirectory(icloudPath)) {\n results.push({ provider: \"icloud\", path: icloudPath, label: \"iCloud Drive\" })\n }\n\n return results\n}\n\nexport const Platform = {\n os: (): \"darwin\" | \"linux\" | \"win32\" | string => process.platform,\n arch: (): string => process.arch,\n homeDir: (): string => os.homedir(),\n tmpDir: (): string => os.tmpdir(),\n hostname: (): string => os.hostname(),\n eol: (): string => os.EOL,\n pathSep: (): string => path.sep,\n\n isWindows: (): boolean => process.platform === \"win32\",\n isMac: (): boolean => process.platform === \"darwin\",\n isLinux: (): boolean => process.platform === \"linux\",\n\n userInfo: (): Option<UserInfo> => {\n try {\n const info = os.userInfo()\n return Option({\n username: info.username,\n uid: info.uid,\n gid: info.gid,\n shell: info.shell,\n homedir: info.homedir,\n })\n } catch {\n return Option<UserInfo>(undefined)\n }\n },\n\n isDocker: (): boolean => cachedIsDocker(),\n isKubernetes: (): boolean => cachedIsKube(),\n isWSL: (): boolean => cachedIsWSL(),\n isCI: (): boolean => cachedIsCI(),\n\n isContainer: (): boolean => Platform.isDocker() || Platform.isKubernetes(),\n\n windowsHomeDir: (): Option<string> => cachedWindowsHome(),\n\n homeDirs: (): List<string> => {\n const homes: string[] = [os.homedir()]\n Platform.windowsHomeDir().forEach((winHome) => {\n if (winHome !== os.homedir()) {\n homes.push(winHome)\n }\n })\n return List(homes)\n },\n\n cloudStorageDirs: (home?: string): List<CloudStorageDir> => {\n if (home !== undefined) {\n return List(scanCloudStorageDirs(home))\n }\n const allDirs: CloudStorageDir[] = []\n const seenPaths = new Set<string>()\n Platform.homeDirs().forEach((h) => {\n for (const dir of scanCloudStorageDirs(h)) {\n if (!seenPaths.has(dir.path)) {\n seenPaths.add(dir.path)\n allDirs.push(dir)\n }\n }\n })\n return List(allDirs)\n },\n}\n"],"mappings":"0KAuBA,MAAM,MAA8B,CAClC,GAAI,CAEF,OADA,EAAG,SAAS,cAAc,CACnB,QACD,CACN,MAAO,KAGL,MAAiC,CACrC,GAAI,CACF,OAAO,EAAG,aAAa,oBAAqB,OAAO,CAAC,SAAS,SAAS,MAChE,CACN,MAAO,KAIL,EAAW,GAA2B,CAC1C,IAAM,EAAuB,EAAE,CAC/B,WACQ,UAAW,IACf,EAAM,MAAQ,GAAI,EAEb,EAAM,QAIX,EAAiB,MAAW,GAAc,EAAI,GAAiB,CAAC,CAChE,EAAe,MAAW,CAC9B,GAAI,CACF,OAAO,EAAG,aAAa,oBAAqB,OAAO,CAAC,SAAS,OAAO,MAC9D,CACN,MAAO,KAET,CACI,EAAc,MAAW,CAC7B,GAAI,CACF,IAAM,EAAU,EAAG,aAAa,gBAAiB,OAAO,CACxD,OAAO,EAAQ,SAAS,YAAY,EAAI,EAAQ,SAAS,MAAM,MACzD,CACN,MAAO,KAET,CACI,EAAa,MAEf,QAAQ,IAAI,KAAU,IAAA,IACtB,QAAQ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ACtB,OAAiD,QAAQ,SACzD,SAAoB,QAAQ,KAC5B,YAAuB,EAAG,SAAS,CACnC,WAAsB,EAAG,QAAQ,CACjC,aAAwB,EAAG,UAAU,CACrC,QAAmB,EAAG,IACtB,YAAuB,EAAK,IAE5B,cAA0B,QAAQ,WAAa,QAC/C,UAAsB,QAAQ,WAAa,SAC3C,YAAwB,QAAQ,WAAa,QAE7C,aAAkC,CAChC,GAAI,CACF,IAAM,EAAO,EAAG,UAAU,CAC1B,OAAO,EAAO,CACZ,SAAU,EAAK,SACf,IAAK,EAAK,IACV,IAAK,EAAK,IACV,MAAO,EAAK,MACZ,QAAS,EAAK,QACf,CAAC,MACI,CACN,OAAO,EAAiB,IAAA,GAAU,GAItC,aAAyB,GAAgB,CACzC,iBAA6B,GAAc,CAC3C,UAAsB,GAAa,CACnC,SAAqB,GAAY,CAEjC,gBAA4B,EAAS,UAAU,EAAI,EAAS,cAAc,CAE1E,mBAAsC,GAAmB,CAEzD,aAA8B,CAC5B,IAAM,EAAkB,CAAC,EAAG,SAAS,CAAC,CAMtC,OALA,EAAS,gBAAgB,CAAC,QAAS,GAAY,CACzC,IAAY,EAAG,SAAS,EAC1B,EAAM,KAAK,EAAQ,EAErB,CACK,EAAK,EAAM,EAGpB,iBAAmB,GAAyC,CAC1D,GAAI,IAAS,IAAA,GACX,OAAO,EAAK,EAAqB,EAAK,CAAC,CAEzC,IAAM,EAA6B,EAAE,CAC/B,EAAY,IAAI,IAStB,OARA,EAAS,UAAU,CAAC,QAAS,GAAM,CACjC,IAAK,IAAM,KAAO,EAAqB,EAAE,CAClC,EAAU,IAAI,EAAI,KAAK,GAC1B,EAAU,IAAI,EAAI,KAAK,CACvB,EAAQ,KAAK,EAAI,GAGrB,CACK,EAAK,EAAQ,EAEvB"}
@@ -1,2 +1,2 @@
1
- import { Platform, UserInfo } from "./Platform.js";
2
- export { Platform, type UserInfo };
1
+ import { CloudProvider, CloudStorageDir, Platform, UserInfo } from "./Platform.js";
2
+ export { type CloudProvider, type CloudStorageDir, Platform, type UserInfo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functype-os",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Functional OS utilities using functype data structures — env vars, path expansion, file ops, platform detection",
5
5
  "keywords": [
6
6
  "functype",
@@ -18,11 +18,25 @@
18
18
  "type": "git",
19
19
  "url": "https://github.com/jordanburke/functype-os"
20
20
  },
21
+ "scripts": {
22
+ "validate": "ts-builds validate",
23
+ "format": "ts-builds format",
24
+ "format:check": "ts-builds format:check",
25
+ "lint": "ts-builds lint",
26
+ "lint:check": "ts-builds lint:check",
27
+ "typecheck": "ts-builds typecheck",
28
+ "test": "ts-builds test",
29
+ "test:watch": "ts-builds test:watch",
30
+ "test:coverage": "ts-builds test:coverage",
31
+ "build": "ts-builds build",
32
+ "dev": "ts-builds dev",
33
+ "prepublishOnly": "pnpm validate"
34
+ },
21
35
  "peerDependencies": {
22
36
  "functype": ">=0.49.0"
23
37
  },
24
38
  "devDependencies": {
25
- "@types/node": "^24.11.2",
39
+ "@types/node": "^24.12.0",
26
40
  "eslint-config-prettier": "^10.1.8",
27
41
  "functype": "^0.49.0",
28
42
  "ts-builds": "^2.5.0",
@@ -75,20 +89,8 @@
75
89
  "dist"
76
90
  ],
77
91
  "prettier": "ts-builds/prettier",
92
+ "packageManager": "pnpm@10.30.3+sha512.c961d1e0a2d8e354ecaa5166b822516668b7f44cb5bd95122d590dd81922f606f5473b6d23ec4a5be05e7fcd18e8488d47d978bbe981872f1145d06e9a740017",
78
93
  "engines": {
79
94
  "node": ">=18.0.0"
80
- },
81
- "scripts": {
82
- "validate": "ts-builds validate",
83
- "format": "ts-builds format",
84
- "format:check": "ts-builds format:check",
85
- "lint": "ts-builds lint",
86
- "lint:check": "ts-builds lint:check",
87
- "typecheck": "ts-builds typecheck",
88
- "test": "ts-builds test",
89
- "test:watch": "ts-builds test:watch",
90
- "test:coverage": "ts-builds test:coverage",
91
- "build": "ts-builds build",
92
- "dev": "ts-builds dev"
93
95
  }
94
- }
96
+ }