GithubHelp home page GithubHelp logo

spritezero-cli's Introduction

npm version build status

spritezero-cli

A command-line interface to spritezero.

Installation

npm install -g @mapbox/spritezero-cli

Usage

spritezero [output filename] [input directory]

  --retina      shorthand for --ratio=2
  --ratio=[n]   pixel ratio
  --unique      map identical images to multiple names

Spritezero reads an input directory containing SVG files and generates a JSON layout file and PNG spritesheet.

spritezero-cli's People

Contributors

bhousel avatar greenkeeperio-bot avatar robozevel avatar tmcw avatar vdumont 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spritezero-cli's Issues

Add eslint

eslint catches trivial bugs, so we should add it.

Fails to convert svg (which contains <use> tags)

The attached svg does not seem to get converted in to the png sprite (nor does it throw an error btw).

I suspect the tags to cause the problem
a- is there a way to ensure it does convert? and if not
b- do you have any recommendation on any tools that can replace tags with the referenced tags? preferably a commandline tool rather than some gui

Star.svg.zip

Faild to install

NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"

node --version
v8.10.0

npm -v
5.6.0

Faile traceback:

sudo -E npm install -g @mapbox/spritezero-cli
npm WARN deprecated [email protected]: protozero should no longer be used via npm, install instead via https://github.com/mapbox/mason
/usr/local/bin/spritezero -> /usr/local/lib/node_modules/@mapbox/spritezero-cli/bin/spritezero

> [email protected] install /usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/mapnik/v3.6.2/node-v57-linux-x64-Release.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp) 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/build'
gyp ERR! System Linux 4.15.0-43-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/lib/binding/mapnik.node" "--module_name=mapnik" "--module_path=/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/lib/binding"
gyp ERR! cwd /usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/lib/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.15.0-43-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/lib/binding/mapnik.node --module_name=mapnik --module_path=/usr/local/lib/node_modules/@mapbox/spritezero-cli/node_modules/mapnik/lib/binding' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above

npm Install Error

Howdy. It seems there's a bug with doing the npm install for this. Error begins with:

node-pre-gyp ERR! Tried to download: https://mapbox-node-binary.s3.amazonaws.com/mapnik/v3.5.13/Release/node-v14-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v14 ABI) (falling back to source compile with node-gyp)

/bin/sh: mapnik-config: command not found
gyp: Call to 'mapnik-config --cflags' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/dmoriarty/n/lib/node_modules

Which seems like it might be something more associated with mapnik itself? Eitherway, can't get this working.

Installation

Am I doing something wrong? I get: 'npm ERR! 404 'spritezero-cli' is not in the npm registry' when running the command line installation.

Did we delete node binaries from S3? (mapnik) ?

Hi, we are using [email protected] and can't seem install it anymore since it cannot find the mapnik 3.5.13 node module from Mapbox's S3 bucket. (We're still on 1.1.2 since later versions require GCC 5.x). Does this ring a bell?

+ npm install -g [email protected]
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/spritezero-cli instead
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/spritezero instead
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/shelf-pack instead
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})

> [email protected] preinstall /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik
> npm install node-pre-gyp

npm WARN engine [email protected]: wanted: {"node":">= 4"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">= 0.12"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"iojs":">= 1.0.0","node":">= 0.12.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/bin/node-pre-gyp -> /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/node-pre-gyp/bin/node-pre-gyp
[email protected] /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/node-pre-gyp
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
npm WARN engine [email protected]: wanted: {"node":">= 4"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.5.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">= 0.12"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"iojs":">= 1.0.0","node":">= 0.12.0"} (current: {"node":"0.10.32","npm":"1.4.28"})

> [email protected] install /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik
> node-pre-gyp install --fallback-to-build


/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/mapnik/v3.5.13/Release/node-v11-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v11 ABI) (falling back to source compile with node-gyp) 
/bin/sh: 1: mapnik-config: not found
gyp: Call to 'mapnik-config --cflags' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.18.44
gyp ERR! command "/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/bin/node" "/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/lib/binding/node-v11-linux-x64/mapnik.node" "--module_name=mapnik" "--module_path=/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/lib/binding/node-v11-linux-x64"
gyp ERR! cwd /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/bin/node /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/lib/binding/node-v11-linux-x64/mapnik.node --module_name=mapnik --module_path=/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/lib/binding/node-v11-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:756:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:823:5)
node-pre-gyp ERR! System Linux 3.18.44
node-pre-gyp ERR! command "node" "/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik
node-pre-gyp ERR! node -v v0.10.32
node-pre-gyp ERR! node-pre-gyp -v v0.6.37
node-pre-gyp ERR! not ok 
Failed to execute '/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/bin/node /var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/lib/binding/node-v11-linux-x64/mapnik.node --module_name=mapnik --module_path=/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/lib/node_modules/spritezero-cli/node_modules/spritezero/node_modules/mapnik/lib/binding/node-v11-linux-x64' (1)

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mapnik package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls mapnik
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.18.44
npm ERR! command "/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/bin/node" "/var/lib/jenkins/workspace/myjob/jenkins-myjob-118-node/bin/npm" "install" "-g" "[email protected]"
npm ERR! cwd /var/lib/jenkins/workspace/myjob
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
Build step 'Execute shell' marked build as failure

npm install fails at mapnik dependency

I just tried to install this tool but got a series of errors from the npm installer. Here's the first part:

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/mapnik/v3.6.2/node-v59-darwin-x64-Release.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp)

AFAICT, the rest are consequences of failure to install mapnik.

License

What is the license for spritezero-cli and spritezero?

Fail install and fail generate sprite sheets

I install spritezero with v.8.0.0 version of node.js. But next step.It happen nothing when I use spritezero .(spritezero texture_building D:\work\texture).Where is the texture_building.json and texture_building.png?????

image

Add docker image

Mapnik installation does not support windows anymore.
This means that this tool can't be installed on windows (As far as I could tell).
Creating a docker image of this command line tool can bypass this limitation for windows users.

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.