Giter VIP home page Giter VIP logo

p8's Introduction

p8

NPM Version NPM Downloads

👾 PICO-8 dependency manager

Import lua/moonscript modules, spritesheets, and automatically reload your carts as you code.


Features:

  • Share code and sprites (via github or any file host)
  • Use require() to use modules in your own carts
  • Code in any IDE you want
  • Auto-reload carts on save

Installation

Download the executable

You can grab the executable for your platform from releases page

- On macOS or linux, you may want to copy the executable into /usr/bin.
- On windows, you may want to add the executable to your PATH.

NPM

Or you can use good old npm

npm i -g p8

Getting Started

You can be up-and-running in a few quick steps.

1. Initialize your project

Create and/or adds basic fields to p8.json.

p8 init

2. Add Dependencies

Add .lua, .moon, .png, .jpg, or .gif files.

p8 add [file|url...]

3. Run your cartridge

Use the --watch flag to automatically reload whenever the entry-point is saved. This command will automatically install and build if you haven't already.

p8 run

Usage

Usage: p8 <command> [options]

Commands:
  p8 add [file|url...]  add modules as "dependencies" or "gfxDependencies" in p8.json.
  p8 build              outputs a cart (.p8 file)
  p8 init               initialize the project
  p8 install            install dependencies listed in p8.json to ./pico_modules
  p8 run                runs a .p8 cartridge (PICO-8 switches can be passed after a trailing --)
Options:
  --version  Show version number
  --help     Show help

If you want a detailed walkthrough, read Getting Started with p8 →.

If you want more examples, check out the examples →

p8's People

Contributors

jozanza 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

Watchers

 avatar  avatar  avatar

p8's Issues

In Monterey, Applescript app not allowed to send keystrokes (1002)

I have an Applescript application named "New" and I get the above message whenever I run it. I have other similar Applescript apps that have the same problem. "New" is a simple 1-line applescript to create a new folder:

      tell application “System Events” to keystroke “n” using {command down, shift down}

I have given script editor and "New" Full Disk Access and Accessibility in the Security & Privacy pref pane.

This error began when I upgraded to Monterey. I created variations of "New", for example accessing "New Finder Window" from Finder's File menu, but all of my attempts run into this same problem. I have restarted the Finder many times, and even rebooted a few times, but the error persists.

p8 spamming stderr with moonc

To fix I had to remove moonc (despite your annotation it was still being required), remove it from dependencies and remove .moon compilation, otherwise the tool was unusable on linux because moon was spamming into (fake) sderr constant stream:

stderr: lua: cannot open /snapshot/p8/node_modules/moonc/moon.lua: No such file or directory
stderr:
stderr: lua: cannot open /snapshot/p8/node_modules/moonc/moon.lua: No such file or directory
stderr:
stderr: lua: cannot open /snapshot/p8/node_modules/moonc/moon.lua: No such file or directory
stderr:

This utility will help you quickly create a p8.json file.
This file will keep track of basic info and the dependencies of your project.

Use p8 add <filepath or url> afterwards to save dependencies in p8.json.

error on p8 init

Installed lua, moonscript and your tool (p8)
But when running p8 init I get this error ... any idea why?

I'm on OSX 10.11 El Capitan

AlexandsMacBook:cavemen alexanderschaefer$ p8 init

/usr/local/lib/node_modules/p8/src/p8-init:9
const { parse } = require('path')
      ^
SyntaxError: Unexpected token {
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

osascript is not allowed to send keystrokes

When I make a change to my lua file and the build auto-reloads, it throws an error running the applescript to send Cmd+R to PICO-8. The error message is:

execution error: System Events got an error: osascript is not allowed to send keystrokes.

I tried adding osascript and p8 under System Preferences > Privacy > Accessibility, but no luck. Is there some other thing required to give the script the right permissions?

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.