Use netlify plugins

This commit is contained in:
Julien Bisconti 2021-10-23 22:59:57 +02:00
parent b82bac6bcf
commit d98c56bc80
7 changed files with 758 additions and 7630 deletions

View File

@ -1,33 +0,0 @@
module.exports = {
env: {
browser: true,
node: true,
},
extends: [
'airbnb-base',
'plugin:import/errors',
'plugin:import/warnings',
'prettier',
'eslint:recommended',
],
plugins: ['import', 'prettier'],
rules: {
camelcase: 0,
'import/order': [
'error',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
'newlines-between': 'never',
},
],
'no-console': 0,
'prefer-template': 2,
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
},
],
},
};

2
.nvmrc
View File

@ -1 +1 @@
14.13.0
14.18.1

View File

@ -1,7 +0,0 @@
{
"bracketSpacing": true,
"tabWidth": 4,
"semi": true,
"trailingComma": "all",
"singleQuote": true
}

View File

@ -1,2 +0,0 @@
language: node_js
cache: npm

View File

@ -1,8 +1,6 @@
const fs = require('fs-extra');
const cheerio = require('cheerio');
const showdown = require('showdown');
const Parcel = require('parcel-bundler');
const { SitemapStream, streamToPromise } = require('sitemap');
process.env.NODE_ENV = 'production';
@ -46,44 +44,8 @@ async function processIndex() {
}
}
const bundle = () => {
LOG.debug('---');
LOG.debug('📦 Bundling with Parcel.js');
LOG.debug('---');
new Parcel(indexDestination, {
name: 'build',
publicURL: '/',
})
.bundle()
.then(() => {
const smStream = new SitemapStream({
hostname: 'https://awesome-docker.netlify.com/',
});
smStream.write({
url: '/',
changefreq: 'daily',
priority: 0.8,
lastmodrealtime: true,
lastmodfile: 'dist/index.html',
});
smStream.end();
return streamToPromise(smStream);
})
.then((sm) =>
// Creates a sitemap object given the input configuration with URLs
fs.outputFile(
'dist/sitemap.xml',
// sm.createSitemap(sitemapOpts).toString(),
sm.toString(),
),
);
};
async function main() {
await processIndex();
await bundle();
}
main();

8283
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,24 +19,11 @@
},
"homepage": "https://github.com/veggiemonk/awesome-docker#readme",
"dependencies": {
"cheerio": "1.0.0-rc.3",
"draftlog": "1.0.12",
"fs-extra": "9.0.1",
"node-fetch": "2.6.1",
"parcel-bundler": "1.12.4",
"cheerio": "1.0.0-rc.10",
"draftlog": "1.0.13",
"fs-extra": "10.0.0",
"node-fetch": "3.0.0",
"rimraf": "3.0.2",
"showdown": "1.9.1",
"sitemap": "6.3.2"
},
"devDependencies": {
"babel-eslint": "10.1.0",
"eslint": "7.10.0",
"eslint-config-airbnb-base": "14.2.0",
"eslint-config-prettier": "6.12.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.3.1",
"eslint-plugin-prettier": "3.1.4",
"minimist": "1.2.5",
"prettier": "2.1.2"
"showdown": "^1.9.0"
}
}