Giter Club home page Giter Club logo

sasha's Introduction

sasha Swift 4.2 Make Swift Package Manager Marathon

Sasha is an easy-to-use CLI app for routine designer tasks.

FeaturesUsingInstallingAuthorLicense

Features

  • Icon slicing for different platforms:
    • iOS
    • watchOS including 40 and 44 mm versions
    • watchOS Complications
    • macOS
    • Carplay
    • Android
    • Android Wear
  • Project folder tree generation

Using

Icons

Sasha has two main commands - icons and project.

$ sasha icons --platform iOS --name icon.png

Sasha generates icons in needed resolutions as well. For Apple platforms Sasha generates AppIcon.appiconset, which iOS developer can drag and drop right into Images.xcassets without manual icon sorting 👨🏻‍💻👍.

There is a service for Sasha. Right click on an original icon, select Services > Sasha, make me iOS icons.

Project generation

$ sasha project --name ProjectName

Sasha generates folder tree with name passed via --name option. By default Sasha uses this project structure:

iOS
-UI
--old
--png
-UX
--old
--png
Android
-UI
--old
--png
-UX
--old
--png
references
-main_screens
-menu
-cards
-another_case
stuff
-logos
-icons
-patterns
-stocks
-source

To change it, open ~/.sasha/project.sasha file in your favourite text editor and make custom project structure.

Installing

Homebrew (recommended):

$ brew install artemnovichkov/projects/sasha

Make:

$ git clone https://github.com/artemnovichkov/sasha.git
$ cd sasha
$ make

Swift Package Manager:

$ git clone https://github.com/artemnovichkov/sasha.git
$ cd sasha
$ make build
$ cp -f .build/release/sasha /usr/local/bin/sasha
$ cp -r .sasha ~

Marathon:

  • Install Marathon.
  • Add Files using $ marathon add https://github.com/artemnovichkov/sasha.git.
  • Run your script using $ marathon run <path-to-your-script>.

Author

Artem Novichkov, [email protected]

Get help on Codementor

License

Sasha is available under the MIT license. See the LICENSE file for more info.

sasha's People

Contributors

artemnovichkov avatar imvm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sasha's Issues

Automator Service for sasha

Designers afraid of terminals so for convenience I'm going to write Automator Service for main sasha actions:

  • Create a new project: right-click action in any folder, select New project and enter a name (or use default if it's not possible)
  • Icon creation: right-click action on any .jpg file and select Create icon

sandbox_apply_container: Operation not permitted

Hi @artemnovichkov, I was trying to install your CLIs on a Mac running macOS High Sierra but was unable to. I believe the sandbox is not required when building on macOS High Sierra, see similar issue here. This issue affects Carting, FastFood and Sasha. See output below.

Updating Homebrew...
==> Installing fastfood from artemnovichkov/projects
==> Downloading https://github.com/artemnovichkov/fastfood/archive/1.3.tar.gz
==> Downloading from https://codeload.github.com/artemnovichkov/fastfood/tar.gz/1.3
######################################################################## 100.0%
==> make install PREFIX=/usr/local/Cellar/fastfood/1.3
Last 15 lines from /Users/hq/Library/Logs/Homebrew/fastfood/01.make:
2017-10-15 23:48:56 +0200

make
install
PREFIX=/usr/local/Cellar/fastfood/1.3

swift build -c release -Xswiftc -static-stdlib
error: manifest parse error(s):
sandbox-exec: sandbox_apply_container: Operation not permitted
make: *** [build] Error 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/artemnovichkov/homebrew-projects/issues

Add check of alpha channel for app icons

I have an error during upload to AppStore Connect:

[iTMSTransporter] ERROR ITMS-90396: "Invalid Icon. The watch application 'Waterbalance.app/Watch/WatchKit.app' contains an icon file 'Icon [email protected]' with an alpha channel. Icons should not have an alpha channel."

I want to add check of alpha channel.

Different sizes for different platform

Sasha supports only 1024x1024 original image. But some platforms require small sizes. For example, max size for watchOS complication icons is 203x203. It would be great to check max size for selected platform.

Icon generation

Add logic for app icon generation for all platforms including CarPlay and WatchOS

Remove hardcoded paths for .sketch files

project command creates a folder structure and copies .sketch files. Paths for the files are hardcoded:

private func addSketchFiles(to folder: Folder, projectName: String) throws {
//TODO: Hardcoded paths. Think about it.
try Platform.all.forEach { platform in
let platformName = platform.rawValue
let sketchFile = try File(path: Keys.fileTemplates + "sketch_\(platformName.lowercased()).sketch")
let sketchFileData = try sketchFile.read()
let fileName = "\(platformName)/UI/" + projectName + " -\(platformName.lowercased()).sketch"
try folder.createFile(named: fileName, contents: sketchFileData)
}
}
}

I want to update project.sasha configuration file format and add possibility to add these paths, for example:

Main
-folder
--{ sketch_ios.sketch }

Also, I want to improve parsing of configuration files:

func paths(fromString string: String) -> [String] {
let components = string.components(separatedBy: "\n")
let allFolders = components.map { component -> Folder in
let name = component.replacingOccurrences(of: "-", with: "")
let level = component.characters.filter { $0 == "-" }
return Folder(name: name, level: level.count)
}
var paths = [String]()
var currentLevel = 0
var currentPath: String?
allFolders.forEach { folder in
if let path = currentPath {
if folder.level > currentLevel {
currentPath = path + Keys.slash + folder.name
}
else {
var components = path.components(separatedBy: Keys.slash)
var subComponents = components[0..<folder.level]
subComponents.append(folder.name)
currentPath = subComponents.joined(separator: Keys.slash)
}
currentLevel = folder.level
}
else {
currentPath = folder.name
currentLevel = folder.level
}
if let path = currentPath {
paths.append(path)
}
}
return paths
}

Add option for icon path

I need this option for Apple Script. The main goal is to pass the path to original image via --path/-p option.

Add support of WatchOS icons

sasha's public API provides only iOS and Android platforms. But Watch apps use separate Assets.xcassets. I want to add an option for selecting WatchOS platform via --platform flag. Here is Context.json from AppIcon:

{
  "images" : [
    {
      "size" : "24x24",
      "idiom" : "watch",
      "scale" : "2x",
      "role" : "notificationCenter",
      "subtype" : "38mm"
    },
    {
      "size" : "27.5x27.5",
      "idiom" : "watch",
      "scale" : "2x",
      "role" : "notificationCenter",
      "subtype" : "42mm"
    },
    {
      "size" : "29x29",
      "idiom" : "watch",
      "role" : "companionSettings",
      "scale" : "2x"
    },
    {
      "size" : "29x29",
      "idiom" : "watch",
      "role" : "companionSettings",
      "scale" : "3x"
    },
    {
      "size" : "40x40",
      "idiom" : "watch",
      "scale" : "2x",
      "role" : "appLauncher",
      "subtype" : "38mm"
    },
    {
      "size" : "44x44",
      "idiom" : "watch",
      "scale" : "2x",
      "role" : "longLook",
      "subtype" : "42mm"
    },
    {
      "size" : "86x86",
      "idiom" : "watch",
      "scale" : "2x",
      "role" : "quickLook",
      "subtype" : "38mm"
    },
    {
      "size" : "98x98",
      "idiom" : "watch",
      "scale" : "2x",
      "role" : "quickLook",
      "subtype" : "42mm"
    },
    {
      "idiom" : "watch-marketing",
      "size" : "1024x1024",
      "scale" : "1x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.