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

@ancademy/bespoke-cli

v2.7.3

Published

**bespoke-cli** provides several commands for developers to increase speed of developing games based on @ancademy/bespoke-xxx framework. It packs some tasks of webpack and file operation , and you can refer to source code in /src to custom your own task.

Downloads

61

Readme

About

bespoke-cli provides several commands for developers to increase speed of developing games based on @ancademy/bespoke-xxx framework. It packs some tasks of webpack and file operation , and you can refer to source code in /src to custom your own task.

Install

npm i -g @ancademy/bespoke-cli

Commands

Options:
  -v --version    output the version number
  -h, --help      display help for command

Commands:
  init            init base project structure
  add             add new sub game
  dev             dev a sub game
  build           build a sub game
  extra           extra util tasks
  help [command]  display help for command

Start

Init project

mkdir hello-bespoke
cd hello-bespoke
bespoke-cli init
# Input project name : hello-bespoke

Add first game

bespoke-cli add
# Input game namespace : openAuction

As for the namespace, the first letter will be converted to uppercase,and then used as the game folder name. You can freely modify it later in config.ts, and it will become the routing prefix of the game. When you modify it in ' config.ts', it can be shaped like '/auction/openAuction', as a multi-layer prefix.

Dev

Frontend

bespoke-cli -> choose game (OpenAuction) -> client -> HMR

The frontend code would be built by webpack-dev-server and served at port 8080 ,and HMR will be enabled when Y is selected.

Custom webpack config in config.ts:

export function updateWebpack(config) {
    //update
    return config;
}

Backend

  • Start mongodb and redis.
  • Configure mongodb, redis and other connection parameters in file .env. If .env does not exist, the server will connect to db with default configuration and automatically create .env on the first startup.
  • There are 2 ways to start the server :
    • @ancademy/bespoke-cli
    bespoke-cli -> choose game (OpenAuction) -> server -> HMR
    • Node(support IDE breakpoint debug)
    node --inspect -r ts-node/register OpenAuction\server.ts
    The backend server would listen on port 8081, then refer to console log, browse http://ip:8081/OpenAuction. If you enabled HMR on both end, visit port 8080 instead, request other than js bundle would be forward to port 8081.

Visit

  • Refer to console log, browse http://ip:port/OpenAuction.
  • Register-free Experience(Teacher) -> (Password 111111) -> Create Room -> Configure room parameters -> Submit -> Automatically redirect to the room console page.
  • Add Player (Player A) -> Click to open a new tab to play with the identity of this player.

Build

bespoke-cli build -> choose game (OpenAuction) -> dist/publish

Frontend code would be packaged into namespace/dist,while backend into namespace/build. Compared with dist , publish will upload the frontend bundle to Qiniu based on the keys in .env.

Deploy

  • upload package.json + dist + build to remote server
  • npm i
  • node ./build/serve.js