cmx-sdk 0.2.11 → 0.2.13
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.
|
@@ -30,12 +30,13 @@ async function addStudio() {
|
|
|
30
30
|
console.error(" \u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u5834\u5408\u306F\u5148\u306B\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\n");
|
|
31
31
|
process.exit(1);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const envFile = existsSync(join(projectRoot, ".env.local")) ? join(projectRoot, ".env.local") : join(projectRoot, ".env");
|
|
34
|
+
config({ path: envFile });
|
|
34
35
|
const apiUrl = process.env.CMX_API_URL;
|
|
35
36
|
const apiKey = process.env.CMX_API_KEY;
|
|
36
37
|
if (!apiUrl || !apiKey) {
|
|
37
38
|
console.error(" \u274C CMX_API_URL \u3068 CMX_API_KEY \u304C\u5FC5\u8981\u3067\u3059");
|
|
38
|
-
console.error(" .env \u306B\u8A8D\u8A3C\u60C5\u5831\u3092\u8A2D\u5B9A\u3057\u3066\u304B\u3089\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\n");
|
|
39
|
+
console.error(" .env.local \u306B\u8A8D\u8A3C\u60C5\u5831\u3092\u8A2D\u5B9A\u3057\u3066\u304B\u3089\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\n");
|
|
39
40
|
process.exit(1);
|
|
40
41
|
}
|
|
41
42
|
console.log(" \u23F3 Studio \u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u4E2D...");
|
package/dist/cli.js
CHANGED
|
@@ -4413,15 +4413,16 @@ function requireApiCredentials() {
|
|
|
4413
4413
|
return { apiUrl, apiKey };
|
|
4414
4414
|
}
|
|
4415
4415
|
program.action(async () => {
|
|
4416
|
-
const { interactiveMenu } = await import("./interactive-menu-
|
|
4416
|
+
const { interactiveMenu } = await import("./interactive-menu-5NJTB5LJ.js");
|
|
4417
4417
|
await interactiveMenu();
|
|
4418
4418
|
});
|
|
4419
|
-
program.command("init [project-name]").description("\u65B0\u3057\u3044 CMX \u30B5\u30A4\u30C8\u3092\u4F5C\u6210").option("--no-studio", "CMX Studio \u3092\u30B9\u30AD\u30C3\u30D7").option("--pm <manager>", "\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC (npm, pnpm, yarn)").option("--key <key>", "CMX API \u30AD\u30FC\uFF08\u5FC5\u9808\u3002\u672A\u6307\u5B9A\u6642\u306F\u30D7\u30ED\u30F3\u30D7\u30C8\u8868\u793A\uFF09").option("--api-url <url>", "CMX API \u30B5\u30FC\u30D0\u30FC\u306E URL").action(async (projectName, options) => {
|
|
4420
|
-
const { init } = await import("./init-
|
|
4421
|
-
|
|
4419
|
+
program.command("init [project-name]").description("\u65B0\u3057\u3044 CMX \u30B5\u30A4\u30C8\u3092\u4F5C\u6210").option("--no-studio", "CMX Studio \u3092\u30B9\u30AD\u30C3\u30D7").option("--pm <manager>", "\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC (npm, pnpm, yarn)").option("--key <key>", "CMX API \u30AD\u30FC\uFF08\u5FC5\u9808\u3002\u672A\u6307\u5B9A\u6642\u306F\u30D7\u30ED\u30F3\u30D7\u30C8\u8868\u793A\uFF09").option("--api-url <url>", "CMX API \u30B5\u30FC\u30D0\u30FC\u306E URL").option("--project-name <name>", "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u7528\u53EF\u80FD\uFF09").action(async (projectName, options) => {
|
|
4420
|
+
const { init } = await import("./init-FPFDEEXW.js");
|
|
4421
|
+
const finalProjectName = options.projectName || projectName;
|
|
4422
|
+
await init(finalProjectName, options);
|
|
4422
4423
|
});
|
|
4423
4424
|
program.command("add-studio").description("\u65E2\u5B58\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B CMX Studio \u3092\u8FFD\u52A0").action(async () => {
|
|
4424
|
-
const { addStudio } = await import("./add-studio-
|
|
4425
|
+
const { addStudio } = await import("./add-studio-QWLCCO5M.js");
|
|
4425
4426
|
await addStudio();
|
|
4426
4427
|
});
|
|
4427
4428
|
program.command("update-studio").description("\u65E2\u5B58\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E CMX Studio \u3092\u6700\u65B0\u5316").option("--force", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action((options) => updateStudio(options));
|
|
@@ -25,7 +25,7 @@ async function downloadAndExtractViaApi(targetDir, apiUrl, apiKey) {
|
|
|
25
25
|
cleanupTempFile(tmpFile);
|
|
26
26
|
}
|
|
27
27
|
function writeEnvFile(targetDir, apiUrl, apiKey) {
|
|
28
|
-
const envPath = join(targetDir, ".env");
|
|
28
|
+
const envPath = join(targetDir, ".env.local");
|
|
29
29
|
const envContent = [
|
|
30
30
|
"# CMX API Configuration (auto-generated by cmx-sdk init)",
|
|
31
31
|
`CMX_API_URL=${apiUrl}`,
|
|
@@ -128,7 +128,7 @@ async function init(projectName, options) {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
writeEnvFile(targetDir, apiUrl, apiKey);
|
|
131
|
-
console.log(" \u2713 .env \u306B API \u8A8D\u8A3C\u60C5\u5831\u3092\u66F8\u304D\u8FBC\u307F\u307E\u3057\u305F");
|
|
131
|
+
console.log(" \u2713 .env.local \u306B API \u8A8D\u8A3C\u60C5\u5831\u3092\u66F8\u304D\u8FBC\u307F\u307E\u3057\u305F");
|
|
132
132
|
console.log(`
|
|
133
133
|
\u{1F4E6} \u4F9D\u5B58\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u4E2D...`);
|
|
134
134
|
const installCmd = packageManager === "yarn" ? "yarn" : `${packageManager} install`;
|
|
@@ -19,11 +19,11 @@ async function interactiveMenu() {
|
|
|
19
19
|
});
|
|
20
20
|
switch (action) {
|
|
21
21
|
case "init": {
|
|
22
|
-
const { init } = await import("./init-
|
|
22
|
+
const { init } = await import("./init-FPFDEEXW.js");
|
|
23
23
|
return init(void 0, {});
|
|
24
24
|
}
|
|
25
25
|
case "add-studio": {
|
|
26
|
-
const { addStudio } = await import("./add-studio-
|
|
26
|
+
const { addStudio } = await import("./add-studio-QWLCCO5M.js");
|
|
27
27
|
return addStudio();
|
|
28
28
|
}
|
|
29
29
|
case "update-studio": {
|