@codedrifters/configulator 0.0.191 → 0.0.193

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.js CHANGED
@@ -179,6 +179,9 @@ __export(index_exports, {
179
179
  AGENT_PLATFORM: () => AGENT_PLATFORM,
180
180
  AGENT_RULE_SCOPE: () => AGENT_RULE_SCOPE,
181
181
  AgentConfig: () => AgentConfig,
182
+ AstroConfig: () => AstroConfig,
183
+ AstroOutput: () => AstroOutput,
184
+ AstroProject: () => AstroProject,
182
185
  AwsDeployWorkflow: () => AwsDeployWorkflow,
183
186
  AwsDeploymentConfig: () => AwsDeploymentConfig,
184
187
  AwsDeploymentTarget: () => AwsDeploymentTarget,
@@ -1451,7 +1454,29 @@ var meetingAnalysisBundle = {
1451
1454
  }
1452
1455
  ],
1453
1456
  skills: [processMeetingSkill],
1454
- subAgents: [meetingAnalystSubAgent]
1457
+ subAgents: [meetingAnalystSubAgent],
1458
+ labels: [
1459
+ {
1460
+ name: "meeting:extract",
1461
+ color: "C5DEF5",
1462
+ description: "Phase 1: raw extraction from a meeting transcript"
1463
+ },
1464
+ {
1465
+ name: "meeting:notes",
1466
+ color: "BFDADC",
1467
+ description: "Phase 2: curated notes derived from an extraction"
1468
+ },
1469
+ {
1470
+ name: "meeting:draft",
1471
+ color: "D4C5F9",
1472
+ description: "Phase 3: draft follow-up issues proposed from notes"
1473
+ },
1474
+ {
1475
+ name: "meeting:link",
1476
+ color: "FEF2C0",
1477
+ description: "Phase 4: linking/reconciling drafted issues with existing work"
1478
+ }
1479
+ ]
1455
1480
  };
1456
1481
 
1457
1482
  // src/agent/bundles/orchestrator.ts
@@ -3016,6 +3041,10 @@ var import_textfile = require("projen/lib/textfile");
3016
3041
 
3017
3042
  // src/versions.ts
3018
3043
  var VERSION = {
3044
+ /**
3045
+ * Version of Astro to pin for AstroProject scaffolding.
3046
+ */
3047
+ ASTRO_VERSION: "5.14.1",
3019
3048
  /**
3020
3049
  * CDK CLI for workflows and command line operations.
3021
3050
  *
@@ -4031,6 +4060,39 @@ var AgentConfig = class _AgentConfig extends import_projen8.Component {
4031
4060
  super(project);
4032
4061
  this.options = options;
4033
4062
  }
4063
+ /**
4064
+ * Returns the bundles that are active for this project: auto-detected
4065
+ * bundles (when `autoDetectBundles !== false`) plus force-included
4066
+ * bundles, minus explicitly excluded bundles. Deduplicated by name.
4067
+ *
4068
+ * Exposed so sibling components (e.g. the sync-labels workflow) can
4069
+ * consume bundle-contributed configuration.
4070
+ */
4071
+ get activeBundles() {
4072
+ const bundleMap = /* @__PURE__ */ new Map();
4073
+ if (this.options.autoDetectBundles !== false) {
4074
+ for (const bundle of BUILT_IN_BUNDLES) {
4075
+ if (this.options.excludeBundles?.includes(bundle.name)) {
4076
+ continue;
4077
+ }
4078
+ if (bundle.name === "base" && this.options.includeBaseRules === false) {
4079
+ continue;
4080
+ }
4081
+ if (bundle.appliesWhen(this.project)) {
4082
+ bundleMap.set(bundle.name, bundle);
4083
+ }
4084
+ }
4085
+ }
4086
+ if (this.options.includeBundles) {
4087
+ for (const bundleName of this.options.includeBundles) {
4088
+ const bundle = BUILT_IN_BUNDLES.find((b) => b.name === bundleName);
4089
+ if (bundle) {
4090
+ bundleMap.set(bundle.name, bundle);
4091
+ }
4092
+ }
4093
+ }
4094
+ return [...bundleMap.values()];
4095
+ }
4034
4096
  preSynthesize() {
4035
4097
  super.preSynthesize();
4036
4098
  const platforms = this.resolvePlatforms();
@@ -4366,11 +4428,91 @@ ${extra}`
4366
4428
  }
4367
4429
  };
4368
4430
 
4431
+ // src/astro/astro-config.ts
4432
+ var import_projen9 = require("projen");
4433
+ var import_textfile4 = require("projen/lib/textfile");
4434
+ var AstroConfig = class _AstroConfig extends import_projen9.Component {
4435
+ constructor(project, options = {}) {
4436
+ super(project);
4437
+ this.project = project;
4438
+ this.configFilePath = "astro.config.mjs";
4439
+ this.site = options.site;
4440
+ this.base = options.base;
4441
+ this.output = options.output;
4442
+ this.integrations = options.integrations ?? [];
4443
+ this.adapter = options.adapter;
4444
+ this.synthesizeConfig();
4445
+ }
4446
+ /**
4447
+ * Find the AstroConfig component on a project.
4448
+ */
4449
+ static of(project) {
4450
+ const isAstroConfig = (c) => c instanceof _AstroConfig;
4451
+ return project.components.find(isAstroConfig);
4452
+ }
4453
+ /**
4454
+ * Render the config file contents as an array of lines.
4455
+ *
4456
+ * Exposed for unit testing — `synthesizeConfig` writes these to disk.
4457
+ */
4458
+ renderConfig() {
4459
+ const imports = [
4460
+ 'import { defineConfig } from "astro/config";'
4461
+ ];
4462
+ const specs = [
4463
+ ...this.integrations,
4464
+ ...this.adapter ? [this.adapter] : []
4465
+ ];
4466
+ for (const spec2 of specs) {
4467
+ imports.push(renderImport(spec2));
4468
+ }
4469
+ const body = [];
4470
+ if (this.site !== void 0) {
4471
+ body.push(` site: ${JSON.stringify(this.site)},`);
4472
+ }
4473
+ if (this.base !== void 0) {
4474
+ body.push(` base: ${JSON.stringify(this.base)},`);
4475
+ }
4476
+ if (this.output !== void 0) {
4477
+ body.push(` output: ${JSON.stringify(this.output)},`);
4478
+ }
4479
+ if (this.integrations.length > 0) {
4480
+ const calls = this.integrations.map(renderCall).join(", ");
4481
+ body.push(` integrations: [${calls}],`);
4482
+ }
4483
+ if (this.adapter) {
4484
+ body.push(` adapter: ${renderCall(this.adapter)},`);
4485
+ }
4486
+ return [...imports, "", "export default defineConfig({", ...body, "});"];
4487
+ }
4488
+ synthesizeConfig() {
4489
+ this.project.tryRemoveFile(this.configFilePath);
4490
+ new import_textfile4.TextFile(this, this.configFilePath, {
4491
+ lines: this.renderConfig()
4492
+ });
4493
+ }
4494
+ };
4495
+ function renderImport(spec2) {
4496
+ const asDefault = spec2.defaultImport ?? true;
4497
+ const binding = asDefault ? spec2.name : `{ ${spec2.name} }`;
4498
+ return `import ${binding} from ${JSON.stringify(spec2.importPath)};`;
4499
+ }
4500
+ function renderCall(spec2) {
4501
+ return `${spec2.name}(${spec2.args ?? ""})`;
4502
+ }
4503
+
4504
+ // src/astro/astro-config-options.ts
4505
+ var AstroOutput = {
4506
+ STATIC: "static",
4507
+ SERVER: "server",
4508
+ HYBRID: "hybrid"
4509
+ };
4510
+
4369
4511
  // src/aws/aws-deployment-config.ts
4370
4512
  var import_node_path = require("path");
4371
4513
  var import_utils9 = __toESM(require_lib());
4372
- var import_projen9 = require("projen");
4373
- var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Component {
4514
+ var import_projen10 = require("projen");
4515
+ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen10.Component {
4374
4516
  constructor(project) {
4375
4517
  super(project);
4376
4518
  /**
@@ -4487,8 +4629,8 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Comp
4487
4629
 
4488
4630
  // src/aws/aws-deployment-target.ts
4489
4631
  var import_utils10 = __toESM(require_lib());
4490
- var import_projen10 = require("projen");
4491
- var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen10.Component {
4632
+ var import_projen11 = require("projen");
4633
+ var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen11.Component {
4492
4634
  constructor(project, options) {
4493
4635
  super(project);
4494
4636
  /**
@@ -4686,6 +4828,7 @@ async function getLatestEligibleVersion(packageName, minimumReleaseAgeMinutes) {
4686
4828
 
4687
4829
  // src/version-package-map.ts
4688
4830
  var VERSION_NPM_PACKAGES = [
4831
+ { key: "ASTRO_VERSION", npmPackage: "astro" },
4689
4832
  { key: "AWS_CDK_CLI_VERSION", npmPackage: "aws-cdk" },
4690
4833
  { key: "AWS_CDK_LIB_VERSION", npmPackage: "aws-cdk-lib" },
4691
4834
  { key: "AWS_CONSTRUCTS_VERSION", npmPackage: "constructs" },
@@ -4704,12 +4847,12 @@ var VERSION_KEYS_SKIP = [
4704
4847
 
4705
4848
  // src/jsii/jsii-faker.ts
4706
4849
  var spec = __toESM(require("@jsii/spec"));
4707
- var import_projen11 = require("projen");
4850
+ var import_projen12 = require("projen");
4708
4851
  var ProjenBaseFqn = {
4709
4852
  TYPESCRIPT_PROJECT: "projen.typescript.TypeScriptProject",
4710
4853
  TYPESCRIPT_PROJECT_OPTIONS: "projen.typescript.TypeScriptProjectOptions"
4711
4854
  };
4712
- var JsiiFaker = class _JsiiFaker extends import_projen11.Component {
4855
+ var JsiiFaker = class _JsiiFaker extends import_projen12.Component {
4713
4856
  constructor(project) {
4714
4857
  super(project);
4715
4858
  this.project = project;
@@ -4720,7 +4863,7 @@ var JsiiFaker = class _JsiiFaker extends import_projen11.Component {
4720
4863
  };
4721
4864
  };
4722
4865
  this._assemblyName = this.project.package.packageName;
4723
- new import_projen11.JsonFile(project, ".jsii", {
4866
+ new import_projen12.JsonFile(project, ".jsii", {
4724
4867
  obj: () => {
4725
4868
  return {
4726
4869
  name: this._assemblyName,
@@ -4757,190 +4900,22 @@ var JsiiFaker = class _JsiiFaker extends import_projen11.Component {
4757
4900
  }
4758
4901
  };
4759
4902
 
4760
- // src/projects/monorepo-project.ts
4903
+ // src/projects/astro-project.ts
4904
+ var import_projen17 = require("projen");
4905
+
4906
+ // src/projects/typescript-project.ts
4907
+ var import_projen16 = require("projen");
4761
4908
  var import_javascript4 = require("projen/lib/javascript");
4762
- var import_typescript3 = require("projen/lib/typescript");
4909
+ var import_release = require("projen/lib/release");
4763
4910
  var import_ts_deepmerge2 = require("ts-deepmerge");
4764
4911
 
4765
- // src/tasks/reset-task.ts
4766
- var import_projen13 = require("projen");
4767
-
4768
- // src/projects/typescript-project.ts
4769
- var import_projen12 = require("projen");
4912
+ // src/projects/monorepo-project.ts
4770
4913
  var import_javascript3 = require("projen/lib/javascript");
4771
- var import_release = require("projen/lib/release");
4914
+ var import_typescript3 = require("projen/lib/typescript");
4772
4915
  var import_ts_deepmerge = require("ts-deepmerge");
4773
- var TestRunner = {
4774
- JEST: "jest",
4775
- VITEST: "vitest"
4776
- };
4777
- var TypeScriptProject = class extends import_projen12.typescript.TypeScriptProject {
4778
- constructor(userOptions) {
4779
- const pnpmVersion = userOptions.parent && userOptions.parent instanceof MonorepoProject ? userOptions.parent.pnpmVersion : VERSION.PNPM_VERSION;
4780
- const pnpmWorkspace = userOptions.parent && userOptions.parent instanceof MonorepoProject ? PnpmWorkspace.of(userOptions.parent) : void 0;
4781
- const testRunner = userOptions.testRunner ?? TestRunner.JEST;
4782
- const useJest = testRunner === TestRunner.JEST;
4783
- const defaultOptions = {
4784
- /**
4785
- * This is a standard, so don't require it to passed in everywhere.
4786
- */
4787
- defaultReleaseBranch: "main",
4788
- /**
4789
- * Enable reset task by default.
4790
- */
4791
- resetTask: true,
4792
- /**
4793
- * Packaging options
4794
- */
4795
- packageManager: import_javascript3.NodePackageManager.PNPM,
4796
- pnpmVersion,
4797
- licensed: userOptions.license !== void 0 || false,
4798
- copyrightOwner: "CodeDrifters",
4799
- release: false,
4800
- /**
4801
- * Don't add sample code.
4802
- */
4803
- sampleCode: false,
4804
- ...useJest ? {
4805
- /**
4806
- * Make sure jest config is stored outside of package.json
4807
- */
4808
- jestOptions: {
4809
- configFilePath: "jest.config.json",
4810
- jestConfig: {
4811
- roots: [`<rootDir>/src`],
4812
- transform: {
4813
- ["^.+\\.[t]sx?$"]: new import_javascript3.Transform("@swc/jest")
4814
- },
4815
- moduleFileExtensions: ["js", "ts"]
4816
- }
4817
- },
4818
- /**
4819
- * SWC for faster testing
4820
- */
4821
- devDeps: ["@swc/jest", "@swc/core"]
4822
- } : {
4823
- jest: false,
4824
- devDeps: []
4825
- },
4826
- /**
4827
- * Turn on prettier formatting
4828
- */
4829
- prettier: true,
4830
- /**
4831
- * Don't package test files.
4832
- */
4833
- npmIgnoreOptions: {
4834
- ignorePatterns: ["*.spec.*", "*.test.*"]
4835
- },
4836
- /**
4837
- * Options for the automated dependency upgrade task / workflow
4838
- * Automatically exclude any packages that are managed by the root
4839
- * project as default catalog dependencies since we want to let the
4840
- * catalog manage those dependencies.
4841
- */
4842
- depsUpgrade: true,
4843
- depsUpgradeOptions: {
4844
- workflow: false,
4845
- exclude: Object.keys(pnpmWorkspace?.defaultCatalog || {}),
4846
- ...userOptions.parent && userOptions.parent instanceof MonorepoProject ? {
4847
- workflowOptions: {
4848
- schedule: import_javascript3.UpgradeDependenciesSchedule.WEEKLY
4849
- },
4850
- cooldown: 1
4851
- } : {}
4852
- },
4853
- /**
4854
- * Only release when the package folder source content or package.json
4855
- * (version, dependencies) changes.
4856
- */
4857
- releaseTrigger: import_release.ReleaseTrigger.continuous({
4858
- paths: [
4859
- `${userOptions.outdir}/src/**`,
4860
- `${userOptions.outdir}/package.json`
4861
- ]
4862
- })
4863
- };
4864
- const options = (0, import_ts_deepmerge.merge)(defaultOptions, userOptions);
4865
- super(options);
4866
- this.addDevDeps("@types/node@catalog:");
4867
- this.tsconfig?.addExclude("**/*.test.*");
4868
- this.tsconfig?.addExclude("**/*.spec.*");
4869
- if (options.testRunner === TestRunner.VITEST) {
4870
- new Vitest(this, {
4871
- config: {
4872
- include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
4873
- ...options.vitestOptions?.config
4874
- },
4875
- ...options.vitestOptions
4876
- });
4877
- } else {
4878
- this.deps.removeDependency("ts-jest");
4879
- }
4880
- this.package.file.addOverride(
4881
- "packageManager",
4882
- `pnpm@${options.pnpmVersion}`
4883
- );
4884
- this.eslint?.addOverride({
4885
- files: ["**/*.test.*", "**/*.spec.*"],
4886
- rules: {
4887
- "import/no-extraneous-dependencies": "off"
4888
- }
4889
- });
4890
- this.gitignore?.addPatterns(".DS_Store", "test-reports");
4891
- this.npmignore?.addPatterns("*.spec.*", "*.test.*", "__fixtures__");
4892
- const turboActive = userOptions.parent && TurboRepo.of(userOptions.parent) !== void 0;
4893
- if (turboActive) {
4894
- const turbo = new TurboRepo(this);
4895
- turbo.compileTask?.outputs.push("dist/**");
4896
- turbo.compileTask?.outputs.push("lib/**");
4897
- }
4898
- if (options.agentConfig === true || typeof options.agentConfig === "object") {
4899
- new AgentConfig(
4900
- this,
4901
- typeof options.agentConfig === "object" ? options.agentConfig : {}
4902
- );
4903
- }
4904
- if (options.resetTask !== false) {
4905
- const defaultResetTaskOptions = {
4906
- pathsToRemove: [
4907
- "node_modules",
4908
- "dist",
4909
- "lib",
4910
- "coverage",
4911
- "test-reports",
4912
- ".turbo",
4913
- "tsconfig.tsbuildinfo",
4914
- this.artifactsDirectory
4915
- ]
4916
- };
4917
- const userResetTaskOptions = options.resetTaskOptions ?? {};
4918
- const resetTaskOptions = (0, import_ts_deepmerge.merge)(
4919
- defaultResetTaskOptions,
4920
- {
4921
- ...userResetTaskOptions,
4922
- pathsToRemove: [
4923
- ...defaultResetTaskOptions.pathsToRemove ?? [],
4924
- ...userResetTaskOptions.pathsToRemove ?? []
4925
- ]
4926
- }
4927
- );
4928
- new ResetTask(this, resetTaskOptions);
4929
- }
4930
- if (options.parent && options.parent instanceof MonorepoProject) {
4931
- const originalResolve = this.package.resolveDepsAndWritePackageJson;
4932
- this.package.installDependencies = () => {
4933
- options.parent.requestInstallDependencies({
4934
- resolveDepsAndWritePackageJson: () => originalResolve.apply(this.package)
4935
- });
4936
- };
4937
- this.package.resolveDepsAndWritePackageJson = () => {
4938
- };
4939
- }
4940
- }
4941
- };
4942
4916
 
4943
4917
  // src/tasks/reset-task.ts
4918
+ var import_projen13 = require("projen");
4944
4919
  var ResetTask = class _ResetTask extends import_projen13.Component {
4945
4920
  constructor(project, options = {}) {
4946
4921
  super(project);
@@ -5294,12 +5269,25 @@ var LABELS_CONFIG_PATH = ".github/labels.yml";
5294
5269
  function addSyncLabelsWorkflow(project, options) {
5295
5270
  const workflowName = options.workflowName ?? DEFAULT_WORKFLOW_NAME2;
5296
5271
  const deleteOtherLabels = options.deleteOtherLabels ?? true;
5297
- const allLabels = [
5298
- ...DEFAULT_STATUS_LABELS,
5299
- ...DEFAULT_PRIORITY_LABELS,
5300
- ...DEFAULT_TYPE_LABELS,
5301
- ...options.labels ?? []
5302
- ];
5272
+ const labelMap = /* @__PURE__ */ new Map();
5273
+ for (const label of DEFAULT_STATUS_LABELS) {
5274
+ labelMap.set(label.name, label);
5275
+ }
5276
+ for (const label of DEFAULT_PRIORITY_LABELS) {
5277
+ labelMap.set(label.name, label);
5278
+ }
5279
+ for (const label of DEFAULT_TYPE_LABELS) {
5280
+ labelMap.set(label.name, label);
5281
+ }
5282
+ for (const bundle of options.bundles ?? []) {
5283
+ for (const label of bundle.labels ?? []) {
5284
+ labelMap.set(label.name, label);
5285
+ }
5286
+ }
5287
+ for (const label of options.labels ?? []) {
5288
+ labelMap.set(label.name, label);
5289
+ }
5290
+ const allLabels = [...labelMap.values()];
5303
5291
  new LabelsFile(project, allLabels);
5304
5292
  const workflow = project.github?.addWorkflow(workflowName);
5305
5293
  if (!workflow) {
@@ -5450,7 +5438,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5450
5438
  depsUpgradeOptions: {
5451
5439
  exclude: ["@codedrifters/configulator"],
5452
5440
  workflowOptions: {
5453
- schedule: import_javascript4.UpgradeDependenciesSchedule.DAILY
5441
+ schedule: import_javascript3.UpgradeDependenciesSchedule.DAILY
5454
5442
  },
5455
5443
  cooldown: 1
5456
5444
  },
@@ -5511,7 +5499,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5511
5499
  * Use PNPM instead of the default (Yarn). Much of the ecosystem depends
5512
5500
  * on PNPM and making monorepos PNPM only simplifies many configurations.
5513
5501
  */
5514
- packageManager: import_javascript4.NodePackageManager.PNPM,
5502
+ packageManager: import_javascript3.NodePackageManager.PNPM,
5515
5503
  /**
5516
5504
  * Some additional pre-build steps if we're using turbo's remote cache.
5517
5505
  * Set GIT_BRANCH_NAME so Turborepo remote cache hashes match between local and CI.
@@ -5532,7 +5520,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5532
5520
  ]
5533
5521
  }
5534
5522
  };
5535
- const options = (0, import_ts_deepmerge2.merge)(
5523
+ const options = (0, import_ts_deepmerge.merge)(
5536
5524
  defaultOptions,
5537
5525
  userOptions,
5538
5526
  requiredOptions
@@ -5568,7 +5556,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5568
5556
  pathsToRemove: ["node_modules", ".turbo", "dist", "lib"]
5569
5557
  };
5570
5558
  const userResetTaskOptions = options.resetTaskOptions ?? {};
5571
- const resetTaskOptions = (0, import_ts_deepmerge2.merge)(
5559
+ const resetTaskOptions = (0, import_ts_deepmerge.merge)(
5572
5560
  defaultResetTaskOptions,
5573
5561
  {
5574
5562
  ...userResetTaskOptions,
@@ -5602,10 +5590,12 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5602
5590
  );
5603
5591
  }
5604
5592
  if (options.syncLabels !== false) {
5605
- addSyncLabelsWorkflow(
5606
- this,
5607
- typeof options.syncLabels === "object" ? options.syncLabels : {}
5608
- );
5593
+ const syncLabelsOptions = typeof options.syncLabels === "object" ? options.syncLabels : {};
5594
+ const agentConfig = AgentConfig.of(this);
5595
+ addSyncLabelsWorkflow(this, {
5596
+ ...syncLabelsOptions,
5597
+ bundles: syncLabelsOptions.bundles ?? agentConfig?.activeBundles
5598
+ });
5609
5599
  }
5610
5600
  if (this.buildWorkflow) {
5611
5601
  addBuildCompleteJob(this.buildWorkflow);
@@ -5663,11 +5653,273 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5663
5653
  }
5664
5654
  };
5665
5655
 
5656
+ // src/projects/typescript-project.ts
5657
+ var TestRunner = {
5658
+ JEST: "jest",
5659
+ VITEST: "vitest"
5660
+ };
5661
+ var TypeScriptProject = class extends import_projen16.typescript.TypeScriptProject {
5662
+ constructor(userOptions) {
5663
+ const pnpmVersion = userOptions.parent && userOptions.parent instanceof MonorepoProject ? userOptions.parent.pnpmVersion : VERSION.PNPM_VERSION;
5664
+ const pnpmWorkspace = userOptions.parent && userOptions.parent instanceof MonorepoProject ? PnpmWorkspace.of(userOptions.parent) : void 0;
5665
+ const testRunner = userOptions.testRunner ?? TestRunner.JEST;
5666
+ const useJest = testRunner === TestRunner.JEST;
5667
+ const defaultOptions = {
5668
+ /**
5669
+ * This is a standard, so don't require it to passed in everywhere.
5670
+ */
5671
+ defaultReleaseBranch: "main",
5672
+ /**
5673
+ * Enable reset task by default.
5674
+ */
5675
+ resetTask: true,
5676
+ /**
5677
+ * Packaging options
5678
+ */
5679
+ packageManager: import_javascript4.NodePackageManager.PNPM,
5680
+ pnpmVersion,
5681
+ licensed: userOptions.license !== void 0 || false,
5682
+ copyrightOwner: "CodeDrifters",
5683
+ release: false,
5684
+ /**
5685
+ * Don't add sample code.
5686
+ */
5687
+ sampleCode: false,
5688
+ ...useJest ? {
5689
+ /**
5690
+ * Make sure jest config is stored outside of package.json
5691
+ */
5692
+ jestOptions: {
5693
+ configFilePath: "jest.config.json",
5694
+ jestConfig: {
5695
+ roots: [`<rootDir>/src`],
5696
+ transform: {
5697
+ ["^.+\\.[t]sx?$"]: new import_javascript4.Transform("@swc/jest")
5698
+ },
5699
+ moduleFileExtensions: ["js", "ts"]
5700
+ }
5701
+ },
5702
+ /**
5703
+ * SWC for faster testing
5704
+ */
5705
+ devDeps: ["@swc/jest", "@swc/core"]
5706
+ } : {
5707
+ jest: false,
5708
+ devDeps: []
5709
+ },
5710
+ /**
5711
+ * Turn on prettier formatting
5712
+ */
5713
+ prettier: true,
5714
+ /**
5715
+ * Don't package test files.
5716
+ */
5717
+ npmIgnoreOptions: {
5718
+ ignorePatterns: ["*.spec.*", "*.test.*"]
5719
+ },
5720
+ /**
5721
+ * Options for the automated dependency upgrade task / workflow
5722
+ * Automatically exclude any packages that are managed by the root
5723
+ * project as default catalog dependencies since we want to let the
5724
+ * catalog manage those dependencies.
5725
+ */
5726
+ depsUpgrade: true,
5727
+ depsUpgradeOptions: {
5728
+ workflow: false,
5729
+ exclude: Object.keys(pnpmWorkspace?.defaultCatalog || {}),
5730
+ ...userOptions.parent && userOptions.parent instanceof MonorepoProject ? {
5731
+ workflowOptions: {
5732
+ schedule: import_javascript4.UpgradeDependenciesSchedule.WEEKLY
5733
+ },
5734
+ cooldown: 1
5735
+ } : {}
5736
+ },
5737
+ /**
5738
+ * Only release when the package folder source content or package.json
5739
+ * (version, dependencies) changes.
5740
+ */
5741
+ releaseTrigger: import_release.ReleaseTrigger.continuous({
5742
+ paths: [
5743
+ `${userOptions.outdir}/src/**`,
5744
+ `${userOptions.outdir}/package.json`
5745
+ ]
5746
+ })
5747
+ };
5748
+ const options = (0, import_ts_deepmerge2.merge)(defaultOptions, userOptions);
5749
+ super(options);
5750
+ this.addDevDeps("@types/node@catalog:");
5751
+ this.tsconfig?.addExclude("**/*.test.*");
5752
+ this.tsconfig?.addExclude("**/*.spec.*");
5753
+ if (options.testRunner === TestRunner.VITEST) {
5754
+ new Vitest(this, {
5755
+ config: {
5756
+ include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
5757
+ ...options.vitestOptions?.config
5758
+ },
5759
+ ...options.vitestOptions
5760
+ });
5761
+ } else {
5762
+ this.deps.removeDependency("ts-jest");
5763
+ }
5764
+ this.package.file.addOverride(
5765
+ "packageManager",
5766
+ `pnpm@${options.pnpmVersion}`
5767
+ );
5768
+ this.eslint?.addOverride({
5769
+ files: ["**/*.test.*", "**/*.spec.*"],
5770
+ rules: {
5771
+ "import/no-extraneous-dependencies": "off"
5772
+ }
5773
+ });
5774
+ this.gitignore?.addPatterns(".DS_Store", "test-reports");
5775
+ this.npmignore?.addPatterns("*.spec.*", "*.test.*", "__fixtures__");
5776
+ const turboActive = userOptions.parent && TurboRepo.of(userOptions.parent) !== void 0;
5777
+ if (turboActive) {
5778
+ const turbo = new TurboRepo(this);
5779
+ turbo.compileTask?.outputs.push("dist/**");
5780
+ turbo.compileTask?.outputs.push("lib/**");
5781
+ }
5782
+ if (options.agentConfig === true || typeof options.agentConfig === "object") {
5783
+ new AgentConfig(
5784
+ this,
5785
+ typeof options.agentConfig === "object" ? options.agentConfig : {}
5786
+ );
5787
+ }
5788
+ if (options.resetTask !== false) {
5789
+ const defaultResetTaskOptions = {
5790
+ pathsToRemove: [
5791
+ "node_modules",
5792
+ "dist",
5793
+ "lib",
5794
+ "coverage",
5795
+ "test-reports",
5796
+ ".turbo",
5797
+ "tsconfig.tsbuildinfo",
5798
+ this.artifactsDirectory
5799
+ ]
5800
+ };
5801
+ const userResetTaskOptions = options.resetTaskOptions ?? {};
5802
+ const resetTaskOptions = (0, import_ts_deepmerge2.merge)(
5803
+ defaultResetTaskOptions,
5804
+ {
5805
+ ...userResetTaskOptions,
5806
+ pathsToRemove: [
5807
+ ...defaultResetTaskOptions.pathsToRemove ?? [],
5808
+ ...userResetTaskOptions.pathsToRemove ?? []
5809
+ ]
5810
+ }
5811
+ );
5812
+ new ResetTask(this, resetTaskOptions);
5813
+ }
5814
+ if (options.parent && options.parent instanceof MonorepoProject) {
5815
+ const originalResolve = this.package.resolveDepsAndWritePackageJson;
5816
+ this.package.installDependencies = () => {
5817
+ options.parent.requestInstallDependencies({
5818
+ resolveDepsAndWritePackageJson: () => originalResolve.apply(this.package)
5819
+ });
5820
+ };
5821
+ this.package.resolveDepsAndWritePackageJson = () => {
5822
+ };
5823
+ }
5824
+ }
5825
+ };
5826
+
5827
+ // src/projects/astro-project.ts
5828
+ var AstroProject = class extends TypeScriptProject {
5829
+ constructor(userOptions) {
5830
+ const options = {
5831
+ testRunner: TestRunner.VITEST,
5832
+ ...userOptions,
5833
+ depsUpgradeOptions: {
5834
+ ...userOptions.depsUpgradeOptions,
5835
+ exclude: [...userOptions.depsUpgradeOptions?.exclude ?? [], "astro"]
5836
+ }
5837
+ };
5838
+ super(options);
5839
+ const astroVersion = options.astroVersion ?? VERSION.ASTRO_VERSION;
5840
+ const astroTsconfigExtends = options.astroTsconfigExtends ?? "astro/tsconfigs/strict";
5841
+ this.package.addField("type", "module");
5842
+ this.tsconfig?.file.addOverride("extends", astroTsconfigExtends);
5843
+ this.tsconfig?.addInclude(".astro/types.d.ts");
5844
+ this.tsconfig?.addInclude("src/**/*.astro");
5845
+ this.compileTask.reset();
5846
+ this.compileTask.exec("astro check");
5847
+ this.compileTask.exec("astro build");
5848
+ this.tasks.tryFind("watch")?.reset("astro dev");
5849
+ this.packageTask.reset();
5850
+ if (!this.tasks.tryFind("dev")) {
5851
+ this.addTask("dev", {
5852
+ description: "Start the Astro dev server",
5853
+ exec: "astro dev",
5854
+ receiveArgs: true
5855
+ });
5856
+ }
5857
+ if (!this.tasks.tryFind("preview")) {
5858
+ this.addTask("preview", {
5859
+ description: "Preview the built site locally",
5860
+ exec: "astro preview",
5861
+ receiveArgs: true
5862
+ });
5863
+ }
5864
+ if (!this.tasks.tryFind("check")) {
5865
+ this.addTask("check", {
5866
+ description: "Run Astro's type and content checks",
5867
+ exec: "astro check"
5868
+ });
5869
+ }
5870
+ this.addDeps(`astro@${astroVersion}`);
5871
+ this.addDevDeps("@astrojs/check", "prettier-plugin-astro");
5872
+ const prettierConfig = this.tryFindObjectFile(".prettierrc.json");
5873
+ prettierConfig?.addOverride("plugins", ["prettier-plugin-astro"]);
5874
+ prettierConfig?.addOverride("overrides", [
5875
+ { files: "*.astro", options: { parser: "astro" } }
5876
+ ]);
5877
+ this.gitignore.addPatterns(".astro", ".vercel", ".netlify");
5878
+ const turbo = TurboRepo.of(this);
5879
+ if (turbo?.compileTask) {
5880
+ turbo.compileTask.inputs.push("public/**", "astro.config.mjs");
5881
+ }
5882
+ const integrations = options.integrations ?? [];
5883
+ this.astroConfig = new AstroConfig(this, {
5884
+ site: options.site,
5885
+ base: options.base,
5886
+ output: options.output,
5887
+ integrations,
5888
+ adapter: options.adapter
5889
+ });
5890
+ if (options.sampleCode === true) {
5891
+ new import_projen17.SampleFile(this, "src/pages/index.astro", {
5892
+ contents: DEFAULT_INDEX_ASTRO
5893
+ });
5894
+ new import_projen17.SampleFile(this, "public/favicon.svg", {
5895
+ contents: DEFAULT_FAVICON_SVG
5896
+ });
5897
+ }
5898
+ }
5899
+ };
5900
+ var DEFAULT_INDEX_ASTRO = `---
5901
+ // Welcome to Astro!
5902
+ ---
5903
+ <html lang="en">
5904
+ <head>
5905
+ <meta charset="utf-8" />
5906
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
5907
+ <meta name="viewport" content="width=device-width" />
5908
+ <title>Astro</title>
5909
+ </head>
5910
+ <body>
5911
+ <h1>Hello, Astro!</h1>
5912
+ </body>
5913
+ </html>
5914
+ `;
5915
+ var DEFAULT_FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path d="M64 8a56 56 0 1 0 0 112A56 56 0 0 0 64 8Z" fill="#ff5d01"/></svg>
5916
+ `;
5917
+
5666
5918
  // src/typescript/typescript-config.ts
5667
5919
  var import_node_path2 = require("path");
5668
- var import_projen16 = require("projen");
5920
+ var import_projen18 = require("projen");
5669
5921
  var import_path2 = require("projen/lib/util/path");
5670
- var TypeScriptConfig = class extends import_projen16.Component {
5922
+ var TypeScriptConfig = class extends import_projen18.Component {
5671
5923
  constructor(project) {
5672
5924
  super(project);
5673
5925
  let tsPaths = {};
@@ -5695,12 +5947,12 @@ var TypeScriptConfig = class extends import_projen16.Component {
5695
5947
 
5696
5948
  // src/workflows/aws-deploy-workflow.ts
5697
5949
  var import_utils11 = __toESM(require_lib());
5698
- var import_projen17 = require("projen");
5950
+ var import_projen19 = require("projen");
5699
5951
  var import_build = require("projen/lib/build");
5700
5952
  var import_github2 = require("projen/lib/github");
5701
5953
  var import_workflows_model5 = require("projen/lib/github/workflows-model");
5702
5954
  var PROD_DEPLOY_NAME = "prod-deploy";
5703
- var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen17.Component {
5955
+ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen19.Component {
5704
5956
  constructor(project, options = {}) {
5705
5957
  super(project);
5706
5958
  this.project = project;
@@ -5969,6 +6221,9 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen17.Compone
5969
6221
  AGENT_PLATFORM,
5970
6222
  AGENT_RULE_SCOPE,
5971
6223
  AgentConfig,
6224
+ AstroConfig,
6225
+ AstroOutput,
6226
+ AstroProject,
5972
6227
  AwsDeployWorkflow,
5973
6228
  AwsDeploymentConfig,
5974
6229
  AwsDeploymentTarget,