Code Monkey home page Code Monkey logo

jspicl-cli's Introduction

jspicl is a Javascript to PICO-8 Lua transpiler. It creates an AST out of the JavaScript code and then transpiles it down to the LUA subset of which PICO-8 supports.

Visit jspicl.github.io for docs, guides, API and more!


npm version License

jspicl-cli's People

Contributors

agronkabashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jspicl-cli's Issues

Unable to run cli: ExperimentalWarning: The ESM module loader is experimental.

Describe the bug
A clear and concise description of what the bug is.

When attempting to run the cli, it crashes instead.

Expected behavior
A clear and concise description of what you expected to happen.

The cli should be able to run.

To Reproduce
Steps to reproduce the behavior.

Clone this repo. Install dependencies using npm install.
Try to run the cli using bin/cli or node bin/cli.

For completeness, here is my environment:

  • node v12.19.0
  • npm 6.14.9
  • Ubuntu 20.10

Screenshots
If applicable, add screenshots to help explain your problem.

~/tmp/jspicl-cli$ bin/cli
(node:36493) ExperimentalWarning: The ESM module loader is experimental.
internal/process/esm_loader.js:90
    internalBinding('errors').triggerUncaughtException(
                              ^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /home/joeja/tmp/jspicl-cli/bin/cli
    at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:65:15)
    at Loader.getFormat (internal/modules/esm/loader.js:116:42)
    at Loader.getModuleJob (internal/modules/esm/loader.js:247:31)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Loader.import (internal/modules/esm/loader.js:181:17)
    at async Object.loadESM (internal/process/esm_loader.js:84:5) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

Additional context
Add any other context about the problem here.

I think this is because of "type": "module" in package.json. If I understand correctly, "type": "module" allows you to use ES6 modules in node instead of CommonJS. However, bin/cli appears to be a CommonJS module, not an ES6 module. Removing this line from package.json causes the script to give an expected output:

~/tmp/jspicl-cli$ bin/cli
Options:
  --input                 Path to entry point  [required]
  --output                Path the generated PICO-8 cardridge  [required]
  --spritesheetImagePath  Path to a spritesheet  [required]
  --cartridgePath         Path to existing cardridge  [required]
  --includeBanner         Include jspicl info in code
  --jsOutput              Path to JavaScript output
  --luaOutput             Path to LUA output
  --showStats             Display build stats
  --pipeOutputToConsole   Output console.log to terminal
  --reloadOnSave          Re-run cartridge when updated
  --polyfillTransform     Path to a module that exports a transformation method
  --customPicoPath        Path to PICO-8 executable
  --prettify              Format LUA code
  --watch                 Reload cartridge on rebuilds

Missing required arguments: input, output, spritesheetImagePath, cartridgePath

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.