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