create-factory 0.1.0-alpha.6 → 0.1.0-alpha.7
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 +12 -0
- package/README.md +1 -1
- package/dist/index.js +29 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# create-factory
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.7
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 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))
|
|
12
|
+
|
|
13
|
+
- 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))
|
|
14
|
+
|
|
3
15
|
## 0.1.0-alpha.6
|
|
4
16
|
|
|
5
17
|
### Patch 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> Platform project region (eu or us); prompts when omitted
|
|
26
26
|
-v, --version output the version number
|
|
27
27
|
-h, --help display help for command
|
|
28
28
|
```
|
package/dist/index.js
CHANGED
|
@@ -131,12 +131,13 @@ var PlatformApiError = class extends Error {
|
|
|
131
131
|
async function createServerProject({
|
|
132
132
|
token,
|
|
133
133
|
orgId,
|
|
134
|
-
name
|
|
134
|
+
name,
|
|
135
|
+
region
|
|
135
136
|
}) {
|
|
136
137
|
const res = await platformFetch(`${MASTRA_PLATFORM_API_URL}/v1/server/projects`, {
|
|
137
138
|
method: "POST",
|
|
138
139
|
headers: { ...authHeaders(token, orgId), "Content-Type": "application/json" },
|
|
139
|
-
body: JSON.stringify({ name, factoryEnabled: true })
|
|
140
|
+
body: JSON.stringify({ name, region, factoryEnabled: true })
|
|
140
141
|
});
|
|
141
142
|
if (!res.ok) {
|
|
142
143
|
throw new PlatformApiError(res.status, `Failed to create project \u2014 ${await extractError(res)}`);
|
|
@@ -172,7 +173,7 @@ async function attachNeonDatabase({
|
|
|
172
173
|
{
|
|
173
174
|
method: "POST",
|
|
174
175
|
headers: { ...authHeaders(token, orgId), "Content-Type": "application/json" },
|
|
175
|
-
body: JSON.stringify({ kind: "neon", name,
|
|
176
|
+
body: JSON.stringify({ kind: "neon", name, regionId })
|
|
176
177
|
}
|
|
177
178
|
);
|
|
178
179
|
if (!res.ok) {
|
|
@@ -384,8 +385,21 @@ function getInstallArgs(packageManager) {
|
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
// 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
|
+
}
|
|
387
400
|
async function create(args) {
|
|
388
401
|
p.intro(color.inverse(" Mastra Factory "));
|
|
402
|
+
const requestedRegion = args.region ? parseProjectRegion(args.region) : void 0;
|
|
389
403
|
const projectName = args.projectName ?? await p.text({
|
|
390
404
|
message: "What do you want to name your project?",
|
|
391
405
|
placeholder: "my-mastra-factory",
|
|
@@ -443,7 +457,7 @@ You can retry manually: cd ${projectName} && ${packageManager} install`
|
|
|
443
457
|
platformResult = await runPlatformProvisioning({
|
|
444
458
|
projectName,
|
|
445
459
|
projectPath,
|
|
446
|
-
region:
|
|
460
|
+
region: requestedRegion,
|
|
447
461
|
org: args.org
|
|
448
462
|
});
|
|
449
463
|
} catch (err) {
|
|
@@ -540,11 +554,19 @@ async function runPlatformProvisioning({
|
|
|
540
554
|
const { orgId, orgName } = org ? await resolveOrgFromFlag(token, org) : await resolveCurrentOrg(token, { forcePrompt: true });
|
|
541
555
|
p.log.info(`Using organization ${color.cyan(orgName)}.`);
|
|
542
556
|
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
|
+
}
|
|
543
565
|
const projectSpinner = p.spinner();
|
|
544
566
|
projectSpinner.start(`Creating platform project "${projectName}"\u2026`);
|
|
545
567
|
let project;
|
|
546
568
|
try {
|
|
547
|
-
project = await createServerProject({ token, orgId, name: projectName });
|
|
569
|
+
project = await createServerProject({ token, orgId, name: projectName, region: projectRegion });
|
|
548
570
|
projectSpinner.stop(`Created platform project ${color.cyan(project.slug)}.`);
|
|
549
571
|
} catch (err) {
|
|
550
572
|
projectSpinner.stop("Project creation failed.");
|
|
@@ -575,7 +597,7 @@ async function runPlatformProvisioning({
|
|
|
575
597
|
orgId,
|
|
576
598
|
projectId: project.id,
|
|
577
599
|
name: sanitizeDatabaseName(projectName),
|
|
578
|
-
regionId:
|
|
600
|
+
regionId: NEON_REGION_BY_PROJECT_REGION[projectRegion]
|
|
579
601
|
});
|
|
580
602
|
const ready = await waitForDatabaseReady({
|
|
581
603
|
token,
|
|
@@ -646,7 +668,7 @@ var pkg = JSON.parse(
|
|
|
646
668
|
var analytics = new Analytics(pkg.version);
|
|
647
669
|
var program = new Command();
|
|
648
670
|
var DEFAULT_TEMPLATE_REPO = "https://github.com/mastra-ai/softwarefactory-template";
|
|
649
|
-
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>", "
|
|
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>", "Platform project region (eu or us); prompts when omitted").version(pkg.version, "-v, --version").action(async (projectNameArg, args) => {
|
|
650
672
|
await create({
|
|
651
673
|
projectName: projectNameArg,
|
|
652
674
|
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.7",
|
|
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",
|