flarecms 0.2.0 → 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.
- package/dist/cli/commands.js +54 -37
- package/dist/cli/index.js +54 -37
- package/package.json +34 -10
package/dist/cli/commands.js
CHANGED
|
@@ -6414,15 +6414,10 @@ var TEMPLATES = {
|
|
|
6414
6414
|
description: "Unified single-process FlareCMS starter for Cloudflare Workers",
|
|
6415
6415
|
dir: "templates/starter"
|
|
6416
6416
|
},
|
|
6417
|
-
|
|
6418
|
-
name: "
|
|
6419
|
-
description: "A pre-configured
|
|
6420
|
-
dir: "templates/
|
|
6421
|
-
},
|
|
6422
|
-
nextjs: {
|
|
6423
|
-
name: "Next.js (App Router)",
|
|
6424
|
-
description: "Modern Next.js template with FlareCMS + Hono API",
|
|
6425
|
-
dir: "templates/nextjs"
|
|
6417
|
+
"plugin-development": {
|
|
6418
|
+
name: "Plugin Development",
|
|
6419
|
+
description: "A pre-configured plugin template",
|
|
6420
|
+
dir: "templates/plugin-development"
|
|
6426
6421
|
}
|
|
6427
6422
|
};
|
|
6428
6423
|
async function createProjectCommand() {
|
|
@@ -6495,32 +6490,52 @@ async function createProjectCommand() {
|
|
|
6495
6490
|
}
|
|
6496
6491
|
s3.start("Injecting FlareCMS configuration...");
|
|
6497
6492
|
}
|
|
6498
|
-
const template = TEMPLATES[templateKey];
|
|
6499
6493
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
6500
6494
|
const cliDir = resolve(currentFilePath, "..");
|
|
6501
6495
|
const localTemplatesRoot = resolve(cliDir, "..", "..", "..", "..", "templates");
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
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
|
+
});
|
|
6506
6526
|
}
|
|
6507
|
-
cpSync(localTemplatePath, projectDir, { recursive: true });
|
|
6508
|
-
} else if (templateKey !== "nextjs") {
|
|
6509
|
-
const remoteSource = `github:fhorray/flarecms/${template.dir}`;
|
|
6510
|
-
await downloadTemplate(remoteSource, {
|
|
6511
|
-
dir: projectDir,
|
|
6512
|
-
force: true
|
|
6513
|
-
});
|
|
6514
6527
|
}
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
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
|
+
}
|
|
6524
6539
|
}
|
|
6525
6540
|
const wranglerPath = resolve(projectDir, "wrangler.jsonc");
|
|
6526
6541
|
if (existsSync2(wranglerPath)) {
|
|
@@ -6535,16 +6550,18 @@ async function createProjectCommand() {
|
|
|
6535
6550
|
try {
|
|
6536
6551
|
await execAsync("bun install", { cwd: projectDir });
|
|
6537
6552
|
s3.stop("Dependencies installed!");
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
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
|
+
}
|
|
6544
6561
|
}
|
|
6545
6562
|
} catch (err) {
|
|
6546
6563
|
s3.stop("Failed to install dependencies");
|
|
6547
|
-
O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install
|
|
6564
|
+
O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install`)} manually`);
|
|
6548
6565
|
}
|
|
6549
6566
|
}
|
|
6550
6567
|
const steps = [`cd ${projectName}`, "bun run dev"];
|
package/dist/cli/index.js
CHANGED
|
@@ -6415,15 +6415,10 @@ var TEMPLATES = {
|
|
|
6415
6415
|
description: "Unified single-process FlareCMS starter for Cloudflare Workers",
|
|
6416
6416
|
dir: "templates/starter"
|
|
6417
6417
|
},
|
|
6418
|
-
|
|
6419
|
-
name: "
|
|
6420
|
-
description: "A pre-configured
|
|
6421
|
-
dir: "templates/
|
|
6422
|
-
},
|
|
6423
|
-
nextjs: {
|
|
6424
|
-
name: "Next.js (App Router)",
|
|
6425
|
-
description: "Modern Next.js template with FlareCMS + Hono API",
|
|
6426
|
-
dir: "templates/nextjs"
|
|
6418
|
+
"plugin-development": {
|
|
6419
|
+
name: "Plugin Development",
|
|
6420
|
+
description: "A pre-configured plugin template",
|
|
6421
|
+
dir: "templates/plugin-development"
|
|
6427
6422
|
}
|
|
6428
6423
|
};
|
|
6429
6424
|
async function createProjectCommand() {
|
|
@@ -6496,32 +6491,52 @@ async function createProjectCommand() {
|
|
|
6496
6491
|
}
|
|
6497
6492
|
s3.start("Injecting FlareCMS configuration...");
|
|
6498
6493
|
}
|
|
6499
|
-
const template = TEMPLATES[templateKey];
|
|
6500
6494
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
6501
6495
|
const cliDir = resolve(currentFilePath, "..");
|
|
6502
6496
|
const localTemplatesRoot = resolve(cliDir, "..", "..", "..", "..", "templates");
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
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
|
+
});
|
|
6507
6527
|
}
|
|
6508
|
-
cpSync(localTemplatePath, projectDir, { recursive: true });
|
|
6509
|
-
} else if (templateKey !== "nextjs") {
|
|
6510
|
-
const remoteSource = `github:fhorray/flarecms/${template.dir}`;
|
|
6511
|
-
await downloadTemplate(remoteSource, {
|
|
6512
|
-
dir: projectDir,
|
|
6513
|
-
force: true
|
|
6514
|
-
});
|
|
6515
6528
|
}
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
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
|
+
}
|
|
6525
6540
|
}
|
|
6526
6541
|
const wranglerPath = resolve(projectDir, "wrangler.jsonc");
|
|
6527
6542
|
if (existsSync2(wranglerPath)) {
|
|
@@ -6536,16 +6551,18 @@ async function createProjectCommand() {
|
|
|
6536
6551
|
try {
|
|
6537
6552
|
await execAsync("bun install", { cwd: projectDir });
|
|
6538
6553
|
s3.stop("Dependencies installed!");
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
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
|
+
}
|
|
6545
6562
|
}
|
|
6546
6563
|
} catch (err) {
|
|
6547
6564
|
s3.stop("Failed to install dependencies");
|
|
6548
|
-
O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install
|
|
6565
|
+
O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install`)} manually`);
|
|
6549
6566
|
}
|
|
6550
6567
|
}
|
|
6551
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.
|
|
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
|
-
".":
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"./
|
|
46
|
-
|
|
47
|
-
|
|
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
|
}
|