@sidebase/base-config 0.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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +554 -0
  3. package/dist/config.d.mts +189 -0
  4. package/dist/config.d.ts +189 -0
  5. package/dist/config.mjs +46 -0
  6. package/dist/eslint/index.d.mts +55 -0
  7. package/dist/eslint/index.d.ts +55 -0
  8. package/dist/eslint/index.mjs +278 -0
  9. package/dist/prisma/index.d.mts +74 -0
  10. package/dist/prisma/index.d.ts +74 -0
  11. package/dist/prisma/index.mjs +61 -0
  12. package/dist/shared/base-config.CuUhyvQo.d.mts +47 -0
  13. package/dist/shared/base-config.CuUhyvQo.d.ts +47 -0
  14. package/docs/migration.md +764 -0
  15. package/package.json +94 -0
  16. package/presets/base/AGENTS.md +31 -0
  17. package/presets/base/CLAUDE.md +3 -0
  18. package/presets/base/dockerignore +18 -0
  19. package/presets/base/editorconfig +12 -0
  20. package/presets/base/github/workflows/streamctl-upgrade.yml +130 -0
  21. package/presets/base/gitignore +19 -0
  22. package/presets/base/oxlintrc.json +31 -0
  23. package/presets/base/pnpm-workspace.yaml +27 -0
  24. package/presets/base/preset.json +38 -0
  25. package/presets/base/templates/pnpm/only-built-dependency.yml +1 -0
  26. package/presets/base/tsconfig.json +3 -0
  27. package/presets/base/vscode/extensions.json +8 -0
  28. package/presets/base/vscode/settings.json +43 -0
  29. package/presets/config.template.ts +18 -0
  30. package/presets/manifest.json +17 -0
  31. package/presets/nuxt-app/Dockerfile +63 -0
  32. package/presets/nuxt-app/eslint.config.ts +5 -0
  33. package/presets/nuxt-app/github/workflows/ci.yml +66 -0
  34. package/presets/nuxt-app/github/workflows/pr-preview-cleanup.yml +41 -0
  35. package/presets/nuxt-app/preset.json +67 -0
  36. package/presets/nuxt-app/prisma.config.ts +6 -0
  37. package/presets/nuxt-app/templates/ci/e2e-job.yml +39 -0
  38. package/presets/nuxt-app/templates/ci/test-job.yml +13 -0
  39. package/presets/nuxt-app/tsconfig.json +6 -0
  40. package/tsconfig.base.json +19 -0
@@ -0,0 +1,189 @@
1
+ import { C as CreateSidebaseEslintOptions } from './shared/base-config.CuUhyvQo.mjs';
2
+
3
+ /**
4
+ * Version-baseline profile, named for the framework AND its major so two majors can
5
+ * coexist during a migration: the manifest declares one profile per major with its own
6
+ * `detect.majorIs`, and each repo detects the one matching its own Nuxt version.
7
+ *
8
+ * The name MUST match a `versionProfiles` key in the preset chain. The CLI resolves the
9
+ * baseline with `versionProfiles?.[profile] ?? {}`, so a name nothing declares reconciles
10
+ * NOTHING, silently. `scripts/validate-presets.mjs` fails the build on that mismatch.
11
+ */
12
+ type Profile = "nuxt-4";
13
+ /**
14
+ * Optional CI knobs (`config.ci.*`) the nuxt-app preset understands: the job
15
+ * toggles. Keys mirror the manifest's `ci.*` `configKeys`; the consistency test
16
+ * in `test/config.test.ts` proves they stay in lockstep.
17
+ */
18
+ interface NuxtBaseCiConfig {
19
+ /** Include the `pnpm test` job. */
20
+ unitTests?: boolean;
21
+ /** Include the e2e job + postgres service. */
22
+ e2e?: boolean;
23
+ }
24
+ /**
25
+ * Optional runtime version pins (`config.versions.*`). `node` feeds every
26
+ * render (`ci.yml`, the Dockerfile, the upgrade-PR workflow); `pnpm` feeds the
27
+ * Dockerfile only. CI takes its pnpm from `package.json#packageManager`, the
28
+ * single reconciled source, so it is never passed to `pnpm/action-setup`.
29
+ * Defaults come from the version baseline (node 24.13.0, pnpm 10.28.1).
30
+ */
31
+ interface NuxtBaseVersionsConfig {
32
+ /** Node version for CI jobs, the Docker base image, and the upgrade workflow. */
33
+ node?: string;
34
+ /**
35
+ * pnpm version for the Docker global pnpm install only. CI pins pnpm through
36
+ * `package.json#packageManager` instead, so this does not affect any workflow.
37
+ */
38
+ pnpm?: string;
39
+ }
40
+ /**
41
+ * Optional Dockerfile knobs (`config.docker.*`) the nuxt-app preset understands.
42
+ */
43
+ interface NuxtBaseDockerConfig {
44
+ /**
45
+ * Project-owned apt packages for the production stage, ON TOP of the baked-in
46
+ * baseline (`openssl`: the Prisma query engine generated in the build stage
47
+ * dynamically links libssl3, which slim images do not ship).
48
+ */
49
+ aptPackages?: string[];
50
+ /**
51
+ * Raw Dockerfile text injected in the build stage BEFORE `pnpm install`, e.g.
52
+ * a `COPY ./vendor ./vendor` a repo needs present at install time. Lands
53
+ * verbatim; see the trust note below. Global installs must use `npm i -g`
54
+ * (`PNPM_HOME` is not set, so `pnpm add -g` fails to find its bin dir).
55
+ */
56
+ preInstall?: string;
57
+ /**
58
+ * Raw Dockerfile text injected in the build stage BEFORE `COPY . .`, e.g.
59
+ * project `ARG`/`ENV` build-flag pairs. Lands verbatim.
60
+ */
61
+ buildArgs?: string;
62
+ /**
63
+ * The build-stage command block (`RUN pnpm nuxi prepare` / `prisma generate`
64
+ * / `run build`). Defaults to all three; a repo with no Prisma overrides it to
65
+ * drop `prisma generate`. Order-preserving, lands verbatim.
66
+ */
67
+ buildSteps?: string;
68
+ /**
69
+ * Raw Dockerfile text injected in the final stage BEFORE `CMD`, e.g. extra
70
+ * `ENV`, `COPY --from`, or `RUN`. Lands verbatim. Cannot drop the fixed
71
+ * `USER node` switch, which sits below it.
72
+ */
73
+ finalStage?: string;
74
+ /**
75
+ * The final-stage Prisma runtime block (copy the schema, install the CLI for
76
+ * `migrate deploy`). Defaults to that block; set `""` for a repo with no
77
+ * Prisma. The `USER node` switch and the `.output` ownership are FIXED outside
78
+ * this knob, so an override cannot re-root the container. Lands verbatim.
79
+ */
80
+ prismaRuntime?: string;
81
+ /**
82
+ * The `sh -c` argument of the final `CMD`. Defaults to
83
+ * `prisma migrate deploy` then the node server; override e.g. for `db push`
84
+ * or a repo with no Prisma. Lands verbatim.
85
+ */
86
+ startCommand?: string;
87
+ }
88
+ /**
89
+ * Optional automation knobs (`config.automation.*`) the base preset understands:
90
+ * the opt-in upgrade-PR workflow and its runtime version pins. Keys mirror the
91
+ * manifest's `automation.*` `configKeys`; the consistency test in
92
+ * `test/config.test.ts` proves they stay in lockstep.
93
+ */
94
+ interface NuxtBaseAutomationConfig {
95
+ /** Sync the weekly streamctl upgrade-PR workflow (default: off, no workflow lands). */
96
+ upgradePr?: boolean;
97
+ }
98
+ /**
99
+ * Optional supply-chain knobs (`config.security.*`) the base preset understands:
100
+ * the pnpm install cooldown rendered into the managed `pnpm-workspace.yaml`.
101
+ */
102
+ interface NuxtBaseSecurityConfig {
103
+ /**
104
+ * Minutes a version must have been published before pnpm resolves it
105
+ * (`minimumReleaseAge`). Default `"10080"` (7 days); `"0"` disables the cooldown.
106
+ * A STRING because the manifest's `configKeys` has no number type, same as the
107
+ * `versions.*` pins.
108
+ */
109
+ minimumReleaseAge?: string;
110
+ }
111
+ /**
112
+ * Optional pnpm knobs (`config.pnpm.*`) rendered into the managed
113
+ * `pnpm-workspace.yaml`.
114
+ */
115
+ interface NuxtBasePnpmConfig {
116
+ /**
117
+ * Packages allowed to run install lifecycle scripts, ON TOP of the baked-in
118
+ * baseline (`@prisma/client`, `esbuild`, `prisma`). Use this instead of
119
+ * `pnpm approve-builds`, which writes to the managed file and is reverted on
120
+ * the next sync.
121
+ */
122
+ onlyBuiltDependencies?: string[];
123
+ }
124
+ /**
125
+ * The typed `streamctl.config.ts` shape for the `@sidebase/base-config` payload:
126
+ * the CLI-universal fields plus this payload's declared knobs (`ci`, `versions`,
127
+ * `docker`, `automation`, `eslint`) with their real option types. The generic CLI only
128
+ * shape-checks these against the manifest's `configKeys`, so the precise types live
129
+ * here, next to the payload that owns them, and consumers keep a fully typed config.
130
+ */
131
+ interface NuxtBaseConfig {
132
+ /** The payload package this repo syncs from. */
133
+ package: string;
134
+ /** Preset to derive from (validated against the payload's presets). */
135
+ base: string;
136
+ /** Pinned streamctl release the repo tracks (semver). */
137
+ version: string;
138
+ /** Version-allow-list profile. */
139
+ profile: Profile;
140
+ /** Master opt-out for `package.json` version reconciliation. */
141
+ versionSync?: boolean;
142
+ /** Specific allow-list keys this repo opts out of. */
143
+ versionSyncExclude?: string[];
144
+ /** Per-file opt-out from sync. */
145
+ files?: Record<string, "managed" | "off">;
146
+ /** Optional CI job knobs. */
147
+ ci?: NuxtBaseCiConfig;
148
+ /** Optional runtime version pins shared by every render (ci, docker, automation). */
149
+ versions?: NuxtBaseVersionsConfig;
150
+ /** Optional Dockerfile knobs (extra apt packages on top of the baked-in baseline). */
151
+ docker?: NuxtBaseDockerConfig;
152
+ /** Optional automation knobs (opt-in upgrade-PR workflow). */
153
+ automation?: NuxtBaseAutomationConfig;
154
+ /** Optional supply-chain knobs (the pnpm install cooldown). */
155
+ security?: NuxtBaseSecurityConfig;
156
+ /** Optional pnpm knobs (extra build-script allowances). */
157
+ pnpm?: NuxtBasePnpmConfig;
158
+ /** ESLint factory options, typed with the payload's own option surface. */
159
+ eslint?: CreateSidebaseEslintOptions;
160
+ }
161
+ /**
162
+ * Identity helper for a typed `streamctl.config.ts`, the payload analog of the
163
+ * CLI's `defineStreamctlConfig`, adding editor inference for this payload's knobs.
164
+ * Returns the config unchanged; the CLI validates it at load.
165
+ */
166
+ declare function defineNuxtBaseConfig(config: NuxtBaseConfig): NuxtBaseConfig;
167
+ /** Runtime list of every {@link NuxtBaseCiConfig} key. */
168
+ declare const NUXT_BASE_CI_KEYS: string[];
169
+ /** Runtime list of every {@link NuxtBaseVersionsConfig} key. */
170
+ declare const NUXT_BASE_VERSIONS_KEYS: string[];
171
+ /** Runtime list of every {@link NuxtBaseDockerConfig} key. */
172
+ declare const NUXT_BASE_DOCKER_KEYS: string[];
173
+ /** Runtime list of every {@link NuxtBaseAutomationConfig} key. */
174
+ declare const NUXT_BASE_AUTOMATION_KEYS: string[];
175
+ /** Runtime list of every {@link NuxtBaseSecurityConfig} key. */
176
+ declare const NUXT_BASE_SECURITY_KEYS: string[];
177
+ /** Runtime list of every {@link NuxtBasePnpmConfig} key. */
178
+ declare const NUXT_BASE_PNPM_KEYS: string[];
179
+ /**
180
+ * Every payload KNOB dot-path {@link NuxtBaseConfig} declares (the `ci.*` and
181
+ * `automation.*` leaves plus the top-level knobs); excludes the CLI-universal
182
+ * fields. The consistency test asserts this set equals the RESOLVED preset chain's
183
+ * declared `configKeys` (base + nuxt-app), catching drift between the type and the
184
+ * manifest in either direction.
185
+ */
186
+ declare const NUXT_BASE_CONFIG_KEYS: string[];
187
+
188
+ export { NUXT_BASE_AUTOMATION_KEYS, NUXT_BASE_CI_KEYS, NUXT_BASE_CONFIG_KEYS, NUXT_BASE_DOCKER_KEYS, NUXT_BASE_PNPM_KEYS, NUXT_BASE_SECURITY_KEYS, NUXT_BASE_VERSIONS_KEYS, defineNuxtBaseConfig };
189
+ export type { NuxtBaseAutomationConfig, NuxtBaseCiConfig, NuxtBaseConfig, NuxtBaseDockerConfig, NuxtBasePnpmConfig, NuxtBaseSecurityConfig, NuxtBaseVersionsConfig, Profile };
@@ -0,0 +1,189 @@
1
+ import { C as CreateSidebaseEslintOptions } from './shared/base-config.CuUhyvQo.js';
2
+
3
+ /**
4
+ * Version-baseline profile, named for the framework AND its major so two majors can
5
+ * coexist during a migration: the manifest declares one profile per major with its own
6
+ * `detect.majorIs`, and each repo detects the one matching its own Nuxt version.
7
+ *
8
+ * The name MUST match a `versionProfiles` key in the preset chain. The CLI resolves the
9
+ * baseline with `versionProfiles?.[profile] ?? {}`, so a name nothing declares reconciles
10
+ * NOTHING, silently. `scripts/validate-presets.mjs` fails the build on that mismatch.
11
+ */
12
+ type Profile = "nuxt-4";
13
+ /**
14
+ * Optional CI knobs (`config.ci.*`) the nuxt-app preset understands: the job
15
+ * toggles. Keys mirror the manifest's `ci.*` `configKeys`; the consistency test
16
+ * in `test/config.test.ts` proves they stay in lockstep.
17
+ */
18
+ interface NuxtBaseCiConfig {
19
+ /** Include the `pnpm test` job. */
20
+ unitTests?: boolean;
21
+ /** Include the e2e job + postgres service. */
22
+ e2e?: boolean;
23
+ }
24
+ /**
25
+ * Optional runtime version pins (`config.versions.*`). `node` feeds every
26
+ * render (`ci.yml`, the Dockerfile, the upgrade-PR workflow); `pnpm` feeds the
27
+ * Dockerfile only. CI takes its pnpm from `package.json#packageManager`, the
28
+ * single reconciled source, so it is never passed to `pnpm/action-setup`.
29
+ * Defaults come from the version baseline (node 24.13.0, pnpm 10.28.1).
30
+ */
31
+ interface NuxtBaseVersionsConfig {
32
+ /** Node version for CI jobs, the Docker base image, and the upgrade workflow. */
33
+ node?: string;
34
+ /**
35
+ * pnpm version for the Docker global pnpm install only. CI pins pnpm through
36
+ * `package.json#packageManager` instead, so this does not affect any workflow.
37
+ */
38
+ pnpm?: string;
39
+ }
40
+ /**
41
+ * Optional Dockerfile knobs (`config.docker.*`) the nuxt-app preset understands.
42
+ */
43
+ interface NuxtBaseDockerConfig {
44
+ /**
45
+ * Project-owned apt packages for the production stage, ON TOP of the baked-in
46
+ * baseline (`openssl`: the Prisma query engine generated in the build stage
47
+ * dynamically links libssl3, which slim images do not ship).
48
+ */
49
+ aptPackages?: string[];
50
+ /**
51
+ * Raw Dockerfile text injected in the build stage BEFORE `pnpm install`, e.g.
52
+ * a `COPY ./vendor ./vendor` a repo needs present at install time. Lands
53
+ * verbatim; see the trust note below. Global installs must use `npm i -g`
54
+ * (`PNPM_HOME` is not set, so `pnpm add -g` fails to find its bin dir).
55
+ */
56
+ preInstall?: string;
57
+ /**
58
+ * Raw Dockerfile text injected in the build stage BEFORE `COPY . .`, e.g.
59
+ * project `ARG`/`ENV` build-flag pairs. Lands verbatim.
60
+ */
61
+ buildArgs?: string;
62
+ /**
63
+ * The build-stage command block (`RUN pnpm nuxi prepare` / `prisma generate`
64
+ * / `run build`). Defaults to all three; a repo with no Prisma overrides it to
65
+ * drop `prisma generate`. Order-preserving, lands verbatim.
66
+ */
67
+ buildSteps?: string;
68
+ /**
69
+ * Raw Dockerfile text injected in the final stage BEFORE `CMD`, e.g. extra
70
+ * `ENV`, `COPY --from`, or `RUN`. Lands verbatim. Cannot drop the fixed
71
+ * `USER node` switch, which sits below it.
72
+ */
73
+ finalStage?: string;
74
+ /**
75
+ * The final-stage Prisma runtime block (copy the schema, install the CLI for
76
+ * `migrate deploy`). Defaults to that block; set `""` for a repo with no
77
+ * Prisma. The `USER node` switch and the `.output` ownership are FIXED outside
78
+ * this knob, so an override cannot re-root the container. Lands verbatim.
79
+ */
80
+ prismaRuntime?: string;
81
+ /**
82
+ * The `sh -c` argument of the final `CMD`. Defaults to
83
+ * `prisma migrate deploy` then the node server; override e.g. for `db push`
84
+ * or a repo with no Prisma. Lands verbatim.
85
+ */
86
+ startCommand?: string;
87
+ }
88
+ /**
89
+ * Optional automation knobs (`config.automation.*`) the base preset understands:
90
+ * the opt-in upgrade-PR workflow and its runtime version pins. Keys mirror the
91
+ * manifest's `automation.*` `configKeys`; the consistency test in
92
+ * `test/config.test.ts` proves they stay in lockstep.
93
+ */
94
+ interface NuxtBaseAutomationConfig {
95
+ /** Sync the weekly streamctl upgrade-PR workflow (default: off, no workflow lands). */
96
+ upgradePr?: boolean;
97
+ }
98
+ /**
99
+ * Optional supply-chain knobs (`config.security.*`) the base preset understands:
100
+ * the pnpm install cooldown rendered into the managed `pnpm-workspace.yaml`.
101
+ */
102
+ interface NuxtBaseSecurityConfig {
103
+ /**
104
+ * Minutes a version must have been published before pnpm resolves it
105
+ * (`minimumReleaseAge`). Default `"10080"` (7 days); `"0"` disables the cooldown.
106
+ * A STRING because the manifest's `configKeys` has no number type, same as the
107
+ * `versions.*` pins.
108
+ */
109
+ minimumReleaseAge?: string;
110
+ }
111
+ /**
112
+ * Optional pnpm knobs (`config.pnpm.*`) rendered into the managed
113
+ * `pnpm-workspace.yaml`.
114
+ */
115
+ interface NuxtBasePnpmConfig {
116
+ /**
117
+ * Packages allowed to run install lifecycle scripts, ON TOP of the baked-in
118
+ * baseline (`@prisma/client`, `esbuild`, `prisma`). Use this instead of
119
+ * `pnpm approve-builds`, which writes to the managed file and is reverted on
120
+ * the next sync.
121
+ */
122
+ onlyBuiltDependencies?: string[];
123
+ }
124
+ /**
125
+ * The typed `streamctl.config.ts` shape for the `@sidebase/base-config` payload:
126
+ * the CLI-universal fields plus this payload's declared knobs (`ci`, `versions`,
127
+ * `docker`, `automation`, `eslint`) with their real option types. The generic CLI only
128
+ * shape-checks these against the manifest's `configKeys`, so the precise types live
129
+ * here, next to the payload that owns them, and consumers keep a fully typed config.
130
+ */
131
+ interface NuxtBaseConfig {
132
+ /** The payload package this repo syncs from. */
133
+ package: string;
134
+ /** Preset to derive from (validated against the payload's presets). */
135
+ base: string;
136
+ /** Pinned streamctl release the repo tracks (semver). */
137
+ version: string;
138
+ /** Version-allow-list profile. */
139
+ profile: Profile;
140
+ /** Master opt-out for `package.json` version reconciliation. */
141
+ versionSync?: boolean;
142
+ /** Specific allow-list keys this repo opts out of. */
143
+ versionSyncExclude?: string[];
144
+ /** Per-file opt-out from sync. */
145
+ files?: Record<string, "managed" | "off">;
146
+ /** Optional CI job knobs. */
147
+ ci?: NuxtBaseCiConfig;
148
+ /** Optional runtime version pins shared by every render (ci, docker, automation). */
149
+ versions?: NuxtBaseVersionsConfig;
150
+ /** Optional Dockerfile knobs (extra apt packages on top of the baked-in baseline). */
151
+ docker?: NuxtBaseDockerConfig;
152
+ /** Optional automation knobs (opt-in upgrade-PR workflow). */
153
+ automation?: NuxtBaseAutomationConfig;
154
+ /** Optional supply-chain knobs (the pnpm install cooldown). */
155
+ security?: NuxtBaseSecurityConfig;
156
+ /** Optional pnpm knobs (extra build-script allowances). */
157
+ pnpm?: NuxtBasePnpmConfig;
158
+ /** ESLint factory options, typed with the payload's own option surface. */
159
+ eslint?: CreateSidebaseEslintOptions;
160
+ }
161
+ /**
162
+ * Identity helper for a typed `streamctl.config.ts`, the payload analog of the
163
+ * CLI's `defineStreamctlConfig`, adding editor inference for this payload's knobs.
164
+ * Returns the config unchanged; the CLI validates it at load.
165
+ */
166
+ declare function defineNuxtBaseConfig(config: NuxtBaseConfig): NuxtBaseConfig;
167
+ /** Runtime list of every {@link NuxtBaseCiConfig} key. */
168
+ declare const NUXT_BASE_CI_KEYS: string[];
169
+ /** Runtime list of every {@link NuxtBaseVersionsConfig} key. */
170
+ declare const NUXT_BASE_VERSIONS_KEYS: string[];
171
+ /** Runtime list of every {@link NuxtBaseDockerConfig} key. */
172
+ declare const NUXT_BASE_DOCKER_KEYS: string[];
173
+ /** Runtime list of every {@link NuxtBaseAutomationConfig} key. */
174
+ declare const NUXT_BASE_AUTOMATION_KEYS: string[];
175
+ /** Runtime list of every {@link NuxtBaseSecurityConfig} key. */
176
+ declare const NUXT_BASE_SECURITY_KEYS: string[];
177
+ /** Runtime list of every {@link NuxtBasePnpmConfig} key. */
178
+ declare const NUXT_BASE_PNPM_KEYS: string[];
179
+ /**
180
+ * Every payload KNOB dot-path {@link NuxtBaseConfig} declares (the `ci.*` and
181
+ * `automation.*` leaves plus the top-level knobs); excludes the CLI-universal
182
+ * fields. The consistency test asserts this set equals the RESOLVED preset chain's
183
+ * declared `configKeys` (base + nuxt-app), catching drift between the type and the
184
+ * manifest in either direction.
185
+ */
186
+ declare const NUXT_BASE_CONFIG_KEYS: string[];
187
+
188
+ export { NUXT_BASE_AUTOMATION_KEYS, NUXT_BASE_CI_KEYS, NUXT_BASE_CONFIG_KEYS, NUXT_BASE_DOCKER_KEYS, NUXT_BASE_PNPM_KEYS, NUXT_BASE_SECURITY_KEYS, NUXT_BASE_VERSIONS_KEYS, defineNuxtBaseConfig };
189
+ export type { NuxtBaseAutomationConfig, NuxtBaseCiConfig, NuxtBaseConfig, NuxtBaseDockerConfig, NuxtBasePnpmConfig, NuxtBaseSecurityConfig, NuxtBaseVersionsConfig, Profile };
@@ -0,0 +1,46 @@
1
+ function defineNuxtBaseConfig(config) {
2
+ return config;
3
+ }
4
+ function knobKeys(shape) {
5
+ return Object.keys(shape);
6
+ }
7
+ const NUXT_BASE_CI_KEYS = knobKeys({
8
+ unitTests: 0,
9
+ e2e: 0
10
+ });
11
+ const NUXT_BASE_VERSIONS_KEYS = knobKeys({
12
+ node: 0,
13
+ pnpm: 0
14
+ });
15
+ const NUXT_BASE_DOCKER_KEYS = knobKeys({
16
+ aptPackages: 0,
17
+ preInstall: 0,
18
+ buildArgs: 0,
19
+ buildSteps: 0,
20
+ finalStage: 0,
21
+ prismaRuntime: 0,
22
+ startCommand: 0
23
+ });
24
+ const NUXT_BASE_AUTOMATION_KEYS = knobKeys({
25
+ upgradePr: 0
26
+ });
27
+ const NUXT_BASE_SECURITY_KEYS = knobKeys({
28
+ minimumReleaseAge: 0
29
+ });
30
+ const NUXT_BASE_PNPM_KEYS = knobKeys({
31
+ onlyBuiltDependencies: 0
32
+ });
33
+ const NUXT_BASE_TOP_LEVEL_KNOBS = knobKeys({
34
+ eslint: 0
35
+ });
36
+ const NUXT_BASE_CONFIG_KEYS = [
37
+ ...NUXT_BASE_CI_KEYS.map((key) => `ci.${key}`),
38
+ ...NUXT_BASE_VERSIONS_KEYS.map((key) => `versions.${key}`),
39
+ ...NUXT_BASE_DOCKER_KEYS.map((key) => `docker.${key}`),
40
+ ...NUXT_BASE_AUTOMATION_KEYS.map((key) => `automation.${key}`),
41
+ ...NUXT_BASE_SECURITY_KEYS.map((key) => `security.${key}`),
42
+ ...NUXT_BASE_PNPM_KEYS.map((key) => `pnpm.${key}`),
43
+ ...NUXT_BASE_TOP_LEVEL_KNOBS
44
+ ];
45
+
46
+ export { NUXT_BASE_AUTOMATION_KEYS, NUXT_BASE_CI_KEYS, NUXT_BASE_CONFIG_KEYS, NUXT_BASE_DOCKER_KEYS, NUXT_BASE_PNPM_KEYS, NUXT_BASE_SECURITY_KEYS, NUXT_BASE_VERSIONS_KEYS, defineNuxtBaseConfig };
@@ -0,0 +1,55 @@
1
+ import { C as CreateSidebaseEslintOptions } from '../shared/base-config.CuUhyvQo.mjs';
2
+ export { E as ESLINT_OPTION_KEYS } from '../shared/base-config.CuUhyvQo.mjs';
3
+ import antfu, { TypedFlatConfigItem } from '@antfu/eslint-config';
4
+
5
+ /** {@link CreateSidebaseEslintOptions} with all defaults applied + the computed type-aware gate. */
6
+ interface ResolvedEslintOptions {
7
+ zod: "full" | "import-style" | "none";
8
+ /**
9
+ * A non-empty allow-list, or `"error"` (hard ban). An empty allow-list is
10
+ * normalized to `"error"` at resolution, so the rule builder never has to
11
+ * emit `{ allow: [] }`, which no-console's schema rejects.
12
+ */
13
+ console: [string, ...string[]] | "error";
14
+ trpcGuard: boolean;
15
+ prismaImportGuard: boolean;
16
+ typeDefStyle: "interface" | "type";
17
+ autoImportPaths: string[];
18
+ autoImportTypeOnly: string[];
19
+ ignoresTypeAware: string[];
20
+ testFilePattern: string[];
21
+ typeAware: boolean;
22
+ }
23
+ /**
24
+ * Whether type-aware linting is on: gated behind `LINT_TYPEAWARE=true` so the
25
+ * slower type-aware pass stays opt-in (CI/local override).
26
+ */
27
+ declare function isTypeAware(): boolean;
28
+ /** Apply the documented option defaults and resolve the type-aware gate. */
29
+ declare function resolveEslintOptions(options?: CreateSidebaseEslintOptions): ResolvedEslintOptions;
30
+
31
+ /**
32
+ * Build the streamctl custom-rule flat-config layers from resolved options.
33
+ * Returned items are appended to the `@antfu/eslint-config` core by
34
+ * {@link createSidebaseEslint}; exported separately so the option matrix is
35
+ * unit-testable without resolving the full antfu config.
36
+ */
37
+ declare function buildEslintLayers(options: ResolvedEslintOptions): TypedFlatConfigItem[];
38
+
39
+ /**
40
+ * Build the shared `@sidebase` ESLint flat-config: the `@antfu/eslint-config`
41
+ * core (Vue + TypeScript, type-aware gated by `LINT_TYPEAWARE`) plus the
42
+ * org's custom rule layers. Returns the antfu `FlatConfigComposer`, so consumers
43
+ * chain `.append()`/`.override()`:
44
+ *
45
+ * ```ts
46
+ * // eslint.config.ts
47
+ * import { createSidebaseEslint } from "@sidebase/base-config/eslint";
48
+ * export default createSidebaseEslint({ trpcGuard: true })
49
+ * .append({ rules: { "vue/multi-word-component-names": "off" } });
50
+ * ```
51
+ */
52
+ declare function createSidebaseEslint(options?: CreateSidebaseEslintOptions): ReturnType<typeof antfu>;
53
+
54
+ export { CreateSidebaseEslintOptions, buildEslintLayers, createSidebaseEslint, isTypeAware, resolveEslintOptions };
55
+ export type { ResolvedEslintOptions };
@@ -0,0 +1,55 @@
1
+ import { C as CreateSidebaseEslintOptions } from '../shared/base-config.CuUhyvQo.js';
2
+ export { E as ESLINT_OPTION_KEYS } from '../shared/base-config.CuUhyvQo.js';
3
+ import antfu, { TypedFlatConfigItem } from '@antfu/eslint-config';
4
+
5
+ /** {@link CreateSidebaseEslintOptions} with all defaults applied + the computed type-aware gate. */
6
+ interface ResolvedEslintOptions {
7
+ zod: "full" | "import-style" | "none";
8
+ /**
9
+ * A non-empty allow-list, or `"error"` (hard ban). An empty allow-list is
10
+ * normalized to `"error"` at resolution, so the rule builder never has to
11
+ * emit `{ allow: [] }`, which no-console's schema rejects.
12
+ */
13
+ console: [string, ...string[]] | "error";
14
+ trpcGuard: boolean;
15
+ prismaImportGuard: boolean;
16
+ typeDefStyle: "interface" | "type";
17
+ autoImportPaths: string[];
18
+ autoImportTypeOnly: string[];
19
+ ignoresTypeAware: string[];
20
+ testFilePattern: string[];
21
+ typeAware: boolean;
22
+ }
23
+ /**
24
+ * Whether type-aware linting is on: gated behind `LINT_TYPEAWARE=true` so the
25
+ * slower type-aware pass stays opt-in (CI/local override).
26
+ */
27
+ declare function isTypeAware(): boolean;
28
+ /** Apply the documented option defaults and resolve the type-aware gate. */
29
+ declare function resolveEslintOptions(options?: CreateSidebaseEslintOptions): ResolvedEslintOptions;
30
+
31
+ /**
32
+ * Build the streamctl custom-rule flat-config layers from resolved options.
33
+ * Returned items are appended to the `@antfu/eslint-config` core by
34
+ * {@link createSidebaseEslint}; exported separately so the option matrix is
35
+ * unit-testable without resolving the full antfu config.
36
+ */
37
+ declare function buildEslintLayers(options: ResolvedEslintOptions): TypedFlatConfigItem[];
38
+
39
+ /**
40
+ * Build the shared `@sidebase` ESLint flat-config: the `@antfu/eslint-config`
41
+ * core (Vue + TypeScript, type-aware gated by `LINT_TYPEAWARE`) plus the
42
+ * org's custom rule layers. Returns the antfu `FlatConfigComposer`, so consumers
43
+ * chain `.append()`/`.override()`:
44
+ *
45
+ * ```ts
46
+ * // eslint.config.ts
47
+ * import { createSidebaseEslint } from "@sidebase/base-config/eslint";
48
+ * export default createSidebaseEslint({ trpcGuard: true })
49
+ * .append({ rules: { "vue/multi-word-component-names": "off" } });
50
+ * ```
51
+ */
52
+ declare function createSidebaseEslint(options?: CreateSidebaseEslintOptions): ReturnType<typeof antfu>;
53
+
54
+ export { CreateSidebaseEslintOptions, buildEslintLayers, createSidebaseEslint, isTypeAware, resolveEslintOptions };
55
+ export type { ResolvedEslintOptions };