@maestro-js/init 1.0.0-alpha.14 → 1.0.0-alpha.15
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/bin.js +3 -10
- package/dist/{chunk-P4YULL3I.js → chunk-52NA54G4.js} +54 -41
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
buildProjectTree,
|
|
4
|
+
getInitVersion,
|
|
4
5
|
scaffold
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-52NA54G4.js";
|
|
6
7
|
|
|
7
8
|
// src/bin.ts
|
|
8
9
|
import crypto from "crypto";
|
|
9
|
-
import fs from "fs";
|
|
10
10
|
import path from "path";
|
|
11
11
|
import { execSync } from "child_process";
|
|
12
12
|
import { access } from "fs/promises";
|
|
13
|
-
import { fileURLToPath } from "url";
|
|
14
13
|
var name = process.argv[2];
|
|
15
14
|
if (!name || !/^[a-z][a-z0-9-]*$/.test(name)) {
|
|
16
15
|
console.error("Project name must be lowercase, start with a letter, and contain only letters, numbers, and hyphens.");
|
|
@@ -51,7 +50,7 @@ function deriveDbPort(name2) {
|
|
|
51
50
|
}
|
|
52
51
|
function installSkills(targetDir2) {
|
|
53
52
|
const skillSources = [
|
|
54
|
-
{ cmd: `npx --yes @maestro-js/agent-skills@${
|
|
53
|
+
{ cmd: `npx --yes @maestro-js/agent-skills@${getInitVersion()}`, label: "maestro" },
|
|
55
54
|
{ cmd: "npx skills add https://react-aria.adobe.com --skill react-aria -a claude-code -y", label: "react-aria" },
|
|
56
55
|
{ cmd: "npx skills add anthropics/skills --skill skill-creator -a claude-code -y", label: "skill-creator" },
|
|
57
56
|
{ cmd: "npx skills add mattpocock/skills --skill grill-me -a claude-code -y", label: "grill-me" },
|
|
@@ -73,9 +72,3 @@ async function fileExists(p) {
|
|
|
73
72
|
return false;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
|
-
function getCurrentVersion() {
|
|
77
|
-
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
78
|
-
const raw = fs.readFileSync(path.join(dir, "../package.json"), "utf-8");
|
|
79
|
-
const pkg = JSON.parse(raw);
|
|
80
|
-
return pkg.version;
|
|
81
|
-
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
|
|
3
8
|
// src/templates/root.ts
|
|
4
|
-
function rootPackageJson(name) {
|
|
9
|
+
function rootPackageJson(name, maestroVersion) {
|
|
5
10
|
return JSON.stringify(
|
|
6
11
|
{
|
|
7
12
|
type: "module",
|
|
@@ -11,13 +16,13 @@ function rootPackageJson(name) {
|
|
|
11
16
|
"fks-restrict": "maestro config:run --config services -- node ./scripts/foreign-key-delete-behavior.ts restrict"
|
|
12
17
|
},
|
|
13
18
|
dependencies: {
|
|
14
|
-
"@maestro-js/config":
|
|
19
|
+
"@maestro-js/config": maestroVersion,
|
|
15
20
|
[`@${name}/services`]: "workspace:*"
|
|
16
21
|
},
|
|
17
22
|
devDependencies: {
|
|
18
|
-
"@maestro-js/cli":
|
|
19
|
-
"@maestro-js/db-migrate":
|
|
20
|
-
"@maestro-js/db":
|
|
23
|
+
"@maestro-js/cli": maestroVersion,
|
|
24
|
+
"@maestro-js/db-migrate": maestroVersion,
|
|
25
|
+
"@maestro-js/db": maestroVersion,
|
|
21
26
|
"@types/node": "^22.19.11",
|
|
22
27
|
tsx: "^4.21.0"
|
|
23
28
|
}
|
|
@@ -134,7 +139,7 @@ var dbMigrateConfig = `export default async function (env: Record<string, string
|
|
|
134
139
|
`;
|
|
135
140
|
|
|
136
141
|
// src/templates/schemas.ts
|
|
137
|
-
function schemasPackageJson(name) {
|
|
142
|
+
function schemasPackageJson(name, maestroVersion) {
|
|
138
143
|
return JSON.stringify(
|
|
139
144
|
{
|
|
140
145
|
name: `@${name}/schemas`,
|
|
@@ -145,7 +150,7 @@ function schemasPackageJson(name) {
|
|
|
145
150
|
dependencies: {
|
|
146
151
|
"iso-fns": "npm:iso-fns@2.0.0-alpha.26",
|
|
147
152
|
zod: "^4.3.0",
|
|
148
|
-
"@maestro-js/iso-zod":
|
|
153
|
+
"@maestro-js/iso-zod": maestroVersion
|
|
149
154
|
},
|
|
150
155
|
devDependencies: {}
|
|
151
156
|
},
|
|
@@ -158,7 +163,7 @@ var schemasIndex = `// Export your Zod schemas here
|
|
|
158
163
|
`;
|
|
159
164
|
|
|
160
165
|
// src/templates/services.ts
|
|
161
|
-
function servicesPackageJson(name) {
|
|
166
|
+
function servicesPackageJson(name, maestroVersion) {
|
|
162
167
|
return JSON.stringify(
|
|
163
168
|
{
|
|
164
169
|
name: `@${name}/services`,
|
|
@@ -172,29 +177,29 @@ function servicesPackageJson(name) {
|
|
|
172
177
|
dependencies: {
|
|
173
178
|
[`@${name}/schemas`]: "workspace:*",
|
|
174
179
|
"@aws-sdk/client-ses": "^3.1004.0",
|
|
175
|
-
"@maestro-js/auth":
|
|
176
|
-
"@maestro-js/cache":
|
|
177
|
-
"@maestro-js/config":
|
|
178
|
-
"@maestro-js/crypt":
|
|
179
|
-
"@maestro-js/custom-errors":
|
|
180
|
-
"@maestro-js/db":
|
|
181
|
-
"@maestro-js/exceptions":
|
|
182
|
-
"@maestro-js/hash":
|
|
183
|
-
"@maestro-js/helpers":
|
|
184
|
-
"@maestro-js/iso-zod":
|
|
185
|
-
"@maestro-js/log":
|
|
186
|
-
"@maestro-js/mail":
|
|
187
|
-
"@maestro-js/password":
|
|
188
|
-
"@maestro-js/permissions":
|
|
189
|
-
"@maestro-js/queue":
|
|
190
|
-
"@maestro-js/rate-limiting":
|
|
191
|
-
"@maestro-js/recurring-jobs":
|
|
192
|
-
"@maestro-js/session":
|
|
180
|
+
"@maestro-js/auth": maestroVersion,
|
|
181
|
+
"@maestro-js/cache": maestroVersion,
|
|
182
|
+
"@maestro-js/config": maestroVersion,
|
|
183
|
+
"@maestro-js/crypt": maestroVersion,
|
|
184
|
+
"@maestro-js/custom-errors": maestroVersion,
|
|
185
|
+
"@maestro-js/db": maestroVersion,
|
|
186
|
+
"@maestro-js/exceptions": maestroVersion,
|
|
187
|
+
"@maestro-js/hash": maestroVersion,
|
|
188
|
+
"@maestro-js/helpers": maestroVersion,
|
|
189
|
+
"@maestro-js/iso-zod": maestroVersion,
|
|
190
|
+
"@maestro-js/log": maestroVersion,
|
|
191
|
+
"@maestro-js/mail": maestroVersion,
|
|
192
|
+
"@maestro-js/password": maestroVersion,
|
|
193
|
+
"@maestro-js/permissions": maestroVersion,
|
|
194
|
+
"@maestro-js/queue": maestroVersion,
|
|
195
|
+
"@maestro-js/rate-limiting": maestroVersion,
|
|
196
|
+
"@maestro-js/recurring-jobs": maestroVersion,
|
|
197
|
+
"@maestro-js/session": maestroVersion,
|
|
193
198
|
"iso-fns": "npm:iso-fns@2.0.0-alpha.26",
|
|
194
199
|
zod: "^4.3.0"
|
|
195
200
|
},
|
|
196
201
|
devDependencies: {
|
|
197
|
-
"@maestro-js/cli":
|
|
202
|
+
"@maestro-js/cli": maestroVersion,
|
|
198
203
|
"@types/node": "^22.0.0",
|
|
199
204
|
"beartest-js": "^8.0.2"
|
|
200
205
|
}
|
|
@@ -379,7 +384,7 @@ export { CustomErrors } from '@maestro-js/custom-errors'
|
|
|
379
384
|
`;
|
|
380
385
|
|
|
381
386
|
// src/templates/web.ts
|
|
382
|
-
function webPackageJson(name) {
|
|
387
|
+
function webPackageJson(name, maestroVersion) {
|
|
383
388
|
return JSON.stringify(
|
|
384
389
|
{
|
|
385
390
|
name: `@${name}/${name}-web`,
|
|
@@ -397,9 +402,9 @@ function webPackageJson(name) {
|
|
|
397
402
|
dependencies: {
|
|
398
403
|
[`@${name}/schemas`]: "workspace:*",
|
|
399
404
|
[`@${name}/services`]: "workspace:*",
|
|
400
|
-
"@maestro-js/custom-errors":
|
|
401
|
-
"@maestro-js/log":
|
|
402
|
-
"@maestro-js/form":
|
|
405
|
+
"@maestro-js/custom-errors": maestroVersion,
|
|
406
|
+
"@maestro-js/log": maestroVersion,
|
|
407
|
+
"@maestro-js/form": maestroVersion,
|
|
403
408
|
"@react-router/node": "^7.9.0",
|
|
404
409
|
"@react-router/serve": "^7.9.0",
|
|
405
410
|
"@sentry/react-router": "^9",
|
|
@@ -414,8 +419,8 @@ function webPackageJson(name) {
|
|
|
414
419
|
zod: "^4.0.0"
|
|
415
420
|
},
|
|
416
421
|
devDependencies: {
|
|
417
|
-
"@maestro-js/cli":
|
|
418
|
-
"@maestro-js/react-router-file-routes":
|
|
422
|
+
"@maestro-js/cli": maestroVersion,
|
|
423
|
+
"@maestro-js/react-router-file-routes": maestroVersion,
|
|
419
424
|
"@playwright/test": "^1.52.0",
|
|
420
425
|
"@react-router/dev": "^7.9.0",
|
|
421
426
|
"@tailwindcss/vite": "^4.2.0",
|
|
@@ -983,7 +988,7 @@ export function getSessionToast(session: Session): Toast | null {
|
|
|
983
988
|
`;
|
|
984
989
|
|
|
985
990
|
// src/templates/queue-processor.ts
|
|
986
|
-
function queueProcessorPackageJson(name) {
|
|
991
|
+
function queueProcessorPackageJson(name, maestroVersion) {
|
|
987
992
|
return JSON.stringify(
|
|
988
993
|
{
|
|
989
994
|
name: `@${name}/queue-processor`,
|
|
@@ -993,11 +998,11 @@ function queueProcessorPackageJson(name) {
|
|
|
993
998
|
start: "maestro config:run --config queue-processor -- tsx src/index.ts"
|
|
994
999
|
},
|
|
995
1000
|
dependencies: {
|
|
996
|
-
"@maestro-js/config":
|
|
1001
|
+
"@maestro-js/config": maestroVersion,
|
|
997
1002
|
[`@${name}/services`]: "workspace:*"
|
|
998
1003
|
},
|
|
999
1004
|
devDependencies: {
|
|
1000
|
-
"@maestro-js/cli":
|
|
1005
|
+
"@maestro-js/cli": maestroVersion,
|
|
1001
1006
|
"@types/node": "^22.19.11",
|
|
1002
1007
|
tsx: "^4.21.0"
|
|
1003
1008
|
}
|
|
@@ -1190,9 +1195,16 @@ function replaceTokens(content, tokens) {
|
|
|
1190
1195
|
}
|
|
1191
1196
|
|
|
1192
1197
|
// src/index.ts
|
|
1198
|
+
function getInitVersion() {
|
|
1199
|
+
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
1200
|
+
const raw = fs.readFileSync(path.join(dir, "../package.json"), "utf-8");
|
|
1201
|
+
const pkg = JSON.parse(raw);
|
|
1202
|
+
return pkg.version;
|
|
1203
|
+
}
|
|
1193
1204
|
function buildProjectTree(name) {
|
|
1205
|
+
const maestroVersion = `^${getInitVersion()}`;
|
|
1194
1206
|
return {
|
|
1195
|
-
"package.json": rootPackageJson(name),
|
|
1207
|
+
"package.json": rootPackageJson(name, maestroVersion),
|
|
1196
1208
|
"pnpm-workspace.yaml": pnpmWorkspace(name),
|
|
1197
1209
|
"tsconfig.json": rootTsconfig,
|
|
1198
1210
|
".env": rootEnv,
|
|
@@ -1205,13 +1217,13 @@ function buildProjectTree(name) {
|
|
|
1205
1217
|
},
|
|
1206
1218
|
packages: {
|
|
1207
1219
|
schemas: {
|
|
1208
|
-
"package.json": schemasPackageJson(name),
|
|
1220
|
+
"package.json": schemasPackageJson(name, maestroVersion),
|
|
1209
1221
|
src: {
|
|
1210
1222
|
"index.ts": schemasIndex
|
|
1211
1223
|
}
|
|
1212
1224
|
},
|
|
1213
1225
|
services: {
|
|
1214
|
-
"package.json": servicesPackageJson(name),
|
|
1226
|
+
"package.json": servicesPackageJson(name, maestroVersion),
|
|
1215
1227
|
"tsconfig.json": servicesTsconfig,
|
|
1216
1228
|
src: {
|
|
1217
1229
|
"maestro.ts": maestroTs,
|
|
@@ -1220,7 +1232,7 @@ function buildProjectTree(name) {
|
|
|
1220
1232
|
}
|
|
1221
1233
|
},
|
|
1222
1234
|
[`${name}-web`]: {
|
|
1223
|
-
"package.json": webPackageJson(name),
|
|
1235
|
+
"package.json": webPackageJson(name, maestroVersion),
|
|
1224
1236
|
"tsconfig.json": webTsconfig,
|
|
1225
1237
|
"vite.config.ts": viteConfig,
|
|
1226
1238
|
"react-router.config.ts": reactRouterConfig,
|
|
@@ -1249,7 +1261,7 @@ function buildProjectTree(name) {
|
|
|
1249
1261
|
}
|
|
1250
1262
|
},
|
|
1251
1263
|
"queue-processor": {
|
|
1252
|
-
"package.json": queueProcessorPackageJson(name),
|
|
1264
|
+
"package.json": queueProcessorPackageJson(name, maestroVersion),
|
|
1253
1265
|
"tsconfig.json": queueProcessorTsconfig,
|
|
1254
1266
|
src: {
|
|
1255
1267
|
"index.ts": queueProcessorIndex,
|
|
@@ -1271,5 +1283,6 @@ function buildProjectTree(name) {
|
|
|
1271
1283
|
|
|
1272
1284
|
export {
|
|
1273
1285
|
scaffold,
|
|
1286
|
+
getInitVersion,
|
|
1274
1287
|
buildProjectTree
|
|
1275
1288
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ type Tree = {
|
|
|
4
4
|
type Tokens = Record<string, string>;
|
|
5
5
|
declare function scaffold(tree: Tree, basePath: string, tokens?: Tokens): Promise<string[]>;
|
|
6
6
|
|
|
7
|
+
declare function getInitVersion(): string;
|
|
7
8
|
declare function buildProjectTree(name: string): Tree;
|
|
8
9
|
|
|
9
|
-
export { type Tokens, type Tree, buildProjectTree, scaffold };
|
|
10
|
+
export { type Tokens, type Tree, buildProjectTree, getInitVersion, scaffold };
|
package/dist/index.js
CHANGED