- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 640
feat(graphql_common): add common package that contains utils functions #1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            vincenzopalazzo
  wants to merge
  3
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
macros/tracing
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            3 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4ecfa64
              
                feat(graphql_common): add common package that contains utils functions
              
              
                vincenzopalazzo 19cfbe4
              
                feat(graphql): add tracer to the core library to be able to trace the…
              
              
                vincenzopalazzo bc7bdc3
              
                ci: include the common package inside our CI architecture
              
              
                vincenzopalazzo File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -4,6 +4,9 @@ version: 5.1.3 | |
| repository: https://github.com/zino-app/graphql-flutter/tree/main/packages/graphql | ||
| issue_tracker: https://github.com/zino-hofmann/graphql-flutter/issues | ||
|  | ||
| # just for dev work | ||
| publish_to: 'none' | ||
|  | ||
| dependencies: | ||
| meta: ^1.3.0 | ||
| path: ^1.8.0 | ||
|  | @@ -22,6 +25,8 @@ dependencies: | |
| stream_channel: ^2.1.0 | ||
| rxdart: ^0.27.1 | ||
| uuid: ^3.0.1 | ||
| graphql_common: | ||
| path: ../graphql_common | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I guess this is a leftover from development. Since you are using melos a pubspec_overrides.yaml should do the trick. | ||
|  | ||
| dev_dependencies: | ||
| async: ^2.5.0 | ||
|  | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Files and directories created by pub. | ||
| .dart_tool/ | ||
| .packages | ||
|  | ||
| # Conventional directory for build outputs. | ||
| build/ | ||
|  | ||
| # Omit committing pubspec.lock for library packages; see | ||
| # https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
| pubspec.lock | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## 1.0.0 | ||
|  | ||
| - Initial version. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <!-- | ||
| This README describes the package. If you publish this package to pub.dev, | ||
| this README's contents appear on the landing page for your package. | ||
| For information about how to write a good package README, see the guide for | ||
| [writing package pages](https://dart.dev/guides/libraries/writing-package-pages). | ||
| For general information about developing packages, see the Dart guide for | ||
| [creating packages](https://dart.dev/guides/libraries/create-library-packages) | ||
| and the Flutter guide for | ||
| [developing packages and plugins](https://flutter.dev/developing-packages). | ||
| --> | ||
|  | ||
| TODO: Put a short description of the package here that helps potential users | ||
| know whether this package might be useful for them. | ||
|  | ||
| ## Features | ||
|  | ||
| TODO: List what your package can do. Maybe include images, gifs, or videos. | ||
|  | ||
| ## Getting started | ||
|  | ||
| TODO: List prerequisites and provide or point to information on how to | ||
| start using the package. | ||
|  | ||
| ## Usage | ||
|  | ||
| TODO: Include short and useful examples for package users. Add longer examples | ||
| to `/example` folder. | ||
|  | ||
| ```dart | ||
| const like = 'sample'; | ||
| ``` | ||
|  | ||
| ## Additional information | ||
|  | ||
| TODO: Tell users more about the package: where to find more information, how to | ||
| contribute to the package, how to file issues, what response they can expect | ||
| from the package authors, and more. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # This file configures the static analysis results for your project (errors, | ||
| # warnings, and lints). | ||
| # | ||
| # This enables the 'recommended' set of lints from `package:lints`. | ||
| # This set helps identify many issues that may lead to problems when running | ||
| # or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
| # style and format. | ||
| # | ||
| # If you want a smaller set of lints you can change this to specify | ||
| # 'package:lints/core.yaml'. These are just the most critical lints | ||
| # (the recommended set includes the core lints). | ||
| # The core lints are also what is used by pub.dev for scoring packages. | ||
|  | ||
| include: package:lints/recommended.yaml | ||
|  | ||
| # Uncomment the following section to specify additional rules. | ||
|  | ||
| # linter: | ||
| # rules: | ||
| # - camel_case_types | ||
|  | ||
| # analyzer: | ||
| # exclude: | ||
| # - path/to/excluded/files/** | ||
|  | ||
| # For more information about the core and recommended set of lints, see | ||
| # https://dart.dev/go/core-lints | ||
|  | ||
| # For additional information about configuring this file, see | ||
| # https://dart.dev/guides/language/analysis-options | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| void main() {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /// Support for doing something awesome. | ||
| /// | ||
| /// More dartdocs go here. | ||
| library graphql_common; | ||
|  | ||
| export 'src/tracing/tracer.dart'; | ||
| export 'src/tracing/logger_tracer.dart'; | 
        
          
          
            20 changes: 20 additions & 0 deletions
          
          20 
        
  packages/graphql_common/lib/src/tracing/logger_tracer.dart
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import 'package:graphql_common/src/tracing/tracer.dart'; | ||
| import 'package:logger/logger.dart'; | ||
|  | ||
| class LoggerTracer extends Tracer { | ||
| late Logger _logger; | ||
|  | ||
| LoggerTracer( | ||
| {LogFilter? filter, | ||
| LogPrinter? printer, | ||
| LogOutput? output, | ||
| Level? level}) { | ||
| _logger = | ||
| Logger(filter: filter, printer: printer, output: output, level: level); | ||
| } | ||
|  | ||
| @override | ||
| Future<void> asyncTrace(String msg, {Map<String, dynamic>? opts}) { | ||
| return Future(() => _logger.d(msg)); | ||
| } | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /// Tracer is an abstract class that provide the basic blocs to | ||
| /// build an application tracer (aka Logger). | ||
| /// | ||
| /// author: Vincenzo Palazzo <[email protected]> | ||
| abstract class Tracer { | ||
| /// Async function to start to tracing the library at runtime | ||
| /// useful when the user want log the information in an external | ||
| /// source, and it is required an async trace! | ||
| Future<void> asyncTrace(String msg, {Map<String, dynamic>? opts}); | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: graphql_common | ||
| description: A starting point for Dart libraries or applications. | ||
| version: 0.0.1 | ||
| # homepage: https://www.example.com | ||
|  | ||
| environment: | ||
| sdk: '>=2.12.6 <3.0.0' | ||
|  | ||
| dependencies: | ||
| logger: ^1.1.0 | ||
|  | ||
|  | ||
| dev_dependencies: | ||
| lints: ^2.0.0 | ||
| test: ^1.16.0 | ||
| graphql: | ||
| path: ../graphql | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import 'package:test/test.dart'; | ||
|  | ||
| void main() { | ||
| group('A group of tests', () { | ||
| setUp(() { | ||
| // Additional setup goes here. | ||
| }); | ||
|  | ||
| test('First Test', () {}); | ||
| }); | ||
| } | 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't want to commit this.