rattail 2.1.1 → 2.2.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/cli/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as hook, c as clean, d as getConfig, l as changelog, n as publish, r as lockfileCheck, s as commitLint, t as release, u as api } from "../release-CFAOWQEE.mjs";
2
+ import { a as hook, c as clean, d as getConfig, l as changelog, n as publish, r as lockfileCheck, s as commitLint, t as release, u as api } from "../release-CIqgOHLH.mjs";
3
3
  import { Command } from "commander";
4
4
  import fs from "node:fs";
5
5
  import { dirname, resolve } from "node:path";
@@ -22,8 +22,9 @@ program.command("hook").description("Install git hooks from config").action(() =
22
22
  return hook();
23
23
  });
24
24
  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) => {
25
+ const config = (await getConfig()).release ?? {};
25
26
  return release({
26
- ...(await getConfig()).release ?? {},
27
+ ...config,
27
28
  ...options.npmTag != null ? { npmTag: options.npmTag } : {},
28
29
  ...options.remote != null ? { remote: options.remote } : {},
29
30
  ...options.skipNpmPublish ? { skipNpmPublish: true } : {},
@@ -33,8 +34,9 @@ program.command("release").description("Release all packages and generate change
33
34
  });
34
35
  });
35
36
  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) => {
37
+ const config = (await getConfig()).publish ?? {};
36
38
  return publish({
37
- ...(await getConfig()).publish ?? {},
39
+ ...config,
38
40
  ...options.checkRemoteVersion ? { checkRemoteVersion: true } : {},
39
41
  ...options.npmTag != null ? { npmTag: options.npmTag } : {},
40
42
  ...options.preRelease ? { preRelease: true } : {}
@@ -1,2 +1,2 @@
1
- import { a as hook, c as clean, i as getHooksDir, l as changelog, n as publish, o as writeHooks, r as lockfileCheck, s as commitLint, t as release, u as api } from "../release-CFAOWQEE.mjs";
1
+ import { a as hook, c as clean, i as getHooksDir, l as changelog, n as publish, o as writeHooks, r as lockfileCheck, s as commitLint, t as release, u as api } from "../release-CIqgOHLH.mjs";
2
2
  export { api, changelog, clean, commitLint, getHooksDir, hook, lockfileCheck, publish, release, writeHooks };
package/dist/index.d.mts CHANGED
@@ -102,10 +102,10 @@ declare function promiseWithResolvers<T>(): PromiseWithResolvers<T>;
102
102
  declare function set<T extends object | any[]>(object: T, path: (string | number)[], value: any): void;
103
103
  //#endregion
104
104
  //#region src/object/objectKeys.d.ts
105
- declare function objectKeys<T extends object>(object: T): `${keyof T & string}`[];
105
+ declare function objectKeys<T extends object>(object: T): Array<`${keyof T & string}`>;
106
106
  //#endregion
107
107
  //#region src/object/objectEntries.d.ts
108
- declare function objectEntries<T extends object>(object: T): [keyof T & string, T[keyof T & string]][];
108
+ declare function objectEntries<T extends object>(object: T): Array<[keyof T & string, T[keyof T & string]]>;
109
109
  //#endregion
110
110
  //#region src/util/cancelAnimationFrame.d.ts
111
111
  declare function cancelAnimationFrame(handle: number): void;
@@ -122,7 +122,7 @@ declare function copyText(value: string): void;
122
122
  type BEM<S extends string | undefined, N extends string, NC extends string> = S extends undefined ? NC : S extends `$--${infer CM}` ? `${N}--${CM}` : S extends `--${infer M}` ? `${NC}--${M}` : `${NC}__${S}`;
123
123
  declare function createNamespaceFn<N extends string>(namespace: N): <C extends string>(name: C) => {
124
124
  name: string;
125
- n: <S extends string | undefined = undefined>(suffix?: S | undefined) => BEM<S, N, `${N}-${C}`>;
125
+ n: <S extends string | undefined = undefined>(suffix?: S) => BEM<S, typeof namespace, `${N}-${C}`>;
126
126
  classes: typeof classes;
127
127
  };
128
128
  //#endregion
package/dist/index.mjs CHANGED
@@ -1287,9 +1287,10 @@ function mergeWith(object, ...sources) {
1287
1287
  const targetValue = target[key];
1288
1288
  const customResult = fn(targetValue, srcValue, key, object, source);
1289
1289
  if (customResult !== void 0) target[key] = customResult;
1290
- else if (isObject(srcValue)) if (isObject(targetValue)) target[key] = baseMerge(targetValue, srcValue);
1291
- else target[key] = baseMerge(isArray(srcValue) ? [] : {}, srcValue);
1292
- else target[key] = srcValue;
1290
+ else if (isObject(srcValue)) {
1291
+ if (isObject(targetValue)) target[key] = baseMerge(targetValue, srcValue);
1292
+ else target[key] = baseMerge(isArray(srcValue) ? [] : {}, srcValue);
1293
+ } else target[key] = srcValue;
1293
1294
  }
1294
1295
  return target;
1295
1296
  }
@@ -19,12 +19,14 @@ async function getConfig() {
19
19
  //#endregion
20
20
  //#region src/cli/api.ts
21
21
  async function api(config) {
22
- await generate(config ?? (await getConfig()).api ?? {});
22
+ const resolvedConfig = config ?? (await getConfig()).api ?? {};
23
+ await generate(resolvedConfig);
23
24
  }
24
25
  //#endregion
25
26
  //#region src/cli/changelog.ts
26
27
  async function changelog$1(config) {
27
- await changelog(config ?? (await getConfig()).changelog ?? {});
28
+ const resolvedConfig = config ?? (await getConfig()).changelog ?? {};
29
+ await changelog(resolvedConfig);
28
30
  }
29
31
  //#endregion
30
32
  //#region src/cli/clean.ts
@@ -35,7 +37,8 @@ function resolveCleanPatterns(clean) {
35
37
  return clean.patterns ?? [];
36
38
  }
37
39
  async function clean(patterns) {
38
- await rimraf(patterns ?? resolveCleanPatterns((await getConfig()).clean), { glob: true });
40
+ const resolvedPatterns = patterns ?? resolveCleanPatterns((await getConfig()).clean);
41
+ await rimraf(resolvedPatterns, { glob: true });
39
42
  }
40
43
  //#endregion
41
44
  //#region src/cli/commitLint.ts
@@ -70,12 +73,14 @@ async function lockfileCheck$1(options) {
70
73
  //#endregion
71
74
  //#region src/cli/publish.ts
72
75
  async function publish$1(config) {
73
- await publish(config ?? (await getConfig()).publish ?? {});
76
+ const resolvedConfig = config ?? (await getConfig()).publish ?? {};
77
+ await publish(resolvedConfig);
74
78
  }
75
79
  //#endregion
76
80
  //#region src/cli/release.ts
77
81
  async function release$1(config) {
78
- await release(config ?? (await getConfig()).release ?? {});
82
+ const resolvedConfig = config ?? (await getConfig()).release ?? {};
83
+ await release(resolvedConfig);
79
84
  }
80
85
  //#endregion
81
86
  export { hook as a, clean as c, getConfig as d, getHooksDir as i, changelog$1 as l, publish$1 as n, writeHooks as o, lockfileCheck$1 as r, commitLint$1 as s, release$1 as t, api as u };
@@ -56,7 +56,9 @@ type RattailUserConfig = UserConfig & {
56
56
  };
57
57
  type RattailUserConfigFn = (env: ConfigEnv) => RattailUserConfig | Promise<RattailUserConfig>;
58
58
  type RattailUserConfigExport = RattailUserConfig | Promise<RattailUserConfig> | RattailUserConfigFn;
59
- declare function defineConfig(config: RattailUserConfigExport): RattailUserConfig;
59
+ declare function defineConfig<T extends RattailUserConfig>(config: T): T;
60
+ declare function defineConfig<T extends Promise<RattailUserConfig>>(config: T): T;
61
+ declare function defineConfig<T extends RattailUserConfigFn>(config: T): T;
60
62
  declare function clean({ patterns }?: {
61
63
  patterns?: string[];
62
64
  }): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rattail",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "A Vite+ oriented, AI Agent friendly front-end toolchain",
5
5
  "keywords": [
6
6
  "ai-agent",
@@ -104,21 +104,22 @@
104
104
  },
105
105
  "devDependencies": {
106
106
  "@types/node": "^22.20.0",
107
- "@vitest/coverage-istanbul": "^4.1.10",
107
+ "@vitejs/plugin-vue": "6.0.8",
108
+ "@vitest/coverage-istanbul": "4.1.11",
108
109
  "esbuild": "^0.28.1",
109
110
  "jsdom": "^25.0.1",
110
111
  "oxc-minify": "^0.124.0",
111
- "oxfmt": "0.60.0",
112
- "oxlint": "1.75.0",
112
+ "oxfmt": "0.64.0",
113
+ "oxlint": "1.79.0",
113
114
  "tsx": "^4.21.0",
114
- "typescript": "5.3.3",
115
- "vite-plus": "0.2.6",
115
+ "typescript": "5.9.3",
116
+ "vite-plus": "0.3.0",
116
117
  "vitepress": "2.0.0-alpha.17"
117
118
  },
118
119
  "peerDependencies": {
119
- "oxfmt": ">=0.60.0",
120
- "oxlint": ">=1.75.0",
121
- "vite-plus": ">=0.2.6"
120
+ "oxfmt": ">=0.64.0",
121
+ "oxlint": ">=1.79.0",
122
+ "vite-plus": ">=0.3.0"
122
123
  },
123
124
  "peerDependenciesMeta": {
124
125
  "oxfmt": {
@@ -143,6 +144,7 @@
143
144
  "docs:preview": "vitepress preview docs",
144
145
  "format": "vp fmt",
145
146
  "lint": "vp lint --fix",
147
+ "test:types": "tsc --noEmit",
146
148
  "release": "pnpm build && tsx src/cli/bin.ts release",
147
149
  "test:watch": "vp test watch",
148
150
  "test": "vp test run --coverage"