@donotdev/cli 0.0.16 → 0.0.17
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/dependencies-matrix.json +33 -129
- package/dist/bin/commands/bump.js +9 -2
- package/dist/bin/commands/create-app.js +195 -40
- package/dist/bin/commands/create-project.js +195 -40
- package/dist/bin/commands/deploy.js +51 -20
- package/dist/bin/commands/doctor.js +249 -56
- package/dist/bin/commands/emu.js +18 -20
- package/dist/bin/commands/make-admin.js +30 -10
- package/dist/bin/commands/setup.js +512 -122
- package/dist/bin/commands/type-check.d.ts.map +1 -1
- package/dist/bin/commands/type-check.js +7 -3
- package/dist/bin/commands/type-check.js.map +1 -1
- package/dist/bin/donotdev.js +26 -14
- package/dist/index.js +264 -80
- package/package.json +1 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +6 -6
- package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -1086
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +68 -16
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +123 -32
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
- package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
- package/dist/bin/commands/firebase-setup.d.ts +0 -6
- package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
- package/dist/bin/commands/firebase-setup.js +0 -7
- package/dist/bin/commands/firebase-setup.js.map +0 -1
- package/dist/bin/commands/supabase-setup.d.ts +0 -6
- package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
- package/dist/bin/commands/supabase-setup.js +0 -7
- package/dist/bin/commands/supabase-setup.js.map +0 -1
package/dependencies-matrix.json
CHANGED
|
@@ -475,29 +475,12 @@
|
|
|
475
475
|
"lucide-react",
|
|
476
476
|
"monitoring"
|
|
477
477
|
],
|
|
478
|
-
"dependencies": [
|
|
479
|
-
|
|
480
|
-
"react-query",
|
|
481
|
-
"fast-glob",
|
|
482
|
-
"cli-prompts"
|
|
483
|
-
],
|
|
484
|
-
"devDependencies": [
|
|
485
|
-
"vite",
|
|
486
|
-
"next",
|
|
487
|
-
"typescript"
|
|
488
|
-
]
|
|
478
|
+
"dependencies": ["i18n", "react-query", "fast-glob", "cli-prompts"],
|
|
479
|
+
"devDependencies": ["vite", "next", "typescript"]
|
|
489
480
|
},
|
|
490
481
|
"@donotdev/components": {
|
|
491
|
-
"dependencies": [
|
|
492
|
-
|
|
493
|
-
"styling",
|
|
494
|
-
"react-day-picker"
|
|
495
|
-
],
|
|
496
|
-
"peerDependencies": [
|
|
497
|
-
"react",
|
|
498
|
-
"shiki",
|
|
499
|
-
"lucide-react"
|
|
500
|
-
],
|
|
482
|
+
"dependencies": ["radix", "styling", "react-day-picker"],
|
|
483
|
+
"peerDependencies": ["react", "shiki", "lucide-react"],
|
|
501
484
|
"peerDependenciesMeta": {
|
|
502
485
|
"shiki": {
|
|
503
486
|
"optional": true
|
|
@@ -513,11 +496,7 @@
|
|
|
513
496
|
"routing",
|
|
514
497
|
"validation"
|
|
515
498
|
],
|
|
516
|
-
"dependencies": [
|
|
517
|
-
"fontsource-themes",
|
|
518
|
-
"forms",
|
|
519
|
-
"seo"
|
|
520
|
-
],
|
|
499
|
+
"dependencies": ["fontsource-themes", "forms", "seo"],
|
|
521
500
|
"peerDependenciesMeta": {
|
|
522
501
|
"@donotdev/crud": {
|
|
523
502
|
"optional": true
|
|
@@ -525,17 +504,10 @@
|
|
|
525
504
|
}
|
|
526
505
|
},
|
|
527
506
|
"@donotdev/auth": {
|
|
528
|
-
"peerDependencies": [
|
|
529
|
-
"react",
|
|
530
|
-
"firebase"
|
|
531
|
-
]
|
|
507
|
+
"peerDependencies": ["react", "firebase"]
|
|
532
508
|
},
|
|
533
509
|
"@donotdev/billing": {
|
|
534
|
-
"peerDependencies": [
|
|
535
|
-
"react",
|
|
536
|
-
"lucide-react",
|
|
537
|
-
"stripe"
|
|
538
|
-
]
|
|
510
|
+
"peerDependencies": ["react", "lucide-react", "stripe"]
|
|
539
511
|
},
|
|
540
512
|
"@donotdev/crud": {
|
|
541
513
|
"dependencies": [
|
|
@@ -545,9 +517,7 @@
|
|
|
545
517
|
"@dnd-kit",
|
|
546
518
|
"forms-resolvers"
|
|
547
519
|
],
|
|
548
|
-
"devDependencies": [
|
|
549
|
-
"tiptap"
|
|
550
|
-
],
|
|
520
|
+
"devDependencies": ["tiptap"],
|
|
551
521
|
"peerDependencies": [
|
|
552
522
|
"@donotdev/firebase",
|
|
553
523
|
"react",
|
|
@@ -570,38 +540,22 @@
|
|
|
570
540
|
}
|
|
571
541
|
},
|
|
572
542
|
"@donotdev/firebase": {
|
|
573
|
-
"dependencies": [
|
|
574
|
-
|
|
575
|
-
],
|
|
576
|
-
"peerDependencies": [
|
|
577
|
-
"firebase"
|
|
578
|
-
]
|
|
543
|
+
"dependencies": ["browser-image-compression"],
|
|
544
|
+
"peerDependencies": ["firebase"]
|
|
579
545
|
},
|
|
580
546
|
"@donotdev/supabase": {
|
|
581
|
-
"dependencies": [
|
|
582
|
-
|
|
583
|
-
],
|
|
584
|
-
"peerDependencies": [
|
|
585
|
-
"supabase-js"
|
|
586
|
-
]
|
|
547
|
+
"dependencies": ["validation"],
|
|
548
|
+
"peerDependencies": ["supabase-js"]
|
|
587
549
|
},
|
|
588
550
|
"@donotdev/i18n": {
|
|
589
|
-
"dependencies": [
|
|
590
|
-
|
|
591
|
-
],
|
|
592
|
-
"peerDependencies": [
|
|
593
|
-
"lucide-react"
|
|
594
|
-
]
|
|
551
|
+
"dependencies": ["i18n"],
|
|
552
|
+
"peerDependencies": ["lucide-react"]
|
|
595
553
|
},
|
|
596
554
|
"@donotdev/stores": {
|
|
597
|
-
"dependencies": [
|
|
598
|
-
"zustand"
|
|
599
|
-
]
|
|
555
|
+
"dependencies": ["zustand"]
|
|
600
556
|
},
|
|
601
557
|
"@donotdev/schemas": {
|
|
602
|
-
"dependencies": [
|
|
603
|
-
"validation"
|
|
604
|
-
]
|
|
558
|
+
"dependencies": ["validation"]
|
|
605
559
|
},
|
|
606
560
|
"@donotdev/types": {
|
|
607
561
|
"devDependencies": [
|
|
@@ -613,34 +567,18 @@
|
|
|
613
567
|
]
|
|
614
568
|
},
|
|
615
569
|
"@donotdev/utils": {
|
|
616
|
-
"dependencies": [
|
|
617
|
-
|
|
618
|
-
]
|
|
619
|
-
"peerDependencies": [
|
|
620
|
-
"monitoring"
|
|
621
|
-
],
|
|
622
|
-
"devDependencies": [
|
|
623
|
-
"validation",
|
|
624
|
-
"firebase",
|
|
625
|
-
"i18n"
|
|
626
|
-
]
|
|
570
|
+
"dependencies": ["zustand"],
|
|
571
|
+
"peerDependencies": ["monitoring"],
|
|
572
|
+
"devDependencies": ["validation", "firebase", "i18n"]
|
|
627
573
|
},
|
|
628
574
|
"@donotdev/hooks": {
|
|
629
|
-
"dependencies": [
|
|
630
|
-
"react-query"
|
|
631
|
-
]
|
|
575
|
+
"dependencies": ["react-query"]
|
|
632
576
|
},
|
|
633
577
|
"@donotdev/cli": {
|
|
634
|
-
"dependencies": [
|
|
635
|
-
"cli-prompts",
|
|
636
|
-
"cli-commander",
|
|
637
|
-
"fast-glob"
|
|
638
|
-
]
|
|
578
|
+
"dependencies": ["cli-prompts", "cli-commander", "fast-glob"]
|
|
639
579
|
},
|
|
640
580
|
"@donotdev/mcp-server": {
|
|
641
|
-
"dependencies": [
|
|
642
|
-
"mcp-sdk"
|
|
643
|
-
]
|
|
581
|
+
"dependencies": ["mcp-sdk"]
|
|
644
582
|
},
|
|
645
583
|
"@donotdev/tooling": {
|
|
646
584
|
"dependencies": [
|
|
@@ -652,19 +590,13 @@
|
|
|
652
590
|
"supabase-cli",
|
|
653
591
|
"supabase-js"
|
|
654
592
|
],
|
|
655
|
-
"devDependencies": [
|
|
656
|
-
"yaml"
|
|
657
|
-
]
|
|
593
|
+
"devDependencies": ["yaml"]
|
|
658
594
|
},
|
|
659
595
|
"@donotdev/oauth": {
|
|
660
|
-
"peerDependencies": [
|
|
661
|
-
"react"
|
|
662
|
-
]
|
|
596
|
+
"peerDependencies": ["react"]
|
|
663
597
|
},
|
|
664
598
|
"@donotdev/functions": {
|
|
665
|
-
"dependencies": [
|
|
666
|
-
"@donotdev/core"
|
|
667
|
-
],
|
|
599
|
+
"dependencies": ["@donotdev/core"],
|
|
668
600
|
"peerDependencies": [
|
|
669
601
|
"firebase-functions",
|
|
670
602
|
"firebase-admin",
|
|
@@ -675,11 +607,7 @@
|
|
|
675
607
|
]
|
|
676
608
|
},
|
|
677
609
|
"@donotdev/adv-comps": {
|
|
678
|
-
"peerDependencies": [
|
|
679
|
-
"react",
|
|
680
|
-
"shiki",
|
|
681
|
-
"lucide-react"
|
|
682
|
-
],
|
|
610
|
+
"peerDependencies": ["react", "shiki", "lucide-react"],
|
|
683
611
|
"dependencies": [],
|
|
684
612
|
"peerDependenciesMeta": {
|
|
685
613
|
"shiki": {
|
|
@@ -852,9 +780,7 @@
|
|
|
852
780
|
"validation",
|
|
853
781
|
"lucide-react"
|
|
854
782
|
],
|
|
855
|
-
"devDependencies": [
|
|
856
|
-
"root-consumer-tooling"
|
|
857
|
-
],
|
|
783
|
+
"devDependencies": ["root-consumer-tooling"],
|
|
858
784
|
"conditional": {
|
|
859
785
|
"provider-firebase": "platform===firebase",
|
|
860
786
|
"provider-supabase": "platform===supabase"
|
|
@@ -911,12 +837,7 @@
|
|
|
911
837
|
"i18n",
|
|
912
838
|
"react-query"
|
|
913
839
|
],
|
|
914
|
-
"devDependencies": [
|
|
915
|
-
"next",
|
|
916
|
-
"typescript",
|
|
917
|
-
"types",
|
|
918
|
-
"postcss"
|
|
919
|
-
],
|
|
840
|
+
"devDependencies": ["next", "typescript", "types", "postcss"],
|
|
920
841
|
"conditional": {
|
|
921
842
|
"provider-firebase": "platform===firebase",
|
|
922
843
|
"provider-supabase": "platform===supabase"
|
|
@@ -936,12 +857,7 @@
|
|
|
936
857
|
"validation",
|
|
937
858
|
"react-query"
|
|
938
859
|
],
|
|
939
|
-
"devDependencies": [
|
|
940
|
-
"expo",
|
|
941
|
-
"typescript",
|
|
942
|
-
"types-expo",
|
|
943
|
-
"react-native"
|
|
944
|
-
],
|
|
860
|
+
"devDependencies": ["expo", "typescript", "types-expo", "react-native"],
|
|
945
861
|
"conditional": {
|
|
946
862
|
"provider-firebase": "platform===firebase",
|
|
947
863
|
"provider-supabase": "platform===supabase"
|
|
@@ -961,12 +877,7 @@
|
|
|
961
877
|
"validation",
|
|
962
878
|
"react-query"
|
|
963
879
|
],
|
|
964
|
-
"devDependencies": [
|
|
965
|
-
"expo",
|
|
966
|
-
"typescript",
|
|
967
|
-
"types-expo",
|
|
968
|
-
"react-native"
|
|
969
|
-
],
|
|
880
|
+
"devDependencies": ["expo", "typescript", "types-expo", "react-native"],
|
|
970
881
|
"conditional": {
|
|
971
882
|
"provider-firebase": "platform===firebase",
|
|
972
883
|
"provider-supabase": "platform===supabase"
|
|
@@ -993,19 +904,12 @@
|
|
|
993
904
|
"monitoring-node",
|
|
994
905
|
"stripe"
|
|
995
906
|
],
|
|
996
|
-
"devDependencies": [
|
|
997
|
-
"vercel"
|
|
998
|
-
]
|
|
907
|
+
"devDependencies": ["vercel"]
|
|
999
908
|
},
|
|
1000
909
|
"entities": {
|
|
1001
910
|
"description": "Entities workspace package",
|
|
1002
|
-
"dependencies": [
|
|
1003
|
-
|
|
1004
|
-
],
|
|
1005
|
-
"devDependencies": [
|
|
1006
|
-
"eslint",
|
|
1007
|
-
"typescript"
|
|
1008
|
-
]
|
|
911
|
+
"dependencies": ["validation"],
|
|
912
|
+
"devDependencies": ["eslint", "typescript"]
|
|
1009
913
|
},
|
|
1010
914
|
"demo": {
|
|
1011
915
|
"description": "Demo app template (components only)",
|
|
@@ -7977,7 +7977,11 @@ function getMatrixPath(mode) {
|
|
|
7977
7977
|
const executionMode = mode || detectExecutionMode();
|
|
7978
7978
|
if (executionMode === "development") {
|
|
7979
7979
|
const templatesRoot = getTemplatesRoot();
|
|
7980
|
-
const devPath = normalizePath(
|
|
7980
|
+
const devPath = normalizePath(
|
|
7981
|
+
templatesRoot,
|
|
7982
|
+
"..",
|
|
7983
|
+
"dependencies-matrix.json"
|
|
7984
|
+
);
|
|
7981
7985
|
if (pathExists(devPath)) {
|
|
7982
7986
|
return devPath;
|
|
7983
7987
|
}
|
|
@@ -8189,7 +8193,10 @@ async function syncFile(sourcePath, destPath, preserveIfExists, appRoot) {
|
|
|
8189
8193
|
}
|
|
8190
8194
|
}
|
|
8191
8195
|
await ensureDir(getDirname(destPathWithoutExample));
|
|
8192
|
-
await write(destPathWithoutExample, content, {
|
|
8196
|
+
await write(destPathWithoutExample, content, {
|
|
8197
|
+
format: "text",
|
|
8198
|
+
overwrite: true
|
|
8199
|
+
});
|
|
8193
8200
|
return true;
|
|
8194
8201
|
}
|
|
8195
8202
|
async function syncTemplates(sourceRoot, destRoot, dryRun) {
|
|
@@ -8394,7 +8394,11 @@ function getMatrixPath(mode) {
|
|
|
8394
8394
|
const executionMode = mode || detectExecutionMode();
|
|
8395
8395
|
if (executionMode === "development") {
|
|
8396
8396
|
const templatesRoot = getTemplatesRoot();
|
|
8397
|
-
const devPath = normalizePath(
|
|
8397
|
+
const devPath = normalizePath(
|
|
8398
|
+
templatesRoot,
|
|
8399
|
+
"..",
|
|
8400
|
+
"dependencies-matrix.json"
|
|
8401
|
+
);
|
|
8398
8402
|
if (pathExists(devPath)) {
|
|
8399
8403
|
return devPath;
|
|
8400
8404
|
}
|
|
@@ -8746,18 +8750,102 @@ init_pathResolver();
|
|
|
8746
8750
|
// packages/tooling/src/scaffolding/scaffold-matrix.ts
|
|
8747
8751
|
init_utils();
|
|
8748
8752
|
var MATRIX = [
|
|
8749
|
-
{
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
{
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8753
|
+
{
|
|
8754
|
+
builder: "vite",
|
|
8755
|
+
backend: "none",
|
|
8756
|
+
baseTemplate: "app-vite",
|
|
8757
|
+
overlay: null,
|
|
8758
|
+
deployConfig: null,
|
|
8759
|
+
functionsTemplate: null
|
|
8760
|
+
},
|
|
8761
|
+
{
|
|
8762
|
+
builder: "vite",
|
|
8763
|
+
backend: "firebase",
|
|
8764
|
+
baseTemplate: "app-vite",
|
|
8765
|
+
overlay: "overlay-firebase",
|
|
8766
|
+
deployConfig: "firebase",
|
|
8767
|
+
functionsTemplate: "functions-firebase"
|
|
8768
|
+
},
|
|
8769
|
+
{
|
|
8770
|
+
builder: "vite",
|
|
8771
|
+
backend: "supabase",
|
|
8772
|
+
baseTemplate: "app-vite",
|
|
8773
|
+
overlay: "overlay-supabase",
|
|
8774
|
+
deployConfig: "vercel-supabase",
|
|
8775
|
+
functionsTemplate: "functions-supabase"
|
|
8776
|
+
},
|
|
8777
|
+
{
|
|
8778
|
+
builder: "vite",
|
|
8779
|
+
backend: "vercel",
|
|
8780
|
+
baseTemplate: "app-vite",
|
|
8781
|
+
overlay: "overlay-vercel",
|
|
8782
|
+
deployConfig: "vercel-vercel",
|
|
8783
|
+
functionsTemplate: "functions-vercel"
|
|
8784
|
+
},
|
|
8785
|
+
{
|
|
8786
|
+
builder: "nextjs",
|
|
8787
|
+
backend: "none",
|
|
8788
|
+
baseTemplate: "app-next",
|
|
8789
|
+
overlay: null,
|
|
8790
|
+
deployConfig: null,
|
|
8791
|
+
functionsTemplate: null
|
|
8792
|
+
},
|
|
8793
|
+
{
|
|
8794
|
+
builder: "nextjs",
|
|
8795
|
+
backend: "firebase",
|
|
8796
|
+
baseTemplate: "app-next",
|
|
8797
|
+
overlay: "overlay-firebase",
|
|
8798
|
+
deployConfig: "firebase",
|
|
8799
|
+
functionsTemplate: "functions-firebase"
|
|
8800
|
+
},
|
|
8801
|
+
{
|
|
8802
|
+
builder: "nextjs",
|
|
8803
|
+
backend: "supabase",
|
|
8804
|
+
baseTemplate: "app-next",
|
|
8805
|
+
overlay: "overlay-supabase",
|
|
8806
|
+
deployConfig: "vercel-supabase",
|
|
8807
|
+
functionsTemplate: "functions-supabase"
|
|
8808
|
+
},
|
|
8809
|
+
{
|
|
8810
|
+
builder: "nextjs",
|
|
8811
|
+
backend: "vercel",
|
|
8812
|
+
baseTemplate: "app-next",
|
|
8813
|
+
overlay: "overlay-vercel",
|
|
8814
|
+
deployConfig: "vercel-vercel",
|
|
8815
|
+
functionsTemplate: "functions-vercel"
|
|
8816
|
+
},
|
|
8817
|
+
{
|
|
8818
|
+
builder: "expo",
|
|
8819
|
+
backend: "none",
|
|
8820
|
+
baseTemplate: "app-expo",
|
|
8821
|
+
overlay: null,
|
|
8822
|
+
deployConfig: null,
|
|
8823
|
+
functionsTemplate: null
|
|
8824
|
+
},
|
|
8825
|
+
{
|
|
8826
|
+
builder: "expo",
|
|
8827
|
+
backend: "firebase",
|
|
8828
|
+
baseTemplate: "app-expo",
|
|
8829
|
+
overlay: "overlay-firebase",
|
|
8830
|
+
deployConfig: null,
|
|
8831
|
+
functionsTemplate: "functions-firebase"
|
|
8832
|
+
},
|
|
8833
|
+
{
|
|
8834
|
+
builder: "expo",
|
|
8835
|
+
backend: "supabase",
|
|
8836
|
+
baseTemplate: "app-expo",
|
|
8837
|
+
overlay: "overlay-supabase",
|
|
8838
|
+
deployConfig: null,
|
|
8839
|
+
functionsTemplate: "functions-supabase"
|
|
8840
|
+
},
|
|
8841
|
+
{
|
|
8842
|
+
builder: "demo",
|
|
8843
|
+
backend: "none",
|
|
8844
|
+
baseTemplate: "app-demo",
|
|
8845
|
+
overlay: null,
|
|
8846
|
+
deployConfig: null,
|
|
8847
|
+
functionsTemplate: null
|
|
8848
|
+
}
|
|
8761
8849
|
];
|
|
8762
8850
|
function comboKey(builder, backend) {
|
|
8763
8851
|
return `${builder}-${backend}`;
|
|
@@ -8770,7 +8858,9 @@ function getScaffoldRow(builder, backend) {
|
|
|
8770
8858
|
const key = comboKey(builder, backend);
|
|
8771
8859
|
const row = ROWS_BY_KEY.get(key);
|
|
8772
8860
|
if (!row) {
|
|
8773
|
-
throw new Error(
|
|
8861
|
+
throw new Error(
|
|
8862
|
+
`Unsupported scaffold combo: ${key}. Supported: ${[...ROWS_BY_KEY.keys()].join(", ")}`
|
|
8863
|
+
);
|
|
8774
8864
|
}
|
|
8775
8865
|
return row;
|
|
8776
8866
|
}
|
|
@@ -8926,13 +9016,16 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8926
9016
|
const variantFile = `src/config/providers.${appTemplate}.ts.example`;
|
|
8927
9017
|
if (overlayFiles.includes(variantFile)) continue;
|
|
8928
9018
|
}
|
|
8929
|
-
const providersVariant = file.match(
|
|
9019
|
+
const providersVariant = file.match(
|
|
9020
|
+
/^src\/config\/providers\.(\w+)\.ts\.example$/
|
|
9021
|
+
);
|
|
8930
9022
|
if (providersVariant) {
|
|
8931
9023
|
if (providersVariant[1] !== appTemplate) continue;
|
|
8932
9024
|
const destPath2 = joinPath(appDir, "src/config/providers.ts");
|
|
8933
9025
|
await ensureDir(getDirname(destPath2));
|
|
8934
9026
|
await copy(joinPath(overlayDir, file), destPath2, { overwrite: true });
|
|
8935
|
-
if (await isTextFile(destPath2))
|
|
9027
|
+
if (await isTextFile(destPath2))
|
|
9028
|
+
await replacePlaceholders(destPath2, replacements);
|
|
8936
9029
|
continue;
|
|
8937
9030
|
}
|
|
8938
9031
|
const sourcePath = joinPath(overlayDir, file);
|
|
@@ -8957,16 +9050,28 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8957
9050
|
}
|
|
8958
9051
|
if (deployConfig === "vercel-supabase") {
|
|
8959
9052
|
const vercelPath = joinPath(appDir, "vercel.json");
|
|
8960
|
-
const headersFragmentPath = joinPath(
|
|
9053
|
+
const headersFragmentPath = joinPath(
|
|
9054
|
+
overlayDir,
|
|
9055
|
+
"vercel.headers.example"
|
|
9056
|
+
);
|
|
8961
9057
|
const fullVercelPath = joinPath(overlayDir, "vercel.json.example");
|
|
8962
9058
|
if (pathExists(vercelPath) && pathExists(headersFragmentPath)) {
|
|
8963
9059
|
const vercelJson = readSync(vercelPath, { format: "json" });
|
|
8964
|
-
const headersFragment = readSync(headersFragmentPath, {
|
|
8965
|
-
|
|
8966
|
-
|
|
9060
|
+
const headersFragment = readSync(headersFragmentPath, {
|
|
9061
|
+
format: "json"
|
|
9062
|
+
});
|
|
9063
|
+
vercelJson.headers = [
|
|
9064
|
+
...vercelJson.headers ?? [],
|
|
9065
|
+
...headersFragment
|
|
9066
|
+
];
|
|
9067
|
+
await write(vercelPath, vercelJson, {
|
|
9068
|
+
format: "json",
|
|
9069
|
+
overwrite: true
|
|
9070
|
+
});
|
|
8967
9071
|
} else if (pathExists(fullVercelPath)) {
|
|
8968
9072
|
await copy(fullVercelPath, vercelPath);
|
|
8969
|
-
if (await isTextFile(vercelPath))
|
|
9073
|
+
if (await isTextFile(vercelPath))
|
|
9074
|
+
await replacePlaceholders(vercelPath, replacements);
|
|
8970
9075
|
}
|
|
8971
9076
|
}
|
|
8972
9077
|
}
|
|
@@ -8986,9 +9091,13 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8986
9091
|
});
|
|
8987
9092
|
if (row.functionsTemplate) {
|
|
8988
9093
|
const functionsTemplateName = row.functionsTemplate;
|
|
8989
|
-
const functionsTemplateExists = pathExists(
|
|
9094
|
+
const functionsTemplateExists = pathExists(
|
|
9095
|
+
joinPath(templatesRoot, functionsTemplateName)
|
|
9096
|
+
);
|
|
8990
9097
|
if (!functionsTemplateExists) {
|
|
8991
|
-
log.warn(
|
|
9098
|
+
log.warn(
|
|
9099
|
+
`Functions template "${functionsTemplateName}" not found \u2014 skipping functions scaffolding.`
|
|
9100
|
+
);
|
|
8992
9101
|
} else {
|
|
8993
9102
|
const isSupabaseFunctions = functionsTemplateName === "functions-supabase";
|
|
8994
9103
|
const functionsRootDir = isSupabaseFunctions ? appDir : joinPath(appDir, "functions");
|
|
@@ -8996,7 +9105,10 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8996
9105
|
const functionsPackageJson = generatePackageJson(
|
|
8997
9106
|
functionsTemplateName,
|
|
8998
9107
|
executionMode,
|
|
8999
|
-
{
|
|
9108
|
+
{
|
|
9109
|
+
appName,
|
|
9110
|
+
platform: row.functionsTemplate.replace("functions-", "")
|
|
9111
|
+
}
|
|
9000
9112
|
);
|
|
9001
9113
|
const packageJsonPath2 = joinPath(functionsRootDir, "package.json");
|
|
9002
9114
|
await ensureDir(functionsRootDir);
|
|
@@ -9032,13 +9144,19 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9032
9144
|
}
|
|
9033
9145
|
const deploymentTemplateDir = joinPath(templatesRoot, "root-consumer");
|
|
9034
9146
|
if (deployConfig === "firebase") {
|
|
9035
|
-
const firebaseJsonSource = joinPath(
|
|
9147
|
+
const firebaseJsonSource = joinPath(
|
|
9148
|
+
deploymentTemplateDir,
|
|
9149
|
+
"firebase.json.example"
|
|
9150
|
+
);
|
|
9036
9151
|
if (pathExists(firebaseJsonSource)) {
|
|
9037
9152
|
await copy(firebaseJsonSource, joinPath(appDir, "firebase.json"));
|
|
9038
9153
|
const firebaseJsonDest = joinPath(appDir, "firebase.json");
|
|
9039
|
-
if (await isTextFile(firebaseJsonDest))
|
|
9154
|
+
if (await isTextFile(firebaseJsonDest))
|
|
9155
|
+
await replacePlaceholders(firebaseJsonDest, replacements);
|
|
9040
9156
|
if (appTemplate === "nextjs") {
|
|
9041
|
-
const firebaseJson = readSync(firebaseJsonDest, {
|
|
9157
|
+
const firebaseJson = readSync(firebaseJsonDest, {
|
|
9158
|
+
format: "json"
|
|
9159
|
+
});
|
|
9042
9160
|
if (firebaseJson.hosting?.rewrites) {
|
|
9043
9161
|
firebaseJson.hosting.rewrites = firebaseJson.hosting.rewrites.filter(
|
|
9044
9162
|
(r2) => r2.destination !== "/index.html"
|
|
@@ -9047,17 +9165,28 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9047
9165
|
if (firebaseJson.hosting) {
|
|
9048
9166
|
firebaseJson.hosting.public = "out";
|
|
9049
9167
|
}
|
|
9050
|
-
await write(firebaseJsonDest, firebaseJson, {
|
|
9168
|
+
await write(firebaseJsonDest, firebaseJson, {
|
|
9169
|
+
format: "json",
|
|
9170
|
+
overwrite: true
|
|
9171
|
+
});
|
|
9051
9172
|
}
|
|
9052
9173
|
}
|
|
9053
|
-
const firebasercSource = joinPath(
|
|
9174
|
+
const firebasercSource = joinPath(
|
|
9175
|
+
deploymentTemplateDir,
|
|
9176
|
+
".firebaserc.example"
|
|
9177
|
+
);
|
|
9054
9178
|
if (pathExists(firebasercSource)) {
|
|
9055
9179
|
await copy(firebasercSource, joinPath(appDir, ".firebaserc"));
|
|
9056
9180
|
const firebasercDest = joinPath(appDir, ".firebaserc");
|
|
9057
|
-
if (await isTextFile(firebasercDest))
|
|
9181
|
+
if (await isTextFile(firebasercDest))
|
|
9182
|
+
await replacePlaceholders(firebasercDest, replacements);
|
|
9058
9183
|
}
|
|
9059
9184
|
if (row.functionsTemplate === "functions-firebase") {
|
|
9060
|
-
for (const example of [
|
|
9185
|
+
for (const example of [
|
|
9186
|
+
"firestore.rules.example",
|
|
9187
|
+
"firestore.indexes.json.example",
|
|
9188
|
+
"storage.rules.example"
|
|
9189
|
+
]) {
|
|
9061
9190
|
const src = joinPath(deploymentTemplateDir, example);
|
|
9062
9191
|
if (pathExists(src)) {
|
|
9063
9192
|
await copy(src, joinPath(appDir, example.replace(".example", "")));
|
|
@@ -9073,11 +9202,22 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9073
9202
|
{
|
|
9074
9203
|
source: "functions",
|
|
9075
9204
|
codebase: "default",
|
|
9076
|
-
ignore: [
|
|
9205
|
+
ignore: [
|
|
9206
|
+
"node_modules",
|
|
9207
|
+
".git",
|
|
9208
|
+
"firebase-debug.log",
|
|
9209
|
+
"firebase-debug.*.log",
|
|
9210
|
+
"**/.*",
|
|
9211
|
+
"**/*.test.ts",
|
|
9212
|
+
"**/__tests__/**"
|
|
9213
|
+
],
|
|
9077
9214
|
runtime: "nodejs22"
|
|
9078
9215
|
}
|
|
9079
9216
|
],
|
|
9080
|
-
firestore: {
|
|
9217
|
+
firestore: {
|
|
9218
|
+
rules: "firestore.rules",
|
|
9219
|
+
indexes: "firestore.indexes.json"
|
|
9220
|
+
},
|
|
9081
9221
|
storage: { rules: "storage.rules" },
|
|
9082
9222
|
emulators: {
|
|
9083
9223
|
auth: { port: 9099 },
|
|
@@ -9087,15 +9227,26 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9087
9227
|
ui: { enabled: true, port: 4e3 }
|
|
9088
9228
|
}
|
|
9089
9229
|
};
|
|
9090
|
-
await write(firebaseJsonPath, expoFirebaseJson, {
|
|
9230
|
+
await write(firebaseJsonPath, expoFirebaseJson, {
|
|
9231
|
+
format: "json",
|
|
9232
|
+
overwrite: true
|
|
9233
|
+
});
|
|
9091
9234
|
}
|
|
9092
|
-
const firebasercSource = joinPath(
|
|
9235
|
+
const firebasercSource = joinPath(
|
|
9236
|
+
deploymentTemplateDir,
|
|
9237
|
+
".firebaserc.example"
|
|
9238
|
+
);
|
|
9093
9239
|
const firebasercDest = joinPath(appDir, ".firebaserc");
|
|
9094
9240
|
if (pathExists(firebasercSource) && !pathExists(firebasercDest)) {
|
|
9095
9241
|
await copy(firebasercSource, firebasercDest);
|
|
9096
|
-
if (await isTextFile(firebasercDest))
|
|
9097
|
-
|
|
9098
|
-
|
|
9242
|
+
if (await isTextFile(firebasercDest))
|
|
9243
|
+
await replacePlaceholders(firebasercDest, replacements);
|
|
9244
|
+
}
|
|
9245
|
+
for (const example of [
|
|
9246
|
+
"firestore.rules.example",
|
|
9247
|
+
"firestore.indexes.json.example",
|
|
9248
|
+
"storage.rules.example"
|
|
9249
|
+
]) {
|
|
9099
9250
|
const src = joinPath(deploymentTemplateDir, example);
|
|
9100
9251
|
const dest = joinPath(appDir, example.replace(".example", ""));
|
|
9101
9252
|
if (pathExists(src) && !pathExists(dest)) {
|
|
@@ -9104,11 +9255,15 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9104
9255
|
}
|
|
9105
9256
|
}
|
|
9106
9257
|
if (deployConfig === "vercel-vercel") {
|
|
9107
|
-
const vercelJsonSource = joinPath(
|
|
9258
|
+
const vercelJsonSource = joinPath(
|
|
9259
|
+
deploymentTemplateDir,
|
|
9260
|
+
"vercel.json.example"
|
|
9261
|
+
);
|
|
9108
9262
|
if (pathExists(vercelJsonSource)) {
|
|
9109
9263
|
await copy(vercelJsonSource, joinPath(appDir, "vercel.json"));
|
|
9110
9264
|
const vercelJsonDest = joinPath(appDir, "vercel.json");
|
|
9111
|
-
if (await isTextFile(vercelJsonDest))
|
|
9265
|
+
if (await isTextFile(vercelJsonDest))
|
|
9266
|
+
await replacePlaceholders(vercelJsonDest, replacements);
|
|
9112
9267
|
}
|
|
9113
9268
|
}
|
|
9114
9269
|
const backendInfo = row.functionsTemplate ? ` with ${row.functionsTemplate.replace("functions-", "")} functions` : "";
|