@donotdev/cli 0.0.19 → 0.0.20
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 +135 -47
- package/dist/bin/commands/bump.js +5 -2
- package/dist/bin/commands/create-app.js +1 -1
- package/dist/bin/commands/create-project.js +13 -2
- package/dist/bin/commands/deploy.js +18 -0
- package/dist/bin/commands/setup.js +3 -0
- package/dist/bin/commands/staging.js +18 -0
- package/dist/bin/commands/type-check.js +10 -4
- package/dist/bin/dndev.js +120 -179
- package/dist/bin/donotdev.js +120 -179
- package/dist/index.js +31 -2
- package/package.json +1 -1
- package/templates/app-demo/public/apple-touch-icon.png.example +0 -0
- package/templates/app-demo/public/favicon.svg.example +1 -0
- package/templates/app-demo/public/icon-192x192.png.example +0 -0
- package/templates/app-demo/public/icon-512x512.png.example +0 -0
- package/templates/app-demo/src/App.tsx.example +3 -1
- package/templates/app-demo/src/config/app.ts.example +1 -0
- package/templates/app-demo/src/entities/booking.ts.example +75 -0
- package/templates/app-demo/src/entities/onboarding.ts.example +160 -0
- package/templates/app-demo/src/entities/product.ts.example +12 -0
- package/templates/app-demo/src/entities/quote.ts.example +70 -0
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +28 -1
- package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +88 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +2 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +355 -2
- package/templates/app-demo/src/pages/OnboardingPage.tsx.example +47 -0
- package/templates/app-demo/src/pages/PricingPage.tsx.example +28 -1
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +2 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +2 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +2 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +22 -16
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +3 -1
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +147 -51
- package/templates/app-demo/src/pages/components/ComponentsData.tsx.example +103 -21
- package/templates/app-demo/src/pages/components/componentConfig.ts.example +139 -59
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +12 -1
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +10 -1
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +10 -1
- package/templates/app-demo/src/themes.css.example +289 -77
- package/templates/app-demo/stats.html.example +4949 -0
- package/templates/app-next/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +252 -252
- package/templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example +174 -174
package/dist/bin/dndev.js
CHANGED
|
@@ -753,11 +753,47 @@ var init_command_registry = __esm({
|
|
|
753
753
|
// packages/cli/src/bin/dndev.mjs
|
|
754
754
|
init_utils();
|
|
755
755
|
init_command_registry();
|
|
756
|
-
import { readFileSync } from "node:fs";
|
|
757
756
|
import { Command } from "commander";
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
)
|
|
757
|
+
|
|
758
|
+
// packages/tooling/src/cli/entry-helpers.ts
|
|
759
|
+
init_utils();
|
|
760
|
+
function baseName2(commanderName) {
|
|
761
|
+
return commanderName.split(" ")[0] ?? commanderName;
|
|
762
|
+
}
|
|
763
|
+
function extractCommonOptions(commanderOptions) {
|
|
764
|
+
const quiet = process.env.QUIET === "true" || process.env.QUIET === "1" || commanderOptions.quiet || false;
|
|
765
|
+
const debug = process.env.DEBUG === "true" || process.env.DEBUG === "1" || commanderOptions.debug || false;
|
|
766
|
+
const verbose = !debug && (process.env.VERBOSE === "true" || process.env.VERBOSE === "1" || commanderOptions.verbose || false);
|
|
767
|
+
const dryRun = process.env.DRY_RUN === "true" || process.env.DRY_RUN === "1" || commanderOptions.dryRun || commanderOptions.dry || false;
|
|
768
|
+
return { dryRun, quiet, verbose, debug };
|
|
769
|
+
}
|
|
770
|
+
function addCommonOptions(cmd) {
|
|
771
|
+
cmd.option("--dry, --dry-run", "Preview changes without applying").option("--verbose", "Verbose output").option("--debug", "Debug output").option("-q, --quiet", "Quiet output (errors only)");
|
|
772
|
+
}
|
|
773
|
+
function registerCommand(program2, def, action) {
|
|
774
|
+
const cmd = program2.command(def.name);
|
|
775
|
+
if (def.alias) {
|
|
776
|
+
const aliases = Array.isArray(def.alias) ? def.alias : [def.alias];
|
|
777
|
+
for (const a of aliases) cmd.alias(a);
|
|
778
|
+
}
|
|
779
|
+
cmd.description(def.description);
|
|
780
|
+
if (def.options) {
|
|
781
|
+
for (const opt of def.options) {
|
|
782
|
+
cmd.option(opt.flags, opt.description);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
addCommonOptions(cmd);
|
|
786
|
+
cmd.action(async (...commanderArgs) => {
|
|
787
|
+
const commanderOptions = commanderArgs[commanderArgs.length - 2];
|
|
788
|
+
const positionalArgs = commanderArgs.slice(0, -2);
|
|
789
|
+
const commonOptions = extractCommonOptions(commanderOptions);
|
|
790
|
+
const parsedOptions = { ...commonOptions, ...commanderOptions };
|
|
791
|
+
await action(parsedOptions, ...positionalArgs);
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// packages/cli/src/bin/dndev.mjs
|
|
796
|
+
var CLI_VERSION = true ? "0.0.20" : "0.0.0";
|
|
761
797
|
var args = process.argv.slice(2);
|
|
762
798
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
|
|
763
799
|
console.log(CLI_VERSION);
|
|
@@ -772,214 +808,119 @@ if (args.length === 0 || args.length === 1 && (args[0] === "--help" || args[0] =
|
|
|
772
808
|
}
|
|
773
809
|
var program = new Command();
|
|
774
810
|
program.name("dndev").description("DoNotDev Framework CLI").version(CLI_VERSION, "-v, --version", "display version number").usage("<command>[:<app>] [options]").helpCommand("help [command]", "display help for command");
|
|
775
|
-
function
|
|
776
|
-
const quiet = process.env.QUIET === "true" || process.env.QUIET === "1" || commanderOptions.quiet || false;
|
|
777
|
-
const debug = process.env.DEBUG === "true" || process.env.DEBUG === "1" || commanderOptions.debug || false;
|
|
778
|
-
const verbose = !debug && (process.env.VERBOSE === "true" || process.env.VERBOSE === "1" || commanderOptions.verbose || false);
|
|
779
|
-
const dryRun = process.env.DRY_RUN === "true" || process.env.DRY_RUN === "1" || commanderOptions.dryRun || false;
|
|
780
|
-
return { dryRun, quiet, verbose, debug };
|
|
781
|
-
}
|
|
782
|
-
function addCommonOptions(cmd) {
|
|
783
|
-
cmd.option("-d, --dry-run", "Preview changes without applying").option("--verbose", "Verbose output").option("--debug", "Debug output").option("-q, --quiet", "Quiet output (errors only)");
|
|
784
|
-
}
|
|
785
|
-
async function runAppCommand(commandPath, app) {
|
|
811
|
+
async function runAppCommand(commandPath, app, commonOptions) {
|
|
786
812
|
const savedArgv = process.argv;
|
|
787
813
|
process.argv = app ? [savedArgv[0], savedArgv[1], app] : [savedArgv[0], savedArgv[1]];
|
|
788
814
|
try {
|
|
789
815
|
const { main } = await import(commandPath);
|
|
790
|
-
process.
|
|
816
|
+
process.exitCode = await main(commonOptions);
|
|
817
|
+
} catch (error) {
|
|
818
|
+
console.error(`Command failed: ${error.message}`);
|
|
819
|
+
process.exitCode = error.context?.exitCode || 1;
|
|
791
820
|
} finally {
|
|
792
821
|
process.argv = savedArgv;
|
|
793
822
|
}
|
|
794
823
|
}
|
|
795
|
-
function
|
|
796
|
-
return
|
|
824
|
+
function makeStandardAction(commandPath) {
|
|
825
|
+
return async (options, ...positionalArgs) => {
|
|
826
|
+
try {
|
|
827
|
+
const { main } = await import(commandPath);
|
|
828
|
+
await main(options, ...positionalArgs);
|
|
829
|
+
} catch (error) {
|
|
830
|
+
console.error(`Command failed: ${error.message}`);
|
|
831
|
+
process.exitCode = error.context?.exitCode || 1;
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
function makeAppAction(commandPath) {
|
|
836
|
+
return async (options, app) => {
|
|
837
|
+
await runAppCommand(commandPath, app, extractCommonOptions(options));
|
|
838
|
+
};
|
|
797
839
|
}
|
|
798
840
|
var ACTION_OVERRIDES = {
|
|
799
|
-
"create-app": (
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
functions: options.functions,
|
|
811
|
-
backend: options.backend,
|
|
812
|
-
firebaseProjectId: options.project,
|
|
813
|
-
firebaseRegion: options.region
|
|
814
|
-
});
|
|
815
|
-
} else {
|
|
816
|
-
await main();
|
|
817
|
-
}
|
|
818
|
-
});
|
|
819
|
-
},
|
|
820
|
-
"format": (cmd) => {
|
|
821
|
-
cmd.action(async (commanderOptions) => {
|
|
822
|
-
const commonOptions = extractCommonOptions(commanderOptions);
|
|
823
|
-
const options = { ...commonOptions, ...commanderOptions };
|
|
824
|
-
try {
|
|
825
|
-
const { main } = await import("./commands/format.js");
|
|
826
|
-
process.exitCode = await main(options);
|
|
827
|
-
} catch (error) {
|
|
828
|
-
if (error.code === "invalid-argument" || error.name === "DoNotDevError") {
|
|
829
|
-
process.exit(error.context?.exitCode || 1);
|
|
830
|
-
}
|
|
831
|
-
throw error;
|
|
832
|
-
}
|
|
833
|
-
});
|
|
834
|
-
},
|
|
835
|
-
"type-check": (cmd) => {
|
|
836
|
-
cmd.action(async (app, commanderOptions) => {
|
|
837
|
-
const commonOptions = extractCommonOptions(commanderOptions);
|
|
838
|
-
const options = { ...commonOptions, package: app };
|
|
839
|
-
try {
|
|
840
|
-
const { main } = await import("./commands/type-check.js");
|
|
841
|
-
process.exit(await main(options));
|
|
842
|
-
} catch (error) {
|
|
843
|
-
if (error.code === "invalid-argument" || error.name === "DoNotDevError") {
|
|
844
|
-
process.exit(error.context?.exitCode || 1);
|
|
845
|
-
}
|
|
846
|
-
throw error;
|
|
847
|
-
}
|
|
848
|
-
});
|
|
841
|
+
"create-app": async (options, name) => {
|
|
842
|
+
const appName = name || options.name;
|
|
843
|
+
const { main } = await import("./commands/create-app.js");
|
|
844
|
+
if (appName) {
|
|
845
|
+
await main({
|
|
846
|
+
...options,
|
|
847
|
+
name: appName
|
|
848
|
+
});
|
|
849
|
+
} else {
|
|
850
|
+
await main(options);
|
|
851
|
+
}
|
|
849
852
|
},
|
|
850
|
-
"
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
const options = { ...commonOptions, ...commanderOptions };
|
|
854
|
-
if (app) options.app = app;
|
|
855
|
-
const { main } = await import("./commands/cacheout.js");
|
|
856
|
-
process.exitCode = await main(options);
|
|
857
|
-
});
|
|
853
|
+
"type-check": async (options, app) => {
|
|
854
|
+
const { main } = await import("./commands/type-check.js");
|
|
855
|
+
process.exitCode = await main({ ...options, package: app });
|
|
858
856
|
},
|
|
859
|
-
"
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
try {
|
|
864
|
-
const { main } = await import("./commands/bump.js");
|
|
865
|
-
process.exitCode = await main(options);
|
|
866
|
-
} catch (error) {
|
|
867
|
-
if (error.code === "invalid-argument" || error.name === "DoNotDevError") {
|
|
868
|
-
process.exit(error.context?.exitCode || 1);
|
|
869
|
-
}
|
|
870
|
-
throw error;
|
|
871
|
-
}
|
|
872
|
-
});
|
|
857
|
+
"cacheout": async (options, app) => {
|
|
858
|
+
if (app) options.app = app;
|
|
859
|
+
const { main } = await import("./commands/cacheout.js");
|
|
860
|
+
process.exitCode = await main(options);
|
|
873
861
|
},
|
|
874
|
-
"staging": (
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
const options = { ...commonOptions, ...commanderOptions, app, staging: true };
|
|
878
|
-
const { main } = await import("./commands/deploy.js");
|
|
879
|
-
await main(options);
|
|
880
|
-
});
|
|
862
|
+
"staging": async (options, app) => {
|
|
863
|
+
const { main } = await import("./commands/deploy.js");
|
|
864
|
+
await main({ ...options, app, staging: true });
|
|
881
865
|
},
|
|
882
|
-
"deploy": (
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
const options = { ...commonOptions, ...commanderOptions, app };
|
|
886
|
-
const { main } = await import("./commands/deploy.js");
|
|
887
|
-
await main(options);
|
|
888
|
-
});
|
|
866
|
+
"deploy": async (options, app) => {
|
|
867
|
+
const { main } = await import("./commands/deploy.js");
|
|
868
|
+
await main({ ...options, app });
|
|
889
869
|
},
|
|
890
|
-
"sync-secrets": (
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
if (options.project) options.projectId = options.project;
|
|
895
|
-
const { main } = await import("./commands/sync-secrets.js");
|
|
896
|
-
process.exitCode = await main(options);
|
|
897
|
-
});
|
|
870
|
+
"sync-secrets": async (options) => {
|
|
871
|
+
if (options.project) options.projectId = options.project;
|
|
872
|
+
const { main } = await import("./commands/sync-secrets.js");
|
|
873
|
+
process.exitCode = await main(options);
|
|
898
874
|
},
|
|
899
|
-
"make-admin": (
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
875
|
+
"make-admin": async (options, userId) => {
|
|
876
|
+
const args2 = [];
|
|
877
|
+
if (userId) args2.push(userId);
|
|
878
|
+
if (options.project) args2.push(`--project=${options.project}`);
|
|
879
|
+
if (options.projectId) args2.push(`--project-id=${options.projectId}`);
|
|
880
|
+
if (options.super) args2.push("--super");
|
|
881
|
+
if (options.dryRun) args2.push("--dry-run");
|
|
882
|
+
if (options.verbose) args2.push("--verbose");
|
|
883
|
+
if (options.debug) args2.push("--debug");
|
|
884
|
+
try {
|
|
906
885
|
const { main } = await import("./commands/make-admin.js");
|
|
907
886
|
await main(args2);
|
|
908
|
-
})
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
const commonOptions = extractCommonOptions(commanderOptions);
|
|
913
|
-
const { main } = await import("./commands/coach.js");
|
|
914
|
-
process.exitCode = await main(commonOptions);
|
|
915
|
-
});
|
|
887
|
+
} catch (error) {
|
|
888
|
+
console.error(`make-admin failed: ${error.message}`);
|
|
889
|
+
process.exitCode = error.context?.exitCode || 1;
|
|
890
|
+
}
|
|
916
891
|
},
|
|
917
|
-
"setup": (
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
const options = { ...commonOptions, provider };
|
|
921
|
-
const { main } = await import("./commands/setup.js");
|
|
922
|
-
process.exitCode = await main(options);
|
|
923
|
-
});
|
|
892
|
+
"setup": async (options, provider) => {
|
|
893
|
+
const { main } = await import("./commands/setup.js");
|
|
894
|
+
process.exitCode = await main({ ...options, provider });
|
|
924
895
|
},
|
|
925
|
-
"doctor": (
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
const options = { ...commonOptions, check: commanderOptions.check };
|
|
929
|
-
const { main } = await import("./commands/doctor.js");
|
|
930
|
-
process.exit(await main(options));
|
|
931
|
-
});
|
|
896
|
+
"doctor": async (options) => {
|
|
897
|
+
const { main } = await import("./commands/doctor.js");
|
|
898
|
+
process.exitCode = await main({ ...options, check: options.check });
|
|
932
899
|
},
|
|
933
|
-
"
|
|
934
|
-
|
|
935
|
-
|
|
900
|
+
"wai": async () => {
|
|
901
|
+
const { main } = await import("./commands/wai.js");
|
|
902
|
+
process.exitCode = await main();
|
|
936
903
|
},
|
|
937
|
-
"
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
process.exit(await main());
|
|
941
|
-
});
|
|
904
|
+
"agent:setup": async (options) => {
|
|
905
|
+
const { main } = await import("./commands/agent-setup.js");
|
|
906
|
+
await main(options);
|
|
942
907
|
}
|
|
943
908
|
};
|
|
944
|
-
|
|
945
|
-
for (const def of publicCommands) {
|
|
909
|
+
for (const def of getPublicCommands()) {
|
|
946
910
|
const cmdName = baseName2(def.name);
|
|
947
911
|
const wrapperFile = def.wrapperFile ?? cmdName;
|
|
948
912
|
const commandPath = `./commands/${wrapperFile}.js`;
|
|
949
|
-
const cmd = program.command(def.name);
|
|
950
|
-
if (def.alias) {
|
|
951
|
-
const aliases = Array.isArray(def.alias) ? def.alias : [def.alias];
|
|
952
|
-
for (const a of aliases) cmd.alias(a);
|
|
953
|
-
}
|
|
954
|
-
cmd.description(def.description);
|
|
955
|
-
if (def.options) {
|
|
956
|
-
for (const opt of def.options) {
|
|
957
|
-
cmd.option(opt.flags, opt.description);
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
addCommonOptions(cmd);
|
|
961
913
|
const override = ACTION_OVERRIDES[def.name] ?? ACTION_OVERRIDES[cmdName];
|
|
914
|
+
let action;
|
|
962
915
|
if (override) {
|
|
963
|
-
|
|
964
|
-
if (result === "skip") continue;
|
|
916
|
+
action = override;
|
|
965
917
|
} else if (def.actionPattern === "app") {
|
|
966
|
-
|
|
918
|
+
action = makeAppAction(commandPath);
|
|
967
919
|
} else {
|
|
968
|
-
|
|
969
|
-
const commanderOptions = commanderArgs[commanderArgs.length - 2];
|
|
970
|
-
const positionalArgs = commanderArgs.slice(0, -2);
|
|
971
|
-
const commonOptions = extractCommonOptions(commanderOptions);
|
|
972
|
-
const options = { ...commonOptions, ...commanderOptions };
|
|
973
|
-
const { main } = await import(commandPath);
|
|
974
|
-
await main(options, ...positionalArgs);
|
|
975
|
-
});
|
|
920
|
+
action = makeStandardAction(commandPath);
|
|
976
921
|
}
|
|
922
|
+
registerCommand(program, def, action);
|
|
977
923
|
}
|
|
978
|
-
program.command("agent").alias("agent:setup").description("Configure MCP server for all AI agents (Cursor, Claude Code, Gemini, Claude Desktop)").option("-d, --dry-run", "Preview changes without applying").action(async (commanderOptions) => {
|
|
979
|
-
const options = extractCommonOptions(commanderOptions);
|
|
980
|
-
const { main } = await import("./commands/agent-setup.js");
|
|
981
|
-
await main(options);
|
|
982
|
-
});
|
|
983
924
|
function preprocessArgs(rawArgs) {
|
|
984
925
|
if (rawArgs.length === 0) return rawArgs;
|
|
985
926
|
const firstArg = rawArgs[0];
|