giget 1.2.4 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "giget",
3
- "version": "1.2.4",
3
+ "version": "2.0.0",
4
4
  "description": "Download templates and git repositories with pleasure!",
5
5
  "repository": "unjs/giget",
6
6
  "license": "MIT",
@@ -8,19 +8,11 @@
8
8
  "type": "module",
9
9
  "exports": {
10
10
  ".": {
11
- "import": {
12
- "types": "./dist/index.d.mts",
13
- "default": "./dist/index.mjs"
14
- },
15
- "require": {
16
- "types": "./dist/index.d.cts",
17
- "default": "./dist/index.cjs"
18
- }
11
+ "types": "./dist/index.d.mts",
12
+ "default": "./dist/index.mjs"
19
13
  }
20
14
  },
21
- "main": "./dist/index.cjs",
22
- "module": "./dist/index.mjs",
23
- "types": "./dist/index.d.ts",
15
+ "types": "./dist/index.d.mts",
24
16
  "bin": {
25
17
  "giget": "./dist/cli.mjs"
26
18
  },
@@ -43,23 +35,28 @@
43
35
  "consola": "^3.4.0",
44
36
  "defu": "^6.1.4",
45
37
  "node-fetch-native": "^1.6.6",
46
- "nypm": "^0.5.1",
47
- "ohash": "^1.1.4",
48
- "pathe": "^2.0.2",
49
- "tar": "^6.2.1"
38
+ "nypm": "^0.6.0",
39
+ "pathe": "^2.0.3"
50
40
  },
51
41
  "devDependencies": {
52
- "@types/node": "^22.10.10",
42
+ "@types/node": "^22.13.5",
53
43
  "@types/tar": "^6.1.13",
54
- "@vitest/coverage-v8": "^3.0.4",
44
+ "@vitest/coverage-v8": "^3.0.7",
55
45
  "changelogen": "^0.5.7",
56
- "eslint": "^9.19.0",
46
+ "esbuild": "^0.25.0",
47
+ "eslint": "^9.21.0",
57
48
  "eslint-config-unjs": "^0.4.2",
58
49
  "jiti": "^2.4.2",
59
- "prettier": "^3.4.2",
50
+ "prettier": "^3.5.2",
51
+ "tar": "^6.2.1",
60
52
  "typescript": "^5.7.3",
61
53
  "unbuild": "^3.3.1",
62
- "vitest": "^3.0.4"
54
+ "vitest": "^3.0.7"
63
55
  },
64
- "packageManager": "pnpm@9.15.4"
56
+ "packageManager": "pnpm@10.5.0",
57
+ "pnpm": {
58
+ "patchedDependencies": {
59
+ "tar": "patches/tar.patch"
60
+ }
61
+ }
65
62
  }
package/dist/cli.cjs DELETED
@@ -1,179 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const node_path = require('node:path');
5
- const citty = require('citty');
6
- const consola = require('consola');
7
- const giget = require('./shared/giget.ooq4UIqH.cjs');
8
- require('node:fs/promises');
9
- require('node:fs');
10
- require('tar');
11
- require('pathe');
12
- require('defu');
13
- require('nypm');
14
- require('node:stream');
15
- require('node:child_process');
16
- require('node:os');
17
- require('node:util');
18
- require('node-fetch-native/proxy');
19
-
20
- const name = "giget";
21
- const version = "1.2.4";
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
- const pkg = {
84
- name: name,
85
- 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
- };
102
-
103
- const mainCommand = citty.defineCommand({
104
- meta: {
105
- name: pkg.name,
106
- version: pkg.version,
107
- description: pkg.description
108
- },
109
- args: {
110
- // TODO: Make it `-t` in the next major version
111
- template: {
112
- type: "positional",
113
- description: "Template name or a a URI describing provider, repository, subdir, and branch/ref"
114
- },
115
- dir: {
116
- type: "positional",
117
- description: "A relative or absolute path where to extract the template",
118
- required: false
119
- },
120
- auth: {
121
- type: "string",
122
- description: "Custom Authorization token to use for downloading template. (Can be overriden with `GIGET_AUTH` environment variable)"
123
- },
124
- cwd: {
125
- type: "string",
126
- description: "Set current working directory to resolve dirs relative to it"
127
- },
128
- force: {
129
- type: "boolean",
130
- description: "Clone to existing directory even if exists"
131
- },
132
- forceClean: {
133
- type: "boolean",
134
- description: "Remove any existing directory or file recusively before cloning"
135
- },
136
- offline: {
137
- type: "boolean",
138
- description: "o not attempt to download and use cached version"
139
- },
140
- preferOffline: {
141
- type: "boolean",
142
- description: "Use cache if exists otherwise try to download"
143
- },
144
- shell: {
145
- type: "boolean",
146
- description: "Open a new shell with current working "
147
- },
148
- install: {
149
- type: "boolean",
150
- description: "Install dependencies after cloning"
151
- },
152
- verbose: {
153
- type: "boolean",
154
- description: "Show verbose debugging info"
155
- }
156
- },
157
- run: async ({ args }) => {
158
- if (args.verbose) {
159
- process.env.DEBUG = process.env.DEBUG || "true";
160
- }
161
- const r = await giget.downloadTemplate(args.template, {
162
- dir: args.dir,
163
- force: args.force,
164
- forceClean: args.forceClean,
165
- offline: args.offline,
166
- preferOffline: args.preferOffline,
167
- auth: args.auth,
168
- install: args.install
169
- });
170
- const _from = r.name || r.url;
171
- const _to = node_path.relative(process.cwd(), r.dir) || "./";
172
- consola.consola.log(`\u2728 Successfully cloned \`${_from}\` to \`${_to}\`
173
- `);
174
- if (args.shell) {
175
- giget.startShell(r.dir);
176
- }
177
- }
178
- });
179
- citty.runMain(mainCommand);
package/dist/cli.d.cts DELETED
@@ -1 +0,0 @@
1
-
package/dist/cli.d.mts DELETED
@@ -1 +0,0 @@
1
-
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
-
package/dist/index.cjs DELETED
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- const giget = require('./shared/giget.ooq4UIqH.cjs');
4
- require('node:fs/promises');
5
- require('node:fs');
6
- require('tar');
7
- require('pathe');
8
- require('defu');
9
- require('nypm');
10
- require('node:stream');
11
- require('node:child_process');
12
- require('node:os');
13
- require('node:util');
14
- require('node-fetch-native/proxy');
15
-
16
-
17
-
18
- exports.downloadTemplate = giget.downloadTemplate;
19
- exports.registryProvider = giget.registryProvider;
20
- exports.startShell = giget.startShell;
package/dist/index.d.cts DELETED
@@ -1,49 +0,0 @@
1
- interface GitInfo {
2
- provider: "github" | "gitlab" | "bitbucket" | "sourcehut";
3
- repo: string;
4
- subdir: string;
5
- ref: string;
6
- }
7
- interface TemplateInfo {
8
- name: string;
9
- tar: string;
10
- version?: string;
11
- subdir?: string;
12
- url?: string;
13
- defaultDir?: string;
14
- headers?: Record<string, string | undefined>;
15
- source?: never;
16
- dir?: never;
17
- [key: string]: any;
18
- }
19
- type TemplateProvider = (input: string, options: {
20
- auth?: string;
21
- }) => TemplateInfo | Promise<TemplateInfo> | null;
22
-
23
- interface DownloadTemplateOptions {
24
- provider?: string;
25
- force?: boolean;
26
- forceClean?: boolean;
27
- offline?: boolean;
28
- preferOffline?: boolean;
29
- providers?: Record<string, TemplateProvider>;
30
- dir?: string;
31
- registry?: false | string;
32
- cwd?: string;
33
- auth?: string;
34
- install?: boolean;
35
- silent?: boolean;
36
- }
37
- type DownloadTemplateResult = Omit<TemplateInfo, "dir" | "source"> & {
38
- dir: string;
39
- source: string;
40
- };
41
- declare function downloadTemplate(input: string, options?: DownloadTemplateOptions): Promise<DownloadTemplateResult>;
42
-
43
- declare const registryProvider: (registryEndpoint?: string, options?: {
44
- auth?: string;
45
- }) => TemplateProvider;
46
-
47
- declare function startShell(cwd: string): void;
48
-
49
- export { type DownloadTemplateOptions, type DownloadTemplateResult, type GitInfo, type TemplateInfo, type TemplateProvider, downloadTemplate, registryProvider, startShell };
package/dist/index.d.ts DELETED
@@ -1,49 +0,0 @@
1
- interface GitInfo {
2
- provider: "github" | "gitlab" | "bitbucket" | "sourcehut";
3
- repo: string;
4
- subdir: string;
5
- ref: string;
6
- }
7
- interface TemplateInfo {
8
- name: string;
9
- tar: string;
10
- version?: string;
11
- subdir?: string;
12
- url?: string;
13
- defaultDir?: string;
14
- headers?: Record<string, string | undefined>;
15
- source?: never;
16
- dir?: never;
17
- [key: string]: any;
18
- }
19
- type TemplateProvider = (input: string, options: {
20
- auth?: string;
21
- }) => TemplateInfo | Promise<TemplateInfo> | null;
22
-
23
- interface DownloadTemplateOptions {
24
- provider?: string;
25
- force?: boolean;
26
- forceClean?: boolean;
27
- offline?: boolean;
28
- preferOffline?: boolean;
29
- providers?: Record<string, TemplateProvider>;
30
- dir?: string;
31
- registry?: false | string;
32
- cwd?: string;
33
- auth?: string;
34
- install?: boolean;
35
- silent?: boolean;
36
- }
37
- type DownloadTemplateResult = Omit<TemplateInfo, "dir" | "source"> & {
38
- dir: string;
39
- source: string;
40
- };
41
- declare function downloadTemplate(input: string, options?: DownloadTemplateOptions): Promise<DownloadTemplateResult>;
42
-
43
- declare const registryProvider: (registryEndpoint?: string, options?: {
44
- auth?: string;
45
- }) => TemplateProvider;
46
-
47
- declare function startShell(cwd: string): void;
48
-
49
- export { type DownloadTemplateOptions, type DownloadTemplateResult, type GitInfo, type TemplateInfo, type TemplateProvider, downloadTemplate, registryProvider, startShell };