From 744c655666c1209a5edaa5c849a3de11e7eb55b7 Mon Sep 17 00:00:00 2001 From: Dave Landry Date: Mon, 8 Jul 2019 17:05:32 -0400 Subject: [PATCH] updates environment --- .eslintrc | 11 +------- .github/CONTRIBUTING.md | 57 ++++++++++++++++++++++++++++++++++++++++- .travis.yml | 4 +++ LICENSE | 2 +- package.json | 3 ++- 5 files changed, 64 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index 4e55a3b..6714361 100644 --- a/.eslintrc +++ b/.eslintrc @@ -128,16 +128,7 @@ ], "quotes": 2, "radix": 2, - "require-jsdoc": [ - 1, - { - "require": { - "FunctionDeclaration": true, - "MethodDefinition": true, - "ClassDeclaration": true - } - } - ], + "require-jsdoc": 2, "require-yield": 2, "semi": 2, "semi-spacing": 2, diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 747e7ed..b026eb2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,7 +19,7 @@ And that's it! Now your environment should be all set up and ready to go. ## Writing Code -With the introduction of modules in D3plus 2.0, all code is transpiled using [buble](http://buble.surge.sh/), which allows usage of most of the good bits from ES6. If you are unfamiliar with ES6, then normal vanilla javascript works fine as well (but we may suggest PR revisions to include more succinct ES6). All source code lives in the `./src` directory. +With the introduction of modules in D3plus 2.0, all code is transpiled using [babel](https://babeljs.io/), which allows usage of most of the good bits from ES6. If you are unfamiliar with ES6, then normal vanilla javascript works fine as well (but we may suggest PR revisions to include more succinct ES6). All source code lives in the `./src` directory. ## Code Style @@ -67,6 +67,28 @@ npm test ``` > This command will also lint all files according to the provided `.eslintc` file. +D3plus uses [zora](https://github.com/lorenzofox3/zora) for running tests, and [tape-run](https://github.com/juliangruber/tape-run) for outputting the results. Here is an example of what a test file could look like: + +```js +import {test} from "zora"; + +test("testing booleans", assert => { + + assert.equal(true, true, "testing true"); + assert.equal(false, false, "testing false"); + +}); + +test("testing numbers", assert => { + + assert.equal(1, 1, "testing 1"); + assert.equal(2, 2, "testing 2"); + +}); + +export default test; +``` + ## Examples All D3plus 2.0 examples seen on [d3plus.org](https://d3plus.org) are created from within their respective repositories. The examples are parsed from any markdown files placed in the `./example` directory, with the following behaviors: @@ -106,6 +128,39 @@ A screenshot of each example is generated from the rendered HTML. By default, ea [height]: 100 ``` +Adding all that together, here is a sample of what a full example could look like: + +`````md +[width]: 100 +[height]: 100 + +# A Cool Red Square + +In this example, we show you how to add a red square to a webpage! + +```html +
+``` + +Wow, look at that container element. Such beauty. + +```css +#container > div { + background-color: red; + height: 100px; + width: 100px; +} +``` + +CSS. Amazing. Now let's finish this off with some JavaScript! + +```js +var box = document.createElement("div"); +document.getElementById("container").appendChild(box); +``` + +````` + ## Submitting a Pull Request Push to your fork and [submit a pull request](https://github.com/d3plus/d3plus-form/compare/). At this point, you're waiting on us. We may suggest some changes or improvements or alternatives. diff --git a/.travis.yml b/.travis.yml index 1562619..f3871df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,10 @@ addons: packages: - xvfb +before_install: + - echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections + - sudo apt-get install ttf-mscorefonts-installer + install: - export DISPLAY=':99.0' - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & diff --git a/LICENSE b/LICENSE index 9d0b8f6..aebd3b6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 D3plus +Copyright (c) 2019 D3plus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 59d8dee..a1924de 100644 --- a/package.json +++ b/package.json @@ -45,5 +45,6 @@ "build/d3plus-form.js.map", "build/d3plus-form.min.js", "es" - ] + ], + "sideEffects": false }