flarecms 0.2.1 → 0.2.2

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.
@@ -6490,32 +6490,52 @@ async function createProjectCommand() {
6490
6490
  }
6491
6491
  s3.start("Injecting FlareCMS configuration...");
6492
6492
  }
6493
- const template = TEMPLATES[templateKey];
6494
6493
  const currentFilePath = fileURLToPath(import.meta.url);
6495
6494
  const cliDir = resolve(currentFilePath, "..");
6496
6495
  const localTemplatesRoot = resolve(cliDir, "..", "..", "..", "..", "templates");
6497
- const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6498
- if (existsSync2(localTemplatePath)) {
6499
- if (!existsSync2(projectDir)) {
6500
- mkdirSync(projectDir, { recursive: true });
6496
+ if (templateKey === "plugin-development") {
6497
+ const pkgPath = resolve(projectDir, "package.json");
6498
+ const rootPkg = {
6499
+ name: projectName,
6500
+ version: "0.1.0",
6501
+ private: true,
6502
+ workspaces: ["plugins/*", "apps/*"],
6503
+ scripts: {
6504
+ dev: "bun --cwd apps/playground dev"
6505
+ }
6506
+ };
6507
+ mkdirSync(resolve(projectDir, "plugins"), { recursive: true });
6508
+ mkdirSync(resolve(projectDir, "apps"), { recursive: true });
6509
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-plugin"), resolve(projectDir, "plugins", "starter-plugin"), { recursive: true });
6510
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-playground"), resolve(projectDir, "apps", "playground"), { recursive: true });
6511
+ writeFileSync(pkgPath, JSON.stringify(rootPkg, null, 2));
6512
+ } else {
6513
+ const template = TEMPLATES[templateKey];
6514
+ const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6515
+ if (existsSync2(localTemplatePath)) {
6516
+ if (!existsSync2(projectDir)) {
6517
+ mkdirSync(projectDir, { recursive: true });
6518
+ }
6519
+ cpSync(localTemplatePath, projectDir, { recursive: true });
6520
+ } else if (templateKey !== "nextjs") {
6521
+ const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6522
+ await downloadTemplate(remoteSource, {
6523
+ dir: projectDir,
6524
+ force: true
6525
+ });
6501
6526
  }
6502
- cpSync(localTemplatePath, projectDir, { recursive: true });
6503
- } else if (templateKey !== "nextjs") {
6504
- const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6505
- await downloadTemplate(remoteSource, {
6506
- dir: projectDir,
6507
- force: true
6508
- });
6509
6527
  }
6510
- const pkgPath = resolve(projectDir, "package.json");
6511
- if (existsSync2(pkgPath)) {
6512
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6513
- pkg.name = projectName;
6514
- pkg.version = "0.1.0";
6515
- pkg.dependencies = pkg.dependencies || {};
6516
- pkg.dependencies["flarecms"] = "latest";
6517
- pkg.dependencies["hono"] = "latest";
6518
- writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6528
+ if (templateKey !== "plugin-development") {
6529
+ const pkgPath = resolve(projectDir, "package.json");
6530
+ if (existsSync2(pkgPath)) {
6531
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6532
+ pkg.name = projectName;
6533
+ pkg.version = "0.1.0";
6534
+ pkg.dependencies = pkg.dependencies || {};
6535
+ pkg.dependencies["flarecms"] = "latest";
6536
+ pkg.dependencies["hono"] = "latest";
6537
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6538
+ }
6519
6539
  }
6520
6540
  const wranglerPath = resolve(projectDir, "wrangler.jsonc");
6521
6541
  if (existsSync2(wranglerPath)) {
@@ -6530,16 +6550,18 @@ async function createProjectCommand() {
6530
6550
  try {
6531
6551
  await execAsync("bun install", { cwd: projectDir });
6532
6552
  s3.stop("Dependencies installed!");
6533
- s3.start("Generating TypeScript bindings...");
6534
- try {
6535
- await execAsync("bun wrangler types", { cwd: projectDir });
6536
- s3.stop("TypeScript bindings generated!");
6537
- } catch (err) {
6538
- s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6553
+ if (templateKey !== "plugin-development") {
6554
+ s3.start("Generating TypeScript bindings...");
6555
+ try {
6556
+ await execAsync("bun wrangler types", { cwd: projectDir });
6557
+ s3.stop("TypeScript bindings generated!");
6558
+ } catch (err) {
6559
+ s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6560
+ }
6539
6561
  }
6540
6562
  } catch (err) {
6541
6563
  s3.stop("Failed to install dependencies");
6542
- O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install && bun cf-typegen`)} manually`);
6564
+ O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install`)} manually`);
6543
6565
  }
6544
6566
  }
6545
6567
  const steps = [`cd ${projectName}`, "bun run dev"];
package/dist/cli/index.js CHANGED
@@ -6491,32 +6491,52 @@ async function createProjectCommand() {
6491
6491
  }
6492
6492
  s3.start("Injecting FlareCMS configuration...");
6493
6493
  }
6494
- const template = TEMPLATES[templateKey];
6495
6494
  const currentFilePath = fileURLToPath(import.meta.url);
6496
6495
  const cliDir = resolve(currentFilePath, "..");
6497
6496
  const localTemplatesRoot = resolve(cliDir, "..", "..", "..", "..", "templates");
6498
- const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6499
- if (existsSync2(localTemplatePath)) {
6500
- if (!existsSync2(projectDir)) {
6501
- mkdirSync(projectDir, { recursive: true });
6497
+ if (templateKey === "plugin-development") {
6498
+ const pkgPath = resolve(projectDir, "package.json");
6499
+ const rootPkg = {
6500
+ name: projectName,
6501
+ version: "0.1.0",
6502
+ private: true,
6503
+ workspaces: ["plugins/*", "apps/*"],
6504
+ scripts: {
6505
+ dev: "bun --cwd apps/playground dev"
6506
+ }
6507
+ };
6508
+ mkdirSync(resolve(projectDir, "plugins"), { recursive: true });
6509
+ mkdirSync(resolve(projectDir, "apps"), { recursive: true });
6510
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-plugin"), resolve(projectDir, "plugins", "starter-plugin"), { recursive: true });
6511
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-playground"), resolve(projectDir, "apps", "playground"), { recursive: true });
6512
+ writeFileSync(pkgPath, JSON.stringify(rootPkg, null, 2));
6513
+ } else {
6514
+ const template = TEMPLATES[templateKey];
6515
+ const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6516
+ if (existsSync2(localTemplatePath)) {
6517
+ if (!existsSync2(projectDir)) {
6518
+ mkdirSync(projectDir, { recursive: true });
6519
+ }
6520
+ cpSync(localTemplatePath, projectDir, { recursive: true });
6521
+ } else if (templateKey !== "nextjs") {
6522
+ const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6523
+ await downloadTemplate(remoteSource, {
6524
+ dir: projectDir,
6525
+ force: true
6526
+ });
6502
6527
  }
6503
- cpSync(localTemplatePath, projectDir, { recursive: true });
6504
- } else if (templateKey !== "nextjs") {
6505
- const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6506
- await downloadTemplate(remoteSource, {
6507
- dir: projectDir,
6508
- force: true
6509
- });
6510
6528
  }
6511
- const pkgPath = resolve(projectDir, "package.json");
6512
- if (existsSync2(pkgPath)) {
6513
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6514
- pkg.name = projectName;
6515
- pkg.version = "0.1.0";
6516
- pkg.dependencies = pkg.dependencies || {};
6517
- pkg.dependencies["flarecms"] = "latest";
6518
- pkg.dependencies["hono"] = "latest";
6519
- writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6529
+ if (templateKey !== "plugin-development") {
6530
+ const pkgPath = resolve(projectDir, "package.json");
6531
+ if (existsSync2(pkgPath)) {
6532
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6533
+ pkg.name = projectName;
6534
+ pkg.version = "0.1.0";
6535
+ pkg.dependencies = pkg.dependencies || {};
6536
+ pkg.dependencies["flarecms"] = "latest";
6537
+ pkg.dependencies["hono"] = "latest";
6538
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6539
+ }
6520
6540
  }
6521
6541
  const wranglerPath = resolve(projectDir, "wrangler.jsonc");
6522
6542
  if (existsSync2(wranglerPath)) {
@@ -6531,16 +6551,18 @@ async function createProjectCommand() {
6531
6551
  try {
6532
6552
  await execAsync("bun install", { cwd: projectDir });
6533
6553
  s3.stop("Dependencies installed!");
6534
- s3.start("Generating TypeScript bindings...");
6535
- try {
6536
- await execAsync("bun wrangler types", { cwd: projectDir });
6537
- s3.stop("TypeScript bindings generated!");
6538
- } catch (err) {
6539
- s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6554
+ if (templateKey !== "plugin-development") {
6555
+ s3.start("Generating TypeScript bindings...");
6556
+ try {
6557
+ await execAsync("bun wrangler types", { cwd: projectDir });
6558
+ s3.stop("TypeScript bindings generated!");
6559
+ } catch (err) {
6560
+ s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6561
+ }
6540
6562
  }
6541
6563
  } catch (err) {
6542
6564
  s3.stop("Failed to install dependencies");
6543
- O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install && bun cf-typegen`)} manually`);
6565
+ O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install`)} manually`);
6544
6566
  }
6545
6567
  }
6546
6568
  const steps = [`cd ${projectName}`, "bun run dev"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flarecms",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "description": "FlareCMS Monorepo: A lightweight CMS for the AI era.",
6
6
  "files": [
@@ -30,7 +30,9 @@
30
30
  "homepage": "https://flarecms.francy.dev",
31
31
  "scripts": {
32
32
  "build:style": "node ./scripts/prefix-css.mjs",
33
- "build": "bun ../../scripts/build.ts"
33
+ "build": "bun ../../scripts/build.ts",
34
+ "prepublishOnly": "bun run scripts/prepare-publish.ts",
35
+ "postpublish": "bun run scripts/cleanup-publish.ts"
34
36
  },
35
37
  "type": "module",
36
38
  "main": "./dist/index.js",
@@ -38,13 +40,34 @@
38
40
  "flarecms": "./dist/cli/index.js"
39
41
  },
40
42
  "exports": {
41
- ".": "./dist/index.js",
42
- "./server": "./dist/server/index.js",
43
- "./client": "./dist/client/index.js",
44
- "./auth": "./dist/auth/index.js",
45
- "./db": "./dist/db/index.js",
46
- "./cli": "./dist/cli/index.js",
47
- "./plugins": "./dist/plugins/index.js",
43
+ ".": {
44
+ "types": "./dist/index.d.ts",
45
+ "default": "./dist/index.js"
46
+ },
47
+ "./server": {
48
+ "types": "./dist/server/index.d.ts",
49
+ "default": "./dist/server/index.js"
50
+ },
51
+ "./client": {
52
+ "types": "./dist/client/index.d.ts",
53
+ "default": "./dist/client/index.js"
54
+ },
55
+ "./auth": {
56
+ "types": "./dist/auth/index.d.ts",
57
+ "default": "./dist/auth/index.js"
58
+ },
59
+ "./db": {
60
+ "types": "./dist/db/index.d.ts",
61
+ "default": "./dist/db/index.js"
62
+ },
63
+ "./cli": {
64
+ "types": "./dist/cli/index.d.ts",
65
+ "default": "./dist/cli/index.js"
66
+ },
67
+ "./plugins": {
68
+ "types": "./dist/plugins/index.d.ts",
69
+ "default": "./dist/plugins/index.js"
70
+ },
48
71
  "./style.css": {
49
72
  "types": "./dist/style.css.d.ts",
50
73
  "default": "./dist/style.css"
@@ -97,5 +120,6 @@
97
120
  "hono": "^4.6.0",
98
121
  "react": "^18.3.1",
99
122
  "react-dom": "^18.3.1"
100
- }
123
+ },
124
+ "types": "./dist/index.d.ts"
101
125
  }