Skip to content

Commit

Permalink
Rename references in tests from app/packs to app/javascript (shakacod…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdracz authored Apr 4, 2023
1 parent 72ed559 commit 2841d43
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Thus ProvidePlugin manages build-time dependencies to global symbols whereas the

For instance, with [jQuery](https://jquery.com/):
```diff
// app/packs/entrypoints/application.js
// app/javascript/entrypoints/application.js
- import jQuery from 'jquery'
- window.jQuery = jQuery
Expand Down
4 changes: 2 additions & 2 deletions lib/webpacker/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def favicon_pack_tag(name, **options)
# Creates script tags that reference the js chunks from entrypoints when using split chunks API,
# as compiled by webpack per the entries list in package/environments/base.js.
# By default, this list is auto-generated to match everything in
# app/packs/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
# app/javascript/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
# See: https://webpack.js.org/plugins/split-chunks-plugin/
#
# Example:
Expand Down Expand Up @@ -133,7 +133,7 @@ def preload_pack_asset(name, **options)
# Creates link tags that reference the css chunks from entrypoints when using split chunks API,
# as compiled by webpack per the entries list in package/environments/base.js.
# By default, this list is auto-generated to match everything in
# app/packs/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
# app/javascript/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
# See: https://webpack.js.org/plugins/split-chunks-plugin/
#
# Examples:
Expand Down
2 changes: 1 addition & 1 deletion package/__tests__/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ describe('Config', () => {
test('should allow overriding manifestPath', () => {
process.env.WEBPACKER_CONFIG = 'config/webpacker_manifest_path.yml'
const config = require('../config')
expect(config.manifestPath).toEqual(resolve('app/packs/manifest.json'))
expect(config.manifestPath).toEqual(resolve('app/javascript/manifest.json'))
})
})
16 changes: 8 additions & 8 deletions package/environments/__tests__/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Base config', () => {
describe('config', () => {
test('should return entry', () => {
expect(baseConfig.entry.application).toEqual(
resolve('app', 'packs', 'entrypoints', 'application.js')
resolve('app', 'javascript', 'entrypoints', 'application.js')
)
})

Expand All @@ -39,8 +39,8 @@ describe('Base config', () => {
expect(config.nested_entries).toEqual(false)

expect(baseConfig.entry.multi_entry.sort()).toEqual([
resolve('app', 'packs', 'entrypoints', 'multi_entry.css'),
resolve('app', 'packs', 'entrypoints', 'multi_entry.js')
resolve('app', 'javascript', 'entrypoints', 'multi_entry.css'),
resolve('app', 'javascript', 'entrypoints', 'multi_entry.js')
])
expect(baseConfig.entry['generated/something']).toEqual(undefined)
})
Expand All @@ -53,14 +53,14 @@ describe('Base config', () => {
expect(config.nested_entries).toEqual(true)

expect(baseConfig.entry.application).toEqual(
resolve('app', 'packs', 'entrypoints', 'application.js')
resolve('app', 'javascript', 'entrypoints', 'application.js')
)
expect(baseConfig.entry.multi_entry.sort()).toEqual([
resolve('app', 'packs', 'entrypoints', 'multi_entry.css'),
resolve('app', 'packs', 'entrypoints', 'multi_entry.js')
resolve('app', 'javascript', 'entrypoints', 'multi_entry.css'),
resolve('app', 'javascript', 'entrypoints', 'multi_entry.js')
])
expect(baseConfig.entry['generated/something']).toEqual(
resolve('app', 'packs', 'entrypoints', 'generated', 'something.js')
resolve('app', 'javascript', 'entrypoints', 'generated', 'something.js')
)
})

Expand Down Expand Up @@ -91,7 +91,7 @@ describe('Base config', () => {

test('should return default resolve.modules with additions', () => {
expect(baseConfig.resolve.modules).toEqual([
resolve('app', 'packs'),
resolve('app', 'javascript'),
resolve('app/assets'),
resolve('/etc/yarn'),
resolve('some.config.js'),
Expand Down
2 changes: 1 addition & 1 deletion package/rules/__tests__/__utils__/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const createTrackLoader = () => {

const node_modules = path.resolve("node_modules");
const node_modules_included = path.resolve("node_modules/included");
const app_javascript = path.resolve("app/packs");
const app_javascript = path.resolve("app/javascript");

const createInMemoryFs = () => {
const fs = new MemoryFS();
Expand Down
6 changes: 3 additions & 3 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
end

it "#source_path returns correct path" do
source_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/packs").to_s
source_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript").to_s
expect(config.source_path.to_s).to eq source_path
end

it "#source_entry_path returns correct path" do
source_entry_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/packs", "entrypoints").to_s
source_entry_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript", "entrypoints").to_s
expect(config.source_entry_path.to_s).to eq source_entry_path
end

Expand Down Expand Up @@ -195,7 +195,7 @@
)

it "#manifest_path returns correct expected value" do
expected_manifest_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/packs", "manifest.json").to_s
expected_manifest_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript", "manifest.json").to_s
expect(config.manifest_path.to_s).to eq expected_manifest_path
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/mounted_app/test/dummy/config/webpacker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Note: You must restart bin/webpacker-dev-server for changes to take effect

default: &default
source_path: app/packs
source_path: app/javascript
source_entry_path: entrypoints
public_output_path: packs
cache_path: tmp/webpacker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/packs and only use these pack files to reference
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
Expand Down
2 changes: 1 addition & 1 deletion spec/test_app/config/webpacker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Note: You must restart bin/webpacker-dev-server for changes to take effect

default: &default
source_path: app/packs
source_path: app/javascript
source_entry_path: entrypoints
nested_entries: false
public_root_path: public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Note: You must restart bin/webpacker-dev-server for changes to take effect

default: &default
source_path: app/packs
source_path: app/javascript
source_entry_path: entrypoints
nested_entries: true
public_root_path: public
Expand Down
4 changes: 2 additions & 2 deletions spec/test_app/config/webpacker_manifest_path.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Note: You must restart bin/webpack-dev-server for changes to take effect

default: &default
source_path: app/packs
source_path: app/javascript
source_entry_path: entrypoints
public_root_path: public
public_output_path: packs
cache_path: tmp/webpacker
webpack_compile_output: false

# Location for manifest.json, defaults to {public_output_path}/manifest.json if unset
manifest_path: app/packs/manifest.json
manifest_path: app/javascript/manifest.json

# Additional paths webpack should look up modules
# ['app/assets', 'engine/foo/app/assets']
Expand Down
2 changes: 1 addition & 1 deletion spec/test_app/config/webpacker_nested_entries.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Note: You must restart bin/webpacker-dev-server for changes to take effect

default: &default
source_path: app/packs
source_path: app/javascript
source_entry_path: entrypoints
nested_entries: true
public_root_path: public
Expand Down
2 changes: 1 addition & 1 deletion spec/test_app/config/webpacker_other_location.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Note: You must restart bin/webpacker-dev-server for changes to take effect

default: &default
source_path: app/packs
source_path: app/javascript
source_entry_path: entrypoints
public_root_path: public
public_output_path: packs
Expand Down

0 comments on commit 2841d43

Please sign in to comment.