create-factory 0.1.0-alpha.4 → 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/CHANGELOG.md +17 -0
- package/dist/index.js +18 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# create-factory
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Improved the create-factory sign-in and success experience: ([#20024](https://github.com/mastra-ai/mastra/pull/20024))
|
|
8
|
+
|
|
9
|
+
- When no Mastra platform session exists, the CLI now pauses with "Mastra account is required, press enter to continue..." before opening the browser auth flow instead of opening it unannounced.
|
|
10
|
+
- The success message now summarizes the infrastructure provisioned on Mastra platform (project, Postgres database, credentials in .env), notes that deployed code agent sessions run inside Mastra platform sandboxes, and links to https://projects.mastra.ai for managing the project.
|
|
11
|
+
|
|
12
|
+
- Fixed generated Factory projects to serve the UI and API from a single Mastra development server. ([#20019](https://github.com/mastra-ai/mastra/pull/20019))
|
|
13
|
+
|
|
14
|
+
## 0.1.0-alpha.5
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Stopped writing MASTRA_SHARED_API_URL to the scaffolded project's .env during platform provisioning. Platform consumers now use their built-in default platform URL, so scaffolded factories no longer pin the API endpoint at create time. ([#20021](https://github.com/mastra-ai/mastra/pull/20021))
|
|
19
|
+
|
|
3
20
|
## 0.1.0-alpha.4
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ var Analytics = class {
|
|
|
72
72
|
import fs3 from "fs";
|
|
73
73
|
import path3 from "path";
|
|
74
74
|
import * as p from "@clack/prompts";
|
|
75
|
-
import { fetchOrgs, getToken,
|
|
75
|
+
import { fetchOrgs, getToken, loadCredentials, resolveCurrentOrg } from "mastra/internal/auth";
|
|
76
76
|
import color from "picocolors";
|
|
77
77
|
import { x as x2 } from "tinyexec";
|
|
78
78
|
|
|
@@ -484,14 +484,17 @@ You can retry manually: cd ${projectName} && ${packageManager} install`
|
|
|
484
484
|
`${color.cyan("cd")} ${projectName}`,
|
|
485
485
|
color.cyan(`${packageManager} run dev`),
|
|
486
486
|
"",
|
|
487
|
-
`Factory UI ${color.underline("http://localhost:
|
|
488
|
-
`Mastra Studio ${color.underline("http://localhost:4111")}`,
|
|
487
|
+
`Factory UI ${color.underline("http://localhost:4111")}`,
|
|
489
488
|
""
|
|
490
489
|
];
|
|
491
490
|
if (platformResult) {
|
|
492
491
|
lines.push(
|
|
493
|
-
`${color.green("
|
|
494
|
-
`
|
|
492
|
+
`${color.green("Provisioned on Mastra platform")} in ${color.cyan(platformResult.orgName)}:`,
|
|
493
|
+
` - Project ${color.cyan(platformResult.project.name)}`,
|
|
494
|
+
` - Postgres database (credentials written to ${color.cyan(".env")})`,
|
|
495
|
+
"",
|
|
496
|
+
"When deployed, code agent sessions run inside Mastra platform sandboxes.",
|
|
497
|
+
`Manage your project at ${color.underline("https://projects.mastra.ai")}`
|
|
495
498
|
);
|
|
496
499
|
} else if (args.noPlatform) {
|
|
497
500
|
lines.push(
|
|
@@ -522,11 +525,20 @@ async function runPlatformProvisioning({
|
|
|
522
525
|
flushed = true;
|
|
523
526
|
};
|
|
524
527
|
try {
|
|
528
|
+
const willOpenAuthFlow = !process.env.MASTRA_API_TOKEN && !await loadCredentials();
|
|
529
|
+
if (willOpenAuthFlow) {
|
|
530
|
+
const proceed = await p.text({
|
|
531
|
+
message: "Mastra account is required, press enter to continue...",
|
|
532
|
+
defaultValue: ""
|
|
533
|
+
});
|
|
534
|
+
if (p.isCancel(proceed)) {
|
|
535
|
+
throw new Error("Sign-in cancelled.");
|
|
536
|
+
}
|
|
537
|
+
}
|
|
525
538
|
p.log.info("Signing in to Mastra\u2026");
|
|
526
539
|
const token = await getToken();
|
|
527
540
|
const { orgId, orgName } = org ? await resolveOrgFromFlag(token, org) : await resolveCurrentOrg(token, { forcePrompt: true });
|
|
528
541
|
p.log.info(`Using organization ${color.cyan(orgName)}.`);
|
|
529
|
-
envAccumulator.MASTRA_SHARED_API_URL = MASTRA_PLATFORM_API_URL2;
|
|
530
542
|
envAccumulator.MASTRA_ORGANIZATION_ID = orgId;
|
|
531
543
|
const projectSpinner = p.spinner();
|
|
532
544
|
projectSpinner.start(`Creating platform project "${projectName}"\u2026`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-factory",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"description": "Create a Mastra Factory project: an agent-powered software delivery environment built on Mastra. Run `npm create factory` to scaffold and get started.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|