@youcan/cli-kit 1.1.0-beta.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/LICENSE +21 -0
- package/dist/common/string.d.ts +1 -0
- package/dist/common/string.js +7 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +16 -0
- package/dist/internal/node/constants.d.ts +4 -0
- package/dist/internal/node/constants.js +14 -0
- package/dist/internal/node/ui.d.ts +11 -0
- package/dist/internal/node/ui.js +45 -0
- package/dist/node/cli.d.ts +17 -0
- package/dist/node/cli.js +61 -0
- package/dist/node/context/helpers.d.ts +1 -0
- package/dist/node/context/helpers.js +8 -0
- package/dist/node/context/local.d.ts +2 -0
- package/dist/node/context/local.js +7 -0
- package/dist/node/filesystem.d.ts +8 -0
- package/dist/node/filesystem.js +24 -0
- package/dist/node/git.d.ts +10 -0
- package/dist/node/git.js +52 -0
- package/dist/node/github.d.ts +6 -0
- package/dist/node/github.js +11 -0
- package/dist/node/path.d.ts +3 -0
- package/dist/node/path.js +13 -0
- package/dist/node/system.d.ts +17 -0
- package/dist/node/system.js +47 -0
- package/dist/node/tasks.d.ts +7 -0
- package/dist/node/tasks.js +30 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 YouCan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hyphenate(value: string): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as Cli from './node/cli';
|
|
2
|
+
export * as Git from './node/git';
|
|
3
|
+
export * as Path from './node/path';
|
|
4
|
+
export * as Tasks from './node/tasks';
|
|
5
|
+
export * as Github from './node/github';
|
|
6
|
+
export * as System from './node/system';
|
|
7
|
+
export * as Filesystem from './node/filesystem';
|
|
8
|
+
export * as String from './common/string';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as cli from './node/cli.js';
|
|
2
|
+
export { cli as Cli };
|
|
3
|
+
import * as git from './node/git.js';
|
|
4
|
+
export { git as Git };
|
|
5
|
+
import * as path from './node/path.js';
|
|
6
|
+
export { path as Path };
|
|
7
|
+
import * as tasks from './node/tasks.js';
|
|
8
|
+
export { tasks as Tasks };
|
|
9
|
+
import * as github from './node/github.js';
|
|
10
|
+
export { github as Github };
|
|
11
|
+
import * as system from './node/system.js';
|
|
12
|
+
export { system as System };
|
|
13
|
+
import * as filesystem from './node/filesystem.js';
|
|
14
|
+
export { filesystem as Filesystem };
|
|
15
|
+
import * as string from './common/string.js';
|
|
16
|
+
export { string as String };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import envpaths from 'env-paths';
|
|
2
|
+
|
|
3
|
+
const identifier = 'youcan-cli';
|
|
4
|
+
function cachedir() {
|
|
5
|
+
if (process.env.XDG_CACHE_HOME) {
|
|
6
|
+
return process.env.XDG_CACHE_HOME;
|
|
7
|
+
}
|
|
8
|
+
return envpaths(identifier).cache;
|
|
9
|
+
}
|
|
10
|
+
const envvars = {
|
|
11
|
+
env: 'YC_CLI_ENV',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { cachedir, envvars };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare class Loader {
|
|
3
|
+
private message;
|
|
4
|
+
timer: NodeJS.Timeout | null;
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
start(): this;
|
|
7
|
+
private flush;
|
|
8
|
+
stop(): this;
|
|
9
|
+
error(message?: string | null): this;
|
|
10
|
+
static exec(message: string, closure: (loader: Loader) => Promise<void>): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import kleur from 'kleur';
|
|
2
|
+
|
|
3
|
+
class Loader {
|
|
4
|
+
message;
|
|
5
|
+
timer;
|
|
6
|
+
constructor(message) {
|
|
7
|
+
this.message = message;
|
|
8
|
+
this.message = message;
|
|
9
|
+
this.timer = null;
|
|
10
|
+
}
|
|
11
|
+
start() {
|
|
12
|
+
process.stdout.write('\x1B[?25l');
|
|
13
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
14
|
+
let i = 0;
|
|
15
|
+
this.timer = setInterval(() => {
|
|
16
|
+
process.stdout.write(`\r${frames[i = ++i % frames.length]} ${this.message}`);
|
|
17
|
+
}, 100);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
flush() {
|
|
21
|
+
if (this.timer) {
|
|
22
|
+
clearInterval(this.timer);
|
|
23
|
+
this.timer = null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
stop() {
|
|
27
|
+
this.flush();
|
|
28
|
+
process.stdout.write('\r');
|
|
29
|
+
process.stdout.write(kleur.green(`✔ ${this.message}\n`));
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
error(message = null) {
|
|
33
|
+
this.flush();
|
|
34
|
+
process.stdout.write('\r');
|
|
35
|
+
process.stdout.write(kleur.red(`✖ ${message ?? this.message}\n`));
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
static async exec(message, closure) {
|
|
39
|
+
const loader = new Loader(message).start();
|
|
40
|
+
await closure(loader);
|
|
41
|
+
loader.timer && loader.stop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { Loader };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command as BaseCommand, ux } from '@oclif/core';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
interface ExecOptions {
|
|
4
|
+
moduleUrl: string;
|
|
5
|
+
development: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function exec(options: ExecOptions): Promise<void>;
|
|
8
|
+
export declare function execCreate(cmdlet: string, options: ExecOptions): Promise<void>;
|
|
9
|
+
export declare const commonFlags: {
|
|
10
|
+
'no-color': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
export declare abstract class Command extends BaseCommand {
|
|
14
|
+
output: typeof ux;
|
|
15
|
+
prompt: typeof prompts;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/dist/node/cli.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Flags, Command as Command$1, ux } from '@oclif/core';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import { truthy } from './context/helpers.js';
|
|
4
|
+
import { isDevelopment } from './context/local.js';
|
|
5
|
+
|
|
6
|
+
function setupEnvVars(options) {
|
|
7
|
+
if (process.argv.includes('--verbose')) {
|
|
8
|
+
process.env.DEBUG = process.env.DEBUG ?? '*';
|
|
9
|
+
}
|
|
10
|
+
if (options.development) {
|
|
11
|
+
process.env.YC_CLI_ENV ??= 'development';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function setupColorMode() {
|
|
15
|
+
if (process.argv.includes('--no-color')
|
|
16
|
+
|| truthy(process.env.NO_COLOR)
|
|
17
|
+
|| truthy(process.env.YC_FLAG_NO_COLOR)
|
|
18
|
+
|| process.env.TERM === 'dumb') {
|
|
19
|
+
process.env.FORCE_COLOR = '0';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function exec(options) {
|
|
23
|
+
setupEnvVars(options);
|
|
24
|
+
setupColorMode();
|
|
25
|
+
const { run, settings, flush, Errors } = await import('@oclif/core');
|
|
26
|
+
if (isDevelopment()) {
|
|
27
|
+
settings.debug = true;
|
|
28
|
+
}
|
|
29
|
+
run(undefined, options.moduleUrl)
|
|
30
|
+
.then(() => flush())
|
|
31
|
+
.catch(err => Errors.handle(err));
|
|
32
|
+
}
|
|
33
|
+
async function execCreate(cmdlet, options) {
|
|
34
|
+
setupEnvVars(options);
|
|
35
|
+
const initIndex = process.argv
|
|
36
|
+
.findIndex(arg => arg.includes('init'));
|
|
37
|
+
if (initIndex === -1) {
|
|
38
|
+
const initIndex = process.argv
|
|
39
|
+
.findIndex(arg => arg.match(new RegExp(`bin(\\/|\\\\)+(create-${cmdlet}|dev|exec)`))) + 1;
|
|
40
|
+
process.argv.splice(initIndex, 0, 'init');
|
|
41
|
+
}
|
|
42
|
+
await exec(options);
|
|
43
|
+
}
|
|
44
|
+
const commonFlags = {
|
|
45
|
+
'no-color': Flags.boolean({
|
|
46
|
+
hidden: false,
|
|
47
|
+
description: 'Disable color output.',
|
|
48
|
+
env: 'YC_FLAG_NO_COLOR',
|
|
49
|
+
}),
|
|
50
|
+
'verbose': Flags.boolean({
|
|
51
|
+
hidden: false,
|
|
52
|
+
description: 'Increase the verbosity of the logs.',
|
|
53
|
+
env: 'YC_FLAG_VERBOSE',
|
|
54
|
+
}),
|
|
55
|
+
};
|
|
56
|
+
class Command extends Command$1 {
|
|
57
|
+
output = ux;
|
|
58
|
+
prompt = prompts;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { Command, commonFlags, exec, execCreate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function truthy(val: string | undefined): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function exists(path: string): Promise<boolean>;
|
|
2
|
+
export declare function tapIntoTmp<T>(callback: (tmp: string) => T | Promise<T>): Promise<T>;
|
|
3
|
+
export declare function mkdir(path: string): Promise<void>;
|
|
4
|
+
interface MoveFileOptions {
|
|
5
|
+
overwrite?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function move(src: string, dest: string, options?: MoveFileOptions): Promise<void>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import FilesystemPromises from 'node:fs/promises';
|
|
2
|
+
import { temporaryDirectoryTask } from 'tempy';
|
|
3
|
+
import FsExtra from 'fs-extra';
|
|
4
|
+
|
|
5
|
+
async function exists(path) {
|
|
6
|
+
try {
|
|
7
|
+
await FilesystemPromises.access(path);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function tapIntoTmp(callback) {
|
|
15
|
+
return temporaryDirectoryTask(callback);
|
|
16
|
+
}
|
|
17
|
+
async function mkdir(path) {
|
|
18
|
+
await FilesystemPromises.mkdir(path, { recursive: true });
|
|
19
|
+
}
|
|
20
|
+
async function move(src, dest, options = {}) {
|
|
21
|
+
await FsExtra.move(src, dest, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { exists, mkdir, move, tapIntoTmp };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function binaryExists(): Promise<boolean>;
|
|
2
|
+
export interface CloneOptions {
|
|
3
|
+
url: string;
|
|
4
|
+
destination: string;
|
|
5
|
+
progressUpdater?: (statusString: string) => void;
|
|
6
|
+
shallow?: boolean;
|
|
7
|
+
latestTag?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function assertGitExists(): Promise<void>;
|
|
10
|
+
export declare function clone(cloneOptions: CloneOptions): Promise<void>;
|
package/dist/node/git.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import git from 'simple-git';
|
|
2
|
+
import { exec } from './system.js';
|
|
3
|
+
|
|
4
|
+
async function binaryExists() {
|
|
5
|
+
try {
|
|
6
|
+
await exec('git', ['--version']);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function assertGitExists() {
|
|
14
|
+
if (!(await binaryExists())) {
|
|
15
|
+
throw new Error('Git is required for the setup to continue.');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async function clone(cloneOptions) {
|
|
19
|
+
await assertGitExists();
|
|
20
|
+
const { url, destination, shallow, latestTag } = cloneOptions;
|
|
21
|
+
const [repository, branch] = url.split('#');
|
|
22
|
+
const options = { '--recurse-submodules': null };
|
|
23
|
+
// ignore latest tag if branch is provided
|
|
24
|
+
if (branch) {
|
|
25
|
+
options['--branch'] = branch;
|
|
26
|
+
}
|
|
27
|
+
if (shallow && latestTag) {
|
|
28
|
+
throw new Error('Cannot get a shallow clone of the latest branch.');
|
|
29
|
+
}
|
|
30
|
+
if (shallow) {
|
|
31
|
+
options['--depth'] = 1;
|
|
32
|
+
}
|
|
33
|
+
const simpleGitOptions = {
|
|
34
|
+
config: ['core.askpass=true'],
|
|
35
|
+
};
|
|
36
|
+
await git(simpleGitOptions)
|
|
37
|
+
.clone(repository, destination, options);
|
|
38
|
+
if (latestTag) {
|
|
39
|
+
const localRepo = git(destination);
|
|
40
|
+
const latestTag = await getLocalLatestTag(localRepo, url);
|
|
41
|
+
await localRepo.checkout(latestTag);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async function getLocalLatestTag(repository, url) {
|
|
45
|
+
const latest = (await repository.tags()).latest;
|
|
46
|
+
if (!latest) {
|
|
47
|
+
throw new Error(`Couldn't infer the latest tag from ${url}`);
|
|
48
|
+
}
|
|
49
|
+
return latest;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { assertGitExists, binaryExists, clone };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function parseRepositoryReference(reference) {
|
|
2
|
+
const url = new URL(reference);
|
|
3
|
+
const [, user, repo, ...repoPath] = url.pathname.split('/');
|
|
4
|
+
return {
|
|
5
|
+
baseUrl: `${url.origin}/${user}/${repo}`,
|
|
6
|
+
branch: url.hash ? url.hash.slice(1) : undefined,
|
|
7
|
+
path: repoPath.length > 0 ? repoPath.join('/') : undefined,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { parseRepositoryReference };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
function resolve(...paths) {
|
|
4
|
+
return path.resolve(...paths);
|
|
5
|
+
}
|
|
6
|
+
function cwd() {
|
|
7
|
+
return path.normalize(process.env.INIT_CWD ? process.env.INIT_CWD : process.cwd());
|
|
8
|
+
}
|
|
9
|
+
function join(...paths) {
|
|
10
|
+
return path.join(...paths);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { cwd, join, resolve };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Readable, Writable } from 'stream';
|
|
4
|
+
export interface ExecOptions {
|
|
5
|
+
cwd?: string;
|
|
6
|
+
env?: {
|
|
7
|
+
[key: string]: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
stdin?: Readable | 'inherit';
|
|
10
|
+
stdout?: Writable | 'inherit';
|
|
11
|
+
stderr?: Writable | 'inherit';
|
|
12
|
+
stdio?: 'inherit';
|
|
13
|
+
input?: string;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
errorHandler?: (error: unknown) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function exec(command: string, args: string[], options?: ExecOptions): Promise<void>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
|
|
3
|
+
function buildExec(command, args, options) {
|
|
4
|
+
const env = options?.env ?? process.env;
|
|
5
|
+
const commandProcess = execa(command, args, {
|
|
6
|
+
env,
|
|
7
|
+
cwd: options?.cwd,
|
|
8
|
+
input: options?.input,
|
|
9
|
+
stdio: options?.stdio,
|
|
10
|
+
stdin: options?.stdin,
|
|
11
|
+
stdout: options?.stdout === 'inherit' ? 'inherit' : undefined,
|
|
12
|
+
stderr: options?.stderr === 'inherit' ? 'inherit' : undefined,
|
|
13
|
+
windowsHide: false,
|
|
14
|
+
});
|
|
15
|
+
return commandProcess;
|
|
16
|
+
}
|
|
17
|
+
async function exec(command, args, options) {
|
|
18
|
+
const commandProcess = buildExec(command, args, options);
|
|
19
|
+
if (options?.stderr && options.stderr !== 'inherit') {
|
|
20
|
+
commandProcess.stderr?.pipe(options.stderr, { end: false });
|
|
21
|
+
}
|
|
22
|
+
if (options?.stdout && options.stdout !== 'inherit') {
|
|
23
|
+
commandProcess.stdout?.pipe(options.stdout, { end: false });
|
|
24
|
+
}
|
|
25
|
+
let aborted = false;
|
|
26
|
+
options?.signal?.addEventListener('abort', () => {
|
|
27
|
+
const pid = commandProcess.pid;
|
|
28
|
+
if (pid) {
|
|
29
|
+
aborted = true;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
try {
|
|
33
|
+
await commandProcess;
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
if (aborted) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (options?.errorHandler) {
|
|
40
|
+
await options?.errorHandler(err);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { exec };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Loader } from '../internal/node/ui.js';
|
|
2
|
+
|
|
3
|
+
async function runTask(task, ctx) {
|
|
4
|
+
if (task.skip?.(ctx)) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
return await task.task(ctx, task);
|
|
8
|
+
}
|
|
9
|
+
async function run(tasks) {
|
|
10
|
+
const context = {};
|
|
11
|
+
for (const task of tasks) {
|
|
12
|
+
await Loader.exec(task.title, async (loader) => {
|
|
13
|
+
try {
|
|
14
|
+
const subtasks = await runTask(task, context);
|
|
15
|
+
if (Array.isArray(subtasks) && subtasks.length > 0 && subtasks.every(t => 'task' in t)) {
|
|
16
|
+
for (const subtask of subtasks) {
|
|
17
|
+
await runTask(subtask, context);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
loader.stop();
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
loader.error(String(err));
|
|
24
|
+
throw err;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { run };
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@youcan/cli-kit",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.1.0-beta.0",
|
|
5
|
+
"description": "Utilities for the YouCan CLI",
|
|
6
|
+
"author": "YouCan <contact@youcan.shop> (https://youcan.shop)",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"youcan",
|
|
10
|
+
"youcan-cli",
|
|
11
|
+
"youcan-app"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@oclif/core": "^2.15.0",
|
|
23
|
+
"change-case": "^4.1.2",
|
|
24
|
+
"env-paths": "^3.0.0",
|
|
25
|
+
"execa": "^6.1.0",
|
|
26
|
+
"fs-extra": "^11.1.1",
|
|
27
|
+
"kleur": "^4.1.5",
|
|
28
|
+
"prompts": "^2.4.2",
|
|
29
|
+
"simple-git": "^3.20.0",
|
|
30
|
+
"tempy": "^3.1.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/fs-extra": "^11.0.2",
|
|
34
|
+
"@types/node": "^18.18.0",
|
|
35
|
+
"@types/prompts": "^2.4.5",
|
|
36
|
+
"shx": "^0.3.4"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "shx rm -rf dist && tsc --noEmit && rollup --config rollup.config.js",
|
|
40
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
41
|
+
"release": "pnpm publish --access public",
|
|
42
|
+
"type-check": "tsc --noEmit"
|
|
43
|
+
}
|
|
44
|
+
}
|