@codedrifters/configulator 0.0.315 → 0.0.317

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
@@ -27635,7 +27635,6 @@ var _TurboRepo = class _TurboRepo extends Component4 {
27635
27635
  ui: this.isRootProject ? this.ui : void 0,
27636
27636
  dangerouslyDisablePackageManagerCheck: this.isRootProject ? this.dangerouslyDisablePackageManagerCheck : void 0,
27637
27637
  cacheDir: this.isRootProject ? this.cacheDir : void 0,
27638
- daemon: this.isRootProject ? this.daemon : void 0,
27639
27638
  envMode: this.isRootProject ? this.envMode : void 0,
27640
27639
  /**
27641
27640
  * All tasks
@@ -34024,6 +34023,92 @@ var MonorepoProject = class extends TypeScriptAppProject {
34024
34023
  }
34025
34024
  };
34026
34025
 
34026
+ // src/typescript/tsdoc-config.ts
34027
+ import { Component as Component18, JsonFile as JsonFile6 } from "projen";
34028
+ var STANDARD_MODIFIER_TAGS = [
34029
+ "@default",
34030
+ "@defaultValue",
34031
+ "@experimental",
34032
+ "@internal"
34033
+ ];
34034
+ var ALWAYS_ON_SCOPES = ["@codedrifters"];
34035
+ var TsdocConfig = class _TsdocConfig extends Component18 {
34036
+ /**
34037
+ * Derive a workspace scope from a scoped package name (`@scope/name`).
34038
+ * Returns `undefined` when the name is unscoped.
34039
+ *
34040
+ * @internal
34041
+ */
34042
+ static scopeFromPackageName(packageName) {
34043
+ if (!packageName || !packageName.startsWith("@")) {
34044
+ return void 0;
34045
+ }
34046
+ const slash = packageName.indexOf("/");
34047
+ if (slash <= 1) {
34048
+ return void 0;
34049
+ }
34050
+ return packageName.slice(0, slash);
34051
+ }
34052
+ constructor(project, options = {}) {
34053
+ super(project);
34054
+ const scopeFromName = _TsdocConfig.scopeFromPackageName(
34055
+ project.package.packageName
34056
+ );
34057
+ const scopeSet = /* @__PURE__ */ new Set([
34058
+ ...ALWAYS_ON_SCOPES,
34059
+ ...scopeFromName ? [scopeFromName] : [],
34060
+ ...options.workspaceScopes ?? []
34061
+ ]);
34062
+ const tagSet = /* @__PURE__ */ new Set([
34063
+ ...STANDARD_MODIFIER_TAGS,
34064
+ ...Array.from(scopeSet),
34065
+ ...options.additionalModifierTags ?? []
34066
+ ]);
34067
+ const tagDefinitions = Array.from(tagSet).sort((a, b) => a.localeCompare(b)).map((tagName) => ({
34068
+ tagName,
34069
+ syntaxKind: "modifier",
34070
+ allowMultiple: true
34071
+ }));
34072
+ new JsonFile6(project, "tsdoc.json", {
34073
+ obj: {
34074
+ $schema: "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
34075
+ tagDefinitions
34076
+ }
34077
+ });
34078
+ project.addPackageIgnore("tsdoc.json");
34079
+ }
34080
+ };
34081
+
34082
+ // src/typescript/typescript-config.ts
34083
+ import { relative as relative7 } from "path";
34084
+ import { Component as Component19 } from "projen";
34085
+ import { ensureRelativePathStartsWithDot } from "projen/lib/util/path";
34086
+ var TypeScriptConfig = class extends Component19 {
34087
+ constructor(project) {
34088
+ super(project);
34089
+ let tsPaths = {};
34090
+ const workspaceDeps = project.deps.all.filter(
34091
+ (d) => d.version === "workspace:*"
34092
+ );
34093
+ workspaceDeps.forEach((dep) => {
34094
+ const subproject = project.root.subprojects.find((p) => p.package.packageName === dep.name);
34095
+ if (!subproject) {
34096
+ throw new Error(`Could not find subproject ${dep.name} in monorepo.`);
34097
+ }
34098
+ tsPaths = {
34099
+ ...tsPaths,
34100
+ [dep.name]: [
34101
+ ensureRelativePathStartsWithDot(
34102
+ relative7(project.outdir, subproject.outdir)
34103
+ )
34104
+ ]
34105
+ };
34106
+ });
34107
+ project.tsconfig?.file.addOverride("compilerOptions.paths", tsPaths);
34108
+ project.tsconfigDev?.file.addOverride("compilerOptions.paths", tsPaths);
34109
+ }
34110
+ };
34111
+
34027
34112
  // src/projects/typescript-project.ts
34028
34113
  var TestRunner = {
34029
34114
  JEST: "jest",
@@ -34159,34 +34244,46 @@ var TypeScriptProject = class extends typescript.TypeScriptProject {
34159
34244
  this.eslint?.addRules({
34160
34245
  "tsdoc/syntax": "warn"
34161
34246
  });
34162
- this.eslint?.addOverride({
34163
- files: ["src/**/*.ts"],
34164
- excludedFiles: ["**/*.test.*", "**/*.spec.*", "**/*.generated.ts"],
34165
- rules: {
34166
- "jsdoc/require-jsdoc": [
34167
- "warn",
34168
- {
34169
- publicOnly: true,
34170
- require: {
34171
- FunctionDeclaration: true,
34172
- ClassDeclaration: true
34173
- },
34174
- contexts: [
34175
- "ExportNamedDeclaration > FunctionDeclaration",
34176
- "ExportNamedDeclaration > ClassDeclaration",
34177
- "ExportNamedDeclaration > VariableDeclaration",
34178
- "ExportNamedDeclaration > TSInterfaceDeclaration",
34179
- "ExportNamedDeclaration > TSTypeAliasDeclaration",
34180
- "ExportNamedDeclaration > TSEnumDeclaration"
34181
- ],
34182
- checkConstructors: false,
34183
- checkGetters: false,
34184
- checkSetters: false,
34185
- enableFixer: false
34186
- }
34187
- ]
34188
- }
34189
- });
34247
+ const requireJsdoc = options.requireJsdoc ?? "off";
34248
+ if (requireJsdoc !== "off") {
34249
+ const publicOnly = requireJsdoc === "public";
34250
+ this.eslint?.addOverride({
34251
+ files: ["src/**/*.ts"],
34252
+ excludedFiles: ["**/*.test.*", "**/*.spec.*", "**/*.generated.ts"],
34253
+ rules: {
34254
+ "jsdoc/require-jsdoc": [
34255
+ "warn",
34256
+ {
34257
+ publicOnly,
34258
+ require: {
34259
+ FunctionDeclaration: true,
34260
+ ClassDeclaration: true
34261
+ },
34262
+ ...publicOnly ? {
34263
+ contexts: [
34264
+ "ExportNamedDeclaration > FunctionDeclaration",
34265
+ "ExportNamedDeclaration > ClassDeclaration",
34266
+ "ExportNamedDeclaration > VariableDeclaration",
34267
+ "ExportNamedDeclaration > TSInterfaceDeclaration",
34268
+ "ExportNamedDeclaration > TSTypeAliasDeclaration",
34269
+ "ExportNamedDeclaration > TSEnumDeclaration"
34270
+ ]
34271
+ } : {},
34272
+ checkConstructors: false,
34273
+ checkGetters: false,
34274
+ checkSetters: false,
34275
+ enableFixer: false
34276
+ }
34277
+ ]
34278
+ }
34279
+ });
34280
+ }
34281
+ if (options.tsdocConfig !== false) {
34282
+ new TsdocConfig(
34283
+ this,
34284
+ typeof options.tsdocConfig === "object" ? options.tsdocConfig : {}
34285
+ );
34286
+ }
34190
34287
  if (options.apiExtractor !== false) {
34191
34288
  new ApiExtractor(
34192
34289
  this,
@@ -34378,12 +34475,12 @@ import { merge as merge4 } from "ts-deepmerge";
34378
34475
 
34379
34476
  // src/workflows/aws-deploy-workflow.ts
34380
34477
  var import_utils11 = __toESM(require_lib());
34381
- import { Component as Component18 } from "projen";
34478
+ import { Component as Component20 } from "projen";
34382
34479
  import { BuildWorkflow } from "projen/lib/build";
34383
34480
  import { GitHub as GitHub4, WorkflowSteps as WorkflowSteps2 } from "projen/lib/github";
34384
34481
  import { JobPermission as JobPermission5 } from "projen/lib/github/workflows-model";
34385
34482
  var PROD_DEPLOY_NAME = "prod-deploy";
34386
- var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component18 {
34483
+ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component20 {
34387
34484
  constructor(project, options = {}) {
34388
34485
  super(project);
34389
34486
  this.project = project;
@@ -34647,7 +34744,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component18 {
34647
34744
  };
34648
34745
 
34649
34746
  // src/workflows/aws-teardown-workflow.ts
34650
- import { Component as Component19 } from "projen";
34747
+ import { Component as Component21 } from "projen";
34651
34748
  import { GitHub as GitHub5, GithubWorkflow } from "projen/lib/github";
34652
34749
  import { JobPermission as JobPermission6 } from "projen/lib/github/workflows-model";
34653
34750
  var DEFAULT_TEARDOWN_BRANCH_PATTERNS = [
@@ -34669,7 +34766,7 @@ var resolveBranchPatterns = (explicit, targets) => {
34669
34766
  }
34670
34767
  return [...DEFAULT_TEARDOWN_BRANCH_PATTERNS];
34671
34768
  };
34672
- var AwsTeardownWorkflow = class extends Component19 {
34769
+ var AwsTeardownWorkflow = class extends Component21 {
34673
34770
  constructor(rootProject, options) {
34674
34771
  super(rootProject);
34675
34772
  this.rootProject = rootProject;
@@ -35486,36 +35583,6 @@ export const collections = {
35486
35583
  docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
35487
35584
  };
35488
35585
  `;
35489
-
35490
- // src/typescript/typescript-config.ts
35491
- import { relative as relative7 } from "path";
35492
- import { Component as Component20 } from "projen";
35493
- import { ensureRelativePathStartsWithDot } from "projen/lib/util/path";
35494
- var TypeScriptConfig = class extends Component20 {
35495
- constructor(project) {
35496
- super(project);
35497
- let tsPaths = {};
35498
- const workspaceDeps = project.deps.all.filter(
35499
- (d) => d.version === "workspace:*"
35500
- );
35501
- workspaceDeps.forEach((dep) => {
35502
- const subproject = project.root.subprojects.find((p) => p.package.packageName === dep.name);
35503
- if (!subproject) {
35504
- throw new Error(`Could not find subproject ${dep.name} in monorepo.`);
35505
- }
35506
- tsPaths = {
35507
- ...tsPaths,
35508
- [dep.name]: [
35509
- ensureRelativePathStartsWithDot(
35510
- relative7(project.outdir, subproject.outdir)
35511
- )
35512
- ]
35513
- };
35514
- });
35515
- project.tsconfig?.file.addOverride("compilerOptions.paths", tsPaths);
35516
- project.tsconfigDev?.file.addOverride("compilerOptions.paths", tsPaths);
35517
- }
35518
- };
35519
35586
  export {
35520
35587
  AGENT_MODEL,
35521
35588
  AGENT_PLATFORM,
@@ -35628,6 +35695,7 @@ export {
35628
35695
  TIER_AWARE_BUNDLE_NAMES,
35629
35696
  TestRunner,
35630
35697
  TsDocCoverageKind,
35698
+ TsdocConfig,
35631
35699
  TurboRepo,
35632
35700
  TurboRepoTask,
35633
35701
  TypeScriptConfig,