Skip to content

Commit 984af13

Browse files
committed
Issue #2484623 by quietone, anavarre, nod_, Manuel Garcia, rteijeiro, kostyashupenko, ankithashetty, smustgrave, jeroent, xjm, droplet, cilefen, travis-bradbury, catch: Move all JS in modules to a js/ folder
1 parent df8a860 commit 984af13

39 files changed

+161
-24
lines changed

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ assets/vendor/**/*
22
node_modules/**/*
33
**/js_test_files/**/*
44
**/build/**/*
5-
modules/locale/tests/locale_test.js
5+
modules/locale/tests/js/locale_test.js
66
misc/jquery.form.js
77

88
# Ignore deliberately malformed YAML files.

modules/comment/comment.libraries.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
drupal.comment:
22
version: VERSION
33
js:
4-
comment-entity-form.js: {}
4+
js/comment-entity-form.js: {}
55
dependencies:
66
- core/jquery
77
- core/drupal
88
- core/drupal.form
9+
moved_files:
10+
comment/drupal.comment:
11+
deprecation_version: drupal:11.1.0
12+
removed_version: drupal:12.0.0
13+
deprecation_link: https://www.drupal.org/node/3471539
14+
js:
15+
comment-entity-form.js: 'js/comment-entity-form.js'
916

1017
drupal.comment-by-viewer:
1118
version: VERSION
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
drupal.content_translation.admin:
22
version: VERSION
33
js:
4-
content_translation.admin.js: {}
4+
js/content_translation.admin.js: {}
55
css:
66
theme:
77
css/content_translation.admin.css: {}
88
dependencies:
99
- core/jquery
1010
- core/drupal
1111
- core/once
12+
moved_files:
13+
content_translation/content_translation.admin.js:
14+
deprecation_version: drupal:11.1.0
15+
removed_version: drupal:12.0.0
16+
deprecation_link: https://www.drupal.org/node/3471539
17+
js:
18+
content_translation_admin.js: 'js/content_translation.admin.js'

modules/file/file.libraries.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
drupal.file:
22
version: VERSION
33
js:
4-
file.js: {}
4+
js/file.js: {}
55
dependencies:
66
- core/jquery
77
- core/once
88
- core/drupal
99
- core/drupalSettings
10+
moved_files:
11+
file/file.js:
12+
deprecation_version: drupal:11.1.0
13+
removed_version: drupal:12.0.0
14+
deprecation_link: https://www.drupal.org/node/3471539
15+
js:
16+
file.js: 'js/file.js'
1017

1118
drupal.file-icon:
1219
version: VERSION
File renamed without changes.

modules/filter/filter.libraries.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
drupal.filter.admin:
22
version: VERSION
33
js:
4-
filter.admin.js: {}
4+
js/filter.admin.js: {}
55
dependencies:
66
- core/jquery
77
- core/drupal
88
- core/once
99
- core/drupal.form
10+
moved_files:
11+
filter/filter.admin.js:
12+
deprecation_version: drupal:11.1.0
13+
removed_version: drupal:12.0.0
14+
deprecation_link: https://www.drupal.org/node/3471539
15+
js:
16+
filter.admin.js: 'js/filter.admin.js'
1017

1118
drupal.filter:
1219
version: VERSION
1320
js:
14-
filter.js: {}
21+
js/filter.js: {}
1522
dependencies:
1623
- core/jquery
1724
- core/drupal
1825
- core/once
26+
moved_files:
27+
filter/filter.js:
28+
deprecation_version: drupal:11.1.0
29+
removed_version: drupal:12.0.0
30+
deprecation_link: https://www.drupal.org/node/3471539
31+
js:
32+
filter.js: 'js/filter.js'
1933

2034
caption:
2135
version: VERSION
File renamed without changes.
File renamed without changes.
File renamed without changes.
+13-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
drupal.language.admin:
22
version: VERSION
33
js:
4-
language.admin.js: {}
4+
js/language.admin.js: {}
55
css:
66
theme:
77
css/language.admin.css: {}
88
dependencies:
99
- core/jquery
1010
- core/drupal
1111
- core/once
12+
13+
moved_to:
14+
version: VERSION
15+
js:
16+
js/language.admin.js: {}
17+
moved_files:
18+
language/language.admin.js:
19+
deprecation_version: drupal:11.1.0
20+
removed_version: drupal:12.0.0
21+
deprecation_link: https://www.drupal.org/node/3471539
22+
js:
23+
language.admin.js: 'js/language.admin.js'
File renamed without changes.
File renamed without changes.

modules/locale/locale.libraries.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
drupal.locale.admin:
22
version: VERSION
33
js:
4-
locale.admin.js: {}
4+
js/locale.admin.js: {}
55
css:
66
component:
77
css/locale.admin.css: {}
@@ -10,6 +10,13 @@ drupal.locale.admin:
1010
- core/drupal
1111
- core/drupal.form
1212
- core/once
13+
moved_files:
14+
locale/locale.admin.js:
15+
deprecation_version: drupal:11.1.0
16+
removed_version: drupal:12.0.0
17+
deprecation_link: https://www.drupal.org/node/3471539
18+
js:
19+
locale.admin.js: 'js/locale.admin.js'
1320

1421
translations:
1522
# No sensible version can be specified, since the translations may change at
File renamed without changes.

modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testFileParsing(): void {
3535
// respect to optional whitespace, line breaks, etc.
3636
// - We test locale_test.js, because that is the one that contains a
3737
// variety of whitespace styles.
38-
$files[] = __DIR__ . '/../../locale_test.js';
38+
$files[] = __DIR__ . '/../../js/locale_test.js';
3939

4040
foreach ($files as $filename) {
4141
// Parse the file to look for source strings.
@@ -149,7 +149,7 @@ public function testLocaleTranslationJsDependencies(): void {
149149
->getStrings([
150150
'source' => 'Show description',
151151
'type' => 'javascript',
152-
'name' => 'core/modules/locale/locale.admin.js',
152+
'name' => 'core/modules/locale/js/locale.admin.js',
153153
]);
154154
$string = $strings[0];
155155

File renamed without changes.
File renamed without changes.

modules/menu_ui/menu_ui.libraries.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
drupal.menu_ui:
22
version: VERSION
33
js:
4-
menu_ui.js: {}
4+
js/menu_ui.js: {}
55
dependencies:
66
- core/jquery
77
- core/drupal
88
- core/drupal.form
9+
moved_files:
10+
menu_uit/menu_ui.js:
11+
deprecation_version: drupal:11.1.0
12+
removed_version: drupal:12.0.0
13+
deprecation_link: https://www.drupal.org/node/3471539
14+
js:
15+
menu_ui.js: 'js/menu_ui.js'
916

1017
drupal.menu_ui.admin:
1118
version: VERSION
1219
js:
13-
menu_ui.admin.js: {}
20+
js/menu_ui.admin.js: {}
1421
dependencies:
1522
- core/jquery
1623
- core/drupal
24+
moved_files:
25+
menu_uit/menu_ui.admin.js:
26+
deprecation_version: drupal:11.1.0
27+
removed_version: drupal:12.0.0
28+
deprecation_link: https://www.drupal.org/node/3471539
29+
js:
30+
menu_ui.admin.js: 'js/menu_ui.admin.js'
1731

1832
drupal.menu_ui.adminforms:
1933
version: VERSION
File renamed without changes.
File renamed without changes.
File renamed without changes.

modules/node/node.libraries.yml

+24-3
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,54 @@ drupal.node:
44
layout:
55
css/node.module.css: {}
66
js:
7-
node.js: {}
7+
js/node.js: {}
88
dependencies:
99
- core/drupal.entity-form
1010
- core/drupalSettings
11+
moved_files:
12+
node/node.js:
13+
deprecation_version: drupal:11.1.0
14+
removed_version: drupal:12.0.0
15+
deprecation_link: https://www.drupal.org/node/3471539
16+
js:
17+
node.js: 'js/node.js'
1118

1219
drupal.node.preview:
1320
version: VERSION
1421
css:
1522
theme:
1623
css/node.preview.css: {}
1724
js:
18-
node.preview.js: {}
25+
js/node.preview.js: {}
1926
dependencies:
2027
- core/jquery
2128
- core/once
2229
- core/drupal
2330
- core/drupal.dialog
2431
- core/drupal.form
32+
moved_files:
33+
node/node.preview.js:
34+
deprecation_version: drupal:11.1.0
35+
removed_version: drupal:12.0.0
36+
deprecation_link: https://www.drupal.org/node/3471539
37+
js:
38+
node.preview.js: 'js/node.preview.js'
2539

2640
drupal.content_types:
2741
version: VERSION
2842
js:
29-
content_types.js: {}
43+
js/content_types.js: {}
3044
dependencies:
3145
- core/jquery
3246
- core/drupal
3347
- core/drupal.form
48+
moved_files:
49+
node/content_types.js:
50+
deprecation_version: drupal:11.1.0
51+
removed_version: drupal:12.0.0
52+
deprecation_link: https://www.drupal.org/node/3471539
53+
js:
54+
content_types.js: 'js/content_types.js'
3455

3556
form:
3657
version: VERSION
File renamed without changes.

modules/path/path.libraries.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
drupal.path:
22
version: VERSION
33
js:
4-
path.js: {}
4+
js/path.js: {}
55
dependencies:
66
- core/jquery
77
- core/drupal
88
- core/drupal.form
9+
moved_files:
10+
path/path.js:
11+
deprecation_version: drupal:11.1.0
12+
removed_version: drupal:12.0.0
13+
deprecation_link: https://www.drupal.org/node/3471539
14+
js:
15+
path.js: 'js/path.js'
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<div>file_url: {{ file_url('core/modules/system/tests/modules/twig_theme_test/twig_theme_test.js') }}</div>
1+
<div>file_url: {{ file_url('core/modules/system/tests/modules/twig_theme_test/js/twig_theme_test.js') }}</div>
22
<div>file_url: {{ file_url(undefined_variable) }}</div>

modules/system/tests/src/Functional/Theme/EngineTwigTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function testTwigFileUrls(): void {
138138
$this->drupalGet('/twig-theme-test/file-url');
139139
/** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */
140140
$file_url_generator = \Drupal::service('file_url_generator');
141-
$filepath = $file_url_generator->generateString('core/modules/system/tests/modules/twig_theme_test/twig_theme_test.js');
141+
$filepath = $file_url_generator->generateString('core/modules/system/tests/modules/twig_theme_test/js/twig_theme_test.js');
142142
$this->assertSession()->responseContains('<div>file_url: ' . $filepath . '</div>');
143143
}
144144

File renamed without changes.
+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
drupal.taxonomy:
22
version: VERSION
33
js:
4-
taxonomy.js: {}
4+
js/taxonomy.js: {}
55
css:
66
component:
77
css/taxonomy.theme.css: {}
@@ -10,3 +10,10 @@ drupal.taxonomy:
1010
- core/drupal
1111
- core/drupalSettings
1212
- core/drupal.tabledrag
13+
moved_files:
14+
taxonomy/taxonomy.js:
15+
deprecation_version: drupal:11.1.0
16+
removed_version: drupal:12.0.0
17+
deprecation_link: https://www.drupal.org/node/3471539
18+
js:
19+
taxonomy.js: js/taxonomy.js'
File renamed without changes.

modules/text/text.libraries.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
drupal.text:
22
version: VERSION
33
js:
4-
text.js: {}
4+
js/text.js: {}
55
dependencies:
66
- core/jquery
77
- core/once
88
- core/drupal
9+
moved_files:
10+
text/text.js:
11+
deprecation_version: drupal:11.1.0
12+
removed_version: drupal:12.0.0
13+
deprecation_link: https://www.drupal.org/node/3471539
14+
js:
15+
text.js: 'js/text.js'
916

1017
drupal.text-icon:
1118
version: VERSION
File renamed without changes.
File renamed without changes.
File renamed without changes.

modules/user/user.libraries.yml

+23-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
drupal.user:
22
version: VERSION
33
js:
4-
user.js: {}
5-
user.theme.js: {}
4+
js/user.js: {}
5+
js/user.theme.js: {}
66
css:
77
component:
88
css/user.module.css: {}
99
dependencies:
1010
- core/jquery
1111
- core/drupal
1212
- core/once
13+
moved_files:
14+
user/user.js:
15+
deprecation_version: drupal:11.1.0
16+
removed_version: drupal:12.0.0
17+
deprecation_link: https://www.drupal.org/node/3471539
18+
js:
19+
user.js: 'js/user.js'
20+
user/user.theme.js:
21+
deprecation_version: drupal:11.1.0
22+
removed_version: drupal:12.0.0
23+
deprecation_link: https://www.drupal.org/node/3471539
24+
js:
25+
user.theme.js: 'js/user.theme.js'
1326

1427
drupal.user.admin:
1528
version: VERSION
@@ -20,7 +33,7 @@ drupal.user.admin:
2033
drupal.user.permissions:
2134
version: VERSION
2235
js:
23-
user.permissions.js: {}
36+
js/user.permissions.js: {}
2437
dependencies:
2538
- core/jquery
2639
- core/once
@@ -30,6 +43,13 @@ drupal.user.permissions:
3043
- core/drupal.checkbox
3144
- core/drupal.debounce
3245
- core/drupal.announce
46+
moved_files:
47+
user/user.permissions.js:
48+
deprecation_version: drupal:11.1.0
49+
removed_version: drupal:12.0.0
50+
deprecation_link: https://www.drupal.org/node/3471539
51+
js:
52+
user.permissions.js: 'js/user.permissions.js'
3353

3454
drupal.user.icons:
3555
version: VERSION

0 commit comments

Comments
 (0)