@codedrifters/configulator 0.0.155 → 0.0.156
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.d.mts +311 -1
- package/lib/index.d.ts +312 -2
- package/lib/index.js +243 -41
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +224 -24
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -192,6 +192,7 @@ __export(index_exports, {
|
|
|
192
192
|
MonorepoProject: () => MonorepoProject,
|
|
193
193
|
PROD_DEPLOY_NAME: () => PROD_DEPLOY_NAME,
|
|
194
194
|
PnpmWorkspace: () => PnpmWorkspace,
|
|
195
|
+
ProjectMetadata: () => ProjectMetadata,
|
|
195
196
|
ROOT_CI_TASK_NAME: () => ROOT_CI_TASK_NAME,
|
|
196
197
|
ROOT_TURBO_TASK_NAME: () => ROOT_TURBO_TASK_NAME,
|
|
197
198
|
ResetTask: () => ResetTask,
|
|
@@ -213,6 +214,7 @@ __export(index_exports, {
|
|
|
213
214
|
jestBundle: () => jestBundle,
|
|
214
215
|
pnpmBundle: () => pnpmBundle,
|
|
215
216
|
projenBundle: () => projenBundle,
|
|
217
|
+
resolveTemplateVariables: () => resolveTemplateVariables,
|
|
216
218
|
turborepoBundle: () => turborepoBundle,
|
|
217
219
|
typescriptBundle: () => typescriptBundle,
|
|
218
220
|
vitestBundle: () => vitestBundle
|
|
@@ -220,7 +222,7 @@ __export(index_exports, {
|
|
|
220
222
|
module.exports = __toCommonJS(index_exports);
|
|
221
223
|
|
|
222
224
|
// src/agent/agent-config.ts
|
|
223
|
-
var
|
|
225
|
+
var import_projen8 = require("projen");
|
|
224
226
|
|
|
225
227
|
// src/agent/types.ts
|
|
226
228
|
var AGENT_RULE_SCOPE = {
|
|
@@ -343,6 +345,9 @@ var baseBundle = {
|
|
|
343
345
|
content: [
|
|
344
346
|
"# Project Overview",
|
|
345
347
|
"",
|
|
348
|
+
"**Repository:** {{repository.owner}}/{{repository.name}}",
|
|
349
|
+
"**Default branch:** {{repository.defaultBranch}}",
|
|
350
|
+
"",
|
|
346
351
|
"## Important Notes",
|
|
347
352
|
"",
|
|
348
353
|
"- **Never edit generated files** \u2014 they are marked with `// ~~ Generated by projen`",
|
|
@@ -1303,8 +1308,78 @@ var BUILT_IN_BUNDLES = [
|
|
|
1303
1308
|
projenBundle
|
|
1304
1309
|
];
|
|
1305
1310
|
|
|
1306
|
-
// src/
|
|
1311
|
+
// src/projects/project-metadata.ts
|
|
1307
1312
|
var import_projen5 = require("projen");
|
|
1313
|
+
var import_javascript2 = require("projen/lib/javascript");
|
|
1314
|
+
var GITHUB_HTTPS_RE = /(?:https?:\/\/|git\+https:\/\/)github\.com\/([^/]+)\/([^/.]+)(?:\.git)?/;
|
|
1315
|
+
var GITHUB_SSH_RE = /git@github\.com:([^/]+)\/([^/.]+)(?:\.git)?/;
|
|
1316
|
+
function parseGitHubUrl(url) {
|
|
1317
|
+
const httpsMatch = url.match(GITHUB_HTTPS_RE);
|
|
1318
|
+
if (httpsMatch) {
|
|
1319
|
+
return { owner: httpsMatch[1], name: httpsMatch[2] };
|
|
1320
|
+
}
|
|
1321
|
+
const sshMatch = url.match(GITHUB_SSH_RE);
|
|
1322
|
+
if (sshMatch) {
|
|
1323
|
+
return { owner: sshMatch[1], name: sshMatch[2] };
|
|
1324
|
+
}
|
|
1325
|
+
return { owner: void 0, name: void 0 };
|
|
1326
|
+
}
|
|
1327
|
+
var ProjectMetadata = class _ProjectMetadata extends import_projen5.Component {
|
|
1328
|
+
/**
|
|
1329
|
+
* Returns the ProjectMetadata instance for a project, or undefined
|
|
1330
|
+
* if the component has not been added.
|
|
1331
|
+
*/
|
|
1332
|
+
static of(project) {
|
|
1333
|
+
const isProjectMetadata = (c) => c instanceof _ProjectMetadata;
|
|
1334
|
+
return project.components.find(isProjectMetadata);
|
|
1335
|
+
}
|
|
1336
|
+
constructor(project, options = {}) {
|
|
1337
|
+
super(project);
|
|
1338
|
+
this.metadata = this.resolveMetadata(options);
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Merges explicit options with auto-detected values.
|
|
1342
|
+
* Auto-detection reads the repository URL from package.json
|
|
1343
|
+
* (via Projen's NodePackage manifest) and parses GitHub owner/name.
|
|
1344
|
+
* Explicit options always take precedence over auto-detected values.
|
|
1345
|
+
*/
|
|
1346
|
+
resolveMetadata(options) {
|
|
1347
|
+
const autoDetected = this.autoDetectRepository();
|
|
1348
|
+
return {
|
|
1349
|
+
repository: {
|
|
1350
|
+
owner: options.repository?.owner ?? autoDetected.owner,
|
|
1351
|
+
name: options.repository?.name ?? autoDetected.name,
|
|
1352
|
+
defaultBranch: options.repository?.defaultBranch ?? "main"
|
|
1353
|
+
},
|
|
1354
|
+
githubProject: options.githubProject,
|
|
1355
|
+
organization: options.organization,
|
|
1356
|
+
slack: options.slack,
|
|
1357
|
+
labels: options.labels,
|
|
1358
|
+
milestones: options.milestones,
|
|
1359
|
+
docsPath: options.docsPath,
|
|
1360
|
+
deployment: options.deployment
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Attempts to auto-detect repository owner and name from the Projen
|
|
1365
|
+
* project's package.json repository field.
|
|
1366
|
+
*/
|
|
1367
|
+
autoDetectRepository() {
|
|
1368
|
+
if (!(this.project instanceof import_javascript2.NodeProject)) {
|
|
1369
|
+
return { owner: void 0, name: void 0 };
|
|
1370
|
+
}
|
|
1371
|
+
const manifest = this.project.package.manifest;
|
|
1372
|
+
const repoField = manifest.repository;
|
|
1373
|
+
if (!repoField) {
|
|
1374
|
+
return { owner: void 0, name: void 0 };
|
|
1375
|
+
}
|
|
1376
|
+
const url = typeof repoField === "string" ? repoField : repoField.url ?? "";
|
|
1377
|
+
return parseGitHubUrl(url);
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
// src/agent/renderers/claude-renderer.ts
|
|
1382
|
+
var import_projen6 = require("projen");
|
|
1308
1383
|
var import_textfile2 = require("projen/lib/textfile");
|
|
1309
1384
|
var GENERATED_MARKER = "<!-- ~~ Generated by @codedrifters/configulator. Edits welcome \u2014 please contribute improvements back. ~~ -->";
|
|
1310
1385
|
var ClaudeRenderer = class _ClaudeRenderer {
|
|
@@ -1465,7 +1540,7 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1465
1540
|
hasContent = true;
|
|
1466
1541
|
}
|
|
1467
1542
|
if (!hasContent) return;
|
|
1468
|
-
new
|
|
1543
|
+
new import_projen6.JsonFile(component, ".claude/settings.json", { obj });
|
|
1469
1544
|
}
|
|
1470
1545
|
static buildSandboxObj(sandbox) {
|
|
1471
1546
|
const obj = {};
|
|
@@ -1603,7 +1678,7 @@ var CopilotRenderer = class {
|
|
|
1603
1678
|
};
|
|
1604
1679
|
|
|
1605
1680
|
// src/agent/renderers/cursor-renderer.ts
|
|
1606
|
-
var
|
|
1681
|
+
var import_projen7 = require("projen");
|
|
1607
1682
|
var import_textfile3 = require("projen/lib/textfile");
|
|
1608
1683
|
var GENERATED_MARKER2 = "# ~~ Generated by @codedrifters/configulator. Edits welcome \u2014 please contribute improvements back. ~~";
|
|
1609
1684
|
var CursorRenderer = class _CursorRenderer {
|
|
@@ -1698,7 +1773,7 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1698
1773
|
if (config.env) server.env = { ...config.env };
|
|
1699
1774
|
servers[name] = server;
|
|
1700
1775
|
}
|
|
1701
|
-
new
|
|
1776
|
+
new import_projen7.JsonFile(component, ".cursor/mcp.json", { obj });
|
|
1702
1777
|
}
|
|
1703
1778
|
static renderHooks(component, settings) {
|
|
1704
1779
|
if (!settings?.hooks) return;
|
|
@@ -1736,7 +1811,7 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1736
1811
|
}
|
|
1737
1812
|
if (stop?.length) hooks.stop = stop.map((h) => ({ command: h.command }));
|
|
1738
1813
|
if (Object.keys(hooks).length === 0) return;
|
|
1739
|
-
new
|
|
1814
|
+
new import_projen7.JsonFile(component, ".cursor/hooks.json", {
|
|
1740
1815
|
obj: { version: 1, hooks }
|
|
1741
1816
|
});
|
|
1742
1817
|
}
|
|
@@ -1754,8 +1829,57 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1754
1829
|
}
|
|
1755
1830
|
};
|
|
1756
1831
|
|
|
1832
|
+
// src/agent/template-resolver.ts
|
|
1833
|
+
var FALLBACKS = {
|
|
1834
|
+
"repository.owner": "<owner>",
|
|
1835
|
+
"repository.name": "<repo>",
|
|
1836
|
+
"repository.defaultBranch": "main",
|
|
1837
|
+
"organization.name": "<organization>",
|
|
1838
|
+
"organization.githubOrg": "<org>",
|
|
1839
|
+
"githubProject.name": "<project-name>",
|
|
1840
|
+
"githubProject.number": "<project-number>",
|
|
1841
|
+
"githubProject.nodeId": "<project-node-id>",
|
|
1842
|
+
docsPath: "<docs-path>"
|
|
1843
|
+
};
|
|
1844
|
+
var TEMPLATE_RE = /\{\{(\w+(?:\.\w+)*)\}\}/g;
|
|
1845
|
+
function getNestedValue(obj, path) {
|
|
1846
|
+
const parts = path.split(".");
|
|
1847
|
+
let current = obj;
|
|
1848
|
+
for (const part of parts) {
|
|
1849
|
+
if (current == null || typeof current !== "object") {
|
|
1850
|
+
return void 0;
|
|
1851
|
+
}
|
|
1852
|
+
current = current[part];
|
|
1853
|
+
}
|
|
1854
|
+
if (current == null) {
|
|
1855
|
+
return void 0;
|
|
1856
|
+
}
|
|
1857
|
+
return String(current);
|
|
1858
|
+
}
|
|
1859
|
+
function resolveTemplateVariables(template, metadata) {
|
|
1860
|
+
if (!TEMPLATE_RE.test(template)) {
|
|
1861
|
+
return { resolved: template, unresolvedKeys: [] };
|
|
1862
|
+
}
|
|
1863
|
+
const unresolvedKeys = [];
|
|
1864
|
+
TEMPLATE_RE.lastIndex = 0;
|
|
1865
|
+
const resolved = template.replace(TEMPLATE_RE, (_match, key) => {
|
|
1866
|
+
if (metadata) {
|
|
1867
|
+
const value = getNestedValue(
|
|
1868
|
+
metadata,
|
|
1869
|
+
key
|
|
1870
|
+
);
|
|
1871
|
+
if (value !== void 0) {
|
|
1872
|
+
return value;
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
unresolvedKeys.push(key);
|
|
1876
|
+
return FALLBACKS[key] ?? `<${key}>`;
|
|
1877
|
+
});
|
|
1878
|
+
return { resolved, unresolvedKeys };
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1757
1881
|
// src/agent/agent-config.ts
|
|
1758
|
-
var AgentConfig = class _AgentConfig extends
|
|
1882
|
+
var AgentConfig = class _AgentConfig extends import_projen8.Component {
|
|
1759
1883
|
/**
|
|
1760
1884
|
* Find the AgentConfig component on a project.
|
|
1761
1885
|
*/
|
|
@@ -1774,12 +1898,20 @@ var AgentConfig = class _AgentConfig extends import_projen7.Component {
|
|
|
1774
1898
|
const skills = this.resolveSkills();
|
|
1775
1899
|
const subAgents = this.resolveSubAgents();
|
|
1776
1900
|
const mcpServers = this.options.mcpServers ?? {};
|
|
1901
|
+
const projectMetadata = ProjectMetadata.of(this.project);
|
|
1902
|
+
const metadata = projectMetadata?.metadata;
|
|
1903
|
+
const resolvedRules = this.resolveTemplates(rules, metadata);
|
|
1904
|
+
const resolvedSkills = this.resolveSkillTemplates(skills, metadata);
|
|
1905
|
+
const resolvedSubAgents = this.resolveSubAgentTemplates(
|
|
1906
|
+
subAgents,
|
|
1907
|
+
metadata
|
|
1908
|
+
);
|
|
1777
1909
|
if (platforms.includes(AGENT_PLATFORM.CURSOR)) {
|
|
1778
1910
|
CursorRenderer.render(
|
|
1779
1911
|
this,
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1912
|
+
resolvedRules,
|
|
1913
|
+
resolvedSkills,
|
|
1914
|
+
resolvedSubAgents,
|
|
1783
1915
|
mcpServers,
|
|
1784
1916
|
this.options.cursorSettings
|
|
1785
1917
|
);
|
|
@@ -1787,18 +1919,28 @@ var AgentConfig = class _AgentConfig extends import_projen7.Component {
|
|
|
1787
1919
|
if (platforms.includes(AGENT_PLATFORM.CLAUDE)) {
|
|
1788
1920
|
ClaudeRenderer.render(
|
|
1789
1921
|
this,
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1922
|
+
resolvedRules,
|
|
1923
|
+
resolvedSkills,
|
|
1924
|
+
resolvedSubAgents,
|
|
1793
1925
|
mcpServers,
|
|
1794
1926
|
this.options.claudeSettings
|
|
1795
1927
|
);
|
|
1796
1928
|
}
|
|
1797
1929
|
if (platforms.includes(AGENT_PLATFORM.CODEX)) {
|
|
1798
|
-
CodexRenderer.render(
|
|
1930
|
+
CodexRenderer.render(
|
|
1931
|
+
this,
|
|
1932
|
+
resolvedRules,
|
|
1933
|
+
resolvedSkills,
|
|
1934
|
+
resolvedSubAgents
|
|
1935
|
+
);
|
|
1799
1936
|
}
|
|
1800
1937
|
if (platforms.includes(AGENT_PLATFORM.COPILOT)) {
|
|
1801
|
-
CopilotRenderer.render(
|
|
1938
|
+
CopilotRenderer.render(
|
|
1939
|
+
this,
|
|
1940
|
+
resolvedRules,
|
|
1941
|
+
resolvedSkills,
|
|
1942
|
+
resolvedSubAgents
|
|
1943
|
+
);
|
|
1802
1944
|
}
|
|
1803
1945
|
}
|
|
1804
1946
|
resolvePlatforms() {
|
|
@@ -1901,13 +2043,65 @@ ${extra}`
|
|
|
1901
2043
|
}
|
|
1902
2044
|
return [...agentMap.values()];
|
|
1903
2045
|
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Resolves template variables in rule content using project metadata.
|
|
2048
|
+
* Emits synthesis warnings for rules with unresolved variables.
|
|
2049
|
+
*/
|
|
2050
|
+
resolveTemplates(rules, metadata) {
|
|
2051
|
+
return rules.map((rule) => {
|
|
2052
|
+
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
2053
|
+
rule.content,
|
|
2054
|
+
metadata
|
|
2055
|
+
);
|
|
2056
|
+
if (unresolvedKeys.length > 0) {
|
|
2057
|
+
this.project.logger.warn(
|
|
2058
|
+
`AgentConfig: ProjectMetadata not found; rule '${rule.name}' using default values`
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
return resolved !== rule.content ? { ...rule, content: resolved } : rule;
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* Resolves template variables in skill instructions using project metadata.
|
|
2066
|
+
*/
|
|
2067
|
+
resolveSkillTemplates(skills, metadata) {
|
|
2068
|
+
return skills.map((skill) => {
|
|
2069
|
+
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
2070
|
+
skill.instructions,
|
|
2071
|
+
metadata
|
|
2072
|
+
);
|
|
2073
|
+
if (unresolvedKeys.length > 0) {
|
|
2074
|
+
this.project.logger.warn(
|
|
2075
|
+
`AgentConfig: ProjectMetadata not found; skill '${skill.name}' using default values`
|
|
2076
|
+
);
|
|
2077
|
+
}
|
|
2078
|
+
return resolved !== skill.instructions ? { ...skill, instructions: resolved } : skill;
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
/**
|
|
2082
|
+
* Resolves template variables in sub-agent prompts using project metadata.
|
|
2083
|
+
*/
|
|
2084
|
+
resolveSubAgentTemplates(subAgents, metadata) {
|
|
2085
|
+
return subAgents.map((agent) => {
|
|
2086
|
+
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
2087
|
+
agent.prompt,
|
|
2088
|
+
metadata
|
|
2089
|
+
);
|
|
2090
|
+
if (unresolvedKeys.length > 0) {
|
|
2091
|
+
this.project.logger.warn(
|
|
2092
|
+
`AgentConfig: ProjectMetadata not found; sub-agent '${agent.name}' using default values`
|
|
2093
|
+
);
|
|
2094
|
+
}
|
|
2095
|
+
return resolved !== agent.prompt ? { ...agent, prompt: resolved } : agent;
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
1904
2098
|
};
|
|
1905
2099
|
|
|
1906
2100
|
// src/aws/aws-deployment-config.ts
|
|
1907
2101
|
var import_node_path = require("path");
|
|
1908
2102
|
var import_utils8 = __toESM(require_lib());
|
|
1909
|
-
var
|
|
1910
|
-
var AwsDeploymentConfig = class _AwsDeploymentConfig extends
|
|
2103
|
+
var import_projen9 = require("projen");
|
|
2104
|
+
var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Component {
|
|
1911
2105
|
constructor(project) {
|
|
1912
2106
|
super(project);
|
|
1913
2107
|
/**
|
|
@@ -2024,8 +2218,8 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen8.Comp
|
|
|
2024
2218
|
|
|
2025
2219
|
// src/aws/aws-deployment-target.ts
|
|
2026
2220
|
var import_utils9 = __toESM(require_lib());
|
|
2027
|
-
var
|
|
2028
|
-
var AwsDeploymentTarget = class _AwsDeploymentTarget extends
|
|
2221
|
+
var import_projen10 = require("projen");
|
|
2222
|
+
var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen10.Component {
|
|
2029
2223
|
constructor(project, options) {
|
|
2030
2224
|
super(project);
|
|
2031
2225
|
/**
|
|
@@ -2240,12 +2434,12 @@ var VERSION_KEYS_SKIP = [
|
|
|
2240
2434
|
|
|
2241
2435
|
// src/jsii/jsii-faker.ts
|
|
2242
2436
|
var spec = __toESM(require("@jsii/spec"));
|
|
2243
|
-
var
|
|
2437
|
+
var import_projen11 = require("projen");
|
|
2244
2438
|
var ProjenBaseFqn = {
|
|
2245
2439
|
TYPESCRIPT_PROJECT: "projen.typescript.TypeScriptProject",
|
|
2246
2440
|
TYPESCRIPT_PROJECT_OPTIONS: "projen.typescript.TypeScriptProjectOptions"
|
|
2247
2441
|
};
|
|
2248
|
-
var JsiiFaker = class _JsiiFaker extends
|
|
2442
|
+
var JsiiFaker = class _JsiiFaker extends import_projen11.Component {
|
|
2249
2443
|
constructor(project) {
|
|
2250
2444
|
super(project);
|
|
2251
2445
|
this.project = project;
|
|
@@ -2256,7 +2450,7 @@ var JsiiFaker = class _JsiiFaker extends import_projen10.Component {
|
|
|
2256
2450
|
};
|
|
2257
2451
|
};
|
|
2258
2452
|
this._assemblyName = this.project.package.packageName;
|
|
2259
|
-
new
|
|
2453
|
+
new import_projen11.JsonFile(project, ".jsii", {
|
|
2260
2454
|
obj: () => {
|
|
2261
2455
|
return {
|
|
2262
2456
|
name: this._assemblyName,
|
|
@@ -2294,23 +2488,23 @@ var JsiiFaker = class _JsiiFaker extends import_projen10.Component {
|
|
|
2294
2488
|
};
|
|
2295
2489
|
|
|
2296
2490
|
// src/projects/monorepo-project.ts
|
|
2297
|
-
var
|
|
2491
|
+
var import_javascript4 = require("projen/lib/javascript");
|
|
2298
2492
|
var import_typescript3 = require("projen/lib/typescript");
|
|
2299
2493
|
var import_ts_deepmerge2 = require("ts-deepmerge");
|
|
2300
2494
|
|
|
2301
2495
|
// src/tasks/reset-task.ts
|
|
2302
|
-
var
|
|
2496
|
+
var import_projen13 = require("projen");
|
|
2303
2497
|
|
|
2304
2498
|
// src/projects/typescript-project.ts
|
|
2305
|
-
var
|
|
2306
|
-
var
|
|
2499
|
+
var import_projen12 = require("projen");
|
|
2500
|
+
var import_javascript3 = require("projen/lib/javascript");
|
|
2307
2501
|
var import_release = require("projen/lib/release");
|
|
2308
2502
|
var import_ts_deepmerge = require("ts-deepmerge");
|
|
2309
2503
|
var TestRunner = {
|
|
2310
2504
|
JEST: "jest",
|
|
2311
2505
|
VITEST: "vitest"
|
|
2312
2506
|
};
|
|
2313
|
-
var TypeScriptProject = class extends
|
|
2507
|
+
var TypeScriptProject = class extends import_projen12.typescript.TypeScriptProject {
|
|
2314
2508
|
constructor(userOptions) {
|
|
2315
2509
|
const pnpmVersion = userOptions.parent && userOptions.parent instanceof MonorepoProject ? userOptions.parent.pnpmVersion : VERSION.PNPM_VERSION;
|
|
2316
2510
|
const pnpmWorkspace = userOptions.parent && userOptions.parent instanceof MonorepoProject ? PnpmWorkspace.of(userOptions.parent) : void 0;
|
|
@@ -2328,7 +2522,7 @@ var TypeScriptProject = class extends import_projen11.typescript.TypeScriptProje
|
|
|
2328
2522
|
/**
|
|
2329
2523
|
* Packaging options
|
|
2330
2524
|
*/
|
|
2331
|
-
packageManager:
|
|
2525
|
+
packageManager: import_javascript3.NodePackageManager.PNPM,
|
|
2332
2526
|
pnpmVersion,
|
|
2333
2527
|
licensed: userOptions.license !== void 0 || false,
|
|
2334
2528
|
copyrightOwner: "CodeDrifters",
|
|
@@ -2346,7 +2540,7 @@ var TypeScriptProject = class extends import_projen11.typescript.TypeScriptProje
|
|
|
2346
2540
|
jestConfig: {
|
|
2347
2541
|
roots: [`<rootDir>/src`],
|
|
2348
2542
|
transform: {
|
|
2349
|
-
["^.+\\.[t]sx?$"]: new
|
|
2543
|
+
["^.+\\.[t]sx?$"]: new import_javascript3.Transform("@swc/jest")
|
|
2350
2544
|
},
|
|
2351
2545
|
moduleFileExtensions: ["js", "ts"]
|
|
2352
2546
|
}
|
|
@@ -2381,7 +2575,7 @@ var TypeScriptProject = class extends import_projen11.typescript.TypeScriptProje
|
|
|
2381
2575
|
exclude: Object.keys(pnpmWorkspace?.defaultCatalog || {}),
|
|
2382
2576
|
...userOptions.parent && userOptions.parent instanceof MonorepoProject ? {
|
|
2383
2577
|
workflowOptions: {
|
|
2384
|
-
schedule:
|
|
2578
|
+
schedule: import_javascript3.UpgradeDependenciesSchedule.WEEKLY
|
|
2385
2579
|
},
|
|
2386
2580
|
cooldown: 1
|
|
2387
2581
|
} : {}
|
|
@@ -2470,7 +2664,7 @@ var TypeScriptProject = class extends import_projen11.typescript.TypeScriptProje
|
|
|
2470
2664
|
};
|
|
2471
2665
|
|
|
2472
2666
|
// src/tasks/reset-task.ts
|
|
2473
|
-
var ResetTask = class _ResetTask extends
|
|
2667
|
+
var ResetTask = class _ResetTask extends import_projen13.Component {
|
|
2474
2668
|
constructor(project, options = {}) {
|
|
2475
2669
|
super(project);
|
|
2476
2670
|
this.project = project;
|
|
@@ -2543,12 +2737,12 @@ var ResetTask = class _ResetTask extends import_projen12.Component {
|
|
|
2543
2737
|
};
|
|
2544
2738
|
|
|
2545
2739
|
// src/vscode/vscode.ts
|
|
2546
|
-
var
|
|
2547
|
-
var VSCodeConfig = class extends
|
|
2740
|
+
var import_projen14 = require("projen");
|
|
2741
|
+
var VSCodeConfig = class extends import_projen14.Component {
|
|
2548
2742
|
constructor(project) {
|
|
2549
2743
|
super(project);
|
|
2550
|
-
const vsConfig = new
|
|
2551
|
-
const vsSettings = new
|
|
2744
|
+
const vsConfig = new import_projen14.vscode.VsCode(project);
|
|
2745
|
+
const vsSettings = new import_projen14.vscode.VsCodeSettings(vsConfig);
|
|
2552
2746
|
vsSettings.addSetting("editor.tabSize", 2);
|
|
2553
2747
|
vsSettings.addSetting("editor.detectIndentation", false);
|
|
2554
2748
|
vsSettings.addSetting("editor.bracketPairColorization.enabled", true);
|
|
@@ -2787,7 +2981,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
2787
2981
|
depsUpgradeOptions: {
|
|
2788
2982
|
exclude: ["@codedrifters/configulator"],
|
|
2789
2983
|
workflowOptions: {
|
|
2790
|
-
schedule:
|
|
2984
|
+
schedule: import_javascript4.UpgradeDependenciesSchedule.DAILY
|
|
2791
2985
|
},
|
|
2792
2986
|
cooldown: 1
|
|
2793
2987
|
},
|
|
@@ -2843,7 +3037,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
2843
3037
|
* Use PNPM instead of the default (Yarn). Much of the ecosystem depends
|
|
2844
3038
|
* on PNPM and making monorepos PNPM only simplifies many configurations.
|
|
2845
3039
|
*/
|
|
2846
|
-
packageManager:
|
|
3040
|
+
packageManager: import_javascript4.NodePackageManager.PNPM,
|
|
2847
3041
|
/**
|
|
2848
3042
|
* Some additional pre-build steps if we're using turbo's remote cache.
|
|
2849
3043
|
* Set GIT_BRANCH_NAME so Turborepo remote cache hashes match between local and CI.
|
|
@@ -2920,6 +3114,12 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
2920
3114
|
if (options.approveMergeUpgradeOptions) {
|
|
2921
3115
|
addApproveMergeUpgradeWorkflow(this, options.approveMergeUpgradeOptions);
|
|
2922
3116
|
}
|
|
3117
|
+
if (options.projectMetadata !== false) {
|
|
3118
|
+
new ProjectMetadata(
|
|
3119
|
+
this,
|
|
3120
|
+
typeof options.projectMetadata === "object" ? options.projectMetadata : {}
|
|
3121
|
+
);
|
|
3122
|
+
}
|
|
2923
3123
|
if (options.agentConfig) {
|
|
2924
3124
|
new AgentConfig(this, options.agentConfigOptions);
|
|
2925
3125
|
}
|
|
@@ -2981,9 +3181,9 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
2981
3181
|
|
|
2982
3182
|
// src/typescript/typescript-config.ts
|
|
2983
3183
|
var import_node_path2 = require("path");
|
|
2984
|
-
var
|
|
3184
|
+
var import_projen15 = require("projen");
|
|
2985
3185
|
var import_path2 = require("projen/lib/util/path");
|
|
2986
|
-
var TypeScriptConfig = class extends
|
|
3186
|
+
var TypeScriptConfig = class extends import_projen15.Component {
|
|
2987
3187
|
constructor(project) {
|
|
2988
3188
|
super(project);
|
|
2989
3189
|
let tsPaths = {};
|
|
@@ -3011,12 +3211,12 @@ var TypeScriptConfig = class extends import_projen14.Component {
|
|
|
3011
3211
|
|
|
3012
3212
|
// src/workflows/aws-deploy-workflow.ts
|
|
3013
3213
|
var import_utils10 = __toESM(require_lib());
|
|
3014
|
-
var
|
|
3214
|
+
var import_projen16 = require("projen");
|
|
3015
3215
|
var import_build = require("projen/lib/build");
|
|
3016
3216
|
var import_github = require("projen/lib/github");
|
|
3017
3217
|
var import_workflows_model4 = require("projen/lib/github/workflows-model");
|
|
3018
3218
|
var PROD_DEPLOY_NAME = "prod-deploy";
|
|
3019
|
-
var AwsDeployWorkflow = class _AwsDeployWorkflow extends
|
|
3219
|
+
var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen16.Component {
|
|
3020
3220
|
constructor(project, options = {}) {
|
|
3021
3221
|
super(project);
|
|
3022
3222
|
this.project = project;
|
|
@@ -3298,6 +3498,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen15.Compone
|
|
|
3298
3498
|
MonorepoProject,
|
|
3299
3499
|
PROD_DEPLOY_NAME,
|
|
3300
3500
|
PnpmWorkspace,
|
|
3501
|
+
ProjectMetadata,
|
|
3301
3502
|
ROOT_CI_TASK_NAME,
|
|
3302
3503
|
ROOT_TURBO_TASK_NAME,
|
|
3303
3504
|
ResetTask,
|
|
@@ -3319,6 +3520,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen15.Compone
|
|
|
3319
3520
|
jestBundle,
|
|
3320
3521
|
pnpmBundle,
|
|
3321
3522
|
projenBundle,
|
|
3523
|
+
resolveTemplateVariables,
|
|
3322
3524
|
turborepoBundle,
|
|
3323
3525
|
typescriptBundle,
|
|
3324
3526
|
vitestBundle
|