From 5a4dd0fb2bb2e746b698158478a96831fff48e79 Mon Sep 17 00:00:00 2001 From: "thomashii@dukefirehawk.com" Date: Fri, 14 May 2021 11:06:32 +0800 Subject: [PATCH] Publish angel3_code_buffer --- CHANGELOG.md | 2 +- packages/code_buffer/.gitignore | 26 +++++-------------- packages/code_buffer/AUTHORS.md | 16 ++++++++++-- packages/code_buffer/CHANGELOG.md | 1 - packages/code_buffer/LICENSE | 2 +- packages/code_buffer/README.md | 16 +++++++----- packages/code_buffer/example/main.dart | 7 ++--- ...de_buffer.dart => angel3_code_buffer.dart} | 0 packages/code_buffer/pubspec.yaml | 4 +-- packages/code_buffer/test/copy_test.dart | 8 +++--- packages/code_buffer/test/span_test.dart | 6 ++--- packages/code_buffer/test/write_test.dart | 10 +++---- .../combinator/lib/src/combinator/chain.dart | 4 +-- packages/combinator/pubspec.yaml | 4 +-- packages/framework/pubspec.yaml | 1 + packages/route/pubspec.yaml | 2 +- 16 files changed, 54 insertions(+), 55 deletions(-) rename packages/code_buffer/lib/{code_buffer.dart => angel3_code_buffer.dart} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index fae07325..634f76cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ * Migrated angel_migration_runner to 3.0.0 (0/0 tests passed) * Migrated angel_orm_test to 3.0.0 (0/0 tests passed) * Migrated angel_orm_postgres to 3.0.0 (51/54 tests passed) -* Update orm-sdk-2.12.x boilerplate (in progress) <= Milestone 2 +* Create orm-sdk-2.12.x boilerplate (in progress) <= Milestone 2 # 3.0.0 (Non NNBD) diff --git a/packages/code_buffer/.gitignore b/packages/code_buffer/.gitignore index 0e12a575..24d68312 100644 --- a/packages/code_buffer/.gitignore +++ b/packages/code_buffer/.gitignore @@ -1,15 +1,18 @@ # See https://www.dartlang.org/tools/private-files.html # Files and directories created by pub +.dart_tool .packages .pub/ build/ + # If you're building an application, you may want to check-in your pubspec.lock pubspec.lock # Directory created by dartdoc # If you don't generate documentation locally you can remove this line. doc/api/ + ### Dart template # See https://www.dartlang.org/tools/private-files.html @@ -44,25 +47,9 @@ doc/api/ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff: -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/dictionaries -# Sensitive or high-churn files: -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.xml -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml - -# Gradle: -.idea/**/gradle.xml -.idea/**/libraries - -# Mongo Explorer plugin: -.idea/**/mongoSettings.xml +## VsCode +.vscode/ ## File-based project format: *.iws @@ -70,9 +57,8 @@ doc/api/ ## Plugin-specific files: # IntelliJ +.idea/ /out/ - -# mpeltonen/sbt-idea plugin .idea_modules/ # JIRA plugin diff --git a/packages/code_buffer/AUTHORS.md b/packages/code_buffer/AUTHORS.md index 2a973de6..aef739da 100644 --- a/packages/code_buffer/AUTHORS.md +++ b/packages/code_buffer/AUTHORS.md @@ -1,2 +1,14 @@ -Tobe O -Thomas Hii \ No newline at end of file +Primary Authors +=============== + +* __[Thomas Hii](dukefirehawk.apps@gmail.com)__ + + Thomas is the current maintainer of the code base. He has refactored and migrated the + code base to support NNBD. + +* __[Tobe O](thosakwe@gmail.com)__ + + Tobe has written much of the original code prior to NNBD migration. He has moved on and + is no longer involved with the project. + +Thomas Hii \ No newline at end of file diff --git a/packages/code_buffer/CHANGELOG.md b/packages/code_buffer/CHANGELOG.md index d7fce08d..aef237fa 100644 --- a/packages/code_buffer/CHANGELOG.md +++ b/packages/code_buffer/CHANGELOG.md @@ -1,5 +1,4 @@ # 2.0.0 * Migrated to support Dart SDK 2.12.x NNBD - # 1.0.1 * Added `CodeBuffer.noWhitespace()`. \ No newline at end of file diff --git a/packages/code_buffer/LICENSE b/packages/code_buffer/LICENSE index 3de28325..b593ac86 100644 --- a/packages/code_buffer/LICENSE +++ b/packages/code_buffer/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Tobe O +Copyright (c) 2021 dukefirehawk.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/code_buffer/README.md b/packages/code_buffer/README.md index d556c428..440a675c 100644 --- a/packages/code_buffer/README.md +++ b/packages/code_buffer/README.md @@ -1,6 +1,8 @@ -# code_buffer -[![Pub](https://img.shields.io/pub/v/code_buffer.svg)](https://pub.dartlang.org/packages/code_buffer) -[![build status](https://travis-ci.org/thosakwe/code_buffer.svg)](https://travis-ci.org/thosakwe/code_buffer) +# angel3_code_buffer +[![version](https://img.shields.io/badge/pub-v2.12.4-brightgreen)](https://pub.dartlang.org/packages/angel3_code_buffer) +[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) + +[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/code_buffer) An advanced StringBuffer geared toward generating code, and source maps. @@ -9,7 +11,7 @@ In your `pubspec.yaml`: ```yaml dependencies: - code_buffer: ^1.0.0 + angel3_code_buffer: ^2.0.0 ``` # Usage @@ -17,7 +19,7 @@ Use a `CodeBuffer` just like any regular `StringBuffer`: ```dart String someFunc() { - var buf = new CodeBuffer(); + var buf = CodeBuffer(); buf ..write('hello ') ..writeln('world!'); @@ -29,9 +31,9 @@ However, a `CodeBuffer` supports indentation. ```dart void someOtherFunc() { - var buf = new CodeBuffer(); + var buf = CodeBuffer(); // Custom options... - var buf = new CodeBuffer(newline: '\r\n', space: '\t', trailingNewline: true); + var buf = CodeBuffer(newline: '\r\n', space: '\t', trailingNewline: true); // Any following lines will have an incremented indentation level... buf.indent(); diff --git a/packages/code_buffer/example/main.dart b/packages/code_buffer/example/main.dart index c02b9674..89b1a531 100644 --- a/packages/code_buffer/example/main.dart +++ b/packages/code_buffer/example/main.dart @@ -1,4 +1,4 @@ -import 'package:code_buffer/code_buffer.dart'; +import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:test/test.dart'; /// Use a `CodeBuffer` just like any regular `StringBuffer`: @@ -16,7 +16,8 @@ void someOtherFunc() { // Custom options... // ignore: unused_local_variable - var customBuf = new CodeBuffer(newline: '\r\n', space: '\t', trailingNewline: true); + var customBuf = + new CodeBuffer(newline: '\r\n', space: '\t', trailingNewline: true); // Without whitespace.. // ignore: unused_local_variable @@ -42,4 +43,4 @@ void yetAnotherOtherFunc(CodeBuffer buf) { /// You can copy a `CodeBuffer` into another, heeding indentation rules: void yetEvenAnotherFunc(CodeBuffer a, CodeBuffer b) { b.copyInto(a); -} \ No newline at end of file +} diff --git a/packages/code_buffer/lib/code_buffer.dart b/packages/code_buffer/lib/angel3_code_buffer.dart similarity index 100% rename from packages/code_buffer/lib/code_buffer.dart rename to packages/code_buffer/lib/angel3_code_buffer.dart diff --git a/packages/code_buffer/pubspec.yaml b/packages/code_buffer/pubspec.yaml index c41db4cd..13a39bd9 100644 --- a/packages/code_buffer/pubspec.yaml +++ b/packages/code_buffer/pubspec.yaml @@ -1,7 +1,7 @@ -name: code_buffer +name: angel3_code_buffer version: 2.0.0 description: An advanced StringBuffer geared toward generating code, and source maps. -homepage: https://github.com/dukefirehawk/angel +homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/code_buffer environment: sdk: '>=2.12.0 <3.0.0' dependencies: diff --git a/packages/code_buffer/test/copy_test.dart b/packages/code_buffer/test/copy_test.dart index 9d0170f0..01f60420 100644 --- a/packages/code_buffer/test/copy_test.dart +++ b/packages/code_buffer/test/copy_test.dart @@ -1,8 +1,8 @@ -import 'package:code_buffer/code_buffer.dart'; +import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:test/test.dart'; -main() { - var a = new CodeBuffer(), b = new CodeBuffer(); +void main() { + var a = CodeBuffer(), b = CodeBuffer(); setUp(() { a.writeln('outer block 1'); @@ -30,7 +30,7 @@ main() { }); test('sets lastLine+lastSpan', () { - var c = new CodeBuffer() + var c = CodeBuffer() ..indent() ..write('>') ..writeln('innermost'); diff --git a/packages/code_buffer/test/span_test.dart b/packages/code_buffer/test/span_test.dart index c96acffd..61615ae8 100644 --- a/packages/code_buffer/test/span_test.dart +++ b/packages/code_buffer/test/span_test.dart @@ -1,9 +1,9 @@ import 'package:charcode/charcode.dart'; -import 'package:code_buffer/code_buffer.dart'; +import 'package:angel3_code_buffer/angel3_code_buffer.dart'; import 'package:test/test.dart'; -main() { - var buf = new CodeBuffer(); +void main() { + var buf = CodeBuffer(); tearDown(buf.clear); test('writeCharCode', () { diff --git a/packages/code_buffer/test/write_test.dart b/packages/code_buffer/test/write_test.dart index 31238980..509c44cd 100644 --- a/packages/code_buffer/test/write_test.dart +++ b/packages/code_buffer/test/write_test.dart @@ -1,9 +1,9 @@ import 'package:charcode/charcode.dart'; -import 'package:code_buffer/code_buffer.dart'; import 'package:test/test.dart'; +import 'package:angel3_code_buffer/angel3_code_buffer.dart'; main() { - var buf = new CodeBuffer(); + var buf = CodeBuffer(); tearDown(buf.clear); test('writeCharCode', () { @@ -17,7 +17,7 @@ main() { }); test('custom space', () { - var b = new CodeBuffer(space: '+') + var b = CodeBuffer(space: '+') ..writeln('foo') ..indent() ..writeln('baz'); @@ -25,7 +25,7 @@ main() { }); test('custom newline', () { - var b = new CodeBuffer(newline: 'N') + var b = CodeBuffer(newline: 'N') ..writeln('foo') ..indent() ..writeln('baz'); @@ -33,7 +33,7 @@ main() { }); test('trailing newline', () { - var b = new CodeBuffer(trailingNewline: true)..writeln('foo'); + var b = CodeBuffer(trailingNewline: true)..writeln('foo'); expect(b.toString(), 'foo\n'); }); diff --git a/packages/combinator/lib/src/combinator/chain.dart b/packages/combinator/lib/src/combinator/chain.dart index cc51e284..39101df5 100644 --- a/packages/combinator/lib/src/combinator/chain.dart +++ b/packages/combinator/lib/src/combinator/chain.dart @@ -61,12 +61,10 @@ class _Chain extends ListParser { successful = false; } - //TODO: To be looked at if (result.value != null) { - //print(result.value.runtimeType); results.add(result.value!); } else { - //print("NULL"); + results.add("NULL" as T); } if (result.span != null) { diff --git a/packages/combinator/pubspec.yaml b/packages/combinator/pubspec.yaml index 1ba7ae13..2174271e 100644 --- a/packages/combinator/pubspec.yaml +++ b/packages/combinator/pubspec.yaml @@ -1,7 +1,7 @@ name: combinator -version: 2.0.0 +version: 2.0.0-beta.1 description: Packrat parser combinators that support static typing, generics, file spans, memoization, and more. -homepage: https://github.com/thosakwe/combinator.git +homepage: https://github.com/dukefirehawk/angel/tree/sdk-2.12.x_nnbd/packages/combinator publish_to: none environment: sdk: '>=2.12.0 <3.0.0' diff --git a/packages/framework/pubspec.yaml b/packages/framework/pubspec.yaml index de3d46b6..89d7aa87 100644 --- a/packages/framework/pubspec.yaml +++ b/packages/framework/pubspec.yaml @@ -29,6 +29,7 @@ dependencies: path: packages/route charcode: ^1.2.0 combinator: +# path: ../combinator git: url: https://github.com/dukefirehawk/angel.git ref: sdk-2.12.x_nnbd diff --git a/packages/route/pubspec.yaml b/packages/route/pubspec.yaml index 527a12bc..a88b7be6 100644 --- a/packages/route/pubspec.yaml +++ b/packages/route/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: combinator: -# path: ../combinator +# path: ../combinator git: url: https://github.com/dukefirehawk/angel.git ref: sdk-2.12.x_nnbd