giget 1.2.4 → 1.2.5

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/dist/cli.cjs CHANGED
@@ -4,7 +4,7 @@
4
4
  const node_path = require('node:path');
5
5
  const citty = require('citty');
6
6
  const consola = require('consola');
7
- const giget = require('./shared/giget.ooq4UIqH.cjs');
7
+ const giget = require('./shared/giget.C0XVJdqO.cjs');
8
8
  require('node:fs/promises');
9
9
  require('node:fs');
10
10
  require('tar');
@@ -18,87 +18,12 @@ require('node:util');
18
18
  require('node-fetch-native/proxy');
19
19
 
20
20
  const name = "giget";
21
- const version = "1.2.4";
21
+ const version = "1.2.5";
22
22
  const description = "Download templates and git repositories with pleasure!";
23
- const repository = "unjs/giget";
24
- const license = "MIT";
25
- const sideEffects = false;
26
- const type = "module";
27
- const exports$1 = {
28
- ".": {
29
- "import": {
30
- types: "./dist/index.d.mts",
31
- "default": "./dist/index.mjs"
32
- },
33
- require: {
34
- types: "./dist/index.d.cts",
35
- "default": "./dist/index.cjs"
36
- }
37
- }
38
- };
39
- const main = "./dist/index.cjs";
40
- const module$1 = "./dist/index.mjs";
41
- const types = "./dist/index.d.ts";
42
- const bin = {
43
- giget: "./dist/cli.mjs"
44
- };
45
- const files = [
46
- "dist"
47
- ];
48
- const scripts = {
49
- build: "unbuild",
50
- dev: "vitest dev",
51
- giget: "jiti ./src/cli.ts",
52
- lint: "eslint . && prettier -c src test",
53
- "lint:fix": "eslint . --fix && prettier -w src test",
54
- prepack: "unbuild",
55
- play: "pnpm giget --force-clean --verbose unjs .tmp/clone",
56
- release: "pnpm test && changelogen --release && npm publish && git push --follow-tags",
57
- test: "pnpm lint && vitest run --coverage"
58
- };
59
- const dependencies = {
60
- citty: "^0.1.6",
61
- consola: "^3.4.0",
62
- defu: "^6.1.4",
63
- "node-fetch-native": "^1.6.6",
64
- nypm: "^0.5.1",
65
- ohash: "^1.1.4",
66
- pathe: "^2.0.2",
67
- tar: "^6.2.1"
68
- };
69
- const devDependencies = {
70
- "@types/node": "^22.10.10",
71
- "@types/tar": "^6.1.13",
72
- "@vitest/coverage-v8": "^3.0.4",
73
- changelogen: "^0.5.7",
74
- eslint: "^9.19.0",
75
- "eslint-config-unjs": "^0.4.2",
76
- jiti: "^2.4.2",
77
- prettier: "^3.4.2",
78
- typescript: "^5.7.3",
79
- unbuild: "^3.3.1",
80
- vitest: "^3.0.4"
81
- };
82
- const packageManager = "pnpm@9.15.4";
83
23
  const pkg = {
84
24
  name: name,
85
25
  version: version,
86
- description: description,
87
- repository: repository,
88
- license: license,
89
- sideEffects: sideEffects,
90
- type: type,
91
- exports: exports$1,
92
- main: main,
93
- module: module$1,
94
- types: types,
95
- bin: bin,
96
- files: files,
97
- scripts: scripts,
98
- dependencies: dependencies,
99
- devDependencies: devDependencies,
100
- packageManager: packageManager
101
- };
26
+ description: description};
102
27
 
103
28
  const mainCommand = citty.defineCommand({
104
29
  meta: {
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { relative } from 'node:path';
3
3
  import { defineCommand, runMain } from 'citty';
4
4
  import { consola } from 'consola';
5
- import { d as downloadTemplate, s as startShell } from './shared/giget.D-_6aM9e.mjs';
5
+ import { d as downloadTemplate, s as startShell } from './shared/giget.BgKdRmJH.mjs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:fs';
8
8
  import 'tar';
@@ -16,87 +16,12 @@ import 'node:util';
16
16
  import 'node-fetch-native/proxy';
17
17
 
18
18
  const name = "giget";
19
- const version = "1.2.4";
19
+ const version = "1.2.5";
20
20
  const description = "Download templates and git repositories with pleasure!";
21
- const repository = "unjs/giget";
22
- const license = "MIT";
23
- const sideEffects = false;
24
- const type = "module";
25
- const exports = {
26
- ".": {
27
- "import": {
28
- types: "./dist/index.d.mts",
29
- "default": "./dist/index.mjs"
30
- },
31
- require: {
32
- types: "./dist/index.d.cts",
33
- "default": "./dist/index.cjs"
34
- }
35
- }
36
- };
37
- const main = "./dist/index.cjs";
38
- const module = "./dist/index.mjs";
39
- const types = "./dist/index.d.ts";
40
- const bin = {
41
- giget: "./dist/cli.mjs"
42
- };
43
- const files = [
44
- "dist"
45
- ];
46
- const scripts = {
47
- build: "unbuild",
48
- dev: "vitest dev",
49
- giget: "jiti ./src/cli.ts",
50
- lint: "eslint . && prettier -c src test",
51
- "lint:fix": "eslint . --fix && prettier -w src test",
52
- prepack: "unbuild",
53
- play: "pnpm giget --force-clean --verbose unjs .tmp/clone",
54
- release: "pnpm test && changelogen --release && npm publish && git push --follow-tags",
55
- test: "pnpm lint && vitest run --coverage"
56
- };
57
- const dependencies = {
58
- citty: "^0.1.6",
59
- consola: "^3.4.0",
60
- defu: "^6.1.4",
61
- "node-fetch-native": "^1.6.6",
62
- nypm: "^0.5.1",
63
- ohash: "^1.1.4",
64
- pathe: "^2.0.2",
65
- tar: "^6.2.1"
66
- };
67
- const devDependencies = {
68
- "@types/node": "^22.10.10",
69
- "@types/tar": "^6.1.13",
70
- "@vitest/coverage-v8": "^3.0.4",
71
- changelogen: "^0.5.7",
72
- eslint: "^9.19.0",
73
- "eslint-config-unjs": "^0.4.2",
74
- jiti: "^2.4.2",
75
- prettier: "^3.4.2",
76
- typescript: "^5.7.3",
77
- unbuild: "^3.3.1",
78
- vitest: "^3.0.4"
79
- };
80
- const packageManager = "pnpm@9.15.4";
81
21
  const pkg = {
82
22
  name: name,
83
23
  version: version,
84
- description: description,
85
- repository: repository,
86
- license: license,
87
- sideEffects: sideEffects,
88
- type: type,
89
- exports: exports,
90
- main: main,
91
- module: module,
92
- types: types,
93
- bin: bin,
94
- files: files,
95
- scripts: scripts,
96
- dependencies: dependencies,
97
- devDependencies: devDependencies,
98
- packageManager: packageManager
99
- };
24
+ description: description};
100
25
 
101
26
  const mainCommand = defineCommand({
102
27
  meta: {
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const giget = require('./shared/giget.ooq4UIqH.cjs');
3
+ const giget = require('./shared/giget.C0XVJdqO.cjs');
4
4
  require('node:fs/promises');
5
5
  require('node:fs');
6
6
  require('tar');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { d as downloadTemplate, r as registryProvider, s as startShell } from './shared/giget.D-_6aM9e.mjs';
1
+ export { d as downloadTemplate, r as registryProvider, s as startShell } from './shared/giget.BgKdRmJH.mjs';
2
2
  import 'node:fs/promises';
3
3
  import 'node:fs';
4
4
  import 'tar';
@@ -18,7 +18,7 @@ async function download(url, filePath, options = {}) {
18
18
  const headResponse = await sendFetch(url, {
19
19
  method: "HEAD",
20
20
  headers: options.headers
21
- }).catch(() => undefined);
21
+ }).catch(() => void 0);
22
22
  const etag = headResponse?.headers.get("etag");
23
23
  if (info.etag === etag && existsSync(filePath)) {
24
24
  return;
@@ -132,7 +132,7 @@ const http = async (input, options) => {
132
132
  tar: url.href,
133
133
  defaultDir: name,
134
134
  headers: {
135
- Authorization: options.auth ? `Bearer ${options.auth}` : undefined
135
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0
136
136
  }
137
137
  };
138
138
  };
@@ -140,7 +140,7 @@ const _httpJSON = async (input, options) => {
140
140
  const result = await sendFetch(input, {
141
141
  validateStatus: true,
142
142
  headers: {
143
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
143
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
144
144
  }
145
145
  });
146
146
  const info = await result.json();
@@ -159,7 +159,7 @@ const github = (input, options) => {
159
159
  version: parsed.ref,
160
160
  subdir: parsed.subdir,
161
161
  headers: {
162
- Authorization: options.auth ? `Bearer ${options.auth}` : undefined,
162
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
163
163
  Accept: "application/vnd.github+json",
164
164
  "X-GitHub-Api-Version": "2022-11-28"
165
165
  },
@@ -175,7 +175,7 @@ const gitlab = (input, options) => {
175
175
  version: parsed.ref,
176
176
  subdir: parsed.subdir,
177
177
  headers: {
178
- authorization: options.auth ? `Bearer ${options.auth}` : undefined,
178
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0,
179
179
  // https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2
180
180
  "sec-fetch-mode": "same-origin"
181
181
  },
@@ -190,7 +190,7 @@ const bitbucket = (input, options) => {
190
190
  version: parsed.ref,
191
191
  subdir: parsed.subdir,
192
192
  headers: {
193
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
193
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
194
194
  },
195
195
  url: `https://bitbucket.com/${parsed.repo}/src/${parsed.ref}${parsed.subdir}`,
196
196
  tar: `https://bitbucket.org/${parsed.repo}/get/${parsed.ref}.tar.gz`
@@ -203,7 +203,7 @@ const sourcehut = (input, options) => {
203
203
  version: parsed.ref,
204
204
  subdir: parsed.subdir,
205
205
  headers: {
206
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
206
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
207
207
  },
208
208
  url: `https://git.sr.ht/~${parsed.repo}/tree/${parsed.ref}/item${parsed.subdir}`,
209
209
  tar: `https://git.sr.ht/~${parsed.repo}/archive/${parsed.ref}.tar.gz`
@@ -226,7 +226,7 @@ const registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) =>
226
226
  const registryURL = `${registryEndpoint}/${input}.json`;
227
227
  const result = await sendFetch(registryURL, {
228
228
  headers: {
229
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
229
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
230
230
  }
231
231
  });
232
232
  if (result.status >= 400) {
@@ -256,7 +256,7 @@ async function downloadTemplate(input, options = {}) {
256
256
  },
257
257
  options
258
258
  );
259
- const registry = options.registry === false ? undefined : registryProvider(options.registry, { auth: options.auth });
259
+ const registry = options.registry === false ? void 0 : registryProvider(options.registry, { auth: options.auth });
260
260
  let providerName = options.provider || (registry ? "registry" : "github");
261
261
  let source = input;
262
262
  const sourceProviderMatch = input.match(sourceProtoRe);
@@ -301,7 +301,7 @@ async function downloadTemplate(input, options = {}) {
301
301
  const s2 = Date.now();
302
302
  await download(template.tar, tarPath, {
303
303
  headers: {
304
- Authorization: options.auth ? `Bearer ${options.auth}` : undefined,
304
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
305
305
  ...normalizeHeaders(template.headers)
306
306
  }
307
307
  }).catch((error) => {
@@ -20,7 +20,7 @@ async function download(url, filePath, options = {}) {
20
20
  const headResponse = await sendFetch(url, {
21
21
  method: "HEAD",
22
22
  headers: options.headers
23
- }).catch(() => undefined);
23
+ }).catch(() => void 0);
24
24
  const etag = headResponse?.headers.get("etag");
25
25
  if (info.etag === etag && node_fs.existsSync(filePath)) {
26
26
  return;
@@ -134,7 +134,7 @@ const http = async (input, options) => {
134
134
  tar: url.href,
135
135
  defaultDir: name,
136
136
  headers: {
137
- Authorization: options.auth ? `Bearer ${options.auth}` : undefined
137
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0
138
138
  }
139
139
  };
140
140
  };
@@ -142,7 +142,7 @@ const _httpJSON = async (input, options) => {
142
142
  const result = await sendFetch(input, {
143
143
  validateStatus: true,
144
144
  headers: {
145
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
145
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
146
146
  }
147
147
  });
148
148
  const info = await result.json();
@@ -161,7 +161,7 @@ const github = (input, options) => {
161
161
  version: parsed.ref,
162
162
  subdir: parsed.subdir,
163
163
  headers: {
164
- Authorization: options.auth ? `Bearer ${options.auth}` : undefined,
164
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
165
165
  Accept: "application/vnd.github+json",
166
166
  "X-GitHub-Api-Version": "2022-11-28"
167
167
  },
@@ -177,7 +177,7 @@ const gitlab = (input, options) => {
177
177
  version: parsed.ref,
178
178
  subdir: parsed.subdir,
179
179
  headers: {
180
- authorization: options.auth ? `Bearer ${options.auth}` : undefined,
180
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0,
181
181
  // https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2
182
182
  "sec-fetch-mode": "same-origin"
183
183
  },
@@ -192,7 +192,7 @@ const bitbucket = (input, options) => {
192
192
  version: parsed.ref,
193
193
  subdir: parsed.subdir,
194
194
  headers: {
195
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
195
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
196
196
  },
197
197
  url: `https://bitbucket.com/${parsed.repo}/src/${parsed.ref}${parsed.subdir}`,
198
198
  tar: `https://bitbucket.org/${parsed.repo}/get/${parsed.ref}.tar.gz`
@@ -205,7 +205,7 @@ const sourcehut = (input, options) => {
205
205
  version: parsed.ref,
206
206
  subdir: parsed.subdir,
207
207
  headers: {
208
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
208
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
209
209
  },
210
210
  url: `https://git.sr.ht/~${parsed.repo}/tree/${parsed.ref}/item${parsed.subdir}`,
211
211
  tar: `https://git.sr.ht/~${parsed.repo}/archive/${parsed.ref}.tar.gz`
@@ -228,7 +228,7 @@ const registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) =>
228
228
  const registryURL = `${registryEndpoint}/${input}.json`;
229
229
  const result = await sendFetch(registryURL, {
230
230
  headers: {
231
- authorization: options.auth ? `Bearer ${options.auth}` : undefined
231
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0
232
232
  }
233
233
  });
234
234
  if (result.status >= 400) {
@@ -258,7 +258,7 @@ async function downloadTemplate(input, options = {}) {
258
258
  },
259
259
  options
260
260
  );
261
- const registry = options.registry === false ? undefined : registryProvider(options.registry, { auth: options.auth });
261
+ const registry = options.registry === false ? void 0 : registryProvider(options.registry, { auth: options.auth });
262
262
  let providerName = options.provider || (registry ? "registry" : "github");
263
263
  let source = input;
264
264
  const sourceProviderMatch = input.match(sourceProtoRe);
@@ -303,7 +303,7 @@ async function downloadTemplate(input, options = {}) {
303
303
  const s2 = Date.now();
304
304
  await download(template.tar, tarPath, {
305
305
  headers: {
306
- Authorization: options.auth ? `Bearer ${options.auth}` : undefined,
306
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
307
307
  ...normalizeHeaders(template.headers)
308
308
  }
309
309
  }).catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "giget",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Download templates and git repositories with pleasure!",
5
5
  "repository": "unjs/giget",
6
6
  "license": "MIT",
@@ -43,23 +43,22 @@
43
43
  "consola": "^3.4.0",
44
44
  "defu": "^6.1.4",
45
45
  "node-fetch-native": "^1.6.6",
46
- "nypm": "^0.5.1",
47
- "ohash": "^1.1.4",
48
- "pathe": "^2.0.2",
46
+ "nypm": "^0.5.4",
47
+ "pathe": "^2.0.3",
49
48
  "tar": "^6.2.1"
50
49
  },
51
50
  "devDependencies": {
52
- "@types/node": "^22.10.10",
51
+ "@types/node": "^22.13.4",
53
52
  "@types/tar": "^6.1.13",
54
- "@vitest/coverage-v8": "^3.0.4",
53
+ "@vitest/coverage-v8": "^3.0.6",
55
54
  "changelogen": "^0.5.7",
56
- "eslint": "^9.19.0",
55
+ "eslint": "^9.20.1",
57
56
  "eslint-config-unjs": "^0.4.2",
58
57
  "jiti": "^2.4.2",
59
- "prettier": "^3.4.2",
58
+ "prettier": "^3.5.1",
60
59
  "typescript": "^5.7.3",
61
60
  "unbuild": "^3.3.1",
62
- "vitest": "^3.0.4"
61
+ "vitest": "^3.0.6"
63
62
  },
64
- "packageManager": "pnpm@9.15.4"
63
+ "packageManager": "pnpm@10.4.1"
65
64
  }