@codedrifters/configulator 0.0.308 → 0.0.310
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/lib/index.d.mts +22 -3
- package/lib/index.d.ts +22 -3
- package/lib/index.js +51 -2
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +51 -2
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -10281,9 +10281,22 @@ interface StarlightEditLink {
|
|
|
10281
10281
|
readonly baseUrl: string;
|
|
10282
10282
|
}
|
|
10283
10283
|
/**
|
|
10284
|
-
* Sidebar item accepted by Starlight's `sidebar` config.
|
|
10285
|
-
*
|
|
10286
|
-
*
|
|
10284
|
+
* Sidebar item accepted by Starlight's `sidebar` config.
|
|
10285
|
+
*
|
|
10286
|
+
* Covers the shapes Starlight 0.39+ accepts:
|
|
10287
|
+
* - link (`{ label, link, badge? }`)
|
|
10288
|
+
* - group with nested items (`{ label, collapsed?, items }`)
|
|
10289
|
+
* - bare autogenerated entry, nested inside a group's `items` array
|
|
10290
|
+
* (`{ autogenerate: { directory, collapsed? } }`)
|
|
10291
|
+
* - internal slug reference (`{ label, slug }`)
|
|
10292
|
+
*
|
|
10293
|
+
* Plus one legacy shape kept for one deprecation cycle:
|
|
10294
|
+
* - top-level autogenerated group (`{ label, collapsed?, autogenerate }`).
|
|
10295
|
+
* Starlight v0.39.0 removed runtime support for this shape; the
|
|
10296
|
+
* `StarlightProject` emitter translates it to the nested form
|
|
10297
|
+
* `{ label, collapsed?, items: [{ autogenerate }] }` before writing
|
|
10298
|
+
* `astro.config.mjs`. Migrate to the nested form directly — this
|
|
10299
|
+
* variant will be removed in a future release.
|
|
10287
10300
|
*/
|
|
10288
10301
|
type StarlightSidebarItem = {
|
|
10289
10302
|
readonly label: string;
|
|
@@ -10297,6 +10310,12 @@ type StarlightSidebarItem = {
|
|
|
10297
10310
|
readonly collapsed?: boolean;
|
|
10298
10311
|
readonly items: ReadonlyArray<StarlightSidebarItem>;
|
|
10299
10312
|
} | {
|
|
10313
|
+
readonly autogenerate: {
|
|
10314
|
+
readonly directory: string;
|
|
10315
|
+
readonly collapsed?: boolean;
|
|
10316
|
+
};
|
|
10317
|
+
} | {
|
|
10318
|
+
/** @deprecated Use `{ label, items: [{ autogenerate }] }` instead. Translated by the emitter for one cycle. */
|
|
10300
10319
|
readonly label: string;
|
|
10301
10320
|
readonly collapsed?: boolean;
|
|
10302
10321
|
readonly autogenerate: {
|
package/lib/index.d.ts
CHANGED
|
@@ -10330,9 +10330,22 @@ interface StarlightEditLink {
|
|
|
10330
10330
|
readonly baseUrl: string;
|
|
10331
10331
|
}
|
|
10332
10332
|
/**
|
|
10333
|
-
* Sidebar item accepted by Starlight's `sidebar` config.
|
|
10334
|
-
*
|
|
10335
|
-
*
|
|
10333
|
+
* Sidebar item accepted by Starlight's `sidebar` config.
|
|
10334
|
+
*
|
|
10335
|
+
* Covers the shapes Starlight 0.39+ accepts:
|
|
10336
|
+
* - link (`{ label, link, badge? }`)
|
|
10337
|
+
* - group with nested items (`{ label, collapsed?, items }`)
|
|
10338
|
+
* - bare autogenerated entry, nested inside a group's `items` array
|
|
10339
|
+
* (`{ autogenerate: { directory, collapsed? } }`)
|
|
10340
|
+
* - internal slug reference (`{ label, slug }`)
|
|
10341
|
+
*
|
|
10342
|
+
* Plus one legacy shape kept for one deprecation cycle:
|
|
10343
|
+
* - top-level autogenerated group (`{ label, collapsed?, autogenerate }`).
|
|
10344
|
+
* Starlight v0.39.0 removed runtime support for this shape; the
|
|
10345
|
+
* `StarlightProject` emitter translates it to the nested form
|
|
10346
|
+
* `{ label, collapsed?, items: [{ autogenerate }] }` before writing
|
|
10347
|
+
* `astro.config.mjs`. Migrate to the nested form directly — this
|
|
10348
|
+
* variant will be removed in a future release.
|
|
10336
10349
|
*/
|
|
10337
10350
|
type StarlightSidebarItem = {
|
|
10338
10351
|
readonly label: string;
|
|
@@ -10346,6 +10359,12 @@ type StarlightSidebarItem = {
|
|
|
10346
10359
|
readonly collapsed?: boolean;
|
|
10347
10360
|
readonly items: ReadonlyArray<StarlightSidebarItem>;
|
|
10348
10361
|
} | {
|
|
10362
|
+
readonly autogenerate: {
|
|
10363
|
+
readonly directory: string;
|
|
10364
|
+
readonly collapsed?: boolean;
|
|
10365
|
+
};
|
|
10366
|
+
} | {
|
|
10367
|
+
/** @deprecated Use `{ label, items: [{ autogenerate }] }` instead. Translated by the emitter for one cycle. */
|
|
10349
10368
|
readonly label: string;
|
|
10350
10369
|
readonly collapsed?: boolean;
|
|
10351
10370
|
readonly autogenerate: {
|
package/lib/index.js
CHANGED
|
@@ -35334,6 +35334,15 @@ var ReactViteSiteProject = class extends TypeScriptProject {
|
|
|
35334
35334
|
this.tsconfig?.file.addOverride("compilerOptions.noEmit", true);
|
|
35335
35335
|
this.tsconfig?.file.addOverride("compilerOptions.skipLibCheck", true);
|
|
35336
35336
|
this.tsconfig?.file.addOverride("compilerOptions.strict", true);
|
|
35337
|
+
this.tsconfig?.file.addOverride(
|
|
35338
|
+
"compilerOptions.noUncheckedIndexedAccess",
|
|
35339
|
+
true
|
|
35340
|
+
);
|
|
35341
|
+
this.tsconfig?.file.addOverride("compilerOptions.noImplicitOverride", true);
|
|
35342
|
+
this.tsconfig?.file.addOverride(
|
|
35343
|
+
"compilerOptions.exactOptionalPropertyTypes",
|
|
35344
|
+
true
|
|
35345
|
+
);
|
|
35337
35346
|
this.tsconfig?.file.addOverride("compilerOptions.resolveJsonModule", true);
|
|
35338
35347
|
this.tsconfig?.file.addOverride("compilerOptions.declaration", false);
|
|
35339
35348
|
this.tsconfig?.file.addOverride("compilerOptions.paths", {
|
|
@@ -35369,6 +35378,19 @@ export default defineConfig({
|
|
|
35369
35378
|
plugins: [tailwindcss(), react()],
|
|
35370
35379
|
resolve: { alias: { '@': path.resolve(__dirname, 'src') } },
|
|
35371
35380
|
});
|
|
35381
|
+
`
|
|
35382
|
+
});
|
|
35383
|
+
new import_projen25.SampleFile(this, "src/vite-env.d.ts", {
|
|
35384
|
+
contents: `/// <reference types="vite/client" />
|
|
35385
|
+
|
|
35386
|
+
interface ImportMetaEnv {
|
|
35387
|
+
// Declare your VITE_* env vars here, e.g.
|
|
35388
|
+
// readonly VITE_API_BASE_URL: string;
|
|
35389
|
+
}
|
|
35390
|
+
|
|
35391
|
+
interface ImportMeta {
|
|
35392
|
+
readonly env: ImportMetaEnv;
|
|
35393
|
+
}
|
|
35372
35394
|
`
|
|
35373
35395
|
});
|
|
35374
35396
|
if (options.testRunner !== TestRunner.JEST) {
|
|
@@ -35424,11 +35446,13 @@ export default mergeConfig(
|
|
|
35424
35446
|
"@types/react",
|
|
35425
35447
|
"@types/react-dom",
|
|
35426
35448
|
"eslint-plugin-react",
|
|
35427
|
-
"eslint-plugin-react-hooks"
|
|
35449
|
+
"eslint-plugin-react-hooks",
|
|
35450
|
+
"eslint-plugin-jsx-a11y"
|
|
35428
35451
|
);
|
|
35429
35452
|
this.eslint?.addExtends("plugin:react/recommended");
|
|
35430
35453
|
this.eslint?.addExtends("plugin:react/jsx-runtime");
|
|
35431
35454
|
this.eslint?.addExtends("plugin:react-hooks/recommended");
|
|
35455
|
+
this.eslint?.addExtends("plugin:jsx-a11y/recommended");
|
|
35432
35456
|
this.eslint?.addOverride({
|
|
35433
35457
|
files: ["**/*.{tsx,jsx}"],
|
|
35434
35458
|
// Projen's ESLint override type does not include `settings`, but
|
|
@@ -35638,7 +35662,7 @@ function buildStarlightConfig(options) {
|
|
|
35638
35662
|
config.social = options.social;
|
|
35639
35663
|
}
|
|
35640
35664
|
if (options.sidebar !== void 0) {
|
|
35641
|
-
config.sidebar = options.sidebar;
|
|
35665
|
+
config.sidebar = options.sidebar.map(translateSidebarItem);
|
|
35642
35666
|
}
|
|
35643
35667
|
if (options.customCss !== void 0) {
|
|
35644
35668
|
config.customCss = options.customCss;
|
|
@@ -35651,6 +35675,31 @@ function buildStarlightConfig(options) {
|
|
|
35651
35675
|
}
|
|
35652
35676
|
return config;
|
|
35653
35677
|
}
|
|
35678
|
+
function translateSidebarItem(item) {
|
|
35679
|
+
if (item === null || typeof item !== "object") {
|
|
35680
|
+
return item;
|
|
35681
|
+
}
|
|
35682
|
+
const record = item;
|
|
35683
|
+
if (typeof record.label === "string" && record.autogenerate !== void 0 && record.items === void 0) {
|
|
35684
|
+
const translated = {
|
|
35685
|
+
label: record.label,
|
|
35686
|
+
items: [{ autogenerate: record.autogenerate }]
|
|
35687
|
+
};
|
|
35688
|
+
if (record.collapsed !== void 0) {
|
|
35689
|
+
translated.collapsed = record.collapsed;
|
|
35690
|
+
}
|
|
35691
|
+
return translated;
|
|
35692
|
+
}
|
|
35693
|
+
if (Array.isArray(record.items)) {
|
|
35694
|
+
return {
|
|
35695
|
+
...record,
|
|
35696
|
+
items: record.items.map(
|
|
35697
|
+
translateSidebarItem
|
|
35698
|
+
)
|
|
35699
|
+
};
|
|
35700
|
+
}
|
|
35701
|
+
return item;
|
|
35702
|
+
}
|
|
35654
35703
|
var DEFAULT_INDEX_MDX = `---
|
|
35655
35704
|
title: Welcome
|
|
35656
35705
|
description: Starlight-powered documentation site.
|