Skip to content
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

DEP Upgrade frontend build stack #59

Merged
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{*.yml,package.json,*.js}]
[{*.yml,package.json,*.js,*.scss}]
indent_size = 2

# The indent size used in the package.json file cannot be changed:
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@silverstripe/eslint-config/.eslintrc');
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/
node_modules/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
6 changes: 6 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
1 change: 1 addition & 0 deletions client/dist/styles/sitewidecontentreport.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gridfieldbasiccontentreport.field{border-bottom:1px solid #d2d5d8;margin:24px 0}.gridfieldbasiccontentreport.field:last-of-type{border-bottom-style:none}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.gridfieldbasiccontentreport.field {
border-bottom: 1px solid #D2D5D8;
margin: 24px 0;
border-bottom: 1px solid #D2D5D8;
margin: 24px 0;
}

.gridfieldbasiccontentreport.field:last-of-type {
border-bottom-style: none;
}
border-bottom-style: none;
}
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
],
"extra": {
"expose": [
"javascript",
"css"
"client/dist"
]
},
"autoload": {
Expand Down
24 changes: 0 additions & 24 deletions javascript/sitewidecontentreport.js

This file was deleted.

28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "silverstripe-sitewidecontent-report",
"license": "BSD-3-Clause",
"author": "SilverStripe Ltd",
"engines": {
"node": ">=18.x"
},
"scripts": {
"build": "yarn && yarn lint && rm -rf client/dist/* && NODE_ENV=production webpack --mode production --bail --progress",
"dev": "NODE_ENV=development webpack --progress",
"watch": "NODE_ENV=development webpack --watch --progress",
"lint": "sass-lint client/src/styles"
},
"dependencies": {
},
"devDependencies": {
"@silverstripe/eslint-config": "^1.0.0-alpha6",
"@silverstripe/webpack-config": "^2.0.0-alpha5",
"webpack": "^5.74.0",
"webpack-cli": "^5.0.0"
},
"resolutions": {
"colors": "1.4.0"
},
"browserslist": [
"defaults"
]
}
2 changes: 1 addition & 1 deletion src/SitewideContentReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function columns($itemType = 'Pages')
*/
public function getCMSFields()
{
Requirements::css('silverstripe/sitewidecontent-report: css/sitewidecontentreport.css');
Requirements::css('silverstripe/sitewidecontent-report: client/dist/styles/sitewidecontentreport.css');
$fields = parent::getCMSFields();

$fields->push(HeaderField::create('FilesTitle', _t(__CLASS__ . '.Files', 'Files'), 3));
Expand Down
19 changes: 19 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const Path = require('path');
const { CssWebpackConfig } = require('@silverstripe/webpack-config');

const PATHS = {
ROOT: Path.resolve(),
SRC: Path.resolve('client/src'),
DIST: Path.resolve('client/dist'),
};

const config = [
// sass to css
new CssWebpackConfig('css', PATHS)
.setEntry({
sitewidecontentreport: `${PATHS.SRC}/styles/sitewidecontentreport.scss`,
})
.getConfig(),
];

module.exports = config;
Loading