-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default configuration when using assets #1505
Merged
OskarStark
merged 7 commits into
sonata-project:master
from
jordisala1991:feature/assets
May 2, 2021
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
300c2ec
Add default configuration when using assets
jordisala1991 8cc0591
Avoid deprecations with faker
jordisala1991 860b1cd
Rename assets for frontend and usesAssets for hasFrontend
jordisala1991 78ee35e
Change json files for js files to add needed headers
jordisala1991 582d5be
Add missing postcss config
jordisala1991 6f312aa
Fix missing rename to frontend
jordisala1991 86588cd
Refactor on remove files
jordisala1991 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/*! | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/* | ||
* DO NOT EDIT THIS FILE! | ||
* | ||
* It's auto-generated by sonata-project/dev-kit package. | ||
*/ | ||
|
||
module.exports = { | ||
presets: ['@babel/preset-env'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*! | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/* | ||
* DO NOT EDIT THIS FILE! | ||
* | ||
* It's auto-generated by sonata-project/dev-kit package. | ||
*/ | ||
|
||
module.exports = { | ||
parser: '@babel/eslint-parser', | ||
extends: ['airbnb-base'], | ||
env: { | ||
browser: true, | ||
jquery: true, | ||
}, | ||
plugins: ['header'], | ||
rules: { | ||
'header/header': [2, 'block', [ | ||
'!', | ||
' * This file is part of the Sonata Project package.', | ||
' *', | ||
' * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>', | ||
' *', | ||
' * For the full copyright and license information, please view the LICENSE', | ||
' * file that was distributed with this source code.', | ||
' ', | ||
], 2], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# DO NOT EDIT THIS FILE! | ||
# | ||
# It's auto-generated by sonata-project/dev-kit package. | ||
|
||
name: Frontend | ||
|
||
on: | ||
push: | ||
branches: | ||
{% for branch in project.branchesReverse|filter(branch => branch.hasFrontend) %} | ||
- {{ branch.name }} | ||
{% endfor %} | ||
paths: | ||
- assets/** | ||
- webpack.config.js | ||
- package.json | ||
- yarn.lock | ||
- .babelrc.js | ||
- .eslintrc.js | ||
- .stylelintrc.js | ||
- postcss.config.js | ||
pull_request: | ||
paths: | ||
- assets/** | ||
- webpack.config.js | ||
- package.json | ||
- yarn.lock | ||
- .babelrc.js | ||
- .eslintrc.js | ||
- .stylelintrc.js | ||
- postcss.config.js | ||
|
||
jobs: | ||
webpack-encore: | ||
name: Webpack Encore | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Node 14 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Install NPM dependencies | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Run Eslint | ||
run: yarn run eslint assets/js | ||
|
||
- name: Run Stylelint | ||
run: yarn run stylelint assets/scss | ||
|
||
- name: Run Webpack Encore | ||
run: yarn encore production |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some option like panther, phpstan, psalm are on the global level, and some options like php are in the branches level. Some option like custom_gitignore_part are now on both.
It seems weird to have some github related workflow
phpstan
on the global level but notfrontend
.I understand why you did this but we should have the same strategy for every option IMHO.
Should we
Also if I use
custom_gitignore_part
on the branch level I would have expect to override the project level.So I would have not expect the code
But only a check on
branch.customGitignorePart
with a getter returningproject.customGitignorePart
by default if the branch level option is not set.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should introduce options as we need them, to avoid implementing things just for having them. Remember this code is not intended to be public used, just internal tool for sonata.
And about what happens if you define at branch level and at root level, I think it should take precedence the branch over the project configuration, I thought I have done that part right, the if will check first for branch config, and then for project config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes indeed, it's an
elseif
.