Skip to content

Commit

Permalink
UI Drafter => UI Rig
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfortis committed Jan 31, 2024
1 parent 02085a1 commit 6154c64
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 50 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022 Uxtely LLC
Copyright (c) 2022-24 Uxtely LLC

js-utils

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JavaScript Utils

These JavaScript utilities are used in UI Drafter.
These JavaScript utilities are used in UI Rig.

Feel free to adapt them to your needs; they are [ISC licensed](./LICENSE).

2 changes: 1 addition & 1 deletion bunnycdn-uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { readFileSync, readdirSync, lstatSync } from 'node:fs'


/**
* At UI Drafter we no longer use CDNs, but here's how we used to do it:
* At UI Rig we no longer use CDNs, but here's how we used to do it:
* - upload new .mp4 of the `localDir`
* - ignores subdirectories
* - skips already uploaded videos
Expand Down
2 changes: 1 addition & 1 deletion indexed-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Promisifies and automates the ceremony of the browser’s `IndexedDB`.

## Pros
- Battle tested in https://uidrafter.com
- Battle tested in https://uirig.com
- Lightweight (40 LoC)

## Cons
Expand Down
2 changes: 1 addition & 1 deletion make-error-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { writeFileSync } from 'node:fs'

// The error pages have no extension, see
// https://blog.uidrafter.com/pretty-routes-for-static-html
// https://blog.uirig.com/pretty-routes-for-static-html
[
'./static-pages-bundler/example-blog/root/root-meta/',
'./static-pages-bundler/example-docs/root/root-meta/'
Expand Down
2 changes: 1 addition & 1 deletion proxy-fields-obfuscator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export { FF }


## Another Example
In UI Drafter, the Card data structure is like this:
In UI Rig, the Card data structure is like this:
```js
let CF = {
id: 0,
Expand Down
4 changes: 2 additions & 2 deletions reactive-state/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It’s a standalone plain JS object that’s bindable to the state of many React
class components without needing higher-order components (HOC).

As it's standalone and importable, it can be used in two leaf components,
for either updating the state or for re-rendering. For example, in [UI Drafter](https://uidrafter.com)
for either updating the state or for re-rendering. For example, in [UI Rig](https://uirig.com)
hitting **User****Delete all Files** needs to refresh **<HomeFileList/>**.
So with this `ReactiveState`, there’s no need to write code in a parent
component to handle this coupling, as it can be imported where it’s needed.
Expand All @@ -21,7 +21,7 @@ require a DOM. For example, to test the router function, we assert the value of
some cases eliminates, the need for DOM based testing, which are slow and brittle.

## Why?
As UI Drafter started out as a Meteor project, it used its
As UI Rig started out as a Meteor project, it used its
[ReactiveVar](https://docs.meteor.com/api/reactive-var.html) extensively. Therefore,
this `ReactiveState` is a re-implementation for React class components of ReactiveVar.

Expand Down
2 changes: 1 addition & 1 deletion static-pages-bundler/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ignore-scripts=true # https://blog.uidrafter.com/getting-rid-of-npm-scripts
ignore-scripts=true # https://blog.uirig.com/getting-rid-of-npm-scripts
18 changes: 9 additions & 9 deletions static-pages-bundler/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Static Site Generator

This is a tiny (under 400 LoC) bundler used for:
- [docs.uidrafter.com](https://docs.uidrafter.com)
- [blog.uidrafter.com](https://blog.uidrafter.com)
- [uidrafter.com](https://uidrafter.com)
- [docs.uirig.com](https://docs.uirig.com)
- [blog.uirig.com](https://blog.uirig.com)
- [uirig.com](https://uirig.com)


## HTML Template
Expand All @@ -18,7 +18,7 @@ It serves and auto reloads the browser on changes.
## Production Build
It crawls the dev server and saves each route as static html page. For pretty
URLs, it saves the pages without the `.html` extension, see [Pretty routes
for static HTML](https://blog.uidrafter.com/pretty-routes-for-static-html)
for static HTML](https://blog.uirig.com/pretty-routes-for-static-html)

- **Assets:** JS and CSS files get inlined with their corresponding CSP nonces.

Expand All @@ -27,7 +27,7 @@ for static HTML](https://blog.uidrafter.com/pretty-routes-for-static-html)

- [**media-optimizer.sh**](./media-optimizer.sh):
- **Images**: We [Conditionally Serve AVIF and WebP with
Nginx](https://blog.uidrafter.com/conditional-avif-for-video-posters). So
Nginx](https://blog.uirig.com/conditional-avif-for-video-posters). So
it auto-generates AVIF and WebP from each PNG.
- **Videos:** MP4 get rewritten if needed for fast playback.

Expand Down Expand Up @@ -74,11 +74,11 @@ npm install -g eslint \


## Deployment Tips
- [Hitting 304s Across Servers](https://blog.uidrafter.com/hitting-304-across-servers)
- [Deploy Assets Before Documents](https://blog.uidrafter.com/deploy-assets-before-documents)
- [Securely creating TLS certificates with Let's Encrypt](https://blog.uidrafter.com/isolated-tls-certificate-creation)
- [Hitting 304s Across Servers](https://blog.uirig.com/hitting-304-across-servers)
- [Deploy Assets Before Documents](https://blog.uirig.com/deploy-assets-before-documents)
- [Securely creating TLS certificates with Let's Encrypt](https://blog.uirig.com/isolated-tls-certificate-creation)


## CDN Media Uploading
See [bunnycdn-uploader.js](../bunnycdn-uploader.js) for a script to upload video files to BunnyCDN.
It's no longer used in UI Drafter, and it hasn't been used it in a while…
It's no longer used in UI Rig, and it hasn't been used it in a while…
2 changes: 1 addition & 1 deletion static-pages-bundler/example-blog/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ switch (process.argv[2]) {

case 'production':
// For drafting blog posts, we exclude files starting with an underscore from the production build.
buildProduction(router, routes.filter(r => !r.startsWith('/_')), 'blog.uidrafter.com', '$blog_csp')
buildProduction(router, routes.filter(r => !r.startsWith('/_')), 'blog.uirig.com', '$blog_csp')
break

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1>
<section>
<h2>Example</h2>
<p>
In UI Drafter, a connection's color varies when
In UI Rig, a connection's color varies when
it's <code class="codeArg">selected</code>, <code class="codeArg">hovered</code>, and their combinations.
</p>

Expand Down
24 changes: 11 additions & 13 deletions static-pages-bundler/example-blog/root/htmlTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default function htmlTemplate(docRoutes, html, iRoute) {
<html lang="en">
<head>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="assets/base.css">
${head}
Expand All @@ -20,12 +19,11 @@ export default function htmlTemplate(docRoutes, html, iRoute) {
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="favicon-apple-icon-touch.png">
<link rel="dns-prefetch" href="//uidrafter.com">
</head>
<body>
<nav>
<div class="bodyWidth">
<a tabindex="0" href="//uidrafter.com" title="Website">
<a tabindex="0" href="//uirig.com" title="Website">
<svg xmlns="http://www.w3.org/2000/svg" id="LogoPosNav" viewBox="0 0 80 20"><!-- @KeepSync #LogoPosB -->
<path class="LetterU1" d="m7.18 5.12c.813.0218.544 4.63.399 6.77-.317 2.16-1.72 3.18-2.62 1.58-.491-.873-1.29-6.11.0982-8.65" />
<path class="LetterU1" d="m10 4.16c.0742 2.06-.0736 8.52.132 11-.156.812-3.75.944-3.75.944-.123-.218 1.29-1.25 1.45-2.18.433-2.62.32-7.5.791-9.97" />
Expand All @@ -38,9 +36,9 @@ export default function htmlTemplate(docRoutes, html, iRoute) {
</a>
<div id="NavRight">
<a href="//free.uidrafter.com">Free App</a>
<a href="//docs.uidrafter.com">Docs</a>
<a href="//blog.uidrafter.com">Blog</a>
<a href="//my.uirig.com">Free App</a>
<a href="//docs.uirig.com">Docs</a>
<a href="//blog.uirig.com">Blog</a>
</div>
</div>
</nav>
Expand All @@ -55,12 +53,12 @@ export default function htmlTemplate(docRoutes, html, iRoute) {
<path class="LetterD1" d="m12.3 13.6c1.68.145 2.65-1.09 2.71-3.2.0613-1.71-.495-3.47-2.92-3.79 1.5.155 4.74-1.39 5.63 3.17-.477 3.44-2.96 4.97-5.44 3.82z" />
<path class="LetterD0" d="m11.7 3.23.113 13.6s3.47-.466 3.58-.502c.346-.0452 3.62-1.33 3.39-6.46-.221-4.77-3.21-5.74-3.62-5.86-.952-.321-3.48-.792-3.48-.792zm2.45 3.35.876.123s1.93.346 1.94 3.43c0 3.47-2.17 3.56-2.17 3.56l-.661.01z" />
</svg>
<div class="Line1">UI Drafter</div>
<div class="Line1">UI Rig</div>
</div>
${body}
${hideSponsor ? '' : `
<a href="//uidrafter.com" id="Outro">
<a href="//uirig.com" id="Outro">
<p>Sponsored by:</p>
<svg xmlns="http://www.w3.org/2000/svg" id="LogoOutro" viewBox="0 0 80 20">
<path class="LetterU1" d="m7.18 5.12c.813.0218.544 4.63.399 6.77-.317 2.16-1.72 3.18-2.62 1.58-.491-.873-1.29-6.11.0982-8.65" />
Expand All @@ -77,19 +75,19 @@ export default function htmlTemplate(docRoutes, html, iRoute) {
<footer>
<div>
<div id="SocialLinks">
<a target="_blank" aria-label="Twitter" href="//twitter.com/uidrafter">
<a target="_blank" aria-label="Twitter" href="//twitter.com/uirig">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
<path d="M45.7 10.5a17.8 17.8 0 01-5.1 1.4A9 9 0 0044.5 7a17.8 17.8 0 01-5.7 2.2 8.9 8.9 0 00-15.1 8A25.3 25.3 0 015.3 8a8.9 8.9 0 002.8 11.9 8.9 8.9 0 01-4-1.1 9 9 0 007 8.8 9 9 0 01-4 .2 9 9 0 008.4 6.2 17.9 17.9 0 01-13.2 3.7 25.2 25.2 0 0013.6 4 25.2 25.2 0 0025.4-25.4v-1.1a18.1 18.1 0 004.4-4.7z"/>
</svg>
</a>
<a target="_blank" aria-label="Facebook" href="//www.facebook.com/uidrafter">
<a target="_blank" aria-label="Facebook" href="//www.facebook.com/uirig">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
<path d="M5.3 3A2.3 2.3 0 003 5.3v37.4A2.3 2.3 0 005.3 45h20.1V28.7H20v-6.3h5.4v-4.7c0-5.4 3.4-8.4 8.2-8.4 2.3 0 4.3.2 4.9.3v5.7H35c-2.6 0-3.1 1.2-3.1 3v4.1h6.3l-.9 6.3H32V45h10.7a2.3 2.3 0 002.3-2.3V5.3A2.3 2.3 0 0042.7 3z"/>
</svg>
</a>
<a target="_blank" aria-label="Instagram" href="//www.instagram.com/uidrafter">
<a target="_blank" aria-label="Instagram" href="//www.instagram.com/uirig">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
<path d="M45 24l-.1 8.6c-.2 3.9-1.3 6.8-3.4 8.9-2.2 2-5 3.2-8.9 3.4L24 45l-8.6-.1c-3.9-.2-6.8-1.3-8.9-3.4-2-2-3.2-5-3.4-8.9L3 24l.1-8.6c.2-3.9 1.3-6.8 3.4-8.9 2-2 5-3.2 8.9-3.4L24 3l8.6.1c3.9.2 6.8 1.3 8.9 3.4 2 2.2 3.2 5 3.4 8.9L45 24zM26 6.7h-6.9l-2.6.1c-1.1 0-2.1.1-2.9.3a8 8 0 00-2 .5c-.8.4-1.6.9-2.4 1.6a7 7 0 00-1.6 2.4 65.7 65.7 0 00-.8 4.8v15.2c0 1 .1 2 .3 2.8l.5 2c.4.9 1 1.6 1.6 2.4a7 7 0 002.5 1.6 65.7 65.7 0 004.8.8H31.6c1 0 2-.1 2.8-.3a8 8 0 004.4-2 7 7 0 001.6-2.5 65.7 65.7 0 00.8-4.8V19v-2.6c0-1-.1-2-.3-2.8a8 8 0 00-.5-2 9.4 9.4 0 00-1.6-2.4 7 7 0 00-2.4-1.6 65.7 65.7 0 00-4.8-.8H26zm5.6 9.6a10.4 10.4 0 013.1 7.7c0 3-1 5.5-3.1 7.7a10.4 10.4 0 01-7.7 3 10.6 10.6 0 01-7.6-3A10.4 10.4 0 0113 24c0-3 1-5.5 3.1-7.7a10.4 10.4 0 017.7-3c3 0 5.6.9 7.7 3zM28.9 29a7 7 0 000-10 6.8 6.8 0 00-5-2c-2 0-3.6.7-5 2a6.8 6.8 0 00-2 5c0 2 .6 3.7 2 5a6.8 6.8 0 005 2c2 0 3.6-.6 5-2zm8-18c.5.5.8 1.1.8 1.8s-.3 1.3-.8 1.8-1 .8-1.7.8-1.3-.3-1.8-.8-.8-1.1-.8-1.8.3-1.3.8-1.8 1-.8 1.8-.8c.7 0 1.2.3 1.7.8z"/>
</svg>
Expand All @@ -104,13 +102,13 @@ export default function htmlTemplate(docRoutes, html, iRoute) {
<span class="FooterLeftLinks">
<a id="cor" href="#contact">Contact</a>
<a target="_blank" href="//uidrafter.com/report-issue">Issues</a>
<a target="_blank" href="//uirig.com/report-issue">Issues</a>
</span>
</div>
<div class="FooterRight">
<a href="/disclaimer" target="_blank">Disclaimer</a>
<a href="//uidrafter.com/privacy" target="_blank">Privacy</a>
<a href="//uirig.com/privacy" target="_blank">Privacy</a>
<a href="https://uxtely.com" target="_blank" class="Copyright">
&copy;2022&nbsp;&nbsp;Uxtely&nbsp;LLC
</a>
Expand Down
2 changes: 1 addition & 1 deletion static-pages-bundler/example-blog/root/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<head>
<title>UI Drafter Blog</title>
<title>UI Rig Blog</title>
<link rel="stylesheet" href="index.css">
</head>

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sitemap: https://blog.uidrafter.com/sitemap.txt
Sitemap: https://blog.uirig.com/sitemap.txt
4 changes: 2 additions & 2 deletions static-pages-bundler/example-docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ switch (process.argv[2]) {
break

case 'production':
buildProduction(router, routes, 'docs.uidrafter.com', '$docs_csp').then(async () => {
buildProduction(router, routes, 'docs.uirig.com', '$docs_csp').then(async () => {
const server = http.createServer(router)
server.listen(0, DevHost, async error => {
if (error)
Expand All @@ -53,7 +53,7 @@ switch (process.argv[2]) {

async function throwIfHasDeadLinks(port) {
const knownLinks = [
'//uidrafter.com',
'//uirig.com',
'//uxtely.com',
'https://github.com/uxtely/server-side-card-api-examples',
'https://github.com/uxtely/css-editor-connector'
Expand Down
2 changes: 1 addition & 1 deletion static-pages-bundler/example-docs/root/cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ <h2>Pasting from Spreadsheets</h2>
<div class="RegionImg">
<img width="460"
src="media/cards-pasting-from-spreadsheets.png"
alt="How to paste from spreadsheets to UI Drafter" />
alt="How to paste from spreadsheets to UI Rig" />
</div>
</section>
<!-- TODO pasting from plain text (in another section) -->
Expand Down
4 changes: 2 additions & 2 deletions static-pages-bundler/example-docs/root/htmlTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export default function htmlTemplate(RouteDefs, html, iRoute) {
${head}
${nextPagePrefetch}
<link rel="dns-prefetch" href="//uidrafter.com">
<link rel="dns-prefetch" href="//uirig.com">
</head>
<body>
<header>
<a tabindex="0" href="//uidrafter.com" title="Website">
<a tabindex="0" href="//uirig.com" title="Website">
<svg class="Logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 20">
<path class="LetterU1" d="m7.18 5.12c.813.0218.544 4.63.399 6.77-.317 2.16-1.72 3.18-2.62 1.58-.491-.873-1.29-6.11.0982-8.65" />
<path class="LetterU1" d="m10 4.16c.0742 2.06-.0736 8.52.132 11-.156.812-3.75.944-3.75.944-.123-.218 1.29-1.25 1.45-2.18.433-2.62.32-7.5.791-9.97" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Sitemap: https://docs.uidrafter.com/sitemap.txt
Sitemap: https://docs.uirig.com/sitemap.txt

2 changes: 1 addition & 1 deletion static-pages-bundler/example-docs/root/shortcuts.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<head>
<meta name="description" content="Keyboard Shortcuts of UI Drafter">
<meta name="description" content="Keyboard Shortcuts of UI Rig">
<link rel="stylesheet" href="shortcuts.css">
</head>

Expand Down
8 changes: 4 additions & 4 deletions static-pages-bundler/example-docs/root/workspaces.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>Workspaces</h1>

<section>
<p>
UI Drafter is an installable web&nbsp;app.
UI Rig is an installable web&nbsp;app.
</p>
<ul>
<li>
Expand All @@ -33,7 +33,7 @@ <h2>Home</h2>
<div class="FullImg">
<img
src="media/workspaces-home.png"
alt="UI Drafter's Home" />
alt="UI Rig's Home" />
</div>
</section>

Expand All @@ -48,7 +48,7 @@ <h2>Drafter <span class="normalWeight">Workspace</span></h2>
<div class="FullImg">
<img
src="media/workspaces-drafter.png"
alt="UI Drafter's Drafter Workspace" />
alt="UI Rig's Drafter Workspace" />
</div>
</section>

Expand All @@ -62,7 +62,7 @@ <h2>Previewer <span class="normalWeight">Workspace</span></h2>
<div class="FullImg light">
<img
src="media/workspaces-previewer.png"
alt="UI Drafter's Previewer Workspace" />
alt="UI Rig's Previewer Workspace" />
</div>
</section>

Expand Down
2 changes: 1 addition & 1 deletion static-pages-bundler/media-optimizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -o noglob
IFS=$'\n'

# https://blog.uidrafter.com/convert-to-avif-programmatically
# https://blog.uirig.com/convert-to-avif-programmatically

abort() { # Prints the message in red to stderr
printf "\033[31m ABORTED: $1\n\033[0m" >&2
Expand Down
2 changes: 1 addition & 1 deletion static-pages-bundler/media-remaper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { copy, sha1, makeDir, listFiles } from '../fs-utils.js'
*
* Yes, all use the SHA-1 from the original PNG. That way
* in nginx.conf we can conditionally serve the best format.
* https://blog.uidrafter.com/conditional-avif-for-video-posters
* https://blog.uirig.com/conditional-avif-for-video-posters
*
* We don't use JPGs (explained in ./media-optimizer.sh)
*/
Expand Down
2 changes: 1 addition & 1 deletion type-check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ new Person({ unspecified: true })
```

## See also
https://blog.uidrafter.com/types-without-typescript
https://blog.uirig.com/types-without-typescript
2 changes: 1 addition & 1 deletion video-player/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Plain JS + CSS HTML5 Video Player
This is minimal video player, it's used in UI Drafter’s website and documentation.
This is minimal video player, it's used in UI Rig’s website and documentation.

## License
This program is [ISC licensed](../LICENSE).

0 comments on commit 6154c64

Please sign in to comment.