create-factory 0.3.1-alpha.2 → 0.3.1-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/dist/index.js +7 -14
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { LoginCancelledError, MASTRA_PLATFORM_API_URL, authHeaders, extractApiEr
|
|
|
9
9
|
import color from "picocolors";
|
|
10
10
|
import { x } from "tinyexec";
|
|
11
11
|
import fs$1 from "node:fs/promises";
|
|
12
|
-
|
|
12
|
+
// src/env.ts
|
|
13
13
|
/**
|
|
14
14
|
* Idempotently update a `.env` file.
|
|
15
15
|
*
|
|
@@ -42,8 +42,7 @@ function upsertEnvFile(envPath, updates) {
|
|
|
42
42
|
fs.chmodSync(envPath, 384);
|
|
43
43
|
} catch {}
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
//#region src/platform.ts
|
|
45
|
+
// src/platform.ts
|
|
47
46
|
/**
|
|
48
47
|
* Common failure path: read `detail`/`message` out of the JSON body if the
|
|
49
48
|
* response wasn't JSON-parseable, fall back to the raw text.
|
|
@@ -218,8 +217,7 @@ function composeSignals(outer, inner) {
|
|
|
218
217
|
else inner.addEventListener("abort", () => abort(inner.reason), { once: true });
|
|
219
218
|
return controller.signal;
|
|
220
219
|
}
|
|
221
|
-
|
|
222
|
-
//#region src/utils/clone.ts
|
|
220
|
+
// src/utils/clone.ts
|
|
223
221
|
/** Rewrite the scaffolded package.json name to the chosen project name. */
|
|
224
222
|
async function renameProject(projectPath, projectName) {
|
|
225
223
|
const pkgPath = path.join(projectPath, "package.json");
|
|
@@ -295,8 +293,7 @@ async function cloneTemplate(repoUrl, targetPath) {
|
|
|
295
293
|
});
|
|
296
294
|
}
|
|
297
295
|
}
|
|
298
|
-
|
|
299
|
-
//#region src/utils/pm.ts
|
|
296
|
+
// src/utils/pm.ts
|
|
300
297
|
function detectPackageManager() {
|
|
301
298
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
302
299
|
const execPath = process.env.npm_execpath || "";
|
|
@@ -320,8 +317,7 @@ function getInstallArgs(packageManager) {
|
|
|
320
317
|
default: return ["install"];
|
|
321
318
|
}
|
|
322
319
|
}
|
|
323
|
-
|
|
324
|
-
//#region src/create.ts
|
|
320
|
+
// src/create.ts
|
|
325
321
|
const PROJECT_REGION_OPTIONS = [{
|
|
326
322
|
value: "eu",
|
|
327
323
|
label: "🇪🇺 eu"
|
|
@@ -622,8 +618,7 @@ function ensureEnvGitignored(projectPath) {
|
|
|
622
618
|
const prefix = existing.length > 0 && !existing.endsWith("\n") ? "\n" : "";
|
|
623
619
|
fs.writeFileSync(gitignorePath, `${existing}${prefix}\n# Added by create-factory to protect platform credentials\n.env\n`);
|
|
624
620
|
}
|
|
625
|
-
|
|
626
|
-
//#region src/utils/redact.ts
|
|
621
|
+
// src/utils/redact.ts
|
|
627
622
|
/**
|
|
628
623
|
* Sanitizes error messages before they are sent to analytics.
|
|
629
624
|
*
|
|
@@ -669,8 +664,7 @@ function redactError(error, sensitiveValues = []) {
|
|
|
669
664
|
const message = error instanceof Error ? error.message : String(error);
|
|
670
665
|
return new Error(redactErrorMessage(message, sensitiveValues));
|
|
671
666
|
}
|
|
672
|
-
|
|
673
|
-
//#region src/index.ts
|
|
667
|
+
// src/index.ts
|
|
674
668
|
const pkg = JSON.parse(readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf8"));
|
|
675
669
|
const analytics = new PosthogAnalytics({
|
|
676
670
|
apiKey: "phc_SBLpZVAB6jmHOct9CABq3PF0Yn5FU3G2FgT4xUr2XrT",
|
|
@@ -727,5 +721,4 @@ try {
|
|
|
727
721
|
} finally {
|
|
728
722
|
await analytics.shutdown(1e3);
|
|
729
723
|
}
|
|
730
|
-
//#endregion
|
|
731
724
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-factory",
|
|
3
|
-
"version": "0.3.1-alpha.
|
|
3
|
+
"version": "0.3.1-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",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"ai"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@clack/prompts": "^1.
|
|
35
|
+
"@clack/prompts": "^1.8.1",
|
|
36
36
|
"commander": "^14.0.3",
|
|
37
37
|
"picocolors": "^1.1.1",
|
|
38
|
-
"tinyexec": "^1.
|
|
39
|
-
"mastra": "1.36.0-alpha.
|
|
38
|
+
"tinyexec": "^1.3.1",
|
|
39
|
+
"mastra": "1.36.0-alpha.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/node": "22.
|
|
42
|
+
"@types/node": "22.19.15",
|
|
43
43
|
"tsdown": "0.23.1",
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
45
|
"vitest": "4.1.12",
|