@isardsat/editorial-cli 6.0.0-canary-002 → 6.0.1

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.
@@ -1,17 +1,23 @@
1
1
  import { Command } from "@commander-js/extra-typings";
2
- import { mkdir, writeFile } from "fs/promises";
3
- import * as path from "path";
2
+ import { existsSync } from "node:fs";
3
+ import { mkdir, writeFile } from "node:fs/promises";
4
+ import * as path from "node:path";
4
5
  export const initCommand = new Command()
5
6
  .name("init")
6
7
  .description("initialize files required for Editorial to function")
7
8
  .action(async () => {
8
9
  console.log("Initializing editorial...");
10
+ // Check if the editorial directory already exists
11
+ if (existsSync("./editorial")) {
12
+ console.log("Editorial directory already exists!");
13
+ return process.exit(1);
14
+ }
9
15
  try {
10
16
  await mkdir("./editorial", { recursive: true });
11
17
  console.log("Created Editorial directory");
12
18
  // Create config.json with basic configuration
13
19
  const configData = JSON.stringify({
14
- name: "WEkEO",
20
+ name: "Editorial",
15
21
  publicUrl: "http://localhost:3001/",
16
22
  previewUrl: "http://localhost:3001/preview/",
17
23
  }, null, 2);
@@ -29,7 +35,7 @@ dummy:
29
35
  body:
30
36
  type: markdown
31
37
  displayName: Body
32
- displayExtra: 'Write anything you want!'
38
+ displayExtra: "Write anything you want!"
33
39
  `;
34
40
  await writeFile(path.join("editorial", "schema.yaml"), schemaData);
35
41
  console.log("Created schema.yaml");
@@ -20,6 +20,7 @@ export const startCommand = new Command()
20
20
  const editorialServer = await createEditorialServer({});
21
21
  console.log(` Editorial ${version}`);
22
22
  console.log(` - Local: http://localhost:${port}`);
23
+ console.log(` - Admin panel: http://localhost:${port}/admin/dashboard`);
23
24
  console.log(` - Swagger UI: http://localhost:${port}/doc/ui\n`);
24
25
  console.log("Starting api...");
25
26
  serve({
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@isardsat/editorial-cli",
3
- "version": "6.0.0-canary-002",
3
+ "version": "6.0.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {
8
- "editorial": "bin/index.js"
8
+ "editorial": "./bin/index.js"
9
9
  },
10
10
  "files": [
11
11
  "dist"
@@ -14,7 +14,7 @@
14
14
  "@commander-js/extra-typings": "^13.0.0",
15
15
  "@hono/node-server": "^1.13.8",
16
16
  "commander": "^13.1.0",
17
- "@isardsat/editorial-server": "^6.0.0-canary-002"
17
+ "@isardsat/editorial-server": "^6.0.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@tsconfig/node22": "^22.0.0",