Skip to content

roycw/niles-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

niles-sdk

The runtime SDK for niles apps. Components, CSS, and the nc client that every niles app uses to talk to its backend.

You do not install this. niles apps consume it directly from the browser via esm.sh.

Usage

In your index.html:

<link rel="stylesheet" href="https://esm.sh/gh/roycw/niles-sdk@v2.0.0/css/imports.css">
<script type="module">
  import nc from "https://esm.sh/gh/roycw/niles-sdk@v2.0.0";
  window.nc = nc;
</script>

In your app code:

import m from "https://esm.sh/mithril@2.2.2";
import nc from "https://esm.sh/gh/roycw/niles-sdk@v2.0.0";
import { Button, Card, TextField } from "https://esm.sh/gh/roycw/niles-sdk@v2.0.0/components";

Pin to a specific version tag (@v2.0.0) in production. @latest resolves to the most recent release; useful for prototyping, risky for running apps.

What's in here

  • niles-sdk.js — the nc client (auth, database, storage, edge functions, integrations, subscriptions, user, ...). Same surface as documented in your project's .claude/docs/.
  • components/ — Mithril UI components: Button, Card, Dialog, Popover, Table, TextField, etc. All exported from components/index.js.
  • css/imports.css is the entrypoint; pulls Open Props UI base + per-component styles.
  • analytics.js, visual-editor.js — internal scripts injected by the niles runtime; not for direct import.

Customization

Don't fork. Two supported escape hatches:

  • Looks — override CSS variables in your project's own theme.css. The components use :where() low-specificity selectors so overrides win without !important.
  • Behavior — wrap components in your own. Build MyPrimaryAction that internally calls m(Button, { variant: "filled", ... }).

Releasing

Cut a release with a semver tag:

git tag v1.0.1
git push origin v1.0.1

esm.sh caches by tag — the moment the tag is on GitHub, esm.sh/gh/roycw/niles-sdk@v1.0.1/... resolves to it. (@latest may take a few minutes to refresh; append ?reload to a URL to force a CDN refresh during testing.)

No npm publish step. esm.sh's gh/ registry serves the repo directly.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors