serverless-websockets-quest
oclif
Our great sponsors
serverless-websockets-quest | oclif | |
---|---|---|
5 | 34 | |
8 | 8,844 | |
- | 1.3% | |
0.0 | 9.5 | |
7 months ago | 4 days ago | |
TypeScript | TypeScript | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
serverless-websockets-quest
-
One year at Ably as a Developer Advocate
Live demo
-
Using serverless WebSocksets with Azure Functions & Durable Entities
Hi all, I created a web app (ADnD style mini game) recently to demonstrate how to use serverless WebSockets (Ably) and combine it with Azure Functions to send realtime updates to the client (based on VueJS and hosted on Azure Static Web Apps). The Azure Functions use Durable Entities (part of Durable Functions) to store a centralized game state, and as soon as the state is updated the clients are notified of this change. Full blog post is here, the game can be played here, and you can have look at the code on GitHub.
-
Quest for serverless WebSockets, an adventure with Azure Functions & Durable Entities
[JsonObject(MemberSerialization.OptIn)] public class GameState : IGameState { // Only showing the class members relevant for this blog section. // For the full implementation see https://github.com/ably-labs/serverless-websockets-quest/blob/main/api/Models/GameState.cs [JsonProperty("questId")] public string QuestId { get; set; } [JsonProperty("phase")] public string Phase { get; set; } public async Task InitGameState(string[] gameStateFields) { QuestId = gameStateFields[0]; Phase = gameStateFields[1]; await _publisher.PublishUpdatePhase(QuestId, Phase); } [JsonProperty("players")] public List PlayerNames { get; set; } public async Task AddPlayerName(string playerName) { if (PlayerNames == null) { PlayerNames = new List { playerName }; } else { PlayerNames.Add(playerName); } if (IsPartyComplete) { await UpdatePhase(GamePhases.Play); await Task.Delay(2000); await AttackByMonster(); } } public async Task UpdatePhase(string phase) { Phase = phase; await _publisher.PublishUpdatePhase(QuestId, Phase); } private async Task AttackByMonster() { var playerAttacking = CharacterClassDefinitions.Monster.Name; var playerUnderAttack = GetRandomPlayerName(); var damage = CharacterClassDefinitions.GetDamageFor(CharacterClassDefinitions.Monster.CharacterClass); await _publisher.PublishPlayerAttacking(QuestId, playerAttacking, playerUnderAttack, damage); await Task.Delay(1000); var playerEntityId = new EntityId(nameof(Player), Player.GetEntityId(QuestId, playerUnderAttack)); Entity.Current.SignalEntity(playerEntityId, proxy => proxy.ApplyDamage(damage)); await Task.Delay(1000); var nextPlayerName = GetNextPlayerName(CharacterClassDefinitions.Monster.Name); await _publisher.PublishPlayerTurnAsync(QuestId, $"Next turn: {nextPlayerName}", nextPlayerName); } }
oclif
-
Using CLI Applications to Increase Efficiency in Work
oclif is a library that helps create CLI applications using Node.js. If you are using a different programming language, search for a suitable library.
-
Is there any alternative to an .exe to deploy node apps?
It is possible, oclif is a full featured framework produced by Salesforce and is used for the Salesforce and Heroku CLI applications. I have used oclif and pkg to bundle a standalone, though I was focused on MacOS not Windows. Any node application should work with pkg, though.
-
Gnarly Learnings from March 2023
oClif.io
-
How do I export/distribute a Node.js command line application?
Check out https://oclif.io/
- The Open CLI Framework
-
From Ruby to Node: Overhauling Shopify’s CLI for a Better Developer Experience
Interesting. TIL about the Open CLI framework that they all seem to be moving to: https://oclif.io/
-
Making command line commands with javascript
https://oclif.io is a tool that helps you build command line tools with node. You can use it to help you create an executable for Linux, max, or windows that you can invoke from the command line.
-
Spidergram is a collection of tools my company Autogram has built or enabled over the past several years to support our work to automate content inventories for large websites: it's part web crawler, part domain model, and part mad science. We released the first public beta today.
Oclif to quickly click together CLI tools for kicking off and monitoring crawls, generating reports, etc.
-
One year at Ably as a Developer Advocate
During the second Ably Innovation Days, I started working on specifications for an Ably CLI. After the first day Phil and I started with a prototype based on oclif. We managed to create a working prototype in a day that lists Ably apps, and creates a new Ably app. This project is still Work In Progress. Once the CLI is in a releasable state, I'll create some content around this.
-
Building a TypeScript CLI with Node.js and Commander
A command-line interface, often referred to as a CLI, is a program that allows users to type instructions and interact with a script that processes the input and produces an output. Node.js has a lot of packages that allows you to build CLIs, like args, minimist, and oclif.
What are some alternatives?
agile-flush-vue-app - Use this app to collaboratively estimate the stories for the next sprint.
Commander.js - node.js command-line interfaces made easy
ably-control-api-action - A GitHub Action to use the Ably Control API.
Ink - 🌈 React for interactive command-line apps
DurableFunctionsMonitor - A monitoring/debugging UI tool for Azure Durable Functions
yargs - yargs the modern, pirate-themed successor to optimist.
collaborative-pixel-drawing - A collaborative pixelart drawing carnvas to demonstrate pub/sub using Ably or Azure WebPubSub.
pkg - Package your Node.js project into an executable
serverless-workflow-visualizer - Web application that uses Ably to visualize the progress of a serverless workflow.
zx - A tool for writing better scripts
enquirer - Stylish, intuitive and user-friendly prompts, for Node.js. Used by eslint, webpack, yarn, pm2, pnpm, RedwoodJS, FactorJS, salesforce, Cypress, Google Lighthouse, Generate, tencent cloudbase, lint-staged, gluegun, hygen, hardhat, AWS Amplify, GitHub Actions Toolkit, @airbnb/nimbus, and many others! Please follow Enquirer's author: https://github.com/jonschlinkert
Cliffy - NodeJS Framework for Interactive CLIs