GithubHelp home page GithubHelp logo

grunt-screeps's Introduction

npm version

grunt-screeps

A Grunt plugin for committing code to your Screeps account.

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-screeps 

Usage Example

Gruntfile.js:

module.exports = function(grunt) {

    grunt.loadNpmTasks('grunt-screeps');

    grunt.initConfig({
        screeps: {
            options: {
                email: 'YOUR_EMAIL',
                token: 'AUTH_TOKEN',
                branch: 'default',
                // server: 'season'
            },
            dist: {
                files: [
                    {
                        expand: true,
                        cwd: 'dist/',
                        src: ['**/*.{js,wasm}'],
                        flatten: true
                    }
                ]
            }
        }
    });
}

Now you can run this command to commit your code from dist folder to your Screeps account:

grunt screeps

See more advanced usage examples in this docs article.

grunt-screeps's People

Contributors

artch avatar brianpeiris avatar c9952594 avatar nitehawk avatar o4kapuk avatar ross-p avatar tedivm 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-screeps's Issues

multiple grunt configs/tasks

module.exports = function(grunt){
  grunt.loadNpmTasks('grunt-screeps');
  grunt.initConfig({
    screeps: {
      default: {
        options: {
          email: creds.email,
          password: creds.password,
          branch: 'default',
          ptr: false
        },
        dist: {
          src: ['dist/*.js']
        }
      },
      test: {
        options: {
          email: creds.email,
          password: creds.password,
          branch: 'test',
          ptr: false
        },
        dist: {
          src: ['webpack/main.js']
        }
      }
    },
  });
  
  grunt.registerTask('screeps', ['screeps:default'])
  grunt.registerTask('screepsTest', ['screeps:test'])
  //grunt.registerTask('default', ['screeps'])
}

when i try to do grunt screepsTest it just hangs forever

when I googled it seems certain grunt modules allow this, others don't? If I did it wrong please tell me, too, thanks.

I am newbie player and a newbie dev.

Hello everyone.

I cannot succeed in installing grunt-screeps.

nodeenv  envScreeps
. ./envScreeps/bin/activate

nodejs --version
v7.8.0
npm --version
4.2.0

I tried this:

npm install -g grunt-cli
npm install -g grunt //or [email protected]
npm install -g grunt-screep

And that:

npm install -g https://github.com/screeps/grunt-screeps

I tried many combinations with NPM but still go stuck with this.

├── UNMET PEER DEPENDENCY grunt@>=0.4.0
└── [email protected]  (git+https://github.com/screeps/grunt-screeps.git#d249b05a4cba157f3a79b0c627e01114de18c472)

npm WARN [email protected] requires a peer of grunt@>=0.4.0 but none was installed.

Can someone tell me what I do wrong ?

Thanks in advance.

Fail to authorize using username and password

I tried to use grunt-screeps but failed to commit code. It reports Fatal error: Screeps server returned error code 401. Do I need to place a spawn structure before everything? The difference between my script is that the auth field is not encoded by base64 while mine is just encoded and directly appended to the request header.

I was using the same password on the website and in the code.

(BUG) Task sends a POST request for EACH file being uploaded (not just 1)

I was getting inconsistent behavior with the grunt-screeps module where sometimes, some of the files in my dist/ folder were not being uploaded. The behavior was inconsistent however. Sometimes all of my files would be uploaded, sometimes a few would be cut off.

It looks like the issue is that there is a POST request being sent with all of the files, for EACH file found. Essentially it is just an indentation issue where the post request construction and execution should not be inside of the forEach(file) function.

I'm happy to submit a PR for this bug.

Password is required to be added to the Gruntfile in plaintext

This is a really nice addition to my Screeps workflow. But I hate that I have to put my password directly into my Gruntfile.js. If I want to put my code somewhere public, my screeps account can easily be compromised.

Instead of two options for username and password, could there just be one that specifies a file that has these credentials? Then the user could check in their Gruntfile but omit the credentials file.

Using folders not fixing requires

Hello there,

In the advanced usage docs here: https://docs.screeps.com/contributed/advanced_grunt.html#Using-Folders - It shows how you can move files from a folder structure into a flattened structure using the grunt-contrib-copy plugin and it also renames the files to prefix the folder name onto the filename for example a file at location "src/Creeps/Roles/Harvester" will be moved to "dist/" and renamed to "Creeps_Roles_Harvester". It also mentioned that your requires would have to change but that is the issue, it doesn't explain how to do that as part of the copy process. Any help would be appreciated.

Auth tokens

It seems this hasn't been updated to use auth tokens.

Unmaintained project?

Hi,

just wanted to ask if the project is not maintained anymore.
Being an official repo, I wonder if the devs support different code distribution tools instead of grunt now? There are pull requests open for a year now.
I only have very basic Javascript and Screeps experience but if you need a maintainer for managing this project I'd volunteer.

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.