@vvedantb/config 0.13.0 → 0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#335](https://github.com/vvedantb/packages/pull/335) [`86d63c8`](https://github.com/vvedantb/packages/commit/86d63c83d4a927575fb2a7a812895442de095b22) Thanks [@vvedantb](https://github.com/vvedantb)! - `defineWebVitestConfig` takes `dedupe` (`resolve.dedupe`, as `defineWebViteConfig` does). Pass `dedupe: REACT_DEDUPE` when the tests load a workspace package from source: without it that package can load another copy of React than the app's.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#335](https://github.com/vvedantb/packages/pull/335) [`86d63c8`](https://github.com/vvedantb/packages/commit/86d63c83d4a927575fb2a7a812895442de095b22) Thanks [@vvedantb](https://github.com/vvedantb)! - The `vvedantb-*` bins are now small committed files in `bin/` that import the built CLI from `dist`. pnpm links a bin only when its file exists at install: in a workspace `dist` does not exist yet, so no bin was linked and scripts such as `vvedantb-check-shared-ui` failed. The commands and their behaviour do not change.
12
+
13
+ - [#335](https://github.com/vvedantb/packages/pull/335) [`86d63c8`](https://github.com/vvedantb/packages/commit/86d63c83d4a927575fb2a7a812895442de095b22) Thanks [@vvedantb](https://github.com/vvedantb)! - `vvedantb-doctor` accepts the shared workflow from `vvedantb/workflows`. Before, `ci-reusable-workflow` and `ci-commands` failed for a repo that called `vvedantb/workflows/.github/workflows/ci-app.yml`, because the doctor looked only for the `vvedantb/packages` path. A call to the older path still passes.
14
+
3
15
  ## 0.13.0
4
16
 
5
17
  ### Minor Changes
@@ -11,7 +23,7 @@
11
23
  ### Minor Changes
12
24
 
13
25
  - [#318](https://github.com/vvedantb/packages/pull/318) [`5f7ce9d`](https://github.com/vvedantb/packages/commit/5f7ce9d342f04bfd979baacc17fd00930f34bb56) Thanks [@vvedantb](https://github.com/vvedantb)! - Speed up the shared Android APK release path.
14
-
26
+
15
27
  - Add `pickAndroidReleaseVersion` and its helpers (`compareSemver`, `highestSemver`, `publishedVersionNames`). The tests own the version rules. The `release-android-apk.yml` version step now lists tags once, takes published versionNames from tag suffixes and downloads `release.json` only for the highest semver tag, instead of every release.
16
28
  - `vvedantb-android-release` builds `arm64-v8a` only (no `x86_64`), sets `org.gradle.workers.max=8` (replacing Expo's lower default) and `org.gradle.parallel=true`. `org.gradle.configuration-cache` stays off: ephemeral CI runners never reuse the cache, so a cold release build only pays the store cost, and native modules can still be incompatible on release tasks.
17
29
  - Add the config flags `syncAppVersion` (write the version to `app.json` and the root `package.json`) and `versionNameFromAppJson` (use `expo.version` when `VERSION_NAME` is unset) so v-store can use the shared bin. Both default to `false`.
@@ -40,7 +52,7 @@
40
52
  ### Minor Changes
41
53
 
42
54
  - [#292](https://github.com/vvedantb/packages/pull/292) [`dfd2849`](https://github.com/vvedantb/packages/commit/dfd2849e95d2f55e2a697767d3de171aaf1fe763) Thanks [@vvedantb](https://github.com/vvedantb)! - Add a shared-worker Vitest preset and a `vvedantb-doctor` CLI.
43
-
55
+
44
56
  - `sharedWorkerVitestConfig` (and `SHARED_WORKER_SETUP`): an opt-in Vitest preset that lets test files share a worker (`isolate: false`), shuffles file order, and resets mocks, env stubs, global stubs and fake timers after each test. Trades per-file isolation for a faster run; adopt it per repo where tests are independent.
45
57
  - `vvedantb-doctor`: a dependency-free CLI that inspects a repo for drift from the shared CI and tooling house rules (ESLint, Prettier, plain `tsc`, missing `tsrs`, missing `oxlint` dep or script, an older `@vvedantb/config` minor, a CI workflow that does not call the shared reusable workflow). It walks workspace packages, supports `--json` and a per-repo waiver file, makes no network requests, and exits non-zero on drift.
46
58
 
@@ -85,7 +97,7 @@
85
97
  ### Minor Changes
86
98
 
87
99
  - [#225](https://github.com/vvedantb/packages/pull/225) [`4eada13`](https://github.com/vvedantb/packages/commit/4eada137e0ff7871dd1003c9b92e92fa29c1b892) Thanks [@vvedantb](https://github.com/vvedantb)! - Add four shared tooling items used across the apps:
88
-
100
+
89
101
  - `withReleaseSigning`: an Expo config plugin that signs the Android `release` build type from a keystore (environment, else `keystore.properties`), failing a release when a value is missing. `expo/config-plugins` is an optional, lazily resolved peer. Marker is configurable and defaults to a value containing `plugins/withReleaseSigning.js` so build-script greps pass.
90
102
  - `singletons` (and `nativeWindConfig`) on `defineExpoMetroConfig`: rewrites `originModulePath` to the app's `package.json` for the given module heads so a single copy resolves. Backward compatible for apps that omit it.
91
103
  - `vvedantb-android-release`: a config-driven Android release build bin that merges the per-app build scripts into one and keeps the reusable-workflow `GITHUB_OUTPUT` interface (`apk`, `release_json`, `version_name`, `version_code`, `sha256`). Runs on Linux CI.
package/README.md CHANGED
@@ -201,7 +201,7 @@ Each check has a stable id:
201
201
  | `oxlint-dep` | No `oxlint` dependency. |
202
202
  | `oxlint-script` | No `lint` script that runs `oxlint`. |
203
203
  | `config-version` | The `@vvedantb/config` range floor is an older minor than the running `vvedantb-doctor` version. |
204
- | `ci-reusable-workflow` | No workflow calls `vvedantb/packages/.github/workflows/ci-app.yml`. |
204
+ | `ci-reusable-workflow` | No workflow calls `vvedantb/workflows/.github/workflows/ci-app.yml`. A call to the older `vvedantb/packages/.github/workflows/ci-app.yml` also passes. |
205
205
  | `ci-runner` | A job uses a runner the Boat policy does not allow. `boat`, `boat-small` and `boat-xlarge` pass, as do GitHub-hosted labels and `${{ ... }}` expressions. `boat-large` is for Android release builds only: it passes as `runs_on` for `release-android-apk.yml` or `release-gallery-android.yml`, or in a workflow file with `android` in its name, and fails on check jobs such as `ci-app.yml`. An unknown `boat*` label such as `boat-medium` fails. |
206
206
  | `ci-commands` | A line in the `commands` input of the shared workflow is not `lint`, `typecheck` or `test` and has no written reason, or a reason names a command that CI does not run. |
207
207
 
@@ -262,7 +262,7 @@ export default defineConfig({
262
262
 
263
263
  Keys that are not asked for are left out, so `resolve` and `build` appear only when set. `reactPlugins(setup)` and `vendorChunkBuild(tests?)` are exported on their own.
264
264
 
265
- `defineWebVitestConfig` takes `plugins`, `tsconfigPaths`, `alias`, `automaticJsx` (`esbuild: { jsx: "automatic" }`), `include` (default `["src/**/*.test.ts"]`) and `inline` (`test.server.deps.inline`). It always sets `test.environment: "node"`. Pass the result to `defineConfig` from `vitest/config`.
265
+ `defineWebVitestConfig` takes `plugins`, `tsconfigPaths`, `alias`, `automaticJsx` (`esbuild: { jsx: "automatic" }`), `include` (default `["src/**/*.test.ts"]`), `inline` (`test.server.deps.inline`) and `dedupe` (`resolve.dedupe`). Pass `dedupe: REACT_DEDUPE` when the tests load a workspace package from source (`workspace:*` with `inline`): without it that package can load another copy of React than the app's, and hooks fail. It always sets `test.environment: "node"`. Pass the result to `defineConfig` from `vitest/config`.
266
266
 
267
267
  ### Shared-worker Vitest preset (opt-in, faster)
268
268
 
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/android-release-cli.js";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/check-asar-cli.js";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/check-no-source-text-cli.js";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/check-shared-ui-cli.js";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/clerk-allow-cli.js";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/cli.js";
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/doctor-cli.js";
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/cli.js CHANGED
File without changes
File without changes
package/dist/doctor.js CHANGED
@@ -303,7 +303,14 @@ export function checkConfigVersion(repo, runningVersion) {
303
303
  }
304
304
  return result("config-version", "@vvedantb/config is current to the running minor", details);
305
305
  }
306
- const CI_WORKFLOW_REF = "vvedantb/packages/.github/workflows/ci-app.yml";
306
+ /** Where the shared ci-app.yml lives. A repo may call either one; the first is the one to use from now on. */
307
+ const CI_WORKFLOW_REFS = [
308
+ "vvedantb/workflows/.github/workflows/ci-app.yml",
309
+ "vvedantb/packages/.github/workflows/ci-app.yml",
310
+ ];
311
+ function callsSharedCi(text) {
312
+ return CI_WORKFLOW_REFS.some((ref) => text.includes(ref));
313
+ }
307
314
  export function checkCiReusableWorkflow(repo) {
308
315
  const dir = join(repo.root, ".github", "workflows");
309
316
  if (!existsSync(dir)) {
@@ -314,14 +321,14 @@ export function checkCiReusableWorkflow(repo) {
314
321
  if (!/\.ya?ml$/.test(name))
315
322
  continue;
316
323
  try {
317
- if (readFileSync(join(dir, name), "utf8").includes(CI_WORKFLOW_REF))
324
+ if (callsSharedCi(readFileSync(join(dir, name), "utf8")))
318
325
  found = true;
319
326
  }
320
327
  catch {
321
328
  // Unreadable workflow file: ignore and keep scanning.
322
329
  }
323
330
  }
324
- const details = found ? [] : [`no workflow calls ${CI_WORKFLOW_REF}`];
331
+ const details = found ? [] : [`no workflow calls ${CI_WORKFLOW_REFS[0]}`];
325
332
  return result("ci-reusable-workflow", "CI calls the shared ci-app.yml workflow", details);
326
333
  }
327
334
  function workflowFiles(root) {
@@ -433,7 +440,7 @@ export function checkCiRunner(repo) {
433
440
  export function ciCommands(repo) {
434
441
  const found = [];
435
442
  for (const file of workflowFiles(repo.root)) {
436
- if (!file.text.includes(CI_WORKFLOW_REF))
443
+ if (!callsSharedCi(file.text))
437
444
  continue;
438
445
  let blockIndent = -1;
439
446
  for (const line of file.text.split(/\r?\n/)) {
package/dist/vite.d.ts CHANGED
@@ -101,6 +101,12 @@ export interface WebVitestOptions extends PathOptions {
101
101
  include?: string[];
102
102
  /** Packages Vitest transforms instead of loading from node_modules (`test.server.deps.inline`). */
103
103
  inline?: string[];
104
+ /**
105
+ * `resolve.dedupe`, as given. See `REACT_DEDUPE`. Set it when the tests load a
106
+ * workspace package from source: without it that package can load another copy
107
+ * of React than the app's.
108
+ */
109
+ dedupe?: readonly string[];
104
110
  }
105
111
  export interface WebVitestConfig {
106
112
  plugins?: VitePluginOption[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vvedantb/config",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared tsconfig bases, oxlint base, Vite, Vitest, Babel and Metro presets, a WXT preset and host-permission helper for Chrome extensions, pinned tool versions, a sync CLI for Claude commands, CLAUDE.md, Cursor environment and Convex tsconfig, a packaged Electron app.asar module check, a shared header and footer check, a no-source-text-in-tests check, shared oxlint JS plugins and a CLI that adds an extension to Clerk's allowed origins.",
6
6
  "type": "module",
@@ -14,13 +14,13 @@
14
14
  "directory": "packages/config"
15
15
  },
16
16
  "bin": {
17
- "vvedantb-config": "./dist/cli.js",
18
- "vvedantb-check-asar": "./dist/check-asar-cli.js",
19
- "vvedantb-clerk-allow": "./dist/clerk-allow-cli.js",
20
- "vvedantb-android-release": "./dist/android-release-cli.js",
21
- "vvedantb-check-shared-ui": "./dist/check-shared-ui-cli.js",
22
- "vvedantb-check-no-source-text": "./dist/check-no-source-text-cli.js",
23
- "vvedantb-doctor": "./dist/doctor-cli.js"
17
+ "vvedantb-config": "./bin/vvedantb-config.js",
18
+ "vvedantb-check-asar": "./bin/vvedantb-check-asar.js",
19
+ "vvedantb-clerk-allow": "./bin/vvedantb-clerk-allow.js",
20
+ "vvedantb-android-release": "./bin/vvedantb-android-release.js",
21
+ "vvedantb-check-shared-ui": "./bin/vvedantb-check-shared-ui.js",
22
+ "vvedantb-check-no-source-text": "./bin/vvedantb-check-no-source-text.js",
23
+ "vvedantb-doctor": "./bin/vvedantb-doctor.js"
24
24
  },
25
25
  "exports": {
26
26
  ".": {
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "types": "./dist/index.d.ts",
48
48
  "files": [
49
+ "bin",
49
50
  "dist",
50
51
  "files",
51
52
  "tsconfig",
@@ -76,8 +77,9 @@
76
77
  "esbuild": "0.28.2",
77
78
  "eslint-plugin-react-you-might-not-need-an-effect": "1.0.2",
78
79
  "@vitejs/plugin-react": "^6.1.2",
80
+ "happy-dom": "18.0.1",
79
81
  "oxlint": "^1.80.0",
80
- "typescript": "^5.9.0",
82
+ "typescript": "7.0.2",
81
83
  "vite": "^8.3.4",
82
84
  "vitest": "^3.2.0"
83
85
  },