@sidebase/base-config 0.2.1 → 0.3.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 CHANGED
@@ -175,9 +175,9 @@ covers both.
175
175
 
176
176
  `defineNuxtBaseConfig` returns the config unchanged. Its job is typed editor inference
177
177
  for this payload's knobs: completion and type checking on `ci`, `versions`, `docker`,
178
- `automation`, `security`, `pnpm`, `editor`, and the whole `eslint` option surface, plus `profile`
179
- narrowed to the profile names that actually exist. Without it the object is an untyped
180
- literal, so a typo such as `ci: { unitTest: true }` stays silent in your editor.
178
+ `automation`, `security`, `pnpm` and `editor`, plus `profile` narrowed to the profile
179
+ names that actually exist. Without it the object is an untyped literal, so a typo such as
180
+ `ci: { unitTest: true }` stays silent in your editor.
181
181
 
182
182
  The CLI shape-checks the config against the manifest when it loads it, so a sync still
183
183
  works without the helper. The helper is what moves that feedback into your editor.
@@ -390,6 +390,7 @@ minimumReleaseAgeExclude:
390
390
  - "@sidebase/*"
391
391
  onlyBuiltDependencies: # the postinstall-script allowlist
392
392
  - "@prisma/client"
393
+ - "@prisma/engines"
393
394
  - "esbuild"
394
395
  - "prisma"
395
396
  ```
@@ -399,7 +400,7 @@ onlyBuiltDependencies: # the postinstall-script allowlist
399
400
  installs it. It needs pnpm 10.16 or newer and gates *fresh resolution only*, so
400
401
  `pnpm install --frozen-lockfile` replays the lockfile untouched and CI is unaffected.
401
402
 
402
- The pnpm baseline shipped to consumers is 10.28.1 (`presets/*/preset.json`). This repo's
403
+ The pnpm baseline shipped to consumers is 10.34.5 (`presets/*/preset.json`). This repo's
403
404
  own `packageManager` pin tracks separately and is usually newer; the two are independent
404
405
  by design, not drift.
405
406
 
@@ -460,7 +461,7 @@ The `nuxt-app` preset ships a managed `.github/workflows/ci.yml`. Its `lint-type
460
461
  | ---- | ------- | ------ |
461
462
  | `ci.unitTests` | `false` | Add the `test` job (`pnpm test`) |
462
463
  | `ci.e2e` | `false` | Add the `e2e` job, with a health-checked postgres service |
463
- | `ci.aptPackages` | `[]` | System packages `apt-get`-installed in the `test` and `e2e` jobs |
464
+ | `ci.aptPackages` | `[]` | System packages `apt-get`-installed in the `test` and `e2e` jobs and the upgrade validation |
464
465
 
465
466
  `ci.aptPackages` is the CI counterpart to `docker.aptPackages` below: extra system packages
466
467
  on top of what the runner image already carries, for a binary the suite needs and
@@ -498,7 +499,7 @@ out:
498
499
  | `docker.buildSteps` | the build-command block | `nuxi prepare` / `prisma generate` / `run build` |
499
500
  | `docker.finalStage` | final stage, before `CMD` | `""` |
500
501
  | `docker.prismaRuntime` | final stage | copy the schema + install the `migrate deploy` CLI |
501
- | `docker.startCommand` | inside `CMD` | `prisma migrate deploy` then the node server |
502
+ | `docker.startCommand` | shell-form `CMD`, one line | `prisma migrate deploy` then `exec node ...` |
502
503
 
503
504
  A seventh knob is different in kind: a validated version, not raw text.
504
505
 
@@ -517,7 +518,7 @@ export default {
517
518
  preInstall: "COPY ./vendor ./vendor", // vendored dep needed at install time
518
519
  buildSteps: "RUN pnpm nuxi prepare\nRUN pnpm run build", // a repo with no Prisma
519
520
  prismaRuntime: "", // drop Prisma entirely
520
- startCommand: "node .output/server/index.mjs",
521
+ startCommand: "exec node .output/server/index.mjs",
521
522
  },
522
523
  };
523
524
  ```
@@ -540,7 +541,7 @@ three default to `""`.
540
541
 
541
542
  **`prismaRuntime` and `startCommand` are coupled.** Override one and you must override the
542
543
  other. `prismaRuntime` is what installs the Prisma CLI into the final stage, and the
543
- DEFAULT `startCommand` is `npm exec prisma migrate deploy && node ...`. Setting only
544
+ DEFAULT `startCommand` is `npm exec prisma migrate deploy && exec node ...`. Setting only
544
545
  `prismaRuntime: ""` therefore produces an image whose `CMD` invokes a CLI that is no longer
545
546
  installed, and the container fails to start. The example above overrides both, which is why
546
547
  it is safe to copy; a single-knob change is not. Drop the `migrate deploy` half of
@@ -590,47 +591,80 @@ sync. A repo that genuinely needs a different layout should opt the file out
590
591
 
591
592
  The base preset ships `.github/workflows/streamctl-upgrade.yml`, a scheduled workflow
592
593
  that opens a PR when a payload update is available. It is an `enabledBy`-gated managed
593
- file, off by default: it only lands once a repo opts in, and it is inert until the
594
- required token exists.
594
+ file, off by default. It only lands once a repo opts in.
595
595
 
596
596
  Enable it in `streamctl.config.ts`, then `streamctl sync`:
597
597
 
598
598
  ```ts
599
599
  export default {
600
600
  // ...
601
- automation: { upgradePr: true },
601
+ automation: {
602
+ upgradePr: true,
603
+ // allowWorkflowUpdates: true,
604
+ // prTokenSecret: "STREAMCTL_PR_TOKEN",
605
+ },
602
606
  // optional: version pins, default to the payload's baseline. `node` feeds
603
- // ci.yml + the Dockerfile; `pnpm` feeds the Dockerfile only (CI pins pnpm
604
- // via package.json#packageManager):
605
- // versions: { node: "24.13.0", pnpm: "10.28.1" },
607
+ // ci.yml, the Dockerfile and this workflow; `pnpm` feeds the Dockerfile only
608
+ // (CI pins pnpm via package.json#packageManager):
609
+ // versions: { node: "24.21.0", pnpm: "10.34.5" },
606
610
  };
607
611
  ```
608
612
 
609
- Required secrets:
610
-
611
- | Secret | Purpose |
612
- | ------ | ------- |
613
- | `STREAMCTL_PR_TOKEN` | A GitHub App installation token or machine-account PAT used to open the PR. **Not** the default `GITHUB_TOKEN`: a PR opened with `GITHUB_TOKEN` does not trigger `pull_request` workflows, so the repo's own `check` gate would never run on the bot PR. |
614
-
615
- That is the only one, because the payload is public npm, so the install step needs no registry
616
- token. A repo whose *other* dependencies are private must opt this full-owned workflow
617
- out and wire its own auth.
613
+ By default, the workflow uses `GITHUB_TOKEN` and omits changes under
614
+ `.github/workflows/**`. If an update contains workflow changes, it opens a draft PR
615
+ with every other safe change and lists the omitted files and completion commands.
618
616
 
619
- The workflow branches on the CLI exit codes: `check` exit 4 opens a PR; exit 0 stops;
620
- exit 3 (pre-existing drift) opens a drift issue instead. A clean `upgrade` (exit 0)
621
- produces a reconcile PR; a conflicted `upgrade` (exit 2, rolled back) produces a
622
- plan-only PR labelled `needs-interactive-upgrade` for a human to finish with
623
- `streamctl sync --interactive`.
617
+ Set `automation.allowWorkflowUpdates` to `true` to include workflow changes. Add a
618
+ `STREAMCTL_PR_TOKEN` repository secret with `Contents`, `Pull requests`, and
619
+ `Workflows` write access. Change `automation.prTokenSecret` when the secret has another
620
+ name. A fine-grained PAT or GitHub App token works. The built-in `GITHUB_TOKEN` cannot
621
+ receive `Workflows` permission.
624
622
 
625
- > The org bot identity is still being decided. Until the runbook lands, leave the
626
- > workflow disabled. Design only; nothing is enabled anywhere.
623
+ | Knob | Default | Effect |
624
+ | ---- | ------- | ------ |
625
+ | `automation.upgradePr` | `false` | Sync the scheduled upgrade workflow |
626
+ | `automation.allowWorkflowUpdates` | `false` | Include `.github/workflows/**` changes in upgrade PRs |
627
+ | `automation.prTokenSecret` | `"STREAMCTL_PR_TOKEN"` | Secret used when workflow updates are enabled |
628
+ | `automation.prepare` | `"pnpm prisma generate"` | One-line command run before validation |
629
+
630
+ `automation.prepare` generates what `pnpm install` does not, before validation. One line;
631
+ chain with `&&`. Set `""` for a repo without Prisma.
632
+
633
+ The upgrade job runs `streamctl check` and every available lint, typecheck, test, and
634
+ build script before opening a ready PR. PRs created with `GITHUB_TOKEN` do not trigger
635
+ their own `pull_request` workflows, so these inline checks are required. The external
636
+ token allows the new PR to trigger them normally.
637
+
638
+ The workflow handles CLI results as follows:
639
+
640
+ - `check` exit 0: stop without a PR.
641
+ - `check` exit 3: open or update one drift issue.
642
+ - `check` exit 4: attempt the upgrade.
643
+ - `upgrade` exit 0: validate and open a ready PR, or a draft when workflow files were omitted.
644
+ - `upgrade` exit 2: inspect conflicts using the pre-upgrade status.
645
+ - Any other exit: fail the workflow.
646
+
647
+ A conflict is safe to apply when the same path was previously `full` managed and
648
+ `in-sync`. The workflow retries those generated replacements with `--force`. Any new,
649
+ modified, malformed, or structurally conflicting path produces a draft PR instead.
650
+ Workflow changes also produce a draft unless explicitly allowed. Drafts contain every
651
+ safe change, keep conflicting and omitted workflow files at their current content, list
652
+ what remains, and give the commands needed to finish the upgrade. When a malformed or
653
+ structurally invalid file blocks `--force`, the draft only updates the payload version
654
+ and lockfile.
655
+
656
+ Diagnostic JSON stays under the runner's temporary directory. Upgrade branches include
657
+ the target version, so a later release does not overwrite an older open PR.
658
+
659
+ The payload is public npm. A repo with other private dependencies must opt this workflow
660
+ out and provide its own install authentication.
627
661
 
628
662
  ### Action pinning policy
629
663
 
630
664
  Every action in every managed workflow and CI job fragment is pinned by full commit SHA,
631
665
  with the version tag in a trailing comment. Moving tags can be re-pointed, so tags are
632
- never trusted, secrets or not. `test/workflow-pins.test.ts` sweeps all preset
633
- templates and fails on any `uses:` that is not a 40-hex SHA.
666
+ never trusted, secrets or not. `test/payload.test.ts` renders every managed workflow
667
+ and fails on any `uses:` that is not a 40-hex SHA.
634
668
 
635
669
  The shipped pins track `actions/checkout` v6, `actions/setup-node` v6, and
636
670
  `pnpm/action-setup` v6. These majors run on the node24 action runtime, which needs a
package/dist/config.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- import { C as CreateSidebaseEslintOptions } from './shared/base-config.BoberVUk.mjs';
2
-
3
1
  /**
4
2
  * Version-baseline profile, named for the framework and its major so two majors can
5
3
  * coexist during a migration.
@@ -18,8 +16,8 @@ interface NuxtBaseCiConfig {
18
16
  /** Include the e2e job + postgres service. */
19
17
  e2e?: boolean;
20
18
  /**
21
- * Packages apt-installed in the `test` and `e2e` jobs, for a binary the suite needs
22
- * that `ubuntu-latest` lacks. Empty renders the install step inert, not absent.
19
+ * Packages apt-installed in the `test` and `e2e` jobs and the upgrade validation, for
20
+ * a binary the suite needs that `ubuntu-latest` lacks. Empty renders the step inert.
23
21
  *
24
22
  * Package names only: the rendered `run:` line is unquoted so word splitting reaches
25
23
  * apt-get, so every element is metacharacter-checked.
@@ -30,7 +28,7 @@ interface NuxtBaseCiConfig {
30
28
  * Runtime version pins (`config.versions.*`). `node` feeds every render (`ci.yml`,
31
29
  * the Dockerfile, the upgrade workflow); `pnpm` feeds the Dockerfile only, because CI
32
30
  * takes pnpm from `package.json#packageManager`. Defaults come from the version
33
- * baseline (node 24.13.0, pnpm 10.28.1).
31
+ * baseline (node 24.21.0, pnpm 10.34.5).
34
32
  */
35
33
  interface NuxtBaseVersionsConfig {
36
34
  /** Node version for CI jobs, the Docker base image, and the upgrade workflow. */
@@ -86,9 +84,8 @@ interface NuxtBaseDockerConfig {
86
84
  */
87
85
  prismaVersion?: string;
88
86
  /**
89
- * The `sh -c` argument of the final `CMD`. Defaults to
90
- * `prisma migrate deploy` then the node server; override e.g. for `db push`
91
- * or a repo with no Prisma. Lands verbatim.
87
+ * The shell-form final `CMD`, one line. Defaults to `prisma migrate deploy` then
88
+ * `exec node ...`; override e.g. for `db push` or a repo with no Prisma.
92
89
  */
93
90
  startCommand?: string;
94
91
  }
@@ -99,6 +96,12 @@ interface NuxtBaseDockerConfig {
99
96
  interface NuxtBaseAutomationConfig {
100
97
  /** Sync the weekly streamctl upgrade-PR workflow (default: off, no workflow lands). */
101
98
  upgradePr?: boolean;
99
+ /** Let upgrade PRs change GitHub Actions workflows (default: false). */
100
+ allowWorkflowUpdates?: boolean;
101
+ /** Repository secret used when workflow updates are allowed. */
102
+ prTokenSecret?: string;
103
+ /** One-line shell command run before validation (default: `pnpm prisma generate`, `""` skips). */
104
+ prepare?: string;
102
105
  }
103
106
  /**
104
107
  * Supply-chain knobs (`config.security.*`): the pnpm install cooldown rendered into
@@ -119,8 +122,9 @@ interface NuxtBaseSecurityConfig {
119
122
  interface NuxtBasePnpmConfig {
120
123
  /**
121
124
  * Packages allowed to run install lifecycle scripts, on top of the baseline
122
- * (`@prisma/client`, `esbuild`, `prisma`). Use this instead of `pnpm approve-builds`,
123
- * which writes to the managed file and is reverted on the next sync.
125
+ * (`@prisma/client`, `@prisma/engines`, `esbuild`, `prisma`). Use this instead of
126
+ * `pnpm approve-builds`, which writes to the managed file and is reverted on the next
127
+ * sync.
124
128
  */
125
129
  onlyBuiltDependencies?: string[];
126
130
  }
@@ -171,8 +175,6 @@ interface NuxtBaseConfig {
171
175
  pnpm?: NuxtBasePnpmConfig;
172
176
  /** Optional editor knobs (the i18n-ally source language). */
173
177
  editor?: NuxtBaseEditorConfig;
174
- /** ESLint factory options, typed with the payload's own option surface. */
175
- eslint?: CreateSidebaseEslintOptions;
176
178
  }
177
179
  /**
178
180
  * Identity helper giving editor inference for this payload's knobs, the analog of the
package/dist/config.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { C as CreateSidebaseEslintOptions } from './shared/base-config.BoberVUk.js';
2
-
3
1
  /**
4
2
  * Version-baseline profile, named for the framework and its major so two majors can
5
3
  * coexist during a migration.
@@ -18,8 +16,8 @@ interface NuxtBaseCiConfig {
18
16
  /** Include the e2e job + postgres service. */
19
17
  e2e?: boolean;
20
18
  /**
21
- * Packages apt-installed in the `test` and `e2e` jobs, for a binary the suite needs
22
- * that `ubuntu-latest` lacks. Empty renders the install step inert, not absent.
19
+ * Packages apt-installed in the `test` and `e2e` jobs and the upgrade validation, for
20
+ * a binary the suite needs that `ubuntu-latest` lacks. Empty renders the step inert.
23
21
  *
24
22
  * Package names only: the rendered `run:` line is unquoted so word splitting reaches
25
23
  * apt-get, so every element is metacharacter-checked.
@@ -30,7 +28,7 @@ interface NuxtBaseCiConfig {
30
28
  * Runtime version pins (`config.versions.*`). `node` feeds every render (`ci.yml`,
31
29
  * the Dockerfile, the upgrade workflow); `pnpm` feeds the Dockerfile only, because CI
32
30
  * takes pnpm from `package.json#packageManager`. Defaults come from the version
33
- * baseline (node 24.13.0, pnpm 10.28.1).
31
+ * baseline (node 24.21.0, pnpm 10.34.5).
34
32
  */
35
33
  interface NuxtBaseVersionsConfig {
36
34
  /** Node version for CI jobs, the Docker base image, and the upgrade workflow. */
@@ -86,9 +84,8 @@ interface NuxtBaseDockerConfig {
86
84
  */
87
85
  prismaVersion?: string;
88
86
  /**
89
- * The `sh -c` argument of the final `CMD`. Defaults to
90
- * `prisma migrate deploy` then the node server; override e.g. for `db push`
91
- * or a repo with no Prisma. Lands verbatim.
87
+ * The shell-form final `CMD`, one line. Defaults to `prisma migrate deploy` then
88
+ * `exec node ...`; override e.g. for `db push` or a repo with no Prisma.
92
89
  */
93
90
  startCommand?: string;
94
91
  }
@@ -99,6 +96,12 @@ interface NuxtBaseDockerConfig {
99
96
  interface NuxtBaseAutomationConfig {
100
97
  /** Sync the weekly streamctl upgrade-PR workflow (default: off, no workflow lands). */
101
98
  upgradePr?: boolean;
99
+ /** Let upgrade PRs change GitHub Actions workflows (default: false). */
100
+ allowWorkflowUpdates?: boolean;
101
+ /** Repository secret used when workflow updates are allowed. */
102
+ prTokenSecret?: string;
103
+ /** One-line shell command run before validation (default: `pnpm prisma generate`, `""` skips). */
104
+ prepare?: string;
102
105
  }
103
106
  /**
104
107
  * Supply-chain knobs (`config.security.*`): the pnpm install cooldown rendered into
@@ -119,8 +122,9 @@ interface NuxtBaseSecurityConfig {
119
122
  interface NuxtBasePnpmConfig {
120
123
  /**
121
124
  * Packages allowed to run install lifecycle scripts, on top of the baseline
122
- * (`@prisma/client`, `esbuild`, `prisma`). Use this instead of `pnpm approve-builds`,
123
- * which writes to the managed file and is reverted on the next sync.
125
+ * (`@prisma/client`, `@prisma/engines`, `esbuild`, `prisma`). Use this instead of
126
+ * `pnpm approve-builds`, which writes to the managed file and is reverted on the next
127
+ * sync.
124
128
  */
125
129
  onlyBuiltDependencies?: string[];
126
130
  }
@@ -171,8 +175,6 @@ interface NuxtBaseConfig {
171
175
  pnpm?: NuxtBasePnpmConfig;
172
176
  /** Optional editor knobs (the i18n-ally source language). */
173
177
  editor?: NuxtBaseEditorConfig;
174
- /** ESLint factory options, typed with the payload's own option surface. */
175
- eslint?: CreateSidebaseEslintOptions;
176
178
  }
177
179
  /**
178
180
  * Identity helper giving editor inference for this payload's knobs, the analog of the
package/dist/config.mjs CHANGED
@@ -24,7 +24,10 @@ const NUXT_BASE_DOCKER_KEYS = knobKeys({
24
24
  startCommand: 0
25
25
  });
26
26
  const NUXT_BASE_AUTOMATION_KEYS = knobKeys({
27
- upgradePr: 0
27
+ upgradePr: 0,
28
+ allowWorkflowUpdates: 0,
29
+ prTokenSecret: 0,
30
+ prepare: 0
28
31
  });
29
32
  const NUXT_BASE_SECURITY_KEYS = knobKeys({
30
33
  minimumReleaseAge: 0
@@ -35,9 +38,7 @@ const NUXT_BASE_PNPM_KEYS = knobKeys({
35
38
  const NUXT_BASE_EDITOR_KEYS = knobKeys({
36
39
  i18nSourceLanguage: 0
37
40
  });
38
- const NUXT_BASE_TOP_LEVEL_KNOBS = knobKeys({
39
- eslint: 0
40
- });
41
+ const NUXT_BASE_TOP_LEVEL_KNOBS = knobKeys({});
41
42
  const NUXT_BASE_CONFIG_KEYS = [
42
43
  ...NUXT_BASE_CI_KEYS.map((key) => `ci.${key}`),
43
44
  ...NUXT_BASE_VERSIONS_KEYS.map((key) => `versions.${key}`),
@@ -1,7 +1,46 @@
1
- import { C as CreateSidebaseEslintOptions } from '../shared/base-config.BoberVUk.mjs';
2
- export { E as ESLINT_OPTION_KEYS } from '../shared/base-config.BoberVUk.mjs';
3
1
  import antfu, { TypedFlatConfigItem } from '@antfu/eslint-config';
4
2
 
3
+ /** Options for the published ESLint factory (`@sidebase/base-config/eslint`). */
4
+ interface CreateSidebaseEslintOptions {
5
+ /** Zod `.extend()/.merge()/.passthrough()` bans and/or `import * as z` enforcement. Default `"none"` (opt-in). */
6
+ zod?: "full" | "import-style" | "none";
7
+ /** Allow-list of permitted console methods, or a hard error. Default `"error"`. */
8
+ console?: string[] | "error";
9
+ /** Ban `publicProcedure` in `server/trpc/routers/**`. Default `false`. */
10
+ trpcGuard?: boolean;
11
+ /** Restrict `~~/prisma/` client imports on the app side. Default `false`. */
12
+ prismaImportGuard?: boolean;
13
+ /** `ts/consistent-type-definitions`. Default `"interface"`. */
14
+ typeDefStyle?: "interface" | "type";
15
+ /** Paths banned from direct import (Nuxt auto-import). Default `["utils/", "composables/", "~~/shared/types/"]`. */
16
+ autoImportPaths?: string[];
17
+ /**
18
+ * Subset of {@link autoImportPaths} where `import type { ... }` is still allowed
19
+ * (value imports stay banned), for repos that import a path like `composables/`
20
+ * only for its types. Default `[]` (opt-in).
21
+ */
22
+ autoImportTypeOnly?: string[];
23
+ /**
24
+ * Files excluded from antfu's type-aware program (only relevant when
25
+ * type-aware). Default excludes `prisma.config.ts`, `eslint.config.ts`, the
26
+ * root `streamctl.config.ts`, and the legacy `.streamctl` TS files (see
27
+ * `resolveEslintOptions`).
28
+ */
29
+ ignoresTypeAware?: string[];
30
+ /**
31
+ * Globs for test / spec / story files where the `process.env` + auto-import
32
+ * bans are relaxed. Defaults to the standard `.test.`/`.spec.`/
33
+ * `.stories.` `ts`/`tsx` globs (see `resolveEslintOptions`).
34
+ */
35
+ testFilePattern?: string[];
36
+ }
37
+ /**
38
+ * Runtime list of every {@link CreateSidebaseEslintOptions} key. The `satisfies` map
39
+ * keeps it exhaustive: a new option fails to compile until it is listed here, so the
40
+ * validator allow-list cannot drift.
41
+ */
42
+ declare const ESLINT_OPTION_KEYS: string[];
43
+
5
44
  /** {@link CreateSidebaseEslintOptions} with all defaults applied + the computed type-aware gate. */
6
45
  interface ResolvedEslintOptions {
7
46
  zod: "full" | "import-style" | "none";
@@ -48,5 +87,5 @@ declare function buildEslintLayers(options: ResolvedEslintOptions): TypedFlatCon
48
87
  */
49
88
  declare function createSidebaseEslint(options?: CreateSidebaseEslintOptions): ReturnType<typeof antfu>;
50
89
 
51
- export { CreateSidebaseEslintOptions, buildEslintLayers, createSidebaseEslint, isTypeAware, resolveEslintOptions };
52
- export type { ResolvedEslintOptions };
90
+ export { ESLINT_OPTION_KEYS, buildEslintLayers, createSidebaseEslint, isTypeAware, resolveEslintOptions };
91
+ export type { CreateSidebaseEslintOptions, ResolvedEslintOptions };
@@ -1,7 +1,46 @@
1
- import { C as CreateSidebaseEslintOptions } from '../shared/base-config.BoberVUk.js';
2
- export { E as ESLINT_OPTION_KEYS } from '../shared/base-config.BoberVUk.js';
3
1
  import antfu, { TypedFlatConfigItem } from '@antfu/eslint-config';
4
2
 
3
+ /** Options for the published ESLint factory (`@sidebase/base-config/eslint`). */
4
+ interface CreateSidebaseEslintOptions {
5
+ /** Zod `.extend()/.merge()/.passthrough()` bans and/or `import * as z` enforcement. Default `"none"` (opt-in). */
6
+ zod?: "full" | "import-style" | "none";
7
+ /** Allow-list of permitted console methods, or a hard error. Default `"error"`. */
8
+ console?: string[] | "error";
9
+ /** Ban `publicProcedure` in `server/trpc/routers/**`. Default `false`. */
10
+ trpcGuard?: boolean;
11
+ /** Restrict `~~/prisma/` client imports on the app side. Default `false`. */
12
+ prismaImportGuard?: boolean;
13
+ /** `ts/consistent-type-definitions`. Default `"interface"`. */
14
+ typeDefStyle?: "interface" | "type";
15
+ /** Paths banned from direct import (Nuxt auto-import). Default `["utils/", "composables/", "~~/shared/types/"]`. */
16
+ autoImportPaths?: string[];
17
+ /**
18
+ * Subset of {@link autoImportPaths} where `import type { ... }` is still allowed
19
+ * (value imports stay banned), for repos that import a path like `composables/`
20
+ * only for its types. Default `[]` (opt-in).
21
+ */
22
+ autoImportTypeOnly?: string[];
23
+ /**
24
+ * Files excluded from antfu's type-aware program (only relevant when
25
+ * type-aware). Default excludes `prisma.config.ts`, `eslint.config.ts`, the
26
+ * root `streamctl.config.ts`, and the legacy `.streamctl` TS files (see
27
+ * `resolveEslintOptions`).
28
+ */
29
+ ignoresTypeAware?: string[];
30
+ /**
31
+ * Globs for test / spec / story files where the `process.env` + auto-import
32
+ * bans are relaxed. Defaults to the standard `.test.`/`.spec.`/
33
+ * `.stories.` `ts`/`tsx` globs (see `resolveEslintOptions`).
34
+ */
35
+ testFilePattern?: string[];
36
+ }
37
+ /**
38
+ * Runtime list of every {@link CreateSidebaseEslintOptions} key. The `satisfies` map
39
+ * keeps it exhaustive: a new option fails to compile until it is listed here, so the
40
+ * validator allow-list cannot drift.
41
+ */
42
+ declare const ESLINT_OPTION_KEYS: string[];
43
+
5
44
  /** {@link CreateSidebaseEslintOptions} with all defaults applied + the computed type-aware gate. */
6
45
  interface ResolvedEslintOptions {
7
46
  zod: "full" | "import-style" | "none";
@@ -48,5 +87,5 @@ declare function buildEslintLayers(options: ResolvedEslintOptions): TypedFlatCon
48
87
  */
49
88
  declare function createSidebaseEslint(options?: CreateSidebaseEslintOptions): ReturnType<typeof antfu>;
50
89
 
51
- export { CreateSidebaseEslintOptions, buildEslintLayers, createSidebaseEslint, isTypeAware, resolveEslintOptions };
52
- export type { ResolvedEslintOptions };
90
+ export { ESLINT_OPTION_KEYS, buildEslintLayers, createSidebaseEslint, isTypeAware, resolveEslintOptions };
91
+ export type { CreateSidebaseEslintOptions, ResolvedEslintOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sidebase/base-config",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Shared @sidebase base configuration for Nuxt repos: ESLint / Prisma / tsconfig factories on npm, plus the streamctl file-sync preset payload",
5
5
  "keywords": [
6
6
  "sidebase",
@@ -50,9 +50,9 @@
50
50
  }
51
51
  },
52
52
  "engines": {
53
- "node": ">=22"
53
+ "node": ">=24.13"
54
54
  },
55
- "packageManager": "pnpm@10.29.1",
55
+ "packageManager": "pnpm@10.34.5",
56
56
  "scripts": {
57
57
  "build": "unbuild",
58
58
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.test.json",
@@ -60,10 +60,11 @@
60
60
  "lint": "eslint .",
61
61
  "validate:presets": "node scripts/validate-presets.mjs",
62
62
  "e2e:dry-run": "pnpm build && node scripts/e2e-dry-run.mjs",
63
+ "e2e:docker": "pnpm build && node scripts/docker-build-leg.mjs",
63
64
  "prepack": "pnpm build"
64
65
  },
65
66
  "dependencies": {
66
- "@antfu/eslint-config": "^7.4",
67
+ "@antfu/eslint-config": "^9.5.1",
67
68
  "ufo": "^1.6.4"
68
69
  },
69
70
  "peerDependencies": {
@@ -83,14 +84,14 @@
83
84
  "@arethetypeswrong/cli": "^0.18.5",
84
85
  "@prisma/client": "^6.19.3",
85
86
  "@sidebase/streamctl": "^0.3.0",
86
- "@types/node": "^24.0.0",
87
- "eslint": "^10.5.0",
87
+ "@types/node": "^24.13.5",
88
+ "eslint": "^10.10.0",
88
89
  "jiti": "^2.7.0",
89
90
  "prisma": "^6.19.3",
90
- "publint": "^0.3.21",
91
- "typescript": "^6.0.0",
92
- "unbuild": "^3.5.0",
93
- "vitest": "^3.0.0",
94
- "yaml": "^2.9.0"
91
+ "publint": "^0.3.24",
92
+ "typescript": "^6.0.3",
93
+ "unbuild": "^3.6.1",
94
+ "vitest": "^5.0.1",
95
+ "yaml": "^2.9.1"
95
96
  }
96
97
  }
@@ -24,11 +24,6 @@ follow. They are the same across every repo in the fleet.
24
24
  - Use precise types; avoid `any` and unchecked casts. Parse and validate external input at the boundary instead of trusting it downstream.
25
25
  - Handle the error and empty-result paths, not just the happy path.
26
26
 
27
- ## Tests & verification
28
-
29
- - Run the project's typecheck, lint, and test scripts before proposing a change.
30
- - Add or update tests for the behavior you change; don't weaken existing assertions to make a change pass.
31
-
32
27
  ## Commits & pull requests
33
28
 
34
29
  - Use Conventional Commits (`feat:`, `fix:`, `refactor:`, `test:`, `docs:`).