@stryke/prisma-better-auth-generator 0.12.2 → 0.13.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/README.md +2 -1
- package/dist/generator.cjs +199 -179
- package/dist/generator.js +199 -179
- package/dist/index.cjs +199 -179
- package/dist/index.js +199 -179
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ var __esm = (fn, res) => function __init() {
|
|
|
5
5
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@22.15.30__@swc+core@1.11.9_@swc+_1a2de6809bc5b79e36a8d4bf1aad64d8/node_modules/tsup/assets/esm_shims.js
|
|
9
9
|
var init_esm_shims = __esm({
|
|
10
|
-
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
10
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@22.15.30__@swc+core@1.11.9_@swc+_1a2de6809bc5b79e36a8d4bf1aad64d8/node_modules/tsup/assets/esm_shims.js"() {
|
|
11
11
|
"use strict";
|
|
12
12
|
}
|
|
13
13
|
});
|
|
@@ -4494,46 +4494,200 @@ init_esm_shims();
|
|
|
4494
4494
|
// ../string-format/src/acronyms.ts
|
|
4495
4495
|
init_esm_shims();
|
|
4496
4496
|
var ACRONYMS = [
|
|
4497
|
+
"3D",
|
|
4498
|
+
"4D",
|
|
4499
|
+
"5G",
|
|
4500
|
+
"6G",
|
|
4501
|
+
"7G",
|
|
4502
|
+
"8G",
|
|
4503
|
+
"ACID",
|
|
4504
|
+
"AES",
|
|
4505
|
+
"AI",
|
|
4506
|
+
"AJAX",
|
|
4497
4507
|
"API",
|
|
4508
|
+
"AR",
|
|
4509
|
+
"ASCII",
|
|
4510
|
+
"B2B",
|
|
4511
|
+
"B2C",
|
|
4512
|
+
"BFF",
|
|
4513
|
+
"BI",
|
|
4514
|
+
"BIOS",
|
|
4515
|
+
"BGP",
|
|
4516
|
+
"BOM",
|
|
4517
|
+
"BYOD",
|
|
4518
|
+
"C2C",
|
|
4519
|
+
"CAGR",
|
|
4520
|
+
"CAPTCHA",
|
|
4521
|
+
"CD",
|
|
4522
|
+
"CDN",
|
|
4523
|
+
"CDP",
|
|
4524
|
+
"CI",
|
|
4525
|
+
"CI/CD",
|
|
4526
|
+
"CIAM",
|
|
4527
|
+
"CICD",
|
|
4528
|
+
"CLI",
|
|
4529
|
+
"CMDB",
|
|
4530
|
+
"CORS",
|
|
4498
4531
|
"CPU",
|
|
4532
|
+
"CRUD",
|
|
4533
|
+
"CSR",
|
|
4499
4534
|
"CSS",
|
|
4535
|
+
"CX",
|
|
4536
|
+
"DAG",
|
|
4537
|
+
"DBMS",
|
|
4538
|
+
"DDoS",
|
|
4500
4539
|
"DNS",
|
|
4540
|
+
"DNSSEC",
|
|
4541
|
+
"DOM",
|
|
4542
|
+
"DR",
|
|
4543
|
+
"DRM",
|
|
4544
|
+
"DWH",
|
|
4545
|
+
"E2E",
|
|
4546
|
+
"EAI",
|
|
4547
|
+
"EKS",
|
|
4501
4548
|
"EOF",
|
|
4549
|
+
"EOD",
|
|
4550
|
+
"ETC",
|
|
4551
|
+
"ETL",
|
|
4552
|
+
"EULA",
|
|
4553
|
+
"FIDO",
|
|
4554
|
+
"FQDN",
|
|
4555
|
+
"FTP",
|
|
4556
|
+
"FaaS",
|
|
4557
|
+
"GDPR",
|
|
4558
|
+
"GCP",
|
|
4559
|
+
"GPU",
|
|
4502
4560
|
"GUID",
|
|
4561
|
+
"GUI",
|
|
4562
|
+
"GZIP",
|
|
4563
|
+
"HCI",
|
|
4564
|
+
"HDD",
|
|
4565
|
+
"HDFS",
|
|
4566
|
+
"HIPAA",
|
|
4567
|
+
"HMAC",
|
|
4568
|
+
"HOTP",
|
|
4569
|
+
"HSM",
|
|
4503
4570
|
"HTML",
|
|
4504
4571
|
"HTTP",
|
|
4572
|
+
"HTTP/2",
|
|
4573
|
+
"HTTP/2.0",
|
|
4574
|
+
"HTTP/3",
|
|
4575
|
+
"HTTP/3.0",
|
|
4576
|
+
"HTTP2",
|
|
4505
4577
|
"HTTPS",
|
|
4578
|
+
"HTTPS/2",
|
|
4579
|
+
"HTTPS/3",
|
|
4580
|
+
"HTTPS3",
|
|
4581
|
+
"IAM",
|
|
4582
|
+
"IAMM",
|
|
4583
|
+
"IAMT",
|
|
4584
|
+
"IaaS",
|
|
4506
4585
|
"ID",
|
|
4586
|
+
"IMAP",
|
|
4507
4587
|
"IP",
|
|
4588
|
+
"IPFS",
|
|
4589
|
+
"IoT",
|
|
4508
4590
|
"JSON",
|
|
4591
|
+
"JSONP",
|
|
4592
|
+
"JWT",
|
|
4593
|
+
"K8s",
|
|
4594
|
+
"KMS",
|
|
4595
|
+
"KPI",
|
|
4596
|
+
"LAN",
|
|
4509
4597
|
"LHS",
|
|
4598
|
+
"LXC",
|
|
4599
|
+
"MFA",
|
|
4600
|
+
"ML",
|
|
4601
|
+
"MLOps",
|
|
4602
|
+
"MVC",
|
|
4603
|
+
"MVP",
|
|
4604
|
+
"NAS",
|
|
4605
|
+
"NAT",
|
|
4606
|
+
"NDA",
|
|
4607
|
+
"NFS",
|
|
4608
|
+
"NIST",
|
|
4609
|
+
"NLP",
|
|
4610
|
+
"NPS",
|
|
4611
|
+
"OCR",
|
|
4510
4612
|
"OEM",
|
|
4613
|
+
"OKR",
|
|
4614
|
+
"OLAP",
|
|
4615
|
+
"OLTP",
|
|
4616
|
+
"OOP",
|
|
4617
|
+
"ORM",
|
|
4618
|
+
"OS",
|
|
4619
|
+
"OTP",
|
|
4620
|
+
"P2P",
|
|
4621
|
+
"PDP",
|
|
4622
|
+
"PaaS",
|
|
4623
|
+
"PCI",
|
|
4624
|
+
"PKI",
|
|
4511
4625
|
"PP",
|
|
4626
|
+
"PWA",
|
|
4627
|
+
"PX",
|
|
4512
4628
|
"QA",
|
|
4629
|
+
"RAID",
|
|
4513
4630
|
"RAM",
|
|
4631
|
+
"RDS",
|
|
4632
|
+
"REST",
|
|
4514
4633
|
"RHS",
|
|
4515
4634
|
"RPC",
|
|
4635
|
+
"RPA",
|
|
4636
|
+
"RUM",
|
|
4516
4637
|
"RSS",
|
|
4638
|
+
"SAN",
|
|
4639
|
+
"SASE",
|
|
4640
|
+
"SDLC",
|
|
4641
|
+
"SDK",
|
|
4642
|
+
"SEO",
|
|
4643
|
+
"SFTP",
|
|
4644
|
+
"SIEM",
|
|
4517
4645
|
"SLA",
|
|
4646
|
+
"SMB",
|
|
4518
4647
|
"SMTP",
|
|
4648
|
+
"SOAP",
|
|
4649
|
+
"SOC",
|
|
4650
|
+
"SOA",
|
|
4651
|
+
"SPDY",
|
|
4652
|
+
"SPF",
|
|
4519
4653
|
"SQL",
|
|
4654
|
+
"SRV",
|
|
4655
|
+
"SRE",
|
|
4520
4656
|
"SSH",
|
|
4657
|
+
"SSDL",
|
|
4658
|
+
"SSO",
|
|
4521
4659
|
"SSL",
|
|
4522
|
-
"
|
|
4660
|
+
"SSR",
|
|
4661
|
+
"TDD",
|
|
4662
|
+
"TLD",
|
|
4523
4663
|
"TLS",
|
|
4664
|
+
"TLS1.3",
|
|
4665
|
+
"TOTP",
|
|
4524
4666
|
"TRPC",
|
|
4525
4667
|
"TTL",
|
|
4526
4668
|
"UDP",
|
|
4527
4669
|
"UI",
|
|
4528
4670
|
"UID",
|
|
4529
|
-
"UUID",
|
|
4530
4671
|
"URI",
|
|
4531
4672
|
"URL",
|
|
4532
4673
|
"UTF",
|
|
4674
|
+
"UUID",
|
|
4675
|
+
"UX",
|
|
4533
4676
|
"VM",
|
|
4677
|
+
"VLAN",
|
|
4678
|
+
"VPN",
|
|
4679
|
+
"VR",
|
|
4680
|
+
"WAF",
|
|
4681
|
+
"WAN",
|
|
4682
|
+
"WLAN",
|
|
4683
|
+
"WPA",
|
|
4684
|
+
"XACML",
|
|
4534
4685
|
"XML",
|
|
4686
|
+
"XSRF",
|
|
4535
4687
|
"XSS",
|
|
4536
|
-
"
|
|
4688
|
+
"XR",
|
|
4689
|
+
"YAML",
|
|
4690
|
+
"ZTA"
|
|
4537
4691
|
];
|
|
4538
4692
|
|
|
4539
4693
|
// ../string-format/src/upper-case-first.ts
|
|
@@ -4548,20 +4702,16 @@ function titleCase(input) {
|
|
|
4548
4702
|
if (!input) {
|
|
4549
4703
|
return input;
|
|
4550
4704
|
}
|
|
4551
|
-
|
|
4705
|
+
const formatSegment = /* @__PURE__ */ __name((segment) => segment.toLowerCase().split(/[\s\-_]+/).filter(Boolean).map((word) => {
|
|
4706
|
+
if (ACRONYMS.includes(word.toUpperCase())) {
|
|
4707
|
+
return word.toUpperCase();
|
|
4708
|
+
}
|
|
4709
|
+
return `${upperCaseFirst(word.toLowerCase())}`;
|
|
4710
|
+
}).join(" "), "formatSegment");
|
|
4711
|
+
return input.split(/\s+-\s+/).map((part) => formatSegment(part)).join(" - ");
|
|
4552
4712
|
}
|
|
4553
4713
|
__name(titleCase, "titleCase");
|
|
4554
4714
|
|
|
4555
|
-
// ../type-checks/src/is-string.ts
|
|
4556
|
-
init_esm_shims();
|
|
4557
|
-
var isString = /* @__PURE__ */ __name((value) => {
|
|
4558
|
-
try {
|
|
4559
|
-
return typeof value === "string";
|
|
4560
|
-
} catch {
|
|
4561
|
-
return false;
|
|
4562
|
-
}
|
|
4563
|
-
}, "isString");
|
|
4564
|
-
|
|
4565
4715
|
// ../env/src/get-env-paths.ts
|
|
4566
4716
|
import os from "node:os";
|
|
4567
4717
|
import path from "node:path";
|
|
@@ -4598,7 +4748,8 @@ var linux = /* @__PURE__ */ __name((orgId) => {
|
|
|
4598
4748
|
cache: joinPaths(process.env.XDG_CACHE_HOME || joinPaths(homedir, ".cache"), orgId),
|
|
4599
4749
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
4600
4750
|
log: joinPaths(process.env.XDG_STATE_HOME || joinPaths(homedir, ".local", "state"), orgId),
|
|
4601
|
-
|
|
4751
|
+
// https://devenv.sh/files-and-variables/#devenv_root
|
|
4752
|
+
temp: process.env.DEVENV_RUNTIME || process.env.XDG_RUNTIME_DIR ? joinPaths(process.env.DEVENV_RUNTIME || process.env.XDG_RUNTIME_DIR, orgId) : joinPaths(tmpdir, username, orgId)
|
|
4602
4753
|
};
|
|
4603
4754
|
}, "linux");
|
|
4604
4755
|
function getEnvPaths(options = {}) {
|
|
@@ -4607,7 +4758,7 @@ function getEnvPaths(options = {}) {
|
|
|
4607
4758
|
throw new Error("You need to provide an orgId to the `getEnvPaths` function");
|
|
4608
4759
|
}
|
|
4609
4760
|
if (options.suffix) {
|
|
4610
|
-
orgId += `-${
|
|
4761
|
+
orgId += `-${typeof options.suffix === "string" ? options.suffix : "nodejs"}`;
|
|
4611
4762
|
}
|
|
4612
4763
|
let result = {};
|
|
4613
4764
|
if (process.platform === "darwin") {
|
|
@@ -4617,16 +4768,16 @@ function getEnvPaths(options = {}) {
|
|
|
4617
4768
|
} else {
|
|
4618
4769
|
result = linux(orgId);
|
|
4619
4770
|
}
|
|
4620
|
-
if (process.env.
|
|
4621
|
-
result.data = process.env.
|
|
4622
|
-
} else if (process.env.
|
|
4623
|
-
result.config = process.env.
|
|
4624
|
-
} else if (process.env.
|
|
4625
|
-
result.cache = process.env.
|
|
4626
|
-
} else if (process.env.
|
|
4627
|
-
result.log = process.env.
|
|
4628
|
-
} else if (process.env.
|
|
4629
|
-
result.temp = process.env.
|
|
4771
|
+
if (process.env.STORM_DATA_DIR) {
|
|
4772
|
+
result.data = process.env.STORM_DATA_DIR;
|
|
4773
|
+
} else if (process.env.STORM_CONFIG_DIR) {
|
|
4774
|
+
result.config = process.env.STORM_CONFIG_DIR;
|
|
4775
|
+
} else if (process.env.STORM_CACHE_DIR) {
|
|
4776
|
+
result.cache = process.env.STORM_CACHE_DIR;
|
|
4777
|
+
} else if (process.env.STORM_LOG_DIR) {
|
|
4778
|
+
result.log = process.env.STORM_LOG_DIR;
|
|
4779
|
+
} else if (process.env.STORM_TEMP_DIR) {
|
|
4780
|
+
result.temp = process.env.STORM_TEMP_DIR;
|
|
4630
4781
|
}
|
|
4631
4782
|
if (options.workspaceRoot) {
|
|
4632
4783
|
result.cache ??= joinPaths(options.workspaceRoot, "node_modules", ".cache", orgId);
|
|
@@ -4650,24 +4801,14 @@ __name(getEnvPaths, "getEnvPaths");
|
|
|
4650
4801
|
// ../path/src/get-workspace-root.ts
|
|
4651
4802
|
init_esm_shims();
|
|
4652
4803
|
|
|
4653
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4654
|
-
init_esm_shims();
|
|
4655
|
-
|
|
4656
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
4804
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.0/node_modules/@storm-software/config-tools/dist/index.js
|
|
4657
4805
|
init_esm_shims();
|
|
4658
4806
|
|
|
4659
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4807
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.0/node_modules/@storm-software/config-tools/dist/chunk-VLWSWYG7.js
|
|
4660
4808
|
init_esm_shims();
|
|
4661
4809
|
|
|
4662
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4810
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.0/node_modules/@storm-software/config-tools/dist/chunk-RWBPUJIZ.js
|
|
4663
4811
|
init_esm_shims();
|
|
4664
|
-
var __defProp2 = Object.defineProperty;
|
|
4665
|
-
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
4666
|
-
value,
|
|
4667
|
-
configurable: true
|
|
4668
|
-
}), "__name");
|
|
4669
|
-
|
|
4670
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
4671
4812
|
import { existsSync as existsSync2 } from "node:fs";
|
|
4672
4813
|
import { join } from "node:path";
|
|
4673
4814
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
@@ -4687,9 +4828,8 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
4687
4828
|
return void 0;
|
|
4688
4829
|
}
|
|
4689
4830
|
__name(findFolderUp, "findFolderUp");
|
|
4690
|
-
__name2(findFolderUp, "findFolderUp");
|
|
4691
4831
|
|
|
4692
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4832
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.0/node_modules/@storm-software/config-tools/dist/chunk-FRR2ZRWD.js
|
|
4693
4833
|
init_esm_shims();
|
|
4694
4834
|
var _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
|
|
4695
4835
|
function normalizeWindowsPath2(input = "") {
|
|
@@ -4699,11 +4839,10 @@ function normalizeWindowsPath2(input = "") {
|
|
|
4699
4839
|
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (r) => r.toUpperCase());
|
|
4700
4840
|
}
|
|
4701
4841
|
__name(normalizeWindowsPath2, "normalizeWindowsPath");
|
|
4702
|
-
__name2(normalizeWindowsPath2, "normalizeWindowsPath");
|
|
4703
4842
|
var _UNC_REGEX2 = /^[/\\]{2}/;
|
|
4704
4843
|
var _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
4705
4844
|
var _DRIVE_LETTER_RE2 = /^[A-Za-z]:$/;
|
|
4706
|
-
var correctPaths2 = /* @__PURE__ */
|
|
4845
|
+
var correctPaths2 = /* @__PURE__ */ __name(function(path2) {
|
|
4707
4846
|
if (!path2 || path2.length === 0) {
|
|
4708
4847
|
return ".";
|
|
4709
4848
|
}
|
|
@@ -4732,14 +4871,6 @@ var correctPaths2 = /* @__PURE__ */ __name2(function(path2) {
|
|
|
4732
4871
|
}
|
|
4733
4872
|
return isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2;
|
|
4734
4873
|
}, "correctPaths");
|
|
4735
|
-
function cwd() {
|
|
4736
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
4737
|
-
return process.cwd().replace(/\\/g, "/");
|
|
4738
|
-
}
|
|
4739
|
-
return "/";
|
|
4740
|
-
}
|
|
4741
|
-
__name(cwd, "cwd");
|
|
4742
|
-
__name2(cwd, "cwd");
|
|
4743
4874
|
function normalizeString2(path2, allowAboveRoot) {
|
|
4744
4875
|
let res = "";
|
|
4745
4876
|
let lastSegmentLength = 0;
|
|
@@ -4801,12 +4932,11 @@ function normalizeString2(path2, allowAboveRoot) {
|
|
|
4801
4932
|
return res;
|
|
4802
4933
|
}
|
|
4803
4934
|
__name(normalizeString2, "normalizeString");
|
|
4804
|
-
|
|
4805
|
-
var isAbsolute2 = /* @__PURE__ */ __name2(function(p) {
|
|
4935
|
+
var isAbsolute2 = /* @__PURE__ */ __name(function(p) {
|
|
4806
4936
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
4807
4937
|
}, "isAbsolute");
|
|
4808
4938
|
|
|
4809
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4939
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.173.0/node_modules/@storm-software/config-tools/dist/chunk-VLWSWYG7.js
|
|
4810
4940
|
var rootFiles = [
|
|
4811
4941
|
"storm-workspace.json",
|
|
4812
4942
|
"storm-workspace.json",
|
|
@@ -4856,35 +4986,21 @@ function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
|
4856
4986
|
return correctPaths2(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
|
|
4857
4987
|
}
|
|
4858
4988
|
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
4859
|
-
__name2(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
4860
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
4861
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
4862
|
-
if (!result) {
|
|
4863
|
-
throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
4864
|
-
${rootFiles.join("\n")}
|
|
4865
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
|
|
4866
|
-
}
|
|
4867
|
-
return result;
|
|
4868
|
-
}
|
|
4869
|
-
__name(findWorkspaceRoot, "findWorkspaceRoot");
|
|
4870
|
-
__name2(findWorkspaceRoot, "findWorkspaceRoot");
|
|
4871
4989
|
|
|
4872
4990
|
// ../path/src/get-parent-path.ts
|
|
4873
4991
|
init_esm_shims();
|
|
4874
4992
|
|
|
4875
|
-
// ../path/src/file
|
|
4993
|
+
// ../path/src/is-file.ts
|
|
4876
4994
|
init_esm_shims();
|
|
4995
|
+
import { lstatSync, statSync } from "node:fs";
|
|
4877
4996
|
|
|
4878
|
-
// ../
|
|
4997
|
+
// ../path/src/regex.ts
|
|
4879
4998
|
init_esm_shims();
|
|
4880
|
-
var $NestedValue = Symbol("NestedValue");
|
|
4881
4999
|
|
|
4882
|
-
// ../path/src/
|
|
5000
|
+
// ../path/src/slash.ts
|
|
4883
5001
|
init_esm_shims();
|
|
4884
5002
|
|
|
4885
5003
|
// ../path/src/is-file.ts
|
|
4886
|
-
init_esm_shims();
|
|
4887
|
-
import { lstatSync, statSync } from "node:fs";
|
|
4888
5004
|
function isFile(path2, additionalPath) {
|
|
4889
5005
|
return Boolean(statSync(additionalPath ? joinPaths(additionalPath, path2) : path2, {
|
|
4890
5006
|
throwIfNoEntry: false
|
|
@@ -4897,118 +5013,22 @@ function isDirectory(path2, additionalPath) {
|
|
|
4897
5013
|
})?.isDirectory());
|
|
4898
5014
|
}
|
|
4899
5015
|
__name(isDirectory, "isDirectory");
|
|
4900
|
-
function isAbsolutePath(path2) {
|
|
4901
|
-
return !/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i.test(path2);
|
|
4902
|
-
}
|
|
4903
|
-
__name(isAbsolutePath, "isAbsolutePath");
|
|
4904
|
-
|
|
4905
|
-
// ../path/src/correct-path.ts
|
|
4906
|
-
var _DRIVE_LETTER_START_RE3 = /^[A-Z]:\//i;
|
|
4907
|
-
function normalizeWindowsPath3(input = "") {
|
|
4908
|
-
if (!input) {
|
|
4909
|
-
return input;
|
|
4910
|
-
}
|
|
4911
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE3, (r) => r.toUpperCase());
|
|
4912
|
-
}
|
|
4913
|
-
__name(normalizeWindowsPath3, "normalizeWindowsPath");
|
|
4914
|
-
function normalizeString3(path2, allowAboveRoot) {
|
|
4915
|
-
let res = "";
|
|
4916
|
-
let lastSegmentLength = 0;
|
|
4917
|
-
let lastSlash = -1;
|
|
4918
|
-
let dots = 0;
|
|
4919
|
-
let char = null;
|
|
4920
|
-
for (let index = 0; index <= path2.length; ++index) {
|
|
4921
|
-
if (index < path2.length) {
|
|
4922
|
-
char = path2[index];
|
|
4923
|
-
} else if (char === "/") {
|
|
4924
|
-
break;
|
|
4925
|
-
} else {
|
|
4926
|
-
char = "/";
|
|
4927
|
-
}
|
|
4928
|
-
if (char === "/") {
|
|
4929
|
-
if (lastSlash === index - 1 || dots === 1) {
|
|
4930
|
-
} else if (dots === 2) {
|
|
4931
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
4932
|
-
if (res.length > 2) {
|
|
4933
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
4934
|
-
if (lastSlashIndex === -1) {
|
|
4935
|
-
res = "";
|
|
4936
|
-
lastSegmentLength = 0;
|
|
4937
|
-
} else {
|
|
4938
|
-
res = res.slice(0, lastSlashIndex);
|
|
4939
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
4940
|
-
}
|
|
4941
|
-
lastSlash = index;
|
|
4942
|
-
dots = 0;
|
|
4943
|
-
continue;
|
|
4944
|
-
} else if (res.length > 0) {
|
|
4945
|
-
res = "";
|
|
4946
|
-
lastSegmentLength = 0;
|
|
4947
|
-
lastSlash = index;
|
|
4948
|
-
dots = 0;
|
|
4949
|
-
continue;
|
|
4950
|
-
}
|
|
4951
|
-
}
|
|
4952
|
-
if (allowAboveRoot) {
|
|
4953
|
-
res += res.length > 0 ? "/.." : "..";
|
|
4954
|
-
lastSegmentLength = 2;
|
|
4955
|
-
}
|
|
4956
|
-
} else {
|
|
4957
|
-
if (res.length > 0) {
|
|
4958
|
-
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
4959
|
-
} else {
|
|
4960
|
-
res = path2.slice(lastSlash + 1, index);
|
|
4961
|
-
}
|
|
4962
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
4963
|
-
}
|
|
4964
|
-
lastSlash = index;
|
|
4965
|
-
dots = 0;
|
|
4966
|
-
} else if (char === "." && dots !== -1) {
|
|
4967
|
-
++dots;
|
|
4968
|
-
} else {
|
|
4969
|
-
dots = -1;
|
|
4970
|
-
}
|
|
4971
|
-
}
|
|
4972
|
-
return res;
|
|
4973
|
-
}
|
|
4974
|
-
__name(normalizeString3, "normalizeString");
|
|
4975
|
-
|
|
4976
|
-
// ../path/src/file-path-fns.ts
|
|
4977
|
-
function resolvePath(path2, cwd2 = getWorkspaceRoot()) {
|
|
4978
|
-
const paths = normalizeWindowsPath3(path2).split("/");
|
|
4979
|
-
let resolvedPath = "";
|
|
4980
|
-
let resolvedAbsolute = false;
|
|
4981
|
-
for (let index = paths.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
4982
|
-
const path3 = index >= 0 ? paths[index] : cwd2;
|
|
4983
|
-
if (!path3 || path3.length === 0) {
|
|
4984
|
-
continue;
|
|
4985
|
-
}
|
|
4986
|
-
resolvedPath = joinPaths(path3, resolvedPath);
|
|
4987
|
-
resolvedAbsolute = isAbsolutePath(path3);
|
|
4988
|
-
}
|
|
4989
|
-
resolvedPath = normalizeString3(resolvedPath, !resolvedAbsolute);
|
|
4990
|
-
if (resolvedAbsolute && !isAbsolutePath(resolvedPath)) {
|
|
4991
|
-
return `/${resolvedPath}`;
|
|
4992
|
-
}
|
|
4993
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
4994
|
-
}
|
|
4995
|
-
__name(resolvePath, "resolvePath");
|
|
4996
|
-
function resolvePaths(...paths) {
|
|
4997
|
-
return resolvePath(joinPaths(...paths.map((path2) => normalizeWindowsPath3(path2))));
|
|
4998
|
-
}
|
|
4999
|
-
__name(resolvePaths, "resolvePaths");
|
|
5000
5016
|
|
|
5001
5017
|
// ../path/src/get-parent-path.ts
|
|
5002
|
-
var resolveParentPath = /* @__PURE__ */ __name((path2) => {
|
|
5003
|
-
|
|
5018
|
+
var resolveParentPath = /* @__PURE__ */ __name((path2, count = 1) => {
|
|
5019
|
+
let parentPath = path2.replaceAll(/\/+$/g, "");
|
|
5020
|
+
for (let i = 0; i < count; i++) {
|
|
5021
|
+
parentPath = joinPaths(parentPath, "..");
|
|
5022
|
+
}
|
|
5023
|
+
return parentPath;
|
|
5004
5024
|
}, "resolveParentPath");
|
|
5005
|
-
var getParentPath = /* @__PURE__ */ __name((name,
|
|
5025
|
+
var getParentPath = /* @__PURE__ */ __name((name, cwd, options) => {
|
|
5006
5026
|
const ignoreCase = options?.ignoreCase ?? true;
|
|
5007
5027
|
const skipCwd = options?.skipCwd ?? false;
|
|
5008
5028
|
const targetType = options?.targetType ?? "both";
|
|
5009
|
-
let dir =
|
|
5029
|
+
let dir = cwd;
|
|
5010
5030
|
if (skipCwd) {
|
|
5011
|
-
dir = resolveParentPath(
|
|
5031
|
+
dir = resolveParentPath(cwd);
|
|
5012
5032
|
}
|
|
5013
5033
|
let names = Array.isArray(name) ? name : [
|
|
5014
5034
|
name
|