File tree 4 files changed +39
-3
lines changed
4 files changed +39
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " wrangler " : patch
3
+ ---
4
+
5
+ Throw error if user attempts to use config with pages
Original file line number Diff line number Diff line change @@ -299,7 +299,6 @@ describe("pages", () => {
299
299
directory The directory of static files to upload [string]
300
300
301
301
Flags:
302
- -c, --config Path to .toml configuration file [string]
303
302
-h, --help Show help [boolean]
304
303
-v, --version Show version number [boolean]
305
304
@@ -969,6 +968,19 @@ describe("pages", () => {
969
968
970
969
expect ( std . err ) . toMatchInlineSnapshot ( `""` ) ;
971
970
} ) ;
971
+
972
+ it ( "should throw an error if user attempts to use config with pages" , async ( ) => {
973
+ await expect (
974
+ runWrangler ( "pages dev --config foo.toml" )
975
+ ) . rejects . toThrowErrorMatchingInlineSnapshot (
976
+ `"Pages does not support wrangler.toml"`
977
+ ) ;
978
+ await expect (
979
+ runWrangler ( "pages publish --config foo.toml" )
980
+ ) . rejects . toThrowErrorMatchingInlineSnapshot (
981
+ `"Pages does not support wrangler.toml"`
982
+ ) ;
983
+ } ) ;
972
984
} ) ;
973
985
974
986
describe ( "project upload" , ( ) => {
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ export function Options(yargs: Argv): Argv<PagesDevArgs> {
92
92
type : "boolean" ,
93
93
hidden : true ,
94
94
} ,
95
+ config : {
96
+ describe : "Pages does not support wrangler.toml" ,
97
+ type : "string" ,
98
+ hidden : true ,
99
+ } ,
95
100
// // TODO: Miniflare user options
96
101
} )
97
102
. epilogue ( pagesBetaWarning ) ;
@@ -108,14 +113,18 @@ export const Handler = async ({
108
113
do : durableObjects = [ ] ,
109
114
"live-reload" : liveReload ,
110
115
"node-compat" : nodeCompat ,
116
+ config : config ,
111
117
_ : [ _pages , _dev , ...remaining ] ,
112
118
} : ArgumentsCamelCase < PagesDevArgs > ) => {
113
119
// Beta message for `wrangler pages <commands>` usage
114
120
logger . log ( pagesBetaWarning ) ;
115
121
116
122
if ( ! local ) {
117
- logger . error ( "Only local mode is supported at the moment." ) ;
118
- return ;
123
+ throw new FatalError ( "Only local mode is supported at the moment." , 1 ) ;
124
+ }
125
+
126
+ if ( config ) {
127
+ throw new FatalError ( "Pages does not support wrangler.toml" , 1 ) ;
119
128
}
120
129
121
130
const functionsDirectory = "./functions" ;
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ export function Options(yargs: Argv): Argv<PublishArgs> {
59
59
description :
60
60
"Whether or not the workspace should be considered dirty for this deployment" ,
61
61
} ,
62
+ config : {
63
+ describe : "Pages does not support wrangler.toml" ,
64
+ type : "string" ,
65
+ hidden : true ,
66
+ } ,
62
67
} )
63
68
. epilogue ( pagesBetaWarning ) ;
64
69
}
@@ -70,7 +75,12 @@ export const Handler = async ({
70
75
commitHash,
71
76
commitMessage,
72
77
commitDirty,
78
+ config : wranglerConfig ,
73
79
} : ArgumentsCamelCase < PublishArgs > ) => {
80
+ if ( wranglerConfig ) {
81
+ throw new FatalError ( "Pages does not support wrangler.toml" , 1 ) ;
82
+ }
83
+
74
84
if ( ! directory ) {
75
85
throw new FatalError ( "Must specify a directory." , 1 ) ;
76
86
}
You can’t perform that action at this time.
0 commit comments