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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 874f589b9d149419ec7d8c8fa1b4891ecb9ab1af9a396bf50f5955d70757a6df
4
- data.tar.gz: 1f3da03d51ae4352212258f02f91631463709b39204578b4ebc096fef1c6899e
3
+ metadata.gz: 34eef05a89e8a6afd90d01f0e07fe8477e348be90b8de3b603b4b7761d93d73a
4
+ data.tar.gz: 993051df2124b49cdd7df806c01a7cbe83276f155b08f93d0d4eed00fba342e9
5
5
  SHA512:
6
- metadata.gz: a8f152c9dc2f6f3bc2c949beb5f9a6daf6b2c2308ef5beac28dc735711c5715f4e5bd565d2eba86f4ff3836e0f538e82936e2b998ab69a658b59053031f51fad
7
- data.tar.gz: a62dea5dc5054e61a171852425d5f1ee3c750f6c2ee231d41f6b6a03d63a2c35f29e5919021166650e5411725a83d2930334692d8de947c2f8b3823cc2355e35
6
+ metadata.gz: 001edb81fb728535077e4dd34dea01ebce3eb184223a6513ce18fcef013c11eaeb601ec5a06503e26b0d0aef2ff24146c2f7bfa59c320f3fc55135dd090f56d4
7
+ data.tar.gz: 98bac4af65a1747a4b9c34ffd90e991440a94156f5e2d1b33570a3d519d7aaa8e1ea15135cf0a0f7dcce40ed58333abce0e4f6350f918298719b30431ef9131a
@@ -0,0 +1,3 @@
1
+
2
+ # Default owners
3
+ * @DevinCodes @sarahdayan
@@ -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/
@@ -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.2...master)
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
- config_path = Frontman::Config.get(
32
- :config_path,
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
- target_path = create_target_path(manifest_path)
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)
@@ -56,5 +56,10 @@ module Frontman
56
56
  def to_s
57
57
  "<DataStoreFile #{@data.keys.join(', ')} >"
58
58
  end
59
+
60
+ sig { returns(Frontman::DataStoreFile) }
61
+ def to_ostruct
62
+ self
63
+ end
59
64
  end
60
65
  end
@@ -6,8 +6,6 @@ require 'parallel'
6
6
  module Frontman
7
7
  class Iterator
8
8
  class << self
9
- extend T::Sig
10
-
11
9
  def map(collection, *options, &block)
12
10
  forward(:map, collection, *options, &block)
13
11
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Frontman
4
4
  # Current Version
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  end
@@ -16,6 +16,7 @@ add_asset_pipeline(
16
16
 
17
17
  Frontman::Config.set :public_dir, '.tmp/'
18
18
  Frontman::Config.set :domain, 'https://example.com'
19
+ Frontman::Config.set :fingerprint_assets, true
19
20
 
20
21
  Frontman::Bootstrapper.resources_from_dir(
21
22
  'source/'
@@ -3009,9 +3009,9 @@
3009
3009
  "dev": true
3010
3010
  },
3011
3011
  "elliptic": {
3012
- "version": "6.5.2",
3013
- "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",
3014
- "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",
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.15",
4358
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
4359
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
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/dwyl/esta/issues)
9
-
10
+ [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/algolia/frontman/issues)
10
11
 
11
- ![Frontman](frontman.svg)
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
- # TODO: determine best tests
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.2
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