create-factory 0.0.1 → 0.0.3-alpha.0
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 +20 -2
- package/LICENSE.md +30 -0
- package/README.md +49 -0
- package/dist/index.js +10 -16
- package/package.json +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-factory
|
|
2
|
+
|
|
3
|
+
## 0.0.3-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added the `create-factory` CLI. It scaffolds a Mastra Software Factory project: enter a project name and the CLI clones the template, installs dependencies, and initializes git. Configuration (model providers, integrations, database) happens in the web UI on first load. ([#19609](https://github.com/mastra-ai/mastra/pull/19609))
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm create factory my-factory
|
|
11
|
+
cd my-factory
|
|
12
|
+
npm run dev
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 0.0.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 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
20
|
|
|
3
21
|
## 0.0.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
6
24
|
|
|
7
|
-
- Initial public package name claim
|
|
25
|
+
- Initial public package name claim.
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Portions of this software are licensed as follows:
|
|
2
|
+
|
|
3
|
+
- All content that resides under any directory named "ee/" within this
|
|
4
|
+
repository, including but not limited to:
|
|
5
|
+
- `packages/core/src/auth/ee/`
|
|
6
|
+
- `packages/server/src/server/auth/ee/`
|
|
7
|
+
is licensed under the license defined in `ee/LICENSE`.
|
|
8
|
+
|
|
9
|
+
- All third-party components incorporated into the Mastra Software are
|
|
10
|
+
licensed under the original license provided by the owner of the
|
|
11
|
+
applicable component.
|
|
12
|
+
|
|
13
|
+
- Content outside of the above-mentioned directories or restrictions is
|
|
14
|
+
available under the "Apache License 2.0" as defined below.
|
|
15
|
+
|
|
16
|
+
# Apache License 2.0
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2025 Kepler Software, Inc.
|
|
19
|
+
|
|
20
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
you may not use this file except in compliance with the License.
|
|
22
|
+
You may obtain a copy of the License at
|
|
23
|
+
|
|
24
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
|
|
26
|
+
Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
See the License for the specific language governing permissions and
|
|
30
|
+
limitations under the License.
|
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 using published local monorepo versions 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.3-alpha.0",
|
|
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": {
|
|
@@ -38,5 +38,19 @@
|
|
|
38
38
|
"commander": "^14.0.3",
|
|
39
39
|
"picocolors": "^1.1.1",
|
|
40
40
|
"posthog-node": "^5.37.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "22.20.1",
|
|
44
|
+
"eslint": "^10.4.1",
|
|
45
|
+
"tsup": "^8.5.1",
|
|
46
|
+
"typescript": "^6.0.3",
|
|
47
|
+
"vitest": "4.1.10",
|
|
48
|
+
"@internal/lint": "0.0.114"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup --silent --config tsup.config.ts",
|
|
52
|
+
"check": "tsc --noEmit",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"lint": "eslint ."
|
|
41
55
|
}
|
|
42
|
-
}
|
|
56
|
+
}
|