create-factory 0.1.0-alpha.11 → 0.1.0-alpha.4
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 +0 -60
- package/README.md +1 -1
- package/dist/index.js +13 -47
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,65 +1,5 @@
|
|
|
1
1
|
# create-factory
|
|
2
2
|
|
|
3
|
-
## 0.1.0-alpha.11
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [[`c9de100`](https://github.com/mastra-ai/mastra/commit/c9de10008ff3f72911bf746294004c305674d855), [`20b159d`](https://github.com/mastra-ai/mastra/commit/20b159d8f5d8153493ec8d5b6cd2864af8ce2c8e)]:
|
|
8
|
-
- mastra@1.20.0-alpha.17
|
|
9
|
-
|
|
10
|
-
## 0.1.0-alpha.10
|
|
11
|
-
|
|
12
|
-
### Patch Changes
|
|
13
|
-
|
|
14
|
-
- Changed the create-factory template sync to pin every Mastra dep to `"latest"` instead of `"alpha"`. Scaffolded projects now install the same set of Mastra packages as every other create-mastra template, and no longer ship a `.npmrc` with `legacy-peer-deps=true` (that flag only existed to accommodate the prerelease peer graph). ([#20052](https://github.com/mastra-ai/mastra/pull/20052))
|
|
15
|
-
|
|
16
|
-
- Updated dependencies [[`91930d6`](https://github.com/mastra-ai/mastra/commit/91930d69ae8146ded10c792387848970f1ca4b59)]:
|
|
17
|
-
- mastra@1.20.0-alpha.16
|
|
18
|
-
|
|
19
|
-
## 0.1.0-alpha.9
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- Simplified the create-factory success message: sandboxes now appear as a bullet in the provisioned resources list so users know code agent sessions run inside Mastra platform sandboxes. ([#20062](https://github.com/mastra-ai/mastra/pull/20062))
|
|
24
|
-
|
|
25
|
-
## 0.1.0-alpha.8
|
|
26
|
-
|
|
27
|
-
### Patch Changes
|
|
28
|
-
|
|
29
|
-
- The factory template now ships a pnpm-workspace.yaml with allowBuilds, preventing pnpm v10+ from exiting with ERR_PNPM_IGNORED_BUILDS during install or build. The file mirrors the mastracode/web build-approval policy minus test-only deps stripped by the template. ([#20056](https://github.com/mastra-ai/mastra/pull/20056))
|
|
30
|
-
|
|
31
|
-
- Updated dependencies [[`0182be3`](https://github.com/mastra-ai/mastra/commit/0182be35cd402209182097098e7ebc07a5a54a2a)]:
|
|
32
|
-
- mastra@1.20.0-alpha.15
|
|
33
|
-
|
|
34
|
-
## 0.1.0-alpha.7
|
|
35
|
-
|
|
36
|
-
### Minor Changes
|
|
37
|
-
|
|
38
|
-
- Added EU and US region selection when creating Factory platform projects, with a --region flag for non-interactive setup. ([#20040](https://github.com/mastra-ai/mastra/pull/20040))
|
|
39
|
-
|
|
40
|
-
### Patch Changes
|
|
41
|
-
|
|
42
|
-
- Updated the generated project README for the single-server setup: the Factory UI and API are both served from `http://localhost:4111`, OAuth callback instructions use the server origin, and the removed `dev:prod` / `build:ui` scripts are no longer documented. ([#20036](https://github.com/mastra-ai/mastra/pull/20036))
|
|
43
|
-
|
|
44
|
-
- Stop shipping `pnpm-workspace.yaml` and `package-lock.json` in projects scaffolded by `npm create factory`. The template generator now excludes the web project's pnpm workspace marker and lockfiles, and the sync workflow validates the template in a throwaway copy so `npm install` artifacts can no longer leak into the published template repository. ([#20041](https://github.com/mastra-ai/mastra/pull/20041))
|
|
45
|
-
|
|
46
|
-
## 0.1.0-alpha.6
|
|
47
|
-
|
|
48
|
-
### Patch Changes
|
|
49
|
-
|
|
50
|
-
- Improved the create-factory sign-in and success experience: ([#20024](https://github.com/mastra-ai/mastra/pull/20024))
|
|
51
|
-
|
|
52
|
-
- 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.
|
|
53
|
-
- 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.
|
|
54
|
-
|
|
55
|
-
- 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))
|
|
56
|
-
|
|
57
|
-
## 0.1.0-alpha.5
|
|
58
|
-
|
|
59
|
-
### Patch Changes
|
|
60
|
-
|
|
61
|
-
- 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))
|
|
62
|
-
|
|
63
3
|
## 0.1.0-alpha.4
|
|
64
4
|
|
|
65
5
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Options:
|
|
|
22
22
|
--template <template-name> Create a project from a template (public GitHub URL) (default: "https://github.com/mastra-ai/softwarefactory-template")
|
|
23
23
|
--no-platform Skip Mastra platform sign-in, project, and Neon provisioning
|
|
24
24
|
--org <org> Mastra organization id or name — skips the interactive org picker
|
|
25
|
-
--region <region>
|
|
25
|
+
--region <region> Neon region id (passed to the platform verbatim)
|
|
26
26
|
-v, --version output the version number
|
|
27
27
|
-h, --help display help for command
|
|
28
28
|
```
|
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, MASTRA_PLATFORM_API_URL as MASTRA_PLATFORM_API_URL2, resolveCurrentOrg } from "mastra/internal/auth";
|
|
76
76
|
import color from "picocolors";
|
|
77
77
|
import { x as x2 } from "tinyexec";
|
|
78
78
|
|
|
@@ -131,13 +131,12 @@ var PlatformApiError = class extends Error {
|
|
|
131
131
|
async function createServerProject({
|
|
132
132
|
token,
|
|
133
133
|
orgId,
|
|
134
|
-
name
|
|
135
|
-
region
|
|
134
|
+
name
|
|
136
135
|
}) {
|
|
137
136
|
const res = await platformFetch(`${MASTRA_PLATFORM_API_URL}/v1/server/projects`, {
|
|
138
137
|
method: "POST",
|
|
139
138
|
headers: { ...authHeaders(token, orgId), "Content-Type": "application/json" },
|
|
140
|
-
body: JSON.stringify({ name,
|
|
139
|
+
body: JSON.stringify({ name, factoryEnabled: true })
|
|
141
140
|
});
|
|
142
141
|
if (!res.ok) {
|
|
143
142
|
throw new PlatformApiError(res.status, `Failed to create project \u2014 ${await extractError(res)}`);
|
|
@@ -173,7 +172,7 @@ async function attachNeonDatabase({
|
|
|
173
172
|
{
|
|
174
173
|
method: "POST",
|
|
175
174
|
headers: { ...authHeaders(token, orgId), "Content-Type": "application/json" },
|
|
176
|
-
body: JSON.stringify({ kind: "neon", name, regionId })
|
|
175
|
+
body: JSON.stringify({ kind: "neon", name, ...regionId ? { regionId } : {} })
|
|
177
176
|
}
|
|
178
177
|
);
|
|
179
178
|
if (!res.ok) {
|
|
@@ -385,21 +384,8 @@ function getInstallArgs(packageManager) {
|
|
|
385
384
|
}
|
|
386
385
|
|
|
387
386
|
// src/create.ts
|
|
388
|
-
var PROJECT_REGION_OPTIONS = [
|
|
389
|
-
{ value: "eu", label: "\u{1F1EA}\u{1F1FA} eu" },
|
|
390
|
-
{ value: "us", label: "\u{1F1FA}\u{1F1F8} us" }
|
|
391
|
-
];
|
|
392
|
-
var NEON_REGION_BY_PROJECT_REGION = {
|
|
393
|
-
eu: "aws-eu-central-1",
|
|
394
|
-
us: "aws-us-west-2"
|
|
395
|
-
};
|
|
396
|
-
function parseProjectRegion(region) {
|
|
397
|
-
if (region === "eu" || region === "us") return region;
|
|
398
|
-
throw new Error(`Invalid --region "${region}". Expected one of: eu, us.`);
|
|
399
|
-
}
|
|
400
387
|
async function create(args) {
|
|
401
388
|
p.intro(color.inverse(" Mastra Factory "));
|
|
402
|
-
const requestedRegion = args.region ? parseProjectRegion(args.region) : void 0;
|
|
403
389
|
const projectName = args.projectName ?? await p.text({
|
|
404
390
|
message: "What do you want to name your project?",
|
|
405
391
|
placeholder: "my-mastra-factory",
|
|
@@ -457,7 +443,7 @@ You can retry manually: cd ${projectName} && ${packageManager} install`
|
|
|
457
443
|
platformResult = await runPlatformProvisioning({
|
|
458
444
|
projectName,
|
|
459
445
|
projectPath,
|
|
460
|
-
region:
|
|
446
|
+
region: args.region,
|
|
461
447
|
org: args.org
|
|
462
448
|
});
|
|
463
449
|
} catch (err) {
|
|
@@ -498,17 +484,14 @@ You can retry manually: cd ${projectName} && ${packageManager} install`
|
|
|
498
484
|
`${color.cyan("cd")} ${projectName}`,
|
|
499
485
|
color.cyan(`${packageManager} run dev`),
|
|
500
486
|
"",
|
|
501
|
-
`Factory UI ${color.underline("http://localhost:
|
|
487
|
+
`Factory UI ${color.underline("http://localhost:5173")}`,
|
|
488
|
+
`Mastra Studio ${color.underline("http://localhost:4111")}`,
|
|
502
489
|
""
|
|
503
490
|
];
|
|
504
491
|
if (platformResult) {
|
|
505
492
|
lines.push(
|
|
506
|
-
`${color.green("
|
|
507
|
-
`
|
|
508
|
-
` - Postgres database (credentials written to ${color.cyan(".env")})`,
|
|
509
|
-
` - Sandboxes (code agent sessions run here)`,
|
|
510
|
-
"",
|
|
511
|
-
`Manage your project at ${color.underline("https://projects.mastra.ai")}`
|
|
493
|
+
`${color.green("Platform connected.")} Project ${color.cyan(platformResult.project.name)} in ${color.cyan(platformResult.orgName)}.`,
|
|
494
|
+
`Wrote ${color.cyan("MASTRA_PROJECT_ID")}, ${color.cyan("MASTRA_PLATFORM_SECRET_KEY")}, and ${color.cyan("DATABASE_URL")} to ${color.cyan(".env")}.`
|
|
512
495
|
);
|
|
513
496
|
} else if (args.noPlatform) {
|
|
514
497
|
lines.push(
|
|
@@ -539,34 +522,17 @@ async function runPlatformProvisioning({
|
|
|
539
522
|
flushed = true;
|
|
540
523
|
};
|
|
541
524
|
try {
|
|
542
|
-
const willOpenAuthFlow = !process.env.MASTRA_API_TOKEN && !await loadCredentials();
|
|
543
|
-
if (willOpenAuthFlow) {
|
|
544
|
-
const proceed = await p.text({
|
|
545
|
-
message: "Mastra account is required, press enter to continue...",
|
|
546
|
-
defaultValue: ""
|
|
547
|
-
});
|
|
548
|
-
if (p.isCancel(proceed)) {
|
|
549
|
-
throw new Error("Sign-in cancelled.");
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
525
|
p.log.info("Signing in to Mastra\u2026");
|
|
553
526
|
const token = await getToken();
|
|
554
527
|
const { orgId, orgName } = org ? await resolveOrgFromFlag(token, org) : await resolveCurrentOrg(token, { forcePrompt: true });
|
|
555
528
|
p.log.info(`Using organization ${color.cyan(orgName)}.`);
|
|
529
|
+
envAccumulator.MASTRA_SHARED_API_URL = MASTRA_PLATFORM_API_URL2;
|
|
556
530
|
envAccumulator.MASTRA_ORGANIZATION_ID = orgId;
|
|
557
|
-
const projectRegion = region ?? await p.select({
|
|
558
|
-
message: "Where should your Factory project run?",
|
|
559
|
-
options: [...PROJECT_REGION_OPTIONS]
|
|
560
|
-
});
|
|
561
|
-
if (p.isCancel(projectRegion)) {
|
|
562
|
-
p.cancel("Operation cancelled");
|
|
563
|
-
process.exit(0);
|
|
564
|
-
}
|
|
565
531
|
const projectSpinner = p.spinner();
|
|
566
532
|
projectSpinner.start(`Creating platform project "${projectName}"\u2026`);
|
|
567
533
|
let project;
|
|
568
534
|
try {
|
|
569
|
-
project = await createServerProject({ token, orgId, name: projectName
|
|
535
|
+
project = await createServerProject({ token, orgId, name: projectName });
|
|
570
536
|
projectSpinner.stop(`Created platform project ${color.cyan(project.slug)}.`);
|
|
571
537
|
} catch (err) {
|
|
572
538
|
projectSpinner.stop("Project creation failed.");
|
|
@@ -597,7 +563,7 @@ async function runPlatformProvisioning({
|
|
|
597
563
|
orgId,
|
|
598
564
|
projectId: project.id,
|
|
599
565
|
name: sanitizeDatabaseName(projectName),
|
|
600
|
-
regionId:
|
|
566
|
+
regionId: region
|
|
601
567
|
});
|
|
602
568
|
const ready = await waitForDatabaseReady({
|
|
603
569
|
token,
|
|
@@ -668,7 +634,7 @@ var pkg = JSON.parse(
|
|
|
668
634
|
var analytics = new Analytics(pkg.version);
|
|
669
635
|
var program = new Command();
|
|
670
636
|
var DEFAULT_TEMPLATE_REPO = "https://github.com/mastra-ai/softwarefactory-template";
|
|
671
|
-
program.name("create-factory").description("Create a new Mastra Factory project").argument("[project-name]", "Directory name of the project").option("--template <template-name>", "Create a project from a template (public GitHub URL)", DEFAULT_TEMPLATE_REPO).option("--no-platform", "Skip Mastra platform sign-in, project, and Neon provisioning").option("--org <org>", "Mastra organization id or name \u2014 skips the interactive org picker").option("--region <region>", "
|
|
637
|
+
program.name("create-factory").description("Create a new Mastra Factory project").argument("[project-name]", "Directory name of the project").option("--template <template-name>", "Create a project from a template (public GitHub URL)", DEFAULT_TEMPLATE_REPO).option("--no-platform", "Skip Mastra platform sign-in, project, and Neon provisioning").option("--org <org>", "Mastra organization id or name \u2014 skips the interactive org picker").option("--region <region>", "Neon region id (passed to the platform verbatim)").version(pkg.version, "-v, --version").action(async (projectNameArg, args) => {
|
|
672
638
|
await create({
|
|
673
639
|
projectName: projectNameArg,
|
|
674
640
|
template: args.template,
|
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.4",
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"picocolors": "^1.1.1",
|
|
39
39
|
"posthog-node": "^5.37.0",
|
|
40
40
|
"tinyexec": "^1.2.4",
|
|
41
|
-
"mastra": "1.20.0-alpha.
|
|
41
|
+
"mastra": "1.20.0-alpha.14"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "22.20.1",
|