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

@paxperscientiam/generate-phaser3-filepack

v6.6.0

Published

[Phaser 3](https://github.com/photonstorm/phaser) Pack File Generator ------

Downloads

7

Readme

Phaser 3 Pack File Generator

WARNING

This project is still a work in progress. I have intentionally designed this script to not write a file. Users can produce a file through output re-direction.

What is this?

This script serves Phaser 3 developers who manage their assets with Phaser's PackFile loader. It's meant to take the load off of manually maintaining a PackFile, which becomes tedious once one is dealing with lots of assets. The product of this script is meant to adhere to the form defined in framework definition.

Features

Generates a Pack File based on organization of asset files, using a configuration file to shape output.

Usage

This script requires a configuration file following the following structure:

{
  "ignoredPaths"?: string|string[] // string ready to be converted to RegEx
  "extensions"?: string // optional comma-separated list of allowed file extensions, default action is not to filter by extension
  "options":? {
    "keyFormat"?: "namespaced"|"filebasename" ,
    "outputDuplicateKeyWarning"?: boolean
    "applyProAssetKeyPrefix"?: boolean
    "removeBaseDirFromURL"?: boolean
  },
  "targets": [
    {
      "key": string // unique key to describe set of targeted files
      "basePath": string // which directory to search
      "hint"?: ["audio"|"image"|"bitmapFont"] // optionally assert asset type
      "extensions"?: string // comma separated list of allowed file extensions, takes precedence over higher-level definition
      "ignoredPaths"?: string|string[] // string ready to be converted to RegEx
    },
    {
     // additional targets
    }
   ]
}

This script processes targets sequentially. What this means is that files found in the first target folder will not be processed a second time, even if included in the second target. This prevents double-processing, which is useful if higher-ranked target is type-hinted.

For assets that are not automatically inferred, you'll probably want to take advantage of hint options.

Invocation:

npx  @paxperscientiam/generate-phaser3-filepack <configfile.json>

Example of invocation and saving (careful not overwrite unintentionally):

npx  @paxperscientiam/generate-phaser3-filepack config.json > filepack.json

Notes

This script does NOT write anything to file; it's up to you to do so.

If you set a "hint", it's assumed accurate.

Auto inferred types

  • [ ] atlas
  • [ ] atlasXML
  • [ ] audioSprite
  • [ ] htmlTexture
  • [ ] multiatlas
  • [ ] obj
  • [ ] spritesheet
  • [ ] tilemapCSV
  • [ ] tilemapImpact
  • [ ] tilemapTiledJSON
  • [ ] unityAtlas
  • [x] audio (:IPhaserFilePackGenericAsset)
  • [x] binary (:IPhaserFilePackBinaryAsset)
  • [x] css
  • [x] glsl
  • [x] html
  • [x] image (:IPhaserFilePackGenericAsset)
  • [x] json
  • [x] svg
  • [x] text
  • [x] video
  • [x] xml

Hint-reliant types

  • [x] atlas
  • [x] bitmapFont

Improvements

  • [ ] allow set asBlob and noAudio in post-processing.
  • [ ] add check to prevent changing keys of unmoved files (only relevant to path-based key naming)
  • [ ] add mode to merge new with pre-existing
  • [x] isolate unknow file types
  • [ ] post process adjustments.
  • [ ] use phaser's types for development
  • [ ] idempotence
  • [x] avoid double processing. This can be done with combination of dirty flags and collative full file list. Or, maybe make a dictionary of all paths, using dirTree in a prior step for that purpose
  • [x] filter out commonsystem and temp files. EG .DS_Store
  • [x] global ignored paths
  • [x] option to remove basedir

Bugs

  • [x] only selectively collapse asset set (EG: collapse audio, but not toher types with files with same file-basenames)
  • [ ] filter out unknowns explicitly
  • [ ] review warnings about key uniqueness. EG this on videos.

Contributors

  • All the programmers Copilot ripped off
  • Fine folks at liberachat
  • Phaser community