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

Commit

Permalink
Bumped version number to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
x64Eddie committed Aug 27, 2020
2 parents 973cade + 5053ca7 commit 89ac757
Show file tree
Hide file tree
Showing 212 changed files with 247 additions and 15,797 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.packages
# Remove the following pattern if you wish to check in your lock file
pubspec.lock
sketch-to-svg/node_modules/
# Conventional directory for build outputs
build/
TestingSketch/
Expand All @@ -16,3 +15,4 @@ doc/api/
out/
temp/
.DS_Store
TestingSketch
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "SketchAssetConverter"]
path = SketchAssetConverter
url = https://github.com/Parabeac/SketchAssetConverter.git
branch = master
13 changes: 5 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,15 @@ You'll need the following tools to run Parabeac Core, as well as a text editor o
* Install latest version (If using Visual Studio Code simply install the Dart Extension)
* Flutter Latest version
* Install latest version (If using Visual Studio Code simply install the Dart Extension)
* Docker
* You don't need to have a Docker account but Docker does need to be running
* [node.js](https://nodejs.org/en/download/)
* node.js is needed in order to run the Sketch-Asset-Converter.

#### Running PBCore
Follow these steps in order to run PBCore on your local environment:

1. Clone PBCore repo in order to get the code on your machine
2. Make sure you have docker running
3. Within your terminal navigate to the sketch-to-svg folder within the Parabeac Core root directory. From here run `docker build -t sketch .`
4. Within the same sketch-to-svg directory run `docker run -p 5555:8081 -d sketch`
> :warning: **Steps 3 and 4 create a docker container in the background, we know this is not ideal and are working to remove this currently. To remove the docker instance run `docker ps` to identify the container Id and then `docker kill <containerId>` to remove it. Please see the Docker docs for more details.**
5. If you have any plugins make sure to put the plugins in the plugin folder
6. In your terminal move to the root PBCore directory and run:
2. If you have any plugins make sure to put the plugins in the plugin folder
3. In your terminal change directory to the root PBCore directory and run:
``` bash
$dart parabeac.dart -p <Absolute Path To Design File> -n <ProjectName>
```
Expand Down
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,40 @@ Parabeac currently supports conversions from [Sketch](https://www.sketch.com) bu

### Dependencies

- Dart
- Flutter
- Docker (*We're working on removing this*)
- [Dart](https://dart.dev/get-dart)
- [Flutter](https://flutter.dev/docs/get-started/install)
- [node.js](https://nodejs.org/en/download/)

To test out a Sketch file feel free to download [this Sketch file](https://drive.google.com/file/d/10ZdTTUCFLrGJ-1oVmapWoH5HCe87Sz4e/view?usp=sharing)!

### Running the conversion
## Cloning the Repo
Because parabeac-core contains the Sketch-Asset-Converter submodule, it is easier to clone the repo using the following command:
```
git clone --recurse-submodules https://github.com/Parabeac/Parabeac-Core.git
```

If you have already cloned the repo without the submodule, simply run the following command which will add Sketch-Asset-Converter:
```
git submodule update --init
```

**_In order to pull new changes from the repository, run the following command to also update the submodule:_**

```
git pull --recurse-submodules
```

For more information about git submodules, click [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).

## Running the conversion

Follow these steps in order to run Parabeac Core on your local environment:
1. Clone PBCore repo in order to get the code on your machine
2. Make sure you have docker running
3. Within your terminal navigate to the sketch-to-svg folder within the Parabeac Core root directory. From here run `docker build -t sketch .`
4. Within the same sketch-to-svg directory run `docker run -p 5555:8081 -d sketch`
5. If you have any plugins make sure to put the plugins in the plugin folder
6. In your terminal move to the root PBCore directory and run:
2. If you have any plugins make sure to put the plugins in the plugin folder
3. In your terminal change directory to the root PBCore directory and run:
``` bash
$dart parabeac.dart -p <Absolute Path To Design File> -n <ProjectName>
```
> :warning: **Note: Steps 3 and 4 create a docker container in the background, we know this is not ideal and are working to remove this currently. To remove the docker instance run `docker ps` to identify the container Id and then `docker kill <containerId>` to remove it. Please see the Docker docs for more details.**

# Running the exported code
### Requirement(s)
Expand All @@ -103,6 +118,5 @@ To add a Parabeac egg, download the egg and add it to the `parabeac-core/plugins
# Upcoming & Known Issues

- Plugin Duplication in the Plugin Service
- Remove Docker Dependency
- Support for Figma
- Egg Marketplace
1 change: 1 addition & 0 deletions SketchAssetConverter
Submodule SketchAssetConverter added at fddd1b
3 changes: 3 additions & 0 deletions lib/controllers/main_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class MainInfo {
/// Path representing where the output of parabeac-core will be produced
String outputPath;

/// Path to the user's sketch file
String sketchPath;

/// Current working directory; contains the path from where the script was called
Directory cwd;
Map configurations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PBBitmapGenerator extends PBGenerator {
String generate(PBIntermediateNode source) {
var buffer = StringBuffer();
buffer.write(
'Image.asset(\'assets/${source is InheritedBitmap ? source.referenceImage : ('images/' + source.name + '.png')}\', ${_sizehelper.generate(source)})');
'Image.asset(\'assets/${source is InheritedBitmap ? source.referenceImage : ('images/' + source.UUID + '.png')}\', ${_sizehelper.generate(source)})');
return buffer.toString();
}
}
2 changes: 1 addition & 1 deletion lib/input/entities/layers/artboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ part 'artboard.g.dart';
@JsonSerializable(nullable: false)
class Artboard extends AbstractGroupLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'artboard';
final bool includeInCloudUpload;
final bool includeBackgroundColorInExport;
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/artboard.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/input/entities/layers/bitmap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ part 'bitmap.g.dart';
// description: Bitmap layers house a single image
class Bitmap extends SketchNode implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'bitmap';
final ImageRef image;
final bool fillReplacesImage;
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/bitmap.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/input/entities/layers/group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ part 'group.g.dart';
@JsonSerializable(nullable: false)
class Group extends AbstractGroupLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'group';
Group(
{bool hasClickThrough,
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/group.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions lib/input/entities/layers/oval.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ part 'oval.g.dart';
@JsonSerializable(nullable: false)
class Oval extends AbstractShapeLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'oval';

Oval(
Expand Down Expand Up @@ -84,7 +84,10 @@ class Oval extends AbstractShapeLayer implements SketchNodeFactory {

@override
Future<PBIntermediateNode> interpretNode(PBContext currentContext) async {
var image = await convertImage(json.encode(toJson()));
var image = await convertImageLocal(do_objectID, frame.width, frame.height);
if (image == null) {
return null;
}
return Future.value(
InheritedOval(this, currentContext: currentContext, image: image));
}
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/oval.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/input/entities/layers/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ part 'page.g.dart';
@JsonSerializable(nullable: false)
class Page extends AbstractGroupLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'page';
dynamic includeInCloudUpload;
dynamic horizontalRulerData;
Expand Down
2 changes: 2 additions & 0 deletions lib/input/entities/layers/page.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/input/entities/layers/rectangle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ part 'rectangle.g.dart';
@JsonSerializable(nullable: false)
class Rectangle extends AbstractShapeLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'rectangle';
final double fixedRadius;
final bool hasConvertedToNewRoundCorners;
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/rectangle.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions lib/input/entities/layers/shape_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ part 'shape_group.g.dart';
@JsonSerializable(nullable: false)
class ShapeGroup extends AbstractGroupLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'shapeGroup';
final dynamic widingRule;
final dynamic windingRule;

ShapeGroup(
{bool hasClickThrough,
Expand Down Expand Up @@ -48,7 +48,7 @@ class ShapeGroup extends AbstractGroupLayer implements SketchNodeFactory {
userInfo,
Style style,
maintainScrollPosition,
this.widingRule})
this.windingRule})
: super(
hasClickThrough,
groupLayout,
Expand Down Expand Up @@ -87,7 +87,10 @@ class ShapeGroup extends AbstractGroupLayer implements SketchNodeFactory {

@override
Future<PBIntermediateNode> interpretNode(PBContext currentContext) async {
var image = await convertImage(json.encode(toJson()));
var image = await convertImageLocal(do_objectID, frame.width, frame.height);
if (image == null) {
return null;
}
return InheritedShapeGroup(this,
currentContext: currentContext, image: image);
}
Expand Down
7 changes: 4 additions & 3 deletions lib/input/entities/layers/shape_group.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions lib/input/entities/layers/shape_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ part 'shape_path.g.dart';
@JsonSerializable(nullable: false)
class ShapePath extends AbstractShapeLayer implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'shapePath';

ShapePath(
Expand Down Expand Up @@ -86,7 +86,10 @@ class ShapePath extends AbstractShapeLayer implements SketchNodeFactory {

@override
Future<PBIntermediateNode> interpretNode(PBContext currentContext) async {
var image = await convertImage(json.encode(toJson()));
var image = await convertImageLocal(do_objectID, frame.width, frame.height);
if (image == null) {
return null;
}
return Future.value(
InheritedShapePath(this, currentContext: currentContext, image: image));
}
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/shape_path.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/input/entities/layers/symbol_instance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SymbolInstance extends SketchNode
with SymbolNodeMixin
implements SketchNodeFactory {
@override
@JsonKey(ignore: true)
@JsonKey(name: '_class')
String CLASS_NAME = 'symbolInstance';
final List<OverridableValue> overrideValues;
final double scale;
Expand Down
3 changes: 2 additions & 1 deletion lib/input/entities/layers/symbol_instance.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 89ac757

Please sign in to comment.