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

@strawbees/code-ui

v1.14.2

Published

Web based interface for Strabess CODE built with [Next](https://nextjs.org/).

Downloads

47

Readme

Strawbees Code UI

Web based interface for Strabess CODE built with Next.

Building

Next will generate a static website so you must provide some building context in form of configuration files and environment variables.

Configuring the build

The current build uses the next.config.js file to list all the parameters for the build.

It also uses the environment variable CONFIG to select the appropriated configuration. The available configuration options are listed in lib/scripts/buildTargets.js:

  • web_stage: Builds for CODE Website using stage/develop configuration.
  • web_production: Builds for CODE Website using production configuration.
  • desktop_stage: Builds for CODE Desktop App using stage configuration.
  • desktop_production: Builds for CODE Desktop App using production configuration.

Running the build script

There are 2 build scripts:

  • lib/scripts/build.js: Will generate the static files for the environment set by CONFIG and will output the result to ./out folder.
  • lib/scripts/buildTargets.js: Will generate static files for all the available environment and will output it on folders named by the environment (for example web_stage) inside the ./out folder.

You can run them manually:

# To build `web_stage`
CONFIG=web_stage node lib/scripts/build.js
# To build all targets
node lib/scripts/buildTargets.js

Or run using npm scripts:

# To build `web_stage`
CONFIG=web_stage npm run build
# To build all targets
npm run build-targets

Running locally

"Running the UI" is a questionable practice as the UI it's not a stand alone project but a dependency that can be fit inside other applications such as an desktop app, a website or a mobile app to provide an standard interface for Strawbees CODE.

Therefore the recommended way to run this project is to include it on the project you want to use it and run the project, not the UI.

For development, the general recommendation is to use npm link:

  • Run npm link on this repository
  • Run npm link @strawbees/code-ui on the application project

Website

Because the build will generate a static website, a shortcut to run the UI locally would be to build the application and run a static website server (such as http-server) on the "output folder" (./out or in one of the "target" build folders).

npm install -g http-server
CONFIG=web_stage npm run build
http-server -c-1 -p 8080 ./out

Or

npm install -g http-server
npm run build-targets
http-server -c-1 -p 8080 ./out/web_stage

Desktop App

If you are developing for the Desktop App, because there are mulitple builds and levels of configuration, the most straight forward way to develop is to manually create a symbolic link from the "output folder" to the folder Desktop App is expecting the UI to be (usually the src/ui).

Assuming you have two folders side by side code-ui and code-desktop and is developing on a UNIX based OS:

# Build UI
cd code-ui
CONFIG=desktop_stage npm run build
cd ..

# Link UI to app
ln -s $(pwd)/code-ui/out $(pwd)/code-destkop/src/ui

# Run the app
cd code-desktop
npm start

Translations

TODO