@codedrifters/configulator 0.0.387 → 0.0.388

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
@@ -173,7 +173,7 @@ var require_lib = __commonJS({
173
173
  });
174
174
 
175
175
  // src/agent/agent-config.ts
176
- import { Component as Component8, SampleFile, TextFile as TextFile4 } from "projen";
176
+ import { Component as Component8, SampleFile as SampleFile2, TextFile as TextFile4 } from "projen";
177
177
 
178
178
  // src/agent/types.ts
179
179
  var AGENT_RULE_SCOPE = {
@@ -30688,7 +30688,13 @@ function buildStandardsResearchBundle(paths = DEFAULT_AGENT_PATHS, issueDefaults
30688
30688
  var standardsResearchBundle = buildStandardsResearchBundle();
30689
30689
 
30690
30690
  // src/turbo/turbo-repo.ts
30691
- import { Component as Component4, FileBase, JsonFile } from "projen/lib";
30691
+ import {
30692
+ Component as Component4,
30693
+ FileBase,
30694
+ JsonFile,
30695
+ SampleDir,
30696
+ SampleFile
30697
+ } from "projen/lib";
30692
30698
  import { JobPermission } from "projen/lib/github/workflows-model";
30693
30699
 
30694
30700
  // src/turbo/turbo-repo-task.ts
@@ -30765,11 +30771,9 @@ var _TurboRepo = class _TurboRepo extends Component4 {
30765
30771
  };
30766
30772
  this.remoteCacheOptions = options.remoteCacheOptions;
30767
30773
  this.buildAllTaskEnvVars = options.buildAllTaskEnvVars ?? {};
30768
- const rootGeneratedFiles = this.isRootProject ? this.project.components.filter((c) => c instanceof FileBase).map((c) => c.path) : [];
30769
30774
  this.buildTask = new TurboRepoTask(this.project, {
30770
30775
  name: ROOT_TURBO_TASK_NAME,
30771
- dependsOn: this.isRootProject ? [`^${ROOT_TURBO_TASK_NAME}`] : [],
30772
- ...rootGeneratedFiles.length > 0 && { inputs: rootGeneratedFiles }
30776
+ dependsOn: this.isRootProject ? [`^${ROOT_TURBO_TASK_NAME}`] : []
30773
30777
  });
30774
30778
  if (this.isRootProject) {
30775
30779
  this.buildAllTask = this.project.tasks.addTask(ROOT_CI_TASK_NAME, {
@@ -30809,18 +30813,17 @@ var _TurboRepo = class _TurboRepo extends Component4 {
30809
30813
  }
30810
30814
  }
30811
30815
  if (!this.isRootProject) {
30812
- const generatedFiles = this.project.components.filter((c) => c instanceof FileBase).map((c) => c.path);
30813
30816
  this.preCompileTask = new TurboRepoTask(project, {
30814
30817
  name: options.preCompileTask?.name ?? "pre-compile",
30815
- inputs: ["src/**", ...generatedFiles]
30818
+ inputs: ["src/**"]
30816
30819
  });
30817
30820
  this.compileTask = new TurboRepoTask(project, {
30818
30821
  name: options.compileTask?.name ?? "compile",
30819
- inputs: ["src/**", ...generatedFiles]
30822
+ inputs: ["src/**"]
30820
30823
  });
30821
30824
  this.postCompileTask = new TurboRepoTask(project, {
30822
30825
  name: options.postCompileTask?.name ?? "post-compile",
30823
- inputs: ["src/**", ...generatedFiles]
30826
+ inputs: ["src/**"]
30824
30827
  });
30825
30828
  this.testTask = new TurboRepoTask(project, {
30826
30829
  name: options.testTask?.name ?? "test"
@@ -30951,6 +30954,33 @@ var _TurboRepo = class _TurboRepo extends Component4 {
30951
30954
  }
30952
30955
  }
30953
30956
  }
30957
+ /**
30958
+ * Paths of all generated files in the project, deduped, for use as task
30959
+ * inputs so the compile cache invalidates when they change. Includes
30960
+ * projen-managed `FileBase` files plus generated-once `SampleFile` /
30961
+ * `SampleDir` — whose paths projen keeps private, so they are read defensively
30962
+ * and skipped if that internal shape ever changes. Computed at synth time so
30963
+ * files added after this component (e.g. a subclass's SampleFiles) are seen.
30964
+ */
30965
+ generatedFileInputs() {
30966
+ const inputs = /* @__PURE__ */ new Set();
30967
+ for (const component of this.project.components) {
30968
+ if (component instanceof FileBase) {
30969
+ inputs.add(component.path);
30970
+ } else if (component instanceof SampleFile) {
30971
+ const filePath = component.filePath;
30972
+ if (typeof filePath === "string") {
30973
+ inputs.add(filePath);
30974
+ }
30975
+ } else if (component instanceof SampleDir) {
30976
+ const dir = component.dir;
30977
+ if (typeof dir === "string") {
30978
+ inputs.add(`${dir}/**`);
30979
+ }
30980
+ }
30981
+ }
30982
+ return Array.from(inputs);
30983
+ }
30954
30984
  preSynthesize() {
30955
30985
  let nextDependsOn = this.project.deps.all.filter((d) => d.version === "workspace:*").map((d) => [d.name, ROOT_TURBO_TASK_NAME].join("#"));
30956
30986
  if (!this.isRootProject) {
@@ -30972,6 +31002,24 @@ var _TurboRepo = class _TurboRepo extends Component4 {
30972
31002
  });
30973
31003
  this.buildTask.dependsOn.push(...nextDependsOn);
30974
31004
  }
31005
+ const generatedInputs = this.generatedFileInputs();
31006
+ const appendGeneratedInputs = (task) => {
31007
+ if (!task) {
31008
+ return;
31009
+ }
31010
+ for (const input of generatedInputs) {
31011
+ if (!task.inputs.includes(input)) {
31012
+ task.inputs.push(input);
31013
+ }
31014
+ }
31015
+ };
31016
+ if (this.isRootProject) {
31017
+ appendGeneratedInputs(this.buildTask);
31018
+ } else {
31019
+ appendGeneratedInputs(this.preCompileTask);
31020
+ appendGeneratedInputs(this.compileTask);
31021
+ appendGeneratedInputs(this.postCompileTask);
31022
+ }
30975
31023
  const fileName = "turbo.json";
30976
31024
  this.project.addPackageIgnore(fileName);
30977
31025
  new JsonFile(this.project, fileName, {
@@ -33491,7 +33539,7 @@ var AgentConfig = class _AgentConfig extends Component8 {
33491
33539
  });
33492
33540
  }
33493
33541
  if (resolvedIssueTemplates.emitStarterDoc) {
33494
- new SampleFile(this.project, resolvedIssueTemplates.templatesPath, {
33542
+ new SampleFile2(this.project, resolvedIssueTemplates.templatesPath, {
33495
33543
  contents: renderIssueTemplatesStarterPage(resolvedIssueTemplates)
33496
33544
  });
33497
33545
  }
@@ -37046,7 +37094,7 @@ var JsiiFaker = class _JsiiFaker extends Component14 {
37046
37094
  };
37047
37095
 
37048
37096
  // src/projects/add-playwright.ts
37049
- import { SampleFile as SampleFile2 } from "projen";
37097
+ import { SampleFile as SampleFile3 } from "projen";
37050
37098
  function addPlaywright(project) {
37051
37099
  project.addDevDeps("@playwright/test");
37052
37100
  project.tasks.addTask("e2e:install", {
@@ -37069,7 +37117,7 @@ function addPlaywright(project) {
37069
37117
  project.setScript("e2e", "npx projen e2e");
37070
37118
  project.setScript("e2e:ui", "npx projen e2e:ui");
37071
37119
  project.setScript("e2e:report", "npx projen e2e:report");
37072
- new SampleFile2(project, "playwright.config.ts", {
37120
+ new SampleFile3(project, "playwright.config.ts", {
37073
37121
  contents: `import { defineConfig, devices } from '@playwright/test';
37074
37122
 
37075
37123
  export default defineConfig({
@@ -37087,7 +37135,7 @@ export default defineConfig({
37087
37135
  }
37088
37136
 
37089
37137
  // src/projects/add-storybook.ts
37090
- import { SampleFile as SampleFile3 } from "projen";
37138
+ import { SampleFile as SampleFile4 } from "projen";
37091
37139
  function addStorybook(project, options = {}) {
37092
37140
  const withDocs = options.withDocs ?? true;
37093
37141
  project.addDevDeps(
@@ -37106,7 +37154,7 @@ function addStorybook(project, options = {}) {
37106
37154
  });
37107
37155
  project.setScript("storybook", "npx projen storybook");
37108
37156
  project.setScript("build-storybook", "npx projen build-storybook");
37109
- new SampleFile3(project, ".storybook/main.ts", {
37157
+ new SampleFile4(project, ".storybook/main.ts", {
37110
37158
  contents: `import type { StorybookConfig } from '@storybook/react-vite';
37111
37159
 
37112
37160
  const config: StorybookConfig = {
@@ -37117,7 +37165,7 @@ const config: StorybookConfig = {
37117
37165
  export default config;
37118
37166
  `
37119
37167
  });
37120
- new SampleFile3(project, ".storybook/preview.ts", {
37168
+ new SampleFile4(project, ".storybook/preview.ts", {
37121
37169
  contents: `import '../src/index.css';
37122
37170
  const preview = { parameters: { controls: { expanded: true } } };
37123
37171
  export default preview;
@@ -37126,7 +37174,7 @@ export default preview;
37126
37174
  }
37127
37175
 
37128
37176
  // src/projects/astro-project.ts
37129
- import { SampleFile as SampleFile4 } from "projen";
37177
+ import { SampleFile as SampleFile5 } from "projen";
37130
37178
  import { merge as merge3 } from "ts-deepmerge";
37131
37179
 
37132
37180
  // src/projects/monorepo-layout.ts
@@ -38859,10 +38907,10 @@ var AstroProject = class extends TypeScriptProject {
38859
38907
  adapter: options.adapter
38860
38908
  });
38861
38909
  if (options.sampleCode === true) {
38862
- new SampleFile4(this, "src/pages/index.astro", {
38910
+ new SampleFile5(this, "src/pages/index.astro", {
38863
38911
  contents: DEFAULT_INDEX_ASTRO
38864
38912
  });
38865
- new SampleFile4(this, "public/favicon.svg", {
38913
+ new SampleFile5(this, "public/favicon.svg", {
38866
38914
  contents: DEFAULT_FAVICON_SVG
38867
38915
  });
38868
38916
  }
@@ -39634,7 +39682,7 @@ var AwsCdkProject = class extends awscdk.AwsCdkTypeScriptApp {
39634
39682
  };
39635
39683
 
39636
39684
  // src/projects/react-vite-site-project.ts
39637
- import { SampleFile as SampleFile5, TextFile as TextFile8 } from "projen";
39685
+ import { SampleFile as SampleFile6, TextFile as TextFile8 } from "projen";
39638
39686
  import { merge as merge5 } from "ts-deepmerge";
39639
39687
  var ReactViteSiteProject = class extends TypeScriptProject {
39640
39688
  constructor(userOptions) {
@@ -39708,7 +39756,7 @@ var ReactViteSiteProject = class extends TypeScriptProject {
39708
39756
  "vitest/globals",
39709
39757
  "vite/client"
39710
39758
  ]);
39711
- new SampleFile5(this, "vite.config.ts", {
39759
+ new SampleFile6(this, "vite.config.ts", {
39712
39760
  contents: `import { defineConfig } from 'vite';
39713
39761
  import react from '@vitejs/plugin-react';
39714
39762
  import tailwindcss from '@tailwindcss/vite';
@@ -39720,7 +39768,7 @@ export default defineConfig({
39720
39768
  });
39721
39769
  `
39722
39770
  });
39723
- new SampleFile5(this, "src/vite-env.d.ts", {
39771
+ new SampleFile6(this, "src/vite-env.d.ts", {
39724
39772
  contents: `/// <reference types="vite/client" />
39725
39773
 
39726
39774
  interface ImportMetaEnv {
@@ -39735,7 +39783,7 @@ interface ImportMeta {
39735
39783
  });
39736
39784
  if (options.testRunner !== TestRunner.JEST) {
39737
39785
  this.tryRemoveFile("vitest.config.ts");
39738
- new SampleFile5(this, "vitest.config.ts", {
39786
+ new SampleFile6(this, "vitest.config.ts", {
39739
39787
  contents: `import { defineConfig, mergeConfig } from 'vitest/config';
39740
39788
  import react from '@vitejs/plugin-react';
39741
39789
  import viteConfig from './vite.config';
@@ -39879,7 +39927,7 @@ export default mergeConfig(
39879
39927
  }
39880
39928
  if (userOptions.sampleCode === true) {
39881
39929
  const siteName = options.name;
39882
- new SampleFile5(this, "index.html", {
39930
+ new SampleFile6(this, "index.html", {
39883
39931
  contents: `<!doctype html>
39884
39932
  <html>
39885
39933
  <head>
@@ -39894,7 +39942,7 @@ export default mergeConfig(
39894
39942
  </html>
39895
39943
  `
39896
39944
  });
39897
- new SampleFile5(this, "src/routes.tsx", {
39945
+ new SampleFile6(this, "src/routes.tsx", {
39898
39946
  contents: `import { createBrowserRouter } from 'react-router-dom';
39899
39947
  import App from './App';
39900
39948
 
@@ -39903,7 +39951,7 @@ export const router = createBrowserRouter([
39903
39951
  ]);
39904
39952
  `
39905
39953
  });
39906
- new SampleFile5(this, "src/main.tsx", {
39954
+ new SampleFile6(this, "src/main.tsx", {
39907
39955
  contents: `import React from 'react';
39908
39956
  import ReactDOM from 'react-dom/client';
39909
39957
  import { RouterProvider } from 'react-router-dom';
@@ -39917,7 +39965,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
39917
39965
  );
39918
39966
  `
39919
39967
  });
39920
- new SampleFile5(this, "src/App.tsx", {
39968
+ new SampleFile6(this, "src/App.tsx", {
39921
39969
  contents: `export default function App() {
39922
39970
  return (
39923
39971
  <main className="p-4">
@@ -39927,11 +39975,11 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
39927
39975
  }
39928
39976
  `
39929
39977
  });
39930
- new SampleFile5(this, "src/index.css", {
39978
+ new SampleFile6(this, "src/index.css", {
39931
39979
  contents: `@import "tailwindcss";
39932
39980
  `
39933
39981
  });
39934
- new SampleFile5(this, "src/setupTests.ts", {
39982
+ new SampleFile6(this, "src/setupTests.ts", {
39935
39983
  contents: `import '@testing-library/jest-dom';
39936
39984
  `
39937
39985
  });
@@ -39940,7 +39988,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
39940
39988
  };
39941
39989
 
39942
39990
  // src/projects/starlight-project.ts
39943
- import { SampleFile as SampleFile6 } from "projen";
39991
+ import { SampleFile as SampleFile7 } from "projen";
39944
39992
  var STARLIGHT_ROLE = {
39945
39993
  DOCS: "docs",
39946
39994
  SITE: "site"
@@ -39982,10 +40030,10 @@ var StarlightProject = class extends AstroProject {
39982
40030
  turbo.compileTask.inputs.push("src/content/**");
39983
40031
  }
39984
40032
  if (userOptions.sampleContent === true) {
39985
- new SampleFile6(this, "src/content/docs/index.mdx", {
40033
+ new SampleFile7(this, "src/content/docs/index.mdx", {
39986
40034
  contents: DEFAULT_INDEX_MDX
39987
40035
  });
39988
- new SampleFile6(this, "src/content.config.ts", {
40036
+ new SampleFile7(this, "src/content.config.ts", {
39989
40037
  contents: DEFAULT_CONTENT_CONFIG_TS
39990
40038
  });
39991
40039
  }