Skip to content

Commit 561a4a3

Browse files
committed
[WIP] All Package directory restructure
1 parent 2e0dc46 commit 561a4a3

File tree

337 files changed

+489
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+489
-350
lines changed

.github/workflows/test-turbo.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ jobs:
7777
${{ runner.os }}-yarn-
7878
7979
- name: Install JavaScript dependencies
80-
working-directory: src/Turbo/Tests/app
80+
working-directory: src/Turbo/tests/app
8181
run: yarn install
8282

8383
- name: Build JavaScript
84-
working-directory: src/Turbo/Tests/app
84+
working-directory: src/Turbo/tests/app
8585
run: yarn build
8686

8787
- name: Create DB
88-
working-directory: src/Turbo/Tests/app
88+
working-directory: src/Turbo/tests/app
8989
run: php public/index.php doctrine:schema:create
9090

9191
- name: Run tests
@@ -139,15 +139,15 @@ jobs:
139139
${{ runner.os }}-yarn-
140140
141141
- name: Install JavaScript dependencies
142-
working-directory: src/Turbo/Tests/app
142+
working-directory: src/Turbo/tests/app
143143
run: yarn install
144144

145145
- name: Build JavaScript
146-
working-directory: src/Turbo/Tests/app
146+
working-directory: src/Turbo/tests/app
147147
run: yarn build
148148

149149
- name: Create DB
150-
working-directory: src/Turbo/Tests/app
150+
working-directory: src/Turbo/tests/app
151151
run: php public/index.php doctrine:schema:create
152152

153153
- name: Run tests

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"private": true,
33
"workspaces": [
4-
"src/**/Resources/assets",
54
"src/**/assets"
65
],
76
"scripts": {
87
"build": "yarn rollup -c",
98
"test": "yarn workspaces run jest",
109
"lint": "yarn workspaces run eslint src test",
11-
"format": "prettier src/*/Resources/assets/src/*.ts src/*/Resources/assets/test/*.js {,src/*/}*.{json,md} --write",
10+
"format": "prettier src/*/assets/src/*.ts src/*/assets/test/*.js {,src/*/}*.{json,md} --write",
1211
"check-lint": "yarn lint --no-fix",
1312
"check-format": "yarn format --no-write --check"
1413
},
@@ -61,7 +60,6 @@
6160
"overrides": [
6261
{
6362
"files": [
64-
"src/*/Resources/assets/test/**/*.ts",
6563
"src/*/assets/test/**/*.ts"
6664
],
6765
"extends": [

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const wildcardExternalsPlugin = (peerDependencies) => ({
3838
}
3939
});
4040

41-
const files = glob.sync("src/**/assets/src/*controller.ts");
41+
const files = glob.sync("src/React/assets/src/*controller.ts");
4242
const packages = files.map((file) => {
4343
const absolutePath = path.join(__dirname, file);
4444
const packageData = require(pkgUp.sync({ cwd: absolutePath }));

src/Autocomplete/.symfony.bundle.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
branches: ["2.x"]
22
maintained_branches: ["2.x"]
3-
doc_dir: "src/Resources/doc"
3+
doc_dir: "doc"

src/Autocomplete/CHANGELOG.md

Lines changed: 12 additions & 1 deletion

src/Autocomplete/assets/src/controller.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class extends Controller {
1010
noMoreResultsText: String,
1111
minCharacters: Number,
1212
tomSelectOptions: Object,
13-
}
13+
};
1414

1515
readonly urlValue: string;
1616
readonly optionsAsHtmlValue: boolean;
@@ -53,7 +53,7 @@ export default class extends Controller {
5353
}
5454

5555
#getCommonConfig(): Partial<TomSettings> {
56-
const plugins: any = {}
56+
const plugins: any = {};
5757

5858
// multiple values excepted if this is NOT A select (i.e. input) or a multiple select
5959
const isMultiple = !this.selectElement || this.selectElement.multiple;
@@ -80,7 +80,7 @@ export default class extends Controller {
8080
onItemAdd: () => {
8181
this.tomSelect.setTextboxValue('');
8282
},
83-
onInitialize: function() {
83+
onInitialize: function () {
8484
const tomSelect = this as any;
8585
tomSelect.wrapper.setAttribute('data-live-ignore', '');
8686
},
@@ -114,12 +114,12 @@ export default class extends Controller {
114114
};
115115
},
116116
render: {
117-
item: function(item: any) {
117+
item: function (item: any) {
118118
return `<div>${item.text}</div>`;
119119
},
120-
option: function(item: any) {
120+
option: function (item: any) {
121121
return `<div>${item.text}</div>`;
122-
}
122+
},
123123
},
124124
});
125125

@@ -139,9 +139,12 @@ export default class extends Controller {
139139
load: function (query: string, callback: (results?: any) => void) {
140140
const url = this.getUrl(query);
141141
fetch(url)
142-
.then(response => response.json())
142+
.then((response) => response.json())
143143
// important: next_url must be set before invoking callback()
144-
.then(json => { this.setNextUrl(query, json.next_page); callback(json.results) })
144+
.then((json) => {
145+
this.setNextUrl(query, json.next_page);
146+
callback(json.results);
147+
})
145148
.catch(() => callback());
146149
},
147150
shouldLoad: function (query: string) {
@@ -150,16 +153,16 @@ export default class extends Controller {
150153
return query.length >= minLength;
151154
},
152155
// avoid extra filtering after results are returned
153-
score: function(search: string) {
154-
return function(item: any) {
156+
score: function (search: string) {
157+
return function (item: any) {
155158
return 1;
156159
};
157160
},
158161
render: {
159-
option: function(item: any) {
162+
option: function (item: any) {
160163
return `<div>${item.text}</div>`;
161164
},
162-
item: function(item: any) {
165+
item: function (item: any) {
163166
return `<div>${item.text}</div>`;
164167
},
165168
no_more_results: (): string => {
@@ -186,7 +189,7 @@ export default class extends Controller {
186189
/**
187190
* Returns the element, but only if it's a select element.
188191
*/
189-
get selectElement(): HTMLSelectElement|null {
192+
get selectElement(): HTMLSelectElement | null {
190193
if (!(this.element instanceof HTMLSelectElement)) {
191194
return null;
192195
}
@@ -197,7 +200,7 @@ export default class extends Controller {
197200
/**
198201
* Getter to help typing.
199202
*/
200-
get formElement(): HTMLInputElement|HTMLSelectElement {
203+
get formElement(): HTMLInputElement | HTMLSelectElement {
201204
if (!(this.element instanceof HTMLInputElement) && !(this.element instanceof HTMLSelectElement)) {
202205
throw new Error('Autocomplete Stimulus controller can only be used no an <input> or <select>.');
203206
}

0 commit comments

Comments
 (0)