Skip to content

Commit

Permalink
chore: minor grammar fixes (#348)
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
G-Rath committed Aug 13, 2023
1 parent cdf3283 commit bdf8366
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby-backward-compatibility.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
- gemfiles/Gemfile-rails.6.1.x
- gemfiles/Gemfile-rails.7.0.x
# Uncomment the following line only to ensure compatibility with the
# upcomming Rails versions, maybe before a release.
# upcoming Rails versions, maybe before a release.
#- gemfiles/Gemfile-rails-edge
exclude:
- ruby: 2.6
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -10,7 +10,7 @@ Thank you for your interest in contributing to Shakapacker! We welcome all contr
- [Testing the generator](#testing-the-generator)

## Reporting Issues
If you encounter any issues with the project, please first check the exisiting issues (including closed ones). If the issues is not reported before, please opening an issue on our GitHub repository. Please provide a clear and detailed description of the issue, including steps to reproduce it. Creating a demo repository to demonstrate the issue would be ideal (and in some cases necessary).
If you encounter any issues with the project, please first check the existing issues (including closed ones). If the issues is not reported before, please opening an issue on our GitHub repository. Please provide a clear and detailed description of the issue, including steps to reproduce it. Creating a demo repository to demonstrate the issue would be ideal (and in some cases necessary).

If looking to contribute to the project by fixing existing issues, we recommend looking at issues, particularly with the "[help wanted](https://github.com/shakacode/shakapacker/issues?q=is%3Aissue+label%3A%22help+wanted%22)" label.

Expand Down Expand Up @@ -41,7 +41,7 @@ We welcome pull requests that fix bugs, add new features, or improve existing on
# In Rails app for testing
yalc link shakapacker

# After every chagnes in shakapacker, run the folloing in Shakapacker directory
# After every change in shakapacker, run the following in Shakapacker directory
yalc push # or yalc publish --push
```
3. Run the following commands to set up the development environment.
Expand Down Expand Up @@ -101,7 +101,7 @@ bundle exec rake run_spec:gem
```

#### 4.4 Run only Shakapacker gem specs for backward compatibility
These specs are to check Shakapcker v7 backward compatibility with v6.x
These specs are to check Shakapacker v7 backward compatibility with v6.x

```
bundle exec rake run_spec:gem_bc
Expand All @@ -125,4 +125,3 @@ To ensure that your installer works as expected, either you can run `bundle exec
3. Run `bundle exec rails shakapacker:install` to confirm that you got the right changes.

**Note:** Ensure that you use bundle exec otherwise the installed shakapacker gem will run and not the one you are working on.

4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -15,13 +15,13 @@ _Official, actively maintained successor to [rails/webpacker](https://github.com
[![Gem](https://img.shields.io/gem/v/shakapacker.svg)](https://rubygems.org/gems/shakapacker)
[![npm version](https://badge.fury.io/js/shakapacker.svg)](https://badge.fury.io/js/shakapacker)

Shakpacker makes it easy to use the JavaScript pre-processor and bundler [Webpack v5+](https://webpack.js.org/)
Shakapacker makes it easy to use the JavaScript pre-processor and bundler [Webpack v5+](https://webpack.js.org/)
to manage frontend JavaScript in Rails. It can coexist with the asset pipeline,
leaving Webpack responsible solely for frontend JavaScript, or can be used exclusively, making it also responsible for images, fonts, and CSS.

Check out 6.1.1+ for [SWC](https://swc.rs/) and [esbuild-loader](https://github.com/privatenumber/esbuild-loader) support! They are faster than Babel!

See a comparison of [Shakapacker with jsbundling-rails](https://github.com/rails/jsbundling-rails/blob/main/docs/comparison_with_webpacker.md). For a in-depth discussion of choosing between `shakapacker` and `jsbundling-rails`, see the discussion [Webpacker alternatives - which path should we go to? #8783](https://github.com/decidim/decidim/discussions/8783) and the resulting PR [Switch away from Webpacker to Shakapacker #10389](https://github.com/decidim/decidim/pull/10389).
See a comparison of [Shakapacker with jsbundling-rails](https://github.com/rails/jsbundling-rails/blob/main/docs/comparison_with_webpacker.md). For an in-depth discussion of choosing between `shakapacker` and `jsbundling-rails`, see the discussion [Webpacker alternatives - which path should we go to? #8783](https://github.com/decidim/decidim/discussions/8783) and the resulting PR [Switch away from Webpacker to Shakapacker #10389](https://github.com/decidim/decidim/pull/10389).

For discussions, see our [Slack Channel](https://reactrails.slack.com/join/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE).

Expand Down
2 changes: 1 addition & 1 deletion docs/deployment.md
Expand Up @@ -94,7 +94,7 @@ If you are using a CDN setup, Shakapacker does NOT use the `ASSET_HOST` environm

### Assets compiling on every deployment even if JavaScript and CSS files are not changed

Make sure you have your public outputh path (default `public/packs`), the shakapacker cache path (default `tmp/shakapacker`) and `node_modules` in `:linked_dirs`
Make sure you have your public output path (default `public/packs`), the shakapacker cache path (default `tmp/shakapacker`) and `node_modules` in `:linked_dirs`

```ruby
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "tmp/shakapacker", "public/packs", ".bundle", "node_modules"
Expand Down
2 changes: 1 addition & 1 deletion docs/using_esbuild_loader.md
Expand Up @@ -8,7 +8,7 @@ If you face any issues, please report them at https://github.com/shakacode/shaka

[esbuild](https://esbuild.github.io/) is a Go-based bundler tool that can offer [significant improvement](https://esbuild.github.io/faq/#benchmark-details) over other similar tools.

While esbuild is a complete bundler, through the usage of [esbuild-loader](https://github.com/privatenumber/esbuild-loader), you can still leverage esbuild's speedy transpilation and minifcation in your Webpack-based configs.
While esbuild is a complete bundler, through the usage of [esbuild-loader](https://github.com/privatenumber/esbuild-loader), you can still leverage esbuild's speedy transpilation and minification in your Webpack-based configs.

Please note, that unlike Babel or SWC loader, esbuild-loader has got no support for things like:
- React Hot Module reload
Expand Down
2 changes: 1 addition & 1 deletion docs/v6_upgrade.md
Expand Up @@ -97,7 +97,7 @@ _If you're on webpacker v5, follow [how to upgrade to webpacker v6.0.0.rc.6 from
```
If you prefer this configuration, then you will move your `app/javascript/packs/*` (including `application.js`) to `app/javascript/` and update the configuration file.

Note, moving your files is optional, as you can stil keep your entries in a separate directory, called something like `packs`, or `entries`. This directory is defined with the `source_path`.
Note, moving your files is optional, as you can still keep your entries in a separate directory, called something like `packs`, or `entries`. This directory is defined with the `source_path`.

1. Update `webpack-dev-server` to the current version, greater than 4.2, updating `package.json`.

Expand Down
2 changes: 1 addition & 1 deletion docs/v7_upgrade.md
Expand Up @@ -45,7 +45,7 @@ If you started with:
const { webpackConfig } = require('shakapacker')
```

Swtich to:
Switch to:

```js
const { generateWebpackConfig } = require('shakapacker')
Expand Down
9 changes: 7 additions & 2 deletions lib/tasks/shakapacker/check_binstubs.rake
@@ -1,12 +1,17 @@
namespace :shakapacker do
desc "Verifies that bin/shakapacker is present"
task :check_binstubs do
verify_file_existance("bin/shakapacker", "bin/webpacker")
verify_file_existance("bin/shakapacker-dev-server", "bin/webpacker-dev-server")
verify_file_existence("bin/shakapacker", "bin/webpacker")
verify_file_existence("bin/shakapacker-dev-server", "bin/webpacker-dev-server")
end
end

def verify_file_existance(main_file, alternative_file)
puts "verify_file_existance is deprecated - use verify_file_existence instead"
verify_file_existence(main_file, alternative_file)
end

def verify_file_existence(main_file, alternative_file)
unless File.exist?(Rails.root.join(main_file))
if File.exist?(Rails.root.join(alternative_file))
Shakapacker.puts_deprecation_message(
Expand Down
2 changes: 1 addition & 1 deletion package/environments/__tests__/base-bc.js
@@ -1,6 +1,6 @@
/* global test expect, describe, afterAll, beforeEach */

// environment.js expects to find config/webapacker.yml and resolved modules from
// environment.js expects to find config/webpacker.yml and resolved modules from
// the root of a Rails project

const { resetEnv, chdirWebpackerTestApp } = require('../../utils/helpers')
Expand Down
18 changes: 9 additions & 9 deletions package/environments/__tests__/development.js
Expand Up @@ -16,10 +16,10 @@ describe('Development specific config', () => {
test('sets filename to use contentHash', () => {
const config = require("../../config");
config.useContentHash = true
const environmnetConfig = require('../development')
const environmentConfig = require('../development')

expect(environmnetConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmnetConfig.output.chunkFilename).toEqual(
expect(environmentConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmentConfig.output.chunkFilename).toEqual(
'js/[name]-[contenthash].chunk.js'
)
})
Expand All @@ -29,10 +29,10 @@ describe('Development specific config', () => {
test('sets filename without using contentHash', () => {
const config = require("../../config");
config.useContentHash = false
const environmnetConfig = require('../development')
const environmentConfig = require('../development')

expect(environmnetConfig.output.filename).toEqual('js/[name].js')
expect(environmnetConfig.output.chunkFilename).toEqual(
expect(environmentConfig.output.filename).toEqual('js/[name].js')
expect(environmentConfig.output.chunkFilename).toEqual(
'js/[name].chunk.js'
)
})
Expand All @@ -42,10 +42,10 @@ describe('Development specific config', () => {
test('sets filename without using contentHash', () => {
const config = require("../../config");
delete config.useContentHash
const environmnetConfig = require('../development')
const environmentConfig = require('../development')

expect(environmnetConfig.output.filename).toEqual('js/[name].js')
expect(environmnetConfig.output.chunkFilename).toEqual(
expect(environmentConfig.output.filename).toEqual('js/[name].js')
expect(environmentConfig.output.chunkFilename).toEqual(
'js/[name].chunk.js'
)
})
Expand Down
24 changes: 12 additions & 12 deletions package/environments/__tests__/production.js
Expand Up @@ -16,10 +16,10 @@ describe('Production specific config', () => {
test('sets filename to use contentHash', () => {
const config = require("../../config");
config.useContentHash = true
const environmnetConfig = require('../production')
const environmentConfig = require('../production')

expect(environmnetConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmnetConfig.output.chunkFilename).toEqual(
expect(environmentConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmentConfig.output.chunkFilename).toEqual(
'js/[name]-[contenthash].chunk.js'
)
})
Expand All @@ -28,7 +28,7 @@ describe('Production specific config', () => {
const consoleWarnSpy = jest.spyOn(console, 'warn');
const config = require("../../config");
config.useContentHash = true
const environmnetConfig = require('../production')
const environmentConfig = require('../production')

expect(consoleWarnSpy).not.toHaveBeenCalledWith(
expect.stringMatching(/Setting 'useContentHash' to 'false' in the production environment/)
Expand All @@ -42,10 +42,10 @@ describe('Production specific config', () => {
test('sets filename to use contentHash', () => {
const config = require("../../config");
config.useContentHash = false
const environmnetConfig = require('../production')
const environmentConfig = require('../production')

expect(environmnetConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmnetConfig.output.chunkFilename).toEqual(
expect(environmentConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmentConfig.output.chunkFilename).toEqual(
'js/[name]-[contenthash].chunk.js'
)
})
Expand All @@ -54,7 +54,7 @@ describe('Production specific config', () => {
const consoleWarnSpy = jest.spyOn(console, 'warn');
const config = require("../../config");
config.useContentHash = false
const environmnetConfig = require('../production')
const environmentConfig = require('../production')

expect(consoleWarnSpy).toHaveBeenCalledWith(
expect.stringMatching(/Setting 'useContentHash' to 'false' in the production environment/)
Expand All @@ -68,10 +68,10 @@ describe('Production specific config', () => {
test('sets filename to use contentHash', () => {
const config = require("../../config");
delete config.useContentHash
const environmnetConfig = require('../production')
const environmentConfig = require('../production')

expect(environmnetConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmnetConfig.output.chunkFilename).toEqual(
expect(environmentConfig.output.filename).toEqual('js/[name]-[contenthash].js')
expect(environmentConfig.output.chunkFilename).toEqual(
'js/[name]-[contenthash].chunk.js'
)
})
Expand All @@ -80,7 +80,7 @@ describe('Production specific config', () => {
const consoleWarnSpy = jest.spyOn(console, 'warn');
const config = require("../../config");
delete config.useContentHash
const environmnetConfig = require('../production')
const environmentConfig = require('../production')

expect(consoleWarnSpy).not.toHaveBeenCalledWith(
expect.stringMatching(/Setting 'useContentHash' to 'false' in the production environment/)
Expand Down
2 changes: 1 addition & 1 deletion rakelib/release.rake
Expand Up @@ -25,7 +25,7 @@ Note, accept defaults for npmjs options. Script will pause to get 2FA tokens.
Example: `rake release[2.1.0,false]`")
task :create_release, %i[gem_version dry_run] do |_t, args|
# Check if there are uncommited changes
# Check if there are uncommitted changes
Shakapacker::Utils::Misc.uncommitted_changes?(RaisingMessageHandler.new)
args_hash = args.to_hash

Expand Down
4 changes: 2 additions & 2 deletions spec/backward_compatibility_specs/compiler_spec.rb
Expand Up @@ -26,7 +26,7 @@
allow(Webpacker.compiler).to receive(:strategy).and_return(mocked_strategy)

status = OpenStruct.new(success?: true)
allow(Open3).to receive(:capture3).and_return([:sterr, :stdout, status])
allow(Open3).to receive(:capture3).and_return([:stderr, :stdout, status])

expect(Webpacker.compiler.compile).to be true
expect(mocked_strategy).to have_received(:after_compile_hook)
Expand All @@ -40,7 +40,7 @@
allow(Webpacker.compiler).to receive(:strategy).and_return(mocked_strategy)

status = OpenStruct.new(success?: false)
allow(Open3).to receive(:capture3).and_return([:sterr, :stdout, status])
allow(Open3).to receive(:capture3).and_return([:stderr, :stdout, status])

expect(Webpacker.compiler.compile).to be false
expect(mocked_strategy).to have_received(:after_compile_hook)
Expand Down
8 changes: 4 additions & 4 deletions spec/backward_compatibility_specs/configuration_spec.rb
Expand Up @@ -56,7 +56,7 @@
expect(config.cache_manifest?).to be true
end

it "returns false in developemnt environemnt" do
it "returns false in development environment" do
with_rails_env("development") do
expect(Webpacker.config.cache_manifest?).to be false
end
Expand All @@ -74,13 +74,13 @@
expect(config.compile?).to be false
end

it "returns true in developemnt environemnt" do
it "returns true in development environment" do
with_rails_env("development") do
expect(Webpacker.config.compile?).to be true
end
end

it "returns true in test environemnt" do
it "returns true in test environment" do
with_rails_env("test") do
expect(Webpacker.config.compile?).to be true
end
Expand Down Expand Up @@ -190,7 +190,7 @@
end
end

context "with webpacker config file containing manifext_path entry" do
context "with webpacker config file containing manifest_path entry" do
config = Webpacker::Configuration.new(
root_path: ROOT_PATH,
config_path: Pathname.new(File.expand_path("./webpacker_test_app/config/webpacker_manifest_path.yml", __dir__)),
Expand Down
8 changes: 4 additions & 4 deletions spec/generator_specs/generator_spec.rb
Expand Up @@ -65,8 +65,8 @@
]

Dir.chdir(path_in_the_app("config/webpack")) do
exisiting_files_in_config_webpack_dir = Dir.glob("*")
expect(exisiting_files_in_config_webpack_dir).to eq expected_files
existing_files_in_config_webpack_dir = Dir.glob("*")
expect(existing_files_in_config_webpack_dir).to eq expected_files
end
end

Expand Down Expand Up @@ -94,12 +94,12 @@
expect(actual_content).to match '<%= javascript_pack_tag "application" %>'
end

it "updates `bin/setup" do
it "updates `bin/setup`" do
setup_file_content = read(path_in_the_app("bin/setup"))
expect(setup_file_content).to match %r(^\s*system!\(['"]bin/yarn['"]\))
end

it "adds relevant shakapacker version in package.json depending on gem version," do
it "adds relevant shakapacker version in package.json depending on gem version" do
npm_version = Shakapacker::Utils::VersionSyntaxConverter.new.rubygem_to_npm(Shakapacker::VERSION)

actual_content = read(path_in_the_app("package.json"))
Expand Down
4 changes: 2 additions & 2 deletions spec/shakapacker/compiler_spec.rb
Expand Up @@ -26,7 +26,7 @@
allow(Shakapacker.compiler).to receive(:strategy).and_return(mocked_strategy)

status = OpenStruct.new(success?: true)
allow(Open3).to receive(:capture3).and_return([:sterr, :stdout, status])
allow(Open3).to receive(:capture3).and_return([:stderr, :stdout, status])

expect(Shakapacker.compiler.compile).to be true
expect(mocked_strategy).to have_received(:after_compile_hook)
Expand All @@ -40,7 +40,7 @@
allow(Shakapacker.compiler).to receive(:strategy).and_return(mocked_strategy)

status = OpenStruct.new(success?: false)
allow(Open3).to receive(:capture3).and_return([:sterr, :stdout, status])
allow(Open3).to receive(:capture3).and_return([:stderr, :stdout, status])

expect(Shakapacker.compiler.compile).to be false
expect(mocked_strategy).to have_received(:after_compile_hook)
Expand Down
8 changes: 4 additions & 4 deletions spec/shakapacker/configuration_spec.rb
Expand Up @@ -56,7 +56,7 @@
expect(config.cache_manifest?).to be true
end

it "returns false in developemnt environemnt" do
it "returns false in development environment" do
with_rails_env("development") do
expect(Shakapacker.config.cache_manifest?).to be false
end
Expand All @@ -74,13 +74,13 @@
expect(config.compile?).to be false
end

it "returns true in developemnt environemnt" do
it "returns true in development environment" do
with_rails_env("development") do
expect(Shakapacker.config.compile?).to be true
end
end

it "returns true in test environemnt" do
it "returns true in test environment" do
with_rails_env("test") do
expect(Shakapacker.config.compile?).to be true
end
Expand Down Expand Up @@ -189,7 +189,7 @@
end
end

context "with shakapacker config file containing manifext_path entry" do
context "with shakapacker config file containing manifest_path entry" do
config = Shakapacker::Configuration.new(
root_path: ROOT_PATH,
config_path: Pathname.new(File.expand_path("./test_app/config/shakapacker_manifest_path.yml", __dir__)),
Expand Down
2 changes: 1 addition & 1 deletion spec/shakapacker/rake_tasks_spec.rb
Expand Up @@ -44,7 +44,7 @@ def with_temporary_file(file_name, &block)
Dir.chdir(TEST_APP_PATH)
end

context "with existing `./bin/shapapacker` and `./bin/shapapacker-dev-server`" do
context "with existing `./bin/shakapacker` and `./bin/shakapacker-dev-server`" do
it "passes" do
expect { system("bundle exec rake shakapacker:check_binstubs") }.to output("").to_stdout_from_any_process
end
Expand Down

0 comments on commit bdf8366

Please sign in to comment.