@codedrifters/configulator 0.0.197 → 0.0.198

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.mjs CHANGED
@@ -2990,6 +2990,15 @@ var VERSION = {
2990
2990
  * Version of Projen to use.
2991
2991
  */
2992
2992
  PROJEN_VERSION: "0.99.48",
2993
+ /**
2994
+ * Version of sharp to pin for StarlightProject (required peer for
2995
+ * Starlight's image optimization pipeline).
2996
+ */
2997
+ SHARP_VERSION: "0.34.5",
2998
+ /**
2999
+ * Version of @astrojs/starlight to pin for StarlightProject scaffolding.
3000
+ */
3001
+ STARLIGHT_VERSION: "0.38.3",
2993
3002
  /**
2994
3003
  * What version of the turborepo library should we use?
2995
3004
  */
@@ -4751,6 +4760,8 @@ var VERSION_NPM_PACKAGES = [
4751
4760
  { key: "AWS_CONSTRUCTS_VERSION", npmPackage: "constructs" },
4752
4761
  { key: "PNPM_VERSION", npmPackage: "pnpm" },
4753
4762
  { key: "PROJEN_VERSION", npmPackage: "projen" },
4763
+ { key: "SHARP_VERSION", npmPackage: "sharp" },
4764
+ { key: "STARLIGHT_VERSION", npmPackage: "@astrojs/starlight" },
4754
4765
  { key: "TURBO_VERSION", npmPackage: "turbo" },
4755
4766
  { key: "TYPES_NODE_VERSION", npmPackage: "@types/node" },
4756
4767
  { key: "VITEST_VERSION", npmPackage: "vitest" }
@@ -6537,6 +6548,91 @@ var AwsCdkProject = class extends awscdk.AwsCdkTypeScriptApp {
6537
6548
  }
6538
6549
  };
6539
6550
 
6551
+ // src/projects/starlight-project.ts
6552
+ import { SampleFile as SampleFile2 } from "projen";
6553
+ var StarlightProject = class extends AstroProject {
6554
+ constructor(userOptions) {
6555
+ const starlightConfig = buildStarlightConfig(userOptions);
6556
+ const starlightSpec = {
6557
+ name: "starlight",
6558
+ importPath: "@astrojs/starlight",
6559
+ defaultImport: true,
6560
+ args: JSON.stringify(starlightConfig, null, 2)
6561
+ };
6562
+ const mergedOptions = {
6563
+ ...userOptions,
6564
+ integrations: [starlightSpec, ...userOptions.integrations ?? []],
6565
+ depsUpgradeOptions: {
6566
+ ...userOptions.depsUpgradeOptions,
6567
+ exclude: [
6568
+ ...userOptions.depsUpgradeOptions?.exclude ?? [],
6569
+ "@astrojs/starlight",
6570
+ "sharp"
6571
+ ]
6572
+ }
6573
+ };
6574
+ super(mergedOptions);
6575
+ const starlightVersion = userOptions.starlightVersion ?? VERSION.STARLIGHT_VERSION;
6576
+ const sharpVersion = userOptions.sharpVersion ?? VERSION.SHARP_VERSION;
6577
+ this.addDeps(
6578
+ `@astrojs/starlight@${starlightVersion}`,
6579
+ `sharp@${sharpVersion}`
6580
+ );
6581
+ const turbo = TurboRepo.of(this);
6582
+ if (turbo?.compileTask) {
6583
+ turbo.compileTask.inputs.push("src/content/**");
6584
+ }
6585
+ if (userOptions.sampleContent === true) {
6586
+ new SampleFile2(this, "src/content/docs/index.mdx", {
6587
+ contents: DEFAULT_INDEX_MDX
6588
+ });
6589
+ new SampleFile2(this, "src/content/config.ts", {
6590
+ contents: DEFAULT_CONTENT_CONFIG_TS
6591
+ });
6592
+ }
6593
+ }
6594
+ };
6595
+ function buildStarlightConfig(options) {
6596
+ const config = {
6597
+ title: options.starlightTitle
6598
+ };
6599
+ if (options.starlightDescription !== void 0) {
6600
+ config.description = options.starlightDescription;
6601
+ }
6602
+ if (options.social !== void 0) {
6603
+ config.social = options.social;
6604
+ }
6605
+ if (options.sidebar !== void 0) {
6606
+ config.sidebar = options.sidebar;
6607
+ }
6608
+ if (options.customCss !== void 0) {
6609
+ config.customCss = options.customCss;
6610
+ }
6611
+ if (options.logo !== void 0) {
6612
+ config.logo = options.logo;
6613
+ }
6614
+ if (options.editLink !== void 0) {
6615
+ config.editLink = options.editLink;
6616
+ }
6617
+ return config;
6618
+ }
6619
+ var DEFAULT_INDEX_MDX = `---
6620
+ title: Welcome
6621
+ description: Starlight-powered documentation site.
6622
+ ---
6623
+
6624
+ # Hello, Starlight!
6625
+
6626
+ Edit \`src/content/docs/index.mdx\` to replace this page.
6627
+ `;
6628
+ var DEFAULT_CONTENT_CONFIG_TS = `import { defineCollection } from "astro:content";
6629
+ import { docsSchema } from "@astrojs/starlight/schema";
6630
+
6631
+ export const collections = {
6632
+ docs: defineCollection({ schema: docsSchema() }),
6633
+ };
6634
+ `;
6635
+
6540
6636
  // src/typescript/typescript-config.ts
6541
6637
  import { relative as relative4 } from "path";
6542
6638
  import { Component as Component18 } from "projen";
@@ -6598,6 +6694,7 @@ export {
6598
6694
  ROOT_CI_TASK_NAME,
6599
6695
  ROOT_TURBO_TASK_NAME,
6600
6696
  ResetTask,
6697
+ StarlightProject,
6601
6698
  TestRunner,
6602
6699
  TurboRepo,
6603
6700
  TurboRepoTask,