From 4001582e10ed5e170a042bde4e3706582247e0c9 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Sun, 24 Jul 2022 23:03:43 -0500 Subject: [PATCH 01/19] Install mustache.js --- .gitignore | 1 + package-lock.json | 31 +++++++++++++++++++++++++++++++ package.json | 23 +++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .gitignore create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..85f7fc1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,31 @@ +{ + "name": "noharm", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "noharm", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "mustache": "^4.2.0" + } + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + } + }, + "dependencies": { + "mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..54a5657 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "noharm", + "version": "1.0.0", + "description": "**A license for developers who write code for a better world**", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/IRod22/NoHarm.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/IRod22/NoHarm/issues" + }, + "homepage": "https://github.com/IRod22/NoHarm#readme", + "dependencies": { + "mustache": "^4.2.0" + } +} From 53500a6e2ba8069380e2507a6728ce3b488e12c1 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Sun, 24 Jul 2022 23:29:10 -0500 Subject: [PATCH 02/19] Create base template and work on title --- templates/license.mustache | 222 +++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 templates/license.mustache diff --git a/templates/license.mustache b/templates/license.mustache new file mode 100644 index 0000000..a5a3758 --- /dev/null +++ b/templates/license.mustache @@ -0,0 +1,222 @@ +# {{license_name}} License + +{{#version}}Version {{major}}.{{minor}}, {{month}} {{year}}{{/version}} + +{{repo_url}} + +{{#all_caps}}terms and conditions for {{terms}}{{/all_caps}} + +## 1. Preamble + +Most software today is developed with little to no thought of how it will be used, or the +consequences for our society and planet. + +As software developers, we engineer the infrastructure of the 21st century. We recognise that our +infrastructure has great power to shape the world and the lives of those we share it with, and we +choose to consciously take responsibility for the social and environmental impacts of what we build. + +We envisage a world free from injustice, inequality, and the reckless destruction of lives and our +planet. We reject slavery in all its forms, whether by force, indebtedness, or by algorithms that +hack human vulnerabilities. We seek a world where humankind is at peace with our neighbours, nature, +and ourselves. We want our work to enrich the physical, mental and spiritual wellbeing of all +society. + +We build software to further this vision of a just world, or at the very least, to not put that +vision further from reach. + +## 2. Definitions + +"License" must mean the terms and conditions for use, reproduction, and distribution as defined by +Sections 1 through 9 of this document. + +"Licensor" must mean the copyright owner or entity authorized by the copyright owner that is +granting the License. + +"Legal Entity" must mean the union of the acting entity and all other entities that control, are +controlled by, or are under common control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") must mean an individual or Legal Entity exercising permissions granted by this +License. + +"Source" form must mean the preferred form for making modifications, including but not limited to +software source code, documentation source, and configuration files. + +"Object" form must mean any form resulting from mechanical transformation or translation of a +Source form, including but not limited to compiled object code, generated documentation, and +conversions to other media types. + +"Work" must mean the work of authorship, whether in Source or Object form, made available under the +License, as indicated by a copyright notice that is included in or attached to the work (an example +is provided in the Appendix below). + +"Derivative Works" must mean any work, whether in Source or Object form, that is based on (or +derived from) the Work and for which the editorial revisions, annotations, elaborations, or other +modifications represent, as a whole, an original work of authorship. For the purposes of this +License, Derivative Works must not include works that remain separable from, or merely link (or +bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" must mean any work of authorship, including the original version of the Work and any +modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted +to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity +authorized to submit on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent to the Licensor or +its representatives, including but not limited to communication on electronic mailing lists, source +code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding communication that is +conspicuously marked or otherwise designated in writing by the copyright owner as "Not a +Contribution." + +"Contributor" must mean Licensor and any individual or Legal Entity on behalf of whom a +Contribution has been received by Licensor and subsequently incorporated within the Work. + +"Forests" must mean 0.5 or more hectares of trees that were either planted more than 50 years ago +or were not planted by humans or human made equipment. + +"Deforestation" must mean the clearing, burning or destruction of 0.5 or more hectares of forests +within a 1 year period. + +## 3. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a +perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to +reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and +distribute the Work and such Derivative Works in Source or Object form. + +## 4. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a +perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this +section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer +the Work, where such license applies only to those patent claims licensable by such Contributor that +are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or +a Contribution incorporated within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that Work must terminate as of the +date such litigation is filed. + +## 5. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with +or without modifications, and in Source or Object form, provided that You meet the following +conditions: + +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + +2. You must cause any modified files to carry prominent notices stating that You changed the + files; and + +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, + patent, trademark, and attribution notices from the Source form of the Work, excluding those + notices that do not pertain to any part of the Derivative Works; and + +4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission; and + +5. This software must not be used by any organisation, website, product, or service that: + 1. promotes, lobbies for or derives a majority of income from: + 1. **abuses of human rights**: + * human trafficking + * sex trafficking + * slavery or indentured servitude + * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality + * hate speech + 2. **environmental destruction**: + * the extraction or sale of fossil fuels + * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests + * the abuse, inhumane killing or neglect of animals under human control + * industrial processes that generate waste products that threaten life + 3. **conflict and war**: + * warfare + * war crimes + * weapons manufacturing + * violence (except when required to protect public safety) + 4. **addictive or destructive products and services**: + * gambling + * tobacco + * products that encourage adversely addictive behaviours + + 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: + * peace + * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) + * peaceful assembly and association (including worker associations) + * a sustainable environment + * democratic processes + + ; and + +6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative + Works that You distribute must include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not pertain to any part of the + Derivative Works, in at least one of the following places: within a NOTICE text file + distributed as part of the Derivative Works; within the Source form or documentation, if + provided along with the Derivative Works; or, within a display generated by the Derivative + Works, if and wherever such third-party notices normally appear. The contents of the NOTICE + file are for informational purposes only and do not modify the License. You may add Your own + attribution notices within Derivative Works that You distribute, alongside or as an addendum to + the NOTICE text from the Work, provided that such additional attribution notices cannot be + construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or +different license terms and conditions for use, reproduction, or distribution of Your modifications, +or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of +the Work otherwise complies with the conditions stated in this License. + +## 6. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the +Work by You to the Licensor must be under the terms and conditions of this License, without any +additional terms or conditions. Notwithstanding the above, nothing herein must supersede or modify +the terms of any separate license agreement you may have executed with Licensor regarding such +Contributions. + +## 7. Trademarks + +This License does not grant permission to use the trade names, trademarks, service marks, or product +names of the Licensor, except as required for reasonable and customary use in describing the origin +of the Work and reproducing the content of the NOTICE file. + +## 8. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied, including, without limitation, any warranties or conditions of +TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +## 9. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), contract, or +otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or +agreed to in writing, must any Contributor be liable to You for damages, including any direct, +indirect, special, incidental, or consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but not limited to damages for +loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial +damages or losses), even if such Contributor has been advised of the possibility of such damages. + +## 10. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee +for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights +consistent with this License. However, in accepting such obligations, You may act only on Your own +behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or +claims asserted against, such Contributor by reason of your accepting any such warranty or +additional liability. + +END OF TERMS AND CONDITIONS + +Copyright (year) [owner](url). + +Licensed under the Do No Harm License, Version 0.1 (the "License"); you may not use this file except +in compliance with the License. You may obtain a +[copy](https://github.com/raisely/NoHarm/licenses/apache-2.0.md) of the License. + +Unless required by applicable law or agreed to in writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing permissions and limitations under the +License. From 7972d8261c43a3156c9a3a9b707893176b86a6ac Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Mon, 25 Jul 2022 19:34:01 -0500 Subject: [PATCH 03/19] Update dependencies --- package-lock.json | 284 +++++++++++++++++++- package.json | 2 +- templates/{license.mustache => license.ejs} | 26 +- templates/preamble.ejs | 17 ++ 4 files changed, 297 insertions(+), 32 deletions(-) rename templates/{license.mustache => license.ejs} (91%) create mode 100644 templates/preamble.ejs diff --git a/package-lock.json b/package-lock.json index 85f7fc1..c4e64b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,23 +9,287 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "mustache": "^4.2.0" + "ejs": "^3.1.8" } }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/ejs": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", + "dependencies": { + "jake": "^10.8.5" + }, "bin": { - "mustache": "bin/mustache" + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } } }, "dependencies": { - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "ejs": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", + "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", + "requires": { + "jake": "^10.8.5" + } + }, + "filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "requires": { + "minimatch": "^5.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "jake": { + "version": "10.8.5", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", + "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "requires": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } } } } diff --git a/package.json b/package.json index 54a5657..d5a2f56 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,6 @@ }, "homepage": "https://github.com/IRod22/NoHarm#readme", "dependencies": { - "mustache": "^4.2.0" + "ejs": "^3.1.8" } } diff --git a/templates/license.mustache b/templates/license.ejs similarity index 91% rename from templates/license.mustache rename to templates/license.ejs index a5a3758..1d9f683 100644 --- a/templates/license.mustache +++ b/templates/license.ejs @@ -1,28 +1,12 @@ -# {{license_name}} License +# <%= license_name %> License -{{#version}}Version {{major}}.{{minor}}, {{month}} {{year}}{{/version}} +Version <%= version.major %>.<%= version.minor %>, <%= version.month %> <%= version.year %> -{{repo_url}} +<%= repo_url %> -{{#all_caps}}terms and conditions for {{terms}}{{/all_caps}} +TERMS AND CONDITIONS FOR <%= join(actions).toUpperCase() %> -## 1. Preamble - -Most software today is developed with little to no thought of how it will be used, or the -consequences for our society and planet. - -As software developers, we engineer the infrastructure of the 21st century. We recognise that our -infrastructure has great power to shape the world and the lives of those we share it with, and we -choose to consciously take responsibility for the social and environmental impacts of what we build. - -We envisage a world free from injustice, inequality, and the reckless destruction of lives and our -planet. We reject slavery in all its forms, whether by force, indebtedness, or by algorithms that -hack human vulnerabilities. We seek a world where humankind is at peace with our neighbours, nature, -and ourselves. We want our work to enrich the physical, mental and spiritual wellbeing of all -society. - -We build software to further this vision of a just world, or at the very least, to not put that -vision further from reach. +<%- include('preamble') %> ## 2. Definitions diff --git a/templates/preamble.ejs b/templates/preamble.ejs new file mode 100644 index 0000000..11e2fba --- /dev/null +++ b/templates/preamble.ejs @@ -0,0 +1,17 @@ +## 1. Preamble + +Most software today is developed with little to no thought of how it will be used, or the +consequences for our society and planet. + +As software developers, we engineer the infrastructure of the 21st century. We recognise that our +infrastructure has great power to shape the world and the lives of those we share it with, and we +choose to consciously take responsibility for the social and environmental impacts of what we build. + +We envisage a world free from injustice, inequality, and the reckless destruction of lives and our +planet. We reject slavery in all its forms, whether by force, indebtedness, or by algorithms that +hack human vulnerabilities. We seek a world where humankind is at peace with our neighbours, nature, +and ourselves. We want our work to enrich the physical, mental and spiritual wellbeing of all +society. + +We build software to further this vision of a just world, or at the very least, to not put that +vision further from reach. \ No newline at end of file From 1424a2e1216af9c49a8a986c35c44a3bf8f5fc95 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Mon, 25 Jul 2022 19:36:52 -0500 Subject: [PATCH 04/19] Add data, configuration, and build script --- build.js | 61 +++++++++++++ licenses/NoHarm.md | 222 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + source/config.js | 4 + source/context.js | 24 +++++ source/data.js | 17 ++++ 6 files changed, 329 insertions(+) create mode 100644 build.js create mode 100644 licenses/NoHarm.md create mode 100644 source/config.js create mode 100644 source/context.js create mode 100644 source/data.js diff --git a/build.js b/build.js new file mode 100644 index 0000000..b4bed33 --- /dev/null +++ b/build.js @@ -0,0 +1,61 @@ +const ctx = require('./source/context'), + config = require('./source/config'), + fs = require('fs'), + path = require('path'), + ejs = require('ejs') +const data = require('./source/data') + +/** + * @param {string} f + * @returns {Promise} + */ +function read(f) { + return new Promise((resolve, reject) => { + const stream = fs.createReadStream(f) + stream.on('error', reject) + let res = '' + stream.on('data', chunk => { + res += chunk + }) + stream.on('end', () => resolve(res)) + }) +} +/** + * @param {string} f + * @param {string} data + * @returns {Promise} + */ +function write(f, data) { + return new Promise((resolve, reject) => { + fs.writeFile(f, data, err => { + if (err) reject(err) + else resolve() + }) + }) +} + +const load_partials = async () => { + const partials_list = config.templates.partials.map(p => ({ + name: p, + file: path.resolve( + config.templates.dir, + `${config.templates.main}.${config.templates.extension}` + ), + })), /** @type {{[key: string]: string}} */ partials = {} + + for (const { name, file } of partials_list) { + partials[name] = await read(file) + } + return partials +} + +const start = () => { + ejs.renderFile(config.main, ctx, (err, txt) => { + if (err) throw err + fs.writeFile(config.dest, txt, err => { + if (err) throw err + }) + }) +} + +start() \ No newline at end of file diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md new file mode 100644 index 0000000..31948f7 --- /dev/null +++ b/licenses/NoHarm.md @@ -0,0 +1,222 @@ +# Do No Harm License + +Version 0.3, July 2022 + +https://github.com/raisely/NoHarm + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +## 1. Preamble + +Most software today is developed with little to no thought of how it will be used, or the +consequences for our society and planet. + +As software developers, we engineer the infrastructure of the 21st century. We recognise that our +infrastructure has great power to shape the world and the lives of those we share it with, and we +choose to consciously take responsibility for the social and environmental impacts of what we build. + +We envisage a world free from injustice, inequality, and the reckless destruction of lives and our +planet. We reject slavery in all its forms, whether by force, indebtedness, or by algorithms that +hack human vulnerabilities. We seek a world where humankind is at peace with our neighbours, nature, +and ourselves. We want our work to enrich the physical, mental and spiritual wellbeing of all +society. + +We build software to further this vision of a just world, or at the very least, to not put that +vision further from reach. + +## 2. Definitions + +"License" must mean the terms and conditions for use, reproduction, and distribution as defined by +Sections 1 through 9 of this document. + +"Licensor" must mean the copyright owner or entity authorized by the copyright owner that is +granting the License. + +"Legal Entity" must mean the union of the acting entity and all other entities that control, are +controlled by, or are under common control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") must mean an individual or Legal Entity exercising permissions granted by this +License. + +"Source" form must mean the preferred form for making modifications, including but not limited to +software source code, documentation source, and configuration files. + +"Object" form must mean any form resulting from mechanical transformation or translation of a +Source form, including but not limited to compiled object code, generated documentation, and +conversions to other media types. + +"Work" must mean the work of authorship, whether in Source or Object form, made available under the +License, as indicated by a copyright notice that is included in or attached to the work (an example +is provided in the Appendix below). + +"Derivative Works" must mean any work, whether in Source or Object form, that is based on (or +derived from) the Work and for which the editorial revisions, annotations, elaborations, or other +modifications represent, as a whole, an original work of authorship. For the purposes of this +License, Derivative Works must not include works that remain separable from, or merely link (or +bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" must mean any work of authorship, including the original version of the Work and any +modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted +to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity +authorized to submit on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent to the Licensor or +its representatives, including but not limited to communication on electronic mailing lists, source +code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding communication that is +conspicuously marked or otherwise designated in writing by the copyright owner as "Not a +Contribution." + +"Contributor" must mean Licensor and any individual or Legal Entity on behalf of whom a +Contribution has been received by Licensor and subsequently incorporated within the Work. + +"Forests" must mean 0.5 or more hectares of trees that were either planted more than 50 years ago +or were not planted by humans or human made equipment. + +"Deforestation" must mean the clearing, burning or destruction of 0.5 or more hectares of forests +within a 1 year period. + +## 3. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a +perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to +reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and +distribute the Work and such Derivative Works in Source or Object form. + +## 4. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a +perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this +section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer +the Work, where such license applies only to those patent claims licensable by such Contributor that +are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or +a Contribution incorporated within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that Work must terminate as of the +date such litigation is filed. + +## 5. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with +or without modifications, and in Source or Object form, provided that You meet the following +conditions: + +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + +2. You must cause any modified files to carry prominent notices stating that You changed the + files; and + +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, + patent, trademark, and attribution notices from the Source form of the Work, excluding those + notices that do not pertain to any part of the Derivative Works; and + +4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission; and + +5. This software must not be used by any organisation, website, product, or service that: + 1. promotes, lobbies for or derives a majority of income from: + 1. **abuses of human rights**: + * human trafficking + * sex trafficking + * slavery or indentured servitude + * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality + * hate speech + 2. **environmental destruction**: + * the extraction or sale of fossil fuels + * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests + * the abuse, inhumane killing or neglect of animals under human control + * industrial processes that generate waste products that threaten life + 3. **conflict and war**: + * warfare + * war crimes + * weapons manufacturing + * violence (except when required to protect public safety) + 4. **addictive or destructive products and services**: + * gambling + * tobacco + * products that encourage adversely addictive behaviours + + 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: + * peace + * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) + * peaceful assembly and association (including worker associations) + * a sustainable environment + * democratic processes + + ; and + +6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative + Works that You distribute must include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not pertain to any part of the + Derivative Works, in at least one of the following places: within a NOTICE text file + distributed as part of the Derivative Works; within the Source form or documentation, if + provided along with the Derivative Works; or, within a display generated by the Derivative + Works, if and wherever such third-party notices normally appear. The contents of the NOTICE + file are for informational purposes only and do not modify the License. You may add Your own + attribution notices within Derivative Works that You distribute, alongside or as an addendum to + the NOTICE text from the Work, provided that such additional attribution notices cannot be + construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or +different license terms and conditions for use, reproduction, or distribution of Your modifications, +or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of +the Work otherwise complies with the conditions stated in this License. + +## 6. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the +Work by You to the Licensor must be under the terms and conditions of this License, without any +additional terms or conditions. Notwithstanding the above, nothing herein must supersede or modify +the terms of any separate license agreement you may have executed with Licensor regarding such +Contributions. + +## 7. Trademarks + +This License does not grant permission to use the trade names, trademarks, service marks, or product +names of the Licensor, except as required for reasonable and customary use in describing the origin +of the Work and reproducing the content of the NOTICE file. + +## 8. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied, including, without limitation, any warranties or conditions of +TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +## 9. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), contract, or +otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or +agreed to in writing, must any Contributor be liable to You for damages, including any direct, +indirect, special, incidental, or consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but not limited to damages for +loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial +damages or losses), even if such Contributor has been advised of the possibility of such damages. + +## 10. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee +for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights +consistent with this License. However, in accepting such obligations, You may act only on Your own +behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or +claims asserted against, such Contributor by reason of your accepting any such warranty or +additional liability. + +END OF TERMS AND CONDITIONS + +Copyright (year) [owner](url). + +Licensed under the Do No Harm License, Version 0.1 (the "License"); you may not use this file except +in compliance with the License. You may obtain a +[copy](https://github.com/raisely/NoHarm/licenses/apache-2.0.md) of the License. + +Unless required by applicable law or agreed to in writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing permissions and limitations under the +License. diff --git a/package.json b/package.json index d5a2f56..47bf925 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "**A license for developers who write code for a better world**", "main": "index.js", "scripts": { + "build": "node build.js", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/source/config.js b/source/config.js new file mode 100644 index 0000000..7701d2d --- /dev/null +++ b/source/config.js @@ -0,0 +1,4 @@ +module.exports = { + main: './templates/license.ejs', + dest: './licenses/NoHarm.md', +} \ No newline at end of file diff --git a/source/context.js b/source/context.js new file mode 100644 index 0000000..928a6a0 --- /dev/null +++ b/source/context.js @@ -0,0 +1,24 @@ +/** + * @param {string[]} ls + */ +function join(ls, { + empty = '(empty)', + final_sep = 'and', + item_sep = ',' +} = {}) { + if ((!ls) && (ls.length <= 0)) + return empty + if (ls.length == 0) + return ls[0] + if (ls.length == 2) + return `${ls[0]} ${final_sep} ${ls[1]}` + ls = ls.slice() + const last = ls.pop() + return `${ls.join(`${item_sep} `)}${item_sep} ${final_sep} ${last}` +} + +const ctx = { + ...require('./data'), + join, +} +module.exports = ctx \ No newline at end of file diff --git a/source/data.js b/source/data.js new file mode 100644 index 0000000..292cfa1 --- /dev/null +++ b/source/data.js @@ -0,0 +1,17 @@ +const data = { + license_name: 'Do No Harm', + version: { + major: 0, + minor: 3, + month: 'July', + year: 2022, + }, + repo_url: 'https://github.com/raisely/NoHarm', + actions: [ + 'use', + 'reproduction', + 'distribution' + ] +} + +module.exports = data \ No newline at end of file From c52db200ef4b1b4e942423997691c3b81228b0d6 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Mon, 25 Jul 2022 21:31:34 -0500 Subject: [PATCH 05/19] Clean up build script --- build.js | 58 +++++--------------------------------------------------- 1 file changed, 5 insertions(+), 53 deletions(-) diff --git a/build.js b/build.js index b4bed33..0b20287 100644 --- a/build.js +++ b/build.js @@ -1,61 +1,13 @@ const ctx = require('./source/context'), config = require('./source/config'), fs = require('fs'), - path = require('path'), ejs = require('ejs') -const data = require('./source/data') -/** - * @param {string} f - * @returns {Promise} - */ -function read(f) { - return new Promise((resolve, reject) => { - const stream = fs.createReadStream(f) - stream.on('error', reject) - let res = '' - stream.on('data', chunk => { - res += chunk - }) - stream.on('end', () => resolve(res)) - }) -} -/** - * @param {string} f - * @param {string} data - * @returns {Promise} - */ -function write(f, data) { - return new Promise((resolve, reject) => { - fs.writeFile(f, data, err => { - if (err) reject(err) - else resolve() - }) - }) -} - -const load_partials = async () => { - const partials_list = config.templates.partials.map(p => ({ - name: p, - file: path.resolve( - config.templates.dir, - `${config.templates.main}.${config.templates.extension}` - ), - })), /** @type {{[key: string]: string}} */ partials = {} +const $ctx = () => ({...ctx, $ctx}) - for (const { name, file } of partials_list) { - partials[name] = await read(file) - } - return partials -} - -const start = () => { - ejs.renderFile(config.main, ctx, (err, txt) => { +ejs.renderFile(config.main, $ctx(), (err, txt) => { + if (err) throw err + fs.writeFile(config.dest, txt, err => { if (err) throw err - fs.writeFile(config.dest, txt, err => { - if (err) throw err - }) }) -} - -start() \ No newline at end of file +}) \ No newline at end of file From d848cf54583dddf859fa337f5c50b65c0b76a08e Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Mon, 25 Jul 2022 23:34:02 -0500 Subject: [PATCH 06/19] Add definitions partial --- licenses/NoHarm.md | 10 +++++--- source/context.js | 8 ++++++ source/data.js | 53 +++++++++++++++++++++++++++++++++++++- templates/definitions.ejs | 9 +++++++ templates/license.ejs | 54 +-------------------------------------- 5 files changed, 76 insertions(+), 58 deletions(-) create mode 100644 templates/definitions.ejs diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 31948f7..733e591 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -41,10 +41,10 @@ outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") must mean an individual or Legal Entity exercising permissions granted by this License. -"Source" form must mean the preferred form for making modifications, including but not limited to -software source code, documentation source, and configuration files. +"Source" must mean the preferred form for making modifications, including but not limited to +the software source code, documentation source, and configuration files. -"Object" form must mean any form resulting from mechanical transformation or translation of a +"Object" must mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. @@ -72,12 +72,14 @@ Contribution." "Contributor" must mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. -"Forests" must mean 0.5 or more hectares of trees that were either planted more than 50 years ago +"Forest" (or "Forests") must mean 0.5 or more hectares of trees that were either planted more than 50 years ago or were not planted by humans or human made equipment. "Deforestation" must mean the clearing, burning or destruction of 0.5 or more hectares of forests within a 1 year period. + + ## 3. Grant of Copyright License Subject to the terms and conditions of this License, each Contributor hereby grants to You a diff --git a/source/context.js b/source/context.js index 928a6a0..8165485 100644 --- a/source/context.js +++ b/source/context.js @@ -17,8 +17,16 @@ function join(ls, { return `${ls.join(`${item_sep} `)}${item_sep} ${final_sep} ${last}` } +/** + * @param {string} str + */ +function trim(str) { + return str.split('\n').map(s => s.trim()).join('\n') +} + const ctx = { ...require('./data'), join, + trim, } module.exports = ctx \ No newline at end of file diff --git a/source/data.js b/source/data.js index 292cfa1..d4bcb1e 100644 --- a/source/data.js +++ b/source/data.js @@ -1,3 +1,53 @@ +const forest_area = 0.5 +/** + * @typedef {{term:string, definition: string, synonyms: string[]}} Definition + */ +// { term: '', definition: ``, synonyms: [] }, +/** + * @type {Definition[]} + */ +const definitions = [ + { term: 'License', definition: `the terms and conditions for use, reproduction, and distribution as defined by + Sections 1 through 9 of this document.`, synonyms: [] }, + { term: 'Licensor', definition: `the copyright owner or entity authorized by the copyright owner that is + granting the License.`, synonyms: [] }, + { term: 'Legal Entity', definition: `the union of the acting entity and all other entities that control, are + controlled by, or are under common control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the direction or management of such + entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity.`, synonyms: [] }, + { term: 'You', definition: `an individual or Legal Entity exercising permissions granted by this + License.`, synonyms: [ 'Your' ] }, + { term: 'Source', definition: `the preferred form for making modifications, including but not limited to + the software source code, documentation source, and configuration files.`, synonyms: [] }, + { term: 'Object', definition: `any form resulting from mechanical transformation or translation of a + Source form, including but not limited to compiled object code, generated documentation, and + conversions to other media types.`, synonyms: [] }, + { term: 'Work', definition: `the work of authorship, whether in Source or Object form, made available under the + License, as indicated by a copyright notice that is included in or attached to the work (an example + is provided in the Appendix below).`, synonyms: [] }, + { term: 'Derivative Works', definition: `any work, whether in Source or Object form, that is based on (or + derived from) the Work and for which the editorial revisions, annotations, elaborations, or other + modifications represent, as a whole, an original work of authorship. For the purposes of this + License, Derivative Works must not include works that remain separable from, or merely link (or + bind by name) to the interfaces of, the Work and Derivative Works thereof.`, synonyms: [] }, + { term: 'Contribution', definition: `any work of authorship, including the original version of the Work and any + modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted + to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity + authorized to submit on behalf of the copyright owner. For the purposes of this definition, + "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or + its representatives, including but not limited to communication on electronic mailing lists, source + code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor + for the purpose of discussing and improving the Work, but excluding communication that is + conspicuously marked or otherwise designated in writing by the copyright owner as "Not a + Contribution."`, synonyms: [] }, + { term: 'Contributor', definition: `Licensor and any individual or Legal Entity on behalf of whom a + Contribution has been received by Licensor and subsequently incorporated within the Work.`, synonyms: [] }, + { term: 'Forest', definition: `${forest_area} or more hectares of trees that were either planted more than 50 years ago + or were not planted by humans or human made equipment.`, synonyms: [ 'Forests' ] }, + { term: 'Deforestation', definition: `the clearing, burning or destruction of ${forest_area} or more hectares of forests + within a 1 year period.`, synonyms: [] }, +] const data = { license_name: 'Do No Harm', version: { @@ -11,7 +61,8 @@ const data = { 'use', 'reproduction', 'distribution' - ] + ], + definitions, } module.exports = data \ No newline at end of file diff --git a/templates/definitions.ejs b/templates/definitions.ejs new file mode 100644 index 0000000..3058ee1 --- /dev/null +++ b/templates/definitions.ejs @@ -0,0 +1,9 @@ +<% const renderSynonyms = syns => { + if(syns.length) {%> (or <%- syns.map(s => `"${s}"`).join(', ') %>)<%} +}; _%> +## 2. Definitions + +<% for (const { term, definition, synonyms } of definitions) { _%> +"<%= term %>"<% renderSynonyms(synonyms); %> must mean <%- trim(definition) %> + +<% } %> \ No newline at end of file diff --git a/templates/license.ejs b/templates/license.ejs index 1d9f683..6d3fa49 100644 --- a/templates/license.ejs +++ b/templates/license.ejs @@ -8,59 +8,7 @@ TERMS AND CONDITIONS FOR <%= join(actions).toUpperCase() %> <%- include('preamble') %> -## 2. Definitions - -"License" must mean the terms and conditions for use, reproduction, and distribution as defined by -Sections 1 through 9 of this document. - -"Licensor" must mean the copyright owner or entity authorized by the copyright owner that is -granting the License. - -"Legal Entity" must mean the union of the acting entity and all other entities that control, are -controlled by, or are under common control with that entity. For the purposes of this definition, -"control" means (i) the power, direct or indirect, to cause the direction or management of such -entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") must mean an individual or Legal Entity exercising permissions granted by this -License. - -"Source" form must mean the preferred form for making modifications, including but not limited to -software source code, documentation source, and configuration files. - -"Object" form must mean any form resulting from mechanical transformation or translation of a -Source form, including but not limited to compiled object code, generated documentation, and -conversions to other media types. - -"Work" must mean the work of authorship, whether in Source or Object form, made available under the -License, as indicated by a copyright notice that is included in or attached to the work (an example -is provided in the Appendix below). - -"Derivative Works" must mean any work, whether in Source or Object form, that is based on (or -derived from) the Work and for which the editorial revisions, annotations, elaborations, or other -modifications represent, as a whole, an original work of authorship. For the purposes of this -License, Derivative Works must not include works that remain separable from, or merely link (or -bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" must mean any work of authorship, including the original version of the Work and any -modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted -to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity -authorized to submit on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent to the Licensor or -its representatives, including but not limited to communication on electronic mailing lists, source -code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor -for the purpose of discussing and improving the Work, but excluding communication that is -conspicuously marked or otherwise designated in writing by the copyright owner as "Not a -Contribution." - -"Contributor" must mean Licensor and any individual or Legal Entity on behalf of whom a -Contribution has been received by Licensor and subsequently incorporated within the Work. - -"Forests" must mean 0.5 or more hectares of trees that were either planted more than 50 years ago -or were not planted by humans or human made equipment. - -"Deforestation" must mean the clearing, burning or destruction of 0.5 or more hectares of forests -within a 1 year period. +<%- include('definitions', $ctx()) %> ## 3. Grant of Copyright License From 9dc52ebff0bc5f19665ce3a7eee01ab171fa61d1 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Tue, 26 Jul 2022 14:18:30 -0500 Subject: [PATCH 07/19] Add copyright grant partial --- licenses/NoHarm.md | 3 +-- source/data.js | 16 ++++++++++++++++ templates/grant_of_copyright.ejs | 5 +++++ templates/license.ejs | 7 +------ 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 templates/grant_of_copyright.ejs diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 733e591..6ea6c68 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -84,8 +84,7 @@ within a 1 year period. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to -reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and -distribute the Work and such Derivative Works in Source or Object form. +reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. ## 4. Grant of Patent License diff --git a/source/data.js b/source/data.js index d4bcb1e..c5365df 100644 --- a/source/data.js +++ b/source/data.js @@ -62,6 +62,22 @@ const data = { 'reproduction', 'distribution' ], + type_of_license: [ + 'perpetual', + 'worldwide', + 'non-exclusive', + 'no-charge', + 'royalty-free', + 'irrevocable', + ], + permissions: [ + 'reproduce', + 'prepare Derivative Works of', + 'publicly display', + 'publicly perform', + 'sublicense', + 'distribute', + ], definitions, } diff --git a/templates/grant_of_copyright.ejs b/templates/grant_of_copyright.ejs new file mode 100644 index 0000000..4ea7736 --- /dev/null +++ b/templates/grant_of_copyright.ejs @@ -0,0 +1,5 @@ +## 3. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a +<%= type_of_license.join(', ') %> copyright license to +<%= join(permissions) %> the Work and such Derivative Works in Source or Object form. \ No newline at end of file diff --git a/templates/license.ejs b/templates/license.ejs index 6d3fa49..661772a 100644 --- a/templates/license.ejs +++ b/templates/license.ejs @@ -10,12 +10,7 @@ TERMS AND CONDITIONS FOR <%= join(actions).toUpperCase() %> <%- include('definitions', $ctx()) %> -## 3. Grant of Copyright License - -Subject to the terms and conditions of this License, each Contributor hereby grants to You a -perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to -reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and -distribute the Work and such Derivative Works in Source or Object form. +<%- include('grant_of_copyright', $ctx()) %> ## 4. Grant of Patent License From 2ca8a0f701f655537bbf717c252365aa757e83db Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Tue, 26 Jul 2022 22:42:37 -0500 Subject: [PATCH 08/19] Make partials for rest of license --- licenses/NoHarm.md | 14 +-- templates/grant_of_patent.ejs | 12 +++ templates/license.ejs | 123 +--------------------- templates/redistribution.ejs | 66 ++++++++++++ templates/submission_of_contributions.ejs | 7 ++ templates/trademarks.ejs | 5 + templates/warranty_and_liability.ejs | 28 +++++ 7 files changed, 130 insertions(+), 125 deletions(-) create mode 100644 templates/grant_of_patent.ejs create mode 100644 templates/redistribution.ejs create mode 100644 templates/submission_of_contributions.ejs create mode 100644 templates/trademarks.ejs create mode 100644 templates/warranty_and_liability.ejs diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 6ea6c68..676422a 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -141,13 +141,13 @@ conditions: * products that encourage adversely addictive behaviours 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: - * peace - * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) - * peaceful assembly and association (including worker associations) - * a sustainable environment - * democratic processes - - ; and + * peace + * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) + * peaceful assembly and association (including worker associations) + * a sustainable environment + * democratic processes + + ; and 6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained diff --git a/templates/grant_of_patent.ejs b/templates/grant_of_patent.ejs new file mode 100644 index 0000000..01d4058 --- /dev/null +++ b/templates/grant_of_patent.ejs @@ -0,0 +1,12 @@ +## 4. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a +perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this +section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer +the Work, where such license applies only to those patent claims licensable by such Contributor that +are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or +a Contribution incorporated within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that Work must terminate as of the +date such litigation is filed. \ No newline at end of file diff --git a/templates/license.ejs b/templates/license.ejs index 661772a..7a5f8c4 100644 --- a/templates/license.ejs +++ b/templates/license.ejs @@ -12,128 +12,15 @@ TERMS AND CONDITIONS FOR <%= join(actions).toUpperCase() %> <%- include('grant_of_copyright', $ctx()) %> -## 4. Grant of Patent License +<%- include('grant_of_patent', $ctx()) %> -Subject to the terms and conditions of this License, each Contributor hereby grants to You a -perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this -section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer -the Work, where such license applies only to those patent claims licensable by such Contributor that -are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You institute patent litigation -against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or -a Contribution incorporated within the Work constitutes direct or contributory patent infringement, -then any patent licenses granted to You under this License for that Work must terminate as of the -date such litigation is filed. +<%- include('redistribution', $ctx()) %> -## 5. Redistribution +<%- include('submission_of_contributions', $ctx()) %> -You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with -or without modifications, and in Source or Object form, provided that You meet the following -conditions: +<%- include('trademarks', $ctx()) %> -1. You must give any other recipients of the Work or Derivative Works a copy of this License; and - -2. You must cause any modified files to carry prominent notices stating that You changed the - files; and - -3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, - patent, trademark, and attribution notices from the Source form of the Work, excluding those - notices that do not pertain to any part of the Derivative Works; and - -4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior written permission; and - -5. This software must not be used by any organisation, website, product, or service that: - 1. promotes, lobbies for or derives a majority of income from: - 1. **abuses of human rights**: - * human trafficking - * sex trafficking - * slavery or indentured servitude - * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality - * hate speech - 2. **environmental destruction**: - * the extraction or sale of fossil fuels - * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests - * the abuse, inhumane killing or neglect of animals under human control - * industrial processes that generate waste products that threaten life - 3. **conflict and war**: - * warfare - * war crimes - * weapons manufacturing - * violence (except when required to protect public safety) - 4. **addictive or destructive products and services**: - * gambling - * tobacco - * products that encourage adversely addictive behaviours - - 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: - * peace - * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) - * peaceful assembly and association (including worker associations) - * a sustainable environment - * democratic processes - - ; and - -6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative - Works that You distribute must include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not pertain to any part of the - Derivative Works, in at least one of the following places: within a NOTICE text file - distributed as part of the Derivative Works; within the Source form or documentation, if - provided along with the Derivative Works; or, within a display generated by the Derivative - Works, if and wherever such third-party notices normally appear. The contents of the NOTICE - file are for informational purposes only and do not modify the License. You may add Your own - attribution notices within Derivative Works that You distribute, alongside or as an addendum to - the NOTICE text from the Work, provided that such additional attribution notices cannot be - construed as modifying the License. - -You may add Your own copyright statement to Your modifications and may provide additional or -different license terms and conditions for use, reproduction, or distribution of Your modifications, -or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of -the Work otherwise complies with the conditions stated in this License. - -## 6. Submission of Contributions - -Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the -Work by You to the Licensor must be under the terms and conditions of this License, without any -additional terms or conditions. Notwithstanding the above, nothing herein must supersede or modify -the terms of any separate license agreement you may have executed with Licensor regarding such -Contributions. - -## 7. Trademarks - -This License does not grant permission to use the trade names, trademarks, service marks, or product -names of the Licensor, except as required for reasonable and customary use in describing the origin -of the Work and reproducing the content of the NOTICE file. - -## 8. Disclaimer of Warranty - -Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied, including, without limitation, any warranties or conditions of -TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely -responsible for determining the appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -## 9. Limitation of Liability - -In no event and under no legal theory, whether in tort (including negligence), contract, or -otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or -agreed to in writing, must any Contributor be liable to You for damages, including any direct, -indirect, special, incidental, or consequential damages of any character arising as a result of this -License or out of the use or inability to use the Work (including but not limited to damages for -loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial -damages or losses), even if such Contributor has been advised of the possibility of such damages. - -## 10. Accepting Warranty or Additional Liability - -While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee -for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights -consistent with this License. However, in accepting such obligations, You may act only on Your own -behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or -claims asserted against, such Contributor by reason of your accepting any such warranty or -additional liability. +<%- include('warranty_and_liability', $ctx()) %> END OF TERMS AND CONDITIONS diff --git a/templates/redistribution.ejs b/templates/redistribution.ejs new file mode 100644 index 0000000..421ce3e --- /dev/null +++ b/templates/redistribution.ejs @@ -0,0 +1,66 @@ +## 5. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with +or without modifications, and in Source or Object form, provided that You meet the following +conditions: + +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + +2. You must cause any modified files to carry prominent notices stating that You changed the + files; and + +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, + patent, trademark, and attribution notices from the Source form of the Work, excluding those + notices that do not pertain to any part of the Derivative Works; and + +4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission; and + +5. This software must not be used by any organisation, website, product, or service that: + 1. promotes, lobbies for or derives a majority of income from: + 1. **abuses of human rights**: + * human trafficking + * sex trafficking + * slavery or indentured servitude + * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality + * hate speech + 2. **environmental destruction**: + * the extraction or sale of fossil fuels + * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests + * the abuse, inhumane killing or neglect of animals under human control + * industrial processes that generate waste products that threaten life + 3. **conflict and war**: + * warfare + * war crimes + * weapons manufacturing + * violence (except when required to protect public safety) + 4. **addictive or destructive products and services**: + * gambling + * tobacco + * products that encourage adversely addictive behaviours + + 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: + * peace + * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) + * peaceful assembly and association (including worker associations) + * a sustainable environment + * democratic processes + + ; and + +6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative + Works that You distribute must include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not pertain to any part of the + Derivative Works, in at least one of the following places: within a NOTICE text file + distributed as part of the Derivative Works; within the Source form or documentation, if + provided along with the Derivative Works; or, within a display generated by the Derivative + Works, if and wherever such third-party notices normally appear. The contents of the NOTICE + file are for informational purposes only and do not modify the License. You may add Your own + attribution notices within Derivative Works that You distribute, alongside or as an addendum to + the NOTICE text from the Work, provided that such additional attribution notices cannot be + construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or +different license terms and conditions for use, reproduction, or distribution of Your modifications, +or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of +the Work otherwise complies with the conditions stated in this License. \ No newline at end of file diff --git a/templates/submission_of_contributions.ejs b/templates/submission_of_contributions.ejs new file mode 100644 index 0000000..ab32c61 --- /dev/null +++ b/templates/submission_of_contributions.ejs @@ -0,0 +1,7 @@ +## 6. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the +Work by You to the Licensor must be under the terms and conditions of this License, without any +additional terms or conditions. Notwithstanding the above, nothing herein must supersede or modify +the terms of any separate license agreement you may have executed with Licensor regarding such +Contributions. \ No newline at end of file diff --git a/templates/trademarks.ejs b/templates/trademarks.ejs new file mode 100644 index 0000000..69abe15 --- /dev/null +++ b/templates/trademarks.ejs @@ -0,0 +1,5 @@ +## 7. Trademarks + +This License does not grant permission to use the trade names, trademarks, service marks, or product +names of the Licensor, except as required for reasonable and customary use in describing the origin +of the Work and reproducing the content of the NOTICE file. \ No newline at end of file diff --git a/templates/warranty_and_liability.ejs b/templates/warranty_and_liability.ejs new file mode 100644 index 0000000..22edf25 --- /dev/null +++ b/templates/warranty_and_liability.ejs @@ -0,0 +1,28 @@ +## 8. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied, including, without limitation, any warranties or conditions of +TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +## 9. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), contract, or +otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or +agreed to in writing, must any Contributor be liable to You for damages, including any direct, +indirect, special, incidental, or consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but not limited to damages for +loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial +damages or losses), even if such Contributor has been advised of the possibility of such damages. + +## 10. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee +for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights +consistent with this License. However, in accepting such obligations, You may act only on Your own +behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or +claims asserted against, such Contributor by reason of your accepting any such warranty or +additional liability. \ No newline at end of file From 7764674be8fae30f9e0d2c53f341d09509481291 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Tue, 26 Jul 2022 22:46:21 -0500 Subject: [PATCH 09/19] Update license version at the end of the license --- licenses/NoHarm.md | 2 +- templates/license.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 676422a..1893dab 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -213,7 +213,7 @@ END OF TERMS AND CONDITIONS Copyright (year) [owner](url). -Licensed under the Do No Harm License, Version 0.1 (the "License"); you may not use this file except +Licensed under the Do No Harm License, Version 0.3 (the "License"); you may not use this file except in compliance with the License. You may obtain a [copy](https://github.com/raisely/NoHarm/licenses/apache-2.0.md) of the License. diff --git a/templates/license.ejs b/templates/license.ejs index 7a5f8c4..de856ef 100644 --- a/templates/license.ejs +++ b/templates/license.ejs @@ -26,7 +26,7 @@ END OF TERMS AND CONDITIONS Copyright (year) [owner](url). -Licensed under the Do No Harm License, Version 0.1 (the "License"); you may not use this file except +Licensed under the <%= license_name %> License, Version <%= version.major %>.<%= version.minor %> (the "License"); you may not use this file except in compliance with the License. You may obtain a [copy](https://github.com/raisely/NoHarm/licenses/apache-2.0.md) of the License. From 70bab9418c24a8e6d99b67b368c60d2ad045b753 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Tue, 26 Jul 2022 22:51:48 -0500 Subject: [PATCH 10/19] Fix a bug in the `join()` function --- source/context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/context.js b/source/context.js index 8165485..cf27032 100644 --- a/source/context.js +++ b/source/context.js @@ -8,7 +8,7 @@ function join(ls, { } = {}) { if ((!ls) && (ls.length <= 0)) return empty - if (ls.length == 0) + if (ls.length == 1) return ls[0] if (ls.length == 2) return `${ls[0]} ${final_sep} ${ls[1]}` From 38ffd43cd101470d7e836330afb1c05595e75eea Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Wed, 27 Jul 2022 22:11:40 -0500 Subject: [PATCH 11/19] Add data for warranty and liability --- licenses/NoHarm.md | 5 +++-- source/data.js | 15 +++++++++++++++ templates/warranty_and_liability.ejs | 7 ++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 1893dab..3a5c41a 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -193,8 +193,9 @@ risks associated with Your exercise of permissions under this License. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or -agreed to in writing, must any Contributor be liable to You for damages, including any direct, -indirect, special, incidental, or consequential damages of any character arising as a result of this +agreed to in writing, must any Contributor be liable to You for damages, including any +direct, indirect, special, incidental, or consequential +damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. diff --git a/source/data.js b/source/data.js index c5365df..f0eaf6e 100644 --- a/source/data.js +++ b/source/data.js @@ -78,6 +78,21 @@ const data = { 'sublicense', 'distribute', ], + warranties: { + conditions: [ + 'title', + 'non-infringement', + 'merchantability', + 'fitness for a particular purpose', + ], + damages: [ + 'direct', + 'indirect', + 'special', + 'incidental', + 'consequential' + ] + }, definitions, } diff --git a/templates/warranty_and_liability.ejs b/templates/warranty_and_liability.ejs index 22edf25..3f16ac8 100644 --- a/templates/warranty_and_liability.ejs +++ b/templates/warranty_and_liability.ejs @@ -3,7 +3,7 @@ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of -TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +<%= join(warranties.conditions.map(c => c.toUpperCase()), { final_sep: 'or' }) %>. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. @@ -11,8 +11,9 @@ risks associated with Your exercise of permissions under this License. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or -agreed to in writing, must any Contributor be liable to You for damages, including any direct, -indirect, special, incidental, or consequential damages of any character arising as a result of this +agreed to in writing, must any Contributor be liable to You for damages, including any +<%= join(warranties.damages, { final_sep: 'or' }) %> +damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. From 7e1ba07566db3d977f74bc3f3c3a6cdf56befdfd Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Wed, 27 Jul 2022 22:13:55 -0500 Subject: [PATCH 12/19] Replace "tort" with "wrongdoing" --- templates/warranty_and_liability.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/warranty_and_liability.ejs b/templates/warranty_and_liability.ejs index 3f16ac8..5ad3fd6 100644 --- a/templates/warranty_and_liability.ejs +++ b/templates/warranty_and_liability.ejs @@ -9,7 +9,7 @@ risks associated with Your exercise of permissions under this License. ## 9. Limitation of Liability -In no event and under no legal theory, whether in tort (including negligence), contract, or +In no event and under no legal theory, whether in wrongdoing (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, must any Contributor be liable to You for damages, including any <%= join(warranties.damages, { final_sep: 'or' }) %> From 9f6001c1c00c0e3bb7a75bf35b2f809cded92ff5 Mon Sep 17 00:00:00 2001 From: "(designer)" Date: Wed, 27 Jul 2022 22:59:05 -0500 Subject: [PATCH 13/19] Add `renderVersion()` to `./templates/license.md` --- licenses/NoHarm.md | 2 +- templates/license.ejs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 3a5c41a..6f01769 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -191,7 +191,7 @@ risks associated with Your exercise of permissions under this License. ## 9. Limitation of Liability -In no event and under no legal theory, whether in tort (including negligence), contract, or +In no event and under no legal theory, whether in wrongdoing (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, must any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential diff --git a/templates/license.ejs b/templates/license.ejs index de856ef..0c9e4ec 100644 --- a/templates/license.ejs +++ b/templates/license.ejs @@ -1,6 +1,7 @@ +<% const renderVersion = () => {%><%= version.major %>.<%= version.minor %><%}; _%> # <%= license_name %> License -Version <%= version.major %>.<%= version.minor %>, <%= version.month %> <%= version.year %> +Version <% renderVersion() %>, <%= version.month %> <%= version.year %> <%= repo_url %> @@ -26,7 +27,7 @@ END OF TERMS AND CONDITIONS Copyright (year) [owner](url). -Licensed under the <%= license_name %> License, Version <%= version.major %>.<%= version.minor %> (the "License"); you may not use this file except +Licensed under the <%= license_name %> License, Version <% renderVersion() %> (the "License"); you may not use this file except in compliance with the License. You may obtain a [copy](https://github.com/raisely/NoHarm/licenses/apache-2.0.md) of the License. From 3c729e48ebde9983a2040b3152a371cffd5fcc8e Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Thu, 4 Aug 2022 21:01:45 -0500 Subject: [PATCH 14/19] Clarify and add data to Section 10 --- licenses/NoHarm.md | 4 ++-- source/data.js | 13 ++++++++++--- templates/warranty_and_liability.ejs | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 6f01769..a1b5ac6 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -203,8 +203,8 @@ damages or losses), even if such Contributor has been advised of the possibility ## 10. Accepting Warranty or Additional Liability While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee -for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights -consistent with this License. However, in accepting such obligations, You may act only on Your own +for acceptance of support, warranty, indemnity, other liability obligations, or rights consistent with this License. +However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or diff --git a/source/data.js b/source/data.js index f0eaf6e..71b1cfa 100644 --- a/source/data.js +++ b/source/data.js @@ -60,7 +60,7 @@ const data = { actions: [ 'use', 'reproduction', - 'distribution' + 'distribution', ], type_of_license: [ 'perpetual', @@ -90,8 +90,15 @@ const data = { 'indirect', 'special', 'incidental', - 'consequential' - ] + 'consequential', + ], + assurances: [ + 'acceptance of support', + 'warranty', + 'indemnity', + 'other liability obligations', + 'rights consistent with this License', + ], }, definitions, } diff --git a/templates/warranty_and_liability.ejs b/templates/warranty_and_liability.ejs index 5ad3fd6..e30588f 100644 --- a/templates/warranty_and_liability.ejs +++ b/templates/warranty_and_liability.ejs @@ -21,8 +21,8 @@ damages or losses), even if such Contributor has been advised of the possibility ## 10. Accepting Warranty or Additional Liability While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee -for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights -consistent with this License. However, in accepting such obligations, You may act only on Your own +for <%= join(warranties.assurances, { final_sep: 'or' }) %>. +However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or From edb0b4e56ada10cc7b8a61bab54150888109cffe Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Thu, 4 Aug 2022 21:35:32 -0500 Subject: [PATCH 15/19] Add data to the grant of patent --- licenses/NoHarm.md | 6 ++-- source/data.js | 53 ++++++++++++++++++++++---------- templates/grant_of_copyright.ejs | 4 +-- templates/grant_of_patent.ejs | 6 ++-- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index a1b5ac6..cdf4713 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -89,9 +89,9 @@ reproduce, prepare Derivative Works of, publicly display, publicly perform, subl ## 4. Grant of Patent License Subject to the terms and conditions of this License, each Contributor hereby grants to You a -perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this -section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer -the Work, where such license applies only to those patent claims licensable by such Contributor that +perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to +make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or diff --git a/source/data.js b/source/data.js index 71b1cfa..f3dd947 100644 --- a/source/data.js +++ b/source/data.js @@ -62,22 +62,43 @@ const data = { 'reproduction', 'distribution', ], - type_of_license: [ - 'perpetual', - 'worldwide', - 'non-exclusive', - 'no-charge', - 'royalty-free', - 'irrevocable', - ], - permissions: [ - 'reproduce', - 'prepare Derivative Works of', - 'publicly display', - 'publicly perform', - 'sublicense', - 'distribute', - ], + type_of_license: { + general: [ + 'perpetual', + 'worldwide', + 'non-exclusive', + 'no-charge', + 'royalty-free', + 'irrevocable', + ], + patent: [ + 'perpetual', + 'worldwide', + 'non-exclusive', + 'no-charge', + 'royalty-free', + 'irrevocable (except as stated in this section)', + ], + }, + permissions: { + general:[ + 'reproduce', + 'prepare Derivative Works of', + 'publicly display', + 'publicly perform', + 'sublicense', + 'distribute', + ], + patent: [ + 'make', + 'have made', + 'use', + 'offer to sell', + 'sell', + 'import', + 'otherwise transfer', + ], + }, warranties: { conditions: [ 'title', diff --git a/templates/grant_of_copyright.ejs b/templates/grant_of_copyright.ejs index 4ea7736..be73948 100644 --- a/templates/grant_of_copyright.ejs +++ b/templates/grant_of_copyright.ejs @@ -1,5 +1,5 @@ ## 3. Grant of Copyright License Subject to the terms and conditions of this License, each Contributor hereby grants to You a -<%= type_of_license.join(', ') %> copyright license to -<%= join(permissions) %> the Work and such Derivative Works in Source or Object form. \ No newline at end of file +<%= type_of_license.general.join(', ') %> copyright license to +<%= join(permissions.general) %> the Work and such Derivative Works in Source or Object form. \ No newline at end of file diff --git a/templates/grant_of_patent.ejs b/templates/grant_of_patent.ejs index 01d4058..3af45f7 100644 --- a/templates/grant_of_patent.ejs +++ b/templates/grant_of_patent.ejs @@ -1,9 +1,9 @@ ## 4. Grant of Patent License Subject to the terms and conditions of this License, each Contributor hereby grants to You a -perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this -section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer -the Work, where such license applies only to those patent claims licensable by such Contributor that +<%= type_of_license.patent.join(', ') %> patent license to +<%= join(permissions.patent) %> the Work, +where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or From 29fc7c5227304379c116eb721dcbb72f47beb07b Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Fri, 5 Aug 2022 00:04:29 -0500 Subject: [PATCH 16/19] Added data for Section 5 --- licenses/NoHarm.md | 78 +++++++++++++++++++----------------- source/context.js | 4 +- source/data.js | 75 ++++++++++++++++++++++++++++++++++ templates/redistribution.ejs | 71 ++++++++------------------------ 4 files changed, 134 insertions(+), 94 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index cdf4713..4a08d6f 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -105,49 +105,52 @@ You may reproduce and distribute copies of the Work or Derivative Works thereof or without modifications, and in Source or Object form, provided that You meet the following conditions: -1. You must give any other recipients of the Work or Derivative Works a copy of this License; and - +1. You must give any other recipients of the Work or Derivative Works a copy of this License 2. You must cause any modified files to carry prominent notices stating that You changed the - files; and - + files 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those - notices that do not pertain to any part of the Derivative Works; and - + notices that do not pertain to any part of the Derivative Works. 4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior written permission; and - + or promote products derived from this software without specific prior written permission 5. This software must not be used by any organisation, website, product, or service that: 1. promotes, lobbies for or derives a majority of income from: - 1. **abuses of human rights**: - * human trafficking - * sex trafficking - * slavery or indentured servitude - * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality - * hate speech - 2. **environmental destruction**: - * the extraction or sale of fossil fuels - * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests - * the abuse, inhumane killing or neglect of animals under human control - * industrial processes that generate waste products that threaten life - 3. **conflict and war**: - * warfare - * war crimes - * weapons manufacturing - * violence (except when required to protect public safety) - 4. **addictive or destructive products and services**: - * gambling - * tobacco - * products that encourage adversely addictive behaviours - - 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: - * peace - * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) - * peaceful assembly and association (including worker associations) - * a sustainable environment - * democratic processes - - ; and + 1. **abuses of human rights**: + * human trafficking + * sex trafficking + * slavery or indentured servitude + * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality + * hate speech + + 2. **environmental destruction**: + * the extraction or sale of fossil fuels + * the destruction of habitats for threatened or endangered species, + including through deforestation or burning of forests + * the abuse, inhumane killing or neglect of animals under human control + * industrial processes that generate waste products that threaten life + + 3. **conflict and war**: + * warfare + * war crimes + * weapons manufacturing + * unprovoked violence + + 4. **addictive or destructive products and services**: + * gambling + * tabaco + * products that encourage adversely addictive behaviours + + + 2. dissuades, lobbies against, or derives a majority of income from actions that + discourage or frustrate: + * peace + * access to the rights set out in the + [Universal Declaration of Human Rights](./documents/UDHR.md) and the + [Convention on the Rights of the Child](./documents/CRC.md) + * peaceful assembly and association (including worker associations) + * a sustainable environment + * democratic processes + 6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained @@ -161,6 +164,7 @@ conditions: the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of diff --git a/source/context.js b/source/context.js index cf27032..bcc3b45 100644 --- a/source/context.js +++ b/source/context.js @@ -20,8 +20,8 @@ function join(ls, { /** * @param {string} str */ -function trim(str) { - return str.split('\n').map(s => s.trim()).join('\n') +function trim(str, spaces = 0) { + return str.split('\n').map((s, i) => i ? ' '.repeat(spaces) + s.trim() : s.trim()).join('\n') } const ctx = { diff --git a/source/data.js b/source/data.js index f3dd947..7bf013a 100644 --- a/source/data.js +++ b/source/data.js @@ -48,6 +48,80 @@ const definitions = [ { term: 'Deforestation', definition: `the clearing, burning or destruction of ${forest_area} or more hectares of forests within a 1 year period.`, synonyms: [] }, ] + +/** + * @typedef {{text: string, items?: Item[], bulleted?: boolean}} Item + */ + +/** + * @param {string[]} points + * @returns {Item[]} + */ +const bullet = points => points.map(text => ({text, bulleted: true})) +/** + * @type {Item[]} + */ +const terms_of_redistribution = [ + { text: `You must give any other recipients of the Work or Derivative Works a copy of this License` }, + { text: `You must cause any modified files to carry prominent notices stating that You changed the + files` }, + { text: `You must retain, in the Source form of any Derivative Works that You distribute, all copyright, + patent, trademark, and attribution notices from the Source form of the Work, excluding those + notices that do not pertain to any part of the Derivative Works.` }, + { text: `Neither the name of the copyright holder nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission` }, + { text: `This software must not be used by any organisation, website, product, or service that`, items: [ + { text: `promotes, lobbies for or derives a majority of income from`, items: [ + { text: `**abuses of human rights**`, items: bullet([ + 'human trafficking', + 'sex trafficking', + 'slavery or indentured servitude', + 'discrimination based on age, gender, gender identity, race, sexuality, religion, nationality', + 'hate speech', + ]) }, + { text: `**environmental destruction**`, items: bullet([ + 'the extraction or sale of fossil fuels', + `the destruction of habitats for threatened or endangered species, + including through deforestation or burning of forests`, + 'the abuse, inhumane killing or neglect of animals under human control', + 'industrial processes that generate waste products that threaten life', + ]) }, + { text: `**conflict and war**`, items: bullet([ + 'warfare', + 'war crimes', + 'weapons manufacturing', + 'unprovoked violence', + ]) }, + { text: `**addictive or destructive products and services**`, items: bullet([ + 'gambling', + 'tabaco', + 'products that encourage adversely addictive behaviours', + ]) }, + ] }, + { text: `dissuades, lobbies against, or derives a majority of income from actions that + discourage or frustrate`, items: bullet([ + 'peace', + `access to the rights set out in the + [Universal Declaration of Human Rights](./documents/UDHR.md) and the + [Convention on the Rights of the Child](./documents/CRC.md)`, + 'peaceful assembly and association (including worker associations)', + 'a sustainable environment', + 'democratic processes', + ]) }, + ] }, + { text: `If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative + Works that You distribute must include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not pertain to any part of the + Derivative Works, in at least one of the following places: within a NOTICE text file + distributed as part of the Derivative Works; within the Source form or documentation, if + provided along with the Derivative Works; or, within a display generated by the Derivative + Works, if and wherever such third-party notices normally appear. The contents of the NOTICE + file are for informational purposes only and do not modify the License. You may add Your own + attribution notices within Derivative Works that You distribute, alongside or as an addendum to + the NOTICE text from the Work, provided that such additional attribution notices cannot be + construed as modifying the License.` }, +] + const data = { license_name: 'Do No Harm', version: { @@ -122,6 +196,7 @@ const data = { ], }, definitions, + terms_of_redistribution, } module.exports = data \ No newline at end of file diff --git a/templates/redistribution.ejs b/templates/redistribution.ejs index 421ce3e..8749469 100644 --- a/templates/redistribution.ejs +++ b/templates/redistribution.ejs @@ -1,64 +1,25 @@ +<% function renderList({text, items = [], bulleted = false}, current = 1, nesting = 0) { + const point = bulleted ? '*' : `${current}.` + const spaces = nesting * 3, indention = spaces + point.length + 1 + if (items.length) { + %><%= ' '.repeat(spaces) + point %> <%- trim(text, indention) %>:<%= '\n' %><% + items.forEach((item, index) => { + renderList(item, index + 1, nesting + 1) + }) + } else { + %><%= ' '.repeat(spaces) + point %> <%- trim(text, indention) %><% + } + %><%- '\n' %><% +} _%> ## 5. Redistribution You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: -1. You must give any other recipients of the Work or Derivative Works a copy of this License; and - -2. You must cause any modified files to carry prominent notices stating that You changed the - files; and - -3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, - patent, trademark, and attribution notices from the Source form of the Work, excluding those - notices that do not pertain to any part of the Derivative Works; and - -4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior written permission; and - -5. This software must not be used by any organisation, website, product, or service that: - 1. promotes, lobbies for or derives a majority of income from: - 1. **abuses of human rights**: - * human trafficking - * sex trafficking - * slavery or indentured servitude - * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality - * hate speech - 2. **environmental destruction**: - * the extraction or sale of fossil fuels - * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests - * the abuse, inhumane killing or neglect of animals under human control - * industrial processes that generate waste products that threaten life - 3. **conflict and war**: - * warfare - * war crimes - * weapons manufacturing - * violence (except when required to protect public safety) - 4. **addictive or destructive products and services**: - * gambling - * tobacco - * products that encourage adversely addictive behaviours - - 2. dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: - * peace - * access to the rights set out in the [Universal Declaration of Human Rights](./documents/UDHR.md) and the [Convention on the Rights of the Child](./documents/CRC.md) - * peaceful assembly and association (including worker associations) - * a sustainable environment - * democratic processes - - ; and - -6. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative - Works that You distribute must include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not pertain to any part of the - Derivative Works, in at least one of the following places: within a NOTICE text file - distributed as part of the Derivative Works; within the Source form or documentation, if - provided along with the Derivative Works; or, within a display generated by the Derivative - Works, if and wherever such third-party notices normally appear. The contents of the NOTICE - file are for informational purposes only and do not modify the License. You may add Your own - attribution notices within Derivative Works that You distribute, alongside or as an addendum to - the NOTICE text from the Work, provided that such additional attribution notices cannot be - construed as modifying the License. +<% terms_of_redistribution.forEach((item, index) => { + renderList(item, index + 1) +}) %> You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, From be39e2bba56b4d4a11b9808b571da2ac33f55f5a Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Fri, 5 Aug 2022 08:51:30 -0500 Subject: [PATCH 17/19] Capitalize items in Subsection 5.5 --- licenses/NoHarm.md | 12 ++++++------ source/data.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/licenses/NoHarm.md b/licenses/NoHarm.md index 4a08d6f..8683901 100644 --- a/licenses/NoHarm.md +++ b/licenses/NoHarm.md @@ -114,34 +114,34 @@ conditions: 4. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission 5. This software must not be used by any organisation, website, product, or service that: - 1. promotes, lobbies for or derives a majority of income from: - 1. **abuses of human rights**: + 1. Promotes, lobbies for or derives a majority of income from: + 1. **Abuses of human rights**: * human trafficking * sex trafficking * slavery or indentured servitude * discrimination based on age, gender, gender identity, race, sexuality, religion, nationality * hate speech - 2. **environmental destruction**: + 2. **Environmental destruction**: * the extraction or sale of fossil fuels * the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests * the abuse, inhumane killing or neglect of animals under human control * industrial processes that generate waste products that threaten life - 3. **conflict and war**: + 3. **Conflict and war**: * warfare * war crimes * weapons manufacturing * unprovoked violence - 4. **addictive or destructive products and services**: + 4. **Addictive or destructive products and services**: * gambling * tabaco * products that encourage adversely addictive behaviours - 2. dissuades, lobbies against, or derives a majority of income from actions that + 2. Dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate: * peace * access to the rights set out in the diff --git a/source/data.js b/source/data.js index 7bf013a..dd6d63c 100644 --- a/source/data.js +++ b/source/data.js @@ -71,34 +71,34 @@ const terms_of_redistribution = [ { text: `Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission` }, { text: `This software must not be used by any organisation, website, product, or service that`, items: [ - { text: `promotes, lobbies for or derives a majority of income from`, items: [ - { text: `**abuses of human rights**`, items: bullet([ + { text: `Promotes, lobbies for or derives a majority of income from`, items: [ + { text: `**Abuses of human rights**`, items: bullet([ 'human trafficking', 'sex trafficking', 'slavery or indentured servitude', 'discrimination based on age, gender, gender identity, race, sexuality, religion, nationality', 'hate speech', ]) }, - { text: `**environmental destruction**`, items: bullet([ + { text: `**Environmental destruction**`, items: bullet([ 'the extraction or sale of fossil fuels', `the destruction of habitats for threatened or endangered species, including through deforestation or burning of forests`, 'the abuse, inhumane killing or neglect of animals under human control', 'industrial processes that generate waste products that threaten life', ]) }, - { text: `**conflict and war**`, items: bullet([ + { text: `**Conflict and war**`, items: bullet([ 'warfare', 'war crimes', 'weapons manufacturing', 'unprovoked violence', ]) }, - { text: `**addictive or destructive products and services**`, items: bullet([ + { text: `**Addictive or destructive products and services**`, items: bullet([ 'gambling', 'tabaco', 'products that encourage adversely addictive behaviours', ]) }, ] }, - { text: `dissuades, lobbies against, or derives a majority of income from actions that + { text: `Dissuades, lobbies against, or derives a majority of income from actions that discourage or frustrate`, items: bullet([ 'peace', `access to the rights set out in the From f61ff9c6a55507f9528741d55ebbfe8036c1cc96 Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Fri, 5 Aug 2022 09:01:30 -0500 Subject: [PATCH 18/19] Make `synonyms` optional in definitions --- source/data.js | 22 +++++++++++----------- templates/definitions.ejs | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/data.js b/source/data.js index dd6d63c..8045070 100644 --- a/source/data.js +++ b/source/data.js @@ -1,6 +1,6 @@ const forest_area = 0.5 /** - * @typedef {{term:string, definition: string, synonyms: string[]}} Definition + * @typedef {{term:string, definition: string, synonyms?: string[]}} Definition */ // { term: '', definition: ``, synonyms: [] }, /** @@ -8,29 +8,29 @@ const forest_area = 0.5 */ const definitions = [ { term: 'License', definition: `the terms and conditions for use, reproduction, and distribution as defined by - Sections 1 through 9 of this document.`, synonyms: [] }, + Sections 1 through 9 of this document.` }, { term: 'Licensor', definition: `the copyright owner or entity authorized by the copyright owner that is - granting the License.`, synonyms: [] }, + granting the License.` }, { term: 'Legal Entity', definition: `the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity.`, synonyms: [] }, + outstanding shares, or (iii) beneficial ownership of such entity.` }, { term: 'You', definition: `an individual or Legal Entity exercising permissions granted by this License.`, synonyms: [ 'Your' ] }, { term: 'Source', definition: `the preferred form for making modifications, including but not limited to - the software source code, documentation source, and configuration files.`, synonyms: [] }, + the software source code, documentation source, and configuration files.` }, { term: 'Object', definition: `any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and - conversions to other media types.`, synonyms: [] }, + conversions to other media types.` }, { term: 'Work', definition: `the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example - is provided in the Appendix below).`, synonyms: [] }, + is provided in the Appendix below).` }, { term: 'Derivative Works', definition: `any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works must not include works that remain separable from, or merely link (or - bind by name) to the interfaces of, the Work and Derivative Works thereof.`, synonyms: [] }, + bind by name) to the interfaces of, the Work and Derivative Works thereof.` }, { term: 'Contribution', definition: `any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity @@ -40,13 +40,13 @@ const definitions = [ code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a - Contribution."`, synonyms: [] }, + Contribution."` }, { term: 'Contributor', definition: `Licensor and any individual or Legal Entity on behalf of whom a - Contribution has been received by Licensor and subsequently incorporated within the Work.`, synonyms: [] }, + Contribution has been received by Licensor and subsequently incorporated within the Work.` }, { term: 'Forest', definition: `${forest_area} or more hectares of trees that were either planted more than 50 years ago or were not planted by humans or human made equipment.`, synonyms: [ 'Forests' ] }, { term: 'Deforestation', definition: `the clearing, burning or destruction of ${forest_area} or more hectares of forests - within a 1 year period.`, synonyms: [] }, + within a 1 year period.` }, ] /** diff --git a/templates/definitions.ejs b/templates/definitions.ejs index 3058ee1..1165739 100644 --- a/templates/definitions.ejs +++ b/templates/definitions.ejs @@ -3,7 +3,7 @@ }; _%> ## 2. Definitions -<% for (const { term, definition, synonyms } of definitions) { _%> +<% for (const { term, definition, synonyms = [] } of definitions) { _%> "<%= term %>"<% renderSynonyms(synonyms); %> must mean <%- trim(definition) %> <% } %> \ No newline at end of file From 22423a7b719a40d0e920e79226cd39fc9e2e5b52 Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Fri, 5 Aug 2022 13:31:13 -0500 Subject: [PATCH 19/19] Add status display to build script This is useful to tell if the license was built successfully. --- build.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 0b20287..6bee570 100644 --- a/build.js +++ b/build.js @@ -3,11 +3,31 @@ const ctx = require('./source/context'), fs = require('fs'), ejs = require('ejs') +/** + * @param {string} message the message to display + * @param {'success'|'info'|'error'} type the type of message + */ +const log = (message, type = 'info') => { + for (const line of message.split('\n')) { + const fullMessage = ` [ ${type} ] ${line}` + if (type == 'error') { + console.error(fullMessage) + } else if (type == 'info') { + console.info(fullMessage) + } else { + console.log(fullMessage) + } + } +} + const $ctx = () => ({...ctx, $ctx}) +log(`Reading ${config.main} ...`) ejs.renderFile(config.main, $ctx(), (err, txt) => { - if (err) throw err + if (err) return log(`${err}`, 'error') + log(`Writing to ${config.dest} ...`) fs.writeFile(config.dest, txt, err => { - if (err) throw err + if (err) return log(`${err}`, 'error') + log(`Template written to ${config.dest} from ${config.main}`, 'success') }) }) \ No newline at end of file