create-projx 1.3.1 → 1.3.3
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 +28 -3
- package/package.json +1 -1
- package/src/templates/docker-compose.yml.ejs +11 -49
package/dist/index.js
CHANGED
|
@@ -209,12 +209,12 @@ async function writeComponentMarker(dir, component, origin = "scaffold", skip) {
|
|
|
209
209
|
try {
|
|
210
210
|
const data = JSON.parse(existing);
|
|
211
211
|
const prev = data.components ?? (data.component ? [data.component] : []);
|
|
212
|
-
existingOrigin = data.origin ??
|
|
212
|
+
existingOrigin = origin ?? data.origin ?? "scaffold";
|
|
213
213
|
existingSkip = skip ?? data.skip;
|
|
214
214
|
if (!prev.includes(component)) {
|
|
215
215
|
components = [...prev, component];
|
|
216
216
|
} else {
|
|
217
|
-
|
|
217
|
+
components = prev;
|
|
218
218
|
}
|
|
219
219
|
} catch {
|
|
220
220
|
}
|
|
@@ -457,7 +457,12 @@ function matchesSkip(filePath, patterns) {
|
|
|
457
457
|
}
|
|
458
458
|
if (pattern.startsWith("**/")) {
|
|
459
459
|
const suffix = pattern.slice(3);
|
|
460
|
-
if (
|
|
460
|
+
if (suffix.startsWith("*.")) {
|
|
461
|
+
const ext = suffix.slice(1);
|
|
462
|
+
if (filePath.endsWith(ext)) return true;
|
|
463
|
+
} else if (filePath.endsWith(suffix) || filePath.includes("/" + suffix)) {
|
|
464
|
+
return true;
|
|
465
|
+
}
|
|
461
466
|
}
|
|
462
467
|
if (pattern.startsWith("*.")) {
|
|
463
468
|
const ext = pattern.slice(1);
|
|
@@ -851,6 +856,26 @@ async function update(cwd, localRepo) {
|
|
|
851
856
|
mergeSpinner.start("Merging template changes");
|
|
852
857
|
const result = mergeBaseline(cwd, `projx: update to template v${version}`);
|
|
853
858
|
mergeSpinner.stop("Merge complete.");
|
|
859
|
+
if (result.status === "clean") {
|
|
860
|
+
const { writeFile: writeFile3 } = await import("fs/promises");
|
|
861
|
+
const updatedConfig = {
|
|
862
|
+
...config,
|
|
863
|
+
version,
|
|
864
|
+
baseline: { branch: "projx/baseline", templateVersion: version }
|
|
865
|
+
};
|
|
866
|
+
await writeFile3(join5(cwd, ".projx"), JSON.stringify(updatedConfig, null, 2) + "\n");
|
|
867
|
+
for (const component of config.components) {
|
|
868
|
+
const dir = componentPaths[component];
|
|
869
|
+
const skip = componentSkips[component];
|
|
870
|
+
await writeComponentMarker(
|
|
871
|
+
join5(cwd, dir),
|
|
872
|
+
component,
|
|
873
|
+
skip?.includes("**") ? "init" : "scaffold",
|
|
874
|
+
skip
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
execSync3('git add -A && git commit --no-verify -m "projx: post-update config"', { cwd, stdio: "pipe" });
|
|
878
|
+
}
|
|
854
879
|
if (result.status === "conflicts") {
|
|
855
880
|
p4.log.warn(`Merge conflicts in ${result.conflictedFiles.length} file(s):`);
|
|
856
881
|
for (const f of result.conflictedFiles) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-projx",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Scaffold production-grade fullstack projects in seconds. FastAPI, Fastify, React, Flutter, Terraform — with auth, database, CI/CD, E2E tests, and Docker. One command, ready to deploy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -2,21 +2,16 @@ services:
|
|
|
2
2
|
<% if (components.includes('fastapi')) { %>
|
|
3
3
|
migrate:
|
|
4
4
|
build: ./<%= paths.fastapi %>
|
|
5
|
-
command: [
|
|
5
|
+
command: ["uv", "run", "migrate.py"]
|
|
6
6
|
env_file:
|
|
7
7
|
- ./<%= paths.fastapi %>/.env
|
|
8
|
-
deploy:
|
|
9
|
-
resources:
|
|
10
|
-
limits:
|
|
11
|
-
memory: 256M
|
|
12
|
-
cpus: '0.5'
|
|
13
8
|
networks:
|
|
14
9
|
- app-network
|
|
15
10
|
|
|
16
11
|
backend:
|
|
17
12
|
build: ./<%= paths.fastapi %>
|
|
18
13
|
expose:
|
|
19
|
-
-
|
|
14
|
+
- "7860"
|
|
20
15
|
env_file:
|
|
21
16
|
- ./<%= paths.fastapi %>/.env
|
|
22
17
|
restart: unless-stopped
|
|
@@ -26,27 +21,15 @@ services:
|
|
|
26
21
|
healthcheck:
|
|
27
22
|
test:
|
|
28
23
|
[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
"CMD",
|
|
25
|
+
"python",
|
|
26
|
+
"-c",
|
|
32
27
|
"import urllib.request; urllib.request.urlopen('http://localhost:7860/api/health')",
|
|
33
28
|
]
|
|
34
29
|
interval: 30s
|
|
35
30
|
timeout: 10s
|
|
36
31
|
retries: 3
|
|
37
32
|
start_period: 15s
|
|
38
|
-
deploy:
|
|
39
|
-
resources:
|
|
40
|
-
limits:
|
|
41
|
-
memory: 512M
|
|
42
|
-
cpus: '1.0'
|
|
43
|
-
reservations:
|
|
44
|
-
memory: 256M
|
|
45
|
-
security_opt:
|
|
46
|
-
- no-new-privileges:true
|
|
47
|
-
read_only: true
|
|
48
|
-
tmpfs:
|
|
49
|
-
- /tmp
|
|
50
33
|
networks:
|
|
51
34
|
- app-network
|
|
52
35
|
<% } %>
|
|
@@ -54,23 +37,16 @@ services:
|
|
|
54
37
|
backend-fastify:
|
|
55
38
|
build: ./<%= paths.fastify %>
|
|
56
39
|
expose:
|
|
57
|
-
-
|
|
40
|
+
- "3000"
|
|
58
41
|
env_file:
|
|
59
42
|
- ./<%= paths.fastify %>/.env
|
|
60
43
|
restart: unless-stopped
|
|
61
44
|
healthcheck:
|
|
62
|
-
test: [
|
|
45
|
+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health"]
|
|
63
46
|
interval: 30s
|
|
64
47
|
timeout: 10s
|
|
65
48
|
retries: 3
|
|
66
49
|
start_period: 15s
|
|
67
|
-
deploy:
|
|
68
|
-
resources:
|
|
69
|
-
limits:
|
|
70
|
-
memory: 512M
|
|
71
|
-
cpus: '1.0'
|
|
72
|
-
security_opt:
|
|
73
|
-
- no-new-privileges:true
|
|
74
50
|
networks:
|
|
75
51
|
- app-network
|
|
76
52
|
<% } %>
|
|
@@ -79,12 +55,10 @@ services:
|
|
|
79
55
|
build:
|
|
80
56
|
context: ./<%= paths.frontend %>
|
|
81
57
|
args:
|
|
82
|
-
VITE_API_URL:
|
|
58
|
+
VITE_API_URL: ""
|
|
83
59
|
ports:
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
environment:
|
|
87
|
-
- DOMAIN=${DOMAIN:-localhost}
|
|
60
|
+
- "80:80"
|
|
61
|
+
- "443:443"
|
|
88
62
|
volumes:
|
|
89
63
|
- letsencrypt:/etc/letsencrypt
|
|
90
64
|
- certbot-www:/var/www/certbot
|
|
@@ -100,18 +74,11 @@ services:
|
|
|
100
74
|
<% } %>
|
|
101
75
|
restart: unless-stopped
|
|
102
76
|
healthcheck:
|
|
103
|
-
test: [
|
|
77
|
+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"]
|
|
104
78
|
interval: 30s
|
|
105
79
|
timeout: 5s
|
|
106
80
|
retries: 3
|
|
107
81
|
start_period: 10s
|
|
108
|
-
deploy:
|
|
109
|
-
resources:
|
|
110
|
-
limits:
|
|
111
|
-
memory: 128M
|
|
112
|
-
cpus: '0.5'
|
|
113
|
-
security_opt:
|
|
114
|
-
- no-new-privileges:true
|
|
115
82
|
networks:
|
|
116
83
|
- app-network
|
|
117
84
|
|
|
@@ -127,11 +94,6 @@ services:
|
|
|
127
94
|
condition: service_healthy
|
|
128
95
|
profiles:
|
|
129
96
|
- ssl
|
|
130
|
-
deploy:
|
|
131
|
-
resources:
|
|
132
|
-
limits:
|
|
133
|
-
memory: 64M
|
|
134
|
-
cpus: '0.25'
|
|
135
97
|
networks:
|
|
136
98
|
- app-network
|
|
137
99
|
<% } %>
|