@donotdev/cli 0.0.7 → 0.0.9
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/README.md +3 -18
- package/dependencies-matrix.json +54 -45
- package/dist/bin/commands/build.js +19 -5
- package/dist/bin/commands/bump.js +30 -5
- package/dist/bin/commands/cacheout.js +36 -19
- package/dist/bin/commands/create-app.js +73 -7
- package/dist/bin/commands/create-project.js +90 -8
- package/dist/bin/commands/deploy.js +130 -27
- package/dist/bin/commands/dev.js +23 -7
- package/dist/bin/commands/emu.js +28 -12
- package/dist/bin/commands/format.js +39 -22
- package/dist/bin/commands/lint.js +36 -19
- package/dist/bin/commands/preview.js +24 -8
- package/dist/bin/commands/sync-secrets.js +19 -5
- package/dist/bin/dndev.js +7 -20
- package/dist/bin/donotdev.js +7 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +209 -100
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/templates/app-next/src/config/app.ts.example +1 -1
- package/templates/app-vite/index.html.example +24 -2
- package/templates/app-vite/src/config/app.ts.example +1 -1
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +8 -5
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +4 -7
- package/templates/root-consumer/.firebaserc.example +5 -0
- package/templates/root-consumer/entities/ExampleEntity.ts.example +2 -1
- package/templates/root-consumer/entities/demo.ts.example +15 -1
- package/templates/root-consumer/eslint.config.js.example +2 -80
- package/templates/root-consumer/firestore.indexes.json.example +4 -0
- package/templates/root-consumer/firestore.rules.example +11 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +9 -6
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +376 -38
- package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +46 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +1 -1
- package/templates/root-consumer/storage.rules.example +8 -0
|
@@ -797,6 +797,7 @@ ${import_picocolors2.default.gray(d2)} ${t}
|
|
|
797
797
|
});
|
|
798
798
|
|
|
799
799
|
// packages/tooling/src/utils/cli-output.ts
|
|
800
|
+
import "node:os";
|
|
800
801
|
function supportsColor() {
|
|
801
802
|
if (process.env.NO_COLOR) return false;
|
|
802
803
|
if (process.platform === "win32") {
|
|
@@ -6584,7 +6585,16 @@ var init_constants = __esm({
|
|
|
6584
6585
|
},
|
|
6585
6586
|
i18n: {
|
|
6586
6587
|
eager: ["src/locales/*_*.json"],
|
|
6587
|
-
lazy: [
|
|
6588
|
+
lazy: [
|
|
6589
|
+
"src/**/locales/*_*.json",
|
|
6590
|
+
"!src/locales/*_*.json",
|
|
6591
|
+
// Auto-detect shared entity translations in monorepos (if exists, use it; if not, no problem)
|
|
6592
|
+
"../../entities/locales/*_*.json"
|
|
6593
|
+
],
|
|
6594
|
+
// Additional paths from workspace packages (e.g., shared entities)
|
|
6595
|
+
// Consumers can still configure via i18n.additionalPaths in dndev/vite config for custom paths
|
|
6596
|
+
// Example: ['../../packages/shared/locales/*_*.json']
|
|
6597
|
+
additional: [],
|
|
6588
6598
|
framework: {
|
|
6589
6599
|
eager: [`${I18N_PATHS.SOURCE_EAGER}/*_*.json`],
|
|
6590
6600
|
lazy: [`${I18N_PATHS.SOURCE_LAZY}/*_*.json`]
|
|
@@ -6677,6 +6687,7 @@ var init_constants = __esm({
|
|
|
6677
6687
|
|
|
6678
6688
|
// packages/core/config/utils/PathResolver.ts
|
|
6679
6689
|
import * as fs from "node:fs";
|
|
6690
|
+
import "node:fs";
|
|
6680
6691
|
import { createRequire } from "node:module";
|
|
6681
6692
|
import {
|
|
6682
6693
|
resolve,
|
|
@@ -7789,6 +7800,7 @@ var init_errors = __esm({
|
|
|
7789
7800
|
});
|
|
7790
7801
|
|
|
7791
7802
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7803
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
7792
7804
|
import {
|
|
7793
7805
|
join as join2,
|
|
7794
7806
|
dirname as dirname2,
|
|
@@ -7798,6 +7810,7 @@ import {
|
|
|
7798
7810
|
resolve as resolve2,
|
|
7799
7811
|
isAbsolute as pathIsAbsolute
|
|
7800
7812
|
} from "node:path";
|
|
7813
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7801
7814
|
function readdirSync2(dirPath, options) {
|
|
7802
7815
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
7803
7816
|
}
|
|
@@ -7826,16 +7839,17 @@ var init_pathResolver = __esm({
|
|
|
7826
7839
|
|
|
7827
7840
|
// packages/tooling/src/bundler/utils.ts
|
|
7828
7841
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
7829
|
-
import {
|
|
7842
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7843
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
7830
7844
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
7831
7845
|
import process from "node:process";
|
|
7832
|
-
import { fileURLToPath as
|
|
7846
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7833
7847
|
var require2, __filename, __dirname;
|
|
7834
7848
|
var init_utils = __esm({
|
|
7835
7849
|
"packages/tooling/src/bundler/utils.ts"() {
|
|
7836
7850
|
"use strict";
|
|
7837
|
-
require2 =
|
|
7838
|
-
__filename =
|
|
7851
|
+
require2 = createRequire3(import.meta.url);
|
|
7852
|
+
__filename = fileURLToPath3(import.meta.url);
|
|
7839
7853
|
__dirname = dirname3(__filename);
|
|
7840
7854
|
if (typeof globalThis !== "undefined") {
|
|
7841
7855
|
globalThis.require = require2;
|
|
@@ -7946,8 +7960,10 @@ function executeFirebaseCommand(args, options) {
|
|
|
7946
7960
|
errorOutput
|
|
7947
7961
|
};
|
|
7948
7962
|
}
|
|
7949
|
-
function buildFirebaseDeployArgs(
|
|
7950
|
-
const
|
|
7963
|
+
function buildFirebaseDeployArgs(deployTargets, projectId, debug, force) {
|
|
7964
|
+
const targets = Array.isArray(deployTargets) ? deployTargets : [deployTargets];
|
|
7965
|
+
const targetString = targets.join(",");
|
|
7966
|
+
const args = ["deploy", "--only", targetString, "--non-interactive"];
|
|
7951
7967
|
if (projectId) {
|
|
7952
7968
|
args.push("--project", projectId);
|
|
7953
7969
|
}
|
|
@@ -8509,6 +8525,47 @@ To fix this, run:
|
|
|
8509
8525
|
}
|
|
8510
8526
|
}
|
|
8511
8527
|
|
|
8528
|
+
// packages/tooling/src/apps/deploy-rules.ts
|
|
8529
|
+
init_utils();
|
|
8530
|
+
async function deployRules(appDir, serviceAccountPath, projectId, config, options) {
|
|
8531
|
+
const targets = [];
|
|
8532
|
+
if (options.firestore) {
|
|
8533
|
+
targets.push("firestore:rules");
|
|
8534
|
+
}
|
|
8535
|
+
if (options.firestoreIndexes) {
|
|
8536
|
+
targets.push("firestore:indexes");
|
|
8537
|
+
}
|
|
8538
|
+
if (options.storage) {
|
|
8539
|
+
targets.push("storage");
|
|
8540
|
+
}
|
|
8541
|
+
if (targets.length === 0) {
|
|
8542
|
+
return;
|
|
8543
|
+
}
|
|
8544
|
+
const targetNames = targets.join(", ");
|
|
8545
|
+
const s = Y2();
|
|
8546
|
+
s.start(`Deploying ${targetNames}...`);
|
|
8547
|
+
const args = buildFirebaseDeployArgs(targets, projectId, config.debug);
|
|
8548
|
+
const result = executeFirebaseCommand(args, {
|
|
8549
|
+
cwd: appDir,
|
|
8550
|
+
serviceAccountPath,
|
|
8551
|
+
projectId,
|
|
8552
|
+
debug: config.debug
|
|
8553
|
+
});
|
|
8554
|
+
if (result.error) {
|
|
8555
|
+
s.stop("Rules deployment failed");
|
|
8556
|
+
throw result.error;
|
|
8557
|
+
}
|
|
8558
|
+
if (!result.success) {
|
|
8559
|
+
s.stop("Rules deployment failed");
|
|
8560
|
+
handleDeploymentFailure(
|
|
8561
|
+
result,
|
|
8562
|
+
`firebase ${args.join(" ")}`,
|
|
8563
|
+
serviceAccountPath
|
|
8564
|
+
);
|
|
8565
|
+
}
|
|
8566
|
+
s.stop(`${targetNames} deployed successfully`);
|
|
8567
|
+
}
|
|
8568
|
+
|
|
8512
8569
|
// packages/tooling/src/apps/deploy-utils.ts
|
|
8513
8570
|
init_utils();
|
|
8514
8571
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
@@ -8629,6 +8686,9 @@ function validateFirebaseJson(appDir) {
|
|
|
8629
8686
|
valid: false,
|
|
8630
8687
|
hasHosting: false,
|
|
8631
8688
|
hasFunctions: false,
|
|
8689
|
+
hasFirestoreRules: false,
|
|
8690
|
+
hasFirestoreIndexes: false,
|
|
8691
|
+
hasStorageRules: false,
|
|
8632
8692
|
errors: [`firebase.json not found at: ${firebaseJsonPath}`]
|
|
8633
8693
|
};
|
|
8634
8694
|
}
|
|
@@ -8641,11 +8701,17 @@ function validateFirebaseJson(appDir) {
|
|
|
8641
8701
|
}
|
|
8642
8702
|
const hasHosting = !!config.hosting;
|
|
8643
8703
|
const hasFunctions = !!config.functions && Array.isArray(config.functions);
|
|
8704
|
+
const hasFirestoreRules = !!config.firestore?.rules && pathExists(joinPath(appDir, config.firestore.rules));
|
|
8705
|
+
const hasFirestoreIndexes = !!config.firestore?.indexes && pathExists(joinPath(appDir, config.firestore.indexes));
|
|
8706
|
+
const hasStorageRules = !!config.storage?.rules && pathExists(joinPath(appDir, config.storage.rules));
|
|
8644
8707
|
return {
|
|
8645
8708
|
valid: true,
|
|
8646
8709
|
projectId: config.projectId,
|
|
8647
8710
|
hasHosting,
|
|
8648
8711
|
hasFunctions,
|
|
8712
|
+
hasFirestoreRules,
|
|
8713
|
+
hasFirestoreIndexes,
|
|
8714
|
+
hasStorageRules,
|
|
8649
8715
|
errors: []
|
|
8650
8716
|
};
|
|
8651
8717
|
} catch (error2) {
|
|
@@ -8653,6 +8719,9 @@ function validateFirebaseJson(appDir) {
|
|
|
8653
8719
|
valid: false,
|
|
8654
8720
|
hasHosting: false,
|
|
8655
8721
|
hasFunctions: false,
|
|
8722
|
+
hasFirestoreRules: false,
|
|
8723
|
+
hasFirestoreIndexes: false,
|
|
8724
|
+
hasStorageRules: false,
|
|
8656
8725
|
errors: [
|
|
8657
8726
|
`Invalid JSON format: ${error2 instanceof DoNotDevError ? error2.message : error2 instanceof Error ? error2.message : String(error2)}`
|
|
8658
8727
|
]
|
|
@@ -8817,16 +8886,36 @@ async function main(options = {}) {
|
|
|
8817
8886
|
hint: "Deploy cloud functions"
|
|
8818
8887
|
});
|
|
8819
8888
|
}
|
|
8889
|
+
const hasRules = firebaseConfig2.hasFirestoreRules || firebaseConfig2.hasFirestoreIndexes || firebaseConfig2.hasStorageRules;
|
|
8890
|
+
if (hasRules) {
|
|
8891
|
+
choices.push({
|
|
8892
|
+
title: "Rules only",
|
|
8893
|
+
value: "rules",
|
|
8894
|
+
hint: "Deploy Firestore/Storage rules"
|
|
8895
|
+
});
|
|
8896
|
+
}
|
|
8820
8897
|
if (firebaseConfig2.hasHosting && firebaseConfig2.hasFunctions) {
|
|
8821
8898
|
choices.push({
|
|
8822
|
-
title: "
|
|
8899
|
+
title: "Frontend + Functions",
|
|
8823
8900
|
value: "both",
|
|
8824
|
-
hint: "Deploy
|
|
8901
|
+
hint: "Deploy hosting and functions"
|
|
8902
|
+
});
|
|
8903
|
+
}
|
|
8904
|
+
const deployableKindsCount = [
|
|
8905
|
+
firebaseConfig2.hasHosting,
|
|
8906
|
+
firebaseConfig2.hasFunctions,
|
|
8907
|
+
hasRules
|
|
8908
|
+
].filter(Boolean).length;
|
|
8909
|
+
if (deployableKindsCount > 1) {
|
|
8910
|
+
choices.push({
|
|
8911
|
+
title: "All",
|
|
8912
|
+
value: "all",
|
|
8913
|
+
hint: "Deploy everything (hosting, functions, rules)"
|
|
8825
8914
|
});
|
|
8826
8915
|
}
|
|
8827
8916
|
if (choices.length === 0) {
|
|
8828
8917
|
log.error(
|
|
8829
|
-
"No deployment targets found. firebase.json must have hosting or
|
|
8918
|
+
"No deployment targets found. firebase.json must have hosting, functions, or rules configuration."
|
|
8830
8919
|
);
|
|
8831
8920
|
process.exit(1);
|
|
8832
8921
|
}
|
|
@@ -8871,13 +8960,28 @@ async function main(options = {}) {
|
|
|
8871
8960
|
showFirebaseJsonError(firebaseConfig.errors, appDir, deploymentType);
|
|
8872
8961
|
process.exit(1);
|
|
8873
8962
|
}
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8963
|
+
const shouldDeployFrontend = (deploymentType === "frontend" || deploymentType === "both" || deploymentType === "all") && firebaseConfig.hasHosting;
|
|
8964
|
+
const shouldDeployFunctions = (deploymentType === "functions" || deploymentType === "both" || deploymentType === "all") && firebaseConfig.hasFunctions;
|
|
8965
|
+
const shouldDeployRules = (deploymentType === "rules" || deploymentType === "all") && (firebaseConfig.hasFirestoreRules || firebaseConfig.hasFirestoreIndexes || firebaseConfig.hasStorageRules);
|
|
8966
|
+
if (deploymentType === "frontend" && !firebaseConfig.hasHosting) {
|
|
8967
|
+
log.error(
|
|
8968
|
+
"firebase.json does not contain hosting configuration, but frontend deployment was requested."
|
|
8969
|
+
);
|
|
8970
|
+
process.exit(1);
|
|
8971
|
+
}
|
|
8972
|
+
if (deploymentType === "functions" && !firebaseConfig.hasFunctions) {
|
|
8973
|
+
log.error(
|
|
8974
|
+
"firebase.json does not contain functions configuration, but functions deployment was requested."
|
|
8975
|
+
);
|
|
8976
|
+
process.exit(1);
|
|
8977
|
+
}
|
|
8978
|
+
if (deploymentType === "rules" && !shouldDeployRules) {
|
|
8979
|
+
log.error(
|
|
8980
|
+
"firebase.json does not contain rules configuration, but rules deployment was requested."
|
|
8981
|
+
);
|
|
8982
|
+
process.exit(1);
|
|
8983
|
+
}
|
|
8984
|
+
if (shouldDeployFrontend) {
|
|
8881
8985
|
const buildStatus = validateBuild(appDir);
|
|
8882
8986
|
let shouldBuild = false;
|
|
8883
8987
|
if (!buildStatus.exists || buildStatus.isEmpty) {
|
|
@@ -8920,14 +9024,6 @@ async function main(options = {}) {
|
|
|
8920
9024
|
}
|
|
8921
9025
|
}
|
|
8922
9026
|
}
|
|
8923
|
-
if (deploymentType === "functions" || deploymentType === "both") {
|
|
8924
|
-
if (!firebaseConfig.hasFunctions) {
|
|
8925
|
-
log.error(
|
|
8926
|
-
"firebase.json does not contain functions configuration, but functions deployment was requested."
|
|
8927
|
-
);
|
|
8928
|
-
process.exit(1);
|
|
8929
|
-
}
|
|
8930
|
-
}
|
|
8931
9027
|
clearFirebaseCache(appDir);
|
|
8932
9028
|
Me(
|
|
8933
9029
|
`App: ${appName}
|
|
@@ -8936,10 +9032,10 @@ Deployment: ${deploymentType}
|
|
|
8936
9032
|
Service Account: ${serviceAccountResult.info.clientEmail}`,
|
|
8937
9033
|
"Deployment Configuration"
|
|
8938
9034
|
);
|
|
8939
|
-
if (
|
|
9035
|
+
if (shouldDeployFrontend) {
|
|
8940
9036
|
await deployFrontend(appDir, serviceAccountPath, config.project, config);
|
|
8941
9037
|
}
|
|
8942
|
-
if (
|
|
9038
|
+
if (shouldDeployFunctions) {
|
|
8943
9039
|
await deployFunctions(
|
|
8944
9040
|
appDir,
|
|
8945
9041
|
serviceAccountPath,
|
|
@@ -8947,6 +9043,13 @@ Service Account: ${serviceAccountResult.info.clientEmail}`,
|
|
|
8947
9043
|
config
|
|
8948
9044
|
);
|
|
8949
9045
|
}
|
|
9046
|
+
if (shouldDeployRules) {
|
|
9047
|
+
await deployRules(appDir, serviceAccountPath, config.project, config, {
|
|
9048
|
+
firestore: firebaseConfig.hasFirestoreRules,
|
|
9049
|
+
firestoreIndexes: firebaseConfig.hasFirestoreIndexes,
|
|
9050
|
+
storage: firebaseConfig.hasStorageRules
|
|
9051
|
+
});
|
|
9052
|
+
}
|
|
8950
9053
|
Se("Deployment completed successfully!");
|
|
8951
9054
|
} catch (error2) {
|
|
8952
9055
|
if (error2 instanceof DoNotDevError) {
|
package/dist/bin/commands/dev.js
CHANGED
|
@@ -502,6 +502,7 @@ var init_dist = __esm({
|
|
|
502
502
|
});
|
|
503
503
|
|
|
504
504
|
// node_modules/.bun/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
505
|
+
import { stripVTControlCharacters as S2 } from "node:util";
|
|
505
506
|
import y2 from "node:process";
|
|
506
507
|
function ce() {
|
|
507
508
|
return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -620,6 +621,7 @@ ${import_picocolors.default.cyan(d2)}
|
|
|
620
621
|
});
|
|
621
622
|
|
|
622
623
|
// packages/tooling/src/utils/cli-output.ts
|
|
624
|
+
import "node:os";
|
|
623
625
|
function supportsColor() {
|
|
624
626
|
if (process.env.NO_COLOR) return false;
|
|
625
627
|
if (process.platform === "win32") {
|
|
@@ -6407,7 +6409,16 @@ var init_constants = __esm({
|
|
|
6407
6409
|
},
|
|
6408
6410
|
i18n: {
|
|
6409
6411
|
eager: ["src/locales/*_*.json"],
|
|
6410
|
-
lazy: [
|
|
6412
|
+
lazy: [
|
|
6413
|
+
"src/**/locales/*_*.json",
|
|
6414
|
+
"!src/locales/*_*.json",
|
|
6415
|
+
// Auto-detect shared entity translations in monorepos (if exists, use it; if not, no problem)
|
|
6416
|
+
"../../entities/locales/*_*.json"
|
|
6417
|
+
],
|
|
6418
|
+
// Additional paths from workspace packages (e.g., shared entities)
|
|
6419
|
+
// Consumers can still configure via i18n.additionalPaths in dndev/vite config for custom paths
|
|
6420
|
+
// Example: ['../../packages/shared/locales/*_*.json']
|
|
6421
|
+
additional: [],
|
|
6411
6422
|
framework: {
|
|
6412
6423
|
eager: [`${I18N_PATHS.SOURCE_EAGER}/*_*.json`],
|
|
6413
6424
|
lazy: [`${I18N_PATHS.SOURCE_LAZY}/*_*.json`]
|
|
@@ -6500,6 +6511,7 @@ var init_constants = __esm({
|
|
|
6500
6511
|
|
|
6501
6512
|
// packages/core/config/utils/PathResolver.ts
|
|
6502
6513
|
import * as fs from "node:fs";
|
|
6514
|
+
import "node:fs";
|
|
6503
6515
|
import { createRequire } from "node:module";
|
|
6504
6516
|
import {
|
|
6505
6517
|
resolve,
|
|
@@ -7612,6 +7624,7 @@ var init_errors = __esm({
|
|
|
7612
7624
|
});
|
|
7613
7625
|
|
|
7614
7626
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7627
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
7615
7628
|
import {
|
|
7616
7629
|
join as join2,
|
|
7617
7630
|
dirname as dirname2,
|
|
@@ -7621,6 +7634,7 @@ import {
|
|
|
7621
7634
|
resolve as resolve2,
|
|
7622
7635
|
isAbsolute as pathIsAbsolute
|
|
7623
7636
|
} from "node:path";
|
|
7637
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7624
7638
|
function readdirSync2(dirPath, options) {
|
|
7625
7639
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
7626
7640
|
}
|
|
@@ -7646,16 +7660,17 @@ var init_pathResolver = __esm({
|
|
|
7646
7660
|
|
|
7647
7661
|
// packages/tooling/src/bundler/utils.ts
|
|
7648
7662
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
7649
|
-
import {
|
|
7663
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7664
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
7650
7665
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
7651
7666
|
import process from "node:process";
|
|
7652
|
-
import { fileURLToPath as
|
|
7667
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7653
7668
|
var require2, __filename, __dirname;
|
|
7654
7669
|
var init_utils = __esm({
|
|
7655
7670
|
"packages/tooling/src/bundler/utils.ts"() {
|
|
7656
7671
|
"use strict";
|
|
7657
|
-
require2 =
|
|
7658
|
-
__filename =
|
|
7672
|
+
require2 = createRequire3(import.meta.url);
|
|
7673
|
+
__filename = fileURLToPath3(import.meta.url);
|
|
7659
7674
|
__dirname = dirname3(__filename);
|
|
7660
7675
|
if (typeof globalThis !== "undefined") {
|
|
7661
7676
|
globalThis.require = require2;
|
|
@@ -7806,13 +7821,14 @@ async function selectApp(projectRoot, appName) {
|
|
|
7806
7821
|
|
|
7807
7822
|
// packages/tooling/src/apps/dev.ts
|
|
7808
7823
|
init_utils();
|
|
7809
|
-
import { spawnSync } from "node:child_process";
|
|
7824
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
7810
7825
|
init_cli_output();
|
|
7811
7826
|
init_errors();
|
|
7812
7827
|
init_pathResolver();
|
|
7813
7828
|
|
|
7814
7829
|
// packages/tooling/src/utils/spawn-utils.ts
|
|
7815
7830
|
init_utils();
|
|
7831
|
+
import { spawnSync, execSync } from "node:child_process";
|
|
7816
7832
|
function createAppEnv(appPath) {
|
|
7817
7833
|
return {
|
|
7818
7834
|
...process.env,
|
|
@@ -7838,7 +7854,7 @@ async function main() {
|
|
|
7838
7854
|
log.info(`Starting dev server for ${app.name}...
|
|
7839
7855
|
`);
|
|
7840
7856
|
const turboArgs = ["dev", "--filter", app.packageName];
|
|
7841
|
-
const result =
|
|
7857
|
+
const result = spawnSync2("bunx", ["turbo", ...turboArgs], {
|
|
7842
7858
|
stdio: "inherit",
|
|
7843
7859
|
env: createAppEnv(app.path),
|
|
7844
7860
|
cwd: projectRoot
|
package/dist/bin/commands/emu.js
CHANGED
|
@@ -540,6 +540,7 @@ var init_dist = __esm({
|
|
|
540
540
|
});
|
|
541
541
|
|
|
542
542
|
// node_modules/.bun/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
543
|
+
import { stripVTControlCharacters as S2 } from "node:util";
|
|
543
544
|
import y2 from "node:process";
|
|
544
545
|
function ce() {
|
|
545
546
|
return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -703,6 +704,7 @@ ${import_picocolors.default.cyan(d2)}
|
|
|
703
704
|
});
|
|
704
705
|
|
|
705
706
|
// packages/tooling/src/utils/cli-output.ts
|
|
707
|
+
import "node:os";
|
|
706
708
|
function supportsColor() {
|
|
707
709
|
if (process.env.NO_COLOR) return false;
|
|
708
710
|
if (process.platform === "win32") {
|
|
@@ -6490,7 +6492,16 @@ var init_constants = __esm({
|
|
|
6490
6492
|
},
|
|
6491
6493
|
i18n: {
|
|
6492
6494
|
eager: ["src/locales/*_*.json"],
|
|
6493
|
-
lazy: [
|
|
6495
|
+
lazy: [
|
|
6496
|
+
"src/**/locales/*_*.json",
|
|
6497
|
+
"!src/locales/*_*.json",
|
|
6498
|
+
// Auto-detect shared entity translations in monorepos (if exists, use it; if not, no problem)
|
|
6499
|
+
"../../entities/locales/*_*.json"
|
|
6500
|
+
],
|
|
6501
|
+
// Additional paths from workspace packages (e.g., shared entities)
|
|
6502
|
+
// Consumers can still configure via i18n.additionalPaths in dndev/vite config for custom paths
|
|
6503
|
+
// Example: ['../../packages/shared/locales/*_*.json']
|
|
6504
|
+
additional: [],
|
|
6494
6505
|
framework: {
|
|
6495
6506
|
eager: [`${I18N_PATHS.SOURCE_EAGER}/*_*.json`],
|
|
6496
6507
|
lazy: [`${I18N_PATHS.SOURCE_LAZY}/*_*.json`]
|
|
@@ -6583,6 +6594,7 @@ var init_constants = __esm({
|
|
|
6583
6594
|
|
|
6584
6595
|
// packages/core/config/utils/PathResolver.ts
|
|
6585
6596
|
import * as fs from "node:fs";
|
|
6597
|
+
import "node:fs";
|
|
6586
6598
|
import { createRequire } from "node:module";
|
|
6587
6599
|
import {
|
|
6588
6600
|
resolve,
|
|
@@ -7695,6 +7707,7 @@ var init_errors = __esm({
|
|
|
7695
7707
|
});
|
|
7696
7708
|
|
|
7697
7709
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7710
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
7698
7711
|
import {
|
|
7699
7712
|
join as join2,
|
|
7700
7713
|
dirname as dirname2,
|
|
@@ -7704,6 +7717,7 @@ import {
|
|
|
7704
7717
|
resolve as resolve2,
|
|
7705
7718
|
isAbsolute as pathIsAbsolute
|
|
7706
7719
|
} from "node:path";
|
|
7720
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7707
7721
|
function readdirSync2(dirPath, options) {
|
|
7708
7722
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
7709
7723
|
}
|
|
@@ -7730,16 +7744,17 @@ var init_pathResolver = __esm({
|
|
|
7730
7744
|
|
|
7731
7745
|
// packages/tooling/src/bundler/utils.ts
|
|
7732
7746
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
7733
|
-
import {
|
|
7747
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7748
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
7734
7749
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
7735
7750
|
import process from "node:process";
|
|
7736
|
-
import { fileURLToPath as
|
|
7751
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7737
7752
|
var require2, __filename, __dirname;
|
|
7738
7753
|
var init_utils = __esm({
|
|
7739
7754
|
"packages/tooling/src/bundler/utils.ts"() {
|
|
7740
7755
|
"use strict";
|
|
7741
|
-
require2 =
|
|
7742
|
-
__filename =
|
|
7756
|
+
require2 = createRequire3(import.meta.url);
|
|
7757
|
+
__filename = fileURLToPath3(import.meta.url);
|
|
7743
7758
|
__dirname = dirname3(__filename);
|
|
7744
7759
|
if (typeof globalThis !== "undefined") {
|
|
7745
7760
|
globalThis.require = require2;
|
|
@@ -7912,6 +7927,7 @@ async function askForMultiSelection(message, choices, defaultIndices = []) {
|
|
|
7912
7927
|
|
|
7913
7928
|
// packages/tooling/src/utils/spawn-utils.ts
|
|
7914
7929
|
init_utils();
|
|
7930
|
+
import { spawnSync, execSync } from "node:child_process";
|
|
7915
7931
|
function createAppEnv(appPath) {
|
|
7916
7932
|
return {
|
|
7917
7933
|
...process.env,
|
|
@@ -7953,7 +7969,7 @@ function createEmulatorEnv(appPath, framework = "vite", options) {
|
|
|
7953
7969
|
|
|
7954
7970
|
// packages/tooling/src/apps/emu.ts
|
|
7955
7971
|
init_utils();
|
|
7956
|
-
import { spawnSync, execSync } from "node:child_process";
|
|
7972
|
+
import { spawnSync as spawnSync2, execSync as execSync2 } from "node:child_process";
|
|
7957
7973
|
init_cli_output();
|
|
7958
7974
|
init_errors();
|
|
7959
7975
|
init_pathResolver();
|
|
@@ -7977,7 +7993,7 @@ function killPorts(ports) {
|
|
|
7977
7993
|
for (const port of ports) {
|
|
7978
7994
|
try {
|
|
7979
7995
|
if (isWindows) {
|
|
7980
|
-
const findPort =
|
|
7996
|
+
const findPort = execSync2(`netstat -ano | findstr :${port}`, {
|
|
7981
7997
|
encoding: "utf-8"
|
|
7982
7998
|
});
|
|
7983
7999
|
const lines = findPort.trim().split("\n");
|
|
@@ -7990,18 +8006,18 @@ function killPorts(ports) {
|
|
|
7990
8006
|
}
|
|
7991
8007
|
for (const pid of pids) {
|
|
7992
8008
|
try {
|
|
7993
|
-
|
|
8009
|
+
execSync2(`taskkill /F /PID ${pid}`, { stdio: "ignore" });
|
|
7994
8010
|
log.debug(`Killed process ${pid} on port ${port}`);
|
|
7995
8011
|
} catch {
|
|
7996
8012
|
}
|
|
7997
8013
|
}
|
|
7998
8014
|
} else {
|
|
7999
8015
|
try {
|
|
8000
|
-
const pid =
|
|
8016
|
+
const pid = execSync2(`lsof -ti:${port}`, {
|
|
8001
8017
|
encoding: "utf-8"
|
|
8002
8018
|
}).trim();
|
|
8003
8019
|
if (pid) {
|
|
8004
|
-
|
|
8020
|
+
execSync2(`kill -9 ${pid}`, { stdio: "ignore" });
|
|
8005
8021
|
log.debug(`Killed process ${pid} on port ${port}`);
|
|
8006
8022
|
}
|
|
8007
8023
|
} catch {
|
|
@@ -8167,7 +8183,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
|
|
|
8167
8183
|
}
|
|
8168
8184
|
}
|
|
8169
8185
|
log.info("Building functions...");
|
|
8170
|
-
const buildResult =
|
|
8186
|
+
const buildResult = spawnSync2("bun", ["run", "build"], {
|
|
8171
8187
|
cwd: functionsDir,
|
|
8172
8188
|
stdio: "pipe",
|
|
8173
8189
|
env: createEmulatorEnv(app.path, app.framework, {
|
|
@@ -8245,7 +8261,7 @@ FIREBASE_AUTH_EMULATOR_HOST=${authEmulatorHost}
|
|
|
8245
8261
|
log.info(" stripe trigger checkout.session.completed");
|
|
8246
8262
|
log.info("");
|
|
8247
8263
|
}
|
|
8248
|
-
const result =
|
|
8264
|
+
const result = spawnSync2("bunx", ["concurrently", ...concurrentlyArgs], {
|
|
8249
8265
|
stdio: "inherit",
|
|
8250
8266
|
env: createEmulatorEnv(app.path, app.framework, {
|
|
8251
8267
|
useEmulatorAuth: useAuth,
|