@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.mjs CHANGED
@@ -1392,7 +1392,29 @@ var meetingAnalysisBundle = {
1392
1392
  }
1393
1393
  ],
1394
1394
  skills: [processMeetingSkill],
1395
- subAgents: [meetingAnalystSubAgent]
1395
+ subAgents: [meetingAnalystSubAgent],
1396
+ labels: [
1397
+ {
1398
+ name: "meeting:extract",
1399
+ color: "C5DEF5",
1400
+ description: "Phase 1: raw extraction from a meeting transcript"
1401
+ },
1402
+ {
1403
+ name: "meeting:notes",
1404
+ color: "BFDADC",
1405
+ description: "Phase 2: curated notes derived from an extraction"
1406
+ },
1407
+ {
1408
+ name: "meeting:draft",
1409
+ color: "D4C5F9",
1410
+ description: "Phase 3: draft follow-up issues proposed from notes"
1411
+ },
1412
+ {
1413
+ name: "meeting:link",
1414
+ color: "FEF2C0",
1415
+ description: "Phase 4: linking/reconciling drafted issues with existing work"
1416
+ }
1417
+ ]
1396
1418
  };
1397
1419
 
1398
1420
  // src/agent/bundles/orchestrator.ts
@@ -2957,6 +2979,10 @@ import { TextFile } from "projen/lib/textfile";
2957
2979
 
2958
2980
  // src/versions.ts
2959
2981
  var VERSION = {
2982
+ /**
2983
+ * Version of Astro to pin for AstroProject scaffolding.
2984
+ */
2985
+ ASTRO_VERSION: "5.14.1",
2960
2986
  /**
2961
2987
  * CDK CLI for workflows and command line operations.
2962
2988
  *
@@ -3972,6 +3998,39 @@ var AgentConfig = class _AgentConfig extends Component8 {
3972
3998
  super(project);
3973
3999
  this.options = options;
3974
4000
  }
4001
+ /**
4002
+ * Returns the bundles that are active for this project: auto-detected
4003
+ * bundles (when `autoDetectBundles !== false`) plus force-included
4004
+ * bundles, minus explicitly excluded bundles. Deduplicated by name.
4005
+ *
4006
+ * Exposed so sibling components (e.g. the sync-labels workflow) can
4007
+ * consume bundle-contributed configuration.
4008
+ */
4009
+ get activeBundles() {
4010
+ const bundleMap = /* @__PURE__ */ new Map();
4011
+ if (this.options.autoDetectBundles !== false) {
4012
+ for (const bundle of BUILT_IN_BUNDLES) {
4013
+ if (this.options.excludeBundles?.includes(bundle.name)) {
4014
+ continue;
4015
+ }
4016
+ if (bundle.name === "base" && this.options.includeBaseRules === false) {
4017
+ continue;
4018
+ }
4019
+ if (bundle.appliesWhen(this.project)) {
4020
+ bundleMap.set(bundle.name, bundle);
4021
+ }
4022
+ }
4023
+ }
4024
+ if (this.options.includeBundles) {
4025
+ for (const bundleName of this.options.includeBundles) {
4026
+ const bundle = BUILT_IN_BUNDLES.find((b) => b.name === bundleName);
4027
+ if (bundle) {
4028
+ bundleMap.set(bundle.name, bundle);
4029
+ }
4030
+ }
4031
+ }
4032
+ return [...bundleMap.values()];
4033
+ }
3975
4034
  preSynthesize() {
3976
4035
  super.preSynthesize();
3977
4036
  const platforms = this.resolvePlatforms();
@@ -4307,11 +4366,91 @@ ${extra}`
4307
4366
  }
4308
4367
  };
4309
4368
 
4369
+ // src/astro/astro-config.ts
4370
+ import { Component as Component9 } from "projen";
4371
+ import { TextFile as TextFile4 } from "projen/lib/textfile";
4372
+ var AstroConfig = class _AstroConfig extends Component9 {
4373
+ constructor(project, options = {}) {
4374
+ super(project);
4375
+ this.project = project;
4376
+ this.configFilePath = "astro.config.mjs";
4377
+ this.site = options.site;
4378
+ this.base = options.base;
4379
+ this.output = options.output;
4380
+ this.integrations = options.integrations ?? [];
4381
+ this.adapter = options.adapter;
4382
+ this.synthesizeConfig();
4383
+ }
4384
+ /**
4385
+ * Find the AstroConfig component on a project.
4386
+ */
4387
+ static of(project) {
4388
+ const isAstroConfig = (c) => c instanceof _AstroConfig;
4389
+ return project.components.find(isAstroConfig);
4390
+ }
4391
+ /**
4392
+ * Render the config file contents as an array of lines.
4393
+ *
4394
+ * Exposed for unit testing — `synthesizeConfig` writes these to disk.
4395
+ */
4396
+ renderConfig() {
4397
+ const imports = [
4398
+ 'import { defineConfig } from "astro/config";'
4399
+ ];
4400
+ const specs = [
4401
+ ...this.integrations,
4402
+ ...this.adapter ? [this.adapter] : []
4403
+ ];
4404
+ for (const spec2 of specs) {
4405
+ imports.push(renderImport(spec2));
4406
+ }
4407
+ const body = [];
4408
+ if (this.site !== void 0) {
4409
+ body.push(` site: ${JSON.stringify(this.site)},`);
4410
+ }
4411
+ if (this.base !== void 0) {
4412
+ body.push(` base: ${JSON.stringify(this.base)},`);
4413
+ }
4414
+ if (this.output !== void 0) {
4415
+ body.push(` output: ${JSON.stringify(this.output)},`);
4416
+ }
4417
+ if (this.integrations.length > 0) {
4418
+ const calls = this.integrations.map(renderCall).join(", ");
4419
+ body.push(` integrations: [${calls}],`);
4420
+ }
4421
+ if (this.adapter) {
4422
+ body.push(` adapter: ${renderCall(this.adapter)},`);
4423
+ }
4424
+ return [...imports, "", "export default defineConfig({", ...body, "});"];
4425
+ }
4426
+ synthesizeConfig() {
4427
+ this.project.tryRemoveFile(this.configFilePath);
4428
+ new TextFile4(this, this.configFilePath, {
4429
+ lines: this.renderConfig()
4430
+ });
4431
+ }
4432
+ };
4433
+ function renderImport(spec2) {
4434
+ const asDefault = spec2.defaultImport ?? true;
4435
+ const binding = asDefault ? spec2.name : `{ ${spec2.name} }`;
4436
+ return `import ${binding} from ${JSON.stringify(spec2.importPath)};`;
4437
+ }
4438
+ function renderCall(spec2) {
4439
+ return `${spec2.name}(${spec2.args ?? ""})`;
4440
+ }
4441
+
4442
+ // src/astro/astro-config-options.ts
4443
+ var AstroOutput = {
4444
+ STATIC: "static",
4445
+ SERVER: "server",
4446
+ HYBRID: "hybrid"
4447
+ };
4448
+
4310
4449
  // src/aws/aws-deployment-config.ts
4311
4450
  var import_utils9 = __toESM(require_lib());
4312
4451
  import { join, relative as relative3 } from "path";
4313
- import { Component as Component9 } from "projen";
4314
- var AwsDeploymentConfig = class _AwsDeploymentConfig extends Component9 {
4452
+ import { Component as Component10 } from "projen";
4453
+ var AwsDeploymentConfig = class _AwsDeploymentConfig extends Component10 {
4315
4454
  constructor(project) {
4316
4455
  super(project);
4317
4456
  /**
@@ -4428,8 +4567,8 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends Component9 {
4428
4567
 
4429
4568
  // src/aws/aws-deployment-target.ts
4430
4569
  var import_utils10 = __toESM(require_lib());
4431
- import { Component as Component10 } from "projen";
4432
- var AwsDeploymentTarget = class _AwsDeploymentTarget extends Component10 {
4570
+ import { Component as Component11 } from "projen";
4571
+ var AwsDeploymentTarget = class _AwsDeploymentTarget extends Component11 {
4433
4572
  constructor(project, options) {
4434
4573
  super(project);
4435
4574
  /**
@@ -4627,6 +4766,7 @@ async function getLatestEligibleVersion(packageName, minimumReleaseAgeMinutes) {
4627
4766
 
4628
4767
  // src/version-package-map.ts
4629
4768
  var VERSION_NPM_PACKAGES = [
4769
+ { key: "ASTRO_VERSION", npmPackage: "astro" },
4630
4770
  { key: "AWS_CDK_CLI_VERSION", npmPackage: "aws-cdk" },
4631
4771
  { key: "AWS_CDK_LIB_VERSION", npmPackage: "aws-cdk-lib" },
4632
4772
  { key: "AWS_CONSTRUCTS_VERSION", npmPackage: "constructs" },
@@ -4645,12 +4785,12 @@ var VERSION_KEYS_SKIP = [
4645
4785
 
4646
4786
  // src/jsii/jsii-faker.ts
4647
4787
  import * as spec from "@jsii/spec";
4648
- import { Component as Component11, JsonFile as JsonFile4 } from "projen";
4788
+ import { Component as Component12, JsonFile as JsonFile4 } from "projen";
4649
4789
  var ProjenBaseFqn = {
4650
4790
  TYPESCRIPT_PROJECT: "projen.typescript.TypeScriptProject",
4651
4791
  TYPESCRIPT_PROJECT_OPTIONS: "projen.typescript.TypeScriptProjectOptions"
4652
4792
  };
4653
- var JsiiFaker = class _JsiiFaker extends Component11 {
4793
+ var JsiiFaker = class _JsiiFaker extends Component12 {
4654
4794
  constructor(project) {
4655
4795
  super(project);
4656
4796
  this.project = project;
@@ -4698,200 +4838,32 @@ var JsiiFaker = class _JsiiFaker extends Component11 {
4698
4838
  }
4699
4839
  };
4700
4840
 
4701
- // src/projects/monorepo-project.ts
4841
+ // src/projects/astro-project.ts
4842
+ import { SampleFile } from "projen";
4843
+
4844
+ // src/projects/typescript-project.ts
4845
+ import { typescript } from "projen";
4702
4846
  import {
4703
4847
  NodePackageManager as NodePackageManager2,
4848
+ Transform,
4704
4849
  UpgradeDependenciesSchedule as UpgradeDependenciesSchedule2
4705
4850
  } from "projen/lib/javascript";
4706
- import {
4707
- TypeScriptAppProject
4708
- } from "projen/lib/typescript";
4851
+ import { ReleaseTrigger } from "projen/lib/release";
4709
4852
  import { merge as merge2 } from "ts-deepmerge";
4710
4853
 
4711
- // src/tasks/reset-task.ts
4712
- import { Component as Component12 } from "projen";
4713
-
4714
- // src/projects/typescript-project.ts
4715
- import { typescript } from "projen";
4854
+ // src/projects/monorepo-project.ts
4716
4855
  import {
4717
4856
  NodePackageManager,
4718
- Transform,
4719
4857
  UpgradeDependenciesSchedule
4720
4858
  } from "projen/lib/javascript";
4721
- import { ReleaseTrigger } from "projen/lib/release";
4859
+ import {
4860
+ TypeScriptAppProject
4861
+ } from "projen/lib/typescript";
4722
4862
  import { merge } from "ts-deepmerge";
4723
- var TestRunner = {
4724
- JEST: "jest",
4725
- VITEST: "vitest"
4726
- };
4727
- var TypeScriptProject = class extends typescript.TypeScriptProject {
4728
- constructor(userOptions) {
4729
- const pnpmVersion = userOptions.parent && userOptions.parent instanceof MonorepoProject ? userOptions.parent.pnpmVersion : VERSION.PNPM_VERSION;
4730
- const pnpmWorkspace = userOptions.parent && userOptions.parent instanceof MonorepoProject ? PnpmWorkspace.of(userOptions.parent) : void 0;
4731
- const testRunner = userOptions.testRunner ?? TestRunner.JEST;
4732
- const useJest = testRunner === TestRunner.JEST;
4733
- const defaultOptions = {
4734
- /**
4735
- * This is a standard, so don't require it to passed in everywhere.
4736
- */
4737
- defaultReleaseBranch: "main",
4738
- /**
4739
- * Enable reset task by default.
4740
- */
4741
- resetTask: true,
4742
- /**
4743
- * Packaging options
4744
- */
4745
- packageManager: NodePackageManager.PNPM,
4746
- pnpmVersion,
4747
- licensed: userOptions.license !== void 0 || false,
4748
- copyrightOwner: "CodeDrifters",
4749
- release: false,
4750
- /**
4751
- * Don't add sample code.
4752
- */
4753
- sampleCode: false,
4754
- ...useJest ? {
4755
- /**
4756
- * Make sure jest config is stored outside of package.json
4757
- */
4758
- jestOptions: {
4759
- configFilePath: "jest.config.json",
4760
- jestConfig: {
4761
- roots: [`<rootDir>/src`],
4762
- transform: {
4763
- ["^.+\\.[t]sx?$"]: new Transform("@swc/jest")
4764
- },
4765
- moduleFileExtensions: ["js", "ts"]
4766
- }
4767
- },
4768
- /**
4769
- * SWC for faster testing
4770
- */
4771
- devDeps: ["@swc/jest", "@swc/core"]
4772
- } : {
4773
- jest: false,
4774
- devDeps: []
4775
- },
4776
- /**
4777
- * Turn on prettier formatting
4778
- */
4779
- prettier: true,
4780
- /**
4781
- * Don't package test files.
4782
- */
4783
- npmIgnoreOptions: {
4784
- ignorePatterns: ["*.spec.*", "*.test.*"]
4785
- },
4786
- /**
4787
- * Options for the automated dependency upgrade task / workflow
4788
- * Automatically exclude any packages that are managed by the root
4789
- * project as default catalog dependencies since we want to let the
4790
- * catalog manage those dependencies.
4791
- */
4792
- depsUpgrade: true,
4793
- depsUpgradeOptions: {
4794
- workflow: false,
4795
- exclude: Object.keys(pnpmWorkspace?.defaultCatalog || {}),
4796
- ...userOptions.parent && userOptions.parent instanceof MonorepoProject ? {
4797
- workflowOptions: {
4798
- schedule: UpgradeDependenciesSchedule.WEEKLY
4799
- },
4800
- cooldown: 1
4801
- } : {}
4802
- },
4803
- /**
4804
- * Only release when the package folder source content or package.json
4805
- * (version, dependencies) changes.
4806
- */
4807
- releaseTrigger: ReleaseTrigger.continuous({
4808
- paths: [
4809
- `${userOptions.outdir}/src/**`,
4810
- `${userOptions.outdir}/package.json`
4811
- ]
4812
- })
4813
- };
4814
- const options = merge(defaultOptions, userOptions);
4815
- super(options);
4816
- this.addDevDeps("@types/node@catalog:");
4817
- this.tsconfig?.addExclude("**/*.test.*");
4818
- this.tsconfig?.addExclude("**/*.spec.*");
4819
- if (options.testRunner === TestRunner.VITEST) {
4820
- new Vitest(this, {
4821
- config: {
4822
- include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
4823
- ...options.vitestOptions?.config
4824
- },
4825
- ...options.vitestOptions
4826
- });
4827
- } else {
4828
- this.deps.removeDependency("ts-jest");
4829
- }
4830
- this.package.file.addOverride(
4831
- "packageManager",
4832
- `pnpm@${options.pnpmVersion}`
4833
- );
4834
- this.eslint?.addOverride({
4835
- files: ["**/*.test.*", "**/*.spec.*"],
4836
- rules: {
4837
- "import/no-extraneous-dependencies": "off"
4838
- }
4839
- });
4840
- this.gitignore?.addPatterns(".DS_Store", "test-reports");
4841
- this.npmignore?.addPatterns("*.spec.*", "*.test.*", "__fixtures__");
4842
- const turboActive = userOptions.parent && TurboRepo.of(userOptions.parent) !== void 0;
4843
- if (turboActive) {
4844
- const turbo = new TurboRepo(this);
4845
- turbo.compileTask?.outputs.push("dist/**");
4846
- turbo.compileTask?.outputs.push("lib/**");
4847
- }
4848
- if (options.agentConfig === true || typeof options.agentConfig === "object") {
4849
- new AgentConfig(
4850
- this,
4851
- typeof options.agentConfig === "object" ? options.agentConfig : {}
4852
- );
4853
- }
4854
- if (options.resetTask !== false) {
4855
- const defaultResetTaskOptions = {
4856
- pathsToRemove: [
4857
- "node_modules",
4858
- "dist",
4859
- "lib",
4860
- "coverage",
4861
- "test-reports",
4862
- ".turbo",
4863
- "tsconfig.tsbuildinfo",
4864
- this.artifactsDirectory
4865
- ]
4866
- };
4867
- const userResetTaskOptions = options.resetTaskOptions ?? {};
4868
- const resetTaskOptions = merge(
4869
- defaultResetTaskOptions,
4870
- {
4871
- ...userResetTaskOptions,
4872
- pathsToRemove: [
4873
- ...defaultResetTaskOptions.pathsToRemove ?? [],
4874
- ...userResetTaskOptions.pathsToRemove ?? []
4875
- ]
4876
- }
4877
- );
4878
- new ResetTask(this, resetTaskOptions);
4879
- }
4880
- if (options.parent && options.parent instanceof MonorepoProject) {
4881
- const originalResolve = this.package.resolveDepsAndWritePackageJson;
4882
- this.package.installDependencies = () => {
4883
- options.parent.requestInstallDependencies({
4884
- resolveDepsAndWritePackageJson: () => originalResolve.apply(this.package)
4885
- });
4886
- };
4887
- this.package.resolveDepsAndWritePackageJson = () => {
4888
- };
4889
- }
4890
- }
4891
- };
4892
4863
 
4893
4864
  // src/tasks/reset-task.ts
4894
- var ResetTask = class _ResetTask extends Component12 {
4865
+ import { Component as Component13 } from "projen";
4866
+ var ResetTask = class _ResetTask extends Component13 {
4895
4867
  constructor(project, options = {}) {
4896
4868
  super(project);
4897
4869
  this.project = project;
@@ -4964,8 +4936,8 @@ var ResetTask = class _ResetTask extends Component12 {
4964
4936
  };
4965
4937
 
4966
4938
  // src/vscode/vscode.ts
4967
- import { Component as Component13, vscode } from "projen";
4968
- var VSCodeConfig = class extends Component13 {
4939
+ import { Component as Component14, vscode } from "projen";
4940
+ var VSCodeConfig = class extends Component14 {
4969
4941
  constructor(project) {
4970
4942
  super(project);
4971
4943
  const vsConfig = new vscode.VsCode(project);
@@ -5111,7 +5083,7 @@ function addBuildCompleteJob(buildWorkflow) {
5111
5083
  }
5112
5084
 
5113
5085
  // src/workflows/sync-labels.ts
5114
- import { Component as Component14, YamlFile as YamlFile2 } from "projen";
5086
+ import { Component as Component15, YamlFile as YamlFile2 } from "projen";
5115
5087
  import { JobPermission as JobPermission4 } from "projen/lib/github/workflows-model";
5116
5088
  var DEFAULT_STATUS_LABELS = [
5117
5089
  {
@@ -5244,12 +5216,25 @@ var LABELS_CONFIG_PATH = ".github/labels.yml";
5244
5216
  function addSyncLabelsWorkflow(project, options) {
5245
5217
  const workflowName = options.workflowName ?? DEFAULT_WORKFLOW_NAME2;
5246
5218
  const deleteOtherLabels = options.deleteOtherLabels ?? true;
5247
- const allLabels = [
5248
- ...DEFAULT_STATUS_LABELS,
5249
- ...DEFAULT_PRIORITY_LABELS,
5250
- ...DEFAULT_TYPE_LABELS,
5251
- ...options.labels ?? []
5252
- ];
5219
+ const labelMap = /* @__PURE__ */ new Map();
5220
+ for (const label of DEFAULT_STATUS_LABELS) {
5221
+ labelMap.set(label.name, label);
5222
+ }
5223
+ for (const label of DEFAULT_PRIORITY_LABELS) {
5224
+ labelMap.set(label.name, label);
5225
+ }
5226
+ for (const label of DEFAULT_TYPE_LABELS) {
5227
+ labelMap.set(label.name, label);
5228
+ }
5229
+ for (const bundle of options.bundles ?? []) {
5230
+ for (const label of bundle.labels ?? []) {
5231
+ labelMap.set(label.name, label);
5232
+ }
5233
+ }
5234
+ for (const label of options.labels ?? []) {
5235
+ labelMap.set(label.name, label);
5236
+ }
5237
+ const allLabels = [...labelMap.values()];
5253
5238
  new LabelsFile(project, allLabels);
5254
5239
  const workflow = project.github?.addWorkflow(workflowName);
5255
5240
  if (!workflow) {
@@ -5288,7 +5273,7 @@ function addSyncLabelsWorkflow(project, options) {
5288
5273
  }
5289
5274
  });
5290
5275
  }
5291
- var LabelsFile = class extends Component14 {
5276
+ var LabelsFile = class extends Component15 {
5292
5277
  constructor(project, labels) {
5293
5278
  super(project);
5294
5279
  new YamlFile2(project, LABELS_CONFIG_PATH, {
@@ -5400,7 +5385,7 @@ var MonorepoProject = class extends TypeScriptAppProject {
5400
5385
  depsUpgradeOptions: {
5401
5386
  exclude: ["@codedrifters/configulator"],
5402
5387
  workflowOptions: {
5403
- schedule: UpgradeDependenciesSchedule2.DAILY
5388
+ schedule: UpgradeDependenciesSchedule.DAILY
5404
5389
  },
5405
5390
  cooldown: 1
5406
5391
  },
@@ -5461,7 +5446,7 @@ var MonorepoProject = class extends TypeScriptAppProject {
5461
5446
  * Use PNPM instead of the default (Yarn). Much of the ecosystem depends
5462
5447
  * on PNPM and making monorepos PNPM only simplifies many configurations.
5463
5448
  */
5464
- packageManager: NodePackageManager2.PNPM,
5449
+ packageManager: NodePackageManager.PNPM,
5465
5450
  /**
5466
5451
  * Some additional pre-build steps if we're using turbo's remote cache.
5467
5452
  * Set GIT_BRANCH_NAME so Turborepo remote cache hashes match between local and CI.
@@ -5482,7 +5467,7 @@ var MonorepoProject = class extends TypeScriptAppProject {
5482
5467
  ]
5483
5468
  }
5484
5469
  };
5485
- const options = merge2(
5470
+ const options = merge(
5486
5471
  defaultOptions,
5487
5472
  userOptions,
5488
5473
  requiredOptions
@@ -5518,7 +5503,7 @@ var MonorepoProject = class extends TypeScriptAppProject {
5518
5503
  pathsToRemove: ["node_modules", ".turbo", "dist", "lib"]
5519
5504
  };
5520
5505
  const userResetTaskOptions = options.resetTaskOptions ?? {};
5521
- const resetTaskOptions = merge2(
5506
+ const resetTaskOptions = merge(
5522
5507
  defaultResetTaskOptions,
5523
5508
  {
5524
5509
  ...userResetTaskOptions,
@@ -5552,10 +5537,12 @@ var MonorepoProject = class extends TypeScriptAppProject {
5552
5537
  );
5553
5538
  }
5554
5539
  if (options.syncLabels !== false) {
5555
- addSyncLabelsWorkflow(
5556
- this,
5557
- typeof options.syncLabels === "object" ? options.syncLabels : {}
5558
- );
5540
+ const syncLabelsOptions = typeof options.syncLabels === "object" ? options.syncLabels : {};
5541
+ const agentConfig = AgentConfig.of(this);
5542
+ addSyncLabelsWorkflow(this, {
5543
+ ...syncLabelsOptions,
5544
+ bundles: syncLabelsOptions.bundles ?? agentConfig?.activeBundles
5545
+ });
5559
5546
  }
5560
5547
  if (this.buildWorkflow) {
5561
5548
  addBuildCompleteJob(this.buildWorkflow);
@@ -5613,11 +5600,273 @@ var MonorepoProject = class extends TypeScriptAppProject {
5613
5600
  }
5614
5601
  };
5615
5602
 
5603
+ // src/projects/typescript-project.ts
5604
+ var TestRunner = {
5605
+ JEST: "jest",
5606
+ VITEST: "vitest"
5607
+ };
5608
+ var TypeScriptProject = class extends typescript.TypeScriptProject {
5609
+ constructor(userOptions) {
5610
+ const pnpmVersion = userOptions.parent && userOptions.parent instanceof MonorepoProject ? userOptions.parent.pnpmVersion : VERSION.PNPM_VERSION;
5611
+ const pnpmWorkspace = userOptions.parent && userOptions.parent instanceof MonorepoProject ? PnpmWorkspace.of(userOptions.parent) : void 0;
5612
+ const testRunner = userOptions.testRunner ?? TestRunner.JEST;
5613
+ const useJest = testRunner === TestRunner.JEST;
5614
+ const defaultOptions = {
5615
+ /**
5616
+ * This is a standard, so don't require it to passed in everywhere.
5617
+ */
5618
+ defaultReleaseBranch: "main",
5619
+ /**
5620
+ * Enable reset task by default.
5621
+ */
5622
+ resetTask: true,
5623
+ /**
5624
+ * Packaging options
5625
+ */
5626
+ packageManager: NodePackageManager2.PNPM,
5627
+ pnpmVersion,
5628
+ licensed: userOptions.license !== void 0 || false,
5629
+ copyrightOwner: "CodeDrifters",
5630
+ release: false,
5631
+ /**
5632
+ * Don't add sample code.
5633
+ */
5634
+ sampleCode: false,
5635
+ ...useJest ? {
5636
+ /**
5637
+ * Make sure jest config is stored outside of package.json
5638
+ */
5639
+ jestOptions: {
5640
+ configFilePath: "jest.config.json",
5641
+ jestConfig: {
5642
+ roots: [`<rootDir>/src`],
5643
+ transform: {
5644
+ ["^.+\\.[t]sx?$"]: new Transform("@swc/jest")
5645
+ },
5646
+ moduleFileExtensions: ["js", "ts"]
5647
+ }
5648
+ },
5649
+ /**
5650
+ * SWC for faster testing
5651
+ */
5652
+ devDeps: ["@swc/jest", "@swc/core"]
5653
+ } : {
5654
+ jest: false,
5655
+ devDeps: []
5656
+ },
5657
+ /**
5658
+ * Turn on prettier formatting
5659
+ */
5660
+ prettier: true,
5661
+ /**
5662
+ * Don't package test files.
5663
+ */
5664
+ npmIgnoreOptions: {
5665
+ ignorePatterns: ["*.spec.*", "*.test.*"]
5666
+ },
5667
+ /**
5668
+ * Options for the automated dependency upgrade task / workflow
5669
+ * Automatically exclude any packages that are managed by the root
5670
+ * project as default catalog dependencies since we want to let the
5671
+ * catalog manage those dependencies.
5672
+ */
5673
+ depsUpgrade: true,
5674
+ depsUpgradeOptions: {
5675
+ workflow: false,
5676
+ exclude: Object.keys(pnpmWorkspace?.defaultCatalog || {}),
5677
+ ...userOptions.parent && userOptions.parent instanceof MonorepoProject ? {
5678
+ workflowOptions: {
5679
+ schedule: UpgradeDependenciesSchedule2.WEEKLY
5680
+ },
5681
+ cooldown: 1
5682
+ } : {}
5683
+ },
5684
+ /**
5685
+ * Only release when the package folder source content or package.json
5686
+ * (version, dependencies) changes.
5687
+ */
5688
+ releaseTrigger: ReleaseTrigger.continuous({
5689
+ paths: [
5690
+ `${userOptions.outdir}/src/**`,
5691
+ `${userOptions.outdir}/package.json`
5692
+ ]
5693
+ })
5694
+ };
5695
+ const options = merge2(defaultOptions, userOptions);
5696
+ super(options);
5697
+ this.addDevDeps("@types/node@catalog:");
5698
+ this.tsconfig?.addExclude("**/*.test.*");
5699
+ this.tsconfig?.addExclude("**/*.spec.*");
5700
+ if (options.testRunner === TestRunner.VITEST) {
5701
+ new Vitest(this, {
5702
+ config: {
5703
+ include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
5704
+ ...options.vitestOptions?.config
5705
+ },
5706
+ ...options.vitestOptions
5707
+ });
5708
+ } else {
5709
+ this.deps.removeDependency("ts-jest");
5710
+ }
5711
+ this.package.file.addOverride(
5712
+ "packageManager",
5713
+ `pnpm@${options.pnpmVersion}`
5714
+ );
5715
+ this.eslint?.addOverride({
5716
+ files: ["**/*.test.*", "**/*.spec.*"],
5717
+ rules: {
5718
+ "import/no-extraneous-dependencies": "off"
5719
+ }
5720
+ });
5721
+ this.gitignore?.addPatterns(".DS_Store", "test-reports");
5722
+ this.npmignore?.addPatterns("*.spec.*", "*.test.*", "__fixtures__");
5723
+ const turboActive = userOptions.parent && TurboRepo.of(userOptions.parent) !== void 0;
5724
+ if (turboActive) {
5725
+ const turbo = new TurboRepo(this);
5726
+ turbo.compileTask?.outputs.push("dist/**");
5727
+ turbo.compileTask?.outputs.push("lib/**");
5728
+ }
5729
+ if (options.agentConfig === true || typeof options.agentConfig === "object") {
5730
+ new AgentConfig(
5731
+ this,
5732
+ typeof options.agentConfig === "object" ? options.agentConfig : {}
5733
+ );
5734
+ }
5735
+ if (options.resetTask !== false) {
5736
+ const defaultResetTaskOptions = {
5737
+ pathsToRemove: [
5738
+ "node_modules",
5739
+ "dist",
5740
+ "lib",
5741
+ "coverage",
5742
+ "test-reports",
5743
+ ".turbo",
5744
+ "tsconfig.tsbuildinfo",
5745
+ this.artifactsDirectory
5746
+ ]
5747
+ };
5748
+ const userResetTaskOptions = options.resetTaskOptions ?? {};
5749
+ const resetTaskOptions = merge2(
5750
+ defaultResetTaskOptions,
5751
+ {
5752
+ ...userResetTaskOptions,
5753
+ pathsToRemove: [
5754
+ ...defaultResetTaskOptions.pathsToRemove ?? [],
5755
+ ...userResetTaskOptions.pathsToRemove ?? []
5756
+ ]
5757
+ }
5758
+ );
5759
+ new ResetTask(this, resetTaskOptions);
5760
+ }
5761
+ if (options.parent && options.parent instanceof MonorepoProject) {
5762
+ const originalResolve = this.package.resolveDepsAndWritePackageJson;
5763
+ this.package.installDependencies = () => {
5764
+ options.parent.requestInstallDependencies({
5765
+ resolveDepsAndWritePackageJson: () => originalResolve.apply(this.package)
5766
+ });
5767
+ };
5768
+ this.package.resolveDepsAndWritePackageJson = () => {
5769
+ };
5770
+ }
5771
+ }
5772
+ };
5773
+
5774
+ // src/projects/astro-project.ts
5775
+ var AstroProject = class extends TypeScriptProject {
5776
+ constructor(userOptions) {
5777
+ const options = {
5778
+ testRunner: TestRunner.VITEST,
5779
+ ...userOptions,
5780
+ depsUpgradeOptions: {
5781
+ ...userOptions.depsUpgradeOptions,
5782
+ exclude: [...userOptions.depsUpgradeOptions?.exclude ?? [], "astro"]
5783
+ }
5784
+ };
5785
+ super(options);
5786
+ const astroVersion = options.astroVersion ?? VERSION.ASTRO_VERSION;
5787
+ const astroTsconfigExtends = options.astroTsconfigExtends ?? "astro/tsconfigs/strict";
5788
+ this.package.addField("type", "module");
5789
+ this.tsconfig?.file.addOverride("extends", astroTsconfigExtends);
5790
+ this.tsconfig?.addInclude(".astro/types.d.ts");
5791
+ this.tsconfig?.addInclude("src/**/*.astro");
5792
+ this.compileTask.reset();
5793
+ this.compileTask.exec("astro check");
5794
+ this.compileTask.exec("astro build");
5795
+ this.tasks.tryFind("watch")?.reset("astro dev");
5796
+ this.packageTask.reset();
5797
+ if (!this.tasks.tryFind("dev")) {
5798
+ this.addTask("dev", {
5799
+ description: "Start the Astro dev server",
5800
+ exec: "astro dev",
5801
+ receiveArgs: true
5802
+ });
5803
+ }
5804
+ if (!this.tasks.tryFind("preview")) {
5805
+ this.addTask("preview", {
5806
+ description: "Preview the built site locally",
5807
+ exec: "astro preview",
5808
+ receiveArgs: true
5809
+ });
5810
+ }
5811
+ if (!this.tasks.tryFind("check")) {
5812
+ this.addTask("check", {
5813
+ description: "Run Astro's type and content checks",
5814
+ exec: "astro check"
5815
+ });
5816
+ }
5817
+ this.addDeps(`astro@${astroVersion}`);
5818
+ this.addDevDeps("@astrojs/check", "prettier-plugin-astro");
5819
+ const prettierConfig = this.tryFindObjectFile(".prettierrc.json");
5820
+ prettierConfig?.addOverride("plugins", ["prettier-plugin-astro"]);
5821
+ prettierConfig?.addOverride("overrides", [
5822
+ { files: "*.astro", options: { parser: "astro" } }
5823
+ ]);
5824
+ this.gitignore.addPatterns(".astro", ".vercel", ".netlify");
5825
+ const turbo = TurboRepo.of(this);
5826
+ if (turbo?.compileTask) {
5827
+ turbo.compileTask.inputs.push("public/**", "astro.config.mjs");
5828
+ }
5829
+ const integrations = options.integrations ?? [];
5830
+ this.astroConfig = new AstroConfig(this, {
5831
+ site: options.site,
5832
+ base: options.base,
5833
+ output: options.output,
5834
+ integrations,
5835
+ adapter: options.adapter
5836
+ });
5837
+ if (options.sampleCode === true) {
5838
+ new SampleFile(this, "src/pages/index.astro", {
5839
+ contents: DEFAULT_INDEX_ASTRO
5840
+ });
5841
+ new SampleFile(this, "public/favicon.svg", {
5842
+ contents: DEFAULT_FAVICON_SVG
5843
+ });
5844
+ }
5845
+ }
5846
+ };
5847
+ var DEFAULT_INDEX_ASTRO = `---
5848
+ // Welcome to Astro!
5849
+ ---
5850
+ <html lang="en">
5851
+ <head>
5852
+ <meta charset="utf-8" />
5853
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
5854
+ <meta name="viewport" content="width=device-width" />
5855
+ <title>Astro</title>
5856
+ </head>
5857
+ <body>
5858
+ <h1>Hello, Astro!</h1>
5859
+ </body>
5860
+ </html>
5861
+ `;
5862
+ 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>
5863
+ `;
5864
+
5616
5865
  // src/typescript/typescript-config.ts
5617
5866
  import { relative as relative4 } from "path";
5618
- import { Component as Component15 } from "projen";
5867
+ import { Component as Component16 } from "projen";
5619
5868
  import { ensureRelativePathStartsWithDot } from "projen/lib/util/path";
5620
- var TypeScriptConfig = class extends Component15 {
5869
+ var TypeScriptConfig = class extends Component16 {
5621
5870
  constructor(project) {
5622
5871
  super(project);
5623
5872
  let tsPaths = {};
@@ -5645,12 +5894,12 @@ var TypeScriptConfig = class extends Component15 {
5645
5894
 
5646
5895
  // src/workflows/aws-deploy-workflow.ts
5647
5896
  var import_utils11 = __toESM(require_lib());
5648
- import { Component as Component16 } from "projen";
5897
+ import { Component as Component17 } from "projen";
5649
5898
  import { BuildWorkflow } from "projen/lib/build";
5650
5899
  import { GitHub as GitHub2 } from "projen/lib/github";
5651
5900
  import { JobPermission as JobPermission5 } from "projen/lib/github/workflows-model";
5652
5901
  var PROD_DEPLOY_NAME = "prod-deploy";
5653
- var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component16 {
5902
+ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component17 {
5654
5903
  constructor(project, options = {}) {
5655
5904
  super(project);
5656
5905
  this.project = project;
@@ -5918,6 +6167,9 @@ export {
5918
6167
  AGENT_PLATFORM,
5919
6168
  AGENT_RULE_SCOPE,
5920
6169
  AgentConfig,
6170
+ AstroConfig,
6171
+ AstroOutput,
6172
+ AstroProject,
5921
6173
  AwsDeployWorkflow,
5922
6174
  AwsDeploymentConfig,
5923
6175
  AwsDeploymentTarget,