Skip to content

Commit

Permalink
Add webpack and missing datepicker scripts (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed May 8, 2022
1 parent 32a24d3 commit 46f5401
Show file tree
Hide file tree
Showing 154 changed files with 18,624 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .babelrc.js
@@ -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'],
};
41 changes: 41 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,41 @@
/*!
* 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', 'prettier'],
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,
],
},
};
47 changes: 47 additions & 0 deletions .github/workflows/frontend.yaml
@@ -0,0 +1,47 @@
# DO NOT EDIT THIS FILE!
#
# It's auto-generated by sonata-project/dev-kit package.

name: Frontend

on:
schedule:
- cron: '30 0 * * *'
push:
branches:
- 4.x
- 5.x
pull_request:

jobs:
webpack-encore:
name: Webpack Encore

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install NPM dependencies
uses: bahmutov/npm-install@v1

- name: Run Eslint
run: npx eslint assets/js

- name: Run Stylelint
run: npx stylelint assets/scss

- name: Run Prettier
run: npx prettier --check assets

- name: Run Webpack Encore
run: npx encore production

- name: Check if the compilation is up to date
run: git diff --no-patch --exit-code src/**/Resources/public
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,3 +11,4 @@ phpunit.xml
phpstan.neon
/.phpunit.result.cache
/docs/_build/
npm-debug.log
1 change: 1 addition & 0 deletions .prettierignore
@@ -0,0 +1 @@
assets/vendor
27 changes: 27 additions & 0 deletions .stylelintrc.js
@@ -0,0 +1,27 @@
/*!
* 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 = {
customSyntax: 'postcss-scss',
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
plugins: ['stylelint-scss', 'stylelint-order'],
rules: {
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': true,
'order/order': ['custom-properties', 'declarations'],
'order/properties-alphabetical-order': true,
'selector-class-pattern': null,
},
};
23 changes: 23 additions & 0 deletions assets/js/app.js
@@ -0,0 +1,23 @@
/*!
* 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.
*/

// Any SCSS/CSS you require will output into a single css file (app.css in this case)
import '../scss/app.scss';

import moment from 'moment';

// Eonasdan Bootstrap DateTimePicker in its version 3 does not
// provide the scss or plain css, it only provides the less version
// of its source files, that's why it is not included it via npm.
import '../vendor/bootstrap-datetimepicker.min';

// Create global moment variable to be used by the locale script.
// It expects moment to be available on the global scope
// in order to define the requested locale translations
global.moment = moment;
16 changes: 16 additions & 0 deletions assets/scss/app.scss
@@ -0,0 +1,16 @@
/*!
* 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.
*/

// Eonasdan Bootstrap DateTimePicker in its version 3 does not
// provide the scss or plain css, it only provides the less version
// of its source files, that's why it is not included it via npm.
//
// Eonasdan Bootstrap DateTimePicker is not directly used in SonataAdmin
// but it is used on form-extensions package
@import '../vendor/bootstrap-datetimepicker.min.css';
5 changes: 5 additions & 0 deletions assets/vendor/bootstrap-datetimepicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions assets/vendor/bootstrap-datetimepicker.min.js

Large diffs are not rendered by default.

0 comments on commit 46f5401

Please sign in to comment.