@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.mjs
CHANGED
|
@@ -35055,6 +35055,15 @@ var ReactViteSiteProject = class extends TypeScriptProject {
|
|
|
35055
35055
|
this.tsconfig?.file.addOverride("compilerOptions.noEmit", true);
|
|
35056
35056
|
this.tsconfig?.file.addOverride("compilerOptions.skipLibCheck", true);
|
|
35057
35057
|
this.tsconfig?.file.addOverride("compilerOptions.strict", true);
|
|
35058
|
+
this.tsconfig?.file.addOverride(
|
|
35059
|
+
"compilerOptions.noUncheckedIndexedAccess",
|
|
35060
|
+
true
|
|
35061
|
+
);
|
|
35062
|
+
this.tsconfig?.file.addOverride("compilerOptions.noImplicitOverride", true);
|
|
35063
|
+
this.tsconfig?.file.addOverride(
|
|
35064
|
+
"compilerOptions.exactOptionalPropertyTypes",
|
|
35065
|
+
true
|
|
35066
|
+
);
|
|
35058
35067
|
this.tsconfig?.file.addOverride("compilerOptions.resolveJsonModule", true);
|
|
35059
35068
|
this.tsconfig?.file.addOverride("compilerOptions.declaration", false);
|
|
35060
35069
|
this.tsconfig?.file.addOverride("compilerOptions.paths", {
|
|
@@ -35090,6 +35099,19 @@ export default defineConfig({
|
|
|
35090
35099
|
plugins: [tailwindcss(), react()],
|
|
35091
35100
|
resolve: { alias: { '@': path.resolve(__dirname, 'src') } },
|
|
35092
35101
|
});
|
|
35102
|
+
`
|
|
35103
|
+
});
|
|
35104
|
+
new SampleFile5(this, "src/vite-env.d.ts", {
|
|
35105
|
+
contents: `/// <reference types="vite/client" />
|
|
35106
|
+
|
|
35107
|
+
interface ImportMetaEnv {
|
|
35108
|
+
// Declare your VITE_* env vars here, e.g.
|
|
35109
|
+
// readonly VITE_API_BASE_URL: string;
|
|
35110
|
+
}
|
|
35111
|
+
|
|
35112
|
+
interface ImportMeta {
|
|
35113
|
+
readonly env: ImportMetaEnv;
|
|
35114
|
+
}
|
|
35093
35115
|
`
|
|
35094
35116
|
});
|
|
35095
35117
|
if (options.testRunner !== TestRunner.JEST) {
|
|
@@ -35145,11 +35167,13 @@ export default mergeConfig(
|
|
|
35145
35167
|
"@types/react",
|
|
35146
35168
|
"@types/react-dom",
|
|
35147
35169
|
"eslint-plugin-react",
|
|
35148
|
-
"eslint-plugin-react-hooks"
|
|
35170
|
+
"eslint-plugin-react-hooks",
|
|
35171
|
+
"eslint-plugin-jsx-a11y"
|
|
35149
35172
|
);
|
|
35150
35173
|
this.eslint?.addExtends("plugin:react/recommended");
|
|
35151
35174
|
this.eslint?.addExtends("plugin:react/jsx-runtime");
|
|
35152
35175
|
this.eslint?.addExtends("plugin:react-hooks/recommended");
|
|
35176
|
+
this.eslint?.addExtends("plugin:jsx-a11y/recommended");
|
|
35153
35177
|
this.eslint?.addOverride({
|
|
35154
35178
|
files: ["**/*.{tsx,jsx}"],
|
|
35155
35179
|
// Projen's ESLint override type does not include `settings`, but
|
|
@@ -35359,7 +35383,7 @@ function buildStarlightConfig(options) {
|
|
|
35359
35383
|
config.social = options.social;
|
|
35360
35384
|
}
|
|
35361
35385
|
if (options.sidebar !== void 0) {
|
|
35362
|
-
config.sidebar = options.sidebar;
|
|
35386
|
+
config.sidebar = options.sidebar.map(translateSidebarItem);
|
|
35363
35387
|
}
|
|
35364
35388
|
if (options.customCss !== void 0) {
|
|
35365
35389
|
config.customCss = options.customCss;
|
|
@@ -35372,6 +35396,31 @@ function buildStarlightConfig(options) {
|
|
|
35372
35396
|
}
|
|
35373
35397
|
return config;
|
|
35374
35398
|
}
|
|
35399
|
+
function translateSidebarItem(item) {
|
|
35400
|
+
if (item === null || typeof item !== "object") {
|
|
35401
|
+
return item;
|
|
35402
|
+
}
|
|
35403
|
+
const record = item;
|
|
35404
|
+
if (typeof record.label === "string" && record.autogenerate !== void 0 && record.items === void 0) {
|
|
35405
|
+
const translated = {
|
|
35406
|
+
label: record.label,
|
|
35407
|
+
items: [{ autogenerate: record.autogenerate }]
|
|
35408
|
+
};
|
|
35409
|
+
if (record.collapsed !== void 0) {
|
|
35410
|
+
translated.collapsed = record.collapsed;
|
|
35411
|
+
}
|
|
35412
|
+
return translated;
|
|
35413
|
+
}
|
|
35414
|
+
if (Array.isArray(record.items)) {
|
|
35415
|
+
return {
|
|
35416
|
+
...record,
|
|
35417
|
+
items: record.items.map(
|
|
35418
|
+
translateSidebarItem
|
|
35419
|
+
)
|
|
35420
|
+
};
|
|
35421
|
+
}
|
|
35422
|
+
return item;
|
|
35423
|
+
}
|
|
35375
35424
|
var DEFAULT_INDEX_MDX = `---
|
|
35376
35425
|
title: Welcome
|
|
35377
35426
|
description: Starlight-powered documentation site.
|