@vltpkg/cli-js 1.0.0-rc.27 → 1.0.0-rc.29

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.
Files changed (85) hide show
  1. package/access-6HRR4HXE.js +293 -0
  2. package/{bugs-CS34LDPD.js → bugs-2CAZQ32S.js} +19 -22
  3. package/{build-XHEFAWMN.js → build-OAWTNBMS.js} +10 -13
  4. package/{cache-LII2V5IM.js → cache-JTAFST6T.js} +14 -15
  5. package/cache-unzip-src-unzip.js +606 -575
  6. package/{chunk-D27QPHKI.js → chunk-2V4AQPBR.js} +67 -20
  7. package/{chunk-JQHMLTO5.js → chunk-3MWZTKGK.js} +419 -328
  8. package/{chunk-DJBBJDHI.js → chunk-7RZL7BZI.js} +159 -74
  9. package/chunk-7WHVJ56C.js +73 -0
  10. package/{chunk-LAG2R3YJ.js → chunk-BW6C3YUV.js} +6 -6
  11. package/{chunk-6YTJVEK2.js → chunk-CLDF5XLG.js} +11 -11
  12. package/{chunk-DYL7AFY7.js → chunk-CPM47YUH.js} +5 -3
  13. package/{chunk-QWWYZ3TT.js → chunk-D2MVJDUA.js} +1 -1
  14. package/{chunk-5E5GX4G6.js → chunk-FBTBHRPG.js} +1 -1
  15. package/{chunk-AZLX27EM.js → chunk-FXDRM4ZO.js} +296 -258
  16. package/chunk-G2YT2GWF.js +120 -0
  17. package/{chunk-INXSTZAX.js → chunk-HAGUS4HI.js} +21 -21
  18. package/{chunk-FI5TUER7.js → chunk-HQ4US6G3.js} +681 -687
  19. package/chunk-IEISSXS4.js +711 -0
  20. package/{chunk-TRXTSZFT.js → chunk-IYO5QKUW.js} +1 -1
  21. package/{chunk-DJBVQKBB.js → chunk-K3RN3BGU.js} +5 -5
  22. package/{chunk-P2HZ4ISK.js → chunk-LPLXAVG7.js} +54 -6
  23. package/{chunk-XSUIV5NF.js → chunk-M7HPHM7B.js} +14 -12
  24. package/{chunk-BIUCOMBH.js → chunk-MAIQR5GM.js} +5 -5
  25. package/{chunk-TDTJOKF2.js → chunk-NLFBANVO.js} +8 -1
  26. package/{chunk-XWF3GJKE.js → chunk-Q3DNNTPG.js} +27 -1
  27. package/{chunk-VCSVHRCS.js → chunk-R44FR7BY.js} +1269 -590
  28. package/{chunk-QDGZZ5FZ.js → chunk-TYV4N3S3.js} +6 -692
  29. package/{chunk-LKFTVDWS.js → chunk-VPKJNCKL.js} +26 -13
  30. package/{chunk-VTZZIXYW.js → chunk-VRIS5HAW.js} +3 -3
  31. package/{chunk-S5I2UOBT.js → chunk-WX2DCAG2.js} +7 -7
  32. package/{chunk-YR47M5L7.js → chunk-XYCCQT7N.js} +34 -39
  33. package/{chunk-D7U7KDEM.js → chunk-YCQTLBWF.js} +1 -1
  34. package/{chunk-SR66HWMM.js → chunk-ZINDEKAU.js} +144 -93
  35. package/{ci-EEXNEPKP.js → ci-TOJJVHI4.js} +13 -16
  36. package/cli-package.json +2 -1
  37. package/{config-4ZFJD5AY.js → config-DVAPEE5D.js} +12 -14
  38. package/{config-6MUU2TRJ.js → config-GOV4E2KK.js} +26 -26
  39. package/{create-DEKJKPYX.js → create-NGJD7K4L.js} +24 -26
  40. package/deprecate-WROL4AHK.js +176 -0
  41. package/{devtools-NOLON5YL.js → devtools-TPMVKPB5.js} +80 -77
  42. package/dist-tag-WZXXWXMB.js +204 -0
  43. package/{docs-5EKPZANX.js → docs-YCOZFMZG.js} +19 -22
  44. package/{exec-I4YPE6YW.js → exec-URG5OWLH.js} +24 -26
  45. package/{exec-cache-XEWPABLK.js → exec-cache-KHDOEH2F.js} +21 -23
  46. package/{exec-local-OQXG2VPW.js → exec-local-52TVUL5K.js} +19 -21
  47. package/{help-OG655SE5.js → help-LNSDVBGJ.js} +4 -5
  48. package/{init-LJH2YTBM.js → init-XNMWYATA.js} +10 -8
  49. package/{install-KP2FGWOR.js → install-SKUZERZJ.js} +28 -17
  50. package/{list-ACZ3ZSIZ.js → list-XEDVFUD5.js} +19 -21
  51. package/{login-VFTRKZE2.js → login-52SA2DSI.js} +6 -9
  52. package/{logout-Z4AVG64D.js → logout-5YYHNV5W.js} +6 -9
  53. package/{pack-GPJNX7RP.js → pack-B7QZHMYP.js} +14 -17
  54. package/package.json +1 -1
  55. package/{ping-B2YS4SR3.js → ping-PRGDYDRI.js} +6 -9
  56. package/{pkg-WUYJDFSH.js → pkg-UEIQIVVD.js} +15 -19
  57. package/profile-46FKVQEL.js +129 -0
  58. package/{publish-WTMGC4ET.js → publish-HBYHOSKH.js} +17 -20
  59. package/{query-UCM35VVC.js → query-5A4YLS2C.js} +19 -21
  60. package/registry-client-package.json +1 -1
  61. package/registry-client-src-revalidate.js +1157 -1032
  62. package/{repo-MZCPTQZU.js → repo-I6X66PHD.js} +19 -22
  63. package/{reporter-XRZ37LFK.js → reporter-NUXJTV4G.js} +2 -3
  64. package/{run-CAX4Z2SC.js → run-VEZMUMVH.js} +19 -21
  65. package/{run-exec-SM42FE7W.js → run-exec-6ADY4BKH.js} +19 -21
  66. package/security-archive-src-update-expired.js +8 -7
  67. package/{src-SDJWTPCU.js → src-O32QL33R.js} +20 -22
  68. package/token-YK6L74PA.js +206 -0
  69. package/{uninstall-YYPPXM2O.js → uninstall-UBUZBV7E.js} +14 -17
  70. package/unpublish-ZHJEKT7A.js +224 -0
  71. package/{update-YFUTH33A.js → update-WO4BHJF4.js} +13 -16
  72. package/{version-SK256WED.js → version-RLESYHML.js} +13 -16
  73. package/{view-CBYGJ76J.js → view-UA5HXFXG.js} +16 -17
  74. package/vlr.js +1 -1
  75. package/vlrx.js +1 -1
  76. package/vlt.js +1 -1
  77. package/vlx.js +1 -1
  78. package/vlxl.js +1 -1
  79. package/{whoami-ZT4ZEN2C.js → whoami-7H3FPR2O.js} +6 -9
  80. package/chunk-52LBC3AX.js +0 -75
  81. package/chunk-BGQCUUCA.js +0 -667
  82. package/chunk-E74WGW5C.js +0 -49
  83. package/chunk-JLJKOF75.js +0 -40
  84. package/chunk-YP4YNE5Y.js +0 -68
  85. package/token-YCURCCNR.js +0 -103
@@ -0,0 +1,224 @@
1
+ var global = globalThis;
2
+ import {Buffer} from "node:buffer";
3
+ import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
+ globalThis.setTimeout = _vlt_setTimeout;
5
+ globalThis.clearTimeout = _vlt_clearTimeout;
6
+ globalThis.setImmediate = _vlt_setImmediate;
7
+ globalThis.clearImmediate = _vlt_clearImmediate;
8
+ globalThis.setInterval = _vlt_setInterval;
9
+ globalThis.clearInterval = _vlt_clearInterval;
10
+ import {createRequire as _vlt_createRequire} from "node:module";
11
+ var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ Spec2 as Spec
14
+ } from "./chunk-IEISSXS4.js";
15
+ import {
16
+ commandUsage
17
+ } from "./chunk-FBTBHRPG.js";
18
+ import {
19
+ RegistryClient
20
+ } from "./chunk-3MWZTKGK.js";
21
+ import "./chunk-YCQTLBWF.js";
22
+ import "./chunk-R44FR7BY.js";
23
+ import "./chunk-2V4AQPBR.js";
24
+ import {
25
+ asError
26
+ } from "./chunk-Q3DNNTPG.js";
27
+ import "./chunk-XNLSTHDK.js";
28
+ import {
29
+ error
30
+ } from "./chunk-WZWDS3W4.js";
31
+ import "./chunk-PZLD7RTK.js";
32
+
33
+ // ../../src/cli-sdk/src/commands/unpublish.ts
34
+ var usage = () => commandUsage({
35
+ command: "unpublish",
36
+ usage: ["<package>@<version>", "<package> --force"],
37
+ description: `Remove a package version from the registry.
38
+
39
+ To unpublish a single version, specify the package name and version.
40
+ To unpublish an entire package, specify the package name and use --force.
41
+
42
+ \u26A0\uFE0F Unpublishing is a destructive action that cannot be undone.
43
+ Consider using \`vlt deprecate\` instead if you want to discourage
44
+ usage of a package without removing it.`,
45
+ examples: {
46
+ "my-package@1.0.0": {
47
+ description: "Unpublish a specific version"
48
+ },
49
+ "@scope/my-package@1.0.0": {
50
+ description: "Unpublish a specific version of a scoped package"
51
+ },
52
+ "my-package --force": {
53
+ description: "Unpublish an entire package (requires --force)"
54
+ }
55
+ },
56
+ options: {
57
+ force: {
58
+ description: "Required to unpublish an entire package (all versions)."
59
+ },
60
+ otp: {
61
+ description: "Provide a one-time password for authentication.",
62
+ value: "<otp>"
63
+ }
64
+ }
65
+ });
66
+ var views = {
67
+ human: (result) => {
68
+ if (result.version) {
69
+ return `\u26A0\uFE0F ${result.name}@${result.version} has been unpublished from ${result.registry}.`;
70
+ }
71
+ return `\u26A0\uFE0F ${result.name} (all versions) has been unpublished from ${result.registry}.`;
72
+ },
73
+ json: (r) => r
74
+ };
75
+ var command = async (conf) => {
76
+ const specArg = conf.positionals[0];
77
+ if (!specArg) {
78
+ throw error(
79
+ "unpublish requires a package spec argument (e.g. pkg@version)",
80
+ { code: "EUSAGE" }
81
+ );
82
+ }
83
+ const { registry, otp, force } = conf.options;
84
+ const registryUrl = new URL(registry);
85
+ const spec = Spec.parseArgs(specArg, conf.options);
86
+ const name = spec.name;
87
+ if (!name) {
88
+ throw error("Package name is required", {
89
+ found: specArg
90
+ });
91
+ }
92
+ const version = spec.bareSpec;
93
+ if (!version) {
94
+ if (!force) {
95
+ throw error(
96
+ "Refusing to unpublish entire package without --force.\nTo unpublish a specific version, use: vlt unpublish <package>@<version>\nTo unpublish all versions, use: vlt unpublish <package> --force"
97
+ );
98
+ }
99
+ }
100
+ const rc = new RegistryClient(conf.options);
101
+ const encodedName = name.startsWith("@") ? name.replace("/", "%2F") : name;
102
+ if (version) {
103
+ const packumentUrl = new URL(encodedName, registryUrl);
104
+ let packumentResponse;
105
+ try {
106
+ packumentResponse = await rc.request(packumentUrl, {
107
+ useCache: false
108
+ });
109
+ } catch (err) {
110
+ throw error("Failed to fetch package metadata", {
111
+ cause: asError(err)
112
+ });
113
+ }
114
+ if (packumentResponse.statusCode !== 200) {
115
+ throw error("Package not found on the registry", {
116
+ url: packumentUrl,
117
+ response: packumentResponse
118
+ });
119
+ }
120
+ const packument = packumentResponse.json();
121
+ const versions = packument.versions;
122
+ const distTags = packument["dist-tags"];
123
+ if (!versions?.[version]) {
124
+ throw error(`Version ${version} not found in package ${name}`, {
125
+ found: version,
126
+ wanted: Object.keys(versions ?? {})
127
+ });
128
+ }
129
+ delete versions[version];
130
+ if (distTags) {
131
+ for (const [tag, tagVersion] of Object.entries(distTags)) {
132
+ if (tagVersion === version) {
133
+ delete distTags[tag];
134
+ }
135
+ }
136
+ }
137
+ const time = packument.time;
138
+ if (time?.[version]) {
139
+ delete time[version];
140
+ }
141
+ const putUrl = new URL(
142
+ `${encodedName}/-rev/${packument._rev}`,
143
+ registryUrl
144
+ );
145
+ let response;
146
+ try {
147
+ response = await rc.request(putUrl, {
148
+ method: "PUT",
149
+ headers: {
150
+ "content-type": "application/json",
151
+ "npm-auth-type": "web",
152
+ "npm-command": "unpublish"
153
+ },
154
+ body: JSON.stringify(packument),
155
+ otp
156
+ });
157
+ } catch (err) {
158
+ throw error("Failed to unpublish package version", {
159
+ cause: asError(err)
160
+ });
161
+ }
162
+ if (response.statusCode !== 200 && response.statusCode !== 201) {
163
+ throw error("Failed to unpublish package version", {
164
+ url: putUrl,
165
+ response
166
+ });
167
+ }
168
+ } else {
169
+ const packumentUrl = new URL(encodedName, registryUrl);
170
+ let packumentResponse;
171
+ try {
172
+ packumentResponse = await rc.request(packumentUrl, {
173
+ useCache: false
174
+ });
175
+ } catch (err) {
176
+ throw error("Failed to fetch package metadata", {
177
+ cause: asError(err)
178
+ });
179
+ }
180
+ if (packumentResponse.statusCode !== 200) {
181
+ throw error("Package not found on the registry", {
182
+ url: packumentUrl,
183
+ response: packumentResponse
184
+ });
185
+ }
186
+ const packument = packumentResponse.json();
187
+ const deleteUrl = new URL(
188
+ `${encodedName}/-rev/${packument._rev}`,
189
+ registryUrl
190
+ );
191
+ let response;
192
+ try {
193
+ response = await rc.request(deleteUrl, {
194
+ method: "DELETE",
195
+ headers: {
196
+ "content-type": "application/json",
197
+ "npm-auth-type": "web",
198
+ "npm-command": "unpublish"
199
+ },
200
+ otp
201
+ });
202
+ } catch (err) {
203
+ throw error("Failed to unpublish package", {
204
+ cause: asError(err)
205
+ });
206
+ }
207
+ if (response.statusCode !== 200 && response.statusCode !== 201) {
208
+ throw error("Failed to unpublish package", {
209
+ url: deleteUrl,
210
+ response
211
+ });
212
+ }
213
+ }
214
+ return {
215
+ name,
216
+ ...version ? { version } : {},
217
+ registry: registryUrl.origin
218
+ };
219
+ };
220
+ export {
221
+ command,
222
+ usage,
223
+ views
224
+ };
@@ -11,27 +11,24 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  InstallReporter
14
- } from "./chunk-SR66HWMM.js";
14
+ } from "./chunk-ZINDEKAU.js";
15
+ import {
16
+ update
17
+ } from "./chunk-7RZL7BZI.js";
18
+ import "./chunk-MAIQR5GM.js";
15
19
  import "./chunk-VTEFO2FT.js";
16
20
  import "./chunk-RXNA2XCX.js";
17
21
  import "./chunk-WGDTG44V.js";
18
- import {
19
- update
20
- } from "./chunk-DJBBJDHI.js";
21
- import "./chunk-BIUCOMBH.js";
22
- import "./chunk-52LBC3AX.js";
22
+ import "./chunk-XYCCQT7N.js";
23
+ import "./chunk-TYV4N3S3.js";
24
+ import "./chunk-IEISSXS4.js";
25
+ import "./chunk-HTOTG4TS.js";
23
26
  import {
24
27
  commandUsage
25
- } from "./chunk-5E5GX4G6.js";
26
- import "./chunk-YR47M5L7.js";
27
- import "./chunk-BGQCUUCA.js";
28
- import "./chunk-E74WGW5C.js";
29
- import "./chunk-QDGZZ5FZ.js";
30
- import "./chunk-VCSVHRCS.js";
31
- import "./chunk-D27QPHKI.js";
32
- import "./chunk-JLJKOF75.js";
33
- import "./chunk-XWF3GJKE.js";
34
- import "./chunk-HTOTG4TS.js";
28
+ } from "./chunk-FBTBHRPG.js";
29
+ import "./chunk-R44FR7BY.js";
30
+ import "./chunk-2V4AQPBR.js";
31
+ import "./chunk-Q3DNNTPG.js";
35
32
  import "./chunk-XNLSTHDK.js";
36
33
  import {
37
34
  error
@@ -11,35 +11,32 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  createHostContextsMap
14
- } from "./chunk-VTZZIXYW.js";
14
+ } from "./chunk-VRIS5HAW.js";
15
15
  import {
16
16
  Query,
17
17
  actual
18
- } from "./chunk-DJBBJDHI.js";
19
- import "./chunk-BIUCOMBH.js";
20
- import "./chunk-52LBC3AX.js";
21
- import {
22
- commandUsage
23
- } from "./chunk-5E5GX4G6.js";
18
+ } from "./chunk-7RZL7BZI.js";
19
+ import "./chunk-MAIQR5GM.js";
24
20
  import {
25
21
  is,
26
22
  isClean,
27
23
  minimatch,
28
24
  spawn
29
- } from "./chunk-YR47M5L7.js";
30
- import "./chunk-BGQCUUCA.js";
31
- import "./chunk-E74WGW5C.js";
32
- import "./chunk-QDGZZ5FZ.js";
33
- import "./chunk-VCSVHRCS.js";
34
- import "./chunk-D27QPHKI.js";
35
- import "./chunk-JLJKOF75.js";
25
+ } from "./chunk-XYCCQT7N.js";
26
+ import "./chunk-TYV4N3S3.js";
27
+ import "./chunk-IEISSXS4.js";
28
+ import "./chunk-HTOTG4TS.js";
29
+ import {
30
+ commandUsage
31
+ } from "./chunk-FBTBHRPG.js";
32
+ import "./chunk-R44FR7BY.js";
33
+ import "./chunk-2V4AQPBR.js";
36
34
  import {
37
35
  asError,
38
36
  inc,
39
37
  parse,
40
38
  versionIncrements
41
- } from "./chunk-XWF3GJKE.js";
42
- import "./chunk-HTOTG4TS.js";
39
+ } from "./chunk-Q3DNNTPG.js";
43
40
  import "./chunk-XNLSTHDK.js";
44
41
  import {
45
42
  error
@@ -14,28 +14,27 @@ import {
14
14
  } from "./chunk-DBANBIL2.js";
15
15
  import {
16
16
  SecurityArchive
17
- } from "./chunk-BIUCOMBH.js";
18
- import {
19
- commandUsage
20
- } from "./chunk-5E5GX4G6.js";
17
+ } from "./chunk-MAIQR5GM.js";
21
18
  import {
22
19
  PackageInfoClient
23
- } from "./chunk-INXSTZAX.js";
24
- import "./chunk-FI5TUER7.js";
25
- import "./chunk-JQHMLTO5.js";
26
- import "./chunk-D7U7KDEM.js";
27
- import "./chunk-YR47M5L7.js";
28
- import "./chunk-BGQCUUCA.js";
29
- import "./chunk-E74WGW5C.js";
20
+ } from "./chunk-HAGUS4HI.js";
21
+ import "./chunk-HQ4US6G3.js";
22
+ import "./chunk-XYCCQT7N.js";
30
23
  import {
31
- Spec2 as Spec,
32
24
  joinDepIDTuple
33
- } from "./chunk-QDGZZ5FZ.js";
34
- import "./chunk-VCSVHRCS.js";
35
- import "./chunk-D27QPHKI.js";
36
- import "./chunk-JLJKOF75.js";
37
- import "./chunk-XWF3GJKE.js";
25
+ } from "./chunk-TYV4N3S3.js";
26
+ import {
27
+ Spec2 as Spec
28
+ } from "./chunk-IEISSXS4.js";
38
29
  import "./chunk-HTOTG4TS.js";
30
+ import {
31
+ commandUsage
32
+ } from "./chunk-FBTBHRPG.js";
33
+ import "./chunk-3MWZTKGK.js";
34
+ import "./chunk-YCQTLBWF.js";
35
+ import "./chunk-R44FR7BY.js";
36
+ import "./chunk-2V4AQPBR.js";
37
+ import "./chunk-Q3DNNTPG.js";
39
38
  import "./chunk-XNLSTHDK.js";
40
39
  import {
41
40
  error
package/vlr.js CHANGED
@@ -12,7 +12,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
12
12
  var require = _vlt_createRequire(import.meta.filename);
13
13
  import {
14
14
  run
15
- } from "./chunk-QWWYZ3TT.js";
15
+ } from "./chunk-D2MVJDUA.js";
16
16
  import "./chunk-PZLD7RTK.js";
17
17
 
18
18
  // ../build/src/bins/vlr.ts
package/vlrx.js CHANGED
@@ -12,7 +12,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
12
12
  var require = _vlt_createRequire(import.meta.filename);
13
13
  import {
14
14
  run
15
- } from "./chunk-QWWYZ3TT.js";
15
+ } from "./chunk-D2MVJDUA.js";
16
16
  import "./chunk-PZLD7RTK.js";
17
17
 
18
18
  // ../build/src/bins/vlrx.ts
package/vlt.js CHANGED
@@ -12,7 +12,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
12
12
  var require = _vlt_createRequire(import.meta.filename);
13
13
  import {
14
14
  run
15
- } from "./chunk-QWWYZ3TT.js";
15
+ } from "./chunk-D2MVJDUA.js";
16
16
  import "./chunk-PZLD7RTK.js";
17
17
 
18
18
  // ../build/src/bins/vlt.ts
package/vlx.js CHANGED
@@ -12,7 +12,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
12
12
  var require = _vlt_createRequire(import.meta.filename);
13
13
  import {
14
14
  run
15
- } from "./chunk-QWWYZ3TT.js";
15
+ } from "./chunk-D2MVJDUA.js";
16
16
  import "./chunk-PZLD7RTK.js";
17
17
 
18
18
  // ../build/src/bins/vlx.ts
package/vlxl.js CHANGED
@@ -12,7 +12,7 @@ import {createRequire as _vlt_createRequire} from "node:module";
12
12
  var require = _vlt_createRequire(import.meta.filename);
13
13
  import {
14
14
  run
15
- } from "./chunk-QWWYZ3TT.js";
15
+ } from "./chunk-D2MVJDUA.js";
16
16
  import "./chunk-PZLD7RTK.js";
17
17
 
18
18
  // ../build/src/bins/vlxl.ts
@@ -11,17 +11,14 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  commandUsage
14
- } from "./chunk-5E5GX4G6.js";
14
+ } from "./chunk-FBTBHRPG.js";
15
15
  import {
16
16
  RegistryClient
17
- } from "./chunk-JQHMLTO5.js";
18
- import "./chunk-D7U7KDEM.js";
19
- import "./chunk-BGQCUUCA.js";
20
- import "./chunk-E74WGW5C.js";
21
- import "./chunk-VCSVHRCS.js";
22
- import "./chunk-D27QPHKI.js";
23
- import "./chunk-JLJKOF75.js";
24
- import "./chunk-XWF3GJKE.js";
17
+ } from "./chunk-3MWZTKGK.js";
18
+ import "./chunk-YCQTLBWF.js";
19
+ import "./chunk-R44FR7BY.js";
20
+ import "./chunk-2V4AQPBR.js";
21
+ import "./chunk-Q3DNNTPG.js";
25
22
  import "./chunk-XNLSTHDK.js";
26
23
  import "./chunk-WZWDS3W4.js";
27
24
  import "./chunk-PZLD7RTK.js";
package/chunk-52LBC3AX.js DELETED
@@ -1,75 +0,0 @@
1
- var global = globalThis;
2
- import {Buffer} from "node:buffer";
3
- import {setTimeout as _vlt_setTimeout,clearTimeout as _vlt_clearTimeout,setImmediate as _vlt_setImmediate,clearImmediate as _vlt_clearImmediate,setInterval as _vlt_setInterval,clearInterval as _vlt_clearInterval} from "node:timers";
4
- globalThis.setTimeout = _vlt_setTimeout;
5
- globalThis.clearTimeout = _vlt_clearTimeout;
6
- globalThis.setImmediate = _vlt_setImmediate;
7
- globalThis.clearImmediate = _vlt_clearImmediate;
8
- globalThis.setInterval = _vlt_setInterval;
9
- globalThis.clearInterval = _vlt_clearInterval;
10
- import {createRequire as _vlt_createRequire} from "node:module";
11
- var require = _vlt_createRequire(import.meta.filename);
12
- import {
13
- PackageJson,
14
- getUser
15
- } from "./chunk-YR47M5L7.js";
16
- import {
17
- asError,
18
- normalizeManifest
19
- } from "./chunk-XWF3GJKE.js";
20
-
21
- // ../../src/init/src/index.ts
22
- import { basename, resolve } from "node:path";
23
-
24
- // ../../src/init/src/get-author-from-git-user.ts
25
- var getAuthorFromGitUser = (user) => {
26
- if (!user) return "";
27
- const { name, email } = user;
28
- let res = "";
29
- if (name) res += name;
30
- if (email) {
31
- if (name) res += " ";
32
- res += `<${email}>`;
33
- }
34
- return res;
35
- };
36
-
37
- // ../../src/init/src/index.ts
38
- var stderr = console.error;
39
- var template = ({ name, author }) => normalizeManifest({
40
- name,
41
- version: "1.0.0",
42
- description: "",
43
- main: "index.js",
44
- ...author ? { author } : void 0
45
- });
46
- var init = async ({
47
- cwd = process.cwd(),
48
- author,
49
- logger = stderr
50
- } = {}) => {
51
- const packageJson = new PackageJson();
52
- const path = resolve(cwd, "package.json");
53
- let existingData;
54
- try {
55
- existingData = packageJson.read(cwd);
56
- logger("package.json already exists");
57
- } catch (err) {
58
- if (asError(err).message !== "Could not read package.json file") {
59
- throw err;
60
- }
61
- }
62
- const name = basename(cwd);
63
- const templateData = template({
64
- name,
65
- author: author ?? getAuthorFromGitUser(await getUser().catch(() => void 0))
66
- });
67
- const data = existingData ? { ...templateData, ...existingData } : templateData;
68
- const indent = 2;
69
- packageJson.write(cwd, data, indent);
70
- return { manifest: { path, data } };
71
- };
72
-
73
- export {
74
- init
75
- };