Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Prettier
run: |
yarn global add prettier@^2.2.0
~/.yarn/bin/prettier --check src/*/Resources/assets/{src,test}/*.js --config .prettierrc.json
- run: yarn
- run: yarn check-lint
- run: yarn check-format

tests-php-low-deps:
runs-on: ubuntu-latest
Expand Down
7 changes: 0 additions & 7 deletions .prettierrc.json

This file was deleted.

30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ infrastructure.
This problem is not new: it looks a whole lot like the state of Symfony in PHP
before Symfony Flex. We need a Symfony Flex equivalent for JavaScript: a tool to
build amazing User Experiences as quickly as we can now setup
[an HTTP client](https://symfony.com/doc/current/http_client.html),
[a Mailer](https://symfony.com/doc/current/mailer.html) or
[an HTTP client](https://symfony.com/doc/current/http_client.html),
[a Mailer](https://symfony.com/doc/current/mailer.html) or
[an administration panel](https://symfony.com/doc/current/bundles/EasyAdminBundle/index.html).

**That's Symfony UX.**
Expand All @@ -28,24 +28,24 @@ build amazing User Experiences as quickly as we can now setup

# Packages

* [UX Chart.js](https://github.com/symfony/ux-chartjs):
[Chart.js](https://www.chartjs.org/) chart library integration for Symfony
* [UX Cropper.js](https://github.com/symfony/ux-cropperjs):
[Cropper.js](https://fengyuanchen.github.io/cropperjs/) image cropper library integration for Symfony
* [UX Dropzone](https://github.com/symfony/ux-dropzone):
File input drag-and-drop zones for Symfony Forms
* [UX LazyImage](https://github.com/symfony/ux-lazy-image):
Improve image loading performances through lazy-loading and data-uri thumbnails
* [UX Swup](https://github.com/symfony/ux-swup):
[Swup](https://swup.js.org/) page transition library integration for Symfony
- [UX Chart.js](https://github.com/symfony/ux-chartjs):
[Chart.js](https://www.chartjs.org/) chart library integration for Symfony
- [UX Cropper.js](https://github.com/symfony/ux-cropperjs):
[Cropper.js](https://fengyuanchen.github.io/cropperjs/) image cropper library integration for Symfony
- [UX Dropzone](https://github.com/symfony/ux-dropzone):
File input drag-and-drop zones for Symfony Forms
- [UX LazyImage](https://github.com/symfony/ux-lazy-image):
Improve image loading performances through lazy-loading and data-uri thumbnails
- [UX Swup](https://github.com/symfony/ux-swup):
[Swup](https://swup.js.org/) page transition library integration for Symfony

# Let's build an amazing ecosystem together

Symfony UX is an **initiative**: its aim is to build an ecosystem. To achieve this,
we need your help: what other packages could we create in Symfony UX? What about a
library that automatically adds an [input mask](https://imask.js.org/) to the text
we need your help: what other packages could we create in Symfony UX? What about a
library that automatically adds an [input mask](https://imask.js.org/) to the text
fields of your Symfony forms? Or the ability to make the `EntityType` render with
[AJAX auto-completion](https://tarekraafat.github.io/autoComplete.js)? Anything you
[AJAX auto-completion](https://tarekraafat.github.io/autoComplete.js)? Anything you
do in JavaScript could be done streamlined as a UX package.

We have some ideas and we will release more packages in the coming days. The rest
Expand Down
45 changes: 43 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,49 @@
{
"private": true,
"workspaces": ["src/*/Resources/assets"],
"workspaces": [
"src/*/Resources/assets"
],
"scripts": {
"build": "yarn workspaces run build",
"test": "yarn workspaces run test"
"test": "yarn workspaces run test",
"lint": "yarn workspaces run lint --fix",
"format": "prettier src/*/Resources/assets/{src,test}/*.js {,src/*/}*.{json,md} --write",
"check-lint": "yarn lint --no-fix",
"check-format": "yarn format --no-write --check"
},
"devDependencies": {
"@babel/eslint-parser": "^7.12.1",
"eslint": "^7.15.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-jest": "^24.1.3",
"prettier": "^2.2.1"
},
"eslintConfig": {
"root": true,
"parser": "@babel/eslint-parser",
"extends": [
"eslint:recommended",
"prettier"
],
"env": {
"browser": true
},
"overrides": [
{
"files": [
"src/*/Resources/assets/test/*.js"
],
"extends": [
"plugin:jest/recommended"
]
}
]
},
"prettier": {
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 4,
"jsxBracketSameLine": true,
"singleQuote": true
}
}
8 changes: 6 additions & 2 deletions src/Chartjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ export default class extends Controller {
console.log(event.detail.chart); // You can access the chart instance using the event details

// For instance you can listen to additional events
event.detail.chart.options.onHover = (mouseEvent) => { /* ... */ };
event.detail.chart.options.onClick = (mouseEvent) => { /* ... */ };
event.detail.chart.options.onHover = (mouseEvent) => {
/* ... */
};
event.detail.chart.options.onClick = (mouseEvent) => {
/* ... */
};
}
}
```
Expand Down
3 changes: 2 additions & 1 deletion src/Chartjs/Resources/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"scripts": {
"build": "babel src -d dist",
"test": "babel src -d dist && jest"
"test": "babel src -d dist && jest",
"lint": "eslint src test"
},
"dependencies": {
"chart.js": "^2.9.4"
Expand Down
8 changes: 7 additions & 1 deletion src/Chartjs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"name": "symfony/ux-chartjs",
"type": "symfony-bundle",
"description": "Chart.js integration for Symfony",
"keywords": ["symfony", "ux", "chart", "chart.js", "chartjs"],
"keywords": [
"symfony",
"ux",
"chart",
"chart.js",
"chartjs"
],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
Expand Down
3 changes: 2 additions & 1 deletion src/Cropperjs/Resources/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"scripts": {
"build": "babel src -d dist",
"test": "babel src -d dist && jest"
"test": "babel src -d dist && jest",
"lint": "eslint src test"
},
"dependencies": {
"cropperjs": "^1.5.9"
Expand Down
8 changes: 7 additions & 1 deletion src/Cropperjs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"name": "symfony/ux-cropperjs",
"type": "symfony-bundle",
"description": "Cropper.js integration for Symfony",
"keywords": ["symfony", "ux", "cropper", "cropper.js", "cropperjs"],
"keywords": [
"symfony",
"ux",
"cropper",
"cropper.js",
"cropperjs"
],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion src/Dropzone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ the `@symfony/ux-dropzone/src/style.css` autoimport to `false`:
}
```

> *Note*: you should put the value to `false` and not remove the line so that Symfony Flex
> _Note_: you should put the value to `false` and not remove the line so that Symfony Flex
> won't try to add the line again in the future.

Once done, the default stylesheet won't be used anymore and you can implement your own CSS on
Expand Down
3 changes: 2 additions & 1 deletion src/Dropzone/Resources/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"scripts": {
"build": "babel src -d dist",
"test": "babel src -d dist && jest"
"test": "babel src -d dist && jest",
"lint": "eslint src test"
},
"peerDependencies": {
"stimulus": "^2.0.0"
Expand Down
6 changes: 5 additions & 1 deletion src/Dropzone/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "symfony/ux-dropzone",
"type": "symfony-bundle",
"description": "File input dropzones for Symfony Forms",
"keywords": ["symfony", "ux", "dropzone"],
"keywords": [
"symfony",
"ux",
"dropzone"
],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
Expand Down
10 changes: 5 additions & 5 deletions src/LazyImage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ image loading performance. It is part of [the Symfony UX initiative](https://sym

It provides two key features:

* a Stimulus controller to load lazily heavy images, with a placeholder
* a [BlurHash implementation](https://blurha.sh/) to create data-uri thumbnails for images
- a Stimulus controller to load lazily heavy images, with a placeholder
- a [BlurHash implementation](https://blurha.sh/) to create data-uri thumbnails for images

## Installation

Expand Down Expand Up @@ -57,9 +57,9 @@ the BlurHash algorithm to create a light, blurred, data-uri thumbnail of the ima

The `data_uri_thumbnail` function receives 3 arguments:

* the server path to the image to generate the data-uri thumbnail for ;
* the width of the BlurHash to generate
* the height of the BlurHash to generate
- the server path to the image to generate the data-uri thumbnail for ;
- the width of the BlurHash to generate
- the height of the BlurHash to generate

You should try to generate small BlurHash images as generating the image can be CPU-intensive.
Instead, you can rely on the browser scaling abilities by generating a small image and using the
Expand Down
3 changes: 2 additions & 1 deletion src/LazyImage/Resources/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"scripts": {
"build": "babel src -d dist",
"test": "babel src -d dist && jest"
"test": "babel src -d dist && jest",
"lint": "eslint src test"
},
"peerDependencies": {
"stimulus": "^2.0.0"
Expand Down
6 changes: 5 additions & 1 deletion src/LazyImage/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "symfony/ux-lazy-image",
"type": "symfony-bundle",
"description": "Lazy image loader and utilities for Symfony",
"keywords": ["symfony", "ux", "dropzone"],
"keywords": [
"symfony",
"ux",
"dropzone"
],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
Expand Down
3 changes: 2 additions & 1 deletion src/Swup/Resources/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"scripts": {
"build": "babel src -d dist",
"test": "babel src -d dist && jest"
"test": "babel src -d dist && jest",
"lint": "eslint src test"
},
"dependencies": {
"@swup/fade-theme": "^1.0",
Expand Down
6 changes: 5 additions & 1 deletion src/Swup/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "symfony/ux-swup",
"type": "symfony-bundle",
"description": "Swup integration for Symfony",
"keywords": ["symfony", "ux", "swup"],
"keywords": [
"symfony",
"ux",
"swup"
],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
Expand Down