@reliverse/dler 1.7.68 → 1.7.69
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 +74 -0
- package/bin/app/create/cmd.d.ts +47 -0
- package/bin/app/create/cmd.js +170 -0
- package/bin/app/init/cmd.d.ts +2 -0
- package/bin/app/init/cmd.js +14 -0
- package/bin/app/install/cmd.d.ts +50 -0
- package/bin/app/install/cmd.js +83 -0
- package/bin/app/remove/cmd.d.ts +42 -0
- package/bin/app/remove/cmd.js +71 -0
- package/bin/app/x/cmd.d.ts +18 -31
- package/bin/app/x/cmd.js +133 -137
- package/bin/libs/cfg/cfg-impl/rse-config/rse-impl/rse-define.d.ts +11 -11
- package/bin/libs/sdk/sdk-impl/config/info.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -960,6 +960,80 @@ special thanks to the project that inspired `@reliverse/dler`:
|
|
|
960
960
|
- [x] allow plugins to extend dler's `defineconfig` (`hooksBeforeBuild` and `hooksAfterBuild` are now available, plugin's options can be passed directly to plugin's params, e.g. `hooksBeforeBuild: [ async () => { await myCoolPlugin({ /* plugin's options */ }); } ],`)
|
|
961
961
|
- [ ] at the moment any bundler like `mkdist` can be called using `bun`, but bun's own bundler is not yet fully supported
|
|
962
962
|
- [ ] support all well-known package managers (currently only bun is fully supported)
|
|
963
|
+
- [ ] `dler <command> [...flags] [...args]` usage should support both `bun` and `dler` own commands and flags
|
|
964
|
+
|
|
965
|
+
### todo: commands
|
|
966
|
+
|
|
967
|
+
- [ ] run ./my-script.ts Execute a file with Bun
|
|
968
|
+
- [ ] lint Run a package.json script
|
|
969
|
+
- [ ] test Run unit tests with Bun
|
|
970
|
+
- [ ] x nuxi Execute a package binary (CLI), installing if needed (dler x)
|
|
971
|
+
- [ ] repl Start a REPL session with Bun
|
|
972
|
+
- [ ] exec Run a shell script directly with Bun
|
|
973
|
+
- [ ] install Install dependencies for a package.json (dler i)
|
|
974
|
+
- [ ] add elysia Add a dependency to package.json (dler a)
|
|
975
|
+
- [ ] remove backbone Remove a dependency from package.json (dler rm)
|
|
976
|
+
- [ ] update @shumai/shumai Update outdated dependencies
|
|
977
|
+
- [ ] audit Check installed packages for vulnerabilities
|
|
978
|
+
- [ ] outdated Display latest versions of outdated dependencies
|
|
979
|
+
- [ ] link [<package>] Register or link a local npm package
|
|
980
|
+
- [ ] unlink Unregister a local npm package
|
|
981
|
+
- [ ] publish Publish a package(s) to the npm/jsr registry
|
|
982
|
+
- [ ] patch <pkg> Prepare a package for patching
|
|
983
|
+
- [ ] pm <subcommand> Additional package management utilities
|
|
984
|
+
- [ ] info hono Display package metadata from the registry
|
|
985
|
+
- [ ] build ./a.ts ./b.jsx Bundle TypeScript & JavaScript into a single file
|
|
986
|
+
- [ ] init Start an empty project from a built-in template
|
|
987
|
+
- [ ] create next-app Create a new project from a template (bun c)
|
|
988
|
+
- [ ] upgrade Upgrade to latest version both of dler and your package manager.
|
|
989
|
+
- [x] <command> --help Print help text for command.
|
|
990
|
+
|
|
991
|
+
### todo: flag
|
|
992
|
+
|
|
993
|
+
- [ ] --watch Automatically restart the process on file change
|
|
994
|
+
- [ ] --hot Enable auto reload in the Bun runtime, test runner, or bundler
|
|
995
|
+
- [ ] --no-clear-screen Disable clearing the terminal screen on reload when --hot or --watch is enabled
|
|
996
|
+
- [ ] --smol Use less memory, but run garbage collection more often
|
|
997
|
+
- [ ] -r, --preload=<val> Import a module before other modules are loaded
|
|
998
|
+
- [ ] --require=<val> Alias of --preload, for Node.js compatibility
|
|
999
|
+
- [ ] --import=<val> Alias of --preload, for Node.js compatibility
|
|
1000
|
+
- [ ] --inspect=<val> Activate Bun's debugger
|
|
1001
|
+
- [ ] --inspect-wait=<val> Activate Bun's debugger, wait for a connection before executing
|
|
1002
|
+
- [ ] --inspect-brk=<val> Activate Bun's debugger, set breakpoint on first line of code and wait
|
|
1003
|
+
- [ ] --if-present Exit without an error if the entrypoint does not exist
|
|
1004
|
+
- [ ] --no-install Disable auto install in the Bun runtime
|
|
1005
|
+
- [ ] --install=<val> Configure auto-install behavior. One of "auto" (default, auto-installs when no node_modules), "fallback" (missing packages only), "force" (always).
|
|
1006
|
+
- [ ] -i Auto-install dependencies during execution. Equivalent to --install=fallback.
|
|
1007
|
+
- [ ] -e, --eval=<val> Evaluate argument as a script
|
|
1008
|
+
- [ ] -p, --print=<val> Evaluate argument as a script and print the result
|
|
1009
|
+
- [ ] --prefer-offline Skip staleness checks for packages in the Bun runtime and resolve from disk
|
|
1010
|
+
- [ ] --prefer-latest Use the latest matching versions of packages in the Bun runtime, always checking npm
|
|
1011
|
+
- [ ] --port=<val> Set the default port for Bun.serve
|
|
1012
|
+
- [ ] --conditions=<val> Pass custom conditions to resolve
|
|
1013
|
+
- [ ] --fetch-preconnect=<val> Preconnect to a URL while code is loading
|
|
1014
|
+
- [ ] --max-http-header-size=<val> Set the maximum size of HTTP headers in bytes. Default is 16KiB
|
|
1015
|
+
- [ ] --dns-result-order=<val> Set the default order of DNS lookup results. Valid orders: verbatim (default), ipv4first, ipv6first
|
|
1016
|
+
- [ ] --expose-gc Expose gc() on the global object. Has no effect on Bun.gc().
|
|
1017
|
+
- [ ] --no-deprecation Suppress all reporting of the custom deprecation.
|
|
1018
|
+
- [ ] --throw-deprecation Determine whether or not deprecation warnings result in errors.
|
|
1019
|
+
- [ ] --title=<val> Set the process title
|
|
1020
|
+
- [ ] --zero-fill-buffers Boolean to force Buffer.allocUnsafe(size) to be zero-filled.
|
|
1021
|
+
- [ ] --redis-preconnect Preconnect to $REDIS_URL at startup
|
|
1022
|
+
- [ ] --sql-preconnect Preconnect to PostgreSQL at startup
|
|
1023
|
+
- [ ] --no-addons Throw an error if process.dlopen is called, and disable export condition "node-addons"
|
|
1024
|
+
- [ ] --unhandled-rejections=<val> One of "strict", "throw", "warn", "none", or "warn-with-error-code"
|
|
1025
|
+
- [ ] --console-depth=<val> Set the default depth for console.log object inspection (default: 2)
|
|
1026
|
+
- [ ] --silent Don't print the script command
|
|
1027
|
+
- [ ] --elide-lines=<val> Number of lines of script output shown when using --filter (default: 10). Set to 0 to show all lines.
|
|
1028
|
+
- [ ] -v, --version Print version and exit
|
|
1029
|
+
- [ ] --revision Print version with revision and exit
|
|
1030
|
+
- [ ] -F, --filter=<val> Run a script in all workspace packages matching the pattern
|
|
1031
|
+
- [ ] -b, --bun Force a script or package to use Bun's runtime instead of Node.js (via symlinking node)
|
|
1032
|
+
- [ ] --shell=<val> Control the shell used for package.json scripts. Supports either 'bun' or 'system'
|
|
1033
|
+
- [ ] --env-file=<val> Load environment variables from the specified file(s)
|
|
1034
|
+
- [ ] --cwd=<val> Absolute path to resolve files & entry points from. This just changes the process' cwd.
|
|
1035
|
+
- [ ] -c, --config=<val> Specify path to Bun config file. Default $cwd/bunfig.toml
|
|
1036
|
+
- [ ] -h, --help Display this menu and exit
|
|
963
1037
|
|
|
964
1038
|
## support
|
|
965
1039
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* USAGE EXAMPLES:
|
|
3
|
+
* - dler create react-app - creates a project from template (like bun create, pnpm create)
|
|
4
|
+
* - dler create --mode files - creates files from templates
|
|
5
|
+
* - dler create --mode files --fileType md:README - creates specific file type
|
|
6
|
+
* - dler create --mode files --multiple - creates multiple file types
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import("@reliverse/rempts").Command<{
|
|
9
|
+
template: {
|
|
10
|
+
type: "positional";
|
|
11
|
+
description: string;
|
|
12
|
+
required: false;
|
|
13
|
+
};
|
|
14
|
+
mode: {
|
|
15
|
+
type: "string";
|
|
16
|
+
description: string;
|
|
17
|
+
allowed: string[];
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
fileType: {
|
|
21
|
+
type: "string";
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
destDir: {
|
|
25
|
+
type: "string";
|
|
26
|
+
description: string;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
multiple: {
|
|
30
|
+
type: "boolean";
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
parallel: {
|
|
34
|
+
type: "boolean";
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
concurrency: {
|
|
38
|
+
type: "string";
|
|
39
|
+
description: string;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
cwd: {
|
|
43
|
+
type: "string";
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { relinka } from "@reliverse/relinka";
|
|
2
|
+
import { defineArgs, defineCommand, multiselectPrompt, selectPrompt } from "@reliverse/rempts";
|
|
3
|
+
import { x } from "../../libs/sdk/sdk-impl/utils/exec/exec-mod.js";
|
|
4
|
+
import { FILE_TYPES } from "../../libs/sdk/sdk-impl/utils/init/init-const.js";
|
|
5
|
+
import { initFile, initFiles } from "../../libs/sdk/sdk-impl/utils/init/init-impl.js";
|
|
6
|
+
import { detectPackageManager } from "../../libs/sdk/sdk-impl/utils/pm/pm-detect.js";
|
|
7
|
+
export default defineCommand({
|
|
8
|
+
meta: {
|
|
9
|
+
name: "create",
|
|
10
|
+
version: "1.1.0",
|
|
11
|
+
description: "Create projects from templates or create files. Usage example: `dler create react-app` or `dler create --mode files`"
|
|
12
|
+
},
|
|
13
|
+
args: defineArgs({
|
|
14
|
+
template: {
|
|
15
|
+
type: "positional",
|
|
16
|
+
description: "Template name for project creation (e.g., react-app, next-app)",
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
mode: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Mode to use: template (default), files",
|
|
22
|
+
allowed: ["template", "files"],
|
|
23
|
+
default: "template"
|
|
24
|
+
},
|
|
25
|
+
fileType: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "File type to create (e.g. 'md:README') - only for files mode"
|
|
28
|
+
},
|
|
29
|
+
destDir: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Destination directory",
|
|
32
|
+
default: "."
|
|
33
|
+
},
|
|
34
|
+
multiple: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
description: "Whether to select multiple file types from the library - only for files mode"
|
|
37
|
+
},
|
|
38
|
+
parallel: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Run tasks in parallel - only for files mode"
|
|
41
|
+
},
|
|
42
|
+
concurrency: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Concurrency limit if parallel is true - only for files mode",
|
|
45
|
+
default: "4"
|
|
46
|
+
},
|
|
47
|
+
cwd: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: "Current working directory"
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
async run({ args }) {
|
|
53
|
+
const { template, mode, fileType, destDir, multiple, parallel, concurrency, cwd } = args;
|
|
54
|
+
if (mode === "files") {
|
|
55
|
+
await handleFileCreation({ fileType, destDir, multiple, parallel, concurrency });
|
|
56
|
+
} else {
|
|
57
|
+
await handleTemplateCreation({ template, destDir, cwd });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
async function handleFileCreation({
|
|
62
|
+
fileType,
|
|
63
|
+
destDir,
|
|
64
|
+
multiple,
|
|
65
|
+
parallel,
|
|
66
|
+
concurrency
|
|
67
|
+
}) {
|
|
68
|
+
const concurrencyNum = Number(concurrency);
|
|
69
|
+
if (fileType && !FILE_TYPES.find((ft) => ft.type === fileType)) {
|
|
70
|
+
throw new Error(`Invalid file type: ${fileType}`);
|
|
71
|
+
}
|
|
72
|
+
const effectiveFileType = fileType;
|
|
73
|
+
if (multiple) {
|
|
74
|
+
const possibleTypes = FILE_TYPES.map((ft) => ft.type);
|
|
75
|
+
const chosen = await multiselectPrompt({
|
|
76
|
+
title: "Select file types to create",
|
|
77
|
+
options: possibleTypes.map((pt) => ({ label: pt, value: pt }))
|
|
78
|
+
});
|
|
79
|
+
if (chosen.length === 0) {
|
|
80
|
+
relinka("log", "No file types selected. Exiting...");
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const requests = chosen.map((ct) => ({
|
|
84
|
+
fileType: ct,
|
|
85
|
+
destDir
|
|
86
|
+
}));
|
|
87
|
+
const results = await initFiles(requests, {
|
|
88
|
+
parallel,
|
|
89
|
+
concurrency: concurrencyNum
|
|
90
|
+
});
|
|
91
|
+
relinka("verbose", `Multiple files result: ${JSON.stringify(results)}`);
|
|
92
|
+
} else {
|
|
93
|
+
let finalFileType = effectiveFileType;
|
|
94
|
+
if (!finalFileType) {
|
|
95
|
+
const possibleTypes = FILE_TYPES.map((ft) => ft.type);
|
|
96
|
+
const picked = await selectPrompt({
|
|
97
|
+
title: "Pick a file type to create",
|
|
98
|
+
options: possibleTypes.map((pt) => ({ label: pt, value: pt }))
|
|
99
|
+
});
|
|
100
|
+
finalFileType = picked;
|
|
101
|
+
}
|
|
102
|
+
const result = await initFile({
|
|
103
|
+
fileType: finalFileType,
|
|
104
|
+
destDir
|
|
105
|
+
});
|
|
106
|
+
relinka("verbose", `Single file result: ${JSON.stringify(result)}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async function handleTemplateCreation({
|
|
110
|
+
template,
|
|
111
|
+
destDir,
|
|
112
|
+
cwd
|
|
113
|
+
}) {
|
|
114
|
+
if (!template) {
|
|
115
|
+
relinka.error("Template name is required for template creation");
|
|
116
|
+
relinka.log("Usage: dler create <template-name>");
|
|
117
|
+
relinka.log("Example: dler create react-app");
|
|
118
|
+
return process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
const workingDir = cwd || process.cwd();
|
|
122
|
+
const packageManager = await detectPackageManager(workingDir);
|
|
123
|
+
if (!packageManager) {
|
|
124
|
+
relinka.error("Cannot detect package manager. Defaulting to bun create.");
|
|
125
|
+
}
|
|
126
|
+
const pmName = packageManager?.name || "bun";
|
|
127
|
+
let createCommand;
|
|
128
|
+
switch (pmName) {
|
|
129
|
+
case "bun":
|
|
130
|
+
createCommand = ["bun", "create", template];
|
|
131
|
+
break;
|
|
132
|
+
case "pnpm":
|
|
133
|
+
createCommand = ["pnpm", "create", template];
|
|
134
|
+
break;
|
|
135
|
+
case "yarn":
|
|
136
|
+
createCommand = ["yarn", "create", template];
|
|
137
|
+
break;
|
|
138
|
+
case "npm":
|
|
139
|
+
createCommand = ["npm", "create", template];
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
createCommand = ["bun", "create", template];
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
if (destDir !== ".") {
|
|
146
|
+
createCommand.push(destDir);
|
|
147
|
+
}
|
|
148
|
+
relinka.log(`Creating project from template: ${template}`);
|
|
149
|
+
relinka.log(`Using command: ${createCommand.join(" ")}`);
|
|
150
|
+
const result = x(createCommand[0], createCommand.slice(1), {
|
|
151
|
+
nodeOptions: {
|
|
152
|
+
cwd: workingDir,
|
|
153
|
+
stdio: "inherit"
|
|
154
|
+
},
|
|
155
|
+
throwOnError: true
|
|
156
|
+
});
|
|
157
|
+
const output = await result;
|
|
158
|
+
if (output.exitCode === 0) {
|
|
159
|
+
relinka.success(`Successfully created project from template: ${template}`);
|
|
160
|
+
} else {
|
|
161
|
+
relinka.error(`Failed to create project. Exit code: ${output.exitCode}`);
|
|
162
|
+
return process.exit(output.exitCode || 1);
|
|
163
|
+
}
|
|
164
|
+
} catch (error) {
|
|
165
|
+
relinka.error(
|
|
166
|
+
`Failed to create project from template: ${error instanceof Error ? error.message : String(error)}`
|
|
167
|
+
);
|
|
168
|
+
return process.exit(1);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { relinka } from "@reliverse/relinka";
|
|
2
|
+
import { defineCommand } from "@reliverse/rempts";
|
|
3
|
+
export default defineCommand({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "init",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
description: "Initialize a new project"
|
|
8
|
+
},
|
|
9
|
+
async run() {
|
|
10
|
+
relinka.info(
|
|
11
|
+
"Command not implemented yet. For now, please install `@reliverse/rse` and run `rse cli`."
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* USAGE EXAMPLES:
|
|
3
|
+
* - dler install package-name - installs a package
|
|
4
|
+
* - dler install - installs all dependencies
|
|
5
|
+
* - dler dedupe - deduplicates dependencies
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import("@reliverse/rempts").Command<{
|
|
8
|
+
action: {
|
|
9
|
+
type: "string";
|
|
10
|
+
description: string;
|
|
11
|
+
required: false;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
name: {
|
|
15
|
+
type: "positional";
|
|
16
|
+
description: string;
|
|
17
|
+
required: false;
|
|
18
|
+
};
|
|
19
|
+
global: {
|
|
20
|
+
type: "boolean";
|
|
21
|
+
alias: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
"frozen-lockfile": {
|
|
25
|
+
type: "boolean";
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
cwd: {
|
|
29
|
+
type: "string";
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
workspace: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
silent: {
|
|
37
|
+
type: "boolean";
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
recreateLockFile: {
|
|
41
|
+
type: "boolean";
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
linter: {
|
|
45
|
+
type: "boolean";
|
|
46
|
+
description: string;
|
|
47
|
+
default: false;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { relinka } from "@reliverse/relinka";
|
|
2
|
+
import { defineArgs, defineCommand } from "@reliverse/rempts";
|
|
3
|
+
import {
|
|
4
|
+
addDependency,
|
|
5
|
+
dedupeDependencies,
|
|
6
|
+
installDependencies
|
|
7
|
+
} from "../../libs/sdk/sdk-impl/utils/pm/pm-api.js";
|
|
8
|
+
export default defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "install",
|
|
11
|
+
version: "1.1.0",
|
|
12
|
+
description: "Install dependencies or deduplicate existing ones. Usage example: `dler install package-name` or `dler install` or `dler dedupe`"
|
|
13
|
+
},
|
|
14
|
+
args: defineArgs({
|
|
15
|
+
action: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Action to perform: install, add, i, dedupe",
|
|
18
|
+
required: false,
|
|
19
|
+
default: "install"
|
|
20
|
+
},
|
|
21
|
+
name: {
|
|
22
|
+
type: "positional",
|
|
23
|
+
description: "Package name",
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
global: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
alias: "g",
|
|
29
|
+
description: "Add globally"
|
|
30
|
+
},
|
|
31
|
+
"frozen-lockfile": {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
description: "Install dependencies with frozen lock file"
|
|
34
|
+
},
|
|
35
|
+
cwd: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Current working directory"
|
|
38
|
+
},
|
|
39
|
+
workspace: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
description: "Add to workspace"
|
|
42
|
+
},
|
|
43
|
+
silent: {
|
|
44
|
+
type: "boolean",
|
|
45
|
+
description: "Run in silent mode"
|
|
46
|
+
},
|
|
47
|
+
recreateLockFile: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Recreate lock file (for dedupe)"
|
|
50
|
+
},
|
|
51
|
+
linter: {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
description: "Run linter checks after updating dependencies",
|
|
54
|
+
default: false
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
async run({ args }) {
|
|
58
|
+
console.log("DEBUG: install command starting with args:", args);
|
|
59
|
+
const { action, name, linter, ...options } = args;
|
|
60
|
+
switch (action) {
|
|
61
|
+
case "install":
|
|
62
|
+
case "i":
|
|
63
|
+
case "add":
|
|
64
|
+
console.log("DEBUG: install case, name:", name, "options:", options);
|
|
65
|
+
await (name ? addDependency(name, options) : installDependencies(options));
|
|
66
|
+
break;
|
|
67
|
+
case "dedupe": {
|
|
68
|
+
await dedupeDependencies(options);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
default: {
|
|
72
|
+
if (!action || action === "install") {
|
|
73
|
+
console.log("DEBUG: default install case, name:", name, "options:", options);
|
|
74
|
+
await (name ? addDependency(name, options) : installDependencies(options));
|
|
75
|
+
} else {
|
|
76
|
+
relinka.error(`Unknown action: ${action}`);
|
|
77
|
+
relinka.log("Available actions: install, add, i, dedupe");
|
|
78
|
+
return process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* USAGE EXAMPLES:
|
|
3
|
+
* - dler remove package-name - removes a package
|
|
4
|
+
* - dler rm package-name - removes a package (alias)
|
|
5
|
+
* - dler uninstall package-name - removes a package (alias)
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import("@reliverse/rempts").Command<{
|
|
8
|
+
action: {
|
|
9
|
+
type: "string";
|
|
10
|
+
description: string;
|
|
11
|
+
required: false;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
name: {
|
|
15
|
+
type: "positional";
|
|
16
|
+
description: string;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
global: {
|
|
20
|
+
type: "boolean";
|
|
21
|
+
alias: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
cwd: {
|
|
25
|
+
type: "string";
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
workspace: {
|
|
29
|
+
type: "boolean";
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
silent: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
linter: {
|
|
37
|
+
type: "boolean";
|
|
38
|
+
description: string;
|
|
39
|
+
default: false;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { relinka } from "@reliverse/relinka";
|
|
2
|
+
import { defineArgs, defineCommand } from "@reliverse/rempts";
|
|
3
|
+
import { removeDependency } from "../../libs/sdk/sdk-impl/utils/pm/pm-api.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "remove",
|
|
7
|
+
version: "1.1.0",
|
|
8
|
+
description: "Remove dependencies. Usage example: `dler remove package-name`"
|
|
9
|
+
},
|
|
10
|
+
args: defineArgs({
|
|
11
|
+
action: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Action to perform: remove, rm, uninstall, un, delete, del",
|
|
14
|
+
required: false,
|
|
15
|
+
default: "remove"
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
type: "positional",
|
|
19
|
+
description: "Package name",
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
global: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
alias: "g",
|
|
25
|
+
description: "Remove globally"
|
|
26
|
+
},
|
|
27
|
+
cwd: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Current working directory"
|
|
30
|
+
},
|
|
31
|
+
workspace: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
description: "Remove from workspace"
|
|
34
|
+
},
|
|
35
|
+
silent: {
|
|
36
|
+
type: "boolean",
|
|
37
|
+
description: "Run in silent mode"
|
|
38
|
+
},
|
|
39
|
+
linter: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
description: "Run linter checks after removing dependencies",
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
async run({ args }) {
|
|
46
|
+
const { action, name, linter, ...options } = args;
|
|
47
|
+
if (!name) {
|
|
48
|
+
relinka.error("Package name is required for remove action");
|
|
49
|
+
return process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
switch (action) {
|
|
52
|
+
case "remove":
|
|
53
|
+
case "rm":
|
|
54
|
+
case "uninstall":
|
|
55
|
+
case "un":
|
|
56
|
+
case "delete":
|
|
57
|
+
case "del":
|
|
58
|
+
await removeDependency(name, options);
|
|
59
|
+
break;
|
|
60
|
+
default: {
|
|
61
|
+
if (!action || action === "remove") {
|
|
62
|
+
await removeDependency(name, options);
|
|
63
|
+
} else {
|
|
64
|
+
relinka.error(`Unknown action: ${action}`);
|
|
65
|
+
relinka.log("Available actions: remove, rm, uninstall, un, delete, del");
|
|
66
|
+
return process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
package/bin/app/x/cmd.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* USAGE EXAMPLES:
|
|
3
|
-
* - dler x install package-name - installs a package
|
|
4
|
-
* - dler x remove package-name - removes a package
|
|
5
3
|
* - dler x detect - detects the package manager
|
|
6
|
-
* - dler x dedupe - deduplicates dependencies
|
|
7
4
|
* - dler x run script-name - runs a script
|
|
8
5
|
* - dler x exec --target 'bun run build' - executes a command
|
|
6
|
+
* - dler x package-name - runs a package directly (like bunx/npx)
|
|
7
|
+
* - dler x package-name --args arg1 arg2 - runs a package with arguments
|
|
8
|
+
* - dler x package-name --bun - force using bunx even if different PM detected
|
|
9
|
+
* - dler x prettier --npm --yes - force using npx with auto-confirm
|
|
9
10
|
*/
|
|
10
11
|
declare const _default: import("@reliverse/rempts").Command<{
|
|
11
12
|
action: {
|
|
@@ -18,31 +19,14 @@ declare const _default: import("@reliverse/rempts").Command<{
|
|
|
18
19
|
description: string;
|
|
19
20
|
required: false;
|
|
20
21
|
};
|
|
21
|
-
global: {
|
|
22
|
-
type: "boolean";
|
|
23
|
-
alias: string;
|
|
24
|
-
description: string;
|
|
25
|
-
};
|
|
26
|
-
"frozen-lockfile": {
|
|
27
|
-
type: "boolean";
|
|
28
|
-
description: string;
|
|
29
|
-
};
|
|
30
22
|
cwd: {
|
|
31
23
|
type: "string";
|
|
32
24
|
description: string;
|
|
33
25
|
};
|
|
34
|
-
workspace: {
|
|
35
|
-
type: "boolean";
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
38
26
|
silent: {
|
|
39
27
|
type: "boolean";
|
|
40
28
|
description: string;
|
|
41
29
|
};
|
|
42
|
-
recreateLockFile: {
|
|
43
|
-
type: "boolean";
|
|
44
|
-
description: string;
|
|
45
|
-
};
|
|
46
30
|
target: {
|
|
47
31
|
type: "string";
|
|
48
32
|
description: string;
|
|
@@ -56,32 +40,35 @@ declare const _default: import("@reliverse/rempts").Command<{
|
|
|
56
40
|
description: string;
|
|
57
41
|
default: true;
|
|
58
42
|
};
|
|
59
|
-
|
|
43
|
+
args: {
|
|
60
44
|
type: "string";
|
|
61
45
|
description: string;
|
|
62
46
|
};
|
|
63
|
-
|
|
64
|
-
type: "
|
|
47
|
+
global: {
|
|
48
|
+
type: "boolean";
|
|
49
|
+
alias: string;
|
|
65
50
|
description: string;
|
|
66
|
-
default: string;
|
|
67
51
|
};
|
|
68
|
-
|
|
52
|
+
yes: {
|
|
69
53
|
type: "boolean";
|
|
54
|
+
alias: string;
|
|
70
55
|
description: string;
|
|
71
56
|
};
|
|
72
|
-
|
|
57
|
+
bun: {
|
|
73
58
|
type: "boolean";
|
|
74
59
|
description: string;
|
|
75
60
|
};
|
|
76
|
-
|
|
77
|
-
type: "
|
|
61
|
+
npm: {
|
|
62
|
+
type: "boolean";
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
pnpm: {
|
|
66
|
+
type: "boolean";
|
|
78
67
|
description: string;
|
|
79
|
-
default: string;
|
|
80
68
|
};
|
|
81
|
-
|
|
69
|
+
yarn: {
|
|
82
70
|
type: "boolean";
|
|
83
71
|
description: string;
|
|
84
|
-
default: false;
|
|
85
72
|
};
|
|
86
73
|
}>;
|
|
87
74
|
export default _default;
|
package/bin/app/x/cmd.js
CHANGED
|
@@ -1,143 +1,110 @@
|
|
|
1
1
|
import path from "@reliverse/pathkit";
|
|
2
2
|
import { relinka } from "@reliverse/relinka";
|
|
3
|
-
import {
|
|
4
|
-
defineArgs,
|
|
5
|
-
defineCommand,
|
|
6
|
-
multiselectPrompt,
|
|
7
|
-
runCmd,
|
|
8
|
-
selectPrompt
|
|
9
|
-
} from "@reliverse/rempts";
|
|
10
|
-
import { getCheckCmd } from "../cmds.js";
|
|
3
|
+
import { defineArgs, defineCommand } from "@reliverse/rempts";
|
|
11
4
|
import { x } from "../../libs/sdk/sdk-impl/utils/exec/exec-mod.js";
|
|
12
|
-
import {
|
|
13
|
-
import { initFile, initFiles } from "../../libs/sdk/sdk-impl/utils/init/init-impl.js";
|
|
14
|
-
import {
|
|
15
|
-
addDependency,
|
|
16
|
-
dedupeDependencies,
|
|
17
|
-
updateDependencies,
|
|
18
|
-
installDependencies,
|
|
19
|
-
removeDependency,
|
|
20
|
-
runScript
|
|
21
|
-
} from "../../libs/sdk/sdk-impl/utils/pm/pm-api.js";
|
|
5
|
+
import { runScript } from "../../libs/sdk/sdk-impl/utils/pm/pm-api.js";
|
|
22
6
|
import { detectPackageManager } from "../../libs/sdk/sdk-impl/utils/pm/pm-detect.js";
|
|
23
7
|
export default defineCommand({
|
|
24
8
|
meta: {
|
|
25
9
|
name: "x",
|
|
26
10
|
version: "1.1.0",
|
|
27
|
-
description: "
|
|
11
|
+
description: "Utility command executor and package runner. Usage example: `dler x detect` or `dler x package-name` (like bunx/npx)"
|
|
28
12
|
},
|
|
29
13
|
args: defineArgs({
|
|
30
14
|
action: {
|
|
31
15
|
type: "string",
|
|
32
|
-
description: "Action to perform:
|
|
16
|
+
description: "Action to perform: detect, run, exec, or package name to run directly",
|
|
33
17
|
required: true
|
|
34
18
|
},
|
|
35
19
|
name: {
|
|
36
20
|
type: "positional",
|
|
37
|
-
description: "
|
|
21
|
+
description: "Script name (for run action) or additional arguments",
|
|
38
22
|
required: false
|
|
39
23
|
},
|
|
40
|
-
global: {
|
|
41
|
-
type: "boolean",
|
|
42
|
-
alias: "g",
|
|
43
|
-
description: "Add globally"
|
|
44
|
-
},
|
|
45
|
-
"frozen-lockfile": {
|
|
46
|
-
type: "boolean",
|
|
47
|
-
description: "Install dependencies with frozen lock file"
|
|
48
|
-
},
|
|
49
24
|
cwd: {
|
|
50
25
|
type: "string",
|
|
51
26
|
description: "Current working directory"
|
|
52
27
|
},
|
|
53
|
-
workspace: {
|
|
54
|
-
type: "boolean",
|
|
55
|
-
description: "Add to workspace"
|
|
56
|
-
},
|
|
57
28
|
silent: {
|
|
58
29
|
type: "boolean",
|
|
59
30
|
description: "Run in silent mode"
|
|
60
31
|
},
|
|
61
|
-
recreateLockFile: {
|
|
62
|
-
type: "boolean",
|
|
63
|
-
description: "Recreate lock file (for dedupe)"
|
|
64
|
-
},
|
|
65
32
|
target: {
|
|
66
33
|
type: "string",
|
|
67
34
|
description: "Command to execute (for exec action)"
|
|
68
35
|
},
|
|
69
36
|
timeout: {
|
|
70
37
|
type: "number",
|
|
71
|
-
description: "Timeout in milliseconds
|
|
38
|
+
description: "Timeout in milliseconds"
|
|
72
39
|
},
|
|
73
40
|
throwOnError: {
|
|
74
41
|
type: "boolean",
|
|
75
42
|
description: "Throw error if command fails",
|
|
76
43
|
default: true
|
|
77
44
|
},
|
|
78
|
-
|
|
45
|
+
args: {
|
|
79
46
|
type: "string",
|
|
80
|
-
description: "
|
|
47
|
+
description: "Additional arguments to pass to the package (space-separated)"
|
|
81
48
|
},
|
|
82
|
-
|
|
83
|
-
type: "
|
|
84
|
-
|
|
85
|
-
|
|
49
|
+
global: {
|
|
50
|
+
type: "boolean",
|
|
51
|
+
alias: "g",
|
|
52
|
+
description: "Use global package manager execution"
|
|
86
53
|
},
|
|
87
|
-
|
|
54
|
+
yes: {
|
|
88
55
|
type: "boolean",
|
|
89
|
-
|
|
56
|
+
alias: "y",
|
|
57
|
+
description: "Automatically confirm package installation if needed"
|
|
90
58
|
},
|
|
91
|
-
|
|
59
|
+
bun: {
|
|
92
60
|
type: "boolean",
|
|
93
|
-
description: "
|
|
61
|
+
description: "Force using bunx (overrides package manager detection)"
|
|
94
62
|
},
|
|
95
|
-
|
|
96
|
-
type: "
|
|
97
|
-
description: "
|
|
98
|
-
|
|
63
|
+
npm: {
|
|
64
|
+
type: "boolean",
|
|
65
|
+
description: "Force using npx (overrides package manager detection)"
|
|
66
|
+
},
|
|
67
|
+
pnpm: {
|
|
68
|
+
type: "boolean",
|
|
69
|
+
description: "Force using pnpx (overrides package manager detection)"
|
|
99
70
|
},
|
|
100
|
-
|
|
71
|
+
yarn: {
|
|
101
72
|
type: "boolean",
|
|
102
|
-
description: "
|
|
103
|
-
default: false
|
|
73
|
+
description: "Force using yarn dlx (overrides package manager detection)"
|
|
104
74
|
}
|
|
105
75
|
}),
|
|
106
76
|
async run({ args }) {
|
|
107
|
-
console.log("DEBUG: x command starting with args:", args);
|
|
108
77
|
const {
|
|
109
78
|
action,
|
|
110
79
|
name,
|
|
111
80
|
target,
|
|
112
81
|
timeout,
|
|
113
82
|
throwOnError,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
83
|
+
args: packageArgs,
|
|
84
|
+
global,
|
|
85
|
+
yes,
|
|
86
|
+
bun,
|
|
87
|
+
npm,
|
|
88
|
+
pnpm,
|
|
89
|
+
yarn,
|
|
120
90
|
...options
|
|
121
91
|
} = args;
|
|
92
|
+
const builtInActions = ["detect", "run", "exec"];
|
|
93
|
+
const isBuiltInAction = builtInActions.includes(action);
|
|
94
|
+
if (!isBuiltInAction) {
|
|
95
|
+
await runPackage({
|
|
96
|
+
packageName: action,
|
|
97
|
+
packageArgs: name ? [name, ...packageArgs?.split(/\s+/) || []] : packageArgs?.split(/\s+/) || [],
|
|
98
|
+
cwd: options.cwd,
|
|
99
|
+
timeout,
|
|
100
|
+
throwOnError,
|
|
101
|
+
global,
|
|
102
|
+
yes,
|
|
103
|
+
forcePm: { bun, npm, pnpm, yarn }
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
122
107
|
switch (action) {
|
|
123
|
-
case "install":
|
|
124
|
-
case "i":
|
|
125
|
-
case "add":
|
|
126
|
-
console.log("DEBUG: install case, name:", name, "options:", options);
|
|
127
|
-
await (name ? addDependency(name, options) : installDependencies(options));
|
|
128
|
-
break;
|
|
129
|
-
case "remove":
|
|
130
|
-
case "rm":
|
|
131
|
-
case "uninstall":
|
|
132
|
-
case "un":
|
|
133
|
-
case "delete":
|
|
134
|
-
case "del":
|
|
135
|
-
if (!name) {
|
|
136
|
-
relinka.error("Package name is required for remove action");
|
|
137
|
-
return process.exit(1);
|
|
138
|
-
}
|
|
139
|
-
await removeDependency(name, options);
|
|
140
|
-
break;
|
|
141
108
|
case "detect": {
|
|
142
109
|
const cwd = path.resolve(options.cwd || ".");
|
|
143
110
|
const packageManager = await detectPackageManager(cwd);
|
|
@@ -155,10 +122,6 @@ export default defineCommand({
|
|
|
155
122
|
);
|
|
156
123
|
break;
|
|
157
124
|
}
|
|
158
|
-
case "dedupe": {
|
|
159
|
-
await dedupeDependencies(options);
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
125
|
case "run": {
|
|
163
126
|
if (!name) {
|
|
164
127
|
relinka.error("Script name is required for run action");
|
|
@@ -207,62 +170,95 @@ export default defineCommand({
|
|
|
207
170
|
}
|
|
208
171
|
break;
|
|
209
172
|
}
|
|
210
|
-
case "init": {
|
|
211
|
-
const concurrencyNum = Number(concurrency);
|
|
212
|
-
if (fileType && !FILE_TYPES.find((ft) => ft.type === fileType)) {
|
|
213
|
-
throw new Error(`Invalid file type: ${fileType}`);
|
|
214
|
-
}
|
|
215
|
-
const effectiveFileType = fileType;
|
|
216
|
-
if (multiple) {
|
|
217
|
-
const possibleTypes = FILE_TYPES.map((ft) => ft.type);
|
|
218
|
-
const chosen = await multiselectPrompt({
|
|
219
|
-
title: "Select file types to initialize",
|
|
220
|
-
options: possibleTypes.map((pt) => ({ label: pt, value: pt }))
|
|
221
|
-
});
|
|
222
|
-
if (chosen.length === 0) {
|
|
223
|
-
relinka("log", "No file types selected. Exiting...");
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const requests = chosen.map((ct) => ({
|
|
227
|
-
fileType: ct,
|
|
228
|
-
destDir
|
|
229
|
-
}));
|
|
230
|
-
const results = await initFiles(requests, {
|
|
231
|
-
parallel,
|
|
232
|
-
concurrency: concurrencyNum
|
|
233
|
-
});
|
|
234
|
-
relinka("verbose", `Multiple files result: ${JSON.stringify(results)}`);
|
|
235
|
-
} else {
|
|
236
|
-
let finalFileType = effectiveFileType;
|
|
237
|
-
if (!finalFileType) {
|
|
238
|
-
const possibleTypes = FILE_TYPES.map((ft) => ft.type);
|
|
239
|
-
const picked = await selectPrompt({
|
|
240
|
-
title: "Pick a file type to initialize",
|
|
241
|
-
options: possibleTypes.map((pt) => ({ label: pt, value: pt }))
|
|
242
|
-
});
|
|
243
|
-
finalFileType = picked;
|
|
244
|
-
}
|
|
245
|
-
const result = await initFile({
|
|
246
|
-
fileType: finalFileType,
|
|
247
|
-
destDir
|
|
248
|
-
});
|
|
249
|
-
relinka("verbose", `Single file result: ${JSON.stringify(result)}`);
|
|
250
|
-
}
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
case "latest": {
|
|
254
|
-
await updateDependencies(true, options);
|
|
255
|
-
if (linter) {
|
|
256
|
-
const checkCmd = await getCheckCmd();
|
|
257
|
-
await runCmd(checkCmd, ["--no-exit", "--no-progress"]);
|
|
258
|
-
}
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
173
|
default: {
|
|
262
174
|
relinka.error(`Unknown action: ${action}`);
|
|
263
|
-
relinka.log("Available actions:
|
|
175
|
+
relinka.log("Available actions: detect, run, exec, or package name to run directly");
|
|
264
176
|
return process.exit(1);
|
|
265
177
|
}
|
|
266
178
|
}
|
|
267
179
|
}
|
|
268
180
|
});
|
|
181
|
+
async function runPackage({
|
|
182
|
+
packageName,
|
|
183
|
+
packageArgs,
|
|
184
|
+
cwd,
|
|
185
|
+
timeout,
|
|
186
|
+
throwOnError,
|
|
187
|
+
global,
|
|
188
|
+
yes,
|
|
189
|
+
forcePm
|
|
190
|
+
}) {
|
|
191
|
+
try {
|
|
192
|
+
const workingDir = cwd ? path.resolve(cwd) : process.cwd();
|
|
193
|
+
let pmName;
|
|
194
|
+
const forcedPmFlags = Object.entries(forcePm).filter(([_, isForced]) => isForced);
|
|
195
|
+
if (forcedPmFlags.length > 1) {
|
|
196
|
+
relinka.error(
|
|
197
|
+
"Multiple package manager flags specified. Use only one: --bun, --npm, --pnpm, or --yarn"
|
|
198
|
+
);
|
|
199
|
+
return process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
if (forcedPmFlags.length === 1) {
|
|
202
|
+
pmName = forcedPmFlags[0][0];
|
|
203
|
+
relinka.log(`Forcing package manager: ${pmName}`);
|
|
204
|
+
} else {
|
|
205
|
+
const packageManager = await detectPackageManager(workingDir);
|
|
206
|
+
if (!packageManager) {
|
|
207
|
+
relinka.warn("Cannot detect package manager. Defaulting to npm.");
|
|
208
|
+
pmName = "npm";
|
|
209
|
+
} else {
|
|
210
|
+
pmName = packageManager.name;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
let runCommand;
|
|
214
|
+
switch (pmName) {
|
|
215
|
+
case "bun":
|
|
216
|
+
runCommand = ["bunx"];
|
|
217
|
+
break;
|
|
218
|
+
case "pnpm":
|
|
219
|
+
runCommand = ["pnpx", "dlx"];
|
|
220
|
+
break;
|
|
221
|
+
case "yarn":
|
|
222
|
+
runCommand = ["yarn", "dlx"];
|
|
223
|
+
break;
|
|
224
|
+
case "npm":
|
|
225
|
+
runCommand = ["npx"];
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
runCommand = ["npx"];
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
if (global && pmName !== "yarn") {
|
|
232
|
+
runCommand.push("--global");
|
|
233
|
+
}
|
|
234
|
+
if (yes && (pmName === "npm" || pmName === "pnpm")) {
|
|
235
|
+
runCommand.push("--yes");
|
|
236
|
+
}
|
|
237
|
+
runCommand.push(packageName);
|
|
238
|
+
runCommand.push(...packageArgs);
|
|
239
|
+
relinka.log(`Running package: ${packageName}`);
|
|
240
|
+
relinka.log(`Using command: ${runCommand.join(" ")}`);
|
|
241
|
+
const result = x(runCommand[0], runCommand.slice(1), {
|
|
242
|
+
nodeOptions: {
|
|
243
|
+
cwd: workingDir,
|
|
244
|
+
stdio: "inherit"
|
|
245
|
+
},
|
|
246
|
+
timeout,
|
|
247
|
+
throwOnError
|
|
248
|
+
});
|
|
249
|
+
const output = await result;
|
|
250
|
+
if (output.exitCode === 0) {
|
|
251
|
+
relinka.success(`Successfully ran package: ${packageName}`);
|
|
252
|
+
} else {
|
|
253
|
+
relinka.warn(`Package exited with code: ${output.exitCode}`);
|
|
254
|
+
if (throwOnError) {
|
|
255
|
+
return process.exit(output.exitCode || 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
} catch (error) {
|
|
259
|
+
relinka.error(
|
|
260
|
+
`Failed to run package: ${error instanceof Error ? error.message : String(error)}`
|
|
261
|
+
);
|
|
262
|
+
return process.exit(1);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { RseConfig } from "./rse-types";
|
|
2
2
|
export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
3
|
+
version?: string | undefined;
|
|
3
4
|
$schema?: "./schema.json" | "https://reliverse.org/schema.json" | undefined;
|
|
4
5
|
projectName?: string | undefined;
|
|
5
6
|
projectAuthor?: string | undefined;
|
|
6
7
|
projectDescription?: string | undefined;
|
|
7
|
-
version?: string | undefined;
|
|
8
8
|
projectLicense?: string | undefined;
|
|
9
9
|
projectRepository?: string | undefined;
|
|
10
10
|
projectDomain?: string | undefined;
|
|
11
11
|
projectGitService?: "none" | "github" | "gitlab" | "bitbucket" | undefined;
|
|
12
12
|
projectDeployService?: "none" | "vercel" | "netlify" | "railway" | "deno" | undefined;
|
|
13
|
-
projectPackageManager?: "
|
|
13
|
+
projectPackageManager?: "npm" | "bun" | "pnpm" | "yarn" | undefined;
|
|
14
14
|
projectState?: "creating" | "created" | undefined;
|
|
15
|
-
projectCategory?: "
|
|
15
|
+
projectCategory?: "browser" | "cli" | "unknown" | "website" | "vscode" | "library" | "mobile" | undefined;
|
|
16
16
|
projectSubcategory?: "unknown" | "e-commerce" | "tool" | undefined;
|
|
17
|
-
projectFramework?: "
|
|
17
|
+
projectFramework?: "vue" | "unknown" | "vscode" | "nextjs" | "vite" | "svelte" | "remix" | "astro" | "nuxt" | "solid" | "qwik" | "wxt" | "lynx" | "react-native" | "expo" | "capacitor" | "ionic" | "electron" | "tauri" | "neutralino" | "rempts" | "citty" | "commander" | "cac" | "meow" | "yargs" | "webextension" | "browser-extension" | "npm-jsr" | undefined;
|
|
18
18
|
projectTemplate?: "unknown" | "blefnk/relivator-nextjs-template" | "blefnk/relivator-docker-template" | "blefnk/next-react-ts-src-minimal" | "blefnk/all-in-one-nextjs-template" | "blefnk/create-t3-app" | "blefnk/create-next-app" | "blefnk/astro-starlight-template" | "blefnk/versator-nextjs-template" | "blefnk/relivator-lynxjs-template" | "blefnk/relivator-react-native-template" | "reliverse/template-browser-extension" | "microsoft/vscode-extension-samples" | "microsoft/vscode-extension-template" | "rsetarter-template" | "blefnk/deno-cli-tutorial" | undefined;
|
|
19
19
|
projectTemplateDate?: string | undefined;
|
|
20
20
|
features?: {
|
|
@@ -37,15 +37,15 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
37
37
|
analytics?: "unknown" | "vercel" | undefined;
|
|
38
38
|
authentication?: "unknown" | "better-auth" | "clerk" | "next-auth" | "supabase-auth" | "auth0" | undefined;
|
|
39
39
|
api?: "unknown" | "hono" | "trpc" | "graphql" | "rest" | undefined;
|
|
40
|
-
testing?: "
|
|
40
|
+
testing?: "bun" | "unknown" | "vitest" | "jest" | "playwright" | "cypress" | undefined;
|
|
41
41
|
stateManagement?: "unknown" | "zustand" | "jotai" | "redux-toolkit" | undefined;
|
|
42
42
|
formManagement?: "unknown" | "react-hook-form" | "formik" | undefined;
|
|
43
|
-
styling?: "unknown" | "tailwind" | "styled-components" | "css-modules" |
|
|
43
|
+
styling?: "sass" | "unknown" | "tailwind" | "styled-components" | "css-modules" | undefined;
|
|
44
44
|
uiComponents?: "unknown" | "shadcn-ui" | "chakra-ui" | "material-ui" | undefined;
|
|
45
45
|
databaseLibrary?: "unknown" | "drizzle" | "prisma" | "supabase" | undefined;
|
|
46
46
|
databaseProvider?: "unknown" | "pg" | "mysql" | "sqlite" | "mongodb" | undefined;
|
|
47
|
-
linting?: "
|
|
48
|
-
formatting?: "
|
|
47
|
+
linting?: "eslint" | "unknown" | undefined;
|
|
48
|
+
formatting?: "biome" | "unknown" | undefined;
|
|
49
49
|
payment?: "unknown" | "stripe" | undefined;
|
|
50
50
|
monitoring?: "unknown" | "sentry" | undefined;
|
|
51
51
|
logging?: "unknown" | "axiom" | undefined;
|
|
@@ -83,7 +83,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
83
83
|
dontRemoveComments?: boolean | undefined;
|
|
84
84
|
shouldAddComments?: boolean | undefined;
|
|
85
85
|
typeOrInterface?: "type" | "interface" | "mixed" | undefined;
|
|
86
|
-
importOrRequire?: "
|
|
86
|
+
importOrRequire?: "import" | "require" | "mixed" | undefined;
|
|
87
87
|
cjsToEsm?: boolean | undefined;
|
|
88
88
|
modernize?: {
|
|
89
89
|
replaceFs?: boolean | undefined;
|
|
@@ -96,7 +96,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
96
96
|
importSymbol?: string | undefined;
|
|
97
97
|
} | undefined;
|
|
98
98
|
monorepo?: {
|
|
99
|
-
type?: "none" | "
|
|
99
|
+
type?: "none" | "bun" | "pnpm" | "turborepo" | "nx" | undefined;
|
|
100
100
|
packages?: string[] | undefined;
|
|
101
101
|
sharedPackages?: string[] | undefined;
|
|
102
102
|
} | undefined;
|
|
@@ -113,7 +113,7 @@ export declare const defineConfigRse: (userConfig?: Partial<RseConfig>) => {
|
|
|
113
113
|
repoBranch?: string | undefined;
|
|
114
114
|
repoPrivacy?: "unknown" | "public" | "private" | undefined;
|
|
115
115
|
projectArchitecture?: "unknown" | "fullstack" | "separated" | undefined;
|
|
116
|
-
projectRuntime?: "
|
|
116
|
+
projectRuntime?: "node" | "bun" | "deno" | undefined;
|
|
117
117
|
skipPromptsUseAutoBehavior?: boolean | undefined;
|
|
118
118
|
deployBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|
|
119
119
|
depsBehavior?: "prompt" | "autoYes" | "autoNo" | undefined;
|