UNPKG

21.5 kBMarkdownView Raw
1<!-- TITLE/ -->
2
3<h1>Projectz</h1>
4
5<!-- /TITLE -->
6
7
8<!-- BADGES/ -->
9
10<span class="badge-githubworkflow"><a href="https://github.com/bevry/projectz/actions?query=workflow%3Abevry" title="View the status of this project's GitHub Workflow: bevry"><img src="https://github.com/bevry/projectz/workflows/bevry/badge.svg" alt="Status of the GitHub Workflow: bevry" /></a></span>
11<span class="badge-npmversion"><a href="https://npmjs.org/package/projectz" title="View this project on NPM"><img src="https://img.shields.io/npm/v/projectz.svg" alt="NPM version" /></a></span>
12<span class="badge-npmdownloads"><a href="https://npmjs.org/package/projectz" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/projectz.svg" alt="NPM downloads" /></a></span>
13<span class="badge-daviddm"><a href="https://david-dm.org/bevry/projectz" title="View the status of this project's dependencies on DavidDM"><img src="https://img.shields.io/david/bevry/projectz.svg" alt="Dependency Status" /></a></span>
14<span class="badge-daviddmdev"><a href="https://david-dm.org/bevry/projectz#info=devDependencies" title="View the status of this project's development dependencies on DavidDM"><img src="https://img.shields.io/david/dev/bevry/projectz.svg" alt="Dev Dependency Status" /></a></span>
15<br class="badge-separator" />
16<span class="badge-githubsponsors"><a href="https://github.com/sponsors/balupton" title="Donate to this project using GitHub Sponsors"><img src="https://img.shields.io/badge/github-donate-yellow.svg" alt="GitHub Sponsors donate button" /></a></span>
17<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
18<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
19<span class="badge-liberapay"><a href="https://liberapay.com/bevry" title="Donate to this project using Liberapay"><img src="https://img.shields.io/badge/liberapay-donate-yellow.svg" alt="Liberapay donate button" /></a></span>
20<span class="badge-buymeacoffee"><a href="https://buymeacoffee.com/balupton" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a></span>
21<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
22<span class="badge-crypto"><a href="https://bevry.me/crypto" title="Donate to this project using Cryptocurrency"><img src="https://img.shields.io/badge/crypto-donate-yellow.svg" alt="crypto donate button" /></a></span>
23<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span>
24<span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span>
25
26<!-- /BADGES -->
27
28
29<!-- DESCRIPTION/ -->
30
31Stop wasting time syncing and updating your project's README and Package Files!
32
33<!-- /DESCRIPTION -->
34
35
36This far, projectz is used directly by [802 repositories](https://github.com/bevry/projectz/network/dependents) and [348 packages](https://github.com/bevry/projectz/network/dependents?dependent_type=PACKAGE), and indirectly by [2936 repositories](https://libraries.io/npm/projectz/dependent-repositories) and [349 packages](https://libraries.io/npm/projectz/dependents).
37
38[Watch the talk.](https://youtu.be/IAB8_UlcNWI)
39
40Here's some of the things it can do:
41
42- [Keep your projects data files synchronised appropriately](https://github.com/bevry/projectz#data-files), supports:
43 - `package.json`
44 - `bower.json`
45 - `component.json`
46 - `jquery.json`
47- [Create beautiful standardised readme files that stay in sync with your data files](https://github.com/bevry/projectz#readme-files), supports:
48 - `README`
49 - `CONTRIBUTING`
50 - `LICENSE`
51 - `BACKERS`
52 - `HISTORY`
53- Automatic injection of the appropriate installation methods, supports:
54 - [npm](https://www.npmjs.com)
55 - [jspm](http://jspm.io)
56 - [Component](http://github.com/component/component)
57 - [Bower](http://bower.io/)
58 - [Editions](https://github.com/bevry/editions)
59 - [DocPad](https://docpad.org) Plugins
60- Automatic injection of your desired [badges](https://github.com/bevry/badges)
61- Automatic injection of your [SPDX](http://spdx.org/licenses/) license information
62- Keep your data and readme files up to date with remote data, supports:
63 - Pulling in your latest contributors from GitHub
64 - Pulling in your latest sponsors from remote APIs ([coming soon](https://github.com/bevry/projectz/issues/80))
65
66## Running Projectz
67
68### Directly
69
70Once installed locally, you can compile your project using projectz by running the following in your terminal:
71
72```shell
73npx projectz compile
74```
75
76### Automatically
77
78To make projectz more automatic, we recommended adding the direct command above to your build tool.
79
80If you don't use a build tool, but do use npm, then you can add the following to your project's `package.json` file:
81
82```json
83{
84 "scripts": {
85 "compile": "projectz compile",
86 "posttest": "npm run compile"
87 }
88}
89```
90
91The `compile` script here is runnable via the command `npm run-script compile` and will compile your project with projectz.
92
93The `posttest` script here automatically compiles your project with projectz after your tests have successfully completed, providing you use `npm test` to run your tests. This is a great place to put projectz as projectz only updates meta documents so won't affect your test, and will always run before a publish.
94
95### GitHub Rate Limiting
96
97If you get a rate limit warning, you will need to add `GITHUB_ACCESS_TOKEN` (or a `GITHUB_CLIENT_ID` AND `GITHUB_CLIENT_SECRET` combination) to your environment. To do this:
98
991. Create a personal access token for your computer at: https://github.com/settings/tokens
1002. Projectz needs the readonly/access permissions for repos and users
1013. Generate the token and copy it
1024. Inside your dotfile profile (`.bashrc`, `.zshrc`) add `export GITHUB_ACCESS_TOKEN="the token value"`
1035. Open a new shell, or run `export GITHUB_ACCESS_TOKEN="the token value"` in your current shell
1046. Run projectz again
105
106## Configuring Projectz
107
108### Data Files
109
110Projectz helps you maintain the following data files:
111
112- `package.json`
113- `bower.json`
114- `component.json`
115- `jquery.json`
116
117It does this by reading them, combining their data in memory, and then outputting the appropriate fields and over-rides for each file.
118
119If you are making use of multiple meta data files, you may find defining a projectz meta file (`projectz.json` for JSON, or `projectz.cson` for [CSON](https://github.com/bevry/cson)) to be useful. The projectz meta file can serve as a central location for the configuration of all the other files. However, if you only require one meta data file, then you can ignore this ability.
120
121Projectz takes notes of these meta data fields:
122
123```javascript
124{
125 // Specify your project's human readable name
126 "title": "Projectz",
127
128 // Specify your project name
129 "name": "projectz",
130
131 // Specify your project's Website URL
132 "homepage": "https://github.com/bevry/projectz",
133
134 // Specify your project's demo URL
135 // If this is missing, and `homepage` is set, we set it to the `homepage` value
136 "demo": "https://github.com/bevry/projectz",
137
138 // Specify your project description
139 "description": "Stop wasting time syncing and updating your project's README and Package Files!",
140
141 // Specify your project's SPDX License
142 // Uses https://www.npmjs.com/packages/spdx for parsing
143 "license": "MIT",
144
145 // Specify your whether the project can run on the client-side in web browsers
146 // If this is missing, and the component or bower package files exist, then this becomes `true`
147 "browsers": true,
148
149 // Specify your project's author details
150 // Can be an array or CSV string
151 "author": "2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me)",
152
153 // Specify your maintainers
154 "maintainers": [
155 "Benjamin Lupton (b@lupton.cc) (http://balupton.com)"
156 ],
157
158 // Specify your sponsors
159 "sponsors": [
160 "Benjamin Lupton (b@lupton.cc) (http://balupton.com)"
161 ],
162
163 // Specify your contributors
164 // This is automatically combined with the contributors from the GitHub Repository API
165 "contributors": [
166 "Benjamin Lupton (b@lupton.cc) (http://balupton.com)"
167 ],
168
169 // Specify your project's repository details
170 // If this is missing, and `homepage` is a GitHub URL, this determined automatically
171 "repository": {
172 "type": "git",
173 "url": "https://github.com/bevry/projectz.git"
174 },
175
176 // Specify your project's issue tracker
177 // If this is missing, and `repository` is a GitHub repository, this determined automatically
178 "bugs": {
179 "url": "https://github.com/bevry/projectz/issues"
180 },
181
182 // Specify your project's badges for use in the readme files
183 // Projectz renders badges by sending the `badges` field to the `badges` package.
184 // Below is some sample projectz configuration for this field to render our most common badges.
185 // Even more badge types and configurations are available than just those included below.
186 // Complete details of what is available can be found over at the badges package:
187 // https://github.com/bevry/badges
188 "badges": {
189 "list": [
190 "travisci",
191 "npmversion",
192 "npmdownloads",
193 "daviddm",
194 "daviddmdev",
195 "---",
196 "slackin",
197 "patreon",
198 "gratipay",
199 "flattr",
200 "paypal",
201 "bitcoin",
202 "wishlist"
203 ],
204 "config": {
205 "patreonUsername": "bevry",
206 "gratipayUsername": "bevry",
207 "flattrUsername": "balupton",
208 "paypalURL": "https://bevry.me/paypal",
209 "bitcoinURL": "https://bevry.me/bitcoin",
210 "wishlistURL": "https://bevry.me/wishlist",
211 "slackinURL": "https://slack.bevry.me"
212 }
213 },
214
215 // If you are using the projectz meta file, you can also define this field
216 // it allows you to set the configuration for other package systems
217 "packages": {
218 "bower": {},
219 "component": {},
220 "jquery": {}
221 }
222}
223```
224
225### Readme Files
226
227Projectz helps you maintain the following readme files:
228
229- `README.md`
230- `CONTRIBUTING.md`
231- `LICENSE.md`
232- `BACKERS.md`
233- `HISTORY.md`
234
235It does this by reading them, and replacing comment tags with the appropriate data.
236
237The following comment tags are supported:
238
239- `<!-- TITLE -->` — outputs the package's `title` field
240- `<!-- BADGES -->` — outputs the badges you have enabled from your package's `badges` field
241- `<!-- DESCRIPTION -->` — outputs the package's `description` field
242- `<!-- INSTALL -->` — outputs the package's installation instructions
243- `<!-- HISTORY -->` — outputs a link to the `HISTORY` file if it exists, otherwise if it is a Github repository, outputs a link to the releases page
244- `<!-- CONTRIBUTE -->` — outputs a link to the `CONTRIBUTE` file if it exists
245- `<!-- BACKERS -->` — outputs who the backers are for the project, including maintainers, sponsors, funding badges, and contributors
246- `<!-- LICENSE -->` — outputs a summary of the license information
247
248As well as these comment tags for updating entire files:
249
250- `<!-- LICENSEFILE -->` — outputs the complete license information
251- `<!-- BACKERSFILE -->` — same as `<!-- BACKERS -->` but made for an individual file instead
252
253As an example, here is a a basic `README.md` file:
254
255 <!-- TITLE -->
256 <!-- BADGES -->
257 <!-- DESCRIPTION -->
258 <!-- INSTALL -->
259
260 ## Usage
261
262[Complete API Documentation.](http://master.projectz.bevry.surge.sh/docs/globals.html)
263
264 Usage instructions go here
265
266 <!-- HISTORY -->
267 <!-- CONTRIBUTE -->
268 <!-- BACKERS -->
269 <!-- LICENSE -->
270
271This README is also, expectedly, built with projectz. [View its source.](https://raw.githubusercontent.com/bevry/projectz/master/README.md)
272
273<!-- INSTALL/ -->
274
275<h2>Install</h2>
276
277<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
278<h4>Install Globally</h4>
279<ul>
280<li>Install: <code>npm install --global projectz</code></li>
281<li>Executable: <code>projectz</code></li>
282</ul>
283<h4>Install Locally</h4>
284<ul>
285<li>Install: <code>npm install --save projectz</code></li>
286<li>Executable: <code>npx projectz</code></li>
287<li>Import: <code>import * as pkg from ('projectz')</code></li>
288<li>Require: <code>const pkg = require('projectz')</code></li>
289</ul>
290
291<h3><a href="https://editions.bevry.me" title="Editions are the best way to produce and consume packages you care about.">Editions</a></h3>
292
293<p>This package is published with the following editions:</p>
294
295<ul><li><code>projectz/source/index.ts</code> is <a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a> source code with <a href="https://babeljs.io/docs/learn-es2015/#modules" title="ECMAScript Modules">Import</a> for modules</li>
296<li><code>projectz</code> aliases <code>projectz/edition-es2019/index.js</code></li>
297<li><code>projectz/edition-es2019/index.js</code> is <a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a> compiled against <a href="https://en.wikipedia.org/wiki/ECMAScript#10th_Edition_-_ECMAScript_2019" title="ECMAScript ES2019">ES2019</a> for <a href="https://nodejs.org" title="Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine">Node.js</a> with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li>
298<li><code>projectz/edition-es2019-esm/index.js</code> is <a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a> compiled against <a href="https://en.wikipedia.org/wiki/ECMAScript#10th_Edition_-_ECMAScript_2019" title="ECMAScript ES2019">ES2019</a> for <a href="https://nodejs.org" title="Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine">Node.js</a> with <a href="https://babeljs.io/docs/learn-es2015/#modules" title="ECMAScript Modules">Import</a> for modules</li></ul>
299
300<!-- /INSTALL -->
301
302
303<!-- HISTORY/ -->
304
305<h2>History</h2>
306
307<a href="https://github.com/bevry/projectz/blob/master/HISTORY.md#files">Discover the release history by heading on over to the <code>HISTORY.md</code> file.</a>
308
309<!-- /HISTORY -->
310
311
312<!-- CONTRIBUTE/ -->
313
314<h2>Contribute</h2>
315
316<a href="https://github.com/bevry/projectz/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>
317
318<!-- /CONTRIBUTE -->
319
320
321<!-- BACKERS/ -->
322
323<h2>Backers</h2>
324
325<h3>Maintainers</h3>
326
327These amazing people are maintaining this project:
328
329<ul><li><a href="https://github.com/balupton">Benjamin Lupton</a><a href="https://github.com/bevry/projectz/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/projectz">view contributions</a></li>
330<li><a href="https://github.com/jamesgeorge007">James George</a><a href="https://github.com/bevry/projectz/commits?author=jamesgeorge007" title="View the GitHub contributions of James George on repository bevry/projectz">view contributions</a></li>
331<li><a href="https://github.com/RobLoach">Rob Loach</a><a href="https://github.com/bevry/projectz/commits?author=RobLoach" title="View the GitHub contributions of Rob Loach on repository bevry/projectz">view contributions</a></li></ul>
332
333<h3>Sponsors</h3>
334
335No sponsors yet! Will you be the first?
336
337<span class="badge-githubsponsors"><a href="https://github.com/sponsors/balupton" title="Donate to this project using GitHub Sponsors"><img src="https://img.shields.io/badge/github-donate-yellow.svg" alt="GitHub Sponsors donate button" /></a></span>
338<span class="badge-patreon"><a href="https://patreon.com/bevry" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
339<span class="badge-flattr"><a href="https://flattr.com/profile/balupton" title="Donate to this project using Flattr"><img src="https://img.shields.io/badge/flattr-donate-yellow.svg" alt="Flattr donate button" /></a></span>
340<span class="badge-liberapay"><a href="https://liberapay.com/bevry" title="Donate to this project using Liberapay"><img src="https://img.shields.io/badge/liberapay-donate-yellow.svg" alt="Liberapay donate button" /></a></span>
341<span class="badge-buymeacoffee"><a href="https://buymeacoffee.com/balupton" title="Donate to this project using Buy Me A Coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg" alt="Buy Me A Coffee donate button" /></a></span>
342<span class="badge-opencollective"><a href="https://opencollective.com/bevry" title="Donate to this project using Open Collective"><img src="https://img.shields.io/badge/open%20collective-donate-yellow.svg" alt="Open Collective donate button" /></a></span>
343<span class="badge-crypto"><a href="https://bevry.me/crypto" title="Donate to this project using Cryptocurrency"><img src="https://img.shields.io/badge/crypto-donate-yellow.svg" alt="crypto donate button" /></a></span>
344<span class="badge-paypal"><a href="https://bevry.me/paypal" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span>
345<span class="badge-wishlist"><a href="https://bevry.me/wishlist" title="Buy an item on our wishlist for us"><img src="https://img.shields.io/badge/wishlist-donate-yellow.svg" alt="Wishlist browse button" /></a></span>
346
347<h3>Contributors</h3>
348
349These amazing people have contributed code to this project:
350
351<ul><li><a href="https://github.com/balupton">Benjamin Lupton</a><a href="https://github.com/bevry/projectz/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/projectz">view contributions</a></li>
352<li><a href="https://github.com/jamesgeorge007">James George</a><a href="https://github.com/bevry/projectz/commits?author=jamesgeorge007" title="View the GitHub contributions of James George on repository bevry/projectz">view contributions</a></li>
353<li><a href="https://github.com/oliverlorenz">Oliver Lorenz</a><a href="https://github.com/bevry/projectz/commits?author=oliverlorenz" title="View the GitHub contributions of Oliver Lorenz on repository bevry/projectz">view contributions</a></li>
354<li><a href="https://github.com/peterkc">Peter C</a><a href="https://github.com/bevry/projectz/commits?author=peterkc" title="View the GitHub contributions of Peter C on repository bevry/projectz">view contributions</a></li>
355<li><a href="https://github.com/pflannery">Peter Flannery</a><a href="https://github.com/bevry/projectz/commits?author=pflannery" title="View the GitHub contributions of Peter Flannery on repository bevry/projectz">view contributions</a></li>
356<li><a href="https://github.com/RobLoach">Rob Loach</a><a href="https://github.com/bevry/projectz/commits?author=RobLoach" title="View the GitHub contributions of Rob Loach on repository bevry/projectz">view contributions</a></li>
357<li><a href="https://github.com/mightyiam">Shahar Dawn Or</a><a href="https://github.com/bevry/projectz/commits?author=mightyiam" title="View the GitHub contributions of Shahar Dawn Or on repository bevry/projectz">view contributions</a></li>
358<li><a href="https://github.com/Zearin">Zearin</a><a href="https://github.com/bevry/projectz/commits?author=Zearin" title="View the GitHub contributions of Zearin on repository bevry/projectz">view contributions</a></li>
359<li><a href="https://github.com/zlatanvasovic">Zlatan Vasović</a><a href="https://github.com/bevry/projectz/commits?author=zlatanvasovic" title="View the GitHub contributions of Zlatan Vasović on repository bevry/projectz">view contributions</a></li>
360<li><a href="https://github.com/vsopvsop">vsopvsop</a><a href="https://github.com/bevry/projectz/commits?author=vsopvsop" title="View the GitHub contributions of vsopvsop on repository bevry/projectz">view contributions</a></li></ul>
361
362<a href="https://github.com/bevry/projectz/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>
363
364<!-- /BACKERS -->
365
366
367<!-- LICENSE/ -->
368
369<h2>License</h2>
370
371Unless stated otherwise all works are:
372
373<ul><li>Copyright &copy; 2013+ <a href="http://bevry.me">Bevry Pty Ltd</a></li></ul>
374
375and licensed under:
376
377<ul><li><a href="http://spdx.org/licenses/MIT.html">MIT License</a></li></ul>
378
379<!-- /LICENSE -->