1
0
mirror of https://github.com/ipdb/website.git synced 2024-11-22 01:26:52 +01:00

update all build tools

This commit is contained in:
Matthias Kretschmann 2018-09-28 12:08:19 +02:00
parent acee53b170
commit a6b689ed84
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 67 additions and 73 deletions

View File

@ -1,3 +1,3 @@
{
"presets": ["env"]
"presets": ["@babel/env"]
}

View File

@ -5,18 +5,14 @@
**Note: As of February 2nd, 2018, IPDB will be shutting down. [Read about why](https://ipdb.io).**
[![Build Status](https://travis-ci.org/ipdb/website.svg?branch=master)](https://travis-ci.org/ipdb/website)
[![Build Status](https://travis-ci.com/ipdb/website.svg?branch=master)](https://travis-ci.com/ipdb/website)
[![css bigchaindb](https://img.shields.io/badge/css-bigchaindb-39BA91.svg)](https://github.com/bigchaindb/stylelint-config-bigchaindb)
[![js ascribe](https://img.shields.io/badge/js-ascribe-39BA91.svg)](https://github.com/ascribe/javascript)
[![Greenkeeper badge](https://badges.greenkeeper.io/ipdb/website.svg)](https://greenkeeper.io/)
---
[**Live**](https://ipdb.io) | [**Styleguide**](https://ipdb.io/styleguide/)
---
# Contents
## Table of Contents
- [Content editing](#content-editing)
- [Pages](#pages)
@ -36,7 +32,9 @@
- [Authors & Contributors](#authors--contributors)
- [License](#license)
# Content editing
---
## Content editing
Most content on the site can be edited on GitHub without messing with HTML markup.
@ -44,7 +42,7 @@ The site's source and structure is in the [`_src/`](_src) folder. Ignore everyth
When viewing a file on GitHub you will see a small pencil icon in the top right. Click that to edit the file.
## Pages
### Pages
All pages are simple Markdown files. Markdown is a way of telling the site how an element should be marked up, like headings & bold text:
@ -57,15 +55,14 @@ I'm a simple paragraph. No fancy symbols needed.
You can make text **bold like so**
```
## Special pages
### Special pages
Some pages like front page source their content dynamically during site build. This is so we have a single source of truth for content used in multiple places on the site.
- [`_src/_data/content-front.yml`](_src/_data/content-front.yml)
- [`_src/_data/content-foundation.yml`](_src/_data/content-foundation.yml)
# Development
## Development
You need to have the following tools installed on your development machine before moving on:
@ -74,7 +71,7 @@ You need to have the following tools installed on your development machine befor
- [Ruby](https://www.ruby-lang.org) (for sanity, install with [rvm](https://rvm.io/))
- [Bundler](http://bundler.io/)
## Install dependencies
### Install dependencies
Run the following command from the repository's root folder to install all dependencies.
@ -82,13 +79,7 @@ Run the following command from the repository's root folder to install all depen
npm i && bundle install
```
or
```bash
yarn && bundle install
```
## Development build
### Development build
Spin up local dev server and livereloading watch task, reachable under [https://localhost:1337](https://localhost:1337):
@ -96,7 +87,7 @@ Spin up local dev server and livereloading watch task, reachable under [https://
gulp
```
# Continuous deployment: always be shipping
## Continuous deployment: always be shipping
The site gets built & deployed automatically via Travis. This is the preferred way of deployment, it makes sure the site is always deployed with fresh dependencies and only after a successful build.
@ -106,15 +97,15 @@ Build & deployment happens under the following conditions on Travis:
- **live deployment**: every push to the master branch initiates a live deployment
- **beta deployment**: every new pull request and every subsequent push to it initiates a beta deployment
# Manual deployment
## Manual deployment
For emergency live deployments or beta deployments, the manual method can be used. The site is hosted in an S3 bucket and gets deployed via a gulp task.
## Prerequisite: authentication
### Prerequisite: authentication
To deploy the site, you must authenticate yourself against the AWS API with your AWS credentials. Get your AWS access key and secret and add them to `~/.aws/credentials`:
```
```bash
[default]
aws_access_key_id = <YOUR_ACCESS_KEY_ID>
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>
@ -130,7 +121,7 @@ AWS_PROFILE=ipdb gulp deploy --live
In case that you get authentication errors or need an alternative way to authenticate with AWS, check out the [AWS documentation](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html).
## Staging build & beta deployment
### Staging build & beta deployment
The staging build is a full production build but prevents search engine indexing & Google Analytics tracking.
@ -146,7 +137,7 @@ gulp build --staging
gulp deploy --beta
```
## Production build & live deployment
### Production build & live deployment
```bash
# make sure your local npm packages & gems are up to date
@ -159,7 +150,7 @@ gulp build --production
gulp deploy --live
```
# Coding conventions & Browser support
## Coding conventions & Browser support
Lint with ESLint & [stylelint](https://stylelint.io) in your editor or run:
@ -169,11 +160,11 @@ npm test
As a rule of thumb, make your CSS & JavaScript work in the last 2 versions of modern browsers, and ideally in IE 11. Adapt the `browserslist` key values in the [`package.json`](package.json) when a change in visitor statistics allows that.
## (S)CSS
### (S)CSS
Follows [stylelint-config-bigchaindb](https://github.com/bigchaindb/stylelint-config-bigchaindb) which itself extends [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard).
## js
### js
Follows [ascribe/javascript](https://github.com/ascribe/javascript) which itself extends [airbnb/javascript](https://github.com/airbnb/javascript).
@ -181,7 +172,7 @@ Try to not use any jQuery, always prefer vanilla JavaScript.
At the moment, jQuery is only used for the form submissions for its simple `$.ajax` functionality, and neither `XMLHttpRequest` or `fetch` seem to work with MailChimp.
# Authors & Contributors
## Authors & Contributors
- Greg McMullen ([@gmcmullen](https://github.com/gmcmullen)) - [IPDB Foundation](https://ipdb.io)
- Morgan Sutherland ([@msutherl](https://github.com/msutherl)) - [IPDB Foundation](https://ipdb.io)
@ -189,12 +180,11 @@ At the moment, jQuery is only used for the form submissions for its simple `$.aj
- Members of the BigchainDB development team
- Representatives of Caretakers in the IPDB
# License
## License
For all code in this repository the Apache License, Version 2.0 is applied.
```
```text
Copyright Interplanetary Database Foundation 2017. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -3,7 +3,7 @@
/* eslint-disable spaced-comment */
//=include _dnt.js
//=include _newsletter.js
//=include smooth-scroll/dist/js/smooth-scroll.js
//=include smooth-scroll/dist/smooth-scroll.js
//=include textarea-autogrow/textarea-autogrow.js
//=include cookie-banner/src/cookiebanner.js
/* eslint-enable spaced-comment */

View File

@ -1,6 +1,6 @@
/* eslint-disable no-console */
import fs from 'fs'
import cp from 'child_process'
import { src, dest, watch, parallel, series } from 'gulp'
import del from 'del'
import parallelize from 'concurrent-transform'
@ -14,10 +14,9 @@ import uglifyjs from 'uglify-es'
import composer from 'gulp-uglify/composer'
// get all the configs: `pkg` and `site`
import pkg from './package.json'
import pkg from './package'
// load plugins
const spawn = require('child_process').spawn
const $ = require('gulp-load-plugins')()
const minify = composer(uglifyjs, console)
@ -109,9 +108,15 @@ export const jekyll = (done) => {
jekyllOptions = 'jekyll build --incremental --drafts --future'
}
const jekyllInstance = spawn('bundle', ['exec', jekyllOptions], { stdio: 'inherit' })
const jekyllInstance = cp.execFile('bundle', ['exec', jekyllOptions], { stdio: 'inherit' })
jekyllInstance.on('error', (error) => onError(error)).on('close', done)
const jekyllLogger = (buffer) => {
buffer.toString()
.split(/\n/)
.forEach((message) => console.log(message))
}
jekyllInstance.stdout.on('data', jekyllLogger).on('close', done)
}
@ -352,9 +357,7 @@ export const build = series(
//
// `gulp dev`
//
export const dev = series(
build, server, watchSrc
)
export const dev = series(build, server, watchSrc)
// Set `gulp dev` as default: `gulp`
export default dev

View File

@ -7,7 +7,7 @@
},
"description": "The blockchain database governance the universe needs",
"homepage": "https://ipdb.io",
"license": "(c) 2017 IPDB Foundation - All Rights Reserved",
"license": "(c) 2018 IPDB Foundation - All Rights Reserved",
"main": "gulpfile.babel.js",
"scripts": {
"start": "gulp",
@ -30,50 +30,51 @@
"dependencies": {
"ajaxchimp": "^1.3.0",
"cookie-banner": "github:dobarkod/cookie-banner",
"jquery": "^3.2.1",
"smooth-scroll": "^12.1.5",
"jquery": "^3.3.1",
"smooth-scroll": "^14.2.1",
"textarea-autogrow": "^1.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.1.2",
"babel-preset-env": "^1.6.1",
"browser-sync": "^2.23.2",
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/register": "^7.0.0",
"babel-eslint": "^8.2.6",
"browser-sync": "^2.24.7",
"concurrent-transform": "^1.0.0",
"critical": "^1.1.0",
"cross-spawn": "^5.1.0",
"critical": "^1.3.4",
"cross-spawn": "^6.0.5",
"del": "^3.0.0",
"eslint": "^4.14.0",
"eslint": "^5.6.0",
"eslint-config-ascribe": "^3.0.5",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-import": "^2.14.0",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-autoprefixer": "^4.1.0",
"gulp-awspublish": "^3.3.0",
"gulp-awspublish-router": "^0.1.3",
"gulp-clean-css": "^3.9.2",
"gulp-cli": "^2.0.0",
"gulp-autoprefixer": "^6.0.0",
"gulp-awspublish": "^3.4.0",
"gulp-awspublish-router": "^0.1.5",
"gulp-clean-css": "^3.10.0",
"gulp-cli": "^2.0.1",
"gulp-concat": "^2.6.1",
"gulp-header": "^1.8.9",
"gulp-htmlmin": "^4.0.0",
"gulp-header": "^2.0.5",
"gulp-htmlmin": "^5.0.1",
"gulp-if": "^2.0.2",
"gulp-imagemin": "^4.1.0",
"gulp-include": "^2.3.1",
"gulp-load-plugins": "^1.5.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-rev": "^8.1.1",
"gulp-rev-replace": "^0.4.3",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.3",
"gulp-svg-sprite": "^1.3.7",
"gulp-uglify": "^3.0.0",
"gulp-rev-replace": "^0.4.4",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-svg-sprite": "^1.5.0",
"gulp-uglify": "^3.0.1",
"gulp-util": "^3.0.8",
"js-yaml": "^3.10.0",
"request": "^2.83.0",
"stylelint": "^8.4.0",
"stylelint-config-bigchaindb": "^1.2.0",
"stylelint-config-standard": "^18.0.0",
"uglify-es": "^3.3.4"
"js-yaml": "^3.12.0",
"request": "^2.88.0",
"stylelint": "^9.6.0",
"stylelint-config-bigchaindb": "^1.2.1",
"stylelint-config-standard": "^18.2.0",
"uglify-es": "^3.3.9"
},
"engines": {
"node": ">=7.0.0"