jekyll-plugin-frontend-build 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 79ca4dce7ef732a091f7b1fe4735f18bb17231537891a2abafb59a9dbeb3ae94
4
+ data.tar.gz: 9f65c010e904e66e0da1574d79e4761b647f783135ad49ef3af885912c7fd0c2
5
+ SHA512:
6
+ metadata.gz: 3f14c463b98445488e8c63f29505a76dcfea69c4276105fd700cc7636bc154c941b00bacb231d15d58f28a7a5519703446033de26cd55e163c9b75025dbe339d
7
+ data.tar.gz: 808d9ef0a609b27b0ea98350978231173c56a2a0ba5b155e96bda505ba87b36f8fefbeee0bddca889e868a26eb66e122c14c0407b71fc80554cd44276adf49b8
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Ribose
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,85 @@
1
+ = Jekyll frontend build plugin
2
+
3
+ This is a very plugin that post-processes frontend assets,
4
+ enabling you to use the latest ES features
5
+ with less worries about cross-browser compatibility.
6
+
7
+ This plugin depends on Node/NPM and currently uses Babel.
8
+
9
+ The plugin uses the “assets” directory in site source as input,
10
+ and `_site/assets` as output.
11
+
12
+ Current limitations:
13
+
14
+ * As of now, it only processes JavaScript files under `assets/js` with Babel.
15
+ * The output & source directories are hard-coded;
16
+ if your site output directory is not `_site` this won’t work.
17
+
18
+ Roadmap:
19
+
20
+ * Post-process the CSS with at least auto-prefixer
21
+ * Combine front-end assets into a few packages (bulk of JS, bulk of CSS) and minify it
22
+ * Glean site destination directory from configuration
23
+ * Make source asset directory (directories) configurable
24
+ * (?) Use Web components, e.g. Polymer
25
+
26
+ == Requirements
27
+
28
+ This plugin requires Node & NPM to be available in Jekyll build environment.
29
+
30
+ == Setting up
31
+
32
+ A quick way to use this plugin with a new site is to use
33
+ the https://github.com/riboseinc/[jekyll-site-skeleton] template.
34
+
35
+ Alternatively, to add this plugin to an existing site,
36
+ create the following files in your site root,
37
+ and run `npm install` afterwards:
38
+
39
+ .package.json
40
+ [source,json]
41
+ ----
42
+ {
43
+ "version": "1.0.0",
44
+ "main": "babel.config.js",
45
+ "dependencies": {
46
+ "@babel/cli": "^7.5.5",
47
+ "@babel/core": "^7.5.5",
48
+ "@babel/polyfill": "^7.4.4",
49
+ "@babel/preset-env": "^7.5.5"
50
+ }
51
+ }
52
+ ----
53
+
54
+ .babel.config.js
55
+ [source,javascript]
56
+ ----
57
+ const presets = [
58
+ [
59
+ "@babel/env",
60
+ {
61
+ targets: {
62
+ ie: "10",
63
+ edge: "17",
64
+ firefox: "60",
65
+ chrome: "67",
66
+ safari: "11.1",
67
+ },
68
+ },
69
+ ],
70
+ ];
71
+
72
+ module.exports = { presets };
73
+ ----
74
+
75
+ == Using during development
76
+
77
+ The plugin will take effect if you run `jekyll serve` as usual.
78
+
79
+ == Using in production/CI
80
+
81
+ Just make sure that Node/NPM are available in your environment,
82
+ and call `npm install` before building the site.
83
+
84
+ See `.travis.yml` in https://github.com/riboseinc/[jekyll-site-skeleton]
85
+ for an example.
@@ -0,0 +1,41 @@
1
+ #!/bin/sh
2
+ # Tag and push a release.
3
+
4
+ set -e
5
+
6
+ # Make sure we're in the project root.
7
+
8
+ cd $(dirname "$0")/..
9
+
10
+ # Make sure the darn thing works? Meh.
11
+ # bundle update
12
+
13
+ # Build a new gem archive.
14
+
15
+ rm -rf jekyll-plugin-frontend-build-*.gem
16
+ gem build -q jekyll-plugin-frontend-build.gemspec
17
+
18
+ # Make sure we're on the master branch.
19
+
20
+ (git branch | grep -q 'master') || {
21
+ echo "Only release from the master branch."
22
+ exit 1
23
+ }
24
+
25
+ # Figure out what version we're releasing.
26
+
27
+ tag=v`ls jekyll-plugin-frontend-build-*.gem | sed 's/^jekyll-plugin-frontend-build-\(.*\)\.gem$/\1/'`
28
+
29
+ # Make sure we haven't released this version before.
30
+
31
+ git fetch -t origin
32
+
33
+ (git tag -l | grep -q "$tag") && {
34
+ echo "Whoops, there's already a '${tag}' tag."
35
+ exit 1
36
+ }
37
+
38
+ # Tag it and bag it.
39
+
40
+ gem push jekyll-plugin-frontend-build-*.gem && git tag "$tag" &&
41
+ git push origin master && git push origin "$tag"
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'jekyll-plugin-frontend-build'
5
+ s.version = '0.0.1'
6
+ s.authors = ['Ribose Inc.']
7
+ s.email = ['open.source@ribose.com']
8
+
9
+ s.summary = 'Jekyll plugin that post-processes static assets with Babel'
10
+ s.homepage = 'https://github.com/riboseinc/jekyll-plugin-frontend-build/'
11
+ s.license = 'MIT'
12
+
13
+ s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
14
+
15
+ s.add_runtime_dependency 'jekyll', '~> 3.8'
16
+ s.add_development_dependency 'rake', '~> 12.0'
17
+ s.add_development_dependency 'rubocop', '~> 0.50'
18
+
19
+ s.require_paths = ["lib"]
20
+ end
@@ -0,0 +1,7 @@
1
+ require 'jekyll-plugin-frontend-build/run_babel'
2
+
3
+
4
+ module Jekyll
5
+ module PluginFrontendBuild
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ Jekyll::Hooks.register :site, :post_write do |site|
2
+ run_frontend_build()
3
+ end
4
+
5
+ def run_frontend_build()
6
+ system('./node_modules/.bin/babel assets/js --out-dir _site/assets/js')
7
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-plugin-frontend-build
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.50'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.50'
55
+ description:
56
+ email:
57
+ - open.source@ribose.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - LICENSE.txt
63
+ - README.adoc
64
+ - develop/release
65
+ - jekyll-plugin-frontend-build.gemspec
66
+ - lib/jekyll-plugin-frontend-build.rb
67
+ - lib/jekyll-plugin-frontend-build/run_babel.rb
68
+ homepage: https://github.com/riboseinc/jekyll-plugin-frontend-build/
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.7.6.2
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Jekyll plugin that post-processes static assets with Babel
92
+ test_files: []