Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Jan 28, 2024
1 parent d8c4a39 commit a954bd2
Show file tree
Hide file tree
Showing 7 changed files with 315 additions and 390 deletions.
11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

7 changes: 1 addition & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.tabCompletion": "on",
"diffEditor.codeLens": true,
"testing.automaticallyOpenPeekView": "never"
"eslint.experimental.useFlatConfig": true
}
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { so1ve } = require("@so1ve/eslint-config");

module.exports = so1ve(
{},
{
files: ["examples/**"],
rules: {
"no-console": "off",
},
},
);
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
},
"devDependencies": {
"@antfu/ni": "^0.21.8",
"@so1ve/eslint-config": "^0.123.0",
"@so1ve/prettier-config": "^0.123.0",
"@so1ve/eslint-config": "^1.1.0",
"@so1ve/prettier-config": "^1.1.0",
"@types/node": "^18.17.18",
"bumpp": "^9.2.0",
"clerc": "workspace:*",
"eslint": "^8.49.0",
"eslint": "^8.56.0",
"pkgroll": "^1.11.0",
"prettier": "^3.0.3",
"prettier": "^3.2.4",
"rimraf": "^3.0.2",
"typescript": "^5.2.2",
"vite": "^4.4.9",
Expand Down
52 changes: 26 additions & 26 deletions packages/core/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { format } from "node:util";

import type { MaybeArray } from "@clerc/utils";
import { toArray } from "@clerc/utils";
import defu from "defu";
import { defu } from "defu";
import { LiteEmit } from "lite-emit";
import type { LiteralUnion } from "type-fest";
import { typeFlag } from "type-flag";
Expand Down Expand Up @@ -72,7 +72,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
#defaultLocale = "en";
#locale = "en";
#locales: Locales = Object.create(null);
get i18n(): I18N {
public get i18n(): I18N {
return {
add: (locales) => {
this.#locales = defu(this.#locales, locales);
Expand Down Expand Up @@ -111,31 +111,31 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
return Object.prototype.hasOwnProperty.call(this._commands, Root);
}

get _name() {
public get _name() {
return this.#name || this.#scriptName;
}

get _scriptName() {
public get _scriptName() {
return this.#scriptName;
}

get _description() {
public get _description() {
return this.#description;
}

get _version() {
public get _version() {
return this.#version;
}

get _inspectors() {
public get _inspectors() {
return this.#inspectors;
}

get _commands() {
public get _commands() {
return this.#commands;
}

get _flags() {
public get _flags() {
return this.#flags;
}

Expand All @@ -161,7 +161,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param version
* @returns
*/
static create(name?: string, description?: string, version?: string) {
public static create(name?: string, description?: string, version?: string) {
return new Clerc(name, description, version);
}

Expand All @@ -177,7 +177,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param name
* @returns
*/
name(name: string) {
public name(name: string) {
this.#otherMethodCalled();
this.#name = name;

Expand All @@ -196,7 +196,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param scriptName
* @returns
*/
scriptName(scriptName: string) {
public scriptName(scriptName: string) {
this.#otherMethodCalled();
this.#scriptName = scriptName;

Expand All @@ -215,7 +215,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param description
* @returns
*/
description(description: string) {
public description(description: string) {
this.#otherMethodCalled();
this.#description = description;

Expand All @@ -234,7 +234,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param version
* @returns
*/
version(version: string) {
public version(version: string) {
this.#otherMethodCalled();
this.#version = version;

Expand All @@ -256,7 +256,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param locale
* @returns
*/
locale(locale: string) {
public locale(locale: string) {
if (this.#isOtherMethodCalled) {
throw new LocaleNotCalledFirstError(this.i18n.t);
}
Expand All @@ -280,7 +280,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param fallbackLocale
* @returns
*/
fallbackLocale(fallbackLocale: string) {
public fallbackLocale(fallbackLocale: string) {
if (this.#isOtherMethodCalled) {
throw new LocaleNotCalledFirstError(this.i18n.t);
}
Expand All @@ -303,7 +303,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param handler
* @returns
*/
errorHandler(handler: (err: any) => void) {
public errorHandler(handler: (err: any) => void) {
this.#errorHandlers.push(handler);

return this;
Expand Down Expand Up @@ -344,7 +344,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param options
* @returns
*/
command<
public command<
N extends string | RootType,
O extends CommandOptions<[...P], A, F>,
P extends string[] = string[],
Expand All @@ -353,7 +353,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
>(
c: CommandWithHandler<N, O & CommandOptions<[...P], A, F>>,
): this & Clerc<C & Record<N, Command<N, O>>, GF>;
command<
public command<
N extends string | RootType,
O extends CommandOptions<[...P], A, F>,
P extends string[] = string[],
Expand All @@ -364,7 +364,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
description: string,
options?: O & CommandOptions<[...P], A, F>,
): this & Clerc<C & Record<N, Command<N, O>>, GF>;
command(nameOrCommand: any, description?: any, options: any = {}) {
public command(nameOrCommand: any, description?: any, options: any = {}) {
this.#callWithErrorHandling(() =>
this.#command(nameOrCommand, description, options),
);
Expand Down Expand Up @@ -429,7 +429,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param options
* @returns
*/
flag<N extends string, O extends GlobalFlagOption>(
public flag<N extends string, O extends GlobalFlagOption>(
name: N,
description: string,
options: O,
Expand Down Expand Up @@ -459,7 +459,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param handler
* @returns
*/
on<
public on<
K extends LiteralUnion<keyof CM, string | RootType>,
CM extends this["_commands"] = this["_commands"],
>(name: K, handler: Handler<CM, K, this["_flags"]>) {
Expand All @@ -480,7 +480,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param plugin
* @returns
*/
use<T extends Clerc, U extends Clerc>(
public use<T extends Clerc, U extends Clerc>(
plugin: Plugin<T, U>,
): this & Clerc<C & U["_commands"]> & U {
this.#otherMethodCalled();
Expand All @@ -503,7 +503,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param inspector
* @returns
*/
inspector(inspector: Inspector) {
public inspector(inspector: Inspector) {
this.#otherMethodCalled();
this.#inspectors.push(inspector);

Expand All @@ -523,7 +523,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
* @param optionsOrArgv
* @returns
*/
parse(optionsOrArgv: string[] | ParseOptions = resolveArgv()) {
public parse(optionsOrArgv: string[] | ParseOptions = resolveArgv()) {
this.#otherMethodCalled();
const { argv, run }: ParseOptions = Array.isArray(optionsOrArgv)
? {
Expand Down Expand Up @@ -683,7 +683,7 @@ export class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
*
* @returns
*/
runMatchedCommand() {
public runMatchedCommand() {
this.#callWithErrorHandling(() => this.#runMatchedCommand());
process.title = this.#name;

Expand Down
Loading

0 comments on commit a954bd2

Please sign in to comment.