Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
8e9e9439
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8e9e9439
编写于
2月 21, 2017
作者:
D
David Heinemeier Hansson
提交者:
GitHub
2月 21, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert back to the original of using package.json in the root of the project (#28093)
上级
1d8466c3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
13 deletion
+13
-13
railties/CHANGELOG.md
railties/CHANGELOG.md
+1
-1
railties/lib/rails/generators/rails/app/app_generator.rb
railties/lib/rails/generators/rails/app/app_generator.rb
+2
-2
railties/lib/rails/generators/rails/app/templates/bin/yarn
railties/lib/rails/generators/rails/app/templates/bin/yarn
+1
-1
railties/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt
...tors/rails/app/templates/config/initializers/assets.rb.tt
+1
-1
railties/lib/rails/generators/rails/app/templates/gitignore
railties/lib/rails/generators/rails/app/templates/gitignore
+2
-2
railties/test/generators/api_app_generator_test.rb
railties/test/generators/api_app_generator_test.rb
+1
-1
railties/test/generators/app_generator_test.rb
railties/test/generators/app_generator_test.rb
+5
-5
未找到文件。
railties/CHANGELOG.md
浏览文件 @
8e9e9439
...
...
@@ -68,7 +68,7 @@
*DHH*
*
Add Yarn support in new apps with a yarn binstub and
vendor/
package.json. Skippable via --skip-yarn option.
*
Add Yarn support in new apps with a yarn binstub and package.json. Skippable via --skip-yarn option.
*Liceth Ovalles*, *Guillermo Iguaran*, *DHH*
...
...
railties/lib/rails/generators/rails/app/app_generator.rb
浏览文件 @
8e9e9439
...
...
@@ -166,7 +166,7 @@ def vendor
empty_directory_with_keep_file
"vendor"
unless
options
[
:skip_yarn
]
template
"package.json"
,
"vendor/package.json"
template
"package.json"
end
end
end
...
...
@@ -280,7 +280,7 @@ def create_vendor_files
build
(
:vendor
)
if
options
[
:skip_yarn
]
remove_file
"
vendor/
package.json"
remove_file
"package.json"
end
end
...
...
railties/lib/rails/generators/rails/app/templates/bin/yarn
浏览文件 @
8e9e9439
VENDOR_PATH = File.expand_path('..
/vendor
', __dir__)
VENDOR_PATH = File.expand_path('..', __dir__)
Dir.chdir(VENDOR_PATH) do
begin
exec "yarnpkg #{ARGV.join(" ")}"
...
...
railties/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt
浏览文件 @
8e9e9439
...
...
@@ -7,7 +7,7 @@ Rails.application.config.assets.version = '1.0'
# Rails.application.config.assets.paths << Emoji.images_path
<%- unless options[:skip_yarn] -%>
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('
vendor/
node_modules')
Rails.application.config.assets.paths << Rails.root.join('node_modules')
<%- end -%>
# Precompile additional assets.
...
...
railties/lib/rails/generators/rails/app/templates/gitignore
浏览文件 @
8e9e9439
...
...
@@ -22,8 +22,8 @@
<% end -%>
<% unless options[:skip_yarn] -%>
/
vendor/
node_modules
/
vendor/
yarn-error.log
/node_modules
/yarn-error.log
<% end -%>
.byebug_history
railties/test/generators/api_app_generator_test.rb
浏览文件 @
8e9e9439
...
...
@@ -117,7 +117,7 @@ def skipped_files
public/apple-touch-icon-precomposed.png
public/apple-touch-icon.png
public/favicon.icon
vendor/
package.json
package.json
)
end
end
railties/test/generators/app_generator_test.rb
浏览文件 @
8e9e9439
...
...
@@ -422,7 +422,7 @@ def test_generator_if_skip_sprockets_is_given
def
test_generator_if_skip_yarn_is_given
run_generator
[
destination_root
,
"--skip-yarn"
]
assert_no_file
"
vendor/
package.json"
assert_no_file
"package.json"
assert_no_file
"bin/yarn"
end
...
...
@@ -497,21 +497,21 @@ def test_coffeescript_is_skipped_if_required
def
test_generator_for_yarn
run_generator
([
destination_root
])
assert_file
"
vendor/
package.json"
,
/dependencies/
assert_file
"package.json"
,
/dependencies/
assert_file
"config/initializers/assets.rb"
,
/node_modules/
end
def
test_generator_for_yarn_skipped
run_generator
([
destination_root
,
"--skip-yarn"
])
assert_no_file
"
vendor/
package.json"
assert_no_file
"package.json"
assert_file
"config/initializers/assets.rb"
do
|
content
|
assert_no_match
(
/node_modules/
,
content
)
end
assert_file
".gitignore"
do
|
content
|
assert_no_match
(
/
vendor\/
node_modules/
,
content
)
assert_no_match
(
/
vendor\/
yarn-error\.log/
,
content
)
assert_no_match
(
/node_modules/
,
content
)
assert_no_match
(
/yarn-error\.log/
,
content
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录