Skip to content

Commit a9be23e

Browse files
committed
[TS] Elimate newlines at beginning of file and add newline at end of file
1 parent 6570f72 commit a9be23e

4 files changed

Lines changed: 235 additions & 312 deletions

File tree

packages/apollo-cli/src/commands/codegen/__tests__/__snapshots__/generate.test.ts.snap

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ public final class SimpleQueryQuery: GraphQLQuery {
311311
`;
312312

313313
exports[`successful codegen infers TypeScript target and writes types 1`] = `
314-
"
315-
316-
/* tslint:disable */
314+
"/* tslint:disable */
317315
// This file was automatically generated and should not be edited.
318316
319317
// ====================================================
@@ -333,13 +331,12 @@ export interface SimpleQuery {
333331
334332
//==============================================================
335333
// END Enums and Input Objects
336-
//=============================================================="
334+
//==============================================================
335+
"
337336
`;
338337

339338
exports[`successful codegen infers TypeScript target and writes types for query with client-side data 1`] = `
340-
"
341-
342-
/* tslint:disable */
339+
"/* tslint:disable */
343340
// This file was automatically generated and should not be edited.
344341
345342
// ====================================================
@@ -376,13 +373,12 @@ export interface SimpleQuery {
376373
377374
//==============================================================
378375
// END Enums and Input Objects
379-
//=============================================================="
376+
//==============================================================
377+
"
380378
`;
381379

382380
exports[`successful codegen infers TypeScript target and writes types for query with client-side data with schema in a JS file 1`] = `
383-
"
384-
385-
/* tslint:disable */
381+
"/* tslint:disable */
386382
// This file was automatically generated and should not be edited.
387383
388384
// ====================================================
@@ -419,13 +415,12 @@ export interface SimpleQuery {
419415
420416
//==============================================================
421417
// END Enums and Input Objects
422-
//=============================================================="
418+
//==============================================================
419+
"
423420
`;
424421

425422
exports[`successful codegen infers TypeScript target and writes types for query with client-side data with schema in a JS file from config 1`] = `
426-
"
427-
428-
/* tslint:disable */
423+
"/* tslint:disable */
429424
// This file was automatically generated and should not be edited.
430425
431426
// ====================================================
@@ -462,13 +457,12 @@ export interface SimpleQuery {
462457
463458
//==============================================================
464459
// END Enums and Input Objects
465-
//=============================================================="
460+
//==============================================================
461+
"
466462
`;
467463

468464
exports[`successful codegen infers TypeScript target and writes types for query with only client-side data 1`] = `
469-
"
470-
471-
/* tslint:disable */
465+
"/* tslint:disable */
472466
// This file was automatically generated and should not be edited.
473467
474468
// ====================================================
@@ -493,7 +487,8 @@ export interface SimpleQuery {
493487
494488
//==============================================================
495489
// END Enums and Input Objects
496-
//=============================================================="
490+
//==============================================================
491+
"
497492
`;
498493

499494
exports[`successful codegen writes Flow types into a __generated__ directory next to sources when no output is set 1`] = `
@@ -581,9 +576,7 @@ export type SimpleQuery = {
581576
`;
582577

583578
exports[`successful codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 1`] = `
584-
"
585-
586-
/* tslint:disable */
579+
"/* tslint:disable */
587580
// This file was automatically generated and should not be edited.
588581
589582
// ====================================================
@@ -592,13 +585,12 @@ exports[`successful codegen writes TypeScript types into a __generated__ directo
592585
593586
export interface SimpleQuery {
594587
hello: string;
595-
}"
588+
}
589+
"
596590
`;
597591

598592
exports[`successful codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 2`] = `
599-
"
600-
601-
/* tslint:disable */
593+
"/* tslint:disable */
602594
// This file was automatically generated and should not be edited.
603595
604596
//==============================================================
@@ -607,13 +599,12 @@ exports[`successful codegen writes TypeScript types into a __generated__ directo
607599
608600
//==============================================================
609601
// END Enums and Input Objects
610-
//=============================================================="
602+
//==============================================================
603+
"
611604
`;
612605

613606
exports[`successful codegen writes TypeScript types next to sources when output is set to empty string 1`] = `
614-
"
615-
616-
/* tslint:disable */
607+
"/* tslint:disable */
617608
// This file was automatically generated and should not be edited.
618609
619610
// ====================================================
@@ -622,13 +613,12 @@ exports[`successful codegen writes TypeScript types next to sources when output
622613
623614
export interface SimpleQuery {
624615
hello: string;
625-
}"
616+
}
617+
"
626618
`;
627619

628620
exports[`successful codegen writes TypeScript types next to sources when output is set to empty string 2`] = `
629-
"
630-
631-
/* tslint:disable */
621+
"/* tslint:disable */
632622
// This file was automatically generated and should not be edited.
633623
634624
//==============================================================
@@ -637,13 +627,12 @@ exports[`successful codegen writes TypeScript types next to sources when output
637627
638628
//==============================================================
639629
// END Enums and Input Objects
640-
//=============================================================="
630+
//==============================================================
631+
"
641632
`;
642633

643634
exports[`successful codegen writes TypeScript types to a custom directory next to sources when output is set 1`] = `
644-
"
645-
646-
/* tslint:disable */
635+
"/* tslint:disable */
647636
// This file was automatically generated and should not be edited.
648637
649638
// ====================================================
@@ -652,13 +641,12 @@ exports[`successful codegen writes TypeScript types to a custom directory next t
652641
653642
export interface SimpleQuery {
654643
hello: string;
655-
}"
644+
}
645+
"
656646
`;
657647

658648
exports[`successful codegen writes TypeScript types to a custom directory next to sources when output is set 2`] = `
659-
"
660-
661-
/* tslint:disable */
649+
"/* tslint:disable */
662650
// This file was automatically generated and should not be edited.
663651
664652
//==============================================================
@@ -667,7 +655,8 @@ exports[`successful codegen writes TypeScript types to a custom directory next t
667655
668656
//==============================================================
669657
// END Enums and Input Objects
670-
//=============================================================="
658+
//==============================================================
659+
"
671660
`;
672661

673662
exports[`successful codegen writes exact Flow types when the flag is set 1`] = `

packages/apollo-cli/src/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default function generate(
157157
} else {
158158
fs.writeFileSync(
159159
outputPath,
160-
generatedFiles.map(o => o.content().fileContents).join("\n") +
160+
generatedFiles.map(o => o.content().fileContents).join("\n") + "\n" +
161161
generatedGlobalFile.fileContents,
162162
);
163163

0 commit comments

Comments
 (0)