feedeas 0.1.0-alpha.5 → 0.1.0-alpha.6
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/index.js +29 -7
- package/package.json +1 -1
- package/src/cli/index.ts +40 -10
- package/test-edit-feature/my-scene.json +33 -0
package/dist/cli/index.js
CHANGED
|
@@ -7109,15 +7109,37 @@ var __filename4 = fileURLToPath4(import.meta.url);
|
|
|
7109
7109
|
var __dirname5 = path13.dirname(__filename4);
|
|
7110
7110
|
var program2 = new Command;
|
|
7111
7111
|
program2.name("feedeas").description("CLI for Feedeas - AI-native video creation tool").version("0.1.0");
|
|
7112
|
-
program2.command("edit [
|
|
7112
|
+
program2.command("edit [path]").alias("start").alias("init").description("Start the Feedeas editor server. Accepts a directory or scene file path.").option("-p, --port <number>", "Port to run on", "3331").option("--no-open", "Do not open browser").action(async (pathArg, options) => {
|
|
7113
7113
|
const port = parseInt(options.port);
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
fs17.
|
|
7114
|
+
let sceneFile;
|
|
7115
|
+
if (pathArg) {
|
|
7116
|
+
const targetPath = path13.resolve(process.cwd(), pathArg);
|
|
7117
|
+
if (fs17.existsSync(targetPath)) {
|
|
7118
|
+
const stats = fs17.statSync(targetPath);
|
|
7119
|
+
if (stats.isFile()) {
|
|
7120
|
+
sceneFile = path13.basename(targetPath);
|
|
7121
|
+
const dir = path13.dirname(targetPath);
|
|
7122
|
+
process.chdir(dir);
|
|
7123
|
+
console.log(`Opening scene file: ${sceneFile}`);
|
|
7124
|
+
} else if (stats.isDirectory()) {
|
|
7125
|
+
process.chdir(targetPath);
|
|
7126
|
+
}
|
|
7127
|
+
} else {
|
|
7128
|
+
if (pathArg.endsWith(".json")) {
|
|
7129
|
+
sceneFile = path13.basename(pathArg);
|
|
7130
|
+
const dir = path13.dirname(path13.resolve(process.cwd(), pathArg));
|
|
7131
|
+
if (!fs17.existsSync(dir)) {
|
|
7132
|
+
console.log(`Creating directory ${dir}...`);
|
|
7133
|
+
fs17.mkdirSync(dir, { recursive: true });
|
|
7134
|
+
}
|
|
7135
|
+
process.chdir(dir);
|
|
7136
|
+
console.log(`Will create new scene file: ${sceneFile}`);
|
|
7137
|
+
} else {
|
|
7138
|
+
console.log(`Creating directory ${targetPath}...`);
|
|
7139
|
+
fs17.mkdirSync(targetPath, { recursive: true });
|
|
7140
|
+
process.chdir(targetPath);
|
|
7141
|
+
}
|
|
7119
7142
|
}
|
|
7120
|
-
process.chdir(targetDir);
|
|
7121
7143
|
}
|
|
7122
7144
|
const cwd = process.cwd();
|
|
7123
7145
|
console.log(`Starting Feedeas in ${cwd}...`);
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -27,23 +27,53 @@ program
|
|
|
27
27
|
.version('0.1.0'); // Updated version
|
|
28
28
|
|
|
29
29
|
program
|
|
30
|
-
.command('edit [
|
|
30
|
+
.command('edit [path]')
|
|
31
31
|
.alias('start')
|
|
32
32
|
.alias('init')
|
|
33
|
-
.description('Start the Feedeas editor server.
|
|
33
|
+
.description('Start the Feedeas editor server. Accepts a directory or scene file path.')
|
|
34
34
|
.option('-p, --port <number>', 'Port to run on', '3331')
|
|
35
35
|
.option('--no-open', 'Do not open browser')
|
|
36
|
-
.action(async (
|
|
36
|
+
.action(async (pathArg, options) => {
|
|
37
37
|
const port = parseInt(options.port);
|
|
38
38
|
|
|
39
|
-
// Handle working directory
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
// Handle working directory or scene file
|
|
40
|
+
let sceneFile: string | undefined;
|
|
41
|
+
if (pathArg) {
|
|
42
|
+
const targetPath = path.resolve(process.cwd(), pathArg);
|
|
43
|
+
|
|
44
|
+
// Check if it's a file or directory
|
|
45
|
+
if (fs.existsSync(targetPath)) {
|
|
46
|
+
const stats = fs.statSync(targetPath);
|
|
47
|
+
|
|
48
|
+
if (stats.isFile()) {
|
|
49
|
+
// It's a scene file - change to its directory
|
|
50
|
+
sceneFile = path.basename(targetPath);
|
|
51
|
+
const dir = path.dirname(targetPath);
|
|
52
|
+
process.chdir(dir);
|
|
53
|
+
console.log(`Opening scene file: ${sceneFile}`);
|
|
54
|
+
} else if (stats.isDirectory()) {
|
|
55
|
+
// It's a directory - change to it
|
|
56
|
+
process.chdir(targetPath);
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
// Path doesn't exist
|
|
60
|
+
if (pathArg.endsWith('.json')) {
|
|
61
|
+
// Looks like a scene file that doesn't exist yet
|
|
62
|
+
sceneFile = path.basename(pathArg);
|
|
63
|
+
const dir = path.dirname(path.resolve(process.cwd(), pathArg));
|
|
64
|
+
if (!fs.existsSync(dir)) {
|
|
65
|
+
console.log(`Creating directory ${dir}...`);
|
|
66
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
67
|
+
}
|
|
68
|
+
process.chdir(dir);
|
|
69
|
+
console.log(`Will create new scene file: ${sceneFile}`);
|
|
70
|
+
} else {
|
|
71
|
+
// Assume it's a directory to create
|
|
72
|
+
console.log(`Creating directory ${targetPath}...`);
|
|
73
|
+
fs.mkdirSync(targetPath, { recursive: true });
|
|
74
|
+
process.chdir(targetPath);
|
|
75
|
+
}
|
|
45
76
|
}
|
|
46
|
-
process.chdir(targetDir);
|
|
47
77
|
}
|
|
48
78
|
|
|
49
79
|
const cwd = process.cwd();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"width": 1080,
|
|
4
|
+
"height": 1350,
|
|
5
|
+
"duration": 5
|
|
6
|
+
},
|
|
7
|
+
"entities": [
|
|
8
|
+
{
|
|
9
|
+
"id": "text-1",
|
|
10
|
+
"type": "text",
|
|
11
|
+
"name": "Hello World",
|
|
12
|
+
"text": "Hello, Feedeas!",
|
|
13
|
+
"startTime": 0,
|
|
14
|
+
"duration": 5,
|
|
15
|
+
"visible": true,
|
|
16
|
+
"x": 540,
|
|
17
|
+
"y": 500,
|
|
18
|
+
"fontSize": 80,
|
|
19
|
+
"fontFamily": "Inter, system-ui",
|
|
20
|
+
"fontWeight": "bold",
|
|
21
|
+
"color": "#ffffff",
|
|
22
|
+
"bgColor": "transparent",
|
|
23
|
+
"maxWidth": 880,
|
|
24
|
+
"lineHeight": 1.2,
|
|
25
|
+
"padding": 0,
|
|
26
|
+
"textAlign": "center",
|
|
27
|
+
"enter": {
|
|
28
|
+
"type": "scale",
|
|
29
|
+
"duration": 0.5
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|