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

citydna-app-test

v1.0.13

Published

This project was bootstrapped with `create-react-app` using the `citydna` template.

Downloads

1

Readme

This project was bootstrapped with create-react-app using the citydna template.

Just FYI...

This is a Typescript project. Typescript is a superset of Javascript that provides a better developer experience. Coming from a javascript it can seem strict and annoying at first, however, once you get going you'll never look back. Importantly, it means lots of documentation is baked right into the @citydna/ packages which you can access through most good IDEs. We recommend Visual Studio Code and it's IntelliSense.

Developing your app

If you've just cloned this repository, first run yarn to install dependencies.

Then run yarn start to run the app in local development mode.

Open http://localhost:3000 to view it in the browser:

Open src/applet/Controls.dna.tsx and you'll notice how @citydna/platform is being used to emit events. Take a look at src/applet/Screen.dna.tsx and you'll see the same package being used to listen for events via the useEvent hook. This is how related devices talk to each other.

For more advanced usage and leveraging the 3D model, open src/applet/Projection.dna.tsx and see how it's possible to add deck.gl layers and manipulate the mapbox map directly.

A local event bus is used so you don't have to worry about polluting the platform with messages. In production, web sockets via pusher are used to provide near instant communication between connected devices.

What are .dna.tsx files?

As a convention, files suffixed with .dna.tsx are app screens for devices on the platform. They are the entry point for webpack and tell the platform what components are available for use on what devices.

Write tests for your app

Your app will most likely be public facing. Because of this, it's essential that you write automated tests to ensure any changes or updates don't break previously build features. We've started for you in src/__tests__/integration.tsx. @testing-library/react, @deck.gl/test-utils and mapbox-gl-js-mock are included by default.

Further reading:

Your tests will be automatically be run everytime you publish to npm.

Prep your app for the platform

Once you're happy with your app, you can build it and publish it to npm. Open package.json and ensure your name entry begins with citydna-app-, i.e. citydna-app-wayfinding. Add an entry files:

{
  name: "citydna-app-wayfinding",
  files: ["dist"]
  ...
}

Running yarn build:app will test your app and package the Control, Screen, Projection components, along with any dependencies into single files in the dist folder. The platform uses these at runtime and injects all react context, as well as several packages, to ensure the app runs as natively as possible.

Sign up for an npm account if you don't already have one, then run yarn publish. This will test, build, version your app and push it up to npm. Your package will now be available at https://npm.org/packages/citydna-app-wayfinding.

To test this in a live sandboxed mode on pusher, visit https://citydna.melbourne.vic.gov.au/sandbox/wayfinding

Submit your app

When you're happy your app works as expected, fill out this form to submit your app to the platform and we can get it running live in no time.