Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Oct 18, 2019
0 parents commit 99f5137
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
coverage
20 changes: 20 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": ["standard", "prettier", "prettier/standard"],
"plugins": ["mocha"],
"env": {
"mocha": true
},
"rules": {
"prefer-template": "error",
"mocha/no-exclusive-tests": "error",
"mocha/no-nested-tests": "error",
"mocha/no-identical-title": "error",
"prefer-const": [
"error",
{
"destructuring": "all",
"ignoreReadBeforeAssign": false
}
]
}
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules/
/coverage/
.DS_Store
/.nyc_output/
dist
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact=false
package-lock=false
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules/
/coverage/

# Don't fight npm install --save
/package.json
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js

node_js:
- 8
- 10
- node

script: npm run ci
after_success: <coverage/lcov.info ./node_modules/coveralls/bin/coveralls.js
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright (c) 2019, Andreas Lind, Peter Müller & contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the author nor the names of contributors may
be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 changes: 13 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const AssetGraph = require('assetgraph');
const subfont = require('subfont');

async function subfontPlugin({ pluginConfig = {}, netlifyConfig = {} }) {
return {
postBuild: async ({ pluginConfig = {}, netlifyConfig = {} }) => {
console.log(pluginConfig);
console.log(netlifyConfig);
}
};
}

module.exports = subfontPlugin;
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "netlify-plugin-subfont",
"description": "Netlify build plugin to run automated web font loading optimizations on static pages",
"repository": "git://github.com/munter/netlify-plugin-subfont.git",
"version": "0.0.0",
"license": "BSD-3-Clause",
"maintainers": [
{
"name": "Peter Müller",
"email": "munter@fumle.dk"
}
],
"files": [
"lib"
],
"dependencies": {
"subfont": "^3.7.0"
},
"devDependencies": {
"coveralls": "^3.0.2",
"cpy-cli": "^2.0.0",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-config-standard": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-mocha": "^6.2.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"magicpen-prism": "3.0.2",
"mocha": "^6.0.0",
"netlify-cli": "^2.19.0",
"nyc": "^14.0.0",
"offline-github-changelog": "^1.6.1",
"prettier": "~1.18.2",
"rimraf": "^3.0.0",
"unexpected": "^11.0.0-1",
"unexpected-assetgraph": "^1.1.1"
},
"main": "lib/index.js",
"scripts": {
"prebuild": "rimraf dist",
"build": "cpy site dist",
"lint": "eslint . && prettier --check '**/*.js'",
"test": "mocha",
"ci": "npm run lint && npm run coverage",
"coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text --all -- mocha --reporter dot && echo google-chrome coverage/lcov-report/index.html",
"preversion": "offline-github-changelog --next=${npm_package_version} > CHANGELOG.md && git add CHANGELOG.md"
},
"nyc": {
"include": [
"lib/**"
]
}
}
25 changes: 25 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hello world</title>
<link href="https://fonts.googleapis.com/css?family=Modak&display=swap" rel="stylesheet">

<style>
h1 {
font-family: Modak;
}
</style>

</head>

<body>

<h1>Hello World!</h1>

</body>

</html>

0 comments on commit 99f5137

Please sign in to comment.