@@ -25,114 +25,108 @@ process.on("SIGTERM", () => {
2525} ) ;
2626
2727export function pages ( yargs : CommonYargsArgv , subHelp : SubHelp ) {
28- return (
29- yargs
30- . command ( subHelp )
31- . command (
32- "dev [directory] [-- command..]" ,
33- "Develop your full-stack Pages application locally" ,
34- Dev . Options ,
35- Dev . Handler
36- )
37- /**
38- * `wrangler pages functions` is meant for internal use only for now,
39- * so let's hide this command from the help output
40- */
41- . command ( "functions" , false , ( args ) =>
42- args
43- . command ( subHelp )
44- . command (
45- "build [directory]" ,
46- "Compile a folder of Cloudflare Pages Functions into a single Worker" ,
47- Build . Options ,
48- Build . Handler
49- )
50- . command (
51- "build-env [projectDir]" ,
52- "Render a list of environment variables from the config file" ,
53- BuildEnv . Options ,
54- BuildEnv . Handler
55- )
56- . command (
57- "optimize-routes [routesPath] [outputRoutesPath]" ,
58- "Consolidate and optimize the route paths declared in _routes.json" ,
59- Functions . OptimizeRoutesOptions ,
60- Functions . OptimizeRoutesHandler
61- )
62- )
63- . command ( "project" , "Interact with your Pages projects" , ( args ) =>
28+ return yargs
29+ . command ( subHelp )
30+ . command (
31+ "dev [directory] [-- command..]" ,
32+ "Develop your full-stack Pages application locally" ,
33+ Dev . Options ,
34+ Dev . Handler
35+ )
36+ . command ( "functions" , "Helpers related to Pages Functions" , ( args ) =>
37+ args
38+ . command ( subHelp )
39+ . command (
40+ "build [directory]" ,
41+ "Compile a folder of Pages Functions into a single Worker" ,
42+ Build . Options ,
43+ Build . Handler
44+ )
45+ . command (
46+ "build-env [projectDir]" ,
47+ false , // Render a list of environment variables from the config file
48+ BuildEnv . Options ,
49+ BuildEnv . Handler
50+ )
51+ . command (
52+ "optimize-routes [routesPath] [outputRoutesPath]" ,
53+ false , // Consolidate and optimize the route paths declared in _routes.json
54+ Functions . OptimizeRoutesOptions ,
55+ Functions . OptimizeRoutesHandler
56+ )
57+ )
58+ . command ( "project" , "Interact with your Pages projects" , ( args ) =>
59+ args
60+ . command ( subHelp )
61+ . command (
62+ "list" ,
63+ "List your Cloudflare Pages projects" ,
64+ Projects . ListOptions ,
65+ Projects . ListHandler
66+ )
67+ . command (
68+ "create [project-name]" ,
69+ "Create a new Cloudflare Pages project" ,
70+ Projects . CreateOptions ,
71+ Projects . CreateHandler
72+ )
73+ . command (
74+ "delete [project-name]" ,
75+ "Delete a Cloudflare Pages project" ,
76+ Projects . DeleteOptions ,
77+ Projects . DeleteHandler
78+ )
79+ . command ( "upload [directory]" , false , Upload . Options , Upload . Handler )
80+ . command (
81+ "validate [directory]" ,
82+ false ,
83+ Validate . Options ,
84+ Validate . Handler
85+ )
86+ )
87+ . command (
88+ "deployment" ,
89+ "Interact with the deployments of a project" ,
90+ ( args ) =>
6491args
6592. command ( subHelp )
6693. command (
6794"list" ,
68- "List your Cloudflare Pages projects" ,
69- Projects . ListOptions ,
70- Projects . ListHandler
71- )
72- . command (
73- "create [project-name]" ,
74- "Create a new Cloudflare Pages project" ,
75- Projects . CreateOptions ,
76- Projects . CreateHandler
95+ "List deployments in your Cloudflare Pages project" ,
96+ Deployments . ListOptions ,
97+ Deployments . ListHandler
7798)
7899. command (
79- "delete [project-name ]" ,
80- "Delete a Cloudflare Pages project " ,
81- Projects . DeleteOptions ,
82- Projects . DeleteHandler
100+ "create [directory ]" ,
101+ "Publish a directory of static assets as a Pages deployment " ,
102+ Deploy . Options ,
103+ Deploy . Handler
83104)
84- . command ( "upload [directory]" , false , Upload . Options , Upload . Handler )
85105. command (
86- "validate [directory]" ,
87- false ,
88- Validate . Options ,
89- Validate . Handler
106+ "tail [deployment]" ,
107+ "Start a tailing session for a project's deployment and " +
108+ "livestream logs from your Functions" ,
109+ DeploymentTails . Options ,
110+ DeploymentTails . Handler
90111)
112+ )
113+ . command (
114+ [ "deploy [directory]" , "publish [directory]" ] ,
115+ "Deploy a directory of static assets as a Pages deployment" ,
116+ Deploy . Options ,
117+ Deploy . Handler
118+ )
119+ . command (
120+ "secret" ,
121+ "Generate a secret that can be referenced in a Pages project" ,
122+ ( secretYargs ) => secret ( secretYargs , subHelp )
123+ )
124+ . command ( "download" , "Download settings from your project" , ( args ) =>
125+ args . command (
126+ "config [projectName]" ,
127+ "Experimental: Download your Pages project config as a Wrangler configuration file" ,
128+ DownloadConfig . Options ,
129+ DownloadConfig . Handler
91130)
92- . command (
93- "deployment" ,
94- "Interact with the deployments of a project" ,
95- ( args ) =>
96- args
97- . command ( subHelp )
98- . command (
99- "list" ,
100- "List deployments in your Cloudflare Pages project" ,
101- Deployments . ListOptions ,
102- Deployments . ListHandler
103- )
104- . command (
105- "create [directory]" ,
106- "Publish a directory of static assets as a Pages deployment" ,
107- Deploy . Options ,
108- Deploy . Handler
109- )
110- . command (
111- "tail [deployment]" ,
112- "Start a tailing session for a project's deployment and " +
113- "livestream logs from your Functions" ,
114- DeploymentTails . Options ,
115- DeploymentTails . Handler
116- )
117- )
118- . command (
119- [ "deploy [directory]" , "publish [directory]" ] ,
120- "Deploy a directory of static assets as a Pages deployment" ,
121- Deploy . Options ,
122- Deploy . Handler
123- )
124- . command (
125- "secret" ,
126- "Generate a secret that can be referenced in a Pages project" ,
127- ( secretYargs ) => secret ( secretYargs , subHelp )
128- )
129- . command ( "download" , "Download settings from your project" , ( args ) =>
130- args . command (
131- "config [projectName]" ,
132- "Experimental: Download your Pages project config as a Wrangler configuration file" ,
133- DownloadConfig . Options ,
134- DownloadConfig . Handler
135- )
136- )
137- ) ;
131+ ) ;
138132}
0 commit comments