@donotdev/cli 0.0.5 → 0.0.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/dependencies-matrix.json +76 -34
- package/dist/bin/commands/build.js +165 -161
- package/dist/bin/commands/bump.js +172 -160
- package/dist/bin/commands/cacheout.js +163 -157
- package/dist/bin/commands/create-app.js +205 -163
- package/dist/bin/commands/create-project.js +176 -161
- package/dist/bin/commands/deploy.js +480 -472
- package/dist/bin/commands/dev.js +164 -158
- package/dist/bin/commands/emu.js +164 -158
- package/dist/bin/commands/format.js +163 -157
- package/dist/bin/commands/lint.js +166 -157
- package/dist/bin/commands/make-admin.d.ts +11 -0
- package/dist/bin/commands/make-admin.d.ts.map +1 -0
- package/dist/bin/commands/make-admin.js +12 -0
- package/dist/bin/commands/make-admin.js.map +1 -0
- package/dist/bin/commands/preview.js +164 -158
- package/dist/bin/commands/sync-secrets.js +164 -158
- package/dist/bin/commands/wai.d.ts +11 -0
- package/dist/bin/commands/wai.d.ts.map +1 -0
- package/dist/bin/commands/wai.js +12 -0
- package/dist/bin/commands/wai.js.map +1 -0
- package/dist/bin/dndev.js +24 -8
- package/dist/bin/donotdev.js +24 -8
- package/dist/index.js +557 -514
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +4 -0
- package/templates/app-demo/src/App.tsx.example +28 -10
- package/templates/app-demo/src/config/app.ts.example +68 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +4 -3
- package/templates/app-next/src/app/layout.tsx.example +17 -25
- package/templates/app-next/src/config/app.ts.example +75 -48
- package/templates/app-next/src/globals.css.example +10 -7
- package/templates/app-next/src/locales/dndev_en.json.example +68 -0
- package/templates/app-next/src/pages/locales/example_en.json.example +5 -0
- package/templates/app-vite/index.html.example +71 -34
- package/templates/app-vite/src/config/app.ts.example +75 -47
- package/templates/app-vite/src/globals.css.example +14 -6
- package/templates/app-vite/src/locales/dndev_en.json.example +68 -0
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +152 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +81 -134
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +88 -0
- package/templates/functions-firebase/README.md.example +25 -0
- package/templates/functions-firebase/build.mjs.example +8 -1
- package/templates/functions-firebase/functions-firebase/build.mjs.example +8 -1
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +19 -25
- package/templates/functions-firebase/functions.config.js.example +35 -0
- package/templates/functions-firebase/tsconfig.json.example +3 -13
- package/templates/functions-vercel/tsconfig.json.example +1 -13
- package/templates/root-consumer/entities/ExampleEntity.ts.example +223 -0
- package/templates/root-consumer/entities/demo.ts.example +562 -0
- package/templates/root-consumer/entities/index.ts.example +15 -0
- package/templates/root-consumer/firebase.json.example +1 -1
- package/templates/root-consumer/guides/{AGENT_START_HERE.md.example → dndev/AGENT_START_HERE.md.example} +22 -0
- package/templates/root-consumer/guides/{COMPONENTS_ADV.md.example → dndev/COMPONENTS_ADV.md.example} +456 -360
- package/templates/root-consumer/guides/{COMPONENTS_ATOMIC.md.example → dndev/COMPONENTS_ATOMIC.md.example} +42 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +231 -0
- package/templates/root-consumer/guides/{INDEX.md.example → dndev/INDEX.md.example} +3 -0
- package/templates/root-consumer/guides/{SETUP_APP_CONFIG.md.example → dndev/SETUP_APP_CONFIG.md.example} +5 -2
- package/templates/root-consumer/guides/{SETUP_AUTH.md.example → dndev/SETUP_AUTH.md.example} +30 -0
- package/templates/root-consumer/guides/{SETUP_BILLING.md.example → dndev/SETUP_BILLING.md.example} +44 -4
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +473 -0
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +116 -0
- package/templates/root-consumer/guides/{SETUP_PAGES.md.example → dndev/SETUP_PAGES.md.example} +17 -0
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +213 -0
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +503 -0
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +404 -0
- package/templates/root-consumer/guides/wai-way/agents/architect.md.example +78 -0
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +87 -0
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +325 -0
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +100 -0
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +281 -0
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +77 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +104 -0
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +124 -0
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +165 -0
- package/templates/root-consumer/guides/wai-way/context_map.json.example +95 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +840 -0
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +686 -0
- package/templates/root-consumer/guides/wai-way/presets_guide.md.example +217 -0
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +312 -0
- package/templates/root-consumer/vercel.json.example +315 -20
- package/templates/app-demo/src/Routes.tsx.example +0 -20
- package/templates/app-vite/src/Routes.tsx.example +0 -16
- package/templates/app-vite/src/pages/locales/README.md.example +0 -1
- package/templates/functions-firebase/functions-firebase/src/crud/createEntity.ts.example +0 -19
- package/templates/functions-firebase/functions-firebase/src/crud/deleteEntity.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/getEntity.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/index.ts.example +0 -12
- package/templates/functions-firebase/functions-firebase/src/crud/listEntities.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/updateEntity.ts.example +0 -14
- package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +0 -70
- package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +0 -62
- /package/templates/root-consumer/guides/{COMPONENTS_UI.md.example → dndev/COMPONENTS_UI.md.example} +0 -0
- /package/templates/root-consumer/guides/{ENV_SETUP.md.example → dndev/ENV_SETUP.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_I18N.md.example → dndev/SETUP_I18N.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_LAYOUTS.md.example → dndev/SETUP_LAYOUTS.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_OAUTH.md.example → dndev/SETUP_OAUTH.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_THEMES.md.example → dndev/SETUP_THEMES.md.example} +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/APP_CHECK.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/COOKIE_REFERENCE.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/EMULATORS.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/VERSION_CONTROL.md.example +0 -0
|
@@ -1013,155 +1013,6 @@ var init_cli_output = __esm({
|
|
|
1013
1013
|
}
|
|
1014
1014
|
});
|
|
1015
1015
|
|
|
1016
|
-
// packages/core/config/constants.js
|
|
1017
|
-
function getPatternsFor(type, repoRoot = null) {
|
|
1018
|
-
const patterns = SCAN_PATTERNS[type];
|
|
1019
|
-
if (!patterns) {
|
|
1020
|
-
throw new Error(`Unknown pattern type: ${type}`);
|
|
1021
|
-
}
|
|
1022
|
-
if (repoRoot && patterns.framework) {
|
|
1023
|
-
return {
|
|
1024
|
-
...patterns,
|
|
1025
|
-
framework: patterns.framework.map((pattern) => `${repoRoot}/${pattern}`)
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
return patterns;
|
|
1029
|
-
}
|
|
1030
|
-
function getGlobOptionsFor(type) {
|
|
1031
|
-
return GLOB_OPTIONS[type] || GLOB_OPTIONS.base;
|
|
1032
|
-
}
|
|
1033
|
-
var I18N_PATHS, SCAN_PATTERNS, GLOB_OPTIONS;
|
|
1034
|
-
var init_constants = __esm({
|
|
1035
|
-
"packages/core/config/constants.js"() {
|
|
1036
|
-
"use strict";
|
|
1037
|
-
init_utils();
|
|
1038
|
-
I18N_PATHS = {
|
|
1039
|
-
// Monorepo source structure (locales at root, not in src/)
|
|
1040
|
-
SOURCE_ROOT: "packages/core/i18n",
|
|
1041
|
-
SOURCE_LOCALES: "packages/core/i18n/locales",
|
|
1042
|
-
SOURCE_EAGER: "packages/core/i18n/locales/eager",
|
|
1043
|
-
SOURCE_LAZY: "packages/core/i18n/locales/lazy",
|
|
1044
|
-
// Published structure (same as source - no flattening needed)
|
|
1045
|
-
PUBLISHED_ROOT: "i18n",
|
|
1046
|
-
PUBLISHED_LOCALES: "i18n/locales",
|
|
1047
|
-
PUBLISHED_EAGER: "i18n/locales/eager",
|
|
1048
|
-
PUBLISHED_LAZY: "i18n/locales/lazy"
|
|
1049
|
-
};
|
|
1050
|
-
SCAN_PATTERNS = {
|
|
1051
|
-
routes: {
|
|
1052
|
-
consumer: ["src/**/*Page.tsx", "src/pages/**/*Page.tsx"],
|
|
1053
|
-
exclude: [
|
|
1054
|
-
"**/node_modules/**",
|
|
1055
|
-
"**/dist/**",
|
|
1056
|
-
"**/build/**",
|
|
1057
|
-
"**/*.test.tsx",
|
|
1058
|
-
"**/*.stories.tsx"
|
|
1059
|
-
],
|
|
1060
|
-
extensions: [".tsx"]
|
|
1061
|
-
},
|
|
1062
|
-
css: {
|
|
1063
|
-
consumer: ["src/**/*.css"],
|
|
1064
|
-
themes: ["src/**/*.css"],
|
|
1065
|
-
extensions: [".css", ".scss", ".sass"],
|
|
1066
|
-
framework: [
|
|
1067
|
-
"packages/ui/src/**/*.css",
|
|
1068
|
-
"packages/core/components/src/**/*.css",
|
|
1069
|
-
"packages/core/templates/src/**/*.css"
|
|
1070
|
-
]
|
|
1071
|
-
},
|
|
1072
|
-
i18n: {
|
|
1073
|
-
eager: ["src/locales/*_*.json"],
|
|
1074
|
-
lazy: ["src/**/locales/*_*.json", "!src/locales/*_*.json"],
|
|
1075
|
-
framework: {
|
|
1076
|
-
eager: [`${I18N_PATHS.SOURCE_EAGER}/*_*.json`],
|
|
1077
|
-
lazy: [`${I18N_PATHS.SOURCE_LAZY}/*_*.json`]
|
|
1078
|
-
},
|
|
1079
|
-
extensions: [".json"]
|
|
1080
|
-
},
|
|
1081
|
-
assets: {
|
|
1082
|
-
consumer: ["public/**/*"],
|
|
1083
|
-
fallback: ["manifest.json"],
|
|
1084
|
-
modern: [
|
|
1085
|
-
"logo.svg",
|
|
1086
|
-
"favicon.svg",
|
|
1087
|
-
"apple-touch-icon.png",
|
|
1088
|
-
"android-chrome-192x192.png",
|
|
1089
|
-
"android-chrome-512x512.png"
|
|
1090
|
-
],
|
|
1091
|
-
patterns: [
|
|
1092
|
-
"favicon.svg",
|
|
1093
|
-
"favicon.ico",
|
|
1094
|
-
"favicon-*.png",
|
|
1095
|
-
"logo.svg",
|
|
1096
|
-
"logo.png",
|
|
1097
|
-
"logo.webp",
|
|
1098
|
-
"logo.avif",
|
|
1099
|
-
"apple-touch-icon*.png",
|
|
1100
|
-
"android-chrome-*.png",
|
|
1101
|
-
"manifest.json"
|
|
1102
|
-
],
|
|
1103
|
-
fonts: ["fonts/**/*.woff2", "fonts/**/*.woff", "fonts/**/*.ttf"],
|
|
1104
|
-
framework: ["packages/ui/assets/**/*"]
|
|
1105
|
-
},
|
|
1106
|
-
pwa: {
|
|
1107
|
-
consumer: [
|
|
1108
|
-
"public/manifest.json",
|
|
1109
|
-
"public/service-worker.js",
|
|
1110
|
-
"public/sw.js",
|
|
1111
|
-
"public/icon-192x192.png",
|
|
1112
|
-
"public/icon-512x512.png",
|
|
1113
|
-
"public/favicon.ico",
|
|
1114
|
-
"public/favicon.svg",
|
|
1115
|
-
"public/apple-touch-icon.png",
|
|
1116
|
-
"public/logo.svg"
|
|
1117
|
-
],
|
|
1118
|
-
exclude: ["**/node_modules/**", "**/dist/**", "**/build/**"],
|
|
1119
|
-
extensions: [".json", ".js", ".png", ".svg", ".ico"],
|
|
1120
|
-
framework: ["packages/ui/assets/**/*"]
|
|
1121
|
-
},
|
|
1122
|
-
globalIgnore: [
|
|
1123
|
-
"**/node_modules/**",
|
|
1124
|
-
"**/dist/**",
|
|
1125
|
-
"**/build/**",
|
|
1126
|
-
"**/.git/**",
|
|
1127
|
-
"**/coverage/**",
|
|
1128
|
-
"**/test/**"
|
|
1129
|
-
]
|
|
1130
|
-
};
|
|
1131
|
-
GLOB_OPTIONS = {
|
|
1132
|
-
base: {
|
|
1133
|
-
absolute: true,
|
|
1134
|
-
onlyFiles: true,
|
|
1135
|
-
ignore: SCAN_PATTERNS.globalIgnore
|
|
1136
|
-
},
|
|
1137
|
-
css: {
|
|
1138
|
-
absolute: true,
|
|
1139
|
-
onlyFiles: true,
|
|
1140
|
-
ignore: [...SCAN_PATTERNS.globalIgnore, "**/*.test.css"]
|
|
1141
|
-
},
|
|
1142
|
-
routes: {
|
|
1143
|
-
absolute: true,
|
|
1144
|
-
onlyFiles: true,
|
|
1145
|
-
ignore: [
|
|
1146
|
-
...SCAN_PATTERNS.globalIgnore,
|
|
1147
|
-
"**/*.test.tsx",
|
|
1148
|
-
"**/*.stories.tsx"
|
|
1149
|
-
]
|
|
1150
|
-
},
|
|
1151
|
-
i18n: {
|
|
1152
|
-
absolute: true,
|
|
1153
|
-
onlyFiles: true,
|
|
1154
|
-
ignore: SCAN_PATTERNS.globalIgnore
|
|
1155
|
-
},
|
|
1156
|
-
assets: {
|
|
1157
|
-
absolute: true,
|
|
1158
|
-
onlyFiles: true,
|
|
1159
|
-
ignore: SCAN_PATTERNS.globalIgnore
|
|
1160
|
-
}
|
|
1161
|
-
};
|
|
1162
|
-
}
|
|
1163
|
-
});
|
|
1164
|
-
|
|
1165
1016
|
// node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
|
|
1166
1017
|
var require_array = __commonJS({
|
|
1167
1018
|
"node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
|
|
@@ -6746,7 +6597,157 @@ var require_out4 = __commonJS({
|
|
|
6746
6597
|
}
|
|
6747
6598
|
});
|
|
6748
6599
|
|
|
6600
|
+
// packages/core/config/constants.js
|
|
6601
|
+
function getPatternsFor(type, repoRoot = null) {
|
|
6602
|
+
const patterns = SCAN_PATTERNS[type];
|
|
6603
|
+
if (!patterns) {
|
|
6604
|
+
throw new Error(`Unknown pattern type: ${type}`);
|
|
6605
|
+
}
|
|
6606
|
+
if (repoRoot && patterns.framework) {
|
|
6607
|
+
return {
|
|
6608
|
+
...patterns,
|
|
6609
|
+
framework: patterns.framework.map((pattern) => `${repoRoot}/${pattern}`)
|
|
6610
|
+
};
|
|
6611
|
+
}
|
|
6612
|
+
return patterns;
|
|
6613
|
+
}
|
|
6614
|
+
function getGlobOptionsFor(type) {
|
|
6615
|
+
return GLOB_OPTIONS[type] || GLOB_OPTIONS.base;
|
|
6616
|
+
}
|
|
6617
|
+
var I18N_PATHS, SCAN_PATTERNS, GLOB_OPTIONS;
|
|
6618
|
+
var init_constants = __esm({
|
|
6619
|
+
"packages/core/config/constants.js"() {
|
|
6620
|
+
"use strict";
|
|
6621
|
+
init_utils();
|
|
6622
|
+
I18N_PATHS = {
|
|
6623
|
+
// Monorepo source structure (locales at root, not in src/)
|
|
6624
|
+
SOURCE_ROOT: "packages/core/i18n",
|
|
6625
|
+
SOURCE_LOCALES: "packages/core/i18n/locales",
|
|
6626
|
+
SOURCE_EAGER: "packages/core/i18n/locales/eager",
|
|
6627
|
+
SOURCE_LAZY: "packages/core/i18n/locales/lazy",
|
|
6628
|
+
// Published structure (same as source - no flattening needed)
|
|
6629
|
+
PUBLISHED_ROOT: "i18n",
|
|
6630
|
+
PUBLISHED_LOCALES: "i18n/locales",
|
|
6631
|
+
PUBLISHED_EAGER: "i18n/locales/eager",
|
|
6632
|
+
PUBLISHED_LAZY: "i18n/locales/lazy"
|
|
6633
|
+
};
|
|
6634
|
+
SCAN_PATTERNS = {
|
|
6635
|
+
routes: {
|
|
6636
|
+
consumer: ["src/**/*Page.tsx", "src/pages/**/*Page.tsx"],
|
|
6637
|
+
exclude: [
|
|
6638
|
+
"**/node_modules/**",
|
|
6639
|
+
"**/dist/**",
|
|
6640
|
+
"**/build/**",
|
|
6641
|
+
"**/*.test.tsx",
|
|
6642
|
+
"**/*.stories.tsx"
|
|
6643
|
+
],
|
|
6644
|
+
extensions: [".tsx"]
|
|
6645
|
+
},
|
|
6646
|
+
css: {
|
|
6647
|
+
consumer: ["src/**/*.css"],
|
|
6648
|
+
themes: ["src/**/*.css"],
|
|
6649
|
+
extensions: [".css", ".scss", ".sass"],
|
|
6650
|
+
framework: [
|
|
6651
|
+
"packages/ui/src/**/*.css",
|
|
6652
|
+
"packages/core/components/src/**/*.css",
|
|
6653
|
+
"packages/core/templates/src/**/*.css"
|
|
6654
|
+
]
|
|
6655
|
+
},
|
|
6656
|
+
i18n: {
|
|
6657
|
+
eager: ["src/locales/*_*.json"],
|
|
6658
|
+
lazy: ["src/**/locales/*_*.json", "!src/locales/*_*.json"],
|
|
6659
|
+
framework: {
|
|
6660
|
+
eager: [`${I18N_PATHS.SOURCE_EAGER}/*_*.json`],
|
|
6661
|
+
lazy: [`${I18N_PATHS.SOURCE_LAZY}/*_*.json`]
|
|
6662
|
+
},
|
|
6663
|
+
extensions: [".json"]
|
|
6664
|
+
},
|
|
6665
|
+
assets: {
|
|
6666
|
+
consumer: ["public/**/*"],
|
|
6667
|
+
fallback: ["manifest.json"],
|
|
6668
|
+
modern: [
|
|
6669
|
+
"logo.svg",
|
|
6670
|
+
"favicon.svg",
|
|
6671
|
+
"apple-touch-icon.png",
|
|
6672
|
+
"android-chrome-192x192.png",
|
|
6673
|
+
"android-chrome-512x512.png"
|
|
6674
|
+
],
|
|
6675
|
+
patterns: [
|
|
6676
|
+
"favicon.svg",
|
|
6677
|
+
"favicon.ico",
|
|
6678
|
+
"favicon-*.png",
|
|
6679
|
+
"logo.svg",
|
|
6680
|
+
"logo.png",
|
|
6681
|
+
"logo.webp",
|
|
6682
|
+
"logo.avif",
|
|
6683
|
+
"apple-touch-icon*.png",
|
|
6684
|
+
"android-chrome-*.png",
|
|
6685
|
+
"manifest.json"
|
|
6686
|
+
],
|
|
6687
|
+
fonts: ["fonts/**/*.woff2", "fonts/**/*.woff", "fonts/**/*.ttf"],
|
|
6688
|
+
framework: ["packages/ui/assets/**/*"]
|
|
6689
|
+
},
|
|
6690
|
+
pwa: {
|
|
6691
|
+
consumer: [
|
|
6692
|
+
"public/manifest.json",
|
|
6693
|
+
"public/service-worker.js",
|
|
6694
|
+
"public/sw.js",
|
|
6695
|
+
"public/icon-192x192.png",
|
|
6696
|
+
"public/icon-512x512.png",
|
|
6697
|
+
"public/favicon.ico",
|
|
6698
|
+
"public/favicon.svg",
|
|
6699
|
+
"public/apple-touch-icon.png",
|
|
6700
|
+
"public/logo.svg"
|
|
6701
|
+
],
|
|
6702
|
+
exclude: ["**/node_modules/**", "**/dist/**", "**/build/**"],
|
|
6703
|
+
extensions: [".json", ".js", ".png", ".svg", ".ico"],
|
|
6704
|
+
framework: ["packages/ui/assets/**/*"]
|
|
6705
|
+
},
|
|
6706
|
+
globalIgnore: [
|
|
6707
|
+
"**/node_modules/**",
|
|
6708
|
+
"**/dist/**",
|
|
6709
|
+
"**/build/**",
|
|
6710
|
+
"**/.git/**",
|
|
6711
|
+
"**/coverage/**",
|
|
6712
|
+
"**/test/**"
|
|
6713
|
+
]
|
|
6714
|
+
};
|
|
6715
|
+
GLOB_OPTIONS = {
|
|
6716
|
+
base: {
|
|
6717
|
+
absolute: true,
|
|
6718
|
+
onlyFiles: true,
|
|
6719
|
+
ignore: SCAN_PATTERNS.globalIgnore
|
|
6720
|
+
},
|
|
6721
|
+
css: {
|
|
6722
|
+
absolute: true,
|
|
6723
|
+
onlyFiles: true,
|
|
6724
|
+
ignore: [...SCAN_PATTERNS.globalIgnore, "**/*.test.css"]
|
|
6725
|
+
},
|
|
6726
|
+
routes: {
|
|
6727
|
+
absolute: true,
|
|
6728
|
+
onlyFiles: true,
|
|
6729
|
+
ignore: [
|
|
6730
|
+
...SCAN_PATTERNS.globalIgnore,
|
|
6731
|
+
"**/*.test.tsx",
|
|
6732
|
+
"**/*.stories.tsx"
|
|
6733
|
+
]
|
|
6734
|
+
},
|
|
6735
|
+
i18n: {
|
|
6736
|
+
absolute: true,
|
|
6737
|
+
onlyFiles: true,
|
|
6738
|
+
ignore: SCAN_PATTERNS.globalIgnore
|
|
6739
|
+
},
|
|
6740
|
+
assets: {
|
|
6741
|
+
absolute: true,
|
|
6742
|
+
onlyFiles: true,
|
|
6743
|
+
ignore: SCAN_PATTERNS.globalIgnore
|
|
6744
|
+
}
|
|
6745
|
+
};
|
|
6746
|
+
}
|
|
6747
|
+
});
|
|
6748
|
+
|
|
6749
6749
|
// packages/core/config/utils/PathResolver.ts
|
|
6750
|
+
import * as fs from "node:fs";
|
|
6750
6751
|
import { createRequire } from "node:module";
|
|
6751
6752
|
import {
|
|
6752
6753
|
resolve,
|
|
@@ -6758,7 +6759,6 @@ import {
|
|
|
6758
6759
|
extname
|
|
6759
6760
|
} from "node:path";
|
|
6760
6761
|
import { fileURLToPath } from "node:url";
|
|
6761
|
-
import * as fs from "node:fs";
|
|
6762
6762
|
function safeExecuteAsync(fn, message) {
|
|
6763
6763
|
return fn().catch((error2) => {
|
|
6764
6764
|
throw new Error(
|
|
@@ -6771,8 +6771,8 @@ var init_PathResolver = __esm({
|
|
|
6771
6771
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
6772
6772
|
"use strict";
|
|
6773
6773
|
init_utils();
|
|
6774
|
-
init_constants();
|
|
6775
6774
|
import_fast_glob = __toESM(require_out4(), 1);
|
|
6775
|
+
init_constants();
|
|
6776
6776
|
constants = {
|
|
6777
6777
|
getGlobOptionsFor: getGlobOptionsFor || void 0,
|
|
6778
6778
|
SCAN_PATTERNS: SCAN_PATTERNS || void 0,
|
|
@@ -7687,11 +7687,17 @@ var init_PathResolver = __esm({
|
|
|
7687
7687
|
/**
|
|
7688
7688
|
* Get path to empty.js module for optional dependency aliasing
|
|
7689
7689
|
* Used by Vite and Turbopack to alias missing optional deps
|
|
7690
|
-
* @returns
|
|
7690
|
+
* @param returnPackageSpecifier - If true, returns package specifier '@donotdev/core/empty' for Turbopack. If false, returns absolute path for Vite.
|
|
7691
|
+
* @returns Package specifier or absolute path to empty.js
|
|
7691
7692
|
*/
|
|
7692
|
-
getEmptyModulePath() {
|
|
7693
|
+
getEmptyModulePath(returnPackageSpecifier = false) {
|
|
7694
|
+
if (returnPackageSpecifier) {
|
|
7695
|
+
return "@donotdev/core/empty";
|
|
7696
|
+
}
|
|
7697
|
+
const resolved = this.resolvePackage("@donotdev/core/empty");
|
|
7698
|
+
if (resolved) return resolved;
|
|
7693
7699
|
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
7694
|
-
return this.normalizePath(join(thisDir, "../
|
|
7700
|
+
return this.normalizePath(join(thisDir, "../empty.js"));
|
|
7695
7701
|
}
|
|
7696
7702
|
// === PRIVATE METHODS ===
|
|
7697
7703
|
/**
|
|
@@ -8208,11 +8214,11 @@ var init_pathResolver = __esm({
|
|
|
8208
8214
|
});
|
|
8209
8215
|
|
|
8210
8216
|
// packages/tooling/src/bundler/utils.ts
|
|
8217
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
8211
8218
|
import { createRequire as createRequire3 } from "node:module";
|
|
8212
|
-
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8213
8219
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
8214
|
-
import { Buffer as Buffer2 } from "node:buffer";
|
|
8215
8220
|
import process from "node:process";
|
|
8221
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8216
8222
|
var require2, __filename, __dirname;
|
|
8217
8223
|
var init_utils = __esm({
|
|
8218
8224
|
"packages/tooling/src/bundler/utils.ts"() {
|
|
@@ -8288,8 +8294,8 @@ async function askForSelection(message, choices, defaultValue = 0) {
|
|
|
8288
8294
|
|
|
8289
8295
|
// packages/tooling/src/utils/create-utils.ts
|
|
8290
8296
|
init_utils();
|
|
8291
|
-
init_pathResolver();
|
|
8292
8297
|
init_cli_output();
|
|
8298
|
+
init_pathResolver();
|
|
8293
8299
|
async function isTextFile(filePath) {
|
|
8294
8300
|
const binaryExtensions = [
|
|
8295
8301
|
".png",
|
|
@@ -8635,7 +8641,7 @@ function generateScripts(templateName, options) {
|
|
|
8635
8641
|
const scripts = {};
|
|
8636
8642
|
if (templateName.includes("vite")) {
|
|
8637
8643
|
scripts.dev = "vite";
|
|
8638
|
-
scripts.build = "
|
|
8644
|
+
scripts.build = "vite build";
|
|
8639
8645
|
scripts.preview = "vite preview";
|
|
8640
8646
|
scripts.lint = "eslint src/";
|
|
8641
8647
|
scripts["type-check"] = "tsc --noEmit";
|
|
@@ -8671,7 +8677,9 @@ function generateScripts(templateName, options) {
|
|
|
8671
8677
|
function generatePackageJson(templateName, mode, options = {}) {
|
|
8672
8678
|
const matrixResult = loadMatrix(mode);
|
|
8673
8679
|
if (!matrixResult) {
|
|
8674
|
-
throw new Error(
|
|
8680
|
+
throw new Error(
|
|
8681
|
+
"dependencies-matrix.json not found. This command requires the matrix file."
|
|
8682
|
+
);
|
|
8675
8683
|
}
|
|
8676
8684
|
const { matrix, cliVersion } = matrixResult;
|
|
8677
8685
|
const template = matrix.templateMapping?.[templateName];
|
|
@@ -8731,6 +8739,11 @@ function generatePackageJson(templateName, mode, options = {}) {
|
|
|
8731
8739
|
result.main = "./index.ts";
|
|
8732
8740
|
result.types = "./index.ts";
|
|
8733
8741
|
}
|
|
8742
|
+
if (templateName.includes("vite") || templateName.includes("nextjs") || templateName.includes("functions")) {
|
|
8743
|
+
if (!dependencies.entities) {
|
|
8744
|
+
dependencies.entities = "workspace:*";
|
|
8745
|
+
}
|
|
8746
|
+
}
|
|
8734
8747
|
if (templateName.includes("functions")) {
|
|
8735
8748
|
result.engines = { node: "20" };
|
|
8736
8749
|
if (options.appName) {
|
|
@@ -8853,7 +8866,8 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8853
8866
|
firebaseProjectId: appName.toLowerCase(),
|
|
8854
8867
|
firebaseSecretName: appName.toUpperCase().replace(/-/g, "_"),
|
|
8855
8868
|
monorepoRelativePath: "../../packages/tooling",
|
|
8856
|
-
appTemplate
|
|
8869
|
+
appTemplate,
|
|
8870
|
+
isNextjs: appTemplate === "nextjs"
|
|
8857
8871
|
};
|
|
8858
8872
|
const templateSourceDir = joinPath(templatesRoot, templateDir);
|
|
8859
8873
|
const templateFiles = await glob("**/*", {
|
|
@@ -8946,7 +8960,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8946
8960
|
await replacePlaceholders(firebaseJsonDest, replacements);
|
|
8947
8961
|
}
|
|
8948
8962
|
}
|
|
8949
|
-
if (appConfig.needsBackend && appConfig.backendPlatform === "vercel") {
|
|
8963
|
+
if (appTemplate === "nextjs" || appConfig.needsBackend && appConfig.backendPlatform === "vercel") {
|
|
8950
8964
|
const vercelJsonSource = joinPath(
|
|
8951
8965
|
deploymentTemplateDir,
|
|
8952
8966
|
"vercel.json.example"
|
|
@@ -8983,9 +8997,37 @@ Happy coding!`,
|
|
|
8983
8997
|
);
|
|
8984
8998
|
}
|
|
8985
8999
|
}
|
|
8986
|
-
async function main() {
|
|
9000
|
+
async function main(options) {
|
|
8987
9001
|
try {
|
|
8988
|
-
|
|
9002
|
+
const hasCliOptions = options?.name || options?.builder !== void 0;
|
|
9003
|
+
if (hasCliOptions && options?.name) {
|
|
9004
|
+
const appName = options.name;
|
|
9005
|
+
const builder = options.builder || "vite";
|
|
9006
|
+
const includeFunctions = options.functions ?? false;
|
|
9007
|
+
if (!isValidFileName(appName)) {
|
|
9008
|
+
throw new Error(
|
|
9009
|
+
`Invalid app name "${appName}". Use only letters, numbers, dashes (-), and underscores (_).`
|
|
9010
|
+
);
|
|
9011
|
+
}
|
|
9012
|
+
if (isReservedAppName(appName)) {
|
|
9013
|
+
throw new Error(
|
|
9014
|
+
`App name "${appName}" is reserved for framework demos. Please choose a different name.`
|
|
9015
|
+
);
|
|
9016
|
+
}
|
|
9017
|
+
const appConfig = {
|
|
9018
|
+
template: builder === "next" ? "nextjs" : "vite",
|
|
9019
|
+
needsBackend: includeFunctions,
|
|
9020
|
+
backendPlatform: includeFunctions ? "firebase" : void 0,
|
|
9021
|
+
needsCRUD: true,
|
|
9022
|
+
selectedEntities: [],
|
|
9023
|
+
userAuth: "social",
|
|
9024
|
+
billing: true,
|
|
9025
|
+
features: []
|
|
9026
|
+
};
|
|
9027
|
+
await createApp(appName, appConfig);
|
|
9028
|
+
} else {
|
|
9029
|
+
await createApp();
|
|
9030
|
+
}
|
|
8989
9031
|
} catch (error2) {
|
|
8990
9032
|
log.error("\n\u274C Error creating app:", error2);
|
|
8991
9033
|
throw error2;
|