@stryke/prisma-better-auth-generator 0.12.1 → 0.12.3
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 +230 -0
- package/dist/generator.cjs +233 -95
- package/dist/generator.js +233 -95
- package/dist/index.cjs +233 -95
- package/dist/index.js +233 -95
- 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.1_@types+node@22.13.10__@swc+core@1.11.9_@swc+
|
|
29
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.1_@types+node@22.13.10__@swc+core@1.11.9_@swc+_59b77ee1c3f80f02138262a51f241204/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.1_@types+node@22.13.10__@swc+core@1.11.9_@swc+
|
|
31
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.1_@types+node@22.13.10__@swc+core@1.11.9_@swc+_59b77ee1c3f80f02138262a51f241204/node_modules/tsup/assets/cjs_shims.js"() {
|
|
32
32
|
"use strict";
|
|
33
33
|
}
|
|
34
34
|
});
|
|
@@ -207,9 +207,10 @@ init_cjs_shims();
|
|
|
207
207
|
|
|
208
208
|
// ../string-format/src/lower-case-first.ts
|
|
209
209
|
init_cjs_shims();
|
|
210
|
-
|
|
210
|
+
function lowerCaseFirst(input) {
|
|
211
211
|
return input ? input.charAt(0).toLowerCase() + input.slice(1) : input;
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
213
214
|
|
|
214
215
|
// src/access-control.ts
|
|
215
216
|
var USER_RESOURCES = [
|
|
@@ -4514,61 +4515,217 @@ init_cjs_shims();
|
|
|
4514
4515
|
// ../string-format/src/acronyms.ts
|
|
4515
4516
|
init_cjs_shims();
|
|
4516
4517
|
var ACRONYMS = [
|
|
4518
|
+
"3D",
|
|
4519
|
+
"4D",
|
|
4520
|
+
"5G",
|
|
4521
|
+
"6G",
|
|
4522
|
+
"7G",
|
|
4523
|
+
"8G",
|
|
4524
|
+
"ACID",
|
|
4525
|
+
"AES",
|
|
4526
|
+
"AI",
|
|
4527
|
+
"AJAX",
|
|
4517
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",
|
|
4518
4552
|
"CPU",
|
|
4553
|
+
"CRUD",
|
|
4554
|
+
"CSR",
|
|
4519
4555
|
"CSS",
|
|
4556
|
+
"CX",
|
|
4557
|
+
"DAG",
|
|
4558
|
+
"DBMS",
|
|
4559
|
+
"DDoS",
|
|
4520
4560
|
"DNS",
|
|
4561
|
+
"DNSSEC",
|
|
4562
|
+
"DOM",
|
|
4563
|
+
"DR",
|
|
4564
|
+
"DRM",
|
|
4565
|
+
"DWH",
|
|
4566
|
+
"E2E",
|
|
4567
|
+
"EAI",
|
|
4568
|
+
"EKS",
|
|
4521
4569
|
"EOF",
|
|
4570
|
+
"EOD",
|
|
4571
|
+
"ETC",
|
|
4572
|
+
"ETL",
|
|
4573
|
+
"EULA",
|
|
4574
|
+
"FIDO",
|
|
4575
|
+
"FQDN",
|
|
4576
|
+
"FTP",
|
|
4577
|
+
"FaaS",
|
|
4578
|
+
"GDPR",
|
|
4579
|
+
"GCP",
|
|
4580
|
+
"GPU",
|
|
4522
4581
|
"GUID",
|
|
4582
|
+
"GUI",
|
|
4583
|
+
"GZIP",
|
|
4584
|
+
"HCI",
|
|
4585
|
+
"HDD",
|
|
4586
|
+
"HDFS",
|
|
4587
|
+
"HIPAA",
|
|
4588
|
+
"HMAC",
|
|
4589
|
+
"HOTP",
|
|
4590
|
+
"HSM",
|
|
4523
4591
|
"HTML",
|
|
4524
4592
|
"HTTP",
|
|
4593
|
+
"HTTP/2",
|
|
4594
|
+
"HTTP/2.0",
|
|
4595
|
+
"HTTP/3",
|
|
4596
|
+
"HTTP/3.0",
|
|
4597
|
+
"HTTP2",
|
|
4525
4598
|
"HTTPS",
|
|
4599
|
+
"HTTPS/2",
|
|
4600
|
+
"HTTPS/3",
|
|
4601
|
+
"HTTPS3",
|
|
4602
|
+
"IAM",
|
|
4603
|
+
"IAMM",
|
|
4604
|
+
"IAMT",
|
|
4605
|
+
"IaaS",
|
|
4526
4606
|
"ID",
|
|
4607
|
+
"IMAP",
|
|
4527
4608
|
"IP",
|
|
4609
|
+
"IPFS",
|
|
4610
|
+
"IoT",
|
|
4528
4611
|
"JSON",
|
|
4612
|
+
"JSONP",
|
|
4613
|
+
"JWT",
|
|
4614
|
+
"K8s",
|
|
4615
|
+
"KMS",
|
|
4616
|
+
"KPI",
|
|
4617
|
+
"LAN",
|
|
4529
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",
|
|
4530
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",
|
|
4531
4646
|
"PP",
|
|
4647
|
+
"PWA",
|
|
4648
|
+
"PX",
|
|
4532
4649
|
"QA",
|
|
4650
|
+
"RAID",
|
|
4533
4651
|
"RAM",
|
|
4652
|
+
"RDS",
|
|
4653
|
+
"REST",
|
|
4534
4654
|
"RHS",
|
|
4535
4655
|
"RPC",
|
|
4656
|
+
"RPA",
|
|
4657
|
+
"RUM",
|
|
4536
4658
|
"RSS",
|
|
4659
|
+
"SAN",
|
|
4660
|
+
"SASE",
|
|
4661
|
+
"SDLC",
|
|
4662
|
+
"SDK",
|
|
4663
|
+
"SEO",
|
|
4664
|
+
"SFTP",
|
|
4665
|
+
"SIEM",
|
|
4537
4666
|
"SLA",
|
|
4667
|
+
"SMB",
|
|
4538
4668
|
"SMTP",
|
|
4669
|
+
"SOAP",
|
|
4670
|
+
"SOC",
|
|
4671
|
+
"SOA",
|
|
4672
|
+
"SPDY",
|
|
4673
|
+
"SPF",
|
|
4539
4674
|
"SQL",
|
|
4675
|
+
"SRV",
|
|
4676
|
+
"SRE",
|
|
4540
4677
|
"SSH",
|
|
4678
|
+
"SSDL",
|
|
4679
|
+
"SSO",
|
|
4541
4680
|
"SSL",
|
|
4542
|
-
"
|
|
4681
|
+
"SSR",
|
|
4682
|
+
"TDD",
|
|
4683
|
+
"TLD",
|
|
4543
4684
|
"TLS",
|
|
4685
|
+
"TLS1.3",
|
|
4686
|
+
"TOTP",
|
|
4544
4687
|
"TRPC",
|
|
4545
4688
|
"TTL",
|
|
4546
4689
|
"UDP",
|
|
4547
4690
|
"UI",
|
|
4548
4691
|
"UID",
|
|
4549
|
-
"UUID",
|
|
4550
4692
|
"URI",
|
|
4551
4693
|
"URL",
|
|
4552
4694
|
"UTF",
|
|
4695
|
+
"UUID",
|
|
4696
|
+
"UX",
|
|
4553
4697
|
"VM",
|
|
4698
|
+
"VLAN",
|
|
4699
|
+
"VPN",
|
|
4700
|
+
"VR",
|
|
4701
|
+
"WAF",
|
|
4702
|
+
"WAN",
|
|
4703
|
+
"WLAN",
|
|
4704
|
+
"WPA",
|
|
4705
|
+
"XACML",
|
|
4554
4706
|
"XML",
|
|
4707
|
+
"XSRF",
|
|
4555
4708
|
"XSS",
|
|
4556
|
-
"
|
|
4709
|
+
"XR",
|
|
4710
|
+
"YAML",
|
|
4711
|
+
"ZTA"
|
|
4557
4712
|
];
|
|
4558
4713
|
|
|
4559
4714
|
// ../string-format/src/upper-case-first.ts
|
|
4560
4715
|
init_cjs_shims();
|
|
4561
|
-
|
|
4716
|
+
function upperCaseFirst(input) {
|
|
4562
4717
|
return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
|
|
4563
|
-
}
|
|
4718
|
+
}
|
|
4719
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
4564
4720
|
|
|
4565
4721
|
// ../string-format/src/title-case.ts
|
|
4566
|
-
|
|
4722
|
+
function titleCase(input) {
|
|
4567
4723
|
if (!input) {
|
|
4568
|
-
return
|
|
4724
|
+
return input;
|
|
4569
4725
|
}
|
|
4570
|
-
return input.split(/(?=[A-Z])|[\s._-]/).map((s) => s.trim()).filter(Boolean).map((s) => ACRONYMS.
|
|
4571
|
-
}
|
|
4726
|
+
return input.split(/(?=[A-Z])|[\s._-]/).map((s) => s.trim()).filter(Boolean).map((s) => ACRONYMS.find((a) => a.toUpperCase() === s.toUpperCase()) || upperCaseFirst(s.toLowerCase())).join(" ");
|
|
4727
|
+
}
|
|
4728
|
+
__name(titleCase, "titleCase");
|
|
4572
4729
|
|
|
4573
4730
|
// ../type-checks/src/is-string.ts
|
|
4574
4731
|
init_cjs_shims();
|
|
@@ -4616,7 +4773,8 @@ var linux = /* @__PURE__ */ __name((orgId) => {
|
|
|
4616
4773
|
cache: joinPaths(process.env.XDG_CACHE_HOME || joinPaths(homedir, ".cache"), orgId),
|
|
4617
4774
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
4618
4775
|
log: joinPaths(process.env.XDG_STATE_HOME || joinPaths(homedir, ".local", "state"), orgId),
|
|
4619
|
-
|
|
4776
|
+
// https://devenv.sh/files-and-variables/#devenv_root
|
|
4777
|
+
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)
|
|
4620
4778
|
};
|
|
4621
4779
|
}, "linux");
|
|
4622
4780
|
function getEnvPaths(options = {}) {
|
|
@@ -4635,16 +4793,16 @@ function getEnvPaths(options = {}) {
|
|
|
4635
4793
|
} else {
|
|
4636
4794
|
result = linux(orgId);
|
|
4637
4795
|
}
|
|
4638
|
-
if (process.env.
|
|
4639
|
-
result.data = process.env.
|
|
4640
|
-
} else if (process.env.
|
|
4641
|
-
result.config = process.env.
|
|
4642
|
-
} else if (process.env.
|
|
4643
|
-
result.cache = process.env.
|
|
4644
|
-
} else if (process.env.
|
|
4645
|
-
result.log = process.env.
|
|
4646
|
-
} else if (process.env.
|
|
4647
|
-
result.temp = process.env.
|
|
4796
|
+
if (process.env.STORM_DATA_DIR) {
|
|
4797
|
+
result.data = process.env.STORM_DATA_DIR;
|
|
4798
|
+
} else if (process.env.STORM_CONFIG_DIR) {
|
|
4799
|
+
result.config = process.env.STORM_CONFIG_DIR;
|
|
4800
|
+
} else if (process.env.STORM_CACHE_DIR) {
|
|
4801
|
+
result.cache = process.env.STORM_CACHE_DIR;
|
|
4802
|
+
} else if (process.env.STORM_LOG_DIR) {
|
|
4803
|
+
result.log = process.env.STORM_LOG_DIR;
|
|
4804
|
+
} else if (process.env.STORM_TEMP_DIR) {
|
|
4805
|
+
result.temp = process.env.STORM_TEMP_DIR;
|
|
4648
4806
|
}
|
|
4649
4807
|
if (options.workspaceRoot) {
|
|
4650
4808
|
result.cache ??= joinPaths(options.workspaceRoot, "node_modules", ".cache", orgId);
|
|
@@ -4668,46 +4826,10 @@ __name(getEnvPaths, "getEnvPaths");
|
|
|
4668
4826
|
// ../path/src/get-workspace-root.ts
|
|
4669
4827
|
init_cjs_shims();
|
|
4670
4828
|
|
|
4671
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4672
|
-
init_cjs_shims();
|
|
4673
|
-
|
|
4674
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.160.6_@storm-software+config@1.110.6/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
4829
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.169.6/node_modules/@storm-software/config-tools/dist/index.js
|
|
4675
4830
|
init_cjs_shims();
|
|
4676
4831
|
|
|
4677
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4678
|
-
init_cjs_shims();
|
|
4679
|
-
|
|
4680
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.160.6_@storm-software+config@1.110.6/node_modules/@storm-software/config-tools/dist/chunk-SHUYVCID.js
|
|
4681
|
-
init_cjs_shims();
|
|
4682
|
-
var __defProp2 = Object.defineProperty;
|
|
4683
|
-
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
4684
|
-
value,
|
|
4685
|
-
configurable: true
|
|
4686
|
-
}), "__name");
|
|
4687
|
-
|
|
4688
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.160.6_@storm-software+config@1.110.6/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
4689
|
-
var import_node_fs2 = require("node:fs");
|
|
4690
|
-
var import_node_path2 = require("node:path");
|
|
4691
|
-
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
4692
|
-
var depth = 0;
|
|
4693
|
-
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
4694
|
-
const _startPath = startPath ?? process.cwd();
|
|
4695
|
-
if (endDirectoryNames.some((endDirName) => (0, import_node_fs2.existsSync)((0, import_node_path2.join)(_startPath, endDirName)))) {
|
|
4696
|
-
return _startPath;
|
|
4697
|
-
}
|
|
4698
|
-
if (endFileNames.some((endFileName) => (0, import_node_fs2.existsSync)((0, import_node_path2.join)(_startPath, endFileName)))) {
|
|
4699
|
-
return _startPath;
|
|
4700
|
-
}
|
|
4701
|
-
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
4702
|
-
const parent = (0, import_node_path2.join)(_startPath, "..");
|
|
4703
|
-
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
4704
|
-
}
|
|
4705
|
-
return void 0;
|
|
4706
|
-
}
|
|
4707
|
-
__name(findFolderUp, "findFolderUp");
|
|
4708
|
-
__name2(findFolderUp, "findFolderUp");
|
|
4709
|
-
|
|
4710
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.160.6_@storm-software+config@1.110.6/node_modules/@storm-software/config-tools/dist/chunk-D6E6GZD2.js
|
|
4832
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.169.6/node_modules/@storm-software/config-tools/dist/chunk-FRR2ZRWD.js
|
|
4711
4833
|
init_cjs_shims();
|
|
4712
4834
|
var _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
|
|
4713
4835
|
function normalizeWindowsPath2(input = "") {
|
|
@@ -4717,11 +4839,10 @@ function normalizeWindowsPath2(input = "") {
|
|
|
4717
4839
|
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (r) => r.toUpperCase());
|
|
4718
4840
|
}
|
|
4719
4841
|
__name(normalizeWindowsPath2, "normalizeWindowsPath");
|
|
4720
|
-
__name2(normalizeWindowsPath2, "normalizeWindowsPath");
|
|
4721
4842
|
var _UNC_REGEX2 = /^[/\\]{2}/;
|
|
4722
4843
|
var _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
4723
4844
|
var _DRIVE_LETTER_RE2 = /^[A-Za-z]:$/;
|
|
4724
|
-
var correctPaths2 = /* @__PURE__ */
|
|
4845
|
+
var correctPaths2 = /* @__PURE__ */ __name(function(path2) {
|
|
4725
4846
|
if (!path2 || path2.length === 0) {
|
|
4726
4847
|
return ".";
|
|
4727
4848
|
}
|
|
@@ -4750,14 +4871,6 @@ var correctPaths2 = /* @__PURE__ */ __name2(function(path2) {
|
|
|
4750
4871
|
}
|
|
4751
4872
|
return isPathAbsolute && !isAbsolute2(path2) ? `/${path2}` : path2;
|
|
4752
4873
|
}, "correctPaths");
|
|
4753
|
-
function cwd() {
|
|
4754
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
4755
|
-
return process.cwd().replace(/\\/g, "/");
|
|
4756
|
-
}
|
|
4757
|
-
return "/";
|
|
4758
|
-
}
|
|
4759
|
-
__name(cwd, "cwd");
|
|
4760
|
-
__name2(cwd, "cwd");
|
|
4761
4874
|
function normalizeString2(path2, allowAboveRoot) {
|
|
4762
4875
|
let res = "";
|
|
4763
4876
|
let lastSegmentLength = 0;
|
|
@@ -4819,12 +4932,36 @@ function normalizeString2(path2, allowAboveRoot) {
|
|
|
4819
4932
|
return res;
|
|
4820
4933
|
}
|
|
4821
4934
|
__name(normalizeString2, "normalizeString");
|
|
4822
|
-
|
|
4823
|
-
var isAbsolute2 = /* @__PURE__ */ __name2(function(p) {
|
|
4935
|
+
var isAbsolute2 = /* @__PURE__ */ __name(function(p) {
|
|
4824
4936
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
4825
4937
|
}, "isAbsolute");
|
|
4826
4938
|
|
|
4827
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
4939
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.169.6/node_modules/@storm-software/config-tools/dist/chunk-VLWSWYG7.js
|
|
4940
|
+
init_cjs_shims();
|
|
4941
|
+
|
|
4942
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.169.6/node_modules/@storm-software/config-tools/dist/chunk-RWBPUJIZ.js
|
|
4943
|
+
init_cjs_shims();
|
|
4944
|
+
var import_node_fs2 = require("node:fs");
|
|
4945
|
+
var import_node_path2 = require("node:path");
|
|
4946
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
4947
|
+
var depth = 0;
|
|
4948
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
4949
|
+
const _startPath = startPath ?? process.cwd();
|
|
4950
|
+
if (endDirectoryNames.some((endDirName) => (0, import_node_fs2.existsSync)((0, import_node_path2.join)(_startPath, endDirName)))) {
|
|
4951
|
+
return _startPath;
|
|
4952
|
+
}
|
|
4953
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs2.existsSync)((0, import_node_path2.join)(_startPath, endFileName)))) {
|
|
4954
|
+
return _startPath;
|
|
4955
|
+
}
|
|
4956
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
4957
|
+
const parent = (0, import_node_path2.join)(_startPath, "..");
|
|
4958
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
4959
|
+
}
|
|
4960
|
+
return void 0;
|
|
4961
|
+
}
|
|
4962
|
+
__name(findFolderUp, "findFolderUp");
|
|
4963
|
+
|
|
4964
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.169.6/node_modules/@storm-software/config-tools/dist/chunk-VLWSWYG7.js
|
|
4828
4965
|
var rootFiles = [
|
|
4829
4966
|
"storm-workspace.json",
|
|
4830
4967
|
"storm-workspace.json",
|
|
@@ -4874,18 +5011,6 @@ function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
|
4874
5011
|
return correctPaths2(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
|
|
4875
5012
|
}
|
|
4876
5013
|
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
4877
|
-
__name2(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
4878
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
4879
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
4880
|
-
if (!result) {
|
|
4881
|
-
throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
4882
|
-
${rootFiles.join("\n")}
|
|
4883
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
|
|
4884
|
-
}
|
|
4885
|
-
return result;
|
|
4886
|
-
}
|
|
4887
|
-
__name(findWorkspaceRoot, "findWorkspaceRoot");
|
|
4888
|
-
__name2(findWorkspaceRoot, "findWorkspaceRoot");
|
|
4889
5014
|
|
|
4890
5015
|
// ../path/src/get-parent-path.ts
|
|
4891
5016
|
init_cjs_shims();
|
|
@@ -4903,6 +5028,20 @@ init_cjs_shims();
|
|
|
4903
5028
|
// ../path/src/is-file.ts
|
|
4904
5029
|
init_cjs_shims();
|
|
4905
5030
|
var import_node_fs3 = require("node:fs");
|
|
5031
|
+
|
|
5032
|
+
// ../path/src/regex.ts
|
|
5033
|
+
init_cjs_shims();
|
|
5034
|
+
var DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
5035
|
+
var ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
5036
|
+
|
|
5037
|
+
// ../path/src/slash.ts
|
|
5038
|
+
init_cjs_shims();
|
|
5039
|
+
function slash(str) {
|
|
5040
|
+
return str.replace(/\\/g, "/");
|
|
5041
|
+
}
|
|
5042
|
+
__name(slash, "slash");
|
|
5043
|
+
|
|
5044
|
+
// ../path/src/is-file.ts
|
|
4906
5045
|
function isFile(path2, additionalPath) {
|
|
4907
5046
|
return Boolean((0, import_node_fs3.statSync)(additionalPath ? joinPaths(additionalPath, path2) : path2, {
|
|
4908
5047
|
throwIfNoEntry: false
|
|
@@ -4916,17 +5055,16 @@ function isDirectory(path2, additionalPath) {
|
|
|
4916
5055
|
}
|
|
4917
5056
|
__name(isDirectory, "isDirectory");
|
|
4918
5057
|
function isAbsolutePath(path2) {
|
|
4919
|
-
return
|
|
5058
|
+
return ABSOLUTE_PATH_REGEX.test(slash(path2));
|
|
4920
5059
|
}
|
|
4921
5060
|
__name(isAbsolutePath, "isAbsolutePath");
|
|
4922
5061
|
|
|
4923
5062
|
// ../path/src/correct-path.ts
|
|
4924
|
-
var _DRIVE_LETTER_START_RE3 = /^[A-Z]:\//i;
|
|
4925
5063
|
function normalizeWindowsPath3(input = "") {
|
|
4926
5064
|
if (!input) {
|
|
4927
5065
|
return input;
|
|
4928
5066
|
}
|
|
4929
|
-
return input
|
|
5067
|
+
return slash(input).replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
|
|
4930
5068
|
}
|
|
4931
5069
|
__name(normalizeWindowsPath3, "normalizeWindowsPath");
|
|
4932
5070
|
function normalizeString3(path2, allowAboveRoot) {
|
|
@@ -4992,12 +5130,12 @@ function normalizeString3(path2, allowAboveRoot) {
|
|
|
4992
5130
|
__name(normalizeString3, "normalizeString");
|
|
4993
5131
|
|
|
4994
5132
|
// ../path/src/file-path-fns.ts
|
|
4995
|
-
function resolvePath(path2,
|
|
5133
|
+
function resolvePath(path2, cwd = getWorkspaceRoot()) {
|
|
4996
5134
|
const paths = normalizeWindowsPath3(path2).split("/");
|
|
4997
5135
|
let resolvedPath = "";
|
|
4998
5136
|
let resolvedAbsolute = false;
|
|
4999
5137
|
for (let index = paths.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
5000
|
-
const path3 = index >= 0 ? paths[index] :
|
|
5138
|
+
const path3 = index >= 0 ? paths[index] : cwd;
|
|
5001
5139
|
if (!path3 || path3.length === 0) {
|
|
5002
5140
|
continue;
|
|
5003
5141
|
}
|
|
@@ -5020,13 +5158,13 @@ __name(resolvePaths, "resolvePaths");
|
|
|
5020
5158
|
var resolveParentPath = /* @__PURE__ */ __name((path2) => {
|
|
5021
5159
|
return resolvePaths(path2, "..");
|
|
5022
5160
|
}, "resolveParentPath");
|
|
5023
|
-
var getParentPath = /* @__PURE__ */ __name((name,
|
|
5161
|
+
var getParentPath = /* @__PURE__ */ __name((name, cwd, options) => {
|
|
5024
5162
|
const ignoreCase = options?.ignoreCase ?? true;
|
|
5025
5163
|
const skipCwd = options?.skipCwd ?? false;
|
|
5026
5164
|
const targetType = options?.targetType ?? "both";
|
|
5027
|
-
let dir =
|
|
5165
|
+
let dir = cwd;
|
|
5028
5166
|
if (skipCwd) {
|
|
5029
|
-
dir = resolveParentPath(
|
|
5167
|
+
dir = resolveParentPath(cwd);
|
|
5030
5168
|
}
|
|
5031
5169
|
let names = Array.isArray(name) ? name : [
|
|
5032
5170
|
name
|