create-newt-app 0.31.5 → 0.31.7
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 +34 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { promises as promises$1 } from "node:fs";
|
|
|
14
14
|
import https from "node:https";
|
|
15
15
|
import path$1 from "node:path";
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.31.
|
|
17
|
+
var version = "0.31.7";
|
|
18
18
|
var engines = { "node": ">=24.0.0" };
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/templates/root/index.ts
|
|
@@ -10840,8 +10840,9 @@ CMD ["pnpm", "db:migrate"]`
|
|
|
10840
10840
|
# Better Auth trusts this origin; without it every deployment falls back to
|
|
10841
10841
|
# localhost:3000 and rejects requests from the real one.
|
|
10842
10842
|
BETTER_AUTH_URL: \${BETTER_AUTH_URL:-http://localhost:3000}
|
|
10843
|
-
DATABASE_URL: postgresql://postgres:\${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
10844
|
-
|
|
10843
|
+
<% if (database === 'postgres') { %> DATABASE_URL: postgresql://postgres:\${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
10844
|
+
<% } else { %> DATABASE_URL: /data/app.db
|
|
10845
|
+
<% } %>
|
|
10845
10846
|
services:
|
|
10846
10847
|
web:
|
|
10847
10848
|
build:
|
|
@@ -10853,6 +10854,9 @@ services:
|
|
|
10853
10854
|
- "3000:3000"
|
|
10854
10855
|
environment:
|
|
10855
10856
|
<<: *app-env
|
|
10857
|
+
<% if (database === 'sqlite') { %> volumes:
|
|
10858
|
+
- db_data:/data
|
|
10859
|
+
<% } -%>
|
|
10856
10860
|
depends_on:
|
|
10857
10861
|
- api
|
|
10858
10862
|
|
|
@@ -10862,9 +10866,12 @@ services:
|
|
|
10862
10866
|
target: migrate
|
|
10863
10867
|
environment:
|
|
10864
10868
|
<<: *app-env
|
|
10865
|
-
depends_on:
|
|
10869
|
+
<% if (database === 'postgres') { %> depends_on:
|
|
10866
10870
|
db:
|
|
10867
10871
|
condition: service_healthy
|
|
10872
|
+
<% } else { %> volumes:
|
|
10873
|
+
- db_data:/data
|
|
10874
|
+
<% } -%>
|
|
10868
10875
|
restart: "no"
|
|
10869
10876
|
|
|
10870
10877
|
api:
|
|
@@ -10875,13 +10882,17 @@ services:
|
|
|
10875
10882
|
- "3001:3001"
|
|
10876
10883
|
environment:
|
|
10877
10884
|
<<: *app-env
|
|
10885
|
+
<% if (database === 'sqlite') { %> volumes:
|
|
10886
|
+
- db_data:/data
|
|
10887
|
+
<% } -%>
|
|
10878
10888
|
depends_on:
|
|
10879
|
-
db:
|
|
10889
|
+
<% if (database === 'postgres') { %> db:
|
|
10880
10890
|
condition: service_healthy
|
|
10891
|
+
<% } -%>
|
|
10881
10892
|
migrate:
|
|
10882
10893
|
condition: service_completed_successfully
|
|
10883
10894
|
|
|
10884
|
-
db:
|
|
10895
|
+
<% if (database === 'postgres') { %> db:
|
|
10885
10896
|
image: postgres:17-alpine
|
|
10886
10897
|
ports:
|
|
10887
10898
|
- "5432:5432"
|
|
@@ -10895,6 +10906,7 @@ services:
|
|
|
10895
10906
|
timeout: 5s
|
|
10896
10907
|
retries: 5
|
|
10897
10908
|
|
|
10909
|
+
<% } -%>
|
|
10898
10910
|
volumes:
|
|
10899
10911
|
db_data:`
|
|
10900
10912
|
},
|
|
@@ -11273,8 +11285,9 @@ CMD ["pnpm", "db:migrate"]`
|
|
|
11273
11285
|
# Better Auth trusts this origin; without it every deployment falls back to
|
|
11274
11286
|
# localhost:3000 and rejects requests from the real one.
|
|
11275
11287
|
BETTER_AUTH_URL: \${BETTER_AUTH_URL:-http://localhost:3000}
|
|
11276
|
-
DATABASE_URL: postgresql://postgres:\${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
11277
|
-
|
|
11288
|
+
<% if (database === 'postgres') { %> DATABASE_URL: postgresql://postgres:\${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
11289
|
+
<% } else { %> DATABASE_URL: /data/app.db
|
|
11290
|
+
<% } %>
|
|
11278
11291
|
services:
|
|
11279
11292
|
web:
|
|
11280
11293
|
build:
|
|
@@ -11284,9 +11297,13 @@ services:
|
|
|
11284
11297
|
- "3000:3000"
|
|
11285
11298
|
environment:
|
|
11286
11299
|
<<: *app-env
|
|
11300
|
+
<% if (database === 'sqlite') { %> volumes:
|
|
11301
|
+
- db_data:/data
|
|
11302
|
+
<% } -%>
|
|
11287
11303
|
depends_on:
|
|
11288
|
-
db:
|
|
11304
|
+
<% if (database === 'postgres') { %> db:
|
|
11289
11305
|
condition: service_healthy
|
|
11306
|
+
<% } -%>
|
|
11290
11307
|
migrate:
|
|
11291
11308
|
condition: service_completed_successfully
|
|
11292
11309
|
|
|
@@ -11296,12 +11313,15 @@ services:
|
|
|
11296
11313
|
target: migrate
|
|
11297
11314
|
environment:
|
|
11298
11315
|
<<: *app-env
|
|
11299
|
-
depends_on:
|
|
11316
|
+
<% if (database === 'postgres') { %> depends_on:
|
|
11300
11317
|
db:
|
|
11301
11318
|
condition: service_healthy
|
|
11319
|
+
<% } else { %> volumes:
|
|
11320
|
+
- db_data:/data
|
|
11321
|
+
<% } -%>
|
|
11302
11322
|
restart: "no"
|
|
11303
11323
|
|
|
11304
|
-
db:
|
|
11324
|
+
<% if (database === 'postgres') { %> db:
|
|
11305
11325
|
image: postgres:17-alpine
|
|
11306
11326
|
ports:
|
|
11307
11327
|
- "5432:5432"
|
|
@@ -11315,6 +11335,7 @@ services:
|
|
|
11315
11335
|
timeout: 5s
|
|
11316
11336
|
retries: 5
|
|
11317
11337
|
|
|
11338
|
+
<% } -%>
|
|
11318
11339
|
volumes:
|
|
11319
11340
|
db_data:`
|
|
11320
11341
|
},
|
|
@@ -12684,35 +12705,12 @@ function post(body) {
|
|
|
12684
12705
|
}
|
|
12685
12706
|
});
|
|
12686
12707
|
}
|
|
12687
|
-
const NOTICE = [
|
|
12688
|
-
"create-newt-app sends one anonymous event per scaffold: the options you chose,",
|
|
12689
|
-
"the CLI and Node major versions, your platform, whether prompts or flags were",
|
|
12690
|
-
"used, and whether this is CI. No project name, no paths, no file contents, and",
|
|
12691
|
-
"no identifier of any kind.",
|
|
12692
|
-
"Opt out with DO_NOT_TRACK=1 or NEWT_TELEMETRY_DISABLED=1."
|
|
12693
|
-
].join("\n");
|
|
12694
12708
|
async function reportRun(report) {
|
|
12695
12709
|
if (!isEnabled()) return;
|
|
12696
12710
|
const state = await readState();
|
|
12697
12711
|
if (state.unreachableUntil && state.unreachableUntil > Date.now()) return;
|
|
12698
|
-
if (!
|
|
12699
|
-
|
|
12700
|
-
console.log(NOTICE);
|
|
12701
|
-
console.log();
|
|
12702
|
-
await writeState({
|
|
12703
|
-
...state,
|
|
12704
|
-
notifiedAt: Date.now()
|
|
12705
|
-
});
|
|
12706
|
-
}
|
|
12707
|
-
if (!await post(JSON.stringify(buildPayload(report)))) await writeState({
|
|
12708
|
-
...state,
|
|
12709
|
-
notifiedAt: state.notifiedAt ?? Date.now(),
|
|
12710
|
-
unreachableUntil: Date.now() + UNREACHABLE_BACKOFF_MS
|
|
12711
|
-
});
|
|
12712
|
-
else if (state.unreachableUntil) await writeState({
|
|
12713
|
-
...state,
|
|
12714
|
-
unreachableUntil: void 0
|
|
12715
|
-
});
|
|
12712
|
+
if (!await post(JSON.stringify(buildPayload(report)))) await writeState({ unreachableUntil: Date.now() + UNREACHABLE_BACKOFF_MS });
|
|
12713
|
+
else if (state.unreachableUntil) await writeState({});
|
|
12716
12714
|
}
|
|
12717
12715
|
//#endregion
|
|
12718
12716
|
//#region src/index.ts
|