File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ import 'package:yaml_edit/yaml_edit.dart';
2424import '../common/cloud_run_id.dart' ;
2525import 'spec.dart' ;
2626
27+ const _manifestComment =
28+ '# This file is generated by package:firebase_functions. Do not edit.' ;
29+
2730/// Generates the YAML manifest string from discovered params and endpoints.
2831String generateManifestYaml (
2932 Map <String , ParamSpec > params,
@@ -32,7 +35,7 @@ String generateManifestYaml(
3235 final map = _buildManifestMap (params, endpoints);
3336 final editor = YamlEditor ('' );
3437 editor.update ([], map);
35- return editor.toString ();
38+ return '$ _manifestComment \n\n ${ editor .toString ()}' ;
3639}
3740
3841/// Builds the full manifest as a structured map.
Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ void main() {
8282 expect (dartManifest['specVersion' ], equals ('v1alpha1' ));
8383 });
8484
85+ test ('should have a comment at top' , () {
86+ final dartYaml = File (
87+ 'test/fixtures/dart_reference/functions.yaml' ,
88+ ).readAsStringSync ();
89+ expect (dartYaml, startsWith ('#' ));
90+ });
91+
8592 // =========================================================================
8693 // Params Tests
8794 // =========================================================================
You can’t perform that action at this time.
0 commit comments