Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Cleanup, add licensing, versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Matan Lurey committed Dec 19, 2016
1 parent 731e6d3 commit eb82e32
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,3 @@
## 0.1.0

- Initial Commit
26 changes: 26 additions & 0 deletions LICENSE
@@ -0,0 +1,26 @@
Copyright 2016, the Dart project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 26 additions & 0 deletions README.md
@@ -0,0 +1,26 @@
# source_transformer

_NOTE: This project is **not** an official Google or dart-lang project_

**This package is currently in development**

Not to be confused with `code_transformers` or `source_gen`,
`source_transformer` is a library for building and applying
modifications to existing files, primarily `.dart` source files, and to
commit the results of those changes.

Example uses:

* Writing tools to automatically upgrade deprecated APIs
* Writing tools to perform mass refactorings
* Writing tools to perform macros as part of writing new code

An example of creating a binary that removes duplicate imports/exports:

```dart
import 'package:source_transformer/source_transformer.dart';
main(List<String> paths) async {
await runTransformer(const DeduplicateDirectives(), paths);
}
```
4 changes: 4 additions & 0 deletions bin/deduplicate.dart
@@ -1,3 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:source_transformer/source_transformer.dart';

/// Remove all duplicate imports and exports in a set of files.
Expand Down
4 changes: 4 additions & 0 deletions lib/source_transformer.dart
@@ -1,3 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

export 'package:source_transformer/src/cli.dart' show runTransformer;
export 'package:source_transformer/src/dart/directives.dart'
show
Expand Down
1 change: 1 addition & 0 deletions lib/src/dart/directives.dart
@@ -1,6 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library source_transformer.src.dart.directives;

import 'package:analyzer/analyzer.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/src/dart/directives/equality.dart
@@ -1,6 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

part of source_transformer.src.dart.directives;

class DirectiveEquality implements Equality<Directive> {
Expand Down
1 change: 1 addition & 0 deletions lib/src/dart/directives/transformer.dart
@@ -1,6 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

part of source_transformer.src.dart.directives;

/// A high-level transformer for manipulating `import` and `export` directives.
Expand Down
19 changes: 13 additions & 6 deletions pubspec.yaml
@@ -1,11 +1,18 @@
name: source_transformer
author: Dart Team <misc@dartlang.org>
version: 0.1.0
description: Patterns for easily re-writing source code
homepage: https://www.github.com/google/source_transformer.dart

environment:
sdk: ">=1.8.0 <2.0.0"

dependencies:
analyzer:
collection:
meta:
quiver:
source_span:
analyzer: '>=0.29.1 <0.30.0'
collection: '^1.11.0'
meta: '^1.0.3'
quiver: '>=0.22.0 <0.30.0'
source_span: '^1.0.0'

dev_dependencies:
test:
test: '^0.12.17'
4 changes: 4 additions & 0 deletions test/dart/directives/deduplicate_test.dart
@@ -1,3 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:source_span/source_span.dart';
import 'package:source_transformer/src/dart/directives.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 4 additions & 0 deletions test/dart/directives/equality_test.dart
@@ -1,3 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:analyzer/analyzer.dart';
import 'package:source_transformer/src/dart/directives.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 4 additions & 0 deletions test/dart/directives/remove_test.dart
@@ -1,3 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:source_span/source_span.dart';
import 'package:source_transformer/src/dart/directives.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 4 additions & 0 deletions test/dart/directives/replace_test.dart
@@ -1,3 +1,7 @@
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:source_span/source_span.dart';
import 'package:source_transformer/src/dart/directives.dart';
import 'package:test/test.dart';
Expand Down

0 comments on commit eb82e32

Please sign in to comment.