Giter VIP home page Giter VIP logo

rollup-plugin-screeps's Introduction

Rollup Screeps Plugin

Install

npm install --save-dev rollup-plugin-screeps

Usage

In rollup.config.js

import screeps from "rollup-plugin-screeps";

...

export default {
  ...
  sourcemap: true, // If set to true your source maps will be made screeps friendly and uploaded

  plugins: [
    ...
    screeps({configFile: "./screeps.json"})
  ]
}

Config File

rollup-plugin-screeps needs your screeps username/password and the server to upload to.

{
  "email": "[email protected]",
  "password": "pass",
  "protocol": "https",
  "hostname": "screeps.com",
  "port": 443,
  "path": "/",
  "branch": "auto"
}

If branch is set to "auto" rollup-plugin-screeps will use your current git branch as the name of the branch on screeps, if you set it to anything else that string will be used as the name of the branch.

rollup-plugin-screeps's People

Contributors

arcath avatar dmarcuse avatar duckymirror avatar pyrodogg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rollup-plugin-screeps's Issues

"module.export =" - prefix is not prepended correctly to sourcemap

Since working with sourcemaps I've found that the sourcemap needs to be uploaded with the module.export prefix to work.
This looks like it's handled in "generateSourceMaps", however, while debugging I've found that it's never ran, nor affects the output.

Tl:dr; It looks like the toString wrapper doesnt work anymore.

npm audit, Severity: high, git-rev-sync 1.3.0 - 3.0.1

Just a heads up that npm audit is highlighting a vulnerability due to a dependancy:

shelljs <0.8.5
Severity: high
Improper Privilege Management in shelljs - GHSA-4rq4-32rv-6wp6
No fix available
node_modules/shelljs
git-rev-sync 1.3.0 - 3.0.1
Depends on vulnerable versions of shelljs
node_modules/git-rev-sync
rollup-plugin-screeps *
Depends on vulnerable versions of git-rev-sync
node_modules/rollup-plugin-screeps

DeprecationWarning running `npm run push--pserver` when server is offline

If the server is offline, instead of giving a proper message we receive the following error

(node:9848) UnhandledPromiseRejectionWarning: Error:
    at ScreepsAPI.req (C:\Projects\Screeps\node_modules\screeps-api\dist\ScreepsAPI.js:640:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:9848) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9848) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I think the following two places needs a .catch maybe more places where the api is used.

api.raw.user.branches().then((data: any) => {
let branches = data.list.map((b: any) => b.branch)
if (branches.includes(branch)) {
api.code.set(branch, code)
} else {
api.raw.user.cloneBranch('', branch, code)
}
})
}

api.auth().then(() => {
runUpload(api, branch!, code)
})

Update to newer Rollup hooks

Running under Rollup 1.27.5:

(!) The "ongenerate" hook used by plugin screeps is deprecated. The "generateBundle" hook should be used instead.
(!) The "onwrite" hook used by plugin screeps is deprecated. The "generateBundle/writeBundle" hook should be used instead.

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.