frontman-ssg 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +3 -0
- data/.github/RELEASE.md +30 -0
- data/CHANGELOG.md +16 -1
- data/lib/frontman/bootstrapper.rb +4 -5
- data/lib/frontman/builder/builder.rb +21 -1
- data/lib/frontman/data_store_file.rb +5 -0
- data/lib/frontman/iterator.rb +0 -2
- data/lib/frontman/version.rb +1 -1
- data/project-templates/webpack/config.rb +1 -0
- data/project-templates/webpack/package-lock.json +6 -6
- data/readme.md +6 -4
- data/spec/frontman/data_store_file_spec.rb +11 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34eef05a89e8a6afd90d01f0e07fe8477e348be90b8de3b603b4b7761d93d73a
|
4
|
+
data.tar.gz: 993051df2124b49cdd7df806c01a7cbe83276f155b08f93d0d4eed00fba342e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 001edb81fb728535077e4dd34dea01ebce3eb184223a6513ce18fcef013c11eaeb601ec5a06503e26b0d0aef2ff24146c2f7bfa59c320f3fc55135dd090f56d4
|
7
|
+
data.tar.gz: 98bac4af65a1747a4b9c34ffd90e991440a94156f5e2d1b33570a3d519d7aaa8e1ea15135cf0a0f7dcce40ed58333abce0e4f6350f918298719b30431ef9131a
|
data/.github/CODEOWNERS
ADDED
data/.github/RELEASE.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Frontman release process
|
2
|
+
|
3
|
+
## Setup
|
4
|
+
|
5
|
+
> You only have to do this once.
|
6
|
+
|
7
|
+
* Make sure you have an account on [RubyGems][rubygems].
|
8
|
+
* Run the `gem signin` command from your CLI and log in with your RubyGems credentials.
|
9
|
+
* Make sure you're an administrator on the [Frontman][frontman] gem. You can ask an existing administrator for access if you're in a position to release Frontman.
|
10
|
+
|
11
|
+
## Release
|
12
|
+
* First, make sure all the tests on `master` are green.
|
13
|
+
* Switch to the `master` branch: `git checkout master`.
|
14
|
+
* Make sure you branch is up-to-date: `git fetch && git pull`.
|
15
|
+
* Make sure your repository is clean: `git reset --hard && git clean -dfx`.
|
16
|
+
* Check the changes the new version introduces by visiting `github.com/algolia/frontman/compare/{latest_version}...master`, replacing `{latest version}` with the latest tag. You can run `git tag --list` to check for the latest release.
|
17
|
+
* Determine the [new version number][semver] that you should release, and make sure there are no breaking changes.
|
18
|
+
* Bump the version in `lib/frontman/version.rb`.
|
19
|
+
* Update the [`CHANGELOG.md`][changelog] file with the changes that this new version introduces.
|
20
|
+
* Commit your changes: `git commit -a -m "chore: bumps version to vX.Y.Z"`.
|
21
|
+
* Create a tag for the new version: `git tag X.Y.Z`.
|
22
|
+
* Push your changes and the new tag: `git push && git push --tags`.
|
23
|
+
* Build the Frontman gem: `gem build frontman-ssg.gemspec`.
|
24
|
+
* Push the newly built gem to [RubyGems][rubygems]: `gem push frontman-ssg-X.Y.Z.gem`.
|
25
|
+
* Delete the locally built gem: `rm frontman-ssg-X.Y.Z.gem`.
|
26
|
+
|
27
|
+
[changelog]: ../CHANGELOG.md
|
28
|
+
[frontman]: https://rubygems.org/gems/frontman-ssg
|
29
|
+
[rubygems]: https://www.rubygems.org/
|
30
|
+
[semver]: https://semver.org/
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,22 @@ We document all notable changes to the project in the file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [semantic versioning](http://semver.org/).
|
6
6
|
|
7
7
|
# Release Notes
|
8
|
-
## [Unreleased](https://github.com/algolia/frontman/compare/0.0.
|
8
|
+
## [Unreleased](https://github.com/algolia/frontman/compare/0.0.3...master)
|
9
|
+
|
10
|
+
## [0.0.3](https://github.com/algolia/frontman/tree/0.0.3) - 2020-08-28
|
11
|
+
|
12
|
+
#### Added
|
13
|
+
* Documentation on the release process.
|
14
|
+
* Load possible `.env` files before application bootstrapping.
|
15
|
+
* Asset fingerprinting through configuration.
|
16
|
+
|
17
|
+
#### Security
|
18
|
+
* Update dependencies in the Webpack project template.
|
19
|
+
|
20
|
+
#### Fixed
|
21
|
+
* Prevent `DataStoreFile` from being converted to `OpenStruct`.
|
22
|
+
* Misc. updates to the projects documentation.
|
23
|
+
|
9
24
|
## [0.0.2](https://github.com/algolia/frontman/tree/0.0.2)
|
10
25
|
The initial alpha release.
|
11
26
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# typed: ignore
|
4
4
|
|
5
|
+
require 'dotenv'
|
5
6
|
require 'sorbet-runtime'
|
6
7
|
require 'frontman/app'
|
7
8
|
require 'frontman/resource'
|
@@ -26,13 +27,11 @@ module Frontman
|
|
26
27
|
sig { params(app: Frontman::App).returns(Frontman::App) }
|
27
28
|
def bootstrap_app(app)
|
28
29
|
unless bootstrapped?
|
30
|
+
Dotenv.load
|
29
31
|
register_default_helpers(app)
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
fallback: './config.rb'
|
34
|
-
)
|
35
|
-
app.run(File.read(config_path)) if File.exist?(config_path)
|
33
|
+
config = Frontman::Config.get(:config_path, fallback: './config.rb')
|
34
|
+
app.run(File.read(config)) if File.exist?(config)
|
36
35
|
|
37
36
|
@@bootstrapped = true
|
38
37
|
end
|
@@ -79,11 +79,31 @@ module Frontman
|
|
79
79
|
.returns(Frontman::Builder::File)
|
80
80
|
end
|
81
81
|
def build_from_asset(path, manifest_path)
|
82
|
-
|
82
|
+
target = manifest_path
|
83
|
+
|
84
|
+
if Frontman::Config.get(:fingerprint_assets, fallback: false)
|
85
|
+
path_with_digest = add_asset_to_manifest(manifest_path, path)
|
86
|
+
target = path_with_digest
|
87
|
+
end
|
88
|
+
|
89
|
+
target_path = create_target_path(target)
|
83
90
|
|
84
91
|
build_from_content(target_path, ::File.read(path))
|
85
92
|
end
|
86
93
|
|
94
|
+
sig do
|
95
|
+
params(manifest_path: String, file_path: String)
|
96
|
+
.returns(String)
|
97
|
+
end
|
98
|
+
def add_asset_to_manifest(manifest_path, file_path)
|
99
|
+
path_with_digest = manifest_path.sub(/\.(\w+)$/) do |ext|
|
100
|
+
"-#{digest(file_path)}#{ext}"
|
101
|
+
end
|
102
|
+
|
103
|
+
Frontman::App.instance.add_to_manifest(manifest_path, path_with_digest)
|
104
|
+
path_with_digest
|
105
|
+
end
|
106
|
+
|
87
107
|
sig do
|
88
108
|
params(path: String, manifest_path: String)
|
89
109
|
.returns(Frontman::Builder::File)
|
data/lib/frontman/iterator.rb
CHANGED
data/lib/frontman/version.rb
CHANGED
@@ -3009,9 +3009,9 @@
|
|
3009
3009
|
"dev": true
|
3010
3010
|
},
|
3011
3011
|
"elliptic": {
|
3012
|
-
"version": "6.5.
|
3013
|
-
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.
|
3014
|
-
"integrity": "sha512-
|
3012
|
+
"version": "6.5.3",
|
3013
|
+
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
3014
|
+
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
3015
3015
|
"dev": true,
|
3016
3016
|
"requires": {
|
3017
3017
|
"bn.js": "^4.4.0",
|
@@ -4354,9 +4354,9 @@
|
|
4354
4354
|
}
|
4355
4355
|
},
|
4356
4356
|
"lodash": {
|
4357
|
-
"version": "4.17.
|
4358
|
-
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.
|
4359
|
-
"integrity": "sha512-
|
4357
|
+
"version": "4.17.20",
|
4358
|
+
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
4359
|
+
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
|
4360
4360
|
"dev": true
|
4361
4361
|
},
|
4362
4362
|
"lodash.memoize": {
|
data/readme.md
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
⚠️ **Frontman is currently in an alpha release**, which can involve breaking changes. However, we try to preserve backwards compatibility as much as possible, and we document all changes in the [changelog][changelog].
|
2
2
|
|
3
|
+
<div align="center">
|
4
|
+
|
3
5
|
# Frontman
|
4
6
|
|
5
7
|
[![CircleCI](https://circleci.com/gh/algolia/frontman/tree/master.svg?style=shield&circle-token=ea3dfd1f27a86d050cbc806d3cbd27c1742746ac)](https://circleci.com/gh/algolia/frontman/tree/master)
|
6
8
|
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)][license]
|
7
9
|
[![Gem Version](http://img.shields.io/gem/v/frontman-ssg.svg?style=flat)][gem]
|
8
|
-
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/
|
9
|
-
|
10
|
+
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/algolia/frontman/issues)
|
10
11
|
|
11
|
-
|
12
|
+
<img src="frontman.svg" alt="Frontman" height="200"/>
|
12
13
|
|
13
14
|
Frontman is a static site generator written in Ruby, optimized for speed. It helps you convert your content to static HTML files, so you can focus on your content instead of maintaining servers.
|
14
15
|
|
15
|
-
|
16
16
|
**Check out our [wiki][wiki] for detailed documentation.**
|
17
17
|
|
18
|
+
</div>
|
19
|
+
|
18
20
|
## About Frontman
|
19
21
|
Frontman is heavily inspired by [Middleman][middleman], a fantastic static site generator with a large community and feature set. We've used it for a long time, with great success.
|
20
22
|
However, once our project reached a certain size, we realized that Middleman had a few shortcomings when it comes to performance. It was becoming a serious bottleneck for us to iterate fast. After unsuccessfully trying to improve build time, we had to move away from it. Instead of undertaking a huge, lengthy migration to another tool and language, we decided to preserve our current codebase, and create our own, Middleman-inspired static site generator.
|
@@ -3,7 +3,17 @@
|
|
3
3
|
|
4
4
|
require './spec/spec_setup'
|
5
5
|
require 'lib/frontman/data_store_file'
|
6
|
+
require 'lib/frontman/data_store'
|
6
7
|
|
7
8
|
describe Frontman::DataStoreFile do
|
8
|
-
|
9
|
+
subject do
|
10
|
+
data = Frontman::DataStore.new("#{__dir__}/mocks")
|
11
|
+
data.info
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#to_ostruct' do
|
15
|
+
it 'does not convert to custom struct' do
|
16
|
+
expect(subject.to_ostruct.is_a?(Frontman::DataStoreFile)).to eq true
|
17
|
+
end
|
18
|
+
end
|
9
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frontman-ssg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Devin Beeuwkes
|
@@ -340,10 +340,12 @@ extensions: []
|
|
340
340
|
extra_rdoc_files: []
|
341
341
|
files:
|
342
342
|
- ".circleci/config.yml"
|
343
|
+
- ".github/CODEOWNERS"
|
343
344
|
- ".github/CODE_OF_CONDUCT.md"
|
344
345
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
345
346
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
346
347
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
348
|
+
- ".github/RELEASE.md"
|
347
349
|
- ".gitignore"
|
348
350
|
- ".rubocop.yml"
|
349
351
|
- CHANGELOG.md
|