create-nyoworks 2.4.1 → 2.5.0
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/checks.js +2 -8
- package/dist/init.js +45 -0
- package/package.json +1 -1
package/dist/checks.js
CHANGED
|
@@ -24,18 +24,12 @@ const DEPENDENCIES = [
|
|
|
24
24
|
url: "https://docker.com/download",
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
name: "Claude
|
|
27
|
+
name: "Claude Code",
|
|
28
28
|
cmd: "claude",
|
|
29
29
|
args: ["-v"],
|
|
30
30
|
required: false,
|
|
31
31
|
install: "npm i -g @anthropic-ai/claude-code",
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
name: "VS Code",
|
|
35
|
-
cmd: "code",
|
|
36
|
-
args: ["-v"],
|
|
37
|
-
required: false,
|
|
38
|
-
url: "https://code.visualstudio.com",
|
|
32
|
+
url: "https://claude.ai/download",
|
|
39
33
|
},
|
|
40
34
|
];
|
|
41
35
|
async function checkCommand(cmd, args = []) {
|
package/dist/init.js
CHANGED
|
@@ -23,6 +23,16 @@ const AVAILABLE_PLATFORMS = [
|
|
|
23
23
|
{ title: "Mobile", value: "mobile", description: "Expo SDK 54" },
|
|
24
24
|
{ title: "Desktop", value: "desktop", description: "Tauri 2.0" },
|
|
25
25
|
];
|
|
26
|
+
const AVAILABLE_LANGUAGES = [
|
|
27
|
+
{ title: "Turkish", value: "tr", description: "Türkçe yanıtlar" },
|
|
28
|
+
{ title: "English", value: "en", description: "English responses" },
|
|
29
|
+
{ title: "Dutch", value: "nl", description: "Nederlandse antwoorden" },
|
|
30
|
+
];
|
|
31
|
+
const LANGUAGE_RESPONSES = {
|
|
32
|
+
tr: "Turkish",
|
|
33
|
+
en: "English",
|
|
34
|
+
nl: "Dutch",
|
|
35
|
+
};
|
|
26
36
|
function generateCode(name) {
|
|
27
37
|
return name
|
|
28
38
|
.toUpperCase()
|
|
@@ -80,6 +90,13 @@ export async function createProject(projectName) {
|
|
|
80
90
|
hint: "- Space to select. Return to submit",
|
|
81
91
|
instructions: false,
|
|
82
92
|
},
|
|
93
|
+
{
|
|
94
|
+
type: "select",
|
|
95
|
+
name: "language",
|
|
96
|
+
message: "Agent response language:",
|
|
97
|
+
choices: AVAILABLE_LANGUAGES,
|
|
98
|
+
initial: 0,
|
|
99
|
+
},
|
|
83
100
|
]);
|
|
84
101
|
if (!response.name && !projectName) {
|
|
85
102
|
console.log(pc.red("Aborted."));
|
|
@@ -91,6 +108,7 @@ export async function createProject(projectName) {
|
|
|
91
108
|
const databaseName = generateDatabaseName(name);
|
|
92
109
|
const platforms = response.platforms || ["web"];
|
|
93
110
|
const features = response.features || [];
|
|
111
|
+
const language = response.language || "tr";
|
|
94
112
|
const targetDir = path.resolve(process.cwd(), slug);
|
|
95
113
|
if (fs.existsSync(targetDir)) {
|
|
96
114
|
console.log(pc.red(`Directory ${slug} already exists.`));
|
|
@@ -142,9 +160,11 @@ export async function createProject(projectName) {
|
|
|
142
160
|
"pnpm-workspace.yaml",
|
|
143
161
|
"turbo.json",
|
|
144
162
|
"tsconfig.json",
|
|
163
|
+
"tsconfig.base.json",
|
|
145
164
|
".env.example",
|
|
146
165
|
".gitignore",
|
|
147
166
|
"nyoworks.config.yaml",
|
|
167
|
+
"docker-compose.yml",
|
|
148
168
|
];
|
|
149
169
|
for (const file of rootFiles) {
|
|
150
170
|
const src = path.join(repoDir, file);
|
|
@@ -160,6 +180,7 @@ export async function createProject(projectName) {
|
|
|
160
180
|
"${PROJECT_CODE}": code,
|
|
161
181
|
"${PROJECT_SLUG}": slug,
|
|
162
182
|
"${DATABASE_NAME}": databaseName,
|
|
183
|
+
"${RESPONSE_LANGUAGE}": LANGUAGE_RESPONSES[language] || "Turkish",
|
|
163
184
|
};
|
|
164
185
|
process.stdout.write(pc.dim(" Replacing placeholders..."));
|
|
165
186
|
await replacePlaceholders(targetDir, placeholders);
|
|
@@ -232,5 +253,29 @@ See \`docs/bible/data/schema.md\`
|
|
|
232
253
|
console.log(pc.dim(` Code: ${code}`));
|
|
233
254
|
console.log(pc.dim(` Platforms: ${platforms.join(", ")}`));
|
|
234
255
|
console.log(pc.dim(` Features: ${features.join(", ") || "none"}`));
|
|
256
|
+
console.log(pc.dim(` Language: ${LANGUAGE_RESPONSES[language] || "Turkish"}`));
|
|
235
257
|
console.log();
|
|
258
|
+
process.stdout.write(pc.dim(" Building MCP server..."));
|
|
259
|
+
try {
|
|
260
|
+
await execa("pnpm", ["install"], { cwd: path.join(targetDir, "mcp-server") });
|
|
261
|
+
await execa("pnpm", ["build"], { cwd: path.join(targetDir, "mcp-server") });
|
|
262
|
+
console.log(pc.green(" done"));
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
console.log(pc.yellow(" skipped (run manually: cd mcp-server && pnpm install && pnpm build)"));
|
|
266
|
+
}
|
|
267
|
+
const mcpConfigPath = path.join(targetDir, ".claude", "settings.local.json");
|
|
268
|
+
const mcpConfig = {
|
|
269
|
+
mcpServers: {
|
|
270
|
+
nyoworks: {
|
|
271
|
+
command: "node",
|
|
272
|
+
args: [path.join(targetDir, "mcp-server", "dist", "index.js")],
|
|
273
|
+
env: {
|
|
274
|
+
PROJECT_ROOT: targetDir,
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
await fs.outputJson(mcpConfigPath, mcpConfig, { spaces: 2 });
|
|
280
|
+
console.log(pc.dim(" Created .claude/settings.local.json"));
|
|
236
281
|
}
|