@elinzy/cli 0.1.5 → 0.1.7
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/commands/eslint/index.mjs +251 -0
- package/dist/commands/eslint/register.mjs +13 -0
- package/dist/constants/common.mjs +13 -1
- package/dist/constants/index.mjs +2 -2
- package/dist/helpers/createEslintConfigFile/index.mjs +42 -23
- package/dist/helpers/getArgs/index.mjs +67 -0
- package/dist/helpers/getCommands/index.mjs +10 -5
- package/dist/helpers/getConfigUrl/index.mjs +8 -3
- package/dist/helpers/getPackageManager.mjs +17 -0
- package/dist/helpers/installPackages/index.mjs +1 -1
- package/dist/index.mjs +2 -10
- package/dist/package.mjs +1 -1
- package/dist/utils/index.mjs +4 -0
- package/dist/utils/paths.mjs +7 -0
- package/package.json +5 -9
- package/dist/_virtual/_rolldown/runtime.cjs +0 -28
- package/dist/commands/eslint.cjs +0 -259
- package/dist/commands/eslint.mjs +0 -254
- package/dist/constants/common.cjs +0 -54
- package/dist/constants/index.cjs +0 -11
- package/dist/helpers/createEslintConfigFile/index.cjs +0 -39
- package/dist/helpers/getCommands/index.cjs +0 -21
- package/dist/helpers/getConfigUrl/index.cjs +0 -26
- package/dist/helpers/installPackages/index.cjs +0 -29
- package/dist/index.cjs +0 -19
- package/dist/index.d.cts +0 -1
- package/dist/package.cjs +0 -17
- package/dist/utils/functions.cjs +0 -33
package/dist/index.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const require_functions = require("./utils/functions.cjs");
|
|
3
|
-
const require_package = require("./package.cjs");
|
|
4
|
-
const require_eslint = require("./commands/eslint.cjs");
|
|
5
|
-
let commander = require("commander");
|
|
6
|
-
|
|
7
|
-
//#region src/index.ts
|
|
8
|
-
const program = new commander.Command().name(require_package.name).version(require_package.version, "-v, --version", "Output the current version.").helpOption("-h, --help", "Display help message.");
|
|
9
|
-
program.command("eslint").description("Interactive ESLint config scaffold").action(async () => {
|
|
10
|
-
try {
|
|
11
|
-
await require_eslint.default();
|
|
12
|
-
} catch (error) {
|
|
13
|
-
if (error instanceof Error) require_functions.exit(error);
|
|
14
|
-
else console.error(error);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
program.parse();
|
|
18
|
-
|
|
19
|
-
//#endregion
|
package/dist/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/dist/package.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region package.json
|
|
2
|
-
var name = "@elinzy/cli";
|
|
3
|
-
var version = "0.1.5";
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
Object.defineProperty(exports, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return name;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "version", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return version;
|
|
16
|
-
}
|
|
17
|
-
});
|
package/dist/utils/functions.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
let ansis = require("ansis");
|
|
3
|
-
ansis = require_runtime.__toESM(ansis, 1);
|
|
4
|
-
|
|
5
|
-
//#region src/utils/functions.ts
|
|
6
|
-
const handleSigTerm = () => process.exit(0);
|
|
7
|
-
const onPromptState = (state) => {
|
|
8
|
-
if (state.aborted) {
|
|
9
|
-
process.stdout.write("\x1B[?25h");
|
|
10
|
-
process.stdout.write("\n");
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const onCancel = () => {
|
|
15
|
-
console.error("Exiting, bye bye.");
|
|
16
|
-
process.exit(1);
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Run Function Catch Block
|
|
20
|
-
* @see https://github.com/vercel/next.js/blob/canary/packages/create-next-app/index.ts#L499
|
|
21
|
-
*/
|
|
22
|
-
const exit = (error) => {
|
|
23
|
-
console.log("Aborting installation.");
|
|
24
|
-
if (error.cause === "package-failed") console.log(`${ansis.default.red(error.message)} has failed.`);
|
|
25
|
-
else console.log(`${ansis.default.red("Unexpected error. Please report it as a bug:")}\n`, error);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.exit = exit;
|
|
31
|
-
exports.handleSigTerm = handleSigTerm;
|
|
32
|
-
exports.onCancel = onCancel;
|
|
33
|
-
exports.onPromptState = onPromptState;
|