Browse Source

QoL updates

master
ポール ウェッブ 10 months ago
parent
commit
74605fbc7e
18 changed files with 268 additions and 1531 deletions
  1. 10
    10
      .babelrc
  2. 9
    29
      .eslintrc
  3. 6
    6
      .gitignore
  4. 15
    31
      README.md
  5. 14
    11
      dist/index.html
  6. 0
    2
      dist/js/bundle.js
  7. 0
    1
      dist/js/bundle.js.map
  8. 0
    1309
      dist/js/bundle.mjs
  9. 7
    1
      index.js
  10. 42
    34
      package.json
  11. 44
    31
      scripts/rollup.base.js
  12. 19
    10
      scripts/rollup.es.js
  13. 22
    12
      scripts/rollup.umd.js
  14. 26
    12
      scripts/rollup.watch.js
  15. 21
    4
      src/index.js
  16. 0
    21
      src/page/__tests__/page.spec.js
  17. 17
    0
      src/page/index.js
  18. 16
    7
      src/styles/index.js

+ 10
- 10
.babelrc View File

@@ -1,17 +1,17 @@
1 1
 {
2
-  "presets": [
3
-    ["@babel/preset-env"]
2
+  presets: [
3
+    "@babel/env"
4 4
   ],
5
-  "env": {
6
-    "test": {
7
-      "presets": [
8
-        "@babel/preset-env"
5
+  env: {
6
+    test: {
7
+      presets: [
8
+        "@babel/env"
9 9
       ]
10 10
     },
11
-    "production": {
12
-      "presets": [
13
-        ["@babel/preset-env"],
14
-        ["minify"]
11
+    production: {
12
+      presets: [
13
+        "@babel/env",
14
+        "minify"
15 15
       ],
16 16
     }
17 17
   }

+ 9
- 29
.eslintrc View File

@@ -1,32 +1,12 @@
1
-
2 1
 {
3
-  "env": {
4
-    "browser": true,
5
-    "commonjs": true,
6
-    "es6": true
2
+  env: {
3
+    browser: true,
4
+    commonjs: true,
5
+    es6: true
7 6
   },
8
-  "extends": "eslint:recommended",
9
-  "parserOptions": {
10
-    "sourceType": "module",
11
-    "ecmaVersion": 7
12
-  },
13
-  "rules": {
14
-    "indent": [
15
-      "error",
16
-      2
17
-    ],
18
-    "linebreak-style": [
19
-      "error",
20
-      "unix"
21
-    ],
22
-    "quotes": [
23
-      "error",
24
-      "double"
25
-    ],
26
-    "semi": [
27
-      "error",
28
-      "always"
29
-    ],
30
-    "no-console": 1
7
+  extends: "@inc",
8
+  parserOptions: {
9
+    ecmaVersion: 7,
10
+    sourceType: "module"
31 11
   }
32
-}
12
+}

+ 6
- 6
.gitignore View File

@@ -1,10 +1,10 @@
1
-node_modules
1
+# Files
2 2
 .DS_Store
3
-build/js/
4
-npm-debug.log*
5
-__snapshots__
3
+.env
6 4
 *.log
7
-
8 5
 *.lock
6
+Thumbs.db
9 7
 
10
-package-lock.json
8
+# Directories
9
+dist/scripts
10
+node_modules

+ 15
- 31
README.md View File

@@ -1,53 +1,40 @@
1
-# mithril-starter-rollup
1
+# mithril-starter
2
+
3
+
2 4
 
3 5
 Project setup with:
4
-* [Mithril](http://mithril.js.org)
5
-* [Rollup](http://rollupjs.org) for optimized module bundles
6 6
 * [Babel](http://babeljs.io) for transpiling es2015 to es5
7
-* [LiveReload](https://github.com/livereload/livereload-js) to view code changes directly in the browser
8
-* [Jest](https://facebook.github.io/jest) to run BDD tests and create component snapshots
9 7
 * [ESLint](http://eslint.org) to find syntax errors and get a standardized coding style
8
+* [LiveReload](https://github.com/livereload/livereload-js) to view code changes directly in the browser
9
+* [Mithril](http://mithril.js.org)
10
+* [Rollup](http://rollupjs.org) for optimized module bundles
10 11
 
11
-A couple of styles are included using [Tachyon](http://tachyons.io), but these can simply be replaced with your own CSS solution.
12
+Basic styles are included using [Tachyon](http://tachyons.io), but these can simply be replaced with your own CSS solution.
12 13
 
13
-If you want to check out the isomorphic example with Fastify, check out [this branch](https://git.inc.sh/NetOperatorWibby/mithril-starter/src/branch/isomorphic).
14
+*If you want to check out the isomorphic example of using Mithril with Fastify, check out [this branch](https://git.inc.sh/NetOperatorWibby/mithril-starter/src/branch/isomorphic).*
14 15
 
15 16
 
16 17
 
17 18
 ## Setup
18 19
 
19 20
 Install dependencies
21
+
20 22
 ```bash
21 23
 npm i
22 24
 ```
23 25
 
24
-
25
-
26 26
 ## Build and watch
27 27
 
28 28
 Script commands defined in `package.json`:
29 29
 
30
-* `build`: creates a minified bundle in `dist/js/`
31
-* `serve`: serves the build directory at [localhost:5000](http://localhost:5000)
32
-* `dev`: starts a local webserver; creates a bundle in `dist/js/` that is being updated with each code change; calls LiveReload to refresh the browser after code changes are built
30
+* `build`: creates a minified bundle in `dist/scripts/`
31
+* `start`: serves the build directory at [localhost:5000](http://localhost:5000)
32
+* `watch`: starts a local webserver; creates a bundle in `dist/scripts/` that is being updated with each code change; calls LiveReload to refresh the browser after code changes are built
33 33
 
34
-Call `npm run dev` and open a web page at [localhost:8080](http://localhost:8080). The port number is set by environment variable `PORT` in `package.json`.
34
+Call `npm run watch` and open a web page at [localhost:8080](http://localhost:8080). The port number is set by environment variable `PORT` in `package.json`.
35 35
 
36 36
 When making changes, the terminal will show lint errors, if any.
37 37
 
38
-
39
-
40
-## Testing
41
-
42
-See [mithril-jest](https://github.com/ArthurClemens/mithril-jest) for a short overview of Jest.
43
-
44
-* `npm run test`: starts a test run (only useful to know if tests are passing)
45
-* `npm run test:watch`: starts an interactive session with the option to evaluate and update existing snapshots
46
-
47
-To run tests alongside the `watch` command, use a separate terminal window.
48
-
49
-
50
-
51 38
 ## Configuration files
52 39
 
53 40
 `scripts` contains a couple of Rollup configuration files. The scripts use `rollup.base.js` as base configuration.
@@ -57,7 +44,6 @@ FYI, the base configuration:
57 44
 * Reads `package.json` to read package dependencies. If `includeDepencies` is `true`, it will include those dependencies in the build file
58 45
 * Creates global package names; and sets global `m` for package "mithril".
59 46
 
60
-
61 47
 ### Bundler configuration
62 48
 
63 49
 * `rollup.es.js`: Builds an ES2015 module with syntax features that node supports
@@ -67,15 +53,13 @@ FYI, the base configuration:
67 53
 Optional environment variables:
68 54
 
69 55
 * `DEPS` (Number 0 or 1): include dependencies
70
-* `WATCH_DIR` (String): sets the watch directory when running the `dev` script
71
-* `PORT` (Number): sets the http server port when running the `dev` script
72
-
56
+* `WATCH_DIR` (String): sets the watch directory when running the `watch` script
57
+* `PORT` (Number): sets the http server port when running the `watch` script
73 58
 
74 59
 Other configuration files:
75 60
 * `.babelrc`: Babel configuration
76 61
 * `.eslintrc`: ESLint configuration
77 62
 
78
-
79 63
 ## License
80 64
 
81 65
 MIT

+ 14
- 11
dist/index.html View File

@@ -1,13 +1,16 @@
1
-<!doctype html>
2
-<html>
3
-  <title>Mithril Starter Rollup</title>
4
-  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0">
5
-  <meta name="mobile-web-app-capable" content="yes">
6
-  <meta name="apple-mobile-web-app-capable" content="yes">
7
-  <meta http-equiv="cleartype" content="on">
8
-  <link rel="stylesheet" href="https://unpkg.com/tachyons/css/tachyons.min.css">
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <meta charset="utf-8"/>
4
+  <title>Mithril Starter</title>
5
+
6
+  <meta name="apple-mobile-web-app-capable" content="yes"/>
7
+  <meta name="mobile-web-app-capable" content="yes"/>
8
+  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0"/>
9
+
10
+  <link rel="stylesheet" href="https://unpkg.com/tachyons/css/tachyons.min.css"/>
11
+
9 12
   <body>
10
-    <div id="app"></div>
11
-    <script src="js/bundle.js"></script>
13
+    <app></app>
14
+    <script src="scripts/bundle.js"></script>
12 15
   </body>
13
-</html>  
16
+</html>

+ 0
- 2
dist/js/bundle.js
File diff suppressed because it is too large
View File


+ 0
- 1
dist/js/bundle.js.map
File diff suppressed because it is too large
View File


+ 0
- 1309
dist/js/bundle.mjs
File diff suppressed because it is too large
View File


+ 7
- 1
index.js View File

@@ -1 +1,7 @@
1
-import "./src/index";
1
+"use strict";
2
+
3
+
4
+
5
+//  U T I L
6
+
7
+import "./src/index";

+ 42
- 34
package.json View File

@@ -1,32 +1,8 @@
1 1
 {
2
-  "name": "mithril-starter-rollup",
3
-  "version": "1.0.4",
4
-  "description": "Mithril Starter Project with Rollup, Babel, LiveReload and ESLint",
5
-  "license": "MIT",
6
-  "repository": {
7
-    "type": "git",
8
-    "url": "https://github.com/ArthurClemens/mithril-starter-rollup.git"
9
-  },
10
-  "main": "dist/js/bundle",
11
-  "module": "dist/js/bundle.mjs",
12
-  "scripts": {
13
-    "build": "npm run clean && npm run rollup",
14
-    "clean": "rimraf dist/js/*",
15
-    "dev": "rollup -c ./scripts/rollup.watch.js --environment DEPS:1,PORT:8080,WATCH_DIR:./dist/ --watch",
16
-    "rollup": "rollup -c ./scripts/rollup.umd.js --environment DEPS:1 && rollup -c ./scripts/rollup.es.js --environment DEPS:1",
17
-    "serve": "http-server -p 5000 dist",
18
-    "test": "jest src/**",
19
-    "test:watch": "jest src/** --watch",
20
-    "update": "updates -u ./"
21
-  },
22
-  "files": [
23
-    "dist",
24
-    "README.md"
25
-  ],
26
-  "jest": {
27
-    "verbose": true,
28
-    "testURL": "http://localhost/"
2
+  "dependencies": {
3
+    "mithril": "^1.1.6"
29 4
   },
5
+  "description": "Mithril starter project with Babel, ESLint, LiveReload, and Rollup",
30 6
   "devDependencies": {
31 7
     "@babel/cli": "^7.2.3",
32 8
     "@babel/core": "^7.2.2",
@@ -35,13 +11,14 @@
35 11
     "@babel/plugin-transform-runtime": "^7.2.0",
36 12
     "@babel/preset-env": "^7.3.1",
37 13
     "@babel/register": "^7.0.0",
14
+    "@inc/eslint-config": "^1.1.2",
38 15
     "babel-core": "^7.0.0-bridge.0",
39 16
     "babel-eslint": "^10.0.1",
40
-    "babel-jest": "^24.1.0",
41 17
     "es-module-loader": "^2.3.0",
18
+    "eslint": "^5.13.0",
42 19
     "http-server": "^0.11.1",
43
-    "jest": "^24.1.0",
44
-    "mithril-jest": "^1.0.3",
20
+    "husky": "^1.3.1",
21
+    "npm-run-all": "^4.1.5",
45 22
     "rimraf": "^2.6.3",
46 23
     "rollup": "^1.1.2",
47 24
     "rollup-plugin-babel": "^4.3.2",
@@ -53,9 +30,40 @@
53 30
     "rollup-plugin-serve": "^1.0.1",
54 31
     "rollup-plugin-uglify": "^6.0.2",
55 32
     "rollup-watch": "^4.3.1",
56
-    "updates": "^7.0.0"
33
+    "snazzy": "^8.0.0",
34
+    "standardx": "^3.0.1",
35
+    "updates": "^7.1.0"
57 36
   },
58
-  "dependencies": {
59
-    "mithril": "^1.1.6"
60
-  }
37
+  "engines": {
38
+    "node": ">=11.0.0"
39
+  },
40
+  "files": [
41
+    "dist",
42
+    "README.md"
43
+  ],
44
+  "husky": {
45
+    "hooks": {
46
+      "pre-commit": "npm run format && git add -A :/"
47
+    }
48
+  },
49
+  "license": "MIT",
50
+  "main": "dist/scripts/bundle",
51
+  "module": "dist/scripts/bundle.mjs",
52
+  "name": "mithril-starter",
53
+  "repository": {
54
+    "type": "git",
55
+    "url": "https://git.inc.sh/NetOperatorWibby/mithril-starter.git"
56
+  },
57
+  "scripts": {
58
+    "build": "npm run clean && npm run rollup",
59
+    "clean": "rimraf dist/js/*",
60
+    "format": "eslint '**/*.js' --fix --ignore-pattern '/dist/'",
61
+    "rollup": "rollup --config ./scripts/rollup.umd.js --environment DEPS:1 && rollup -c ./scripts/rollup.es.js --environment DEPS:1",
62
+    "start": "npm run build && http-server -p 5000 dist",
63
+    "test": "run-s test:*",
64
+    "test:dependencies": "updates --update ./",
65
+    "test:lint": "standardx --verbose | snazzy",
66
+    "watch": "rollup --config ./scripts/rollup.watch.js --environment DEPS:1,PORT:8080,WATCH_DIR:./dist/ --watch"
67
+  },
68
+  "version": "1.0.0"
61 69
 }

+ 44
- 31
scripts/rollup.base.js View File

@@ -1,52 +1,58 @@
1
+"use strict";
2
+
3
+
4
+
5
+//  N A T I V E
6
+
1 7
 import fs from "fs";
8
+
9
+//  I M P O R T S
10
+
2 11
 import babel from "rollup-plugin-babel";
3
-import { eslint } from "rollup-plugin-eslint";
4
-import resolve from "rollup-plugin-node-resolve";
5 12
 import commonjs from "rollup-plugin-commonjs";
13
+import { eslint } from "rollup-plugin-eslint";
6 14
 import pathmodify from "rollup-plugin-pathmodify";
15
+import resolve from "rollup-plugin-node-resolve";
16
+
17
+//  U T I L S
7 18
 
8 19
 export const pkg = JSON.parse(fs.readFileSync("./package.json"));
9
-if (!pkg) {
20
+
21
+if (!pkg)
10 22
   throw("Could not read package.json");
11
-}
12
-const env = process.env; // eslint-disable-line no-undef
13
-const input = env.INPUT || "index.js";
14
-const name = env.NAME || pkg.name;
15
-const external = Object.keys(pkg.dependencies || {});
16 23
 
24
+const env = process.env;
25
+const external = Object.keys(pkg.dependencies || {});
17 26
 const globals = {};
27
+const input = env.INPUT || "index.js";
28
+const name = env.NAME || pkg.name;
18 29
 
19 30
 external.forEach(ext => {
20
-  switch (ext) {
21
-  case "mithril":
22
-    globals["mithril"] = "m";
23
-    break;
24
-  default:
25
-    globals[ext] = ext;
31
+  switch(ext) {
32
+    case "mithril":
33
+      globals["mithril"] = "m";
34
+      break;
35
+
36
+    default:
37
+      globals[ext] = ext;
38
+      break;
26 39
   }
27 40
 });
28 41
 
29 42
 export const createConfig = ({ includeDepencies }) => ({
30
-  input,
31 43
   external: includeDepencies ? [] : external,
44
+  input,
32 45
   output: {
33 46
     name,
34
-    globals,
47
+    globals
35 48
   },
36 49
   plugins: [
37
-    // Resolve libs in node_modules
38
-    resolve({
39
-      jsnext: true,
40
-      main: true,
50
+    eslint({
51
+      cache: true
41 52
     }),
42 53
 
43
-    pathmodify({
44
-      aliases: [
45
-        {
46
-          id: "mithril/stream",
47
-          resolveTo: "node_modules/mithril/stream.js"
48
-        }
49
-      ]
54
+    babel({
55
+      exclude: "node_modules/**"
50 56
     }),
51 57
 
52 58
     // Convert CommonJS modules to ES6, so they can be included in a Rollup bundle
@@ -54,12 +60,19 @@ export const createConfig = ({ includeDepencies }) => ({
54 60
       include: "node_modules/**"
55 61
     }),
56 62
 
57
-    eslint({
58
-      cache: true
63
+    pathmodify({
64
+      aliases: [
65
+        {
66
+          id: "mithril/stream",
67
+          resolveTo: "node_modules/mithril/stream.js"
68
+        }
69
+      ]
59 70
     }),
60 71
 
61
-    babel({
62
-      exclude: "node_modules/**"
72
+    // Resolve libs in node_modules
73
+    resolve({
74
+      jsnext: true,
75
+      main: true
63 76
     })
64 77
   ]
65 78
 });

+ 19
- 10
scripts/rollup.es.js View File

@@ -1,24 +1,33 @@
1
-/* globals process */
2
-/*
3
-Build to a module that has ES2015 module syntax but otherwise only syntax features that node supports
4
-https://github.com/rollup/rollup/wiki/jsnext:main
5
-*/
6
-import { pkg, createConfig } from "./rollup.base.js";
1
+"use strict";
2
+
3
+
7 4
 
8
-const includeDepencies = !!parseInt(process.env.DEPS, 10) || false; // Use `false` if you are creating a library, or if you are including external script in html
9
-const env = process.env; // eslint-disable-line no-undef
5
+//  U T I L S
10 6
 
7
+import { pkg, createConfig } from "./rollup.base.js";
8
+
9
+const env = process.env;
10
+// Use `false` if you are creating a library, or if you are including external script in html
11
+const includeDepencies = !!parseInt(env.DEPS, 10) || false;
11 12
 const baseConfig = createConfig({ includeDepencies });
13
+
12 14
 const targetConfig = Object.assign({}, baseConfig, {
13 15
   output: Object.assign(
14 16
     {},
15
-    baseConfig.output,
16
-    {
17
+    baseConfig.output, {
17 18
       file: `${env.DEST || pkg.main}.mjs`,
18 19
       format: "es"
19 20
     }
20 21
   )
21 22
 });
22 23
 
24
+
25
+
26
+//  E X P O R T
27
+
23 28
 export default targetConfig;
24 29
 
30
+
31
+
32
+// Build to a module that has ES2015 module syntax but otherwise only syntax features that node supports
33
+// https://github.com/rollup/rollup/wiki/jsnext:main

+ 22
- 12
scripts/rollup.umd.js View File

@@ -1,21 +1,25 @@
1
-/*
2
-Build to an Universal Module Definition
3
-*/
4
-import { pkg, createConfig } from "./rollup.base.js";
1
+"use strict";
2
+
3
+
4
+
5
+//  I M P O R T
6
+
5 7
 import { uglify } from "rollup-plugin-uglify";
6 8
 
7
-const env = process.env; // eslint-disable-line no-undef
8
-const includeDepencies = !!parseInt(env.DEPS, 10) || false; // Use `false` if you are creating a library, or if you are including external script in html
9
-const createSourceMap = env.SOURCEMAP !== undefined
10
-  ? !!parseInt(env.SOURCEMAP, 10)
11
-  : true;
9
+//  U T I L S
10
+
11
+import { pkg, createConfig } from "./rollup.base.js";
12 12
 
13
+const env = process.env;
14
+const createSourceMap = env.SOURCEMAP !== undefined ? !!parseInt(env.SOURCEMAP, 10) : true;
15
+// Use `false` if you are creating a library, or if you are including external script in html
16
+const includeDepencies = !!parseInt(env.DEPS, 10) || false;
13 17
 const baseConfig = createConfig({ includeDepencies });
18
+
14 19
 const targetConfig = Object.assign({}, baseConfig, {
15 20
   output: Object.assign(
16 21
     {},
17
-    baseConfig.output,
18
-    {
22
+    baseConfig.output, {
19 23
       file: `${env.DEST || pkg.main}.js`,
20 24
       format: "umd",
21 25
       sourcemap: createSourceMap
@@ -23,8 +27,14 @@ const targetConfig = Object.assign({}, baseConfig, {
23 27
   )
24 28
 });
25 29
 
26
-
27 30
 targetConfig.plugins.push(uglify());
28 31
 
32
+
33
+
34
+//  E X P O R T
35
+
29 36
 export default targetConfig;
30 37
 
38
+
39
+
40
+// Build to an Universal Module Definition

+ 26
- 12
scripts/rollup.watch.js View File

@@ -1,23 +1,30 @@
1
-/*
2
-Builds a UMD bundle that is updated with each file change
3
-*/
4
-import umdConfig from "./rollup.umd.js";
1
+"use strict";
2
+
3
+
4
+
5
+//  I M P O R T S
6
+
5 7
 import livereload from "rollup-plugin-livereload";
6 8
 import serve from "rollup-plugin-serve";
7 9
 
8
-const env = process.env; // eslint-disable-line no-undef
10
+//  U T I L S
9 11
 
12
+import umdConfig from "./rollup.umd.js";
13
+
14
+const env = process.env;
15
+const serverPort = parseInt(env.PORT, 10);
16
+const targetConfig = Object.assign({}, umdConfig);
10 17
 const watchDir = env.WATCH_DIR;
11
-if (!watchDir) {
18
+
19
+
20
+
21
+//  P R O G R A M
22
+
23
+if (!watchDir)
12 24
   throw("Missing WATCH_DIR: no watch directory");
13
-}
14 25
 
15
-const serverPort = parseInt(env.PORT, 10);
16
-if (!serverPort) {
26
+if (!serverPort)
17 27
   throw("Missing PORT: no http server port");
18
-}
19
-
20
-const targetConfig = Object.assign({}, umdConfig);
21 28
 
22 29
 targetConfig.plugins.push(
23 30
   serve({
@@ -32,5 +39,12 @@ targetConfig.plugins.push(
32 39
   })
33 40
 );
34 41
 
42
+
43
+
44
+//  E X P O R T
45
+
35 46
 export default targetConfig;
36 47
 
48
+
49
+
50
+// Builds a UMD bundle that is updated with each file change

+ 21
- 4
src/index.js View File

@@ -1,12 +1,21 @@
1
+"use strict";
2
+
3
+
4
+
5
+//  I M P O R T
6
+
1 7
 import m from "mithril";
8
+
9
+//  U T I L S
10
+
2 11
 import CSS from "./styles";
3 12
 import Page from "./page";
4 13
 
5 14
 const links = [
6 15
   {
7
-    path: "/page",
8 16
     module: Page,
9
-    name: "Link to Page"
17
+    name: "Link to Page",
18
+    path: "/page"
10 19
   }
11 20
 ];
12 21
 
@@ -23,10 +32,18 @@ const Index = {
23 32
     ])
24 33
 };
25 34
 
26
-m.route.prefix(""); // #
27
-const mountNode = document.querySelector("#app");
35
+const mountNode = document.querySelector("app");
36
+
28 37
 const routes = {
29 38
   "/": Index
30 39
 };
40
+
41
+
42
+
43
+//  P R O G R A M
44
+
45
+m.route.prefix("");
46
+
31 47
 links.forEach(link => routes[link.path] = link.module);
48
+
32 49
 m.route(mountNode, "/", routes);

+ 0
- 21
src/page/__tests__/page.spec.js View File

@@ -1,21 +0,0 @@
1
-/* global describe, it, expect */
2
-import m from "mithril";
3
-import { tidy } from "mithril-jest";
4
-import Page from "../";
5
-
6
-describe("Page component", () => {
7
-  it("default title should be 'Page'", () => {
8
-    const cmp = m(Page);
9
-    const html = tidy(cmp);
10
-    expect(html).toContain("Page");
11
-    expect(html).toMatchSnapshot();
12
-  });
13
-  it("should render a custom title", () => {
14
-    const title = "Custom page title";
15
-    const cmp = m(Page, { title });
16
-    const html = tidy(cmp);
17
-    expect(html).toContain(title);
18
-    expect(html).toMatchSnapshot();
19
-  });
20
-});
21
-

+ 17
- 0
src/page/index.js View File

@@ -1,6 +1,19 @@
1
+"use strict";
2
+
3
+
4
+
5
+//  I M P O R T
6
+
1 7
 import m from "mithril";
8
+
9
+//  U T I L
10
+
2 11
 import CSS from "../styles";
3 12
 
13
+
14
+
15
+//  P R O G R A M
16
+
4 17
 const Page = {
5 18
   view: ({ attrs }) =>
6 19
     m(CSS.page, [
@@ -12,4 +25,8 @@ const Page = {
12 25
     ])
13 26
 };
14 27
 
28
+
29
+
30
+//  E X P O R T
31
+
15 32
 export default Page;

+ 16
- 7
src/styles/index.js View File

@@ -1,15 +1,24 @@
1
-/*
2
-Theme style definitions using Tachyons.
3
-Complete list of tags: http://tachyons.io/docs/table-of-styles/
4
-*/
1
+"use strict";
2
+
3
+
4
+
5
+//  U T I L
5 6
 
6 7
 const CSS = {
7
-  page: ".pa4.sans-serif",
8
-  pageTitle: "h1.med-gray.f3",
9 8
   link: "a.link.underline-hover.blue",
10 9
   list: "ul.list.pl0",
11
-  listItem: "li.mv1"
10
+  listItem: "li.mv1",
11
+  page: ".pa4.sans-serif",
12
+  pageTitle: "h1.med-gray.f3"
12 13
 };
13 14
 
15
+
16
+
17
+//  E X P O R T
18
+
14 19
 export default CSS;
15 20
 
21
+
22
+
23
+// Theme style definitions using Tachyons
24
+// Complete list of tags: http://tachyons.io/docs/table-of-styles

Loading…
Cancel
Save