Skip to content

Commit f811b6f

Browse files
committed
Update dependencies
1 parent f414ff7 commit f811b6f

7 files changed

+3204
-10478
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![StyleCI][styleci-badge]][styleci]
1111

1212
[kofi]: https://ko-fi.com/A7052ICP
13-
[kofi-badge]: https://img.shields.io/badge/Donate-Buy%20Me%20a%20Coffee-blue.svg
13+
[kofi-badge]: https://img.shields.io/badge/Donate-Buy%20Me%20a%20Coffee-blue?logo=ko-fi&logoColor=white
1414
[releases]: https://github.com/lcharette/UF_FormGenerator/releases
1515
[releases-badge]: https://img.shields.io/github/release/lcharette/UF_FormGenerator.svg
1616
[uf-version]: https://img.shields.io/badge/UserFrosting->=%205.0-brightgreen.svg
@@ -50,16 +50,16 @@ If you need help using this sprinkle or found any bug, feels free to open an iss
5050
composer require lcharette/uf_formgenerator "^5.0"
5151
```
5252
53-
2. Add `UserFrosting\Sprinkle\FormGenerator\FormGenerator` to your Sprinkle Recipe.
53+
2. Add `UserFrosting\Sprinkle\FormGenerator\FormGenerator` to your Sprinkle Recipe sprinkle method.
5454
5555
3. To use the frontend helper, first install the npm dependency:
5656
```
57-
npm install https://github.com/lcharette/UF_FormGenerator#5.0
57+
npm install --save @lcharette/formgenerator
5858
```
5959
60-
4. Then add this entry to your `webpack.config.js` :
60+
4. Then add this entry to your `webpack.config.js`, in the `sprinkles` list :
6161
```js
62-
.addEntry('widget.formGenerator', './node_modules/formgenerator/app/assets/js/widget-formGenerator.js')
62+
FormGenerator: require('@lcharette/formgenerator/webpack.entries'),
6363
```
6464
6565
5. Each template file where you want to use the frontend helper, add this line to `{% block scripts_page %}`:
@@ -69,7 +69,7 @@ If you need help using this sprinkle or found any bug, feels free to open an iss
6969
7070
6. Run `php bakery bake` to finish installation of the sprinkle.
7171
72-
Alternatively, you can add `./node_modules/formgenerator/app/assets/js/widget-formGenerator.js` globally in your app main js file.
72+
Alternatively, you can add `@lcharette/formgenerator/app/assets/js/widget-formGenerator.js` globally in your app main js file.
7373
7474
# Working example
7575

composer.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
],
1414
"require": {
1515
"php": "^8.0",
16-
"userfrosting/framework": "^5.0.0@alpha",
17-
"userfrosting/sprinkle-core": "^5.0.0@alpha"
16+
"userfrosting/framework": "^5.0",
17+
"userfrosting/sprinkle-core": "^5.0"
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3.0",
@@ -27,8 +27,6 @@
2727
"league/factory-muffin-faker": "^2.0",
2828
"userfrosting/theme-adminlte": "^5.0"
2929
},
30-
"minimum-stability": "dev",
31-
"prefer-stable": true,
3230
"autoload": {
3331
"psr-4": {
3432
"UserFrosting\\Sprinkle\\FormGenerator\\": "app/src/"

package-lock.json

+3,154-10,459
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
{
2-
"name": "formgenerator",
3-
"license": "MIT",
2+
"name": "@lcharette/formgenerator",
43
"version": "5.0.0",
54
"description": "Form Generator Sprinkle for UserFrosting 5",
5+
"funding": "https://ko-fi.com/lcharette",
6+
"license": "MIT",
7+
"author": "Louis Charette (https://bbqsoftwares.com/)",
8+
"keywords": [
9+
"UserFrosting",
10+
"Sprinkle",
11+
"form"
12+
],
13+
"homepage": "https://github.com/lcharette/UF_FormGenerator#readme",
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/lcharette/UF_FormGenerator.git"
17+
},
18+
"bugs": {
19+
"url": "https://github.com/lcharette/UF_FormGenerator/issues"
20+
},
621
"dependencies": {
7-
"theme-adminlte": "github:userfrosting/theme-adminlte"
22+
"@userfrosting/theme-adminlte": "^5.0"
823
},
924
"devDependencies": {
10-
"@symfony/webpack-encore": "^1.7.0",
11-
"sass": "^1.58.1",
12-
"sass-loader": "^10.0",
25+
"@symfony/webpack-encore": "^4.4.0",
26+
"sass": "^1.51.0",
1327
"webpack-notifier": "^1.14.1"
1428
},
1529
"scripts": {

public/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ------ Import Base Theme ------
2-
require('theme-adminlte');
2+
require('@userfrosting/theme-adminlte');
33

44
// ------ Custom Code ------
55
// Add you own code below

webpack.config.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@ if (!Encore.isRuntimeEnvironmentConfigured()) {
66
Encore.configureRuntimeEnvironment(process.env.UF_MODE || 'dev');
77
}
88

9+
// List dependent sprinkles and local entries files
10+
const sprinkles = {
11+
AdminLTE: require('@userfrosting/theme-adminlte/webpack.entries'),
12+
FormGenerator: require('./webpack.entries'),
13+
APP: {
14+
'app': './public/app.js',
15+
}
16+
}
17+
18+
// Merge dependent Sprinkles entries with local entries
19+
let entries = {}
20+
Object.values(sprinkles).forEach(sprinkle => {
21+
entries = Object.assign(entries, sprinkle);
22+
});
23+
924
Encore
1025
.setOutputPath('public/assets')
1126
.setPublicPath('/assets/')
12-
.addEntry('app', './public/app.js')
13-
.addEntry('widget.formGenerator', './app/assets/js/widget-formGenerator.js')
27+
.addEntries(entries)
1428
.splitEntryChunks()
1529
.enableSingleRuntimeChunk()
1630
.cleanupOutputBeforeBuild()

webpack.entries.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
'widget.formGenerator': path.resolve(__dirname, './app/assets/js/widget-formGenerator.js'),
5+
}

0 commit comments

Comments
 (0)