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

FRONT-2362: Refactor theme and sub-theme to use bcl-builder. #10

Merged
merged 30 commits into from
Aug 11, 2021

Conversation

papegaill
Copy link
Contributor

@papegaill papegaill commented Jul 12, 2021

Jira issue(s):

PR goals:

@brummbar brummbar self-requested a review July 12, 2021 13:11
Copy link
Contributor

@drishu drishu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disclaimer: I haven't double checked all the paths

README.md Show resolved Hide resolved
composer.json Show resolved Hide resolved
includes/page_attachments.inc Outdated Show resolved Hide resolved
includes/page_attachments.inc Show resolved Hide resolved
includes/page_attachments.inc Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
kits/default/package.json Outdated Show resolved Hide resolved
kits/default/README.md Show resolved Hide resolved
@papegaill papegaill requested a review from drishu July 28, 2021 15:09
@papegaill
Copy link
Contributor Author

Many thanks for the review and updates @drishu I updated the PR accordingly.

drishu
drishu previously requested changes Aug 3, 2021
Copy link
Contributor

@drishu drishu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on the whitelabel I noticed one missed point about the disabling of the system style sheets

kits/default/default.info.hidden.yml Outdated Show resolved Hide resolved
kits/default/default.info.hidden.yml Outdated Show resolved Hide resolved
kits/default/default.info.hidden.yml Show resolved Hide resolved
@papegaill
Copy link
Contributor Author

Working on the whitelabel I noticed one missed point about the disabling of the system style sheets

Thanks for the review, PR updated accordingly.

@papegaill papegaill requested a review from drishu August 6, 2021 11:59
base theme: oe_bootstrap_theme
base theme: OE_BOOTSTRAP_THEME_SUBTHEME_MACHINE_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to stay oe_bootstrap_theme as it's the base theme.

Comment on lines 17 to 18
oe_bootstrap_theme/bcl: false
oe_bootstrap_theme/bcl: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we remove the bcl from the original theme? We can keep the original coming from oe_bootstrap_theme, we don't even have to include it in the builder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to keep the default bcl theme, as for most projects this will just be replaced by another project-specific bcl theme. My intention was thus to keep the config of the builder and to just replace the package .. in order to facilitate the setup for the future projects. but I agree it's confusing! it will undoubtedly be necessary to improve the documentation in a second step..

Comment on lines 1 to 8
bcl:
js:
assets/js/oe-bcl-default.bundle.min.js: {}
css:
theme:
assets/css/oe-bcl-default.min.css: {}

custom_style:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written above, we can revert this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above, ok to remove the config from the theme by default ..

Comment on lines 16 to 23
"@openeuropa/bcl-builder": "0.4.0",
"@openeuropa/bcl-theme-default": "0.4.0",
"bootstrap-ie11": "5.0.2",
"chokidar-cli": "1.2.0",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
"glob": "7.1.7",
"npm-run-all": "4.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, keep only the ones needed to compile the theme specific styles.

Comment on lines 21 to 37
copy: [
{
from: ["node_modules/@openeuropa/bcl-theme-default/css/**"],
to: path.resolve(outputFolder, "assets/css"),
options: { up: true },
},
{
from: ["node_modules/@openeuropa/bcl-theme-default/js/**"],
to: path.resolve(outputFolder, "assets/js"),
options: { up: true },
},
{
from: ["node_modules/@openeuropa/bcl-theme-default/icons/bootstrap-icons.svg"],
to: path.resolve(outputFolder, "assets/icons"),
options: { up: true },
},
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This we can drop.

@@ -7,6 +7,7 @@
"prefer-stable": true,
"require": {
"php": ">=7.3",
"drupal/components": "^2.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually don't need this module. Since we are placing the bcl files under the /template/bcl folder, you can access them by doing @oe_bootstrap_theme/bcl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, my bad! I didn't see that, and forgot about oe_theme 😄 I'll create a custom twig loader for this project to expose this namespace. Enabling the whole component module to have just its loader is too much.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the components module handles only namespaces, so it's the correct fit for this. 2x my bad 😄
I'll restore the module.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the commit that was dropping the components module.

Comment on lines -21 to +22
. '<script src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"></script>'
. '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js"></script>'
. '<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'
. '<script>!function () { var e, t; ((e = document.createEvent("CustomEvent")).initEvent("Bootstrap", !0, !0), e.preventDefault(), e.defaultPrevented) || (t = Event.prototype.preventDefault, Event.prototype.preventDefault = function () { this.cancelable && (t.call(this), Object.defineProperty(this, "defaultPrevented", { get: function () { return !0 }, configurable: !0 })) }) }();</script>';
. '<script src="https://cdn.jsdelivr.net/combine/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js,npm/ie11-custom-properties@4,npm/element-qsa-scope@1"></script>'
. '<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=default%2CNumber.parseInt%2CNumber.parseFloat%2CArray.prototype.find%2CArray.prototype.includes"></script>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will rework this in a next iteration.

Comment on lines 16 to 21
"@openeuropa/bcl-builder": "0.4.0",
"chokidar-cli": "1.2.0",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
"glob": "7.1.7",
"npm-run-all": "4.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need also to look at these dependencies, move to chokidar 3.x (I tried locally and it seemed to work), and not lock dependencies to a specific patch if not needed.

@brummbar brummbar dismissed drishu’s stale review August 11, 2021 12:48

Comments adressed

@brummbar brummbar merged commit a19ae7e into 1.x Aug 11, 2021
@brummbar brummbar deleted the FRONT-2362 branch August 11, 2021 12:49
@papegaill papegaill mentioned this pull request Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants