@dbx-tools/projen 0.6.72 → 0.6.74
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/README.md +1 -1
- package/package.json +4 -4
- package/src/project.ts +45 -0
package/README.md
CHANGED
|
@@ -204,7 +204,7 @@ file contract as the CLI.
|
|
|
204
204
|
The engine registers its commands as projen tasks on the workspace root, so run
|
|
205
205
|
them with `bun run <task>` - `sync` (add `--watch`), `barrels`, `openapi`, and
|
|
206
206
|
`clean`.
|
|
207
|
-
[`@dbx-tools/cli`](../packages/cli/dbx-tools) is only needed to
|
|
207
|
+
[`@dbx-tools/cli`](../js-packages/cli/dbx-tools) is only needed to
|
|
208
208
|
bootstrap a folder that has no `.projenrc.ts` or toolchain yet.
|
|
209
209
|
|
|
210
210
|
## Run Tasks From The ROOT
|
package/package.json
CHANGED
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@clack/prompts": "^1.7.0",
|
|
29
|
-
"@dbx-tools/core": "0.6.
|
|
30
|
-
"@dbx-tools/path": "0.6.
|
|
31
|
-
"@dbx-tools/shared-core": "0.6.
|
|
29
|
+
"@dbx-tools/core": "0.6.74",
|
|
30
|
+
"@dbx-tools/path": "0.6.74",
|
|
31
|
+
"@dbx-tools/shared-core": "0.6.74",
|
|
32
32
|
"commander": "^15.0.0",
|
|
33
33
|
"concurrently": "^10.0.3",
|
|
34
34
|
"constructs": "^10.6.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"main": "index.ts",
|
|
49
49
|
"license": "Apache-2.0",
|
|
50
|
-
"version": "0.6.
|
|
50
|
+
"version": "0.6.74",
|
|
51
51
|
"types": "index.ts",
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
package/src/project.ts
CHANGED
|
@@ -743,6 +743,25 @@ class WorkspaceValidationTasks extends Component {
|
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
+
/**
|
|
747
|
+
* Bound the default validation workflows when a root opts into them.
|
|
748
|
+
*
|
|
749
|
+
* Projen otherwise leaves jobs at GitHub's six-hour ceiling. Missing workflows
|
|
750
|
+
* are a no-op, so roots that keep the engine defaults (`github`/build workflow
|
|
751
|
+
* off) do not gain new files.
|
|
752
|
+
*/
|
|
753
|
+
class WorkflowTimeouts extends Component {
|
|
754
|
+
public override preSynthesize(): void {
|
|
755
|
+
const build = this.project.tryFindObjectFile(".github/workflows/build.yml");
|
|
756
|
+
for (const job of ["build", "self-mutation"]) {
|
|
757
|
+
build?.addOverride(`jobs.${job}.timeout-minutes`, 30);
|
|
758
|
+
}
|
|
759
|
+
this.project
|
|
760
|
+
.tryFindObjectFile(".github/workflows/pull-request-lint.yml")
|
|
761
|
+
?.addOverride("jobs.validate.timeout-minutes", 10);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
746
765
|
/**
|
|
747
766
|
* Ignore each `codegen`-declaring package's `src/` from the root ESLint config.
|
|
748
767
|
* Those modules are read-only (ts-to-zod); lint `--fix` otherwise EACCES-crashes
|
|
@@ -770,6 +789,30 @@ class EslintIgnoreCodegen extends Component {
|
|
|
770
789
|
}
|
|
771
790
|
}
|
|
772
791
|
|
|
792
|
+
/**
|
|
793
|
+
* Keep generated package barrels and codegen modules out of root formatting.
|
|
794
|
+
*
|
|
795
|
+
* Their generators own the layout and may mark outputs read-only. Package paths
|
|
796
|
+
* are derived from attached subprojects so custom `packageRoots` need no manual
|
|
797
|
+
* Prettier patterns.
|
|
798
|
+
*/
|
|
799
|
+
class PrettierIgnoreGenerated extends Component {
|
|
800
|
+
public override preSynthesize(): void {
|
|
801
|
+
const prettier = javascript.Prettier.of(this.project);
|
|
802
|
+
if (!prettier) return;
|
|
803
|
+
const rootAbs = resolve(this.project.outdir);
|
|
804
|
+
for (const sub of this.project.subprojects) {
|
|
805
|
+
if (!(sub instanceof javascript.NodeProject)) continue;
|
|
806
|
+
const rel = toPosix(relative(rootAbs, sub.outdir));
|
|
807
|
+
prettier.addIgnorePattern(`${rel}/index.ts`);
|
|
808
|
+
const codegen = sub.package.manifest.codegen as { inputs?: string[] } | undefined;
|
|
809
|
+
for (const module of codegenModulePaths(codegen?.inputs ?? [])) {
|
|
810
|
+
prettier.addIgnorePattern(`${rel}/${module}`);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
773
816
|
/** Default leading path segment stripped from a package's name (not its tag). */
|
|
774
817
|
const DEFAULT_OMIT_RELATIVE_PREFIX = ["node"];
|
|
775
818
|
|
|
@@ -1096,6 +1139,8 @@ function initProject(
|
|
|
1096
1139
|
}
|
|
1097
1140
|
|
|
1098
1141
|
new WorkspaceValidationTasks(project);
|
|
1142
|
+
new WorkflowTimeouts(project);
|
|
1143
|
+
new PrettierIgnoreGenerated(project);
|
|
1099
1144
|
|
|
1100
1145
|
new GeneratedSource(project);
|
|
1101
1146
|
// The `bump` task (compute next version + commit + tag + push) is useful on
|