@rexezuge/tooling 1.12.0 → 1.14.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/README.md +149 -18
- package/dist/eslint-manifest.d.ts +25 -0
- package/dist/eslint-manifest.d.ts.map +1 -0
- package/dist/eslint-manifest.js +1 -0
- package/dist/eslint-manifest.js.map +7 -0
- package/dist/eslint-options.d.ts +54 -0
- package/dist/eslint-options.d.ts.map +1 -0
- package/dist/eslint-options.js +0 -0
- package/dist/eslint-options.js.map +7 -0
- package/dist/eslint-strict.d.ts +45 -0
- package/dist/eslint-strict.d.ts.map +1 -0
- package/dist/eslint-strict.js +1 -0
- package/dist/eslint-strict.js.map +7 -0
- package/dist/eslint.d.ts +2 -36
- package/dist/eslint.d.ts.map +1 -1
- package/dist/eslint.js +1 -1
- package/dist/eslint.js.map +3 -3
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/manifest-validate.d.ts +14 -0
- package/dist/manifest-validate.d.ts.map +1 -0
- package/dist/manifest-validate.js +1 -0
- package/dist/manifest-validate.js.map +7 -0
- package/dist/manifest.d.ts +159 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +3 -0
- package/dist/manifest.js.map +7 -0
- package/dist/pages-proxy.d.ts +2 -0
- package/dist/pages-proxy.d.ts.map +1 -0
- package/dist/pages-proxy.js +1 -0
- package/dist/pages-proxy.js.map +7 -0
- package/dist/plugin-option.d.ts +15 -0
- package/dist/plugin-option.d.ts.map +1 -0
- package/dist/plugin-option.js +1 -0
- package/dist/plugin-option.js.map +7 -0
- package/dist/scripts/check-god-files.d.ts.map +1 -1
- package/dist/scripts/check-god-files.js +2 -2
- package/dist/scripts/check-god-files.js.map +3 -3
- package/dist/scripts/ensure-spa-shell-stub.d.ts +4 -2
- package/dist/scripts/ensure-spa-shell-stub.d.ts.map +1 -1
- package/dist/scripts/ensure-spa-shell-stub.js +1 -2
- package/dist/scripts/ensure-spa-shell-stub.js.map +3 -3
- package/dist/scripts/init-secrets.d.ts +1 -2
- package/dist/scripts/init-secrets.d.ts.map +1 -1
- package/dist/scripts/init-secrets.js +2 -3
- package/dist/scripts/init-secrets.js.map +3 -3
- package/dist/scripts/migrations-lock.d.ts +6 -2
- package/dist/scripts/migrations-lock.d.ts.map +1 -1
- package/dist/scripts/migrations-lock.js +1 -2
- package/dist/scripts/migrations-lock.js.map +3 -3
- package/dist/scripts/prepare-wrangler-config.d.ts +6 -2
- package/dist/scripts/prepare-wrangler-config.d.ts.map +1 -1
- package/dist/scripts/prepare-wrangler-config.js +1 -2
- package/dist/scripts/prepare-wrangler-config.js.map +3 -3
- package/dist/scripts/validate-locales.d.ts +20 -2
- package/dist/scripts/validate-locales.d.ts.map +1 -1
- package/dist/scripts/validate-locales.js +5 -5
- package/dist/scripts/validate-locales.js.map +3 -3
- package/dist/scripts/verify-spa-shell.d.ts +7 -2
- package/dist/scripts/verify-spa-shell.d.ts.map +1 -1
- package/dist/scripts/verify-spa-shell.js +1 -2
- package/dist/scripts/verify-spa-shell.js.map +3 -3
- package/dist/test/mocks/cloudflare-workers.d.ts +6 -103
- package/dist/test/mocks/cloudflare-workers.d.ts.map +1 -1
- package/dist/test/mocks/cloudflare-workers.js +1 -1
- package/dist/test/mocks/cloudflare-workers.js.map +3 -3
- package/dist/vite.d.ts +2 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +3 -3
- package/dist/vite.js.map +3 -3
- package/dist/vitest-aliases.d.ts +3 -0
- package/dist/vitest-aliases.d.ts.map +1 -1
- package/dist/vitest-aliases.js +1 -1
- package/dist/vitest-aliases.js.map +3 -3
- package/dist/vitest-integration.d.ts +3 -2
- package/dist/vitest-integration.d.ts.map +1 -1
- package/dist/vitest-integration.js +1 -1
- package/dist/vitest-integration.js.map +3 -3
- package/dist/vitest-repo.d.ts +5 -3
- package/dist/vitest-repo.d.ts.map +1 -1
- package/dist/vitest-repo.js +1 -1
- package/dist/vitest-repo.js.map +3 -3
- package/dist/vitest-web.d.ts +3 -2
- package/dist/vitest-web.d.ts.map +1 -1
- package/dist/vitest-web.js +1 -1
- package/dist/vitest-web.js.map +3 -3
- package/dist/vitest.d.ts +5 -3
- package/dist/vitest.d.ts.map +1 -1
- package/dist/vitest.js +1 -1
- package/dist/vitest.js.map +3 -3
- package/package.json +14 -3
- package/presets/prettier.d.mts +4 -0
- package/presets/prettier.mjs +16 -0
- package/presets/tsconfig/base.json +19 -0
- package/presets/tsconfig/web.json +10 -0
- package/presets/tsconfig/worker.json +9 -0
- package/schema/manifest.schema.json +105 -0
- package/src/eslint-manifest.ts +71 -0
- package/src/eslint-options.ts +54 -0
- package/src/eslint-strict.test.ts +106 -0
- package/src/eslint-strict.ts +191 -0
- package/src/eslint.ts +18 -41
- package/src/index.ts +15 -2
- package/src/manifest-validate.ts +202 -0
- package/src/manifest.test.ts +228 -0
- package/src/manifest.ts +194 -0
- package/src/pages-proxy.test.ts +8 -0
- package/src/pages-proxy.ts +13 -0
- package/src/plugin-option.test.ts +13 -0
- package/src/plugin-option.ts +18 -0
- package/src/presets.test.ts +63 -0
- package/src/scripts/check-god-files.ts +3 -0
- package/src/scripts/ensure-spa-shell-stub.ts +18 -10
- package/src/scripts/entrypoints.test.ts +55 -0
- package/src/scripts/init-secrets.ts +8 -6
- package/src/scripts/migrations-lock.ts +22 -17
- package/src/scripts/prepare-wrangler-config.ts +26 -14
- package/src/scripts/validate-locales.ts +39 -17
- package/src/scripts/verify-spa-shell.ts +21 -20
- package/src/test/mocks/cloudflare-workers.ts +6 -113
- package/src/vite.ts +6 -3
- package/src/vitest-aliases.test.ts +23 -0
- package/src/vitest-aliases.ts +22 -1
- package/src/vitest-factories.test.ts +30 -1
- package/src/vitest-integration.ts +5 -3
- package/src/vitest-repo.ts +10 -5
- package/src/vitest-web.ts +5 -3
- package/src/vitest.ts +10 -5
package/src/vitest-web.ts
CHANGED
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
* packages, so web tests reach shared logic the same way backend tests do.
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
import { defineConfig
|
|
42
|
+
import { defineConfig } from 'vitest/config';
|
|
43
|
+
import { asVitePlugins } from './plugin-option.ts';
|
|
44
|
+
import type { PluginOption } from './plugin-option.ts';
|
|
43
45
|
import { fileURLToPath } from 'node:url';
|
|
44
46
|
import { DEFAULT_CLOUDFLARE_MOCKS, DEFAULT_WORKSPACE_PACKAGES, KIT_NO_EXTERNAL, workspaceAliases } from './vitest-aliases.ts';
|
|
45
47
|
import type { VitestAlias } from './vitest-aliases.ts';
|
|
@@ -68,7 +70,7 @@ export interface WebVitestConfigOptions {
|
|
|
68
70
|
* by the consumer rather than imported here, because the kit must stay
|
|
69
71
|
* zero-dependency and the plugin belongs to the app, not the harness.
|
|
70
72
|
*/
|
|
71
|
-
readonly plugins?: readonly
|
|
73
|
+
readonly plugins?: readonly PluginOption[];
|
|
72
74
|
/**
|
|
73
75
|
* Extra resolver entries, applied after the canonical ones.
|
|
74
76
|
*/
|
|
@@ -163,7 +165,7 @@ export function defineWebVitestConfig(options: WebVitestConfigOptions = {}): Ret
|
|
|
163
165
|
];
|
|
164
166
|
|
|
165
167
|
return defineConfig({
|
|
166
|
-
...(options.plugins !== undefined && { plugins:
|
|
168
|
+
...(options.plugins !== undefined && { plugins: asVitePlugins(options.plugins) }),
|
|
167
169
|
resolve: { alias: aliases, noExternal: [...KIT_NO_EXTERNAL, ...(options.noExternal ?? [])] },
|
|
168
170
|
test: {
|
|
169
171
|
globals: true,
|
package/src/vitest.ts
CHANGED
|
@@ -33,7 +33,10 @@
|
|
|
33
33
|
* resolver that bundles the worker).
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
import { defineConfig
|
|
36
|
+
import { defineConfig } from 'vitest/config';
|
|
37
|
+
import { asVitePlugins } from './plugin-option.ts';
|
|
38
|
+
import type { PluginOption } from './plugin-option.ts';
|
|
39
|
+
import { manifestCoverageThresholds } from './manifest.ts';
|
|
37
40
|
import { DEFAULT_CLOUDFLARE_MOCKS, DEFAULT_WORKSPACE_PACKAGES, KIT_DEDUPE, KIT_NO_EXTERNAL, workspaceAliases } from './vitest-aliases.ts';
|
|
38
41
|
import type { VitestAlias } from './vitest-aliases.ts';
|
|
39
42
|
|
|
@@ -115,7 +118,7 @@ export interface UnitVitestConfigOptions {
|
|
|
115
118
|
* Vite plugins for the suite (rare on the backend half; the SPA half passes
|
|
116
119
|
* `react()` here).
|
|
117
120
|
*/
|
|
118
|
-
readonly plugins?: readonly
|
|
121
|
+
readonly plugins?: readonly PluginOption[];
|
|
119
122
|
/**
|
|
120
123
|
* Setup files run before each test file (e.g. AWS's floci guard, Meow's
|
|
121
124
|
* backend/web setups).
|
|
@@ -147,7 +150,8 @@ export interface UnitVitestConfigOptions {
|
|
|
147
150
|
*/
|
|
148
151
|
readonly includeIndexBarrels?: boolean;
|
|
149
152
|
/**
|
|
150
|
-
* Coverage floors.
|
|
153
|
+
* Coverage floors. Defaults to the manifest's `quality.coverage` (`.rexezuge.jsonc`
|
|
154
|
+
* at `root`); without one, no floor.
|
|
151
155
|
*/
|
|
152
156
|
readonly thresholds?: CoverageThresholds;
|
|
153
157
|
/**
|
|
@@ -220,6 +224,7 @@ function coverageExcludeFor(options: { coverageExclude?: readonly string[]; incl
|
|
|
220
224
|
*/
|
|
221
225
|
export function defineUnitVitestConfig(options: UnitVitestConfigOptions = {}): ReturnType<typeof defineConfig> {
|
|
222
226
|
const root = options.root ?? new URL('.', import.meta.url).href;
|
|
227
|
+
const thresholds = options.thresholds ?? manifestCoverageThresholds(root);
|
|
223
228
|
const coverageInclude = options.coverageInclude ?? ['apps/api/src/**/*.ts', 'apps/background/src/**/*.ts', 'packages/**/src/**/*.ts'];
|
|
224
229
|
const coverageExclude = coverageExcludeFor(options);
|
|
225
230
|
const baseAliases = workspaceAliases({
|
|
@@ -236,7 +241,7 @@ export function defineUnitVitestConfig(options: UnitVitestConfigOptions = {}): R
|
|
|
236
241
|
];
|
|
237
242
|
|
|
238
243
|
return defineConfig({
|
|
239
|
-
...(options.plugins !== undefined && { plugins:
|
|
244
|
+
...(options.plugins !== undefined && { plugins: asVitePlugins(options.plugins) }),
|
|
240
245
|
resolve: {
|
|
241
246
|
alias: aliases,
|
|
242
247
|
noExternal: [...KIT_NO_EXTERNAL, ...(options.noExternal ?? [])],
|
|
@@ -278,7 +283,7 @@ export function defineUnitVitestConfig(options: UnitVitestConfigOptions = {}): R
|
|
|
278
283
|
reportsDirectory: options.reportsDirectory ?? './coverage',
|
|
279
284
|
include: [...coverageInclude],
|
|
280
285
|
exclude: coverageExclude,
|
|
281
|
-
...(
|
|
286
|
+
...(thresholds !== undefined && { thresholds: { ...thresholds } }),
|
|
282
287
|
},
|
|
283
288
|
},
|
|
284
289
|
});
|