Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
86b489e3
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,发现更多精彩内容 >>
提交
86b489e3
编写于
1月 09, 2019
作者:
J
Javan Makhmali
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move all npm packages to @rails scope
Fixes #33083
上级
7aaf9b80
变更
21
显示空白变更内容
内联
并排
Showing
21 changed file
with
48 addition
and
53 deletion
+48
-53
RELEASING_RAILS.md
RELEASING_RAILS.md
+8
-7
actioncable/README.md
actioncable/README.md
+3
-3
actioncable/lib/rails/generators/channel/templates/javascript/consumer.js.tt
...ls/generators/channel/templates/javascript/consumer.js.tt
+1
-1
actioncable/package.json
actioncable/package.json
+1
-1
actiontext/app/javascript/actiontext/attachment_upload.js
actiontext/app/javascript/actiontext/attachment_upload.js
+1
-1
actiontext/lib/templates/installer.rb
actiontext/lib/templates/installer.rb
+3
-4
actiontext/package.json
actiontext/package.json
+3
-3
actiontext/test/dummy/app/javascript/packs/application.js
actiontext/test/dummy/app/javascript/packs/application.js
+1
-1
actiontext/yarn.lock
actiontext/yarn.lock
+0
-11
actionview/app/assets/javascripts/README.md
actionview/app/assets/javascripts/README.md
+5
-5
actionview/package.json
actionview/package.json
+1
-1
activestorage/README.md
activestorage/README.md
+1
-1
activestorage/package.json
activestorage/package.json
+1
-1
guides/source/action_cable_overview.md
guides/source/action_cable_overview.md
+1
-1
guides/source/active_storage_overview.md
guides/source/active_storage_overview.md
+3
-3
package.json
package.json
+1
-0
railties/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js
...s/rails/app/templates/app/javascript/channels/consumer.js
+1
-1
railties/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt
...ails/app/templates/app/javascript/packs/application.js.tt
+2
-2
railties/lib/rails/generators/rails/app/templates/package.json.tt
.../lib/rails/generators/rails/app/templates/package.json.tt
+4
-4
railties/test/generators/shared_generator_tests.rb
railties/test/generators/shared_generator_tests.rb
+2
-2
yarn.lock
yarn.lock
+5
-0
未找到文件。
RELEASING_RAILS.md
浏览文件 @
86b489e3
...
...
@@ -109,13 +109,14 @@ browser.
This will stop you from looking silly when you push an RC to rubygems.org and
then realize it is broken.
### Release to RubyGems and NPM.
IMPORTANT: The Action Cable client and Action View's UJS adapter are released
as NPM packages, so you must have Node.js installed, have an NPM account
(npmjs.com), and be a package owner for
`actioncable`
and
`rails-ujs`
(you can
check this via
`npm owner ls actioncable`
and
`npm owner ls rails-ujs`
) in
order to do a full release. Do not release until you're set up with NPM!
### Release to RubyGems and npm.
IMPORTANT: Several gems have JavaScript components that are released as npm
packages, so you must have Node.js installed, have an npm account (npmjs.com),
and be a package owner for
`@rails/actioncable`
,
`@rails/actiontext`
,
`@rails/activestorage`
, and
`@rails/ujs`
. You can check this by making sure your
npm user (
`npm whoami`
) is listed as an owner (
`npm owner ls <pkg>`
) of each
package. Do not release until you're set up with npm!
The release task will sign the release tag. If you haven't got commit signing
set up, use https://git-scm.com/book/tr/v2/Git-Tools-Signing-Your-Work as a
...
...
actioncable/README.md
浏览文件 @
86b489e3
...
...
@@ -504,7 +504,7 @@ WebSocket functionality.
### Installation
```
npm install actioncable --save
npm install
@rails/
actioncable --save
```
### Usage
...
...
@@ -516,7 +516,7 @@ provided.
In JavaScript...
```
javascript
ActionCable
=
require
(
'
actioncable
'
)
ActionCable
=
require
(
'
@rails/
actioncable
'
)
var
cable
=
ActionCable
.
createConsumer
(
'
wss://RAILS-API-PATH.com/cable
'
)
...
...
@@ -528,7 +528,7 @@ cable.subscriptions.create('AppearanceChannel', {
and in CoffeeScript...
```
coffeescript
ActionCable
=
require
(
'actioncable'
)
ActionCable
=
require
(
'
@rails/
actioncable'
)
cable
=
ActionCable
.
createConsumer
(
'wss://RAILS-API-PATH.com/cable'
)
...
...
actioncable/lib/rails/generators/channel/templates/javascript/consumer.js.tt
浏览文件 @
86b489e3
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
import ActionCable from "actioncable"
import ActionCable from "
@rails/
actioncable"
export default ActionCable.createConsumer()
actioncable/package.json
浏览文件 @
86b489e3
{
"name"
:
"actioncable"
,
"name"
:
"
@rails/
actioncable"
,
"version"
:
"6.0.0-alpha"
,
"description"
:
"WebSocket framework for Ruby on Rails."
,
"main"
:
"app/assets/javascripts/action_cable.js"
,
...
...
actiontext/app/javascript/actiontext/attachment_upload.js
浏览文件 @
86b489e3
import
{
DirectUpload
}
from
"
activestorage
"
import
{
DirectUpload
}
from
"
@rails/
activestorage
"
export
class
AttachmentUpload
{
constructor
(
attachment
,
element
)
{
...
...
actiontext/lib/templates/installer.rb
浏览文件 @
86b489e3
...
...
@@ -8,15 +8,14 @@
copy_file
"
#{
__dir__
}
/../../app/views/active_storage/blobs/_blob.html.erb"
,
"app/views/active_storage/blobs/_blob.html.erb"
# FIXME: Replace with release version on release
say
"Installing JavaScript dependency"
run
"yarn add
https://github.com/
rails/actiontext"
run
"yarn add
@
rails/actiontext"
APPLICATION_PACK_PATH
=
"app/javascript/packs/application.js"
if
File
.
exist?
(
APPLICATION_PACK_PATH
)
&&
File
.
read
(
APPLICATION_PACK_PATH
)
!~
/import "actiontext"/
if
File
.
exist?
(
APPLICATION_PACK_PATH
)
&&
File
.
read
(
APPLICATION_PACK_PATH
)
!~
/import "
@rails\/
actiontext"/
say
"Adding import to default JavaScript pack"
append_to_file
APPLICATION_PACK_PATH
,
<<-
EOS
import "actiontext"
import "
@rails/
actiontext"
EOS
end
actiontext/package.json
浏览文件 @
86b489e3
{
"name"
:
"actiontext"
,
"name"
:
"
@rails/
actiontext"
,
"version"
:
"6.0.0-alpha"
,
"description"
:
"Edit and display rich text in Rails applications"
,
"main"
:
"app/javascript/actiontext/index.js"
,
...
...
@@ -21,7 +21,7 @@
],
"license"
:
"MIT"
,
"dependencies"
:
{
"trix"
:
"
>=
1.0.0"
,
"
activestorage"
:
"
6.0.0-alpha"
"trix"
:
"
^
1.0.0"
,
"
@rails/activestorage"
:
"^
6.0.0-alpha"
}
}
actiontext/test/dummy/app/javascript/packs/application.js
浏览文件 @
86b489e3
import
"
actiontext
"
import
"
@rails/
actiontext
"
actiontext/yarn.lock
已删除
100644 → 0
浏览文件 @
7aaf9b80
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"activestorage@>= 5.2.0-rc1":
version "5.2.0-rc1"
resolved "https://registry.yarnpkg.com/activestorage/-/activestorage-5.2.0-rc1.tgz#79898996eceb0f13575eff41fb109051fbfa49b0"
trix@^0.11.1:
version "0.11.1"
resolved "https://registry.yarnpkg.com/trix/-/trix-0.11.1.tgz#ffe54f2757c2c2385b8424fd5c5d2ab712a09acc"
actionview/app/assets/javascripts/README.md
浏览文件 @
86b489e3
...
...
@@ -17,11 +17,11 @@ Note that the `data` attributes this library adds are a feature of HTML5. If you
### NPM
npm install
rails-
ujs --save
npm install
@rails/
ujs --save
### Yarn
yarn add
rails-
ujs
yarn add
@rails/
ujs
Ensure that
`.yarnclean`
does not include
`assets`
if you use
[
yarn autoclean
](
https://yarnpkg.com/lang/en/docs/cli/autoclean/
)
.
...
...
@@ -40,7 +40,7 @@ In a conventional Rails application that uses the asset pipeline, require `rails
If you're using the Webpacker gem or some other JavaScript bundler, add the following to your main JS file:
```
javascript
import
Rails
from
'
rails-ujs
'
;
import
Rails
from
"
@rails/ujs
"
Rails
.
start
()
```
...
...
actionview/package.json
浏览文件 @
86b489e3
{
"name"
:
"
rails-
ujs"
,
"name"
:
"
@rails/
ujs"
,
"version"
:
"6.0.0-alpha"
,
"description"
:
"Ruby on Rails unobtrusive scripting adapter"
,
"main"
:
"lib/assets/compiled/rails-ujs.js"
,
...
...
activestorage/README.md
浏览文件 @
86b489e3
...
...
@@ -118,7 +118,7 @@ Active Storage, with its included JavaScript library, supports uploading directl
```
Using the npm package:
```js
import * as ActiveStorage from "activestorage"
import * as ActiveStorage from "
@rails/
activestorage"
ActiveStorage.start()
```
2.
Annotate file inputs with the direct upload URL.
...
...
activestorage/package.json
浏览文件 @
86b489e3
{
"name"
:
"activestorage"
,
"name"
:
"
@rails/
activestorage"
,
"version"
:
"6.0.0-alpha"
,
"description"
:
"Attach cloud and local files in Rails applications"
,
"main"
:
"app/assets/javascripts/activestorage.js"
,
...
...
guides/source/action_cable_overview.md
浏览文件 @
86b489e3
...
...
@@ -151,7 +151,7 @@ established using the following JavaScript, which is generated by default by Rai
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
import
ActionCable
from
"
actioncable
"
import
ActionCable
from
"
@rails/
actioncable
"
export
default
ActionCable
.
createConsumer
()
```
...
...
guides/source/active_storage_overview.md
浏览文件 @
86b489e3
...
...
@@ -489,7 +489,7 @@ directly from the client to the cloud.
Using the npm package:
```js
import * as ActiveStorage from "activestorage"
import * as ActiveStorage from "
@rails/
activestorage"
ActiveStorage.start()
```
...
...
@@ -616,7 +616,7 @@ of choice, instantiate a DirectUpload and call its create method. Create takes
a callback to invoke when the upload completes.
```
js
import
{
DirectUpload
}
from
"
activestorage
"
import
{
DirectUpload
}
from
"
@rails/
activestorage
"
const
input
=
document
.
querySelector
(
'
input[type=file]
'
)
...
...
@@ -664,7 +664,7 @@ will call the object's `directUploadWillStoreFileWithXHR` method. You can then
bind your own progress handler on the XHR.
```
js
import
{
DirectUpload
}
from
"
activestorage
"
import
{
DirectUpload
}
from
"
@rails/
activestorage
"
class
Uploader
{
constructor
(
file
,
url
)
{
...
...
package.json
浏览文件 @
86b489e3
...
...
@@ -2,6 +2,7 @@
"private"
:
true
,
"workspaces"
:
[
"actioncable"
,
"actiontext"
,
"activestorage"
,
"actionview"
,
"tmp/templates/app_template"
,
...
...
railties/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js
浏览文件 @
86b489e3
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
import
ActionCable
from
"
actioncable
"
import
ActionCable
from
"
@rails/
actioncable
"
export
default
ActionCable
.
createConsumer
()
railties/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt
浏览文件 @
86b489e3
...
...
@@ -3,7 +3,7 @@
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
import Rails from "
rails-
ujs"
import Rails from "
@rails/
ujs"
Rails.start()
<%- unless options[:skip_turbolinks] -%>
...
...
@@ -12,7 +12,7 @@ Turbolinks.start()
<%- end -%>
<%- unless skip_active_storage? -%>
import * as ActiveStorage from "activestorage"
import * as ActiveStorage from "
@rails/
activestorage"
ActiveStorage.start()
<%- end -%>
<%- unless options[:skip_action_cable] -%>
...
...
railties/lib/rails/generators/rails/app/templates/package.json.tt
浏览文件 @
86b489e3
...
...
@@ -2,10 +2,10 @@
"name": "<%= app_name %>",
"private": true,
"dependencies": {
"
rails-ujs": ">=5.2.1
"<% unless options[:skip_turbolinks] %>,
"turbolinks": "
5.1.1
"<% end -%><% unless skip_active_storage? %>,
"
activestorage": ">=5.2.1
"<% end -%><% unless options[:skip_action_cable] %>,
"
actioncable": ">=5.2.1
"<% end %>
"
@rails/ujs": "^6.0.0-alpha
"<% unless options[:skip_turbolinks] %>,
"turbolinks": "
^5.2.0
"<% end -%><% unless skip_active_storage? %>,
"
@rails/activestorage": "^6.0.0-alpha
"<% end -%><% unless options[:skip_action_cable] %>,
"
@rails/actioncable": "^6.0.0-alpha
"<% end %>
},
"version": "0.1.0"
}
railties/test/generators/shared_generator_tests.rb
浏览文件 @
86b489e3
...
...
@@ -206,7 +206,7 @@ def test_generator_for_active_storage
unless
generator_class
.
name
==
"Rails::Generators::PluginGenerator"
assert_file
"
#{
application_path
}
/app/javascript/packs/application.js"
do
|
content
|
assert_match
(
/^import \* as ActiveStorage from "activestorage"\nActiveStorage.start\(\)/
,
content
)
assert_match
(
/^import \* as ActiveStorage from "
@rails\/
activestorage"\nActiveStorage.start\(\)/
,
content
)
end
end
...
...
@@ -267,7 +267,7 @@ def test_generator_does_not_generate_active_storage_contents_if_skip_active_reco
assert_file
"
#{
application_path
}
/config/application.rb"
,
/#\s+require\s+["']active_storage\/engine["']/
assert_file
"
#{
application_path
}
/app/javascript/packs/application.js"
do
|
content
|
assert_no_match
(
/^import * as ActiveStorage from "activestorage"\nActiveStorage.start\(\)/
,
content
)
assert_no_match
(
/^import * as ActiveStorage from "
@rails\/
activestorage"\nActiveStorage.start\(\)/
,
content
)
end
assert_file
"
#{
application_path
}
/config/environments/development.rb"
do
|
content
|
...
...
yarn.lock
浏览文件 @
86b489e3
...
...
@@ -5692,6 +5692,11 @@ trim-right@^1.0.1:
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=
trix@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/trix/-/trix-1.0.0.tgz#e9cc98cf6030c908f8d54e317b5b072f927b0c6b"
integrity sha512-feli9QVXe6gzZOCUfpPGpNDURW9jMciIRVQ5gkDudOctcA1oMtI5K/qEbsL2rFCoGl1rSoeRt+HPhIFGyQscKg==
tslib@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录