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