@isardsat/create-editorial 6.0.1 → 6.0.3
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/bin/index.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +19 -25
- package/package.json +2 -2
package/bin/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export declare const command: Command;
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.command = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const node_fs_1 = require("node:fs");
|
|
6
6
|
const promises_1 = require("node:fs/promises");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const package_json_1 = require("./utils/package-json");
|
|
9
9
|
const { version } = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, "../package.json"), "utf8"));
|
|
10
|
-
|
|
10
|
+
exports.command = new commander_1.Command()
|
|
11
11
|
.version(version)
|
|
12
|
-
.
|
|
12
|
+
.argument("[directory]", "root directory for your application")
|
|
13
13
|
.usage("[directory] [options]")
|
|
14
|
-
.description("Create a new Editorial application")
|
|
15
|
-
async
|
|
16
|
-
|
|
17
|
-
const directory = options.args[0];
|
|
18
|
-
console.log("Creating new Editorial application");
|
|
19
|
-
if (!directory) {
|
|
20
|
-
console.error("Directory is required");
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
14
|
+
.description("Create a new Editorial application")
|
|
15
|
+
.action(async (directory) => {
|
|
16
|
+
console.log("Creating new Editorial application...");
|
|
23
17
|
try {
|
|
24
18
|
await (0, promises_1.access)(directory);
|
|
25
19
|
console.error("Directory already exists");
|
|
@@ -40,18 +34,18 @@ async function run() {
|
|
|
40
34
|
await (0, promises_1.writeFile)((0, node_path_1.join)(directory, "editorial", "config.json"), configData);
|
|
41
35
|
console.log("Creating schema.yaml...");
|
|
42
36
|
const schemaData = `# Editorial Schema
|
|
43
|
-
dummy:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
`;
|
|
37
|
+
dummy:
|
|
38
|
+
displayName: Dummy Object
|
|
39
|
+
fields:
|
|
40
|
+
title:
|
|
41
|
+
type: string
|
|
42
|
+
displayName: Title
|
|
43
|
+
showInSummary: true
|
|
44
|
+
body:
|
|
45
|
+
type: markdown
|
|
46
|
+
displayName: Body
|
|
47
|
+
displayExtra: 'Write anything you want!'
|
|
48
|
+
`;
|
|
55
49
|
await (0, promises_1.writeFile)((0, node_path_1.join)(directory, "editorial", "schema.yaml"), schemaData);
|
|
56
50
|
console.log("Creating data.json...");
|
|
57
51
|
const dataJson = JSON.stringify({
|
|
@@ -67,4 +61,4 @@ dummy:
|
|
|
67
61
|
console.log("Creating package.json...");
|
|
68
62
|
await (0, package_json_1.createPackageJSON)(directory, version);
|
|
69
63
|
console.log("Done!");
|
|
70
|
-
}
|
|
64
|
+
});
|
package/package.json
CHANGED