npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-typed-factorio

v1.1.8

Published

This is an `create` package for yarn (Technically installable by npm too), which would allow you to quickly buid a TypeScript -> Lua project, for developing mods with Factorio. It has some awesome built in scripts for building, cleaning, and deploying a p

Downloads

9

Readme

create-typed-factorio

This is an create package for yarn (Technically installable by npm too), which would allow you to quickly buid a TypeScript -> Lua project, for developing mods with Factorio. It has some awesome built in scripts for building, cleaning, and deploying a packaged mod. (Psst, you can even deploy directly to your factorio instance, on-the-fly, for rapid iteration and testing, simply reset your scenario.) This should get you developing right out of the box, it includes all the types you would need, as well as configuing the files. When you're ready to deploy, simply remove the files you don't want from src/ and run yarn deploy. Your package will be named, zipped, and ready to roll. Enjoy and please let me know if youu'd like to see any changes.

Dependencies

Installation

First, you need to have yarn installed, you can install it with the following command: npm install -g yarn

Once you have yarn installed, you can install create-typed-factorio with the following command: yarn add create-typed-factorio

Usage

To create a new mod, navigate to the directory where you want to create the mod and run the following command: yarn create typed-factorio <yourModName>

This will create a new directory in the current directory with the name of the mod. The directory will contain all the necessary files to start developing a new mod.

Start Developing

You'll notice there is now a src/ directory. In there you'll find all the revelvant files, already configured in the proper structure for a mod to be packaged. Once you're done developing your mod, build it with the built in script, which will generate a new build/ or deployment/ directory, which will be your lua files that you'd traditionally use. Profit o7, and happy coding.

Scripts

The following scripts are contained in the generated files, all you need to do is cd your/mod/root/dir and then run them. Unix is for Linux/Mac and Windows is for... well Windows.

  • yarn build_windows or yarn build_unix - compiles the TypeScript files into Lua and places the files into the build/ directory.
  • yarn deploy_windows or yarn deploy_unix - creates a compressed mod file that is ready for release. If you do not modify the --dest flag on the gulp script, it will be placed into the deplyment/ directory, otherwise the directory you specify.
  • yarn watch - watches the TypeScript files and recompiles them when they change. Also places them into the build/ directory.

To run any of these scripts, navigate to the mod directory and run the script using yarn. For example, to build the mod, run the following command from yourProjectDestination/: yarn build

Building to the Factorio directory

To build and deploy a mod to the Factorio directory, use the --dest flag with the yarn deploy command. For example, to build and deploy a mod to the directory C:\your\factorio\mods, modify the script "deploy: ..." located in the generated package.json. An example might look something like this :

"deploy_windows": "yarn clean:windows && yarn build && yarn copy:infoJSON:windows && yarn copy:campaigns:windows && yarn copy:locale:windows && yarn copy:migrations:windows && yarn copy:scenarios:windows && yarn copy:tutorials:windows && gulp compress gulp compress --dest=C:\your\factorio\mods"

Or for Unix fans:

"deploy_unix": "yarn clean:windows && yarn build && yarn copy:infoJSON:windows && yarn copy:campaigns:windows && yarn copy:locale:windows && yarn copy:migrations:windows && yarn copy:scenarios:windows && yarn copy:tutorials:windows && gulp compress gulp compress --dest=~etc\your\factorio\mods"

Attribution

This package is based on the work of GlassBricks and cdaringe.