chore: remove node_modules from git master

This commit is contained in:
Denis Tsoi 2020-01-15 14:25:06 +08:00
parent fdeeadc074
commit 56f7405bb7
13885 changed files with 0 additions and 2233767 deletions

1
node_modules/.bin/acorn generated vendored
View File

@ -1 +0,0 @@
../acorn/bin/acorn

1
node_modules/.bin/atob generated vendored
View File

@ -1 +0,0 @@
../atob/bin/atob.js

1
node_modules/.bin/babylon generated vendored
View File

@ -1 +0,0 @@
../babylon/bin/babylon.js

1
node_modules/.bin/browser-sync generated vendored
View File

@ -1 +0,0 @@
../browser-sync/dist/bin.js

1
node_modules/.bin/css-beautify generated vendored
View File

@ -1 +0,0 @@
../js-beautify/js/bin/css-beautify.js

1
node_modules/.bin/dependency-tree generated vendored
View File

@ -1 +0,0 @@
../dependency-tree/bin/cli.js

1
node_modules/.bin/detective-amd generated vendored
View File

@ -1 +0,0 @@
../detective-amd/bin/detective-amd.js

1
node_modules/.bin/dev-ip generated vendored
View File

@ -1 +0,0 @@
../dev-ip/lib/dev-ip.js

1
node_modules/.bin/editorconfig generated vendored
View File

@ -1 +0,0 @@
../editorconfig/bin/editorconfig

1
node_modules/.bin/eleventy generated vendored
View File

@ -1 +0,0 @@
../@11ty/eleventy/cmd.js

1
node_modules/.bin/errno generated vendored
View File

@ -1 +0,0 @@
../errno/cli.js

1
node_modules/.bin/escodegen generated vendored
View File

@ -1 +0,0 @@
../escodegen/bin/escodegen.js

1
node_modules/.bin/esgenerate generated vendored
View File

@ -1 +0,0 @@
../escodegen/bin/esgenerate.js

1
node_modules/.bin/esparse generated vendored
View File

@ -1 +0,0 @@
../esprima/bin/esparse.js

1
node_modules/.bin/esvalidate generated vendored
View File

@ -1 +0,0 @@
../esprima/bin/esvalidate.js

1
node_modules/.bin/filing-cabinet generated vendored
View File

@ -1 +0,0 @@
../filing-cabinet/bin/cli.js

1
node_modules/.bin/gonzales generated vendored
View File

@ -1 +0,0 @@
../gonzales-pe/bin/gonzales.js

1
node_modules/.bin/handlebars generated vendored
View File

@ -1 +0,0 @@
../handlebars/bin/handlebars

1
node_modules/.bin/html-beautify generated vendored
View File

@ -1 +0,0 @@
../js-beautify/js/bin/html-beautify.js

1
node_modules/.bin/js-beautify generated vendored
View File

@ -1 +0,0 @@
../js-beautify/js/bin/js-beautify.js

1
node_modules/.bin/js-yaml generated vendored
View File

@ -1 +0,0 @@
../js-yaml/bin/js-yaml.js

1
node_modules/.bin/lookup-amd generated vendored
View File

@ -1 +0,0 @@
../module-lookup-amd/bin/cli.js

1
node_modules/.bin/lt generated vendored
View File

@ -1 +0,0 @@
../localtunnel/bin/client

1
node_modules/.bin/markdown-it generated vendored
View File

@ -1 +0,0 @@
../markdown-it/bin/markdown-it.js

1
node_modules/.bin/mime generated vendored
View File

@ -1 +0,0 @@
../mime/cli.js

1
node_modules/.bin/mkdirp generated vendored
View File

@ -1 +0,0 @@
../mkdirp/bin/cmd.js

View File

@ -1 +0,0 @@
../module-definition/bin/module-definition.js

1
node_modules/.bin/mustache generated vendored
View File

@ -1 +0,0 @@
../mustache/bin/mustache

1
node_modules/.bin/nopt generated vendored
View File

@ -1 +0,0 @@
../nopt/bin/nopt.js

View File

@ -1 +0,0 @@
../nunjucks/bin/precompile

1
node_modules/.bin/parser generated vendored
View File

@ -1 +0,0 @@
../@babel/parser/bin/babel-parser.js

1
node_modules/.bin/precinct generated vendored
View File

@ -1 +0,0 @@
../precinct/bin/cli.js

1
node_modules/.bin/pretty-ms generated vendored
View File

@ -1 +0,0 @@
../pretty-ms/cli.js

1
node_modules/.bin/r.js generated vendored
View File

@ -1 +0,0 @@
../requirejs/bin/r.js

1
node_modules/.bin/r_js generated vendored
View File

@ -1 +0,0 @@
../requirejs/bin/r.js

1
node_modules/.bin/rimraf generated vendored
View File

@ -1 +0,0 @@
../rimraf/bin.js

1
node_modules/.bin/sass-lookup generated vendored
View File

@ -1 +0,0 @@
../sass-lookup/bin/cli.js

1
node_modules/.bin/semver generated vendored
View File

@ -1 +0,0 @@
../semver/bin/semver.js

1
node_modules/.bin/stylus-lookup generated vendored
View File

@ -1 +0,0 @@
../stylus-lookup/bin/cli.js

1
node_modules/.bin/throttleproxy generated vendored
View File

@ -1 +0,0 @@
../stream-throttle/bin/throttleproxy.js

1
node_modules/.bin/tsc generated vendored
View File

@ -1 +0,0 @@
../typescript/bin/tsc

1
node_modules/.bin/tsserver generated vendored
View File

@ -1 +0,0 @@
../typescript/bin/tsserver

1
node_modules/.bin/uglifyjs generated vendored
View File

@ -1 +0,0 @@
../uglify-js/bin/uglifyjs

1
node_modules/.bin/window-size generated vendored
View File

@ -1 +0,0 @@
../window-size/cli.js

View File

@ -1,12 +0,0 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = false
trim_trailing_whitespace = true
charset = utf-8
[*.js]
insert_final_newline = true

View File

@ -1,17 +0,0 @@
module.exports = {
env: {
es6: true,
node: true
},
extends: "eslint:recommended",
parserOptions: {
sourceType: "module",
ecmaVersion: 2017
},
rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"]
}
};

View File

@ -1,3 +0,0 @@
# These are supported funding model platforms
open_collective: 11ty

View File

@ -1,10 +0,0 @@
---
name: I have a question about Eleventy
about: e.g. “How do I do this in Eleventy?” or “Can Eleventy do this?”
title: ''
labels: education
assignees: ''
---

View File

@ -1,31 +0,0 @@
---
name: Im having a problem with Eleventy
about: Create a report to help us improve
title: ''
labels: needs-triage
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS and Version: [e.g. Windows/Mac/Linux]
- Eleventy Version [via `eleventy --version` or `npx @11ty/eleventy --version`]
**Additional context**
Add any other context about the problem here.

View File

@ -1,20 +0,0 @@
---
name: I want Eleventy do to this new thing
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

1
node_modules/@11ty/eleventy/.nvmrc generated vendored
View File

@ -1 +0,0 @@
10

View File

@ -1,16 +0,0 @@
language: node_js
node_js:
- 8
- 10
- 12
before_script:
- npm install
script: npm run test
branches:
except:
- gh-pages
sudo: false
os:
- linux
- osx
- windows

View File

@ -1,46 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at eleventy@zachleat.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

21
node_modules/@11ty/eleventy/LICENSE generated vendored
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 Zach Leatherman @zachleat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,40 +0,0 @@
<p align="center"><img src="https://www.11ty.io/img/logo-github.png" alt="eleventy Logo"></p>
# eleventy 🕚⚡️
A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML.
Works with HTML, Markdown, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pug, and JavaScript Template Literals.
## ➡ [Documentation](https://www.11ty.io/docs/)
- Please star [this repo on GitHub](https://github.com/11ty/eleventy/)!
- Follow us on Twitter [@eleven_ty](https://twitter.com/eleven_ty)
- Support [11ty on Open Collective](https://opencollective.com/11ty)
- [11ty on npm](https://www.npmjs.com/org/11ty)
- [11ty on GitHub](https://github.com/11ty)
- [11ty/eleventy on Travis CI](https://travis-ci.org/11ty/eleventy)
[![npm Version](https://img.shields.io/npm/v/@11ty/eleventy.svg?style=for-the-badge)](https://www.npmjs.com/package/@11ty/eleventy) [![GitHub issues](https://img.shields.io/github/issues/11ty/eleventy.svg?style=for-the-badge)](https://github.com/11ty/eleventy/issues) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier) [![npm Downloads](https://img.shields.io/npm/dt/@11ty/eleventy.svg?style=for-the-badge)](https://www.npmjs.com/package/@11ty/eleventy)
## Tests
```
npm run test
```
- We use the [ava JavaScript test runner](https://github.com/avajs/ava) ([Assertions documentation](https://github.com/avajs/ava/blob/master/docs/03-assertions.md))
- To keep tests fast, thou shalt try to avoid writing files in tests.
- [Code Coverage Statistics](https://github.com/11ty/eleventy/blob/master/docs/coverage.md)
- [Benchmark for Performance Regressions](https://github.com/11ty/eleventy-benchmark)
## Major Roadmapped Features
- [Top Feature Requests](https://github.com/11ty/eleventy/issues?q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc) (Add your own votes using the 👍 reaction)
- [Documentation Requests](https://github.com/11ty/eleventy/issues?utf8=%E2%9C%93&q=is%3Aissue+sort%3Areactions-%2B1-desc+is%3Aclosed+label%3Adocumentation+label%3Aneeds-votes) (Add your own votes using the 👍 reaction)
- [Top Bugs 😱](https://github.com/11ty/eleventy/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your own votes using the 👍 reaction)
- [Newest Bugs 🙀](https://github.com/11ty/eleventy/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
## Plugins
See the [official docs on plugins](https://www.11ty.io/docs/plugins/).

13
node_modules/@11ty/eleventy/TODO.md generated vendored
View File

@ -1,13 +0,0 @@
# User defined file extensions (Issue #117) TODO List
[x] add option to do straight file output instead of dir/index.extension
[x] outputFileExtension
[x] filter function
[] example of allowing consumers of plugins to override plugin options (e.g. I want a different `outputStyle` in my sass)
[] allow overrides of built-in keys with user extensions (e.g. I want a newer version of liquid)
[] What if multiple plugins operate on the same file extension? SVGO and svgmin, for example
[] Work with non-plaintext file formats like PNG
[] should filter also support String or Array of String and run a configuration method to add globs for ignores?
[] undecided: its garbage that I have to use setTemplateFormats too (and theres not an additive method either), options versus opt-in, you could install the plugin but not want the language

71
node_modules/@11ty/eleventy/cmd.js generated vendored
View File

@ -1,71 +0,0 @@
#!/usr/bin/env node
const pkg = require("./package.json");
const chalk = require("chalk"); // node 4+
require("please-upgrade-node")(pkg, {
message: function(requiredVersion) {
return chalk.red(
`Eleventy requires Node ${requiredVersion}. Youll need to upgrade to use it!`
);
}
});
if (process.env.DEBUG) {
require("time-require");
}
const EleventyErrorHandler = require("./src/EleventyErrorHandler");
try {
const argv = require("minimist")(process.argv.slice(2));
const Eleventy = require("./src/Eleventy");
const EleventyCommandCheck = require("./src/EleventyCommandCheck");
process.on("unhandledRejection", (error, promise) => {
EleventyErrorHandler.error(promise, "Unhandled rejection in promise");
});
process.on("uncaughtException", e => {
EleventyErrorHandler.fatal(e, "Uncaught exception");
});
process.on("rejectionHandled", promise => {
EleventyErrorHandler.warn(
promise,
"A promise rejection was handled asynchronously"
);
});
let cmdCheck = new EleventyCommandCheck(argv);
cmdCheck.hasUnknownArguments();
let elev = new Eleventy(argv.input, argv.output);
elev.setConfigPathOverride(argv.config);
elev.setPathPrefix(argv.pathprefix);
elev.setDryRun(argv.dryrun);
elev.setPassthroughAll(argv.passthroughall);
elev.setFormats(argv.formats);
let isVerbose = process.env.DEBUG ? false : !argv.quiet;
elev.setIsVerbose(isVerbose);
// careful, we cant use async/await here to error properly
// with old node versions in `please-upgrade-node` above.
elev
.init()
.then(function() {
if (argv.version) {
console.log(elev.getVersion());
} else if (argv.help) {
console.log(elev.getHelp());
} else if (argv.serve) {
elev.watch().then(function() {
elev.serve(argv.port);
});
} else if (argv.watch) {
elev.watch();
} else {
elev.write();
}
})
.catch(EleventyErrorHandler.fatal);
} catch (e) {
EleventyErrorHandler.fatal(e, "Eleventy fatal error");
}

View File

@ -1,50 +0,0 @@
const urlFilter = require("./src/Filters/Url");
const slugFilter = require("./src/Filters/Slug");
module.exports = function(config) {
config.addFilter("slug", slugFilter);
config.addFilter("url", urlFilter);
return {
templateFormats: [
"liquid",
"ejs",
"md",
"hbs",
"mustache",
"haml",
"pug",
"njk",
"html",
"jstl",
"11ty.js"
],
// if your site lives in a subdirectory, change this
pathPrefix: "/",
markdownTemplateEngine: "liquid",
htmlTemplateEngine: "liquid",
dataTemplateEngine: "liquid",
passthroughFileCopy: true,
htmlOutputSuffix: "-o",
jsDataFileSuffix: ".11tydata",
keys: {
package: "pkg",
layout: "layout",
permalink: "permalink",
permalinkRoot: "permalinkBypassOutputDir",
engineOverride: "templateEngineOverride"
},
dir: {
input: ".",
includes: "_includes",
data: "_data",
output: "_site"
},
// deprecated, use config.addTransform
filters: {},
// deprecated, use config.addHandlebarsHelper
handlebarsHelpers: {},
// deprecated, use config.addNunjucksFilter
nunjucksFilters: {}
};
};

View File

@ -1,18 +0,0 @@
const TemplatePath = require("../src/TemplatePath");
module.exports = {
templateFormats: ["njk"],
dir: {
input: "docs-src",
data: "_data",
output: "docs"
},
nunjucksFilters: {
removeDir: function(str) {
return TemplatePath.stripLeadingSubPath(
str,
TemplatePath.join(__dirname, "..")
);
}
}
};

View File

@ -1,57 +0,0 @@
{"total": {"lines":{"total":2763,"covered":2450,"skipped":0,"pct":88.67},"statements":{"total":2778,"covered":2465,"skipped":0,"pct":88.73},"functions":{"total":656,"covered":574,"skipped":0,"pct":87.5},"branches":{"total":1110,"covered":902,"skipped":0,"pct":81.26}}
,"/Users/zachleat/Code/eleventy/config.js": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":6,"covered":6,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Benchmark.js": {"lines":{"total":12,"covered":11,"skipped":0,"pct":91.67},"functions":{"total":6,"covered":5,"skipped":0,"pct":83.33},"statements":{"total":12,"covered":11,"skipped":0,"pct":91.67},"branches":{"total":6,"covered":4,"skipped":0,"pct":66.67}}
,"/Users/zachleat/Code/eleventy/src/BenchmarkGroup.js": {"lines":{"total":34,"covered":23,"skipped":0,"pct":67.65},"functions":{"total":7,"covered":5,"skipped":0,"pct":71.43},"statements":{"total":34,"covered":23,"skipped":0,"pct":67.65},"branches":{"total":10,"covered":3,"skipped":0,"pct":30}}
,"/Users/zachleat/Code/eleventy/src/BenchmarkManager.js": {"lines":{"total":17,"covered":13,"skipped":0,"pct":76.47},"functions":{"total":7,"covered":5,"skipped":0,"pct":71.43},"statements":{"total":17,"covered":13,"skipped":0,"pct":76.47},"branches":{"total":4,"covered":3,"skipped":0,"pct":75}}
,"/Users/zachleat/Code/eleventy/src/Config.js": {"lines":{"total":5,"covered":5,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":5,"covered":5,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Eleventy.js": {"lines":{"total":177,"covered":97,"skipped":0,"pct":54.8},"functions":{"total":33,"covered":19,"skipped":0,"pct":57.58},"statements":{"total":177,"covered":97,"skipped":0,"pct":54.8},"branches":{"total":52,"covered":24,"skipped":0,"pct":46.15}}
,"/Users/zachleat/Code/eleventy/src/EleventyBaseError.js": {"lines":{"total":5,"covered":5,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":5,"covered":5,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/EleventyCommandCheck.js": {"lines":{"total":28,"covered":28,"skipped":0,"pct":100},"functions":{"total":5,"covered":5,"skipped":0,"pct":100},"statements":{"total":28,"covered":28,"skipped":0,"pct":100},"branches":{"total":8,"covered":7,"skipped":0,"pct":87.5}}
,"/Users/zachleat/Code/eleventy/src/EleventyConfig.js": {"lines":{"total":2,"covered":2,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/EleventyErrorHandler.js": {"lines":{"total":36,"covered":33,"skipped":0,"pct":91.67},"functions":{"total":8,"covered":8,"skipped":0,"pct":100},"statements":{"total":36,"covered":33,"skipped":0,"pct":91.67},"branches":{"total":37,"covered":25,"skipped":0,"pct":67.57}}
,"/Users/zachleat/Code/eleventy/src/EleventyErrorUtil.js": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":5,"covered":5,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/EleventyExtensionMap.js": {"lines":{"total":60,"covered":58,"skipped":0,"pct":96.67},"functions":{"total":25,"covered":23,"skipped":0,"pct":92},"statements":{"total":60,"covered":58,"skipped":0,"pct":96.67},"branches":{"total":27,"covered":27,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/EleventyFiles.js": {"lines":{"total":126,"covered":119,"skipped":0,"pct":94.44},"functions":{"total":37,"covered":33,"skipped":0,"pct":89.19},"statements":{"total":126,"covered":119,"skipped":0,"pct":94.44},"branches":{"total":46,"covered":42,"skipped":0,"pct":91.3}}
,"/Users/zachleat/Code/eleventy/src/EleventyServe.js": {"lines":{"total":61,"covered":22,"skipped":0,"pct":36.07},"functions":{"total":16,"covered":9,"skipped":0,"pct":56.25},"statements":{"total":61,"covered":22,"skipped":0,"pct":36.07},"branches":{"total":41,"covered":10,"skipped":0,"pct":24.39}}
,"/Users/zachleat/Code/eleventy/src/EleventyWatchTargets.js": {"lines":{"total":46,"covered":43,"skipped":0,"pct":93.48},"functions":{"total":20,"covered":18,"skipped":0,"pct":90},"statements":{"total":46,"covered":43,"skipped":0,"pct":93.48},"branches":{"total":15,"covered":14,"skipped":0,"pct":93.33}}
,"/Users/zachleat/Code/eleventy/src/Template.js": {"lines":{"total":282,"covered":267,"skipped":0,"pct":94.68},"functions":{"total":47,"covered":46,"skipped":0,"pct":97.87},"statements":{"total":284,"covered":269,"skipped":0,"pct":94.72},"branches":{"total":101,"covered":87,"skipped":0,"pct":86.14}}
,"/Users/zachleat/Code/eleventy/src/TemplateCache.js": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/TemplateCollection.js": {"lines":{"total":29,"covered":27,"skipped":0,"pct":93.1},"functions":{"total":13,"covered":12,"skipped":0,"pct":92.31},"statements":{"total":31,"covered":29,"skipped":0,"pct":93.55},"branches":{"total":10,"covered":8,"skipped":0,"pct":80}}
,"/Users/zachleat/Code/eleventy/src/TemplateConfig.js": {"lines":{"total":57,"covered":52,"skipped":0,"pct":91.23},"functions":{"total":9,"covered":6,"skipped":0,"pct":66.67},"statements":{"total":57,"covered":52,"skipped":0,"pct":91.23},"branches":{"total":24,"covered":22,"skipped":0,"pct":91.67}}
,"/Users/zachleat/Code/eleventy/src/TemplateContent.js": {"lines":{"total":81,"covered":76,"skipped":0,"pct":93.83},"functions":{"total":17,"covered":16,"skipped":0,"pct":94.12},"statements":{"total":81,"covered":76,"skipped":0,"pct":93.83},"branches":{"total":34,"covered":31,"skipped":0,"pct":91.18}}
,"/Users/zachleat/Code/eleventy/src/TemplateData.js": {"lines":{"total":161,"covered":152,"skipped":0,"pct":94.41},"functions":{"total":27,"covered":27,"skipped":0,"pct":100},"statements":{"total":163,"covered":154,"skipped":0,"pct":94.48},"branches":{"total":50,"covered":41,"skipped":0,"pct":82}}
,"/Users/zachleat/Code/eleventy/src/TemplateFileSlug.js": {"lines":{"total":23,"covered":23,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":23,"covered":23,"skipped":0,"pct":100},"branches":{"total":8,"covered":8,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/TemplateGlob.js": {"lines":{"total":15,"covered":14,"skipped":0,"pct":93.33},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":15,"covered":14,"skipped":0,"pct":93.33},"branches":{"total":8,"covered":7,"skipped":0,"pct":87.5}}
,"/Users/zachleat/Code/eleventy/src/TemplateLayout.js": {"lines":{"total":68,"covered":68,"skipped":0,"pct":100},"functions":{"total":9,"covered":9,"skipped":0,"pct":100},"statements":{"total":69,"covered":69,"skipped":0,"pct":100},"branches":{"total":14,"covered":14,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/TemplateLayoutPathResolver.js": {"lines":{"total":47,"covered":45,"skipped":0,"pct":95.74},"functions":{"total":11,"covered":11,"skipped":0,"pct":100},"statements":{"total":47,"covered":45,"skipped":0,"pct":95.74},"branches":{"total":18,"covered":16,"skipped":0,"pct":88.89}}
,"/Users/zachleat/Code/eleventy/src/TemplateMap.js": {"lines":{"total":238,"covered":233,"skipped":0,"pct":97.9},"functions":{"total":32,"covered":31,"skipped":0,"pct":96.88},"statements":{"total":238,"covered":233,"skipped":0,"pct":97.9},"branches":{"total":125,"covered":113,"skipped":0,"pct":90.4}}
,"/Users/zachleat/Code/eleventy/src/TemplatePassthrough.js": {"lines":{"total":38,"covered":36,"skipped":0,"pct":94.74},"functions":{"total":9,"covered":8,"skipped":0,"pct":88.89},"statements":{"total":38,"covered":36,"skipped":0,"pct":94.74},"branches":{"total":14,"covered":12,"skipped":0,"pct":85.71}}
,"/Users/zachleat/Code/eleventy/src/TemplatePassthroughManager.js": {"lines":{"total":58,"covered":53,"skipped":0,"pct":91.38},"functions":{"total":17,"covered":17,"skipped":0,"pct":100},"statements":{"total":58,"covered":53,"skipped":0,"pct":91.38},"branches":{"total":14,"covered":10,"skipped":0,"pct":71.43}}
,"/Users/zachleat/Code/eleventy/src/TemplatePath.js": {"lines":{"total":74,"covered":74,"skipped":0,"pct":100},"functions":{"total":23,"covered":22,"skipped":0,"pct":95.65},"statements":{"total":75,"covered":75,"skipped":0,"pct":100},"branches":{"total":38,"covered":38,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/TemplatePermalink.js": {"lines":{"total":30,"covered":30,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":30,"covered":30,"skipped":0,"pct":100},"branches":{"total":20,"covered":20,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/TemplatePermalinkNoWrite.js": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/TemplateRender.js": {"lines":{"total":77,"covered":76,"skipped":0,"pct":98.7},"functions":{"total":22,"covered":22,"skipped":0,"pct":100},"statements":{"total":77,"covered":76,"skipped":0,"pct":98.7},"branches":{"total":42,"covered":40,"skipped":0,"pct":95.24}}
,"/Users/zachleat/Code/eleventy/src/TemplateWriter.js": {"lines":{"total":96,"covered":78,"skipped":0,"pct":81.25},"functions":{"total":21,"covered":15,"skipped":0,"pct":71.43},"statements":{"total":96,"covered":78,"skipped":0,"pct":81.25},"branches":{"total":10,"covered":3,"skipped":0,"pct":30}}
,"/Users/zachleat/Code/eleventy/src/UserConfig.js": {"lines":{"total":166,"covered":107,"skipped":0,"pct":64.46},"functions":{"total":45,"covered":23,"skipped":0,"pct":51.11},"statements":{"total":167,"covered":108,"skipped":0,"pct":64.67},"branches":{"total":66,"covered":36,"skipped":0,"pct":54.55}}
,"/Users/zachleat/Code/eleventy/src/Engines/Ejs.js": {"lines":{"total":20,"covered":19,"skipped":0,"pct":95},"functions":{"total":7,"covered":6,"skipped":0,"pct":85.71},"statements":{"total":20,"covered":19,"skipped":0,"pct":95},"branches":{"total":9,"covered":8,"skipped":0,"pct":88.89}}
,"/Users/zachleat/Code/eleventy/src/Engines/Haml.js": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Engines/Handlebars.js": {"lines":{"total":30,"covered":30,"skipped":0,"pct":100},"functions":{"total":9,"covered":9,"skipped":0,"pct":100},"statements":{"total":30,"covered":30,"skipped":0,"pct":100},"branches":{"total":6,"covered":5,"skipped":0,"pct":83.33}}
,"/Users/zachleat/Code/eleventy/src/Engines/Html.js": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Engines/JavaScript.js": {"lines":{"total":50,"covered":48,"skipped":0,"pct":96},"functions":{"total":12,"covered":12,"skipped":0,"pct":100},"statements":{"total":51,"covered":49,"skipped":0,"pct":96.08},"branches":{"total":42,"covered":37,"skipped":0,"pct":88.1}}
,"/Users/zachleat/Code/eleventy/src/Engines/JavaScriptTemplateLiteral.js": {"lines":{"total":18,"covered":17,"skipped":0,"pct":94.44},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":18,"covered":17,"skipped":0,"pct":94.44},"branches":{"total":6,"covered":6,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Engines/Liquid.js": {"lines":{"total":73,"covered":70,"skipped":0,"pct":95.89},"functions":{"total":26,"covered":25,"skipped":0,"pct":96.15},"statements":{"total":73,"covered":70,"skipped":0,"pct":95.89},"branches":{"total":15,"covered":13,"skipped":0,"pct":86.67}}
,"/Users/zachleat/Code/eleventy/src/Engines/Markdown.js": {"lines":{"total":33,"covered":30,"skipped":0,"pct":90.91},"functions":{"total":9,"covered":8,"skipped":0,"pct":88.89},"statements":{"total":33,"covered":30,"skipped":0,"pct":90.91},"branches":{"total":16,"covered":13,"skipped":0,"pct":81.25}}
,"/Users/zachleat/Code/eleventy/src/Engines/Mustache.js": {"lines":{"total":10,"covered":10,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":10,"covered":10,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Engines/Nunjucks.js": {"lines":{"total":61,"covered":54,"skipped":0,"pct":88.52},"functions":{"total":19,"covered":18,"skipped":0,"pct":94.74},"statements":{"total":61,"covered":54,"skipped":0,"pct":88.52},"branches":{"total":13,"covered":11,"skipped":0,"pct":84.62}}
,"/Users/zachleat/Code/eleventy/src/Engines/Pug.js": {"lines":{"total":17,"covered":17,"skipped":0,"pct":100},"functions":{"total":5,"covered":5,"skipped":0,"pct":100},"statements":{"total":17,"covered":17,"skipped":0,"pct":100},"branches":{"total":9,"covered":8,"skipped":0,"pct":88.89}}
,"/Users/zachleat/Code/eleventy/src/Engines/TemplateEngine.js": {"lines":{"total":51,"covered":51,"skipped":0,"pct":100},"functions":{"total":18,"covered":18,"skipped":0,"pct":100},"statements":{"total":53,"covered":53,"skipped":0,"pct":100},"branches":{"total":8,"covered":8,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Errors/TemplateContentPrematureUseError.js": {"lines":{"total":2,"covered":2,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Errors/UsingCircularTemplateContentReferenceError.js": {"lines":{"total":2,"covered":2,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Filters/Slug.js": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Filters/Url.js": {"lines":{"total":18,"covered":18,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":18,"covered":18,"skipped":0,"pct":100},"branches":{"total":21,"covered":21,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Plugins/Pagination.js": {"lines":{"total":107,"covered":99,"skipped":0,"pct":92.52},"functions":{"total":16,"covered":15,"skipped":0,"pct":93.75},"statements":{"total":109,"covered":101,"skipped":0,"pct":92.66},"branches":{"total":66,"covered":54,"skipped":0,"pct":81.82}}
,"/Users/zachleat/Code/eleventy/src/Util/Capitalize.js": {"lines":{"total":4,"covered":4,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":4,"covered":4,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Util/Merge.js": {"lines":{"total":28,"covered":26,"skipped":0,"pct":92.86},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":28,"covered":26,"skipped":0,"pct":92.86},"branches":{"total":22,"covered":19,"skipped":0,"pct":86.36}}
,"/Users/zachleat/Code/eleventy/src/Util/Pluralize.js": {"lines":{"total":2,"covered":2,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":2,"covered":2,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/zachleat/Code/eleventy/src/Util/Sortable.js": {"lines":{"total":46,"covered":39,"skipped":0,"pct":84.78},"functions":{"total":23,"covered":17,"skipped":0,"pct":73.91},"statements":{"total":47,"covered":40,"skipped":0,"pct":85.11},"branches":{"total":18,"covered":17,"skipped":0,"pct":94.44}}
}

View File

@ -1,10 +0,0 @@
---
permalink: coverage.md
---
# Code Coverage for Eleventy v{{ pkg.version }}
| Filename | % Lines | % Statements | % Functions | % Branches |
| --- | --- | --- | --- | --- |
{% for file, line in coverage -%}
| `{{ file | removeDir }}` | {{ line.lines.pct }}% | {{ line.statements.pct }}% | {{ line.functions.pct }}% | {{ line.branches.pct }}% |
{% endfor -%}

View File

@ -1,3 +0,0 @@
# Collections (and Tags)
Moved to [https://www.11ty.io/docs/collections/](https://www.11ty.io/docs/collections/).

View File

@ -1,3 +0,0 @@
# Pass-through File Copy
Moved to [https://www.11ty.io/docs/copy/](https://www.11ty.io/docs/copy/).

View File

@ -1,60 +0,0 @@
# Code Coverage for Eleventy v0.9.0
| Filename | % Lines | % Statements | % Functions | % Branches |
| ---------------------------------------------------------- | ------- | ------------ | ----------- | ---------- |
| `total` | 88.67% | 88.73% | 87.5% | 81.26% |
| `config.js` | 100% | 100% | 100% | 100% |
| `src/Benchmark.js` | 91.67% | 91.67% | 83.33% | 66.67% |
| `src/BenchmarkGroup.js` | 67.65% | 67.65% | 71.43% | 30% |
| `src/BenchmarkManager.js` | 76.47% | 76.47% | 71.43% | 75% |
| `src/Config.js` | 100% | 100% | 100% | 100% |
| `src/Eleventy.js` | 54.8% | 54.8% | 57.58% | 46.15% |
| `src/EleventyBaseError.js` | 100% | 100% | 100% | 100% |
| `src/EleventyCommandCheck.js` | 100% | 100% | 100% | 87.5% |
| `src/EleventyConfig.js` | 100% | 100% | 100% | 100% |
| `src/EleventyErrorHandler.js` | 91.67% | 91.67% | 100% | 67.57% |
| `src/EleventyErrorUtil.js` | 100% | 100% | 100% | 100% |
| `src/EleventyExtensionMap.js` | 96.67% | 96.67% | 92% | 100% |
| `src/EleventyFiles.js` | 94.44% | 94.44% | 89.19% | 91.3% |
| `src/EleventyServe.js` | 36.07% | 36.07% | 56.25% | 24.39% |
| `src/EleventyWatchTargets.js` | 93.48% | 93.48% | 90% | 93.33% |
| `src/Template.js` | 94.68% | 94.72% | 97.87% | 86.14% |
| `src/TemplateCache.js` | 100% | 100% | 100% | 100% |
| `src/TemplateCollection.js` | 93.1% | 93.55% | 92.31% | 80% |
| `src/TemplateConfig.js` | 91.23% | 91.23% | 66.67% | 91.67% |
| `src/TemplateContent.js` | 93.83% | 93.83% | 94.12% | 91.18% |
| `src/TemplateData.js` | 94.41% | 94.48% | 100% | 82% |
| `src/TemplateFileSlug.js` | 100% | 100% | 100% | 100% |
| `src/TemplateGlob.js` | 93.33% | 93.33% | 100% | 87.5% |
| `src/TemplateLayout.js` | 100% | 100% | 100% | 100% |
| `src/TemplateLayoutPathResolver.js` | 95.74% | 95.74% | 100% | 88.89% |
| `src/TemplateMap.js` | 97.9% | 97.9% | 96.88% | 90.4% |
| `src/TemplatePassthrough.js` | 94.74% | 94.74% | 88.89% | 85.71% |
| `src/TemplatePassthroughManager.js` | 91.38% | 91.38% | 100% | 71.43% |
| `src/TemplatePath.js` | 100% | 100% | 95.65% | 100% |
| `src/TemplatePermalink.js` | 100% | 100% | 100% | 100% |
| `src/TemplatePermalinkNoWrite.js` | 100% | 100% | 100% | 100% |
| `src/TemplateRender.js` | 98.7% | 98.7% | 100% | 95.24% |
| `src/TemplateWriter.js` | 81.25% | 81.25% | 71.43% | 30% |
| `src/UserConfig.js` | 64.46% | 64.67% | 51.11% | 54.55% |
| `src/Engines/Ejs.js` | 95% | 95% | 85.71% | 88.89% |
| `src/Engines/Haml.js` | 100% | 100% | 100% | 100% |
| `src/Engines/Handlebars.js` | 100% | 100% | 100% | 83.33% |
| `src/Engines/Html.js` | 100% | 100% | 100% | 100% |
| `src/Engines/JavaScript.js` | 96% | 96.08% | 100% | 88.1% |
| `src/Engines/JavaScriptTemplateLiteral.js` | 94.44% | 94.44% | 100% | 100% |
| `src/Engines/Liquid.js` | 95.89% | 95.89% | 96.15% | 86.67% |
| `src/Engines/Markdown.js` | 90.91% | 90.91% | 88.89% | 81.25% |
| `src/Engines/Mustache.js` | 100% | 100% | 100% | 100% |
| `src/Engines/Nunjucks.js` | 88.52% | 88.52% | 94.74% | 84.62% |
| `src/Engines/Pug.js` | 100% | 100% | 100% | 88.89% |
| `src/Engines/TemplateEngine.js` | 100% | 100% | 100% | 100% |
| `src/Errors/TemplateContentPrematureUseError.js` | 100% | 100% | 100% | 100% |
| `src/Errors/UsingCircularTemplateContentReferenceError.js` | 100% | 100% | 100% | 100% |
| `src/Filters/Slug.js` | 100% | 100% | 100% | 100% |
| `src/Filters/Url.js` | 100% | 100% | 100% | 100% |
| `src/Plugins/Pagination.js` | 92.52% | 92.66% | 93.75% | 81.82% |
| `src/Util/Capitalize.js` | 100% | 100% | 100% | 100% |
| `src/Util/Merge.js` | 92.86% | 92.86% | 100% | 86.36% |
| `src/Util/Pluralize.js` | 100% | 100% | 100% | 100% |
| `src/Util/Sortable.js` | 84.78% | 85.11% | 73.91% | 94.44% |

View File

@ -1,3 +0,0 @@
# Using Data
Moved to [https://www.11ty.io/docs/data/](https://www.11ty.io/docs/data/).

View File

@ -1,3 +0,0 @@
# Changing a Templates Rendering Engine
Moved to [https://www.11ty.io/docs/languages/](https://www.11ty.io/docs/languages/).

View File

@ -1,3 +0,0 @@
# EJS
Moved to [https://www.11ty.io/docs/languages/ejs/](https://www.11ty.io/docs/languages/ejs/).

View File

@ -1,3 +0,0 @@
# HAML
Moved to [https://www.11ty.io/docs/languages/haml/](https://www.11ty.io/docs/languages/haml/).

View File

@ -1,3 +0,0 @@
# Handlebars
Moved to [https://www.11ty.io/docs/languages/handlebars/](https://www.11ty.io/docs/languages/handlebars/).

View File

@ -1,3 +0,0 @@
# HTML
Moved to [https://www.11ty.io/docs/languages/html/](https://www.11ty.io/docs/languages/html/).

View File

@ -1,3 +0,0 @@
# JavaScript Template Literals
Moved to [https://www.11ty.io/docs/languages/jstl/](https://www.11ty.io/docs/languages/jstl/).

View File

@ -1,3 +0,0 @@
# Liquid
Moved to [https://www.11ty.io/docs/languages/liquid/](https://www.11ty.io/docs/languages/liquid/).

View File

@ -1,3 +0,0 @@
# Markdown
Moved to [https://www.11ty.io/docs/languages/markdown/](https://www.11ty.io/docs/languages/markdown/).

View File

@ -1,3 +0,0 @@
# Mustache
Moved to [https://www.11ty.io/docs/languages/mustache/](https://www.11ty.io/docs/languages/mustache/).

View File

@ -1,3 +0,0 @@
# Nunjucks
Moved to [https://www.11ty.io/docs/languages/nunjucks/](https://www.11ty.io/docs/languages/nunjucks/).

View File

@ -1,3 +0,0 @@
# Pug (formerly Jade)
Moved to [https://www.11ty.io/docs/languages/pug/](https://www.11ty.io/docs/languages/pug/).

View File

@ -1,3 +0,0 @@
# Filters, Tags, etc.
Moved to [https://www.11ty.io/docs/filters/](https://www.11ty.io/docs/filters/).

View File

@ -1,3 +0,0 @@
# Install locally
Moved to [https://www.11ty.io/docs/local-installation/](https://www.11ty.io/docs/local-installation/).

View File

@ -1,3 +0,0 @@
# Layouts
Moved to [https://www.11ty.io/docs/layouts/](https://www.11ty.io/docs/layouts/).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -1,39 +0,0 @@
# Beta Release Procedure
1. update minor dependencies in package.json?
1. npmclean
1. npm audit
1. Update version in `package.json`, include `-beta.1` suffix
1. Run `npm run coverage`
1. Check it all in and commit
1. Tag new version
1. `npm publish --access=public --tag=beta`
# Release Procedure
1. update minor dependencies in package.json? `npm outdated` `npm update --save`
1. npmclean first
1. npm audit
1. Update version in `package.json`
1. Run `npm run coverage`
1. Check it all in and commit
1. Tag new version
1. `npm publish --access=public`
## If branch docs do not exist
1. Check in a new `11ty.io` site with updated `package.json` version.
2. Add version to 11ty.io `versions.json`
3. Create a new branch for branched version
4. Go to https://app.netlify.com/sites/11ty/settings/domain and set up a subdomain for it.
### Always:
1. Check out the previous version git branch and add `outdated: true` to `_data/config.json` and commit/push.
2. Update `eleventy-base-blog`?
## If Branch docs already exist, 11ty.io (unlikely, I dont do this any more)
1. Check to make sure `"prerelease": false` in `_data/config.json`
2. Check to make sure `"prerelease": true` does not exist in current version in `_data/versions.json`
3. Merge branch to master.

View File

@ -1,3 +0,0 @@
# Pagination
Moved to [https://www.11ty.io/docs/pagination/](https://www.11ty.io/docs/pagination/).

View File

@ -1,3 +0,0 @@
# Permalinks
Moved to [https://www.11ty.io/docs/permalinks/](https://www.11ty.io/docs/permalinks/).

View File

@ -1,3 +0,0 @@
# Common Eleventy Pitfalls
Moved to [https://www.11ty.io/docs/pitfalls/](https://www.11ty.io/docs/pitfalls/).

View File

@ -1,3 +0,0 @@
# Plugins
Moved to [https://www.11ty.io/docs/plugins/](https://www.11ty.io/docs/plugins/).

View File

@ -1,152 +0,0 @@
{
"_args": [
[
"@11ty/eleventy@0.9.0",
"/Users/tatiana/selfdefined"
]
],
"_from": "@11ty/eleventy@0.9.0",
"_id": "@11ty/eleventy@0.9.0",
"_inBundle": false,
"_integrity": "sha512-6BW59Fzf2sXrtnS5bUey5JbbiOSZCujG7/6/quj4ooLYIFV3djBZpyJg6mQmlyefFIacvC0GDP+9QT+QQ0O74g==",
"_location": "/@11ty/eleventy",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@11ty/eleventy@0.9.0",
"name": "@11ty/eleventy",
"escapedName": "@11ty%2feleventy",
"scope": "@11ty",
"rawSpec": "0.9.0",
"saveSpec": null,
"fetchSpec": "0.9.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/@11ty/eleventy/-/eleventy-0.9.0.tgz",
"_spec": "0.9.0",
"_where": "/Users/tatiana/selfdefined",
"author": {
"name": "Zach Leatherman",
"email": "zachleatherman@gmail.com",
"url": "https://zachleat.com/"
},
"ava": {
"files": [
"./test/*.js"
],
"sources": [
"./**/.eleventyignore",
"./src/**/*.js",
"./test/stubs/**",
"!./test/stubs/**/_site/**"
]
},
"bin": {
"eleventy": "./cmd.js"
},
"bugs": {
"url": "https://github.com/11ty/eleventy/issues"
},
"dependencies": {
"browser-sync": "^2.26.7",
"chalk": "^2.4.2",
"chokidar": "^3.0.2",
"debug": "^4.1.1",
"dependency-graph": "^0.8.0",
"dependency-tree": "^7.0.2",
"ejs": "^2.6.2",
"fast-glob": "^3.0.4",
"fs-extra": "^8.1.0",
"gray-matter": "^4.0.2",
"hamljs": "^0.6.2",
"handlebars": "^4.1.2",
"javascript-stringify": "^2.0.0",
"liquidjs": "^6.4.3",
"lodash": "^4.17.15",
"luxon": "^1.17.2",
"markdown-it": "^8.4.2",
"minimist": "^1.2.0",
"moo": "^0.5.0",
"multimatch": "^4.0.0",
"mustache": "^2.3.0",
"normalize-path": "^3.0.0",
"nunjucks": "^3.2.0",
"parse-filepath": "^1.0.2",
"please-upgrade-node": "^3.2.0",
"pretty": "^2.0.0",
"pug": "^2.0.4",
"recursive-copy": "^2.0.10",
"semver": "^6.3.0",
"slugify": "^1.3.4",
"time-require": "^0.1.2",
"valid-url": "^1.0.9"
},
"description": "Transform a directory of templates into HTML.",
"devDependencies": {
"@11ty/eleventy-plugin-syntaxhighlight": "^2.0.3",
"ava": "^2.2.0",
"lint-staged": "^9.2.5",
"markdown-it-emoji": "^1.4.0",
"nyc": "^14.1.1",
"pre-commit": "^1.2.2",
"pre-push": "^0.1.1",
"prettier": "^1.18.2",
"rimraf": "^3.0.0",
"toml": "^3.0.0",
"viperhtml": "^2.17.0",
"vue": "^2.6.10",
"vue-server-renderer": "^2.6.10"
},
"engines": {
"node": ">=8"
},
"homepage": "https://github.com/11ty/eleventy#readme",
"keywords": [
"static-site-generator",
"static-site",
"ssg",
"documentation",
"website",
"jekyll",
"blog",
"templates",
"generator",
"framework",
"eleventy",
"11ty",
"html",
"markdown",
"liquid",
"nunjucks",
"pug",
"handlebars",
"mustache",
"ejs",
"haml"
],
"license": "MIT",
"lint-staged": {
"*.{js,css,md}": [
"prettier --write",
"git add"
]
},
"main": "src/Eleventy.js",
"name": "@11ty/eleventy",
"pre-commit": "lint-staged",
"pre-push": "test",
"repository": {
"type": "git",
"url": "git://github.com/11ty/eleventy.git"
},
"scripts": {
"coverage": "npx nyc ava && npx nyc report --reporter=json-summary && cp coverage/coverage-summary.json docs-src/_data/coverage.json && node cmd.js --config=docs-src/.eleventy.docs.js",
"default": "npm run test",
"lint-staged": "lint-staged",
"test": "npx ava --verbose"
},
"version": "0.9.0"
}

View File

@ -1,35 +0,0 @@
class Benchmark {
constructor() {
this.reset();
}
reset() {
this.timeSpent = 0;
this.beforeDates = [];
}
before() {
this.beforeDates.push(new Date());
}
after() {
if (!this.beforeDates.length) {
throw new Error("You called Benchmark after() without a before().");
}
let before = this.beforeDates.pop();
if (!this.beforeDates.length) {
this.timeSpent += new Date().getTime() - before.getTime();
}
}
getTotal() {
return this.timeSpent;
}
getTotalString() {
return this.timeSpent > 0 ? ` (${this.timeSpent}ms)` : "";
}
}
module.exports = Benchmark;

View File

@ -1,73 +0,0 @@
const chalk = require("chalk");
const Benchmark = require("./Benchmark");
const debugWarn = require("debug")("Eleventy:Warnings");
class BenchmarkGroup {
constructor() {
this.benchmarks = {};
this.start = new Date();
this.isVerbose = true;
this.minimumThresholdMs = 0;
}
reset() {
this.start = new Date();
for (var type in this.benchmarks) {
this.benchmarks[type].reset();
}
}
// TODO make this async
add(type, callback) {
let benchmark = (this.benchmarks[type] = new Benchmark());
return function(...args) {
benchmark.before();
let ret = callback.call(this, ...args);
benchmark.after();
return ret;
};
}
setMinimumThresholdMs(minimumThresholdMs) {
let val = parseInt(minimumThresholdMs, 10);
if (isNaN(val)) {
throw new Error("`setMinimumThresholdMs` expects a number argument.");
}
this.minimumThresholdMs = val;
}
get(type) {
this.benchmarks[type] = new Benchmark();
return this.benchmarks[type];
}
finish(label, thresholdPercent, isVerbose) {
let totalTimeSpent = new Date().getTime() - this.start.getTime();
thresholdPercent = thresholdPercent !== undefined ? thresholdPercent : 10;
for (var type in this.benchmarks) {
let bench = this.benchmarks[type];
let totalForBenchmark = bench.getTotal();
let percent = (totalForBenchmark * 100) / totalTimeSpent;
if (
percent > thresholdPercent &&
totalForBenchmark >= this.minimumThresholdMs
) {
let str = chalk.yellow(
`Benchmark (${label}): ${type} took ${bench.getTotal()}ms (${percent.toFixed(
1
)}%)`
);
if (isVerbose) {
console.log(str);
}
debugWarn(str);
}
}
}
}
module.exports = BenchmarkGroup;

View File

@ -1,47 +0,0 @@
const BenchmarkGroup = require("./BenchmarkGroup");
class BenchmarkManager {
constructor() {
this.benches = {};
this.isVerbose = true;
}
reset() {
for (var j in this.benches) {
this.benches[j].reset();
}
}
setVerboseOutput(isVerbose) {
this.isVerbose = !!isVerbose;
}
getBenchmarkGroup(name) {
if (!this.benches[name]) {
this.benches[name] = new BenchmarkGroup();
}
return this.benches[name];
}
getAll() {
return this.benches;
}
get(name) {
if (name) {
return this.getBenchmarkGroup(name);
}
return this.getAll();
}
finish(thresholdPercent) {
for (var j in this.benches) {
this.benches[j].finish(j, thresholdPercent, this.isVerbose);
}
}
}
let manager = new BenchmarkManager();
module.exports = manager;

View File

@ -1,7 +0,0 @@
const TemplateConfig = require("./TemplateConfig");
const debug = require("debug")("Eleventy:Config");
debug("Setting up global TemplateConfig.");
let config = new TemplateConfig();
module.exports = config;

View File

@ -1,451 +0,0 @@
const pkg = require("../package.json");
const TemplatePath = require("./TemplatePath");
const TemplateData = require("./TemplateData");
const TemplateWriter = require("./TemplateWriter");
const EleventyErrorHandler = require("./EleventyErrorHandler");
const EleventyServe = require("./EleventyServe");
const EleventyWatchTargets = require("./EleventyWatchTargets");
const EleventyFiles = require("./EleventyFiles");
const templateCache = require("./TemplateCache");
const simplePlural = require("./Util/Pluralize");
const config = require("./Config");
const bench = require("./BenchmarkManager");
const debug = require("debug")("Eleventy");
class Eleventy {
constructor(input, output) {
this.config = config.getConfig();
this.configPath = null;
this.isVerbose = true;
this.isDebug = false;
this.isDryRun = false;
this.start = new Date();
this.formatsOverride = null;
this.eleventyServe = new EleventyServe();
this.rawInput = input;
this.rawOutput = output;
this.watchTargets = new EleventyWatchTargets();
this.watchTargets.watchJavaScriptDependencies = this.config.watchJavaScriptDependencies;
}
get input() {
return this.rawInput || this.config.dir.input;
}
get inputDir() {
return TemplatePath.getDir(this.input);
}
get outputDir() {
let dir = this.rawOutput || this.config.dir.output;
if (dir !== this._savedOutputDir) {
this.eleventyServe.setOutputDir(dir);
}
this._savedOutputDir = dir;
return dir;
}
setDryRun(isDryRun) {
this.isDryRun = !!isDryRun;
}
setPassthroughAll(isPassthroughAll) {
this.isPassthroughAll = !!isPassthroughAll;
}
setPathPrefix(pathPrefix) {
if (pathPrefix || pathPrefix === "") {
config.setPathPrefix(pathPrefix);
this.config = config.getConfig();
}
}
setWatchTargets(watchTargets) {
this.watchTargets = watchTargets;
}
setConfigPathOverride(configPath) {
if (configPath) {
this.configPath = configPath;
config.setProjectConfigPath(configPath);
this.config = config.getConfig();
}
}
async restart() {
debug("Restarting");
this.start = new Date();
templateCache.clear();
bench.reset();
this.eleventyFiles.restart();
// reload package.json values (if applicable)
// TODO only reset this if it changed
delete require.cache[TemplatePath.absolutePath("package.json")];
await this.init();
}
finish() {
bench.finish();
(this.logger || console).log(this.logFinished());
debug("Finished writing templates.");
}
logFinished() {
if (!this.writer) {
throw new Error(
"Did you call Eleventy.init to create the TemplateWriter instance? Hint: you probably didnt."
);
}
let ret = [];
let writeCount = this.writer.getWriteCount();
let copyCount = this.writer.getCopyCount();
if (this.isDryRun) {
ret.push("Pretended to");
}
if (copyCount) {
ret.push(
`${this.isDryRun ? "Copy" : "Copied"} ${copyCount} ${simplePlural(
copyCount,
"item",
"items"
)} and`
);
}
ret.push(
`${this.isDryRun ? "Process" : "Processed"} ${writeCount} ${simplePlural(
writeCount,
"file",
"files"
)}`
);
let time = ((new Date() - this.start) / 1000).toFixed(2);
ret.push(`in ${time} ${simplePlural(time, "second", "seconds")}`);
if (writeCount >= 10) {
ret.push(
`(${((time * 1000) / writeCount).toFixed(1)}ms each, v${pkg.version})`
);
} else {
ret.push(`(v${pkg.version})`);
}
return ret.join(" ");
}
async init() {
let formats = this.formatsOverride || this.config.templateFormats;
this.eleventyFiles = new EleventyFiles(
this.input,
this.outputDir,
formats,
this.isPassthroughAll
);
this.eleventyFiles.init();
this.templateData = new TemplateData(this.inputDir);
this.eleventyFiles.setTemplateData(this.templateData);
this.writer = new TemplateWriter(
this.input,
this.outputDir,
formats,
this.templateData,
this.isPassthroughAll
);
this.writer.setEleventyFiles(this.eleventyFiles);
// TODO maybe isVerbose -> console.log?
debug(`Directories:
Input: ${this.inputDir}
Data: ${this.templateData.getDataDir()}
Includes: ${this.eleventyFiles.getIncludesDir()}
Layouts: ${this.eleventyFiles.getLayoutsDir()}
Output: ${this.outputDir}
Template Formats: ${formats.join(",")}`);
this.writer.setVerboseOutput(this.isVerbose);
this.writer.setDryRun(this.isDryRun);
return this.templateData.cacheData();
}
setIsDebug(isDebug) {
this.isDebug = !!isDebug;
}
setIsVerbose(isVerbose) {
this.isVerbose = !!isVerbose;
if (this.writer) {
this.writer.setVerboseOutput(this.isVerbose);
}
if (bench) {
bench.setVerboseOutput(this.isVerbose);
}
}
setFormats(formats) {
if (formats && formats !== "*") {
this.formatsOverride = formats.split(",");
}
}
getVersion() {
return require("../package.json").version;
}
getHelp() {
return `usage: eleventy
eleventy --input=. --output=./_site
eleventy --serve
Arguments:
--version
--input=.
Input template files (default: \`.\`)
--output=_site
Write HTML output to this folder (default: \`_site\`)
--serve
Run web server on --port (default 8080) and watch them too
--watch
Wait for files to change and automatically rewrite (no web server)
--formats=liquid,md
Whitelist only certain template types (default: \`*\`)
--quiet
Dont print all written files (off by default)
--config=filename.js
Override the eleventy config file path (default: \`.eleventy.js\`)
--pathprefix='/'
Change all url template filters to use this subdirectory.
--dryrun
Dont write any files. Useful with \`DEBUG=Eleventy* npx eleventy\`
--help`;
}
resetConfig() {
config.reset();
this.config = config.getConfig();
this.eleventyServe.config = this.config;
}
async _watch(path) {
if (path) {
path = TemplatePath.addLeadingDotSlash(path);
}
if (this.active) {
this.queuedToRun = path;
return;
}
this.active = true;
let localProjectConfigPath = config.getLocalProjectConfigFile();
// reset and reload global configuration :O
if (path === localProjectConfigPath) {
this.resetConfig();
}
config.resetOnWatch();
await this.restart();
this.watchTargets.clearDependencyRequireCache();
await this.write();
this.watchTargets.reset();
await this._initWatchDependencies();
// Add new deps to chokidar
this.watcher.add(this.watchTargets.getNewTargetsSinceLastReset());
let isInclude =
path &&
TemplatePath.startsWithSubPath(path, this.eleventyFiles.getIncludesDir());
this.eleventyServe.reload(path, isInclude);
this.active = false;
if (this.queuedToRun) {
console.log("You saved while Eleventy was running, lets run again.");
this.queuedToRun = false;
await this._watch(this.queuedToRun);
} else {
console.log("Watching…");
}
}
get watcherBench() {
return bench.get("Watcher");
}
async initWatch() {
this.watchTargets.add(this.eleventyFiles.getGlobWatcherFiles());
// Watch the local project config file
this.watchTargets.add(config.getLocalProjectConfigFile());
// Template and Directory Data Files
this.watchTargets.add(
await this.eleventyFiles.getGlobWatcherTemplateDataFiles()
);
let benchmark = this.watcherBench.get(
"Watching JavaScript Dependencies (disable with `eleventyConfig.setWatchJavaScriptDependencies(false)`)"
);
benchmark.before();
await this._initWatchDependencies();
benchmark.after();
}
async _initWatchDependencies() {
if (!this.watchTargets.watchJavaScriptDependencies) {
return;
}
let dataDir = this.templateData.getDataDir();
function filterOutGlobalDataFiles(path) {
return !dataDir || path.indexOf(dataDir) === -1;
}
// Template files .11ty.js
this.watchTargets.addDependencies(this.eleventyFiles.getWatchPathCache());
// Config file dependencies
this.watchTargets.addDependencies(
config.getLocalProjectConfigFile(),
filterOutGlobalDataFiles.bind(this)
);
// Deps from Global Data (that arent in the global data directory, everything is watched there)
this.watchTargets.addDependencies(
this.templateData.getWatchPathCache(),
filterOutGlobalDataFiles.bind(this)
);
this.watchTargets.addDependencies(
await this.eleventyFiles.getWatcherTemplateJavaScriptDataFiles()
);
}
async getWatchedFiles() {
return this.watchTargets.getTargets();
}
async watch() {
this.watcherBench.setMinimumThresholdMs(500);
this.watcherBench.reset();
const chokidar = require("chokidar");
this.active = false;
this.queuedToRun = false;
// Note that watching indirectly depends on this for fetching dependencies from JS files
// See: TemplateWriter:pathCache and EleventyWatchTargets
await this.write();
await this.initWatch();
// TODO improve unwatching if JS dependencies are removed (or files are deleted)
let rawFiles = await this.getWatchedFiles();
debug("Watching for changes to: %o", rawFiles);
let ignores = this.eleventyFiles.getGlobWatcherIgnores();
debug("Watching but ignoring changes to: %o", ignores);
let watcher = chokidar.watch(rawFiles, {
ignored: ignores,
ignoreInitial: true
});
this.watcherBench.finish("Initialize --watch", 10, this.isVerbose);
console.log("Watching…");
this.watcher = watcher;
async function watchRun(path) {
try {
await this._watch(path);
} catch (e) {
EleventyErrorHandler.fatal(e, "Eleventy fatal watch error");
watcher.close();
}
}
watcher.on("change", async path => {
console.log("File changed:", path);
await watchRun.call(this, path);
});
watcher.on("add", async path => {
console.log("File added:", path);
await watchRun.call(this, path);
});
process.on(
"SIGINT",
function() {
debug("Cleaning up chokidar and browsersync (if exists) instances.");
this.eleventyServe.close();
this.watcher.close();
process.exit();
}.bind(this)
);
}
serve(port) {
this.eleventyServe.serve(port);
}
/* For testing */
setLogger(logger) {
this.logger = logger;
}
async write() {
let ret;
if (this.logger) {
EleventyErrorHandler.logger = this.logger;
}
try {
let promise = this.writer.write();
ret = await promise;
} catch (e) {
EleventyErrorHandler.initialMessage(
"Problem writing Eleventy templates",
"error",
"red"
);
EleventyErrorHandler.fatal(e);
}
this.finish();
debug(`
Getting frustrated? Have a suggestion/feature request/feedback?
I want to hear it! Open an issue: https://github.com/11ty/eleventy/issues/new`);
// unset the logger
EleventyErrorHandler.logger = undefined;
return ret;
}
}
module.exports = Eleventy;

View File

@ -1,10 +0,0 @@
class EleventyBaseError extends Error {
constructor(message, originalError) {
super(message);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.originalError = originalError;
}
}
module.exports = EleventyBaseError;

View File

@ -1,82 +0,0 @@
const EleventyBaseError = require("./EleventyBaseError");
const debug = require("debug")("Eleventy:CommandCheck");
class EleventyCommandCheckError extends EleventyBaseError {}
class EleventyCommandCheck {
constructor(argv) {
this.valueArgs = [
"input",
"output",
"formats",
"config",
"pathprefix",
"port"
];
this.booleanArgs = [
"quiet",
"version",
"watch",
"dryrun",
"help",
"serve",
"passthroughall"
];
this.args = argv;
this.argsMap = this.getArgumentLookupMap();
debug("command: eleventy ", this.toString());
}
toString() {
let cmd = [];
for (let valueArgName of this.valueArgs) {
if (this.args[valueArgName]) {
cmd.push(`--${valueArgName}=${this.args[valueArgName]}`);
}
}
for (let booleanArgName of this.booleanArgs) {
if (this.args[booleanArgName]) {
cmd.push(`--${booleanArgName}`);
}
}
return cmd.join(" ");
}
getArgumentLookupMap() {
let obj = {};
for (let valueArgName of this.valueArgs) {
obj[valueArgName] = true;
}
for (let booleanArgName of this.booleanArgs) {
obj[booleanArgName] = true;
}
return obj;
}
isKnownArgument(name) {
// _ is the default keyless parameter
if (name === "_") {
return true;
}
return !!this.argsMap[name];
}
hasUnknownArguments() {
for (let argName in this.args) {
if (!this.isKnownArgument(argName)) {
throw new EleventyCommandCheckError(
`We dont know what '${argName}' is. Use --help to see the list of supported commands.`
);
}
}
}
}
module.exports = EleventyCommandCheck;

View File

@ -1,3 +0,0 @@
const UserConfig = require("./UserConfig");
module.exports = new UserConfig();

View File

@ -1,93 +0,0 @@
const chalk = require("chalk");
const debug = require("debug")("Eleventy:EleventyErrorHandler");
class EleventyErrorHandler {
static get isChalkEnabled() {
if (this._isChalkEnabled !== undefined) {
return this._isChalkEnabled;
}
return true;
}
static set isChalkEnabled(enabled) {
this._isChalkEnabled = !!enabled;
}
static warn(e, msg) {
if (msg) {
EleventyErrorHandler.initialMessage(msg, "warn", "yellow");
}
EleventyErrorHandler.log(e, "warn");
}
static fatal(e, msg) {
EleventyErrorHandler.error(e, msg);
process.exitCode = 1;
}
static error(e, msg) {
if (msg) {
EleventyErrorHandler.initialMessage(msg, "error", "red");
}
EleventyErrorHandler.log(e, "error");
}
static log(e, type = "log", prefix = ">") {
let ref = e;
while (ref) {
let nextRef = ref.originalError;
EleventyErrorHandler.message(
(process.env.DEBUG ? "" : `${prefix} `) +
`${ref.message.trim()}
\`${ref.name}\` was thrown${!nextRef && ref.stack ? ":" : ""}`,
type
);
if (process.env.DEBUG) {
debug(`(${type} stack): ${ref.stack}`);
} else if (!nextRef) {
// last error in the loop
let prefix = " ";
// remove duplicate error messages if the stack contains the original message output above
//
let stackStr = ref.stack || "";
if (e.removeDuplicateErrorStringFromOutput) {
stackStr = stackStr.replace(
`${ref.name}: ${ref.message}`,
"(Repeated output has been truncated…)"
);
}
EleventyErrorHandler.message(
prefix + stackStr.split("\n").join("\n" + prefix)
);
}
ref = nextRef;
}
}
static initialMessage(message, type = "log", chalkColor = "blue") {
if (message) {
EleventyErrorHandler.message(
message + ":" + (process.env.DEBUG ? "" : " (more in DEBUG output)"),
type,
chalkColor
);
}
}
static message(message, type = "log", chalkColor) {
if (process.env.DEBUG) {
debug(message);
} else {
let logger = EleventyErrorHandler.logger || console;
if (chalkColor && EleventyErrorHandler.isChalkEnabled) {
logger[type](chalk[chalkColor](message));
} else {
logger[type](message);
}
}
}
}
module.exports = EleventyErrorHandler;

View File

@ -1,17 +0,0 @@
const TemplateContentPrematureUseError = require("./Errors/TemplateContentPrematureUseError");
class EleventyErrorUtil {
static isPrematureTemplateContentError(e) {
// TODO the rest of the template engines
return (
e instanceof TemplateContentPrematureUseError ||
(e.originalError &&
e.originalError.name === "RenderError" &&
e.originalError.originalError instanceof
TemplateContentPrematureUseError) || // Liquid
e.message.indexOf("TemplateContentPrematureUseError") > -1
); // Nunjucks
}
}
module.exports = EleventyErrorUtil;

View File

@ -1,164 +0,0 @@
const TemplatePath = require("./TemplatePath");
const config = require("./Config");
class EleventyExtensionMap {
constructor(formatKeys = []) {
this.unfilteredFormatKeys = formatKeys.map(function(key) {
return key.trim().toLowerCase();
});
this.formatKeys = this.unfilteredFormatKeys.filter(key =>
this.hasExtension(key)
);
this.prunedFormatKeys = this.unfilteredFormatKeys.filter(
key => !this.hasExtension(key)
);
}
get config() {
return this.configOverride || config.getConfig();
}
set config(cfg) {
this.configOverride = cfg;
}
/* Used for layout path resolution */
getFileList(path, dir) {
if (!path) {
return [];
}
let files = [];
this.formatKeys.forEach(
function(key) {
this.getExtensionsFromKey(key).forEach(function(extension) {
files.push((dir ? dir + "/" : "") + path + "." + extension);
});
}.bind(this)
);
return files;
}
getPrunedGlobs(inputDir) {
return this._getGlobs(this.prunedFormatKeys, inputDir);
}
getGlobs(inputDir) {
if (this.config.passthroughFileCopy) {
return this._getGlobs(this.unfilteredFormatKeys, inputDir);
}
return this._getGlobs(this.formatKeys, inputDir);
}
_getGlobs(formatKeys, inputDir) {
let dir = TemplatePath.convertToRecursiveGlob(inputDir);
let globs = [];
formatKeys.forEach(
function(key) {
if (this.hasExtension(key)) {
this.getExtensionsFromKey(key).forEach(function(extension) {
globs.push(dir + "/*." + extension);
});
} else {
globs.push(dir + "/*." + key);
}
}.bind(this)
);
return globs;
}
hasExtension(key) {
for (var extension in EleventyExtensionMap.keyMap) {
if (EleventyExtensionMap.keyMap[extension] === key) {
return true;
}
}
return false;
}
getExtensionsFromKey(key) {
let extensions = [];
for (var extension in this.keyMap) {
if (this.keyMap[extension] === key) {
extensions.push(extension);
}
}
return extensions;
}
getKey(pathOrKey) {
return EleventyExtensionMap._getKey(pathOrKey, this.keyMap);
}
static getKey(pathOrKey) {
return EleventyExtensionMap._getKey(pathOrKey, EleventyExtensionMap.keyMap);
}
static _getKey(pathOrKey, map) {
pathOrKey = pathOrKey.toLowerCase();
for (var extension in map) {
let key = map[extension];
if (pathOrKey === extension) {
return key;
} else if (pathOrKey.endsWith("." + extension)) {
return key;
}
}
}
removeTemplateExtension(path) {
return EleventyExtensionMap._removeTemplateExtension(path, this.keyMap);
}
static removeTemplateExtension(path) {
return EleventyExtensionMap._removeTemplateExtension(
path,
EleventyExtensionMap.keyMap
);
}
static _removeTemplateExtension(path, map) {
for (var extension in map) {
if (path === extension || path.endsWith("." + extension)) {
return path.substr(0, path.length - 1 - extension.length);
}
}
return path;
}
get keyMap() {
return EleventyExtensionMap._getKeyMap(
this.config.templateExtensionAliases || {}
);
}
static get keyMap() {
return EleventyExtensionMap._getKeyMap(
config.getConfig().templateExtensionAliases || {}
);
}
// file extension => key
static _getKeyMap(aliases) {
let fileExtensionToKeyMap = {
ejs: "ejs",
md: "md",
jstl: "jstl",
html: "html",
hbs: "hbs",
mustache: "mustache",
haml: "haml",
pug: "pug",
njk: "njk",
liquid: "liquid",
"11ty.js": "11ty.js"
};
for (let extension in aliases) {
fileExtensionToKeyMap[extension] = aliases[extension];
}
return fileExtensionToKeyMap;
}
}
module.exports = EleventyExtensionMap;

View File

@ -1,349 +0,0 @@
const fs = require("fs-extra");
const fastglob = require("fast-glob");
const EleventyExtensionMap = require("./EleventyExtensionMap");
const TemplateData = require("./TemplateData");
const TemplateGlob = require("./TemplateGlob");
const TemplatePath = require("./TemplatePath");
const TemplatePassthroughManager = require("./TemplatePassthroughManager");
const config = require("./Config");
const debug = require("debug")("Eleventy:EleventyFiles");
// const debugDev = require("debug")("Dev:Eleventy:EleventyFiles");
class EleventyFiles {
constructor(input, outputDir, formats, passthroughAll) {
this.config = config.getConfig();
this.input = input;
this.inputDir = TemplatePath.getDir(this.input);
this.outputDir = outputDir;
this.initConfig();
this.passthroughAll = !!passthroughAll;
this.formats = formats;
this.extensionMap = new EleventyExtensionMap(formats);
}
initConfig() {
this.includesDir = TemplatePath.join(
this.inputDir,
this.config.dir.includes
);
if ("layouts" in this.config.dir) {
this.layoutsDir = TemplatePath.join(
this.inputDir,
this.config.dir.layouts
);
}
}
init() {
this.initFormatsGlobs();
this.setPassthroughManager();
this.setupGlobs();
}
restart() {
this.passthroughManager.reset();
this.setupGlobs();
}
/* For testing */
_setConfig(config) {
this.config = config;
this.initConfig();
}
/* For testing */
_setExtensionMap(map) {
this.extensionMap = map;
}
/* Set command root for local project paths */
_setLocalPathRoot(dir) {
this.localPathRoot = dir;
}
setPassthroughAll(passthroughAll) {
this.passthroughAll = !!passthroughAll;
}
initFormatsGlobs() {
// Input was a directory
if (this.input === this.inputDir) {
this.templateGlobs = TemplateGlob.map(
this.extensionMap.getGlobs(this.inputDir)
);
} else {
this.templateGlobs = TemplateGlob.map([this.input]);
}
}
getPassthroughManager() {
return this.passthroughManager;
}
setPassthroughManager(mgr) {
if (!mgr) {
mgr = new TemplatePassthroughManager();
mgr.setInputDir(this.inputDir);
mgr.setOutputDir(this.outputDir);
}
this.passthroughManager = mgr;
}
setTemplateData(templateData) {
this.templateData = templateData;
}
// TODO make this a getter
getTemplateData() {
if (!this.templateData) {
this.templateData = new TemplateData(this.inputDir);
}
return this.templateData;
}
getDataDir() {
let data = this.getTemplateData();
return data.getDataDir();
}
setupGlobs() {
this.ignores = this.getIgnores();
if (this.passthroughAll) {
this.watchedGlobs = TemplateGlob.map([
TemplateGlob.normalizePath(this.input, "/**")
]).concat(this.ignores);
} else {
this.watchedGlobs = this.templateGlobs.concat(this.ignores);
}
this.templateGlobsWithIgnores = this.watchedGlobs.concat(
this.getTemplateIgnores()
);
}
static getFileIgnores(ignoreFiles, defaultIfFileDoesNotExist) {
if (!Array.isArray(ignoreFiles)) {
ignoreFiles = [ignoreFiles];
}
let ignores = [];
let fileFound = false;
let dirs = [];
for (let ignorePath of ignoreFiles) {
ignorePath = TemplatePath.normalize(ignorePath);
let dir = TemplatePath.getDirFromFilePath(ignorePath);
dirs.push(dir);
if (fs.existsSync(ignorePath) && fs.statSync(ignorePath).size > 0) {
fileFound = true;
let ignoreContent = fs.readFileSync(ignorePath, "utf-8");
// make sure that empty .gitignore with spaces takes default ignore.
if (ignoreContent.trim().length === 0) {
fileFound = false;
} else {
ignores = ignores.concat(
EleventyFiles.normalizeIgnoreContent(dir, ignoreContent)
);
}
}
}
if (!fileFound && defaultIfFileDoesNotExist) {
ignores.push("!" + TemplateGlob.normalizePath(defaultIfFileDoesNotExist));
for (let dir of dirs) {
ignores.push(
"!" + TemplateGlob.normalizePath(dir, defaultIfFileDoesNotExist)
);
}
}
ignores.forEach(function(path) {
debug(`${ignoreFiles} ignoring: ${path}`);
});
return ignores;
}
static normalizeIgnoreContent(dir, ignoreContent) {
let ignores = [];
if (ignoreContent) {
ignores = ignoreContent
.split("\n")
.map(line => {
return line.trim();
})
.filter(line => {
// empty lines or comments get filtered out
return line.length > 0 && line.charAt(0) !== "#";
})
.map(line => {
let path = TemplateGlob.normalizePath(dir, "/", line);
path = TemplatePath.addLeadingDotSlash(
TemplatePath.relativePath(path)
);
try {
// Note these folders must exist to get /** suffix
let stat = fs.statSync(path);
if (stat.isDirectory()) {
return "!" + path + "/**";
}
return "!" + path;
} catch (e) {
return "!" + path;
}
});
}
return ignores;
}
getIgnores() {
let files = [];
if (this.config.useGitIgnore) {
files = files.concat(
EleventyFiles.getFileIgnores(
[
TemplatePath.join(
this.localPathRoot || TemplatePath.getWorkingDir(),
".gitignore"
),
TemplatePath.join(this.inputDir, ".gitignore")
],
"node_modules/**"
)
);
}
if (this.config.eleventyignoreOverride !== false) {
let eleventyIgnores = [
TemplatePath.join(
this.localPathRoot || TemplatePath.getWorkingDir(),
".eleventyignore"
),
TemplatePath.join(this.inputDir, ".eleventyignore")
];
files = files.concat(
this.config.eleventyignoreOverride ||
EleventyFiles.getFileIgnores(eleventyIgnores)
);
}
files = files.concat(TemplateGlob.map("!" + this.outputDir + "/**"));
return files;
}
getIncludesDir() {
return this.includesDir;
}
getLayoutsDir() {
return this.layoutsDir;
}
getFileGlobs() {
return this.templateGlobsWithIgnores;
}
getRawFiles() {
return this.templateGlobs;
}
getWatchPathCache() {
return this.pathCache;
}
async getFiles() {
let globs = this.getFileGlobs();
debug("Searching for: %o", globs);
let paths = TemplatePath.addLeadingDotSlashArray(
await fastglob(globs, {
caseSensitiveMatch: false,
dot: true
})
);
this.pathCache = paths;
return paths;
}
getGlobWatcherFiles() {
// TODO is it better to tie the includes and data to specific file extensions or keep the **?
return this.templateGlobs
.concat(this.getIncludesAndDataDirs())
.concat(this.getPassthroughManager().getConfigPathGlobs());
}
async getGlobWatcherTemplateDataFiles() {
let templateData = this.getTemplateData();
return await templateData.getTemplateDataFileGlob();
}
// TODO this isnt great but reduces complexity avoiding using TemplateData:getLocalDataPaths for each template in the cache
async getWatcherTemplateJavaScriptDataFiles() {
let globs = await this.getTemplateData().getTemplateJavaScriptDataFileGlob();
return TemplatePath.addLeadingDotSlashArray(
await fastglob(globs, {
ignore: ["**/node_modules/**"],
caseSensitiveMatch: false,
dot: true
})
);
}
getGlobWatcherIgnores() {
// convert to format without ! since they are passed in as a separate argument to glob watcher
return this.ignores.map(ignore =>
TemplatePath.stripLeadingDotSlash(ignore.substr(1))
);
}
getPassthroughPaths() {
let paths = [];
paths = paths.concat(this.passthroughManager.getConfigPaths());
// These are already added in the root templateGlobs
// paths = paths.concat(this.extensionMap.getPrunedGlobs(this.inputDir));
return paths;
}
getIncludesAndDataDirs() {
let files = [];
// we want this to fail on "" because we dont want to ignore the
// entire input directory when using ""
if (this.config.dir.includes) {
files = files.concat(TemplateGlob.map(this.includesDir + "/**"));
}
// we want this to fail on "" because we dont want to ignore the
// entire input directory when using ""
if (this.config.dir.layouts) {
files = files.concat(TemplateGlob.map(this.layoutsDir + "/**"));
}
if (this.config.dir.data && this.config.dir.data !== ".") {
let dataDir = this.getDataDir();
files = files.concat(TemplateGlob.map(dataDir + "/**"));
}
return files;
}
getTemplateIgnores() {
return this.getIncludesAndDataDirs().map(function(dir) {
return "!" + dir;
});
}
}
module.exports = EleventyFiles;

View File

@ -1,176 +0,0 @@
const fs = require("fs-extra");
const TemplatePath = require("./TemplatePath");
const config = require("./Config");
const debug = require("debug")("EleventyServe");
class EleventyServe {
constructor() {}
get config() {
return this.configOverride || config.getConfig();
}
set config(config) {
this.configOverride = config;
}
setOutputDir(outputDir) {
this.outputDir = outputDir;
}
getPathPrefix() {
return this.config.pathPrefix || "/";
}
getRedirectDir(dirName) {
return TemplatePath.join(this.outputDir, dirName);
}
getRedirectDirOverride() {
// has a pathPrefix, add a /index.html template to redirect to /pathPrefix/
if (this.getPathPrefix() !== "/") {
return "_eleventy_redirect";
}
}
getRedirectFilename(dirName) {
return TemplatePath.join(this.getRedirectDir(dirName), "index.html");
}
getOptions(port) {
let pathPrefix = this.getPathPrefix();
// TODO customize this in Configuration API?
let serverConfig = {
baseDir: this.outputDir
};
let redirectDirName = this.getRedirectDirOverride();
// has a pathPrefix, add a /index.html template to redirect to /pathPrefix/
if (redirectDirName) {
serverConfig.baseDir = this.getRedirectDir(redirectDirName);
serverConfig.routes = {};
serverConfig.routes[pathPrefix] = this.outputDir;
// if has a savedPathPrefix, use the /savedPathPrefix/index.html template to redirect to /pathPrefix/
if (this.savedPathPrefix) {
serverConfig.routes[this.savedPathPrefix] = TemplatePath.join(
this.outputDir,
this.savedPathPrefix
);
}
}
return Object.assign(
{
server: serverConfig,
port: port || 8080,
ignore: ["node_modules"],
watch: false,
open: false,
notify: false,
index: "index.html"
},
this.config.browserSyncConfig
);
}
cleanupRedirect(dirName) {
if (dirName && dirName !== "/") {
let savedPathFilename = this.getRedirectFilename(dirName);
setTimeout(function() {
if (!fs.existsSync(savedPathFilename)) {
debug(`Cleanup redirect: Could not find ${savedPathFilename}`);
return;
}
let savedPathContent = fs.readFileSync(savedPathFilename, "utf-8");
if (
savedPathContent.indexOf("Browsersync pathPrefix Redirect") === -1
) {
debug(
`Cleanup redirect: Found ${savedPathFilename} but it wasnt an eleventy redirect.`
);
return;
}
fs.unlink(savedPathFilename, err => {
if (!err) {
debug(`Cleanup redirect: Deleted ${savedPathFilename}`);
}
});
}, 2000);
}
}
serveRedirect(dirName) {
fs.outputFile(
this.getRedirectFilename(dirName),
`<!doctype html>
<meta http-equiv="refresh" content="0; url=${this.config.pathPrefix}">
<title>Browsersync pathPrefix Redirect</title>
<a href="${this.config.pathPrefix}">Go to ${this.config.pathPrefix}</a>`
);
}
serve(port) {
// only load on serve—this is pretty expensive
const browserSync = require("browser-sync");
this.server = browserSync.create();
let pathPrefix = this.getPathPrefix();
if (this.savedPathPrefix && pathPrefix !== this.savedPathPrefix) {
let redirectFilename = this.getRedirectFilename(this.savedPathPrefix);
if (!fs.existsSync(redirectFilename)) {
debug(
`Redirecting BrowserSync from ${
this.savedPathPrefix
} to ${pathPrefix}`
);
this.serveRedirect(this.savedPathPrefix);
} else {
debug(
`Config updated with a new pathPrefix. Tried to set up a transparent redirect but found a template already existing at ${redirectFilename}. Youll have to navigate manually.`
);
}
}
let redirectDirName = this.getRedirectDirOverride();
// has a pathPrefix, add a /index.html template to redirect to /pathPrefix/
if (redirectDirName) {
this.serveRedirect(redirectDirName);
}
this.cleanupRedirect(this.savedPathPrefix);
this.server.init(this.getOptions(port));
// this needs to happen after `.getOptions`
this.savedPathPrefix = pathPrefix;
}
close() {
if (this.server) {
this.server.exit();
}
}
reload(path, isInclude) {
if (this.server) {
if (this.getPathPrefix() !== this.savedPathPrefix) {
this.server.exit();
this.serve();
} else {
// Is a CSS input file and is not in the includes folder
// TODO check output path file extension of this template (not input path)
if (path && path.split(".").pop() === "css" && !isInclude) {
this.server.reload("*.css");
} else {
this.server.reload();
}
}
}
}
}
module.exports = EleventyServe;

View File

@ -1,125 +0,0 @@
const dependencyTree = require("dependency-tree");
const TemplatePath = require("./TemplatePath");
class EleventyWatchTargets {
constructor() {
this.targets = new Set();
this.dependencies = new Set();
this.newTargets = new Set();
this._watchJavaScriptDependencies = true;
}
set watchJavaScriptDependencies(watch) {
this._watchJavaScriptDependencies = !!watch;
}
get watchJavaScriptDependencies() {
return this._watchJavaScriptDependencies;
}
_normalizeTargets(targets) {
if (!targets) {
return [];
} else if (Array.isArray(targets)) {
return targets;
}
return [targets];
}
reset() {
this.newTargets = new Set();
}
isWatched(target) {
return this.targets.has(target);
}
addRaw(targets, isDependency) {
for (let target of targets) {
let path = TemplatePath.addLeadingDotSlash(target);
if (!this.isWatched(path)) {
this.newTargets.add(path);
}
this.targets.add(path);
if (isDependency) {
this.dependencies.add(path);
}
}
}
// add only a target
add(targets) {
targets = this._normalizeTargets(targets);
this.addRaw(targets);
}
// add only a targets dependencies
addDependencies(targets, filterCallback) {
if (!this.watchJavaScriptDependencies) {
return;
}
targets = this._normalizeTargets(targets);
let deps = this.getJavaScriptDependenciesFromList(targets);
if (filterCallback) {
deps = deps.filter(filterCallback);
}
this.addRaw(deps, true);
}
setWriter(templateWriter) {
this.writer = templateWriter;
}
getJavaScriptDependenciesFromList(files = []) {
let depSet = new Set();
files
.filter(file => file.endsWith(".js")) // TODO does this need to work with aliasing? what other JS extensions will have deps?
.forEach(file => {
dependencyTree
.toList({
filename: file,
directory: TemplatePath.absolutePath(),
filter: function(path) {
return path.indexOf("node_modules") === -1;
}
})
.map(dependency => {
return TemplatePath.addLeadingDotSlash(
TemplatePath.relativePath(dependency)
);
})
.filter(dependency => {
return (
dependency !== file && dependency.indexOf("node_modules") === -1
);
})
.forEach(dependency => {
depSet.add(dependency);
});
});
return Array.from(depSet);
}
clearDependencyRequireCache() {
for (let path of this.dependencies) {
delete require.cache[TemplatePath.absolutePath(path)];
}
}
getNewTargetsSinceLastReset() {
return Array.from(this.newTargets);
}
getTargets() {
return Array.from(this.targets);
}
}
module.exports = EleventyWatchTargets;

Some files were not shown because too many files have changed in this diff Show More