@ghentcdh/create-crouton 0.0.1-alpha.84 → 0.0.1-alpha.85

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/dist/index.js CHANGED
@@ -26225,7 +26225,10 @@ var CroutonConfigSchema = external_exports.object({
26225
26225
  rules: RulesetSchema.default(RulesetSchema.parse({})).describe("Optional overrides of the default visibility and behaviour ruleset applied to all resources."),
26226
26226
  sidebarGroups: external_exports.record(external_exports.string(), SidebarGroupSchema).default({}).describe('Sidebar group definitions, keyed by group slug (e.g. "metadata"). Resources reference a group via sidebar.group in their resource.json.'),
26227
26227
  autoSave: external_exports.boolean().default(true).describe("Whether form fields are saved automatically as the user edits them. Default true."),
26228
- i18n: I18nConfigSchema.optional().describe("Optional i18n / translation configuration. Omit if the app is single-language.")
26228
+ i18n: I18nConfigSchema.optional().describe("Optional i18n / translation configuration. Omit if the app is single-language."),
26229
+ agentFiles: external_exports.object({
26230
+ targets: external_exports.array(external_exports.enum(["claude", "cursor"])).optional().describe("Which agent file sets to manage. Defaults to those already present in the project, or both on first run.")
26231
+ }).optional().describe("Agent file sync configuration for `crouton migrate`. Stored after the first run.")
26229
26232
  });
26230
26233
 
26231
26234
  // ../crouton-core/src/lib/i18n/Translations.schema.ts
@@ -26618,9 +26621,19 @@ import { existsSync as existsSync3 } from "fs";
26618
26621
  import { mkdir as mkdir2, readFile as readFile6, writeFile as writeFile3 } from "fs/promises";
26619
26622
  import { dirname as dirname7 } from "path";
26620
26623
 
26624
+ // ../crouton-codegen/src/agent-files/manifest.ts
26625
+ import { createHash } from "crypto";
26626
+ import { mkdir as mkdir3, readFile as readFile7, writeFile as writeFile4 } from "fs/promises";
26627
+ import { join as join6 } from "path";
26628
+
26629
+ // ../crouton-codegen/src/agent-files/sync.ts
26630
+ import { existsSync as existsSync4 } from "fs";
26631
+ import { mkdir as mkdir4, readFile as readFile8, readdir as readdir5, writeFile as writeFile5 } from "fs/promises";
26632
+ import { dirname as dirname8, join as join7, relative as relative2 } from "path";
26633
+
26621
26634
  // src/lib/files.ts
26622
- import { access as access2, mkdir as mkdir3, readFile as readFile7, writeFile as writeFile4 } from "fs/promises";
26623
- import { dirname as dirname8 } from "path";
26635
+ import { access as access2, mkdir as mkdir5, readFile as readFile9, writeFile as writeFile6 } from "fs/promises";
26636
+ import { dirname as dirname9 } from "path";
26624
26637
  var fileExists2 = async (p) => {
26625
26638
  try {
26626
26639
  await access2(p);
@@ -26633,13 +26646,13 @@ var writeFiles = async (files, opts = {}) => {
26633
26646
  let written = 0;
26634
26647
  for (const f of files) {
26635
26648
  if (!opts.force && await fileExists2(f.path)) continue;
26636
- await mkdir3(dirname8(f.path), { recursive: true });
26637
- await writeFile4(f.path, f.contents, "utf-8");
26649
+ await mkdir5(dirname9(f.path), { recursive: true });
26650
+ await writeFile6(f.path, f.contents, "utf-8");
26638
26651
  written += 1;
26639
26652
  }
26640
26653
  return written;
26641
26654
  };
26642
- var loadTemplate = async (templateDir, relativePath) => readFile7(`${templateDir}/${relativePath}`, "utf-8");
26655
+ var loadTemplate = async (templateDir, relativePath) => readFile9(`${templateDir}/${relativePath}`, "utf-8");
26643
26656
 
26644
26657
  // src/lib/pm.ts
26645
26658
  import { execSync, spawn as spawn2 } from "child_process";
@@ -26697,14 +26710,14 @@ var render = (template, tokens) => {
26697
26710
 
26698
26711
  // src/runner.ts
26699
26712
  import { execSync as execSync2 } from "child_process";
26700
- import { existsSync as existsSync4 } from "fs";
26701
- import { readdir as readdir5 } from "fs/promises";
26713
+ import { existsSync as existsSync5 } from "fs";
26714
+ import { readdir as readdir6 } from "fs/promises";
26702
26715
  import { resolve as resolve2 } from "path";
26703
26716
  import { fileURLToPath } from "url";
26704
26717
  var resolveTemplateDir = () => {
26705
26718
  const thisDir = typeof __dirname !== "undefined" ? __dirname : fileURLToPath(new URL(".", import.meta.url));
26706
26719
  const distPath = resolve2(thisDir, "templates");
26707
- if (existsSync4(distPath)) return distPath;
26720
+ if (existsSync5(distPath)) return distPath;
26708
26721
  return resolve2(thisDir, "..", "templates");
26709
26722
  };
26710
26723
  var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
@@ -26713,8 +26726,8 @@ var runCreate = async (name, opts) => {
26713
26726
  intro(import_picocolors.default.bold(`create-crouton ${import_picocolors.default.cyan(name)}`));
26714
26727
  try {
26715
26728
  const targetDir = resolve2(process.cwd(), name);
26716
- if (existsSync4(targetDir) && !opts.force) {
26717
- const entries = await readdir5(targetDir);
26729
+ if (existsSync5(targetDir) && !opts.force) {
26730
+ const entries = await readdir6(targetDir);
26718
26731
  if (entries.length > 0) {
26719
26732
  log.error(
26720
26733
  `Directory "${name}" already exists and is not empty. Use --force to overwrite.`
@@ -26737,7 +26750,7 @@ var runCreate = async (name, opts) => {
26737
26750
  const tokens = {
26738
26751
  name,
26739
26752
  Name: toTitle(name),
26740
- version: true ? "0.0.1-alpha.84" : "latest",
26753
+ version: true ? "0.0.1-alpha.85" : "latest",
26741
26754
  year: String((/* @__PURE__ */ new Date()).getFullYear()),
26742
26755
  pmRun: pm === "npm" ? "npm run" : pm,
26743
26756
  urlEnv: "DATABASE_URL",
@@ -27102,8 +27115,8 @@ var resolvePostgres = async (opts) => {
27102
27115
  var loadAndRenderTemplates = async (templateDir, subPath, tokens, targetDir, skipPaths = []) => {
27103
27116
  const files = [];
27104
27117
  const dir = subPath ? resolve2(templateDir, subPath) : templateDir;
27105
- if (!existsSync4(dir)) return files;
27106
- const entries = await readdir5(dir, { withFileTypes: true });
27118
+ if (!existsSync5(dir)) return files;
27119
+ const entries = await readdir6(dir, { withFileTypes: true });
27107
27120
  for (const entry of entries) {
27108
27121
  const relPath = subPath ? `${subPath}/${entry.name}` : entry.name;
27109
27122
  if (skipPaths.some((sp) => relPath.startsWith(sp))) continue;