rattail 2.0.9 → 2.1.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/dist/{api-BZphli-u.mjs → api-BAhe-2Qc.mjs} +2 -2
- package/dist/{changelog-CbLZqT8o.mjs → changelog-giizMwKa.mjs} +2 -2
- package/dist/{clean-ChrJ3VXV.mjs → clean-D_MS0eEx.mjs} +3 -3
- package/dist/cli/bin.d.mts +1 -1
- package/dist/cli/bin.mjs +10 -10
- package/dist/cli/index.d.mts +1 -2
- package/dist/cli/index.mjs +8 -8
- package/dist/{commitLint-eVcRXbbH.mjs → commitLint-CGrVknHB.mjs} +1 -1
- package/dist/{config-DSUWeyjT.d.mts → config-B21-n_bR.d.mts} +0 -1
- package/dist/{config-CpH0B9DB.mjs → config-DyjJBx_r.mjs} +2 -2
- package/dist/{hook-e3tLJA2D.mjs → hook-BsFKhwBl.mjs} +2 -2
- package/dist/index.d.mts +10 -24
- package/dist/index.mjs +2 -2
- package/dist/{lockfileCheck-DKW6MKdC.mjs → lockfileCheck-DR-KZIyO.mjs} +1 -1
- package/dist/{publish-C86CKyEw.mjs → publish-tTIXb5nn.mjs} +2 -2
- package/dist/{release-CtpGDUcn.mjs → release-DcENhCIa.mjs} +2 -2
- package/dist/vite-plus/index.d.mts +54 -11
- package/dist/vite-plus/index.mjs +385 -1
- package/package.json +15 -10
- package/dist/rolldown-runtime-Dfn8tqD8.mjs +0 -27
- /package/dist/{callOrReturn-MpTzoGlG.mjs → callOrReturn-CZqsjrou.mjs} +0 -0
- /package/dist/{isString-eoLxw4CX.mjs → isString-Ci3uKJYg.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as getConfig } from "./config-DyjJBx_r.mjs";
|
|
2
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
3
3
|
import { generate } from "api-farmer";
|
|
4
4
|
//#region src/cli/api.ts
|
|
5
5
|
var api_exports = /* @__PURE__ */ __exportAll({ api: () => api });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as getConfig } from "./config-DyjJBx_r.mjs";
|
|
2
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
3
3
|
import { changelog } from "@varlet/release";
|
|
4
4
|
//#region src/cli/changelog.ts
|
|
5
5
|
var changelog_exports = /* @__PURE__ */ __exportAll({ changelog: () => changelog$1 });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
1
|
+
import { n as isArray, t as isString } from "./isString-Ci3uKJYg.mjs";
|
|
2
|
+
import { n as getConfig } from "./config-DyjJBx_r.mjs";
|
|
3
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
4
4
|
import { rimraf } from "rimraf";
|
|
5
5
|
//#region src/cli/clean.ts
|
|
6
6
|
var clean_exports = /* @__PURE__ */ __exportAll({ clean: () => clean });
|
package/dist/cli/bin.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/cli/bin.mjs
CHANGED
|
@@ -12,20 +12,20 @@ function getCliVersion() {
|
|
|
12
12
|
const program = new Command();
|
|
13
13
|
program.version(getCliVersion());
|
|
14
14
|
program.command("clean").description("Remove files and directories").argument("[patterns...]").action(async (patterns) => {
|
|
15
|
-
const { clean } = await import("../clean-
|
|
15
|
+
const { clean } = await import("../clean-D_MS0eEx.mjs").then((n) => n.n);
|
|
16
16
|
return clean(patterns.length ? patterns : void 0);
|
|
17
17
|
});
|
|
18
18
|
program.command("api").description("Generate API modules from OpenAPI/Swagger schema").action(async () => {
|
|
19
|
-
const { api } = await import("../api-
|
|
19
|
+
const { api } = await import("../api-BAhe-2Qc.mjs").then((n) => n.n);
|
|
20
20
|
return api();
|
|
21
21
|
});
|
|
22
22
|
program.command("hook").description("Install git hooks from config").action(async () => {
|
|
23
|
-
const { hook } = await import("../hook-
|
|
23
|
+
const { hook } = await import("../hook-BsFKhwBl.mjs").then((n) => n.r);
|
|
24
24
|
return hook();
|
|
25
25
|
});
|
|
26
26
|
program.command("release").description("Release all packages and generate changelogs").option("-t, --npmTag <tag>", "npm dist-tag (e.g. beta, next)").option("-r, --remote <remote>", "Git remote name for pushing").option("--skip-npm-publish", "Skip npm publish").option("--skip-changelog", "Skip changelog generation").option("--skip-git-tag", "Skip git tag").option("-c, --check-remote-version", "Skip publish if the current version already exists on npm").action(async (options) => {
|
|
27
|
-
const { getConfig } = await import("../config-
|
|
28
|
-
const { release } = await import("../release-
|
|
27
|
+
const { getConfig } = await import("../config-DyjJBx_r.mjs").then((n) => n.t);
|
|
28
|
+
const { release } = await import("../release-DcENhCIa.mjs").then((n) => n.n);
|
|
29
29
|
return release({
|
|
30
30
|
...(await getConfig()).release ?? {},
|
|
31
31
|
...options.npmTag != null ? { npmTag: options.npmTag } : {},
|
|
@@ -37,8 +37,8 @@ program.command("release").description("Release all packages and generate change
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
program.command("publish").description("Publish workspace packages to npm (pnpm recursive publish)").option("-c, --checkRemoteVersion", "Skip publish if the current version already exists on npm").option("-t, --npmTag <tag>", "npm dist-tag (e.g. beta, next); ignored when --pre-release is set").option("--pre-release", "Publish with alpha dist-tag").action(async (options) => {
|
|
40
|
-
const { getConfig } = await import("../config-
|
|
41
|
-
const { publish } = await import("../publish-
|
|
40
|
+
const { getConfig } = await import("../config-DyjJBx_r.mjs").then((n) => n.t);
|
|
41
|
+
const { publish } = await import("../publish-tTIXb5nn.mjs").then((n) => n.n);
|
|
42
42
|
return publish({
|
|
43
43
|
...(await getConfig()).publish ?? {},
|
|
44
44
|
...options.checkRemoteVersion ? { checkRemoteVersion: true } : {},
|
|
@@ -47,15 +47,15 @@ program.command("publish").description("Publish workspace packages to npm (pnpm
|
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
program.command("changelog").description("Generate changelog").action(async () => {
|
|
50
|
-
const { changelog } = await import("../changelog-
|
|
50
|
+
const { changelog } = await import("../changelog-giizMwKa.mjs").then((n) => n.n);
|
|
51
51
|
return changelog();
|
|
52
52
|
});
|
|
53
53
|
program.command("commit-lint").description("Lint commit message").argument("<commitMessagePath>", "Git commit message path").action(async (commitMessagePath) => {
|
|
54
|
-
const { commitLint } = await import("../commitLint-
|
|
54
|
+
const { commitLint } = await import("../commitLint-CGrVknHB.mjs").then((n) => n.n);
|
|
55
55
|
return commitLint({ commitMessagePath });
|
|
56
56
|
});
|
|
57
57
|
program.command("lockfile-check").description("Check if lockfile has been updated and auto-install dependencies").option("-m, --packageManager <manager>", "Package manager (npm, yarn, pnpm)").option("-s, --skipInstall", "Skip install dependencies when lockfile changed").action(async (options) => {
|
|
58
|
-
const { lockfileCheck } = await import("../lockfileCheck-
|
|
58
|
+
const { lockfileCheck } = await import("../lockfileCheck-DR-KZIyO.mjs").then((n) => n.n);
|
|
59
59
|
return lockfileCheck(options);
|
|
60
60
|
});
|
|
61
61
|
program.parse();
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as HookConfig } from "../config-
|
|
1
|
+
import { t as HookConfig } from "../config-B21-n_bR.mjs";
|
|
2
2
|
import { GenerateOptions } from "api-farmer";
|
|
3
3
|
import { ChangelogOptions, CommitLintCommandOptions, LockfileCheckOptions, PublishCommandOptions, ReleaseCommandOptions } from "@varlet/release";
|
|
4
|
-
|
|
5
4
|
//#region src/cli/clean.d.ts
|
|
6
5
|
declare function clean(patterns?: string[]): Promise<void>;
|
|
7
6
|
//#endregion
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as clean } from "../clean-
|
|
2
|
-
import { t as api } from "../api-
|
|
3
|
-
import { i as writeHooks, n as hook, t as getHooksDir } from "../hook-
|
|
4
|
-
import { t as release } from "../release-
|
|
5
|
-
import { t as publish } from "../publish-
|
|
6
|
-
import { t as changelog } from "../changelog-
|
|
7
|
-
import { t as commitLint } from "../commitLint-
|
|
8
|
-
import { t as lockfileCheck } from "../lockfileCheck-
|
|
1
|
+
import { t as clean } from "../clean-D_MS0eEx.mjs";
|
|
2
|
+
import { t as api } from "../api-BAhe-2Qc.mjs";
|
|
3
|
+
import { i as writeHooks, n as hook, t as getHooksDir } from "../hook-BsFKhwBl.mjs";
|
|
4
|
+
import { t as release } from "../release-DcENhCIa.mjs";
|
|
5
|
+
import { t as publish } from "../publish-tTIXb5nn.mjs";
|
|
6
|
+
import { t as changelog } from "../changelog-giizMwKa.mjs";
|
|
7
|
+
import { t as commitLint } from "../commitLint-CGrVknHB.mjs";
|
|
8
|
+
import { t as lockfileCheck } from "../lockfileCheck-DR-KZIyO.mjs";
|
|
9
9
|
export { api, changelog, clean, commitLint, getHooksDir, hook, lockfileCheck, publish, release, writeHooks };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./
|
|
1
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
2
2
|
import { commitLint } from "@varlet/release";
|
|
3
3
|
//#region src/cli/commitLint.ts
|
|
4
4
|
var commitLint_exports = /* @__PURE__ */ __exportAll({ commitLint: () => commitLint$1 });
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenerateOptions } from "api-farmer";
|
|
2
2
|
import { ChangelogOptions, PublishCommandOptions, ReleaseCommandOptions } from "@varlet/release";
|
|
3
|
-
|
|
4
3
|
//#region src/cli/config.d.ts
|
|
5
4
|
type GitHook = 'applypatch-msg' | 'pre-applypatch' | 'post-applypatch' | 'pre-commit' | 'pre-merge-commit' | 'prepare-commit-msg' | 'commit-msg' | 'post-commit' | 'pre-rebase' | 'post-checkout' | 'post-merge' | 'pre-push' | 'pre-auto-gc' | 'post-rewrite';
|
|
6
5
|
type HookConfig = Partial<Record<GitHook, string[]>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
1
|
+
import { t as callOrReturn } from "./callOrReturn-CZqsjrou.mjs";
|
|
2
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
3
3
|
import { loadConfig } from "unconfig";
|
|
4
4
|
//#region src/cli/config.ts
|
|
5
5
|
var config_exports = /* @__PURE__ */ __exportAll({ getConfig: () => getConfig });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as getConfig } from "./config-DyjJBx_r.mjs";
|
|
2
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
5
|
import { execSync } from "node:child_process";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v4 as uuid, v6 as uuidV6 } from "uuid";
|
|
2
2
|
import mitt from "mitt";
|
|
3
3
|
export * from "mitt";
|
|
4
|
-
|
|
4
|
+
//#endregion
|
|
5
5
|
//#region src/array/at.d.ts
|
|
6
6
|
declare function at<T>(arr: T[], index: number): T | undefined;
|
|
7
7
|
//#endregion
|
|
@@ -80,12 +80,12 @@ declare function omitBy<T extends object>(object: T, fn: (value: any, key: keyof
|
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/object/deriveKey.d.ts
|
|
82
82
|
type DeriveKeyMap<T extends object> = Partial<Record<keyof T, PropertyKey>>;
|
|
83
|
-
type DeriveKeyResult<T extends object, M extends DeriveKeyMap<T>> = T & { [K in keyof M as M[K] extends PropertyKey ? M[K] : never]: K extends keyof T ? T[K] : never };
|
|
83
|
+
type DeriveKeyResult<T extends object, M extends DeriveKeyMap<T>> = T & { [K in keyof M as M[K] extends PropertyKey ? M[K] : never]: K extends keyof T ? T[K] : never; };
|
|
84
84
|
declare function deriveKey<T extends object, M extends DeriveKeyMap<T>>(object: T, mapping: M): DeriveKeyResult<T, M>;
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region src/object/rekey.d.ts
|
|
87
87
|
type RekeyMap<T extends object> = Partial<Record<keyof T, PropertyKey>>;
|
|
88
|
-
type RekeyResult<T extends object, M extends RekeyMap<T>> = Omit<T, keyof M> & { [K in keyof M as M[K] extends PropertyKey ? M[K] : never]: K extends keyof T ? T[K] : never };
|
|
88
|
+
type RekeyResult<T extends object, M extends RekeyMap<T>> = Omit<T, keyof M> & { [K in keyof M as M[K] extends PropertyKey ? M[K] : never]: K extends keyof T ? T[K] : never; };
|
|
89
89
|
declare function rekey<T extends object, M extends RekeyMap<T>>(object: T, mapping: M): RekeyResult<T, M>;
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/object/mapObject.d.ts
|
|
@@ -107,9 +107,6 @@ declare function objectKeys<T extends object>(object: T): `${keyof T & string}`[
|
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/object/objectEntries.d.ts
|
|
109
109
|
declare function objectEntries<T extends object>(object: T): [keyof T & string, T[keyof T & string]][];
|
|
110
|
-
declare namespace index_d_exports$1 {
|
|
111
|
-
export { mitt, uuid, uuidV6 };
|
|
112
|
-
}
|
|
113
110
|
//#endregion
|
|
114
111
|
//#region src/util/cancelAnimationFrame.d.ts
|
|
115
112
|
declare function cancelAnimationFrame(handle: number): void;
|
|
@@ -214,13 +211,13 @@ type EnumOfNormalizeToOption<V> = V extends {
|
|
|
214
211
|
description?: EnumOfStringOrGetter;
|
|
215
212
|
};
|
|
216
213
|
type EnumOfResolvedField<V> = V extends ((...args: any[]) => infer R) ? R : V;
|
|
217
|
-
type EnumOfResolvedOption<O> = O extends unknown ? { [K in keyof O]: EnumOfResolvedField<O[K]
|
|
214
|
+
type EnumOfResolvedOption<O> = O extends unknown ? { [K in keyof O]: EnumOfResolvedField<O[K]>; } : never;
|
|
218
215
|
type EnumOfExtractOptionShape<T extends Record<string, EnumOfConfigValue>> = EnumOfResolvedOption<EnumOfNormalizeToOption<ValueOf<T>>>;
|
|
219
216
|
type EnumOfExtractValues<T extends object> = { [P in keyof T]: T[P] extends {
|
|
220
217
|
value: infer V;
|
|
221
|
-
} ? V : T[P] };
|
|
222
|
-
type EnumOfKeyForValue<T extends object, V> = { [K in keyof T]: EnumOfExtractValues<T>[K] extends V ? (V extends EnumOfExtractValues<T>[K] ? K : never) : never }[keyof T];
|
|
223
|
-
type EnumOfOptionForValue<T extends Record<string, EnumOfConfigValue>, Value> = Value extends infer V ? EnumOfKeyForValue<T, V> extends keyof T ? EnumOfResolvedOption<EnumOfNormalizeToOption<T[EnumOfKeyForValue<T, V>]>> : EnumOfExtractOptionShape<T> : never;
|
|
218
|
+
} ? V : T[P]; };
|
|
219
|
+
type EnumOfKeyForValue<T extends object, V> = { [K in keyof T]: EnumOfExtractValues<T>[K] extends V ? (V extends EnumOfExtractValues<T>[K] ? K : never) : never; }[keyof T];
|
|
220
|
+
type EnumOfOptionForValue<T extends Record<string, EnumOfConfigValue>, Value> = Value extends (infer V) ? EnumOfKeyForValue<T, V> extends keyof T ? EnumOfResolvedOption<EnumOfNormalizeToOption<T[EnumOfKeyForValue<T, V>]>> : EnumOfExtractOptionShape<T> : never;
|
|
224
221
|
type EnumOfResultMethods<V, T extends Record<string, EnumOfConfigValue>> = {
|
|
225
222
|
values(): V[];
|
|
226
223
|
label(v: V): string;
|
|
@@ -241,10 +238,7 @@ interface MotionOptions {
|
|
|
241
238
|
from: number;
|
|
242
239
|
to: number;
|
|
243
240
|
duration?: number;
|
|
244
|
-
frame?: ({
|
|
245
|
-
value,
|
|
246
|
-
done
|
|
247
|
-
}: {
|
|
241
|
+
frame?: ({ value, done }: {
|
|
248
242
|
value: number;
|
|
249
243
|
done: boolean;
|
|
250
244
|
}) => void;
|
|
@@ -484,12 +478,7 @@ interface MaskStringOptions {
|
|
|
484
478
|
mask?: string;
|
|
485
479
|
maskLength?: number;
|
|
486
480
|
}
|
|
487
|
-
declare function maskString(text: string, {
|
|
488
|
-
prefix,
|
|
489
|
-
suffix,
|
|
490
|
-
mask,
|
|
491
|
-
maskLength
|
|
492
|
-
}?: MaskStringOptions): string;
|
|
481
|
+
declare function maskString(text: string, { prefix, suffix, mask, maskLength }?: MaskStringOptions): string;
|
|
493
482
|
//#endregion
|
|
494
483
|
//#region src/string/camelize.d.ts
|
|
495
484
|
declare function camelize(s: string): string;
|
|
@@ -579,8 +568,5 @@ declare function floor(val: number, precision?: number): number;
|
|
|
579
568
|
//#endregion
|
|
580
569
|
//#region src/math/ceil.d.ts
|
|
581
570
|
declare function ceil(val: number, precision?: number): number;
|
|
582
|
-
declare namespace index_d_exports {
|
|
583
|
-
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, deriveKey, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, rekey, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
|
584
|
-
}
|
|
585
571
|
//#endregion
|
|
586
|
-
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, deriveKey, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, rekey, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
|
572
|
+
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, deriveKey, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, rekey, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, __exportAll as t, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as isArray, t as isString } from "./isString-
|
|
2
|
-
import { n as isFunction, t as callOrReturn } from "./callOrReturn-
|
|
1
|
+
import { n as isArray, t as isString } from "./isString-Ci3uKJYg.mjs";
|
|
2
|
+
import { n as isFunction, t as callOrReturn } from "./callOrReturn-CZqsjrou.mjs";
|
|
3
3
|
import { v4 as uuid, v6 as uuidV6 } from "uuid";
|
|
4
4
|
import mitt from "mitt";
|
|
5
5
|
import Cookie from "js-cookie";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./
|
|
1
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
2
2
|
import { lockfileCheck } from "@varlet/release";
|
|
3
3
|
//#region src/cli/lockfileCheck.ts
|
|
4
4
|
var lockfileCheck_exports = /* @__PURE__ */ __exportAll({ lockfileCheck: () => lockfileCheck$1 });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as getConfig } from "./config-DyjJBx_r.mjs";
|
|
2
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
3
3
|
import { publish } from "@varlet/release";
|
|
4
4
|
//#region src/cli/publish.ts
|
|
5
5
|
var publish_exports = /* @__PURE__ */ __exportAll({ publish: () => publish$1 });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as getConfig } from "./config-DyjJBx_r.mjs";
|
|
2
|
+
import { t as __exportAll } from "./index.d.mts";
|
|
3
3
|
import { release } from "@varlet/release";
|
|
4
4
|
//#region src/cli/release.ts
|
|
5
5
|
var release_exports = /* @__PURE__ */ __exportAll({ release: () => release$1 });
|
|
@@ -1,27 +1,70 @@
|
|
|
1
|
-
import { n as RattailConfig, t as HookConfig } from "../config-
|
|
1
|
+
import { n as RattailConfig, t as HookConfig } from "../config-B21-n_bR.mjs";
|
|
2
2
|
import { ConfigEnv, UserConfig } from "vite-plus";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { OxfmtConfig } from "oxfmt";
|
|
4
|
+
import { DummyRule, OxlintConfig, OxlintOverride } from "oxlint";
|
|
5
5
|
//#region src/vite-plus/index.d.ts
|
|
6
|
+
interface CreateVueConfigOptions {
|
|
7
|
+
version?: 2 | 3;
|
|
8
|
+
}
|
|
9
|
+
type LintOptionsVue = Partial<Pick<CreateVueConfigOptions, 'version'>>;
|
|
10
|
+
type StagedConfig = Record<string, string | string[]>;
|
|
11
|
+
interface FmtOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Ignore file patterns
|
|
14
|
+
*/
|
|
15
|
+
ignores?: string[];
|
|
16
|
+
}
|
|
17
|
+
interface LintOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Enable TypeScript support
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
ts?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Enable Vue support, version 3 by default
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
vue?: boolean | LintOptionsVue;
|
|
28
|
+
/**
|
|
29
|
+
* Enable React support
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
react?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Enable Vitest support
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
vitest?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Custom rules
|
|
40
|
+
*/
|
|
41
|
+
rules?: Record<string, DummyRule>;
|
|
42
|
+
/**
|
|
43
|
+
* Ignore file patterns
|
|
44
|
+
*/
|
|
45
|
+
ignores?: string[];
|
|
46
|
+
/**
|
|
47
|
+
* Additional overrides
|
|
48
|
+
*/
|
|
49
|
+
overrides?: OxlintOverride[];
|
|
50
|
+
}
|
|
51
|
+
declare function lint(options?: LintOptions): OxlintConfig;
|
|
52
|
+
declare function staged(): StagedConfig;
|
|
53
|
+
declare function fmt(options?: FmtOptions): OxfmtConfig;
|
|
6
54
|
type RattailUserConfig = UserConfig & {
|
|
7
55
|
rattail?: RattailConfig;
|
|
8
56
|
};
|
|
9
57
|
type RattailUserConfigFn = (env: ConfigEnv) => RattailUserConfig | Promise<RattailUserConfig>;
|
|
10
58
|
type RattailUserConfigExport = RattailUserConfig | Promise<RattailUserConfig> | RattailUserConfigFn;
|
|
11
59
|
declare function defineConfig(config: RattailUserConfigExport): RattailUserConfig;
|
|
12
|
-
declare function clean({
|
|
13
|
-
patterns
|
|
14
|
-
}?: {
|
|
60
|
+
declare function clean({ patterns }?: {
|
|
15
61
|
patterns?: string[];
|
|
16
62
|
}): {
|
|
17
63
|
patterns: string[];
|
|
18
64
|
};
|
|
19
|
-
declare function hook({
|
|
20
|
-
commitLint,
|
|
21
|
-
lockfileCheck
|
|
22
|
-
}?: {
|
|
65
|
+
declare function hook({ commitLint, lockfileCheck }?: {
|
|
23
66
|
commitLint?: boolean;
|
|
24
67
|
lockfileCheck?: boolean;
|
|
25
68
|
}): HookConfig;
|
|
26
69
|
//#endregion
|
|
27
|
-
export {
|
|
70
|
+
export { CreateVueConfigOptions, type DummyRule, FmtOptions, type HookConfig, LintOptions, LintOptionsVue, type OxlintConfig, type OxlintOverride, type RattailConfig, RattailUserConfig, RattailUserConfigExport, RattailUserConfigFn, StagedConfig, clean, defineConfig, fmt, hook, lint, staged };
|
package/dist/vite-plus/index.mjs
CHANGED
|
@@ -1,6 +1,390 @@
|
|
|
1
1
|
import { defineConfig as defineConfig$1 } from "vite-plus";
|
|
2
|
-
import { fmt, lint, staged } from "@configurajs/vite-plus";
|
|
3
2
|
//#region src/vite-plus/index.ts
|
|
3
|
+
const DEFAULT_IGNORES = [
|
|
4
|
+
"**/node_modules",
|
|
5
|
+
"**/dist",
|
|
6
|
+
"**/package-lock.json",
|
|
7
|
+
"**/yarn.lock",
|
|
8
|
+
"**/pnpm-lock.yaml",
|
|
9
|
+
"**/bun.lockb",
|
|
10
|
+
"**/output",
|
|
11
|
+
"**/coverage",
|
|
12
|
+
"**/temp",
|
|
13
|
+
"**/.temp",
|
|
14
|
+
"**/tmp",
|
|
15
|
+
"**/.tmp",
|
|
16
|
+
"**/.history",
|
|
17
|
+
"**/.vitepress/cache",
|
|
18
|
+
"**/.nuxt",
|
|
19
|
+
"**/.next",
|
|
20
|
+
"**/.svelte-kit",
|
|
21
|
+
"**/.vercel",
|
|
22
|
+
"**/.changeset",
|
|
23
|
+
"**/.idea",
|
|
24
|
+
"**/.vscode",
|
|
25
|
+
"**/.cache",
|
|
26
|
+
"**/.output",
|
|
27
|
+
"**/.vite-inspect",
|
|
28
|
+
"**/.yarn",
|
|
29
|
+
"**/vite.config.*.timestamp-*",
|
|
30
|
+
"**/CHANGELOG*.md",
|
|
31
|
+
"**/*.min.*",
|
|
32
|
+
"**/LICENSE*",
|
|
33
|
+
"**/__snapshots__",
|
|
34
|
+
"**/auto-import?(s).d.ts",
|
|
35
|
+
"**/components.d.ts",
|
|
36
|
+
"**/.vite-hooks/**"
|
|
37
|
+
];
|
|
38
|
+
function createIgnoresConfig(ignores = []) {
|
|
39
|
+
return [...DEFAULT_IGNORES, ...ignores];
|
|
40
|
+
}
|
|
41
|
+
function createJsConfig() {
|
|
42
|
+
return {
|
|
43
|
+
plugins: [
|
|
44
|
+
"eslint",
|
|
45
|
+
"oxc",
|
|
46
|
+
"unicorn",
|
|
47
|
+
"import"
|
|
48
|
+
],
|
|
49
|
+
categories: { correctness: "off" },
|
|
50
|
+
env: {
|
|
51
|
+
browser: true,
|
|
52
|
+
node: true,
|
|
53
|
+
es2024: true
|
|
54
|
+
},
|
|
55
|
+
rules: {
|
|
56
|
+
"constructor-super": "error",
|
|
57
|
+
"for-direction": "error",
|
|
58
|
+
"no-async-promise-executor": "error",
|
|
59
|
+
"no-caller": "error",
|
|
60
|
+
"no-class-assign": "error",
|
|
61
|
+
"no-compare-neg-zero": "error",
|
|
62
|
+
"no-cond-assign": "error",
|
|
63
|
+
"no-const-assign": "error",
|
|
64
|
+
"no-constant-binary-expression": "error",
|
|
65
|
+
"no-constant-condition": "error",
|
|
66
|
+
"no-control-regex": "error",
|
|
67
|
+
"no-debugger": "error",
|
|
68
|
+
"no-delete-var": "error",
|
|
69
|
+
"no-dupe-class-members": "error",
|
|
70
|
+
"no-dupe-else-if": "error",
|
|
71
|
+
"no-dupe-keys": "error",
|
|
72
|
+
"no-duplicate-case": "error",
|
|
73
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
74
|
+
"no-empty-character-class": "error",
|
|
75
|
+
"no-empty-pattern": "error",
|
|
76
|
+
"no-empty-static-block": "error",
|
|
77
|
+
"no-eval": "error",
|
|
78
|
+
"no-ex-assign": "error",
|
|
79
|
+
"no-extra-boolean-cast": "error",
|
|
80
|
+
"no-func-assign": "error",
|
|
81
|
+
"no-global-assign": "error",
|
|
82
|
+
"no-import-assign": "error",
|
|
83
|
+
"no-invalid-regexp": "error",
|
|
84
|
+
"no-irregular-whitespace": "error",
|
|
85
|
+
"no-iterator": "error",
|
|
86
|
+
"no-loss-of-precision": "error",
|
|
87
|
+
"no-misleading-character-class": "error",
|
|
88
|
+
"no-new-native-nonconstructor": "error",
|
|
89
|
+
"no-nonoctal-decimal-escape": "error",
|
|
90
|
+
"no-obj-calls": "error",
|
|
91
|
+
"no-self-assign": "error",
|
|
92
|
+
"no-setter-return": "error",
|
|
93
|
+
"no-sparse-arrays": "error",
|
|
94
|
+
"no-this-before-super": "error",
|
|
95
|
+
"no-unassigned-vars": "error",
|
|
96
|
+
"no-unsafe-finally": "error",
|
|
97
|
+
"no-unsafe-negation": "error",
|
|
98
|
+
"no-unsafe-optional-chaining": "error",
|
|
99
|
+
"no-unused-expressions": ["error", {
|
|
100
|
+
allowShortCircuit: true,
|
|
101
|
+
allowTaggedTemplates: true,
|
|
102
|
+
allowTernary: true
|
|
103
|
+
}],
|
|
104
|
+
"no-unused-labels": "error",
|
|
105
|
+
"no-unused-private-class-members": "error",
|
|
106
|
+
"no-unused-vars": ["error", {
|
|
107
|
+
args: "none",
|
|
108
|
+
caughtErrors: "none",
|
|
109
|
+
ignoreRestSiblings: true,
|
|
110
|
+
vars: "all"
|
|
111
|
+
}],
|
|
112
|
+
"no-useless-backreference": "error",
|
|
113
|
+
"no-useless-catch": "error",
|
|
114
|
+
"no-useless-escape": "error",
|
|
115
|
+
"no-useless-rename": "error",
|
|
116
|
+
"no-with": "error",
|
|
117
|
+
"require-yield": "error",
|
|
118
|
+
"use-isnan": "error",
|
|
119
|
+
"valid-typeof": "error",
|
|
120
|
+
eqeqeq: [
|
|
121
|
+
"error",
|
|
122
|
+
"always",
|
|
123
|
+
{ null: "ignore" }
|
|
124
|
+
],
|
|
125
|
+
curly: "error",
|
|
126
|
+
yoda: "error",
|
|
127
|
+
"default-param-last": "error",
|
|
128
|
+
"prefer-const": "error",
|
|
129
|
+
"prefer-rest-params": "error",
|
|
130
|
+
"require-await": "error",
|
|
131
|
+
"symbol-description": "error",
|
|
132
|
+
"oxc/bad-array-method-on-arguments": "error",
|
|
133
|
+
"oxc/bad-char-at-comparison": "error",
|
|
134
|
+
"oxc/bad-comparison-sequence": "error",
|
|
135
|
+
"oxc/bad-min-max-func": "error",
|
|
136
|
+
"oxc/bad-object-literal-comparison": "error",
|
|
137
|
+
"oxc/bad-replace-all-arg": "error",
|
|
138
|
+
"oxc/const-comparisons": "error",
|
|
139
|
+
"oxc/double-comparisons": "error",
|
|
140
|
+
"oxc/erasing-op": "error",
|
|
141
|
+
"oxc/missing-throw": "error",
|
|
142
|
+
"oxc/number-arg-out-of-range": "error",
|
|
143
|
+
"oxc/only-used-in-recursion": "error",
|
|
144
|
+
"oxc/uninvoked-array-callback": "error",
|
|
145
|
+
"unicorn/no-await-in-promise-methods": "error",
|
|
146
|
+
"unicorn/no-empty-file": "error",
|
|
147
|
+
"unicorn/no-invalid-fetch-options": "error",
|
|
148
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
149
|
+
"unicorn/no-new-array": "error",
|
|
150
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
151
|
+
"unicorn/no-unnecessary-await": "error",
|
|
152
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
153
|
+
"unicorn/no-useless-length-check": "error",
|
|
154
|
+
"unicorn/no-useless-spread": "error",
|
|
155
|
+
"unicorn/prefer-set-size": "error",
|
|
156
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
157
|
+
"import/default": "error",
|
|
158
|
+
"import/namespace": "error",
|
|
159
|
+
"import/first": "error",
|
|
160
|
+
"import/no-duplicates": "error",
|
|
161
|
+
"import/no-mutable-exports": "error",
|
|
162
|
+
"import/no-self-import": "error"
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function createTsConfig(exts = []) {
|
|
167
|
+
return {
|
|
168
|
+
plugins: ["typescript"],
|
|
169
|
+
overrides: [{
|
|
170
|
+
files: [
|
|
171
|
+
"**/*.?([cm])ts",
|
|
172
|
+
"**/*.?([cm])tsx",
|
|
173
|
+
...exts.map((ext) => `**/*.${ext}`)
|
|
174
|
+
],
|
|
175
|
+
rules: {
|
|
176
|
+
"no-unused-expressions": "off",
|
|
177
|
+
"no-unused-vars": "off",
|
|
178
|
+
"no-redeclare": "off",
|
|
179
|
+
"no-undef": "off",
|
|
180
|
+
"no-var": "error",
|
|
181
|
+
"prefer-const": "error",
|
|
182
|
+
"prefer-rest-params": "error",
|
|
183
|
+
"prefer-spread": "error",
|
|
184
|
+
"typescript/await-thenable": "error",
|
|
185
|
+
"typescript/no-array-constructor": "error",
|
|
186
|
+
"typescript/no-array-delete": "error",
|
|
187
|
+
"typescript/no-base-to-string": "error",
|
|
188
|
+
"typescript/no-duplicate-enum-values": "error",
|
|
189
|
+
"typescript/no-duplicate-type-constituents": "error",
|
|
190
|
+
"typescript/no-extra-non-null-assertion": "error",
|
|
191
|
+
"typescript/no-floating-promises": "error",
|
|
192
|
+
"typescript/no-for-in-array": "error",
|
|
193
|
+
"typescript/no-implied-eval": "error",
|
|
194
|
+
"typescript/no-meaningless-void-operator": "error",
|
|
195
|
+
"typescript/no-misused-new": "error",
|
|
196
|
+
"typescript/no-namespace": "error",
|
|
197
|
+
"typescript/no-non-null-asserted-optional-chain": "error",
|
|
198
|
+
"typescript/no-redundant-type-constituents": "error",
|
|
199
|
+
"typescript/no-require-imports": "error",
|
|
200
|
+
"typescript/no-this-alias": "error",
|
|
201
|
+
"typescript/no-unnecessary-parameter-property-assignment": "error",
|
|
202
|
+
"typescript/no-unnecessary-type-constraint": "error",
|
|
203
|
+
"typescript/no-unsafe-declaration-merging": "error",
|
|
204
|
+
"typescript/no-unsafe-function-type": "error",
|
|
205
|
+
"typescript/no-unsafe-unary-minus": "error",
|
|
206
|
+
"typescript/no-useless-empty-export": "error",
|
|
207
|
+
"typescript/no-wrapper-object-types": "error",
|
|
208
|
+
"typescript/prefer-as-const": "error",
|
|
209
|
+
"typescript/prefer-namespace-keyword": "error",
|
|
210
|
+
"typescript/prefer-string-starts-ends-with": "error",
|
|
211
|
+
"typescript/restrict-template-expressions": "error",
|
|
212
|
+
"typescript/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
|
|
213
|
+
"typescript/no-non-null-asserted-nullish-coalescing": "error",
|
|
214
|
+
"typescript/no-useless-constructor": "error",
|
|
215
|
+
"typescript/prefer-literal-enum-member": "error",
|
|
216
|
+
"typescript/unified-signatures": "error",
|
|
217
|
+
"typescript/no-unused-expressions": ["error", {
|
|
218
|
+
allowShortCircuit: true,
|
|
219
|
+
allowTaggedTemplates: true,
|
|
220
|
+
allowTernary: true
|
|
221
|
+
}],
|
|
222
|
+
"typescript/no-unused-vars": ["error", {
|
|
223
|
+
args: "none",
|
|
224
|
+
caughtErrors: "none",
|
|
225
|
+
ignoreRestSiblings: true,
|
|
226
|
+
vars: "all"
|
|
227
|
+
}]
|
|
228
|
+
}
|
|
229
|
+
}]
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function createVueConfig(options = {}) {
|
|
233
|
+
const { version = 3 } = options;
|
|
234
|
+
return {
|
|
235
|
+
plugins: ["vue"],
|
|
236
|
+
rules: {
|
|
237
|
+
"vue/no-arrow-functions-in-watch": "error",
|
|
238
|
+
"vue/no-deprecated-destroyed-lifecycle": version === 2 ? "off" : "error",
|
|
239
|
+
"vue/no-export-in-script-setup": "error",
|
|
240
|
+
"vue/no-lifecycle-after-await": "error",
|
|
241
|
+
"vue/no-multiple-slot-args": "warn",
|
|
242
|
+
"vue/no-this-in-before-route-enter": "error",
|
|
243
|
+
"vue/prefer-import-from-vue": "error",
|
|
244
|
+
"vue/valid-define-emits": "error",
|
|
245
|
+
"vue/valid-define-props": "error"
|
|
246
|
+
},
|
|
247
|
+
globals: {
|
|
248
|
+
computed: "readonly",
|
|
249
|
+
defineEmits: "readonly",
|
|
250
|
+
defineExpose: "readonly",
|
|
251
|
+
defineProps: "readonly",
|
|
252
|
+
onMounted: "readonly",
|
|
253
|
+
onUnmounted: "readonly",
|
|
254
|
+
reactive: "readonly",
|
|
255
|
+
ref: "readonly",
|
|
256
|
+
shallowReactive: "readonly",
|
|
257
|
+
shallowRef: "readonly",
|
|
258
|
+
toRef: "readonly",
|
|
259
|
+
toRefs: "readonly",
|
|
260
|
+
watch: "readonly",
|
|
261
|
+
watchEffect: "readonly"
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function createReactConfig() {
|
|
266
|
+
return {
|
|
267
|
+
plugins: ["react"],
|
|
268
|
+
overrides: [{
|
|
269
|
+
files: ["**/*.?([cm])[jt]s?(x)"],
|
|
270
|
+
rules: {
|
|
271
|
+
"react/exhaustive-deps": "warn",
|
|
272
|
+
"react/forward-ref-uses-ref": "error",
|
|
273
|
+
"react/jsx-key": "error",
|
|
274
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
275
|
+
"react/jsx-no-undef": "error",
|
|
276
|
+
"react/jsx-props-no-spread-multi": "error",
|
|
277
|
+
"react/jsx-uses-vars": "warn",
|
|
278
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
279
|
+
"react/jsx-no-target-blank": "warn",
|
|
280
|
+
"react/jsx-no-script-url": "warn",
|
|
281
|
+
"react/jsx-boolean-value": "warn",
|
|
282
|
+
"react/jsx-no-useless-fragment": "warn",
|
|
283
|
+
"react/no-access-state-in-setstate": "error",
|
|
284
|
+
"react/no-array-index-key": "warn",
|
|
285
|
+
"react/no-children-prop": "error",
|
|
286
|
+
"react/no-danger": "warn",
|
|
287
|
+
"react/no-danger-with-children": "error",
|
|
288
|
+
"react/no-deprecated": "error",
|
|
289
|
+
"react/no-did-mount-set-state": "error",
|
|
290
|
+
"react/no-direct-mutation-state": "error",
|
|
291
|
+
"react/no-find-dom-node": "error",
|
|
292
|
+
"react/no-is-mounted": "error",
|
|
293
|
+
"react/no-render-return-value": "error",
|
|
294
|
+
"react/no-string-refs": "error",
|
|
295
|
+
"react/no-this-in-sfc": "error",
|
|
296
|
+
"react/no-unsafe": "error",
|
|
297
|
+
"react/no-unstable-nested-components": "error",
|
|
298
|
+
"react/no-will-update-set-state": "error",
|
|
299
|
+
"react/void-dom-elements-no-children": "warn",
|
|
300
|
+
"react/button-has-type": "warn",
|
|
301
|
+
"react/iframe-missing-sandbox": "warn",
|
|
302
|
+
"react/rules-of-hooks": "error"
|
|
303
|
+
}
|
|
304
|
+
}]
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function createVitestConfig() {
|
|
308
|
+
return {
|
|
309
|
+
plugins: ["vitest"],
|
|
310
|
+
overrides: [{
|
|
311
|
+
files: ["**/*.{test,spec}.?(c|m)[jt]s?(x)"],
|
|
312
|
+
rules: {
|
|
313
|
+
"vitest/consistent-each-for": "error",
|
|
314
|
+
"vitest/hoisted-apis-on-top": "error",
|
|
315
|
+
"vitest/no-commented-out-tests": "warn",
|
|
316
|
+
"vitest/no-conditional-tests": "error",
|
|
317
|
+
"vitest/no-identical-title": "error",
|
|
318
|
+
"vitest/no-import-node-test": "warn",
|
|
319
|
+
"vitest/require-awaited-expect-poll": "error",
|
|
320
|
+
"vitest/require-local-test-context-for-concurrent-snapshots": "warn",
|
|
321
|
+
"vitest/require-mock-type-parameters": "error",
|
|
322
|
+
"vitest/valid-describe-callback": "error",
|
|
323
|
+
"vitest/valid-expect": "error",
|
|
324
|
+
"vitest/valid-title": "error",
|
|
325
|
+
"vitest/warn-todo": "error"
|
|
326
|
+
}
|
|
327
|
+
}]
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function mergeContributions(...contributions) {
|
|
331
|
+
const categories = {};
|
|
332
|
+
const rules = {};
|
|
333
|
+
const overrides = [];
|
|
334
|
+
const globals = {};
|
|
335
|
+
const env = {};
|
|
336
|
+
const settings = {};
|
|
337
|
+
const plugins = [];
|
|
338
|
+
contributions.forEach((contribution) => {
|
|
339
|
+
contribution.plugins?.forEach((plugin) => plugins.push(plugin));
|
|
340
|
+
Object.assign(categories, contribution.categories);
|
|
341
|
+
Object.assign(rules, contribution.rules);
|
|
342
|
+
Object.assign(globals, contribution.globals);
|
|
343
|
+
Object.assign(env, contribution.env);
|
|
344
|
+
Object.assign(settings, contribution.settings);
|
|
345
|
+
if (contribution.overrides) overrides.push(...contribution.overrides);
|
|
346
|
+
});
|
|
347
|
+
return {
|
|
348
|
+
plugins,
|
|
349
|
+
categories,
|
|
350
|
+
rules,
|
|
351
|
+
overrides,
|
|
352
|
+
globals,
|
|
353
|
+
env,
|
|
354
|
+
settings
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function lint(options = {}) {
|
|
358
|
+
const { ts = true, vue = true, react = false, vitest = true, ignores = [], rules = {}, overrides = [] } = options;
|
|
359
|
+
const contributions = [createJsConfig()];
|
|
360
|
+
if (ts) contributions.push(createTsConfig(vue ? ["vue"] : []));
|
|
361
|
+
if (vue) contributions.push(createVueConfig({ version: vue === true ? 3 : vue.version ?? 3 }));
|
|
362
|
+
if (react) contributions.push(createReactConfig());
|
|
363
|
+
if (vitest) contributions.push(createVitestConfig());
|
|
364
|
+
contributions.push({ rules });
|
|
365
|
+
const config = mergeContributions(...contributions);
|
|
366
|
+
config.ignorePatterns = createIgnoresConfig(ignores);
|
|
367
|
+
config.overrides = [...config.overrides ?? [], ...overrides];
|
|
368
|
+
return config;
|
|
369
|
+
}
|
|
370
|
+
function staged() {
|
|
371
|
+
return {
|
|
372
|
+
"*.{js,jsx,ts,tsx}": ["vp fmt --no-error-on-unmatched-pattern", "vp lint --fix --no-error-on-unmatched-pattern"],
|
|
373
|
+
"*.{md,json,yaml,yml,html,css,scss,less}": "vp fmt --no-error-on-unmatched-pattern",
|
|
374
|
+
"*.vue": ["vp fmt --no-error-on-unmatched-pattern", "vp lint --fix --no-error-on-unmatched-pattern"]
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function fmt(options = {}) {
|
|
378
|
+
const { ignores = [] } = options;
|
|
379
|
+
return {
|
|
380
|
+
semi: false,
|
|
381
|
+
printWidth: 120,
|
|
382
|
+
singleQuote: true,
|
|
383
|
+
sortImports: { newlinesBetween: false },
|
|
384
|
+
sortTailwindcss: true,
|
|
385
|
+
ignorePatterns: createIgnoresConfig(ignores)
|
|
386
|
+
};
|
|
387
|
+
}
|
|
4
388
|
function defineConfig(config) {
|
|
5
389
|
return defineConfig$1(config);
|
|
6
390
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rattail",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A Vite+ oriented, AI Agent friendly front-end toolchain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agent",
|
|
@@ -91,7 +91,6 @@
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@configurajs/vite-plus": "0.2.6",
|
|
95
94
|
"@varlet/axle": "1.0.2",
|
|
96
95
|
"@varlet/release": "^2.2.1",
|
|
97
96
|
"api-farmer": "0.1.5",
|
|
@@ -104,22 +103,28 @@
|
|
|
104
103
|
"uuid": "13.0.0"
|
|
105
104
|
},
|
|
106
105
|
"devDependencies": {
|
|
107
|
-
"@types/node": "^22.
|
|
108
|
-
"@vitest/coverage-istanbul": "^4.1.
|
|
106
|
+
"@types/node": "^22.20.0",
|
|
107
|
+
"@vitest/coverage-istanbul": "^4.1.10",
|
|
108
|
+
"esbuild": "^0.28.1",
|
|
109
109
|
"jsdom": "^25.0.1",
|
|
110
110
|
"oxc-minify": "^0.124.0",
|
|
111
|
+
"oxfmt": "0.60.0",
|
|
112
|
+
"oxlint": "1.75.0",
|
|
111
113
|
"tsx": "^4.21.0",
|
|
112
114
|
"typescript": "5.3.3",
|
|
113
|
-
"vite-plus": "0.
|
|
114
|
-
"vitepress": "2.0.0-alpha.17"
|
|
115
|
-
"vitest": "$vitest"
|
|
115
|
+
"vite-plus": "0.2.6",
|
|
116
|
+
"vitepress": "2.0.0-alpha.17"
|
|
116
117
|
},
|
|
117
118
|
"peerDependencies": {
|
|
118
|
-
"
|
|
119
|
-
"
|
|
119
|
+
"oxfmt": ">=0.60.0",
|
|
120
|
+
"oxlint": ">=1.75.0",
|
|
121
|
+
"vite-plus": ">=0.2.6"
|
|
120
122
|
},
|
|
121
123
|
"peerDependenciesMeta": {
|
|
122
|
-
"
|
|
124
|
+
"oxfmt": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"oxlint": {
|
|
123
128
|
"optional": true
|
|
124
129
|
},
|
|
125
130
|
"vite-plus": {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __exportAll = (all, no_symbols) => {
|
|
7
|
-
let target = {};
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
-
return target;
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
-
key = keys[i];
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
-
get: ((k) => from[k]).bind(null, key),
|
|
20
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
26
|
-
//#endregion
|
|
27
|
-
export { __reExport as n, __exportAll as t };
|
|
File without changes
|
|
File without changes
|