create-factory 0.0.1 → 0.0.2
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 +8 -2
- package/README.md +49 -0
- package/dist/index.js +10 -16
- package/package.json +17 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-factory
|
|
2
|
+
|
|
3
|
+
## 0.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- First real scaffold release for `npm create factory`. Clones the softwarefactory template, installs dependencies, initializes git, and prints next steps. Configuration (model providers, database, integrations) happens in the web UI on first load.
|
|
2
8
|
|
|
3
9
|
## 0.0.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
7
|
-
- Initial public package name claim
|
|
13
|
+
- Initial public package name claim.
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# create-factory
|
|
2
|
+
|
|
3
|
+
Scaffolding CLI for the **Mastra Software Factory** — an open-source, agent-powered software delivery environment built on [Mastra](https://mastra.ai).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm create factory
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The CLI is intentionally minimal: it asks for a project name, clones the [softwarefactory-template](https://github.com/mastra-ai/softwarefactory-template), installs dependencies, and initializes git. That's it — run `npm run dev` and finish setup (model providers, integrations, database) from the web UI on first load. An "auth with the Mastra platform" step is planned as a follow-up.
|
|
10
|
+
|
|
11
|
+
## Flags
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
npm create factory [project-name] -- [options]
|
|
15
|
+
|
|
16
|
+
--default Non-interactive: default name
|
|
17
|
+
--template-ref <ref> Pin a template repo tag/branch
|
|
18
|
+
--template-dir <dir> Use a local template directory (development)
|
|
19
|
+
-t, --timeout [ms] Timeout for dependency installation
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Development (monorepo)
|
|
23
|
+
|
|
24
|
+
This package lives in the `mastra-ai/mastra` monorepo at `mastracode/mastra-factory`. Releases go through the monorepo's changesets release train (it is un-ignored in `.changeset/config.json`) — add a changeset with your change and the train versions and publishes it.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm --filter ./mastracode/mastra-factory build # bundle src -> dist
|
|
28
|
+
pnpm --filter ./mastracode/mastra-factory test # vitest
|
|
29
|
+
node bin/cli.mjs my-app --default --template-dir ./template-out
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Template sync
|
|
33
|
+
|
|
34
|
+
`scripts/sync-template.mjs` generates the template tree from `mastracode/web`:
|
|
35
|
+
|
|
36
|
+
- `link:` deps → caret ranges on published versions (anchored on local monorepo versions by default, verified on npm; `--tag latest` for stable dist-tags)
|
|
37
|
+
- monorepo tsconfig → standalone, test files/deps stripped, user-facing scripts
|
|
38
|
+
- checked-in `template/README.md` → user-facing README (version tokens filled at sync)
|
|
39
|
+
- `.env.schema` → `.env.example` (varlock decorators removed)
|
|
40
|
+
|
|
41
|
+
Syncing to [softwarefactory-template](https://github.com/mastra-ai/softwarefactory-template) is automated, mirroring the `templates/*` process: the `sync-softwarefactory-template` workflow regenerates the template (`--tag latest`) and force-pushes it on every push to `main` that touches `mastracode/web`, the sync script, or `template/README.md`. The monorepo is the source of truth — direct commits to the template repo get overwritten.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node scripts/sync-template.mjs # writes ./template-out (local development)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
Apache-2.0
|
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var Analytics = class {
|
|
|
52
52
|
this.client?.capture({
|
|
53
53
|
distinctId: this.distinctId,
|
|
54
54
|
event,
|
|
55
|
-
properties: { ...properties, cli: "
|
|
55
|
+
properties: { ...properties, cli: "create-factory", version: this.version }
|
|
56
56
|
});
|
|
57
57
|
} catch {
|
|
58
58
|
}
|
|
@@ -226,20 +226,14 @@ async function create(args) {
|
|
|
226
226
|
You can retry manually: cd ${projectName} && ${packageManager} install`
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
await runInherit("git", ["commit", "-q", "-m", "Initial commit from mastra-factory"], {
|
|
238
|
-
cwd: projectPath
|
|
239
|
-
});
|
|
240
|
-
} catch {
|
|
241
|
-
p.log.warn("git init failed \u2014 you can initialize the repository yourself later.");
|
|
242
|
-
}
|
|
229
|
+
try {
|
|
230
|
+
await runInherit("git", ["init", "-q"], { cwd: projectPath });
|
|
231
|
+
await runInherit("git", ["add", "-A"], { cwd: projectPath });
|
|
232
|
+
await runInherit("git", ["commit", "-q", "-m", "Initial commit from create-factory"], {
|
|
233
|
+
cwd: projectPath
|
|
234
|
+
});
|
|
235
|
+
} catch {
|
|
236
|
+
p.log.warn("git init failed \u2014 you can initialize the repository yourself later.");
|
|
243
237
|
}
|
|
244
238
|
args.analytics.trackEvent("sf_create_completed", {
|
|
245
239
|
package_manager: packageManager,
|
|
@@ -270,7 +264,7 @@ var pkg = JSON.parse(
|
|
|
270
264
|
);
|
|
271
265
|
var analytics = new Analytics(pkg.version);
|
|
272
266
|
var program = new Command();
|
|
273
|
-
program.name("
|
|
267
|
+
program.name("create-factory").description("Create a Mastra Software Factory project").version(pkg.version, "-v, --version").argument("[project-name]", "Directory name of the project").option("--default", "Non-interactive: default name").option("--template-ref <ref>", "Pin a template repo tag/branch").option("--template-dir <dir>", "Use a local template directory instead of cloning (development)").option("-t, --timeout [ms]", "Timeout for dependency installation in ms").action(async (projectNameArg, args) => {
|
|
274
268
|
let timeout;
|
|
275
269
|
if (args.timeout !== void 0) {
|
|
276
270
|
timeout = args.timeout === true ? 6e4 : Number(args.timeout);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-factory",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Create a Mastra Software Factory project
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Create a Mastra Software 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",
|
|
7
7
|
"bin": {
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"dist",
|
|
13
13
|
"CHANGELOG.md"
|
|
14
14
|
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup --silent --config tsup.config.ts",
|
|
17
|
+
"prepack": "npm run build",
|
|
18
|
+
"check": "tsc --noEmit",
|
|
19
|
+
"test": "vitest run",
|
|
20
|
+
"lint": "eslint ."
|
|
21
|
+
},
|
|
15
22
|
"engines": {
|
|
16
23
|
"node": ">=20"
|
|
17
24
|
},
|
|
@@ -38,5 +45,13 @@
|
|
|
38
45
|
"commander": "^14.0.3",
|
|
39
46
|
"picocolors": "^1.1.1",
|
|
40
47
|
"posthog-node": "^5.37.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@internal/lint": "workspace:*",
|
|
51
|
+
"@types/node": "22.20.1",
|
|
52
|
+
"eslint": "^10.4.1",
|
|
53
|
+
"tsup": "^8.5.1",
|
|
54
|
+
"typescript": "catalog:",
|
|
55
|
+
"vitest": "catalog:"
|
|
41
56
|
}
|
|
42
57
|
}
|