create-m5kdev 0.34.0 → 0.36.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/package.json +1 -1
- package/templates/minimal-app/.cursor/rules/frontend-data-guide.mdc +1 -0
- package/templates/minimal-app/.cursor/rules/server-event-emit.mdc +41 -0
- package/templates/minimal-app/AGENTS.md.tpl +1 -0
- package/templates/minimal-app/CLAUDE.md.tpl +1 -0
- package/templates/minimal-app/README.md.tpl +2 -1
- package/templates/minimal-app/apps/e2e/servers.ts.tpl +3 -0
- package/templates/minimal-app/apps/e2e/tests/expo-helpers.ts.tpl +2 -34
- package/templates/minimal-app/apps/e2e/tests/expo-standard.spec.ts.tpl +225 -5
- package/templates/minimal-app/apps/e2e/tests/helpers.ts.tpl +47 -1
- package/templates/minimal-app/apps/e2e/tests/standard.spec.ts.tpl +290 -8
- package/templates/minimal-app/apps/expo/app.json.tpl +1 -0
- package/templates/minimal-app/apps/expo/package.json.tpl +4 -0
- package/templates/minimal-app/apps/expo/src/app/_layout.tsx.tpl +4 -1
- package/templates/minimal-app/apps/expo/src/app/notifications.tsx.tpl +70 -0
- package/templates/minimal-app/apps/expo/src/app/organization/accept-invitation.tsx.tpl +8 -16
- package/templates/minimal-app/apps/expo/src/app/posts.tsx.tpl +4 -1
- package/templates/minimal-app/apps/expo/src/lib/trpc.ts.tpl +11 -2
- package/templates/minimal-app/apps/landing/vite.config.ts.tpl +2 -3
- package/templates/minimal-app/apps/server/AGENTS.md.tpl +1 -0
- package/templates/minimal-app/apps/server/db.e2e.ts.tpl +5 -40
- package/templates/minimal-app/apps/server/db.ts.tpl +5 -42
- package/templates/minimal-app/apps/server/drizzle/{0000_wealthy_absorbing_man.sql → 0000_whole_echo.sql} +102 -3
- package/templates/minimal-app/apps/server/drizzle/0001_yummy_spectrum.sql +26 -0
- package/templates/minimal-app/apps/server/drizzle/0002_crazy_lilith.sql +47 -0
- package/templates/minimal-app/apps/server/drizzle/0003_freezing_fantastic_four.sql +4 -0
- package/templates/minimal-app/apps/server/drizzle/0004_slow_ezekiel_stane.sql +99 -0
- package/templates/minimal-app/apps/server/drizzle/0005_wonderful_the_professor.sql +2 -0
- package/templates/minimal-app/apps/server/drizzle/meta/0000_snapshot.json.tpl +2625 -1780
- package/templates/minimal-app/apps/server/drizzle/meta/0001_snapshot.json.tpl +2671 -1796
- package/templates/minimal-app/apps/server/drizzle/meta/0002_snapshot.json.tpl +2716 -1818
- package/templates/minimal-app/apps/server/drizzle/meta/0003_snapshot.json.tpl +715 -164
- package/templates/minimal-app/apps/server/drizzle/meta/0004_snapshot.json.tpl +2498 -0
- package/templates/minimal-app/apps/server/drizzle/meta/0005_snapshot.json.tpl +2484 -0
- package/templates/minimal-app/apps/server/drizzle/meta/_journal.json.tpl +23 -9
- package/templates/minimal-app/apps/server/src/app.ts.tpl +4 -1
- package/templates/minimal-app/apps/server/src/modules/demo-workflow/demo-workflow.module.ts.tpl +7 -3
- package/templates/minimal-app/apps/server/src/modules/demo-workflow/demo-workflow.service.ts.tpl +12 -4
- package/templates/minimal-app/apps/server/src/modules/posts/posts.db.ts.tpl +2 -2
- package/templates/minimal-app/apps/server/src/modules/posts/posts.module.ts.tpl +7 -4
- package/templates/minimal-app/apps/server/src/modules/posts/posts.service.ts.tpl +2 -2
- package/templates/minimal-app/apps/server/src/modules/test-harness/test-harness.module.ts.tpl +13 -36
- package/templates/minimal-app/apps/server/src/schema.ts.tpl +3 -2
- package/templates/minimal-app/apps/shared/package.json.tpl +2 -0
- package/templates/minimal-app/apps/shared/src/modules/app/app.constants.ts.tpl +1 -1
- package/templates/minimal-app/apps/shared/src/modules/demo-workflow/demo-workflow.constants.ts.tpl +1 -0
- package/templates/minimal-app/apps/shared/src/modules/notification/notification.constants.ts.tpl +5 -0
- package/templates/minimal-app/apps/shared/src/modules/notification/notification.schema.ts.tpl +1 -1
- package/templates/minimal-app/apps/webapp/src/App.tsx.tpl +8 -5
- package/templates/minimal-app/apps/webapp/src/Layout.tsx.tpl +17 -1
- package/templates/minimal-app/apps/webapp/src/Router.tsx.tpl +10 -8
- package/templates/minimal-app/apps/webapp/src/StarterServerEventProvider.tsx.tpl +38 -0
- package/templates/minimal-app/apps/webapp/src/modules/notification/NotificationPreferencesRoute.tsx.tpl +29 -0
- package/templates/minimal-app/apps/webapp/src/modules/notification/StarterWebPush.tsx.tpl +44 -0
- package/templates/minimal-app/apps/webapp/translations/en/{{APP_SLUG}}.json.tpl +8 -0
- package/templates/minimal-app/package.json.tpl +5 -4
- package/templates/minimal-app/pnpm-workspace.yaml.tpl +12 -11
- package/templates/minimal-app/template.manifest.json +1 -0
- package/templates/minimal-app/apps/landing/scripts/fly-deploy.mjs.tpl +0 -75
- package/templates/minimal-app/apps/landing/scripts/fly-secrets.mjs.tpl +0 -31
- package/templates/minimal-app/apps/server/drizzle/0001_third_ink.sql +0 -1
- package/templates/minimal-app/apps/server/drizzle/0002_concerned_proudstar.sql +0 -3
- package/templates/minimal-app/apps/server/drizzle/0003_silly_the_liberteens.sql +0 -27
- package/templates/minimal-app/apps/shared/scripts/fly-deploy.mjs.tpl +0 -75
- package/templates/minimal-app/apps/shared/scripts/fly-secrets.mjs.tpl +0 -31
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
"lint": "turbo run lint",
|
|
9
9
|
"lint:fix": "turbo run lint:fix",
|
|
10
10
|
"check-types": "turbo run check-types",
|
|
11
|
-
"app:deploy": "
|
|
12
|
-
"app:secrets": "
|
|
13
|
-
"landing:deploy": "
|
|
14
|
-
"landing:secrets": "
|
|
11
|
+
"app:deploy": "m5kdev-fly-deploy --config apps/shared/fly.toml --dockerfile apps/shared/Dockerfile --env apps/shared/.env.production",
|
|
12
|
+
"app:secrets": "m5kdev-fly-secrets --config apps/shared/fly.toml --env apps/shared/.env.production",
|
|
13
|
+
"landing:deploy": "m5kdev-fly-deploy --config apps/landing/fly.toml --dockerfile apps/landing/Dockerfile --env apps/landing/.env.production",
|
|
14
|
+
"landing:secrets": "m5kdev-fly-secrets --config apps/landing/fly.toml --env apps/landing/.env.production"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@biomejs/biome": "catalog:m5kdev",
|
|
18
|
+
"@m5kdev/backend": "catalog:m5kdev",
|
|
18
19
|
"turbo": "catalog:m5kdev",
|
|
19
20
|
"typescript": "catalog:m5kdev"
|
|
20
21
|
},
|
|
@@ -7,17 +7,18 @@ catalogs:
|
|
|
7
7
|
"@heroui/react": 3.0.3
|
|
8
8
|
"@heroui/styles": 3.0.3
|
|
9
9
|
"@libsql/client": 0.17.4
|
|
10
|
-
"@m5kdev/backend": 0.
|
|
11
|
-
"@m5kdev/commons": 0.
|
|
12
|
-
"@m5kdev/config": 0.
|
|
13
|
-
"@m5kdev/email": 0.
|
|
14
|
-
"@m5kdev/
|
|
15
|
-
"@m5kdev/
|
|
16
|
-
"@m5kdev/module-
|
|
17
|
-
"@m5kdev/module-
|
|
18
|
-
"@m5kdev/module-
|
|
19
|
-
"@m5kdev/module-
|
|
20
|
-
"@m5kdev/
|
|
10
|
+
"@m5kdev/backend": 0.36.0
|
|
11
|
+
"@m5kdev/commons": 0.36.0
|
|
12
|
+
"@m5kdev/config": 0.36.0
|
|
13
|
+
"@m5kdev/email": 0.36.0
|
|
14
|
+
"@m5kdev/expo": 0.36.0
|
|
15
|
+
"@m5kdev/frontend": 0.36.0
|
|
16
|
+
"@m5kdev/module-clay": 0.36.0
|
|
17
|
+
"@m5kdev/module-docx": 0.36.0
|
|
18
|
+
"@m5kdev/module-pdf": 0.36.0
|
|
19
|
+
"@m5kdev/module-social": 0.36.0
|
|
20
|
+
"@m5kdev/module-video": 0.36.0
|
|
21
|
+
"@m5kdev/web-ui": 0.36.0
|
|
21
22
|
"@mastra/core": 1.51.0
|
|
22
23
|
"@openrouter/ai-sdk-provider": 3.0.0
|
|
23
24
|
"@opentelemetry/api": 1.9.0
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import { parseArgs } from "node:util";
|
|
5
|
-
|
|
6
|
-
function missingEnvMessage(envPath) {
|
|
7
|
-
return `Missing ${envPath}. Copy the .env.production.example next to it, fill in values, then retry.`;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function parseDotenv(source) {
|
|
11
|
-
const vars = {};
|
|
12
|
-
for (const rawLine of source.split(/\r?\n/)) {
|
|
13
|
-
const line = rawLine.trim();
|
|
14
|
-
if (!line || line.startsWith("#")) continue;
|
|
15
|
-
const eq = line.indexOf("=");
|
|
16
|
-
if (eq === -1) continue;
|
|
17
|
-
const key = line.slice(0, eq).trim();
|
|
18
|
-
let value = line.slice(eq + 1);
|
|
19
|
-
if (
|
|
20
|
-
(value.startsWith('"') && value.endsWith('"')) ||
|
|
21
|
-
(value.startsWith("'") && value.endsWith("'"))
|
|
22
|
-
) {
|
|
23
|
-
value = value.slice(1, -1);
|
|
24
|
-
}
|
|
25
|
-
vars[key] = value;
|
|
26
|
-
}
|
|
27
|
-
return vars;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function shellSingleQuote(value) {
|
|
31
|
-
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function toExportScript(vars) {
|
|
35
|
-
return Object.entries(vars)
|
|
36
|
-
.map(([key, value]) => `export ${key}=${shellSingleQuote(value)}`)
|
|
37
|
-
.join("\n");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const { values } = parseArgs({
|
|
41
|
-
options: {
|
|
42
|
-
config: { type: "string" },
|
|
43
|
-
dockerfile: { type: "string" },
|
|
44
|
-
env: { type: "string" },
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
if (!values.config || !values.dockerfile || !values.env) {
|
|
49
|
-
console.error(
|
|
50
|
-
"Usage: fly-deploy.mjs --config <fly.toml> --dockerfile <Dockerfile> --env <.env.production>"
|
|
51
|
-
);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!existsSync(values.env)) {
|
|
56
|
-
console.error(missingEnvMessage(values.env));
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const vars = parseDotenv(readFileSync(values.env, "utf8"));
|
|
61
|
-
const args = [
|
|
62
|
-
"deploy",
|
|
63
|
-
"-c",
|
|
64
|
-
values.config,
|
|
65
|
-
"--dockerfile",
|
|
66
|
-
values.dockerfile,
|
|
67
|
-
"--build-secret",
|
|
68
|
-
`ALL_SECRETS=${toExportScript(vars)}`,
|
|
69
|
-
];
|
|
70
|
-
for (const [key, value] of Object.entries(vars)) {
|
|
71
|
-
args.push("--build-secret", `${key}=${value}`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const result = spawnSync("fly", args, { stdio: "inherit" });
|
|
75
|
-
process.exit(result.status ?? 1);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import { parseArgs } from "node:util";
|
|
5
|
-
|
|
6
|
-
function missingEnvMessage(envPath) {
|
|
7
|
-
return `Missing ${envPath}. Copy the .env.production.example next to it, fill in values, then retry.`;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { values } = parseArgs({
|
|
11
|
-
options: {
|
|
12
|
-
config: { type: "string" },
|
|
13
|
-
env: { type: "string" },
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
if (!values.config || !values.env) {
|
|
18
|
-
console.error("Usage: fly-secrets.mjs --config <fly.toml> --env <.env.production>");
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (!existsSync(values.env)) {
|
|
23
|
-
console.error(missingEnvMessage(values.env));
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const result = spawnSync("fly", ["secrets", "import", "-c", values.config], {
|
|
28
|
-
input: readFileSync(values.env),
|
|
29
|
-
stdio: ["pipe", "inherit", "inherit"],
|
|
30
|
-
});
|
|
31
|
-
process.exit(result.status ?? 1);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE `posts` ADD `member_id` text REFERENCES members(id);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
CREATE TABLE `files` (
|
|
2
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`created_at` integer NOT NULL,
|
|
4
|
-
`updated_at` integer,
|
|
5
|
-
`deleted_at` integer,
|
|
6
|
-
`user_id` text,
|
|
7
|
-
`member_id` text,
|
|
8
|
-
`organization_id` text,
|
|
9
|
-
`team_id` text,
|
|
10
|
-
`bucket` text NOT NULL,
|
|
11
|
-
`key` text NOT NULL,
|
|
12
|
-
`original_name` text NOT NULL,
|
|
13
|
-
`original_extension` text,
|
|
14
|
-
`content_type` text NOT NULL,
|
|
15
|
-
`size_bytes` integer,
|
|
16
|
-
`etag` text,
|
|
17
|
-
`checksum_sha256` text,
|
|
18
|
-
`metadata` text,
|
|
19
|
-
`status` text NOT NULL,
|
|
20
|
-
`uploaded_at` integer,
|
|
21
|
-
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
|
|
22
|
-
FOREIGN KEY (`member_id`) REFERENCES `members`(`id`) ON UPDATE no action ON DELETE set null,
|
|
23
|
-
FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE set null,
|
|
24
|
-
FOREIGN KEY (`team_id`) REFERENCES `teams`(`id`) ON UPDATE no action ON DELETE set null
|
|
25
|
-
);
|
|
26
|
-
--> statement-breakpoint
|
|
27
|
-
CREATE UNIQUE INDEX `files_bucket_key_unique` ON `files` (`bucket`,`key`);
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import { parseArgs } from "node:util";
|
|
5
|
-
|
|
6
|
-
function missingEnvMessage(envPath) {
|
|
7
|
-
return `Missing ${envPath}. Copy the .env.production.example next to it, fill in values, then retry.`;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function parseDotenv(source) {
|
|
11
|
-
const vars = {};
|
|
12
|
-
for (const rawLine of source.split(/\r?\n/)) {
|
|
13
|
-
const line = rawLine.trim();
|
|
14
|
-
if (!line || line.startsWith("#")) continue;
|
|
15
|
-
const eq = line.indexOf("=");
|
|
16
|
-
if (eq === -1) continue;
|
|
17
|
-
const key = line.slice(0, eq).trim();
|
|
18
|
-
let value = line.slice(eq + 1);
|
|
19
|
-
if (
|
|
20
|
-
(value.startsWith('"') && value.endsWith('"')) ||
|
|
21
|
-
(value.startsWith("'") && value.endsWith("'"))
|
|
22
|
-
) {
|
|
23
|
-
value = value.slice(1, -1);
|
|
24
|
-
}
|
|
25
|
-
vars[key] = value;
|
|
26
|
-
}
|
|
27
|
-
return vars;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function shellSingleQuote(value) {
|
|
31
|
-
return `'${value.replaceAll("'", `'\\''`)}'`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function toExportScript(vars) {
|
|
35
|
-
return Object.entries(vars)
|
|
36
|
-
.map(([key, value]) => `export ${key}=${shellSingleQuote(value)}`)
|
|
37
|
-
.join("\n");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const { values } = parseArgs({
|
|
41
|
-
options: {
|
|
42
|
-
config: { type: "string" },
|
|
43
|
-
dockerfile: { type: "string" },
|
|
44
|
-
env: { type: "string" },
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
if (!values.config || !values.dockerfile || !values.env) {
|
|
49
|
-
console.error(
|
|
50
|
-
"Usage: fly-deploy.mjs --config <fly.toml> --dockerfile <Dockerfile> --env <.env.production>"
|
|
51
|
-
);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!existsSync(values.env)) {
|
|
56
|
-
console.error(missingEnvMessage(values.env));
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const vars = parseDotenv(readFileSync(values.env, "utf8"));
|
|
61
|
-
const args = [
|
|
62
|
-
"deploy",
|
|
63
|
-
"-c",
|
|
64
|
-
values.config,
|
|
65
|
-
"--dockerfile",
|
|
66
|
-
values.dockerfile,
|
|
67
|
-
"--build-secret",
|
|
68
|
-
`ALL_SECRETS=${toExportScript(vars)}`,
|
|
69
|
-
];
|
|
70
|
-
for (const [key, value] of Object.entries(vars)) {
|
|
71
|
-
args.push("--build-secret", `${key}=${value}`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const result = spawnSync("fly", args, { stdio: "inherit" });
|
|
75
|
-
process.exit(result.status ?? 1);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import { parseArgs } from "node:util";
|
|
5
|
-
|
|
6
|
-
function missingEnvMessage(envPath) {
|
|
7
|
-
return `Missing ${envPath}. Copy the .env.production.example next to it, fill in values, then retry.`;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { values } = parseArgs({
|
|
11
|
-
options: {
|
|
12
|
-
config: { type: "string" },
|
|
13
|
-
env: { type: "string" },
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
if (!values.config || !values.env) {
|
|
18
|
-
console.error("Usage: fly-secrets.mjs --config <fly.toml> --env <.env.production>");
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (!existsSync(values.env)) {
|
|
23
|
-
console.error(missingEnvMessage(values.env));
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const result = spawnSync("fly", ["secrets", "import", "-c", values.config], {
|
|
28
|
-
input: readFileSync(values.env),
|
|
29
|
-
stdio: ["pipe", "inherit", "inherit"],
|
|
30
|
-
});
|
|
31
|
-
process.exit(result.status ?? 1);
|