From d79b7554bff9b1a8f011b1b5b83839eef0df5e01 Mon Sep 17 00:00:00 2001 From: ronreg-ribdev <56719257+ronreg-ribdev@users.noreply.github.com> Date: Tue, 12 May 2020 00:10:53 -0700 Subject: [PATCH] Init bartinfo app --- .urbitrc | 2 +- full/gulpfile.js | 164 ------------------ full/tile/tile.js | 20 --- gulpfile.js | 96 +++++++++- package-lock.json | 52 ++++-- {full/src => src}/css/custom.css | 0 {full/src => src}/css/fonts.css | 0 {full/src => src}/css/indigo-static.css | 0 {full/src => src}/index.css | 0 {full/src => src}/index.js | 0 {full/src => src}/js/api.js | 6 +- .../js/components/lib/header-bar.js | 0 .../js/components/lib/icons/icon-home.js | 2 +- .../js/components/lib/icons/icon-spinner.js | 0 .../js/components/lib/icons/sigil.js | 0 {full/src => src}/js/components/root.js | 6 +- {full/src => src}/js/lib/util.js | 0 {full/src => src}/js/reducers/config.js | 2 +- {full/src => src}/js/reducers/initial.js | 0 {full/src => src}/js/reducers/update.js | 0 {full/src => src}/js/store.js | 0 {full/src => src}/js/subscription.js | 8 +- {full/src => src}/js/vendor/sigils-1.2.5.js | 0 tile/tile.js | 9 +- .../app/smol.hoon => urbit/app/bartinfo.hoon | 34 ++-- .../smol => urbit/app/bartinfo}/img/Home.png | Bin .../smol => urbit/app/bartinfo}/img/Tile.png | Bin .../smol => urbit/app/bartinfo}/index.html | 6 +- urbit/app/smol.hoon | 71 -------- 29 files changed, 165 insertions(+), 313 deletions(-) delete mode 100644 full/gulpfile.js delete mode 100644 full/tile/tile.js rename {full/src => src}/css/custom.css (100%) rename {full/src => src}/css/fonts.css (100%) rename {full/src => src}/css/indigo-static.css (100%) rename {full/src => src}/index.css (100%) rename {full/src => src}/index.js (100%) rename {full/src => src}/js/api.js (85%) rename {full/src => src}/js/components/lib/header-bar.js (100%) rename {full/src => src}/js/components/lib/icons/icon-home.js (88%) rename {full/src => src}/js/components/lib/icons/icon-spinner.js (100%) rename {full/src => src}/js/components/lib/icons/sigil.js (100%) rename {full/src => src}/js/components/root.js (82%) rename {full/src => src}/js/lib/util.js (100%) rename {full/src => src}/js/reducers/config.js (75%) rename {full/src => src}/js/reducers/initial.js (100%) rename {full/src => src}/js/reducers/update.js (100%) rename {full/src => src}/js/store.js (100%) rename {full/src => src}/js/subscription.js (74%) rename {full/src => src}/js/vendor/sigils-1.2.5.js (100%) rename full/urbit/app/smol.hoon => urbit/app/bartinfo.hoon (69%) rename {full/urbit/app/smol => urbit/app/bartinfo}/img/Home.png (100%) rename {full/urbit/app/smol => urbit/app/bartinfo}/img/Tile.png (100%) rename {full/urbit/app/smol => urbit/app/bartinfo}/index.html (68%) delete mode 100644 urbit/app/smol.hoon diff --git a/.urbitrc b/.urbitrc index b53c38e..4fa2f49 100644 --- a/.urbitrc +++ b/.urbitrc @@ -1,5 +1,5 @@ module.exports = { URBIT_PIERS: [ - "%URBITPIER%", + "../zod/home", ] }; diff --git a/full/gulpfile.js b/full/gulpfile.js deleted file mode 100644 index eb8b6a3..0000000 --- a/full/gulpfile.js +++ /dev/null @@ -1,164 +0,0 @@ -var gulp = require('gulp'); -var cssimport = require('gulp-cssimport'); -var rollup = require('gulp-better-rollup'); -var cssnano = require('cssnano'); -var postcss = require('gulp-postcss'); -var sucrase = require('@sucrase/gulp-plugin'); -var minify = require('gulp-minify'); - -var resolve = require('rollup-plugin-node-resolve'); -var commonjs = require('rollup-plugin-commonjs'); -var rootImport = require('rollup-plugin-root-import'); -var globals = require('rollup-plugin-node-globals'); - -/*** - Main config options -***/ - -var urbitrc = require('./.urbitrc'); - -/*** - End main config options -***/ - -gulp.task('css-bundle', function() { - let plugins = [ - cssnano() - ]; - return gulp - .src('src/index.css') - .pipe(cssimport()) - .pipe(postcss(plugins)) - .pipe(gulp.dest('./urbit/app/%APPNAME%/css')); -}); - -gulp.task('jsx-transform', function(cb) { - return gulp.src('src/**/*.js') - .pipe(sucrase({ - transforms: ['jsx'] - })) - .pipe(gulp.dest('dist')); -}); - -gulp.task('tile-jsx-transform', function(cb) { - return gulp.src('tile/**/*.js') - .pipe(sucrase({ - transforms: ['jsx'] - })) - .pipe(gulp.dest('dist')); -}); - -gulp.task('js-imports', function(cb) { - return gulp.src('dist/index.js') - .pipe(rollup({ - plugins: [ - commonjs({ - namedExports: { - 'node_modules/react/index.js': [ 'Component' ], - 'node_modules/react-is/index.js': [ 'isValidElementType' ], - } - }), - rootImport({ - root: `${__dirname}/dist/js`, - useEntry: 'prepend', - extensions: '.js' - }), - globals(), - resolve() - ] - }, 'umd')) - .on('error', function(e){ - console.log(e); - cb(); - }) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')) - .on('end', cb); -}); - -gulp.task('tile-js-imports', function(cb) { - return gulp.src('dist/tile.js') - .pipe(rollup({ - plugins: [ - commonjs({ - namedExports: { - 'node_modules/react/index.js': [ 'Component' ], - } - }), - rootImport({ - root: `${__dirname}/dist/js`, - useEntry: 'prepend', - extensions: '.js' - }), - globals(), - resolve() - ] - }, 'umd')) - .on('error', function(e){ - console.log(e); - cb(); - }) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')) - .on('end', cb); -}); - - -gulp.task('js-minify', function () { - return gulp.src('./urbit/app/%APPNAME%/js/index.js') - .pipe(minify()) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')); -}); - -gulp.task('tile-js-minify', function () { - return gulp.src('./urbit/app/%APPNAME%/js/tile.js') - .pipe(minify()) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')); -}); - -gulp.task('urbit-copy', function () { - let ret = gulp.src('urbit/**/*'); - - urbitrc.URBIT_PIERS.forEach(function(pier) { - ret = ret.pipe(gulp.dest(pier)); - }); - - return ret; -}); - -gulp.task('js-bundle-dev', gulp.series('jsx-transform', 'js-imports')); -gulp.task('tile-js-bundle-dev', gulp.series('tile-jsx-transform', 'tile-js-imports')); -gulp.task('js-bundle-prod', gulp.series('jsx-transform', 'js-imports', 'js-minify')) -gulp.task('tile-js-bundle-prod', - gulp.series('tile-jsx-transform', 'tile-js-imports', 'tile-js-minify')); - -gulp.task('bundle-dev', - gulp.series( - gulp.parallel( - 'css-bundle', - 'js-bundle-dev', - 'tile-js-bundle-dev' - ), - 'urbit-copy' - ) -); - -gulp.task('bundle-prod', - gulp.series( - gulp.parallel( - 'css-bundle', - 'js-bundle-prod', - 'tile-js-bundle-prod', - ), - 'urbit-copy' - ) -); - -gulp.task('default', gulp.series('bundle-dev')); - -gulp.task('watch', gulp.series('default', function() { - gulp.watch('tile/**/*.js', gulp.parallel('tile-js-bundle-dev')); - - gulp.watch('src/**/*.js', gulp.parallel('js-bundle-dev')); - gulp.watch('src/**/*.css', gulp.parallel('css-bundle')); - - gulp.watch('urbit/**/*', gulp.parallel('urbit-copy')); -})); diff --git a/full/tile/tile.js b/full/tile/tile.js deleted file mode 100644 index 64b2d2c..0000000 --- a/full/tile/tile.js +++ /dev/null @@ -1,20 +0,0 @@ -import React, { Component } from 'react'; -import _ from 'lodash'; - - -export default class %APPNAME%Tile extends Component { - - render() { - return ( -
- -

%APPNAME%

- -
-
- ); - } - -} - -window.%APPNAME%Tile = %APPNAME%Tile; diff --git a/gulpfile.js b/gulpfile.js index 32eaa0f..d25b8d1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,8 @@ var gulp = require('gulp'); +var cssimport = require('gulp-cssimport'); var rollup = require('gulp-better-rollup'); +var cssnano = require('cssnano'); +var postcss = require('gulp-postcss'); var sucrase = require('@sucrase/gulp-plugin'); var minify = require('gulp-minify'); @@ -18,6 +21,25 @@ var urbitrc = require('./.urbitrc'); End main config options ***/ +gulp.task('css-bundle', function() { + let plugins = [ + cssnano() + ]; + return gulp + .src('src/index.css') + .pipe(cssimport()) + .pipe(postcss(plugins)) + .pipe(gulp.dest('./urbit/app/bartinfo/css')); +}); + +gulp.task('jsx-transform', function(cb) { + return gulp.src('src/**/*.js') + .pipe(sucrase({ + transforms: ['jsx'] + })) + .pipe(gulp.dest('dist')); +}); + gulp.task('tile-jsx-transform', function(cb) { return gulp.src('tile/**/*.js') .pipe(sucrase({ @@ -26,6 +48,32 @@ gulp.task('tile-jsx-transform', function(cb) { .pipe(gulp.dest('dist')); }); +gulp.task('js-imports', function(cb) { + return gulp.src('dist/index.js') + .pipe(rollup({ + plugins: [ + commonjs({ + namedExports: { + 'node_modules/react/index.js': [ 'Component' ], + 'node_modules/react-is/index.js': [ 'isValidElementType' ], + } + }), + rootImport({ + root: `${__dirname}/dist/js`, + useEntry: 'prepend', + extensions: '.js' + }), + globals(), + resolve() + ] + }, 'umd')) + .on('error', function(e){ + console.log(e); + cb(); + }) + .pipe(gulp.dest('./urbit/app/bartinfo/js/')) + .on('end', cb); +}); gulp.task('tile-js-imports', function(cb) { return gulp.src('dist/tile.js') @@ -49,14 +97,21 @@ gulp.task('tile-js-imports', function(cb) { console.log(e); cb(); }) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')) + .pipe(gulp.dest('./urbit/app/bartinfo/js/')) .on('end', cb); }); -gulp.task('tile-js-minify', function () { - return gulp.src('./urbit/app/%APPNAME%/js/tile.js') + +gulp.task('js-minify', function () { + return gulp.src('./urbit/app/bartinfo/js/index.js') .pipe(minify()) - .pipe(gulp.dest('./urbit/app/%APPNAME%/js/')); + .pipe(gulp.dest('./urbit/app/bartinfo/js/')); +}); + +gulp.task('tile-js-minify', function () { + return gulp.src('./urbit/app/bartinfo/js/tile.js') + .pipe(minify()) + .pipe(gulp.dest('./urbit/app/bartinfo/js/')); }); gulp.task('urbit-copy', function () { @@ -69,14 +124,41 @@ gulp.task('urbit-copy', function () { return ret; }); +gulp.task('js-bundle-dev', gulp.series('jsx-transform', 'js-imports')); gulp.task('tile-js-bundle-dev', gulp.series('tile-jsx-transform', 'tile-js-imports')); -gulp.task('tile-js-bundle-prod', +gulp.task('js-bundle-prod', gulp.series('jsx-transform', 'js-imports', 'js-minify')) +gulp.task('tile-js-bundle-prod', gulp.series('tile-jsx-transform', 'tile-js-imports', 'tile-js-minify')); -gulp.task('bundle-prod', gulp.series('tile-js-bundle-prod', 'urbit-copy')); +gulp.task('bundle-dev', + gulp.series( + gulp.parallel( + 'css-bundle', + 'js-bundle-dev', + 'tile-js-bundle-dev' + ), + 'urbit-copy' + ) +); + +gulp.task('bundle-prod', + gulp.series( + gulp.parallel( + 'css-bundle', + 'js-bundle-prod', + 'tile-js-bundle-prod', + ), + 'urbit-copy' + ) +); + +gulp.task('default', gulp.series('bundle-dev')); -gulp.task('default', gulp.series('tile-js-bundle-dev', 'urbit-copy')); gulp.task('watch', gulp.series('default', function() { gulp.watch('tile/**/*.js', gulp.parallel('tile-js-bundle-dev')); + + gulp.watch('src/**/*.js', gulp.parallel('js-bundle-dev')); + gulp.watch('src/**/*.css', gulp.parallel('css-bundle')); + gulp.watch('urbit/**/*', gulp.parallel('urbit-copy')); })); diff --git a/package-lock.json b/package-lock.json index eb1a54c..4f86b66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "create-landscape-app", - "version": "2.0.0", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -401,7 +401,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -1480,7 +1481,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -1643,7 +1645,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -1664,12 +1667,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1684,17 +1689,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -1811,7 +1819,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -1823,6 +1832,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1837,6 +1847,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -1844,12 +1855,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -1868,6 +1881,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -1948,7 +1962,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -1960,6 +1975,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2045,7 +2061,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2081,6 +2098,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2100,6 +2118,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2143,12 +2162,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -5185,7 +5206,8 @@ }, "kind-of": { "version": "6.0.2", - "resolved": "", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } diff --git a/full/src/css/custom.css b/src/css/custom.css similarity index 100% rename from full/src/css/custom.css rename to src/css/custom.css diff --git a/full/src/css/fonts.css b/src/css/fonts.css similarity index 100% rename from full/src/css/fonts.css rename to src/css/fonts.css diff --git a/full/src/css/indigo-static.css b/src/css/indigo-static.css similarity index 100% rename from full/src/css/indigo-static.css rename to src/css/indigo-static.css diff --git a/full/src/index.css b/src/index.css similarity index 100% rename from full/src/index.css rename to src/index.css diff --git a/full/src/index.js b/src/index.js similarity index 100% rename from full/src/index.js rename to src/index.js diff --git a/full/src/js/api.js b/src/js/api.js similarity index 85% rename from full/src/js/api.js rename to src/js/api.js index 317d454..30db2db 100644 --- a/full/src/js/api.js +++ b/src/js/api.js @@ -8,7 +8,7 @@ class UrbitApi { this.bindPaths = []; } - bind(path, method, ship = this.authTokens.ship, appl = "%APPNAME%", success, fail) { + bind(path, method, ship = this.authTokens.ship, appl = "bartinfo", success, fail) { this.bindPaths = _.uniq([...this.bindPaths, path]); window.subscriptionId = window.urb.subscribe(ship, appl, path, @@ -29,8 +29,8 @@ class UrbitApi { }); } - %APPNAME%(data) { - this.action("%APPNAME%", "json", data); + bartinfo(data) { + this.action("bartinfo", "json", data); } action(appl, mark, data) { diff --git a/full/src/js/components/lib/header-bar.js b/src/js/components/lib/header-bar.js similarity index 100% rename from full/src/js/components/lib/header-bar.js rename to src/js/components/lib/header-bar.js diff --git a/full/src/js/components/lib/icons/icon-home.js b/src/js/components/lib/icons/icon-home.js similarity index 88% rename from full/src/js/components/lib/icons/icon-home.js rename to src/js/components/lib/icons/icon-home.js index 77c2934..6071106 100644 --- a/full/src/js/components/lib/icons/icon-home.js +++ b/src/js/components/lib/icons/icon-home.js @@ -6,7 +6,7 @@ export class IconHome extends Component { return ( diff --git a/full/src/js/components/lib/icons/icon-spinner.js b/src/js/components/lib/icons/icon-spinner.js similarity index 100% rename from full/src/js/components/lib/icons/icon-spinner.js rename to src/js/components/lib/icons/icon-spinner.js diff --git a/full/src/js/components/lib/icons/sigil.js b/src/js/components/lib/icons/sigil.js similarity index 100% rename from full/src/js/components/lib/icons/sigil.js rename to src/js/components/lib/icons/sigil.js diff --git a/full/src/js/components/root.js b/src/js/components/root.js similarity index 82% rename from full/src/js/components/root.js rename to src/js/components/root.js index 9b790d2..35fda33 100644 --- a/full/src/js/components/root.js +++ b/src/js/components/root.js @@ -15,12 +15,12 @@ export class Root extends Component {
- { + { return (
-

%APPNAME%

+

bartinfo

Welcome to your Landscape application.

-

To get started, edit src/index.js, tile/tile.js or urbit/app/%APPNAME%.hoon and |commit %home on your Urbit ship to see your changes.

+

To get started, edit src/index.js, tile/tile.js or urbit/app/bartinfo.hoon and |commit %home on your Urbit ship to see your changes.

-> Read the docs
)}} diff --git a/full/src/js/lib/util.js b/src/js/lib/util.js similarity index 100% rename from full/src/js/lib/util.js rename to src/js/lib/util.js diff --git a/full/src/js/reducers/config.js b/src/js/reducers/config.js similarity index 75% rename from full/src/js/reducers/config.js rename to src/js/reducers/config.js index f4ea3a2..04bb524 100644 --- a/full/src/js/reducers/config.js +++ b/src/js/reducers/config.js @@ -3,7 +3,7 @@ import _ from 'lodash'; export class ConfigReducer { reduce(json, state) { - let data = _.get(json, '%APPNAME%', false); + let data = _.get(json, 'bartinfo', false); if (data) { state.inbox = data.inbox; } diff --git a/full/src/js/reducers/initial.js b/src/js/reducers/initial.js similarity index 100% rename from full/src/js/reducers/initial.js rename to src/js/reducers/initial.js diff --git a/full/src/js/reducers/update.js b/src/js/reducers/update.js similarity index 100% rename from full/src/js/reducers/update.js rename to src/js/reducers/update.js diff --git a/full/src/js/store.js b/src/js/store.js similarity index 100% rename from full/src/js/store.js rename to src/js/store.js diff --git a/full/src/js/subscription.js b/src/js/subscription.js similarity index 74% rename from full/src/js/subscription.js rename to src/js/subscription.js index e49306d..e549e4e 100644 --- a/full/src/js/subscription.js +++ b/src/js/subscription.js @@ -7,14 +7,14 @@ import urbitOb from 'urbit-ob'; export class Subscription { start() { if (api.authTokens) { - // this.initialize%APPNAME%(); + // this.initializebartinfo(); } else { console.error("~~~ ERROR: Must set api.authTokens before operation ~~~"); } } - // initialize%APPNAME%() { - // api.bind('/primary', 'PUT', api.authTokens.ship, '%APPNAME%', + // initializebartinfo() { + // api.bind('/primary', 'PUT', api.authTokens.ship, 'bartinfo', // this.handleEvent.bind(this), // this.handleError.bind(this)); // } @@ -25,7 +25,7 @@ export class Subscription { handleError(err) { console.error(err); - api.bind('/primary', 'PUT', api.authTokens.ship, '%APPNAME%', + api.bind('/primary', 'PUT', api.authTokens.ship, 'bartinfo', this.handleEvent.bind(this), this.handleError.bind(this)); } diff --git a/full/src/js/vendor/sigils-1.2.5.js b/src/js/vendor/sigils-1.2.5.js similarity index 100% rename from full/src/js/vendor/sigils-1.2.5.js rename to src/js/vendor/sigils-1.2.5.js diff --git a/tile/tile.js b/tile/tile.js index e15c93a..16209e5 100644 --- a/tile/tile.js +++ b/tile/tile.js @@ -2,16 +2,19 @@ import React, { Component } from 'react'; import _ from 'lodash'; -export default class %APPNAME%Tile extends Component { +export default class bartinfoTile extends Component { render() { return (
-

%APPNAME%

+ +

bartinfo

+ +
); } } -window.%APPNAME%Tile = %APPNAME%Tile; +window.bartinfoTile = bartinfoTile; diff --git a/full/urbit/app/smol.hoon b/urbit/app/bartinfo.hoon similarity index 69% rename from full/urbit/app/smol.hoon rename to urbit/app/bartinfo.hoon index 71fb8ba..eccde14 100644 --- a/full/urbit/app/smol.hoon +++ b/urbit/app/bartinfo.hoon @@ -2,34 +2,34 @@ /= index /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/index + /: /===/app/bartinfo/index /| /html/ /~ ~ == /= tile-js /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/js/tile + /: /===/app/bartinfo/js/tile /| /js/ /~ ~ == /= script /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/js/index + /: /===/app/bartinfo/js/index /| /js/ /~ ~ == /= style /^ octs /; as-octs:mimes:html - /: /===/app/%APPNAME%/css/index + /: /===/app/bartinfo/css/index /| /css/ /~ ~ == -/= %APPNAME%-png +/= bartinfo-png /^ (map knot @) - /: /===/app/%APPNAME%/img /_ /png/ + /: /===/app/bartinfo/img /_ /png/ :: |% +$ card card:agent:gall @@ -38,16 +38,16 @@ =< |_ bol=bowl:gall +* this . - %APPNAME%-core +> - cc ~(. %APPNAME%-core bol) + bartinfo-core +> + cc ~(. bartinfo-core bol) def ~(. (default-agent this %|) bol) :: ++ on-init ^- (quip card _this) - =/ launcha [%launch-action !>([%add %%APPNAME% / '/~%APPNAME%/js/tile.js'])] + =/ launcha [%launch-action !>([%add %bartinfo / '/~bartinfo/js/tile.js'])] :_ this - :~ [%pass / %arvo %e %connect [~ /'~%APPNAME%'] %%APPNAME%] - [%pass /%APPNAME% %agent [our.bol %launch] %poke launcha] + :~ [%pass / %arvo %e %connect [~ /'~bartinfo'] %bartinfo] + [%pass /bartinfo %agent [our.bol %launch] %poke launcha] == ++ on-poke |= [=mark =vase] @@ -96,18 +96,18 @@ ^- simple-payload:http =+ url=(parse-request-line url.request.inbound-request) ?+ site.url not-found:gen - [%'~%APPNAME%' %css %index ~] (css-response:gen style) - [%'~%APPNAME%' %js %tile ~] (js-response:gen tile-js) - [%'~%APPNAME%' %js %index ~] (js-response:gen script) + [%'~bartinfo' %css %index ~] (css-response:gen style) + [%'~bartinfo' %js %tile ~] (js-response:gen tile-js) + [%'~bartinfo' %js %index ~] (js-response:gen script) :: - [%'~%APPNAME%' %img @t *] + [%'~bartinfo' %img @t *] =/ name=@t i.t.t.site.url - =/ img (~(get by %APPNAME%-png) name) + =/ img (~(get by bartinfo-png) name) ?~ img not-found:gen (png-response:gen (as-octs:mimes:html u.img)) :: - [%'~%APPNAME%' *] (html-response:gen index) + [%'~bartinfo' *] (html-response:gen index) == :: -- diff --git a/full/urbit/app/smol/img/Home.png b/urbit/app/bartinfo/img/Home.png similarity index 100% rename from full/urbit/app/smol/img/Home.png rename to urbit/app/bartinfo/img/Home.png diff --git a/full/urbit/app/smol/img/Tile.png b/urbit/app/bartinfo/img/Tile.png similarity index 100% rename from full/urbit/app/smol/img/Tile.png rename to urbit/app/bartinfo/img/Tile.png diff --git a/full/urbit/app/smol/index.html b/urbit/app/bartinfo/index.html similarity index 68% rename from full/urbit/app/smol/index.html rename to urbit/app/bartinfo/index.html index ce9e6c9..dcf8837 100644 --- a/full/urbit/app/smol/index.html +++ b/urbit/app/bartinfo/index.html @@ -1,16 +1,16 @@ - %APPNAME% + bartinfo - +
- + diff --git a/urbit/app/smol.hoon b/urbit/app/smol.hoon deleted file mode 100644 index ef8b0e2..0000000 --- a/urbit/app/smol.hoon +++ /dev/null @@ -1,71 +0,0 @@ -/+ *server, default-agent, verb -/= tile-js - /^ octs - /; as-octs:mimes:html - /: /===/app/%APPNAME%/js/tile - /| /js/ - /~ ~ - == -=, format -:: -%+ verb | -^- agent:gall -|_ =bowl:gall -+* this . - def ~(. (default-agent this %|) bowl) -:: -++ on-init - ^- (quip card:agent:gall _this) - =/ launcha - [%launch-action !>([%add %%APPNAME% /%APPNAME%tile '/~%APPNAME%/js/tile.js'])] - :_ this - :~ [%pass / %arvo %e %connect [~ /'~%APPNAME%'] %%APPNAME%] - [%pass /%APPNAME% %agent [our.bowl %launch] %poke launcha] - == -++ on-save on-save:def -++ on-load on-load:def -++ on-poke - |= [=mark =vase] - ^- (quip card:agent:gall _this) - ?. ?=(%handle-http-request mark) - (on-poke:def mark vase) - =+ !<([eyre-id=@ta =inbound-request:eyre] vase) - :_ this - %+ give-simple-payload:app eyre-id - %+ require-authorization:app inbound-request - |= =inbound-request:eyre - =/ request-line (parse-request-line url.request.inbound-request) - =/ back-path (flop site.request-line) - =/ name=@t - =/ back-path (flop site.request-line) - ?~ back-path - '' - i.back-path - :: - ?~ back-path - not-found:gen - ?: =(name 'tile') - (js-response:gen tile-js) - not-found:gen -:: -++ on-watch - |= =path - ^- (quip card:agent:gall _this) - ?: ?=([%http-response *] path) - `this - ?. =([/%APPNAME%tile *] path) - (on-watch:def path) - [[%give %fact ~ %json !>(*json)]~ this] -:: -++ on-leave on-leave:def -++ on-peek on-peek:def -++ on-agent on-agent:def -++ on-arvo - |= [=wire =sign-arvo] - ^- (quip card:agent:gall _this) - ?. ?=(%bound +<.sign-arvo) - (on-arvo:def wire sign-arvo) - [~ this] -:: -++ on-fail on-fail:def ---